You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cf2bf68
Browse filesBrowse the repository at this point in the historyBrowse files
# Spec 004: Role, title, and description of each spec source
8
8
9
9
## Summary
10
-
This spec changes the spec capture of [Spec 002](002-session-spec-capture.md) and [Spec 003](003-spec-capture-during-session.md). It does not replace them. Today each spec source has a kind: ticket, document, image, or text. The kind tells the format of a source, but not its purpose. A source also has no name that a person can read. With this change, the agent can also record a roleand a title for each source. The role is `task`, `spec`, `plan`, or `reference`. The title is a short name, for example the title of a ticket. The CLI stores both in the session material and in the annotations of the spec material. A tool that shows the sources can then group them by purpose and label them by title.
10
+
This spec changes the spec capture of [Spec 002](002-session-spec-capture.md) and [Spec 003](003-spec-capture-during-session.md). It does not replace them. Today each spec source has a kind: ticket, document, image, or text. The kind tells the format of a source, but not its purpose. A source also has no name that a person can read. With this change, the agent can also record a role, a title, and a description for each source. The role is `task`, `spec`, `plan`, or `reference`. The title is a short name, for example the title of a ticket. The description says in one or two sentences what the source holds. The CLI stores these values in the session material and in the annotations of the spec material. A tool that shows the sources can then group them by purpose, label them by title, and explain each one.
11
11
12
12
## Problem
13
13
- A reader of the evidence cannot tell a spec from a background document. Both have the kind `document`.
@@ -18,13 +18,13 @@ This spec changes the spec capture of [Spec 002](002-session-spec-capture.md) an
18
18
- An image or another binary file has no header, so the agent cannot record anything about it.
19
19
20
20
## Goals and Non-Goals
21
-
- Goal: each spec source can carry its purposeand a short title, as the agent decides them.
22
-
- Goal: the evidence holds the role and the title next to the kind, in the spec entry and in the material annotations.
23
-
- Goal: the agent can give a role and a title to a binary file too.
24
-
- Goal: sessions without roles or titles stay valid, and earlier consumers keep working.
21
+
- Goal: each spec source can carry its purpose, a short title, and a short description, as the agent decides them.
22
+
- Goal: the evidence holds these values next to the kind, in the spec entry and in the material annotations.
23
+
- Goal: the agent can give these values to a binary file too.
24
+
- Goal: sessions without these values stay valid, and earlier consumers keep working.
25
25
- Non-goal: a change to the kinds, or to how the CLI finds the kind.
26
-
- Non-goal: rules in the CLI that guess a roleor a title. The agent decides them, as it decides what a spec is (D-001 of Spec 002).
27
-
- Non-goal: a source address or other metadata for binary files. Only the roleand the title are new.
26
+
- Non-goal: rules in the CLI that guess a role, a title, or a description. The agent decides them, as it decides what a spec is (D-001 of Spec 002).
27
+
- Non-goal: a source address or other metadata for binary files. Only the role, the title, and the description are new.
28
28
- Non-goal: a change to the reminder at each user turn of Spec 003.
29
29
30
30
## Requirements
@@ -40,7 +40,7 @@ A spec source MAY have one role. The roles are:
40
40
The header of a text spec file MAY hold a `role` field. The CLI MUST read it with no regard to letter case.
41
41
42
42
### R-003: Role of a binary file
43
-
For an image or another binary file, the agent MAY write a companion file. Its name is the name of the binary file plus `.meta.yaml`. It holds a `role` field and a `title` field. The CLI MUST apply those values to the binary file. The CLI MUST NOT store the companion file as a spec material of its own. The CLI MUST ignore a companion file with no binary file next to it.
43
+
For an image or another binary file, the agent MAY write a companion file. Its name is the name of the binary file plus `.meta.yaml`. It holds the fields `role`, `title`, and `description`. The CLI MUST apply those values to the binary file. The CLI MUST NOT store the companion file as a spec material of its own. The CLI MUST ignore a companion file with no binary file next to it.
44
44
- Done when: the agent copies a screenshot and writes its companion file with `role: reference`. The push records one image material with the role `reference`, and no material for the companion file.
45
45
46
46
### R-004: Role in the evidence
@@ -51,7 +51,7 @@ A role that is missing, empty, or not in the vocabulary MUST give no role. The s
51
51
- Done when: a header with `role: design` pushes a spec material with no role annotation, and the push succeeds.
52
52
53
53
### R-006: Capture instruction
54
-
The capture instruction at session start SHOULD ask the agent to set the roleand the title of each source. It SHOULD give one short line for each role. It SHOULD tell the agent how to give a role and a title to a binary file.
54
+
The capture instruction at session start SHOULD ask the agent to set the role, the title, and the description of each source. It SHOULD give one short line for each role. It SHOULD tell the agent how to give these values to a binary file.
55
55
56
56
### R-007: Title
57
57
The header of a text spec file, and the companion file of a binary file, MAY hold a `title` field. When a source has a title, the system MUST record it in the spec entry of the session material. It MUST also record it in a `chainloop.spec.title` annotation on the spec material. When the title is missing or empty, the system MUST leave out both. The system MUST NOT make a title from the content or from the file name.
@@ -60,6 +60,9 @@ The header of a text spec file, and the companion file of a binary file, MAY hol
60
60
### R-008: Title limits
61
61
The system MUST cut a title that is longer than 120 characters, and keep the first 120. Each title MUST pass the secret redaction of Spec 002 before it goes into any evidence field. For a text file, the system MUST read the title from the redacted file, as it reads the source address. For a binary file, the system MUST redact the title of the companion file. A bad title MUST NOT stop the push.
62
62
63
+
### R-009: Description
64
+
The header of a text spec file, and the companion file of a binary file, MAY hold a `description` field. It says in one or two sentences what the source holds, or why it is in the session. When a source has a description, the system MUST record it in the spec entry of the session material. It MUST also record it in a `chainloop.spec.description` annotation on the spec material. When the description is missing or empty, the system MUST leave out both. The system MUST NOT make a description from the content. The rules of R-008 apply, with a limit of 300 characters.
65
+
63
66
## Constraints
64
67
- The repository is public. The instruction text and the format are visible to all users.
65
68
- The change to the evidence is additive. A consumer that does not know the role or the title MUST still read the spec entries and materials.
@@ -76,6 +79,7 @@ kind: ticket
76
79
uri: https://tracker.example.com/issue/ENG-1234
77
80
role: task
78
81
title: "ENG-1234: Add an export button"
82
+
description: The ticket that the session implements. It asks for a CSV export on the report page.
79
83
---
80
84
81
85
# ENG-1234: Add an export button
@@ -92,13 +96,15 @@ spec folder
92
96
├── export-mockup.png image, stored as it is
93
97
└── export-mockup.png.meta.yaml role: reference
94
98
title: Export button mockup
99
+
description: Where the button goes.
95
100
```
96
101
97
102
At push time, the CLI reads the role and the title as it reads the kind and the source address. It normalizes the role, and it drops a role that is not in the vocabulary. It cuts a long title. It applies the values of a companion file to its binary file, after it redacts the title, and it does not upload the companion file. The spec entry and the material annotations then hold the role and the title:
@@ -136,6 +142,7 @@ A tool that shows the sources groups them by role when a source has one, and lab
136
142
| D-008 | Name of a source | An optional title that the agent writes, next to the role | The agent knows the title of the source when it writes the file. The format already changes for the role, so a second field costs little. A tool can label a source from the session material alone. Rejected: the material name only (a short lower-case file stem). Rejected: a title that the CLI takes from the first heading (a guess that looks like a fact in the evidence). This changes the outcome of [#3528](https://github.com/chainloop-dev/chainloop/issues/3528), which closed a title field before the format had other changes. | drafting |
137
143
| D-009 | Where the title goes | The spec entry and a `chainloop.spec.title` annotation, as for the role | A tool that reads only one material can label it. Rejected: the spec entry only. | drafting |
138
144
| D-010 | Long title | Cut at 120 characters, and keep the first part | A model sometimes writes a full paragraph. A cut keeps a usable label. Rejected: drop a long title (the source loses its label). Rejected: no limit (long annotations and labels). | drafting |
145
+
| D-011 | Description of a source | An optional description of one or two sentences, with the rules of the title and a limit of 300 characters | A reviewer sees why a source is in the session before opening it. Rejected: no description, because the content is the description (a reviewer must open each source to know what it is). |[PR comment](https://github.com/chainloop-dev/chainloop/pull/3532#discussion_r4195022169)|
0 commit comments