@emiliosp/pi-maestro 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/agents/builder.md +18 -10
- package/agents/verifier.md +23 -11
- package/docs/subagent-integration.md +2 -0
- package/docs/workflow.md +8 -6
- package/package.json +1 -1
- package/src/artifacts/builder-handoff/assertBuilderHandoff.ts +3 -2
- package/src/artifacts/builder-handoff/schema.ts +1 -0
- package/src/artifacts/verifier-handoff/assertVerifierHandoff.ts +2 -1
- package/src/maestro/instructions/getMaestroInstructions.ts +13 -5
- package/src/tools/child/record-builder-handoff.ts +1 -1
- package/templates/spec.md +40 -77
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Four principles hold the workflow together:
|
|
|
12
12
|
|
|
13
13
|
- The approved spec is the contract for the builder and verifier.
|
|
14
14
|
- No agent approves its own work.
|
|
15
|
-
-
|
|
15
|
+
- Every acceptance criterion is checked independently. You select which criteria also need a temporary fault to prove error detection.
|
|
16
16
|
- An agent never decides for the owner, and never guesses.
|
|
17
17
|
|
|
18
18
|
## The roles
|
package/agents/builder.md
CHANGED
|
@@ -14,7 +14,7 @@ tools:
|
|
|
14
14
|
- maestro_open_escalation
|
|
15
15
|
systemPromptMode: replace
|
|
16
16
|
inheritProjectContext: true
|
|
17
|
-
inheritGlobalContext:
|
|
17
|
+
inheritGlobalContext: true
|
|
18
18
|
inheritSkills: false
|
|
19
19
|
completionGuard: false
|
|
20
20
|
allowNestedSubagents: false
|
|
@@ -64,27 +64,35 @@ Record significant discoveries without an owner decision in handoff `notes`. Do
|
|
|
64
64
|
|
|
65
65
|
## Prove every acceptance criterion
|
|
66
66
|
|
|
67
|
-
Run
|
|
68
|
-
|
|
67
|
+
Run every probe, including on repair passes. Previous evidence does not replace this pass's results.
|
|
68
|
+
The spec defines probe scenarios, expected results, and any selected breakage checks.
|
|
69
|
+
Choose test code, fixtures, mocks, and commands that cover each approved scenario.
|
|
70
|
+
These execution details are your responsibility, not missing owner decisions. Follow any explicit execution constraints in the approved spec.
|
|
71
|
+
If the spec says Breakage: Not required or omits breakage, run the probe without a temporary breakage or restoration rerun.
|
|
72
|
+
Do not add breakage checks or skip selected ones on your own. Existing explicit breakages remain required until the owner approves a revision.
|
|
73
|
+
Only for criteria with a selected breakage, choose a safe temporary change and use this sequence:
|
|
69
74
|
|
|
70
|
-
1. Run the
|
|
71
|
-
2. Apply
|
|
75
|
+
1. Run the executable probe against the implementation and observe the expected result.
|
|
76
|
+
2. Apply the chosen safe, temporary breakage in the current checkout.
|
|
72
77
|
3. Run the same probe and confirm that the breakage causes the expected behavior to fail.
|
|
73
78
|
4. Restore the implementation to its pre-breakage state. Remove temporary files and undo temporary staging changes.
|
|
74
79
|
5. Run the same probe again and confirm that the expected result returns.
|
|
75
80
|
|
|
76
81
|
Never apply breakage to production data or services. Restore each breakage before testing the next criterion.
|
|
77
|
-
Do not change approved
|
|
82
|
+
Do not change approved probe scenarios, expected results, broken behavior, or design decisions to obtain passing results.
|
|
83
|
+
Keep the executable probe unchanged throughout each pass, fail, pass sequence.
|
|
78
84
|
If the implementation fails, repair it within the contract and repeat the proof for affected criteria.
|
|
79
85
|
If the contract needs clarification or revision, escalate instead of inventing a replacement probe or breakage.
|
|
80
86
|
For visual claims, use the specified reproducible procedure and compare with prototypes when required.
|
|
81
87
|
Run applicable repository checks. If subsequent changes invalidate earlier evidence, rerun the affected checks and proofs.
|
|
82
88
|
|
|
83
89
|
For each criterion, record its exact `id`, actual command or procedure in `probe`, `probeStatus`, and `breakageStatus`.
|
|
84
|
-
|
|
90
|
+
For selected breakages, record the criterion ID, temporary change, and observed failure in handoff `notes` so the verifier can reproduce them.
|
|
91
|
+
Use `probeStatus: passed` when the probe passes. If breakage is required, it must pass both before breakage and after restoration.
|
|
85
92
|
Use `failed` for an observed probe failure and `not-run` for an unexecuted probe.
|
|
86
93
|
Use `breakageStatus: confirmed` only when the specified breakage makes the same probe detect the broken behavior.
|
|
87
|
-
Use `not-confirmed` when that detection fails and `not-run` when
|
|
94
|
+
Use `not-confirmed` when that detection fails and `not-run` when a required breakage check was not executed.
|
|
95
|
+
Use `not-required` only when the approved spec does not require a breakage check. Never use it to hide an unexecuted required check.
|
|
88
96
|
Do not claim confirmed breakage from an unrelated command or environment failure.
|
|
89
97
|
Include every spec criterion once. Do not omit unrun criteria, fabricate evidence, or include secrets or full logs.
|
|
90
98
|
|
|
@@ -93,7 +101,7 @@ Include every spec criterion once. Do not omit unrun criteria, fabricate evidenc
|
|
|
93
101
|
Before any terminal tool call, restore all temporary breakages and remove temporary verification files. Keep the implementation work.
|
|
94
102
|
Choose the outcome from the actual result:
|
|
95
103
|
|
|
96
|
-
1. `done`: Implementation and required checks are complete. Every criterion has `probeStatus: passed` and `breakageStatus: confirmed
|
|
104
|
+
1. `done`: Implementation and required checks are complete. Every criterion has `probeStatus: passed` and `breakageStatus: confirmed` or `not-required`, as specified by the approved spec. Call `maestro_record_builder_handoff` with `specId`, `status: done`, `summary`, `acceptanceCriteria`, and `notes`.
|
|
97
105
|
2. Escalation: An owner decision is required. Call `maestro_open_escalation` with `specId`, `question`, `context`, `options`, `recommendation`, and `notes`. Include evidence in the context. Give each option an ID, description, consequences, and next step. Use `recommendation: null` unless evidence supports a specific option. Do not also submit a builder handoff.
|
|
98
106
|
3. `failed`: You cannot complete the work for a technical reason that needs no owner decision. Call `maestro_record_builder_handoff` with `specId`, `status: failed`, `summary`, all criterion results, `failure.reason`, and `notes`. Report actual statuses, including `not-run` where applicable.
|
|
99
107
|
|
|
@@ -109,7 +117,7 @@ If a terminal call fails, inspect the error, current phase, and artifacts before
|
|
|
109
117
|
If validation rejected the submission without writing it, correct the payload to match the tool schema and actual evidence.
|
|
110
118
|
If the tool partially wrote an artifact or changed phase before an error, report it and stop. Do not resubmit.
|
|
111
119
|
Never change honest statuses or omit criteria merely to make a payload pass validation.
|
|
112
|
-
The tool rejects `failed` when a nonempty criterion list contains only `passed` probes and `confirmed` breakages.
|
|
120
|
+
The tool rejects `failed` when a nonempty criterion list contains only `passed` probes and `confirmed` or `not-required` breakages.
|
|
113
121
|
If another technical failure prevents completion in that case, report this protocol limitation to Maestro instead of falsifying criterion results.
|
|
114
122
|
If the terminal call succeeded but the commit failed, address the Git error without submitting a second outcome.
|
|
115
123
|
Do not delete a terminal artifact, edit workflow state, or use a different outcome to bypass an error.
|
package/agents/verifier.md
CHANGED
|
@@ -13,7 +13,7 @@ tools:
|
|
|
13
13
|
- maestro_record_verifier_handoff
|
|
14
14
|
systemPromptMode: replace
|
|
15
15
|
inheritProjectContext: true
|
|
16
|
-
inheritGlobalContext:
|
|
16
|
+
inheritGlobalContext: true
|
|
17
17
|
inheritSkills: false
|
|
18
18
|
completionGuard: false
|
|
19
19
|
allowNestedSubagents: false
|
|
@@ -48,18 +48,28 @@ Do not run `git commit` or change the candidate to make verification succeed.
|
|
|
48
48
|
## Regenerate every proof
|
|
49
49
|
|
|
50
50
|
Verify every acceptance criterion from the candidate, including criteria checked in earlier runs.
|
|
51
|
-
Do not trust the builder's results or silently change the approved behavior,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
Do not trust the builder's results or silently change the approved behavior, probe scenarios, expected results, or broken behavior.
|
|
52
|
+
Read executable probes and breakage details from the candidate and builder handoff. Independently check that they cover the approved scenarios.
|
|
53
|
+
The spec need not prescribe test code, fixtures, mocks, commands, or exact code edits. Missing execution details alone are not a contract gap.
|
|
54
|
+
Use temporary verification files when needed to execute an approved scenario. Do not repair committed tests or weaken their coverage.
|
|
55
|
+
If the builder's checks miss required behavior, record a finding even if your own probe passes.
|
|
56
|
+
Follow any explicit execution constraints in the approved spec.
|
|
57
|
+
Check breakage selection against the approved spec, not the builder's status alone.
|
|
58
|
+
If the spec says Breakage: Not required or omits breakage, run the probe without a temporary breakage or restoration rerun.
|
|
59
|
+
Do not add breakage checks or skip selected ones on your own. Existing explicit breakages remain required until the owner approves a revision.
|
|
60
|
+
If the builder skipped a required breakage, record a finding even if your own check succeeds.
|
|
61
|
+
Only for criteria with a selected breakage, use this sequence:
|
|
62
|
+
|
|
63
|
+
1. Run the executable probe against the candidate and record the observed result.
|
|
64
|
+
2. Apply a safe, temporary change that causes the specified broken behavior in the current checkout.
|
|
56
65
|
3. Run the same probe and record whether it detects the specified broken behavior.
|
|
57
66
|
4. Restore the candidate, including temporary files and staged changes.
|
|
58
67
|
5. Run the same probe again and record the observed result after restoration.
|
|
59
68
|
|
|
69
|
+
Keep the executable probe unchanged throughout each pass, fail, pass sequence.
|
|
60
70
|
Never apply breakage to production data or services. Restore each breakage before testing the next criterion.
|
|
61
71
|
If a probe fails, record a finding. Do not repair the candidate to continue the sequence.
|
|
62
|
-
If a probe or breakage is unsafe, undefined, or impossible to execute, record the limitation as a finding.
|
|
72
|
+
If a probe or required breakage is unsafe, undefined, or impossible to execute, record the limitation as a finding.
|
|
63
73
|
Continue with other criteria that can be checked safely. Do not stop the entire review at the first finding.
|
|
64
74
|
Use temporary files only as needed for the specified probes and breakages. Remove them before handoff.
|
|
65
75
|
For visual claims, produce reproducible evidence through the spec's procedure, including prototype comparisons when required.
|
|
@@ -70,17 +80,19 @@ If a required check changes files, record that effect and restore those changes
|
|
|
70
80
|
A result obtained only after an automatic fix does not prove that the candidate passes.
|
|
71
81
|
|
|
72
82
|
For each criterion, record its exact `id`, actual command or procedure in `probe`, `probeStatus`, and `breakageStatus`.
|
|
73
|
-
|
|
83
|
+
For selected breakages, record the criterion ID, temporary change, and observed failure in handoff `notes`.
|
|
84
|
+
Use `probeStatus: passed` when the probe passes. If breakage is required, it must pass both before breakage and after restoration.
|
|
74
85
|
Use `failed` for an observed probe failure and `not-run` for an unexecuted probe.
|
|
75
86
|
Use `breakageStatus: confirmed` only when the specified breakage makes the same probe detect the broken behavior.
|
|
76
|
-
Use `not-confirmed` when that detection fails and `not-run` when
|
|
87
|
+
Use `not-confirmed` when that detection fails and `not-run` when a required breakage check was not executed.
|
|
88
|
+
Use `not-required` only when the approved spec does not require a breakage check. Never use it to hide an unexecuted required check.
|
|
77
89
|
An existing baseline failure or unrelated environment error does not confirm breakage.
|
|
78
90
|
Include every spec criterion once. Never omit unrun criteria or fabricate evidence.
|
|
79
91
|
|
|
80
92
|
## Record findings, not decisions
|
|
81
93
|
|
|
82
94
|
Record technical issues supported by fresh evidence. Do not add requirements, style preferences, or unrelated improvements.
|
|
83
|
-
Give every criterion with a probe other than `passed` or breakage other than `confirmed` at least one related finding.
|
|
95
|
+
Give every criterion with a probe other than `passed` or breakage other than `confirmed` or `not-required` at least one related finding.
|
|
84
96
|
Report required repository check failures as findings, even when every acceptance criterion passes.
|
|
85
97
|
Do not copy an earlier rejection into a new finding. Only the owner can reject current findings through Maestro.
|
|
86
98
|
|
|
@@ -94,7 +106,7 @@ For each finding, follow the tool schema:
|
|
|
94
106
|
6. Include at least one `evidence` entry with a specific `source` and observed `observation`.
|
|
95
107
|
7. Set `rejection: null`.
|
|
96
108
|
|
|
97
|
-
Use `findings: []` only when every probe passes, every breakage is confirmed, and no other technical findings remain.
|
|
109
|
+
Use `findings: []` only when every probe passes, every required breakage is confirmed, and no other technical findings remain.
|
|
98
110
|
Keep summaries and notes concise. Do not include full logs or secrets.
|
|
99
111
|
|
|
100
112
|
## Restore and submit
|
|
@@ -11,6 +11,8 @@ The package contains two agent definitions:
|
|
|
11
11
|
1. [`agents/builder.md`](../agents/builder.md) defines the builder role.
|
|
12
12
|
2. [`agents/verifier.md`](../agents/verifier.md) defines the verifier role.
|
|
13
13
|
|
|
14
|
+
Both agents receive project instructions and your global `AGENTS.md` from the Pi agent directory, normally `~/.pi/agent/AGENTS.md`.
|
|
15
|
+
|
|
14
16
|
## Package registration
|
|
15
17
|
|
|
16
18
|
`package.json` registers the agent directory with Pi:
|
package/docs/workflow.md
CHANGED
|
@@ -48,7 +48,7 @@ The builder works on the current branch with a fresh context.
|
|
|
48
48
|
|
|
49
49
|
It reads the active spec, implements the approved change, and runs every acceptance criterion.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
The builder checks every criterion. For the criteria the owner selects in the spec, it also introduces a temporary fault to prove that the check detects it.
|
|
52
52
|
|
|
53
53
|
The builder ends a run with one of these outcomes:
|
|
54
54
|
|
|
@@ -64,7 +64,7 @@ It reads the active spec and available artifacts. Historical artifacts provide c
|
|
|
64
64
|
|
|
65
65
|
Before the verifier starts, Maestro commits a `verifier-running` checkpoint. That checkpoint is the candidate commit.
|
|
66
66
|
|
|
67
|
-
The verifier does not repair product code. It independently
|
|
67
|
+
The verifier does not repair product code. It independently checks every criterion and repeats the fault checks the owner selected in the spec. It restores all temporary changes before reporting its results.
|
|
68
68
|
|
|
69
69
|
## Main flow
|
|
70
70
|
|
|
@@ -154,11 +154,11 @@ Checks that leave product files and workflow artifacts unchanged do not need you
|
|
|
154
154
|
|
|
155
155
|
If answering a specification question requires temporary product changes, Maestro first agrees on the question and scope with you. Commands with automatic fixes also require this agreement, even if they ultimately change no files. These experiments help clarify the spec. They do not implement the feature or replace the builder and verifier.
|
|
156
156
|
|
|
157
|
-
Maestro must preserve all pre-existing changes, including uncommitted and untracked files. Before requesting spec approval or resuming the workflow, Maestro must restore only its experiment changes and remove temporary files. If cleanup fails, Maestro reports the remaining changes and stops. Experiments cannot create commits or change `workflow.json`, handoffs, or other protected workflow artifacts. Installing packages or adding or updating dependencies requires explicit owner approval. After cleanup, Maestro records
|
|
157
|
+
Maestro must preserve all pre-existing changes, including uncommitted and untracked files. Before requesting spec approval or resuming the workflow, Maestro must restore only its experiment changes and remove temporary files. If cleanup fails, Maestro reports the remaining changes and stops. Experiments cannot create commits or change `workflow.json`, handoffs, or other protected workflow artifacts. Installing packages or adding or updating dependencies requires explicit owner approval. After cleanup, Maestro records only conclusions and limits that affect the contract in `spec.md`.
|
|
158
158
|
|
|
159
159
|
## Acceptance criterion simplicity principle
|
|
160
160
|
|
|
161
|
-
Each acceptance criterion
|
|
161
|
+
Each acceptance criterion describes one observable result.
|
|
162
162
|
|
|
163
163
|
```text
|
|
164
164
|
Probe
|
|
@@ -170,7 +170,9 @@ Expected result
|
|
|
170
170
|
Breakage
|
|
171
171
|
How to prove that the probe detects a broken behavior.
|
|
172
172
|
```
|
|
173
|
-
|
|
173
|
+
|
|
174
|
+
Breakage checks are not required by default.
|
|
175
|
+
The owner selects a breakage check during spec preparation when a proof, that the test detects a specific error, is needed.
|
|
174
176
|
|
|
175
177
|
## Escalations
|
|
176
178
|
|
|
@@ -247,5 +249,5 @@ The default spec directory contains:
|
|
|
247
249
|
```
|
|
248
250
|
|
|
249
251
|
- `builder.json` and `verifier.json` represent the current handoffs and can be overwritten by later runs.
|
|
250
|
-
- Builder handoff `notes` contain
|
|
252
|
+
- Builder handoff `notes` contain evidence for selected fault checks and significant discoveries that did not require an owner decision. Maestro summarizes the relevant results at the end.
|
|
251
253
|
- Earlier versions of all artifacts remain in Git commits.
|
package/package.json
CHANGED
|
@@ -26,7 +26,8 @@ const hasOnlyCompletedChecks = (
|
|
|
26
26
|
acceptanceCriteria.every(
|
|
27
27
|
(criterion) =>
|
|
28
28
|
criterion.probeStatus === PROBE_STATUSES.PASSED &&
|
|
29
|
-
criterion.breakageStatus === BREAKAGE_STATUSES.CONFIRMED
|
|
29
|
+
(criterion.breakageStatus === BREAKAGE_STATUSES.CONFIRMED ||
|
|
30
|
+
criterion.breakageStatus === BREAKAGE_STATUSES.NOT_REQUIRED),
|
|
30
31
|
);
|
|
31
32
|
|
|
32
33
|
const hasValidFailedChecks = (
|
|
@@ -74,7 +75,7 @@ export function assertBuilderHandoff(
|
|
|
74
75
|
!hasOnlyCompletedChecks(handoff.acceptanceCriteria)
|
|
75
76
|
) {
|
|
76
77
|
throw new Error(
|
|
77
|
-
'Done builder handoff requires every probe to pass and every breakage check to be confirmed.',
|
|
78
|
+
'Done builder handoff requires every probe to pass and every breakage check to be confirmed or not required.',
|
|
78
79
|
);
|
|
79
80
|
}
|
|
80
81
|
|
|
@@ -17,7 +17,8 @@ import { isValidSpecId } from '#ids/isValidSpecId.ts';
|
|
|
17
17
|
|
|
18
18
|
const hasCompletedChecks = (criterion: BuilderAcceptanceCriterion): boolean =>
|
|
19
19
|
criterion.probeStatus === PROBE_STATUSES.PASSED &&
|
|
20
|
-
criterion.breakageStatus === BREAKAGE_STATUSES.CONFIRMED
|
|
20
|
+
(criterion.breakageStatus === BREAKAGE_STATUSES.CONFIRMED ||
|
|
21
|
+
criterion.breakageStatus === BREAKAGE_STATUSES.NOT_REQUIRED);
|
|
21
22
|
|
|
22
23
|
function assertVerifierHandoffSchema(
|
|
23
24
|
input: unknown,
|
|
@@ -29,18 +29,26 @@ Wait for each tool result before taking the next workflow action. Do not launch
|
|
|
29
29
|
2. Read the repository and applicable AGENTS.md files. Investigate the affected behavior before asking the owner for missing information.
|
|
30
30
|
3. Ask one focused question at a time. Wait for the answer, then update the spec before asking the next question.
|
|
31
31
|
4. Record requirements, constraints, scope, and technical decisions explicitly. Do not invent requirements or silently resolve owner decisions.
|
|
32
|
-
5. Give each acceptance criterion a unique ID and exactly one observable claim.
|
|
33
|
-
6.
|
|
34
|
-
7. Review the complete spec for consistency, missing decisions, measurable
|
|
32
|
+
5. Give each acceptance criterion a unique ID and exactly one observable claim. Describe its probe scenario and expected result in plain language.
|
|
33
|
+
6. Select breakage checks explicitly with the owner only where proving error detection adds value. Otherwise write Breakage: Not required. For selected checks, describe the broken behavior and require the same probe to pass, fail during breakage, and pass after restoration.
|
|
34
|
+
7. Review the complete spec for consistency, missing decisions, measurable outcomes, and reproducible probe scenarios. Remove repetition and unnecessary implementation details. Resolve gaps with the owner.
|
|
35
35
|
8. Request explicit approval. Only after approval, call maestro_mark_spec_ready with the active specId.
|
|
36
36
|
9. Ask the owner to commit spec.md, its prototypes, and workflow.json. Do not start the builder until the checkout is clean.
|
|
37
37
|
|
|
38
|
+
Write spec.md for the owner. Keep detail proportional to the change and state each requirement once.
|
|
39
|
+
Use the template topics as guidance. Omit empty subsections instead of filling them with Not applicable.
|
|
40
|
+
Keep behavior, scope, constraints, and approved architectural decisions in the spec. Leave routine implementation choices to the builder.
|
|
41
|
+
Keep probes as starting conditions and actions or observations, with measurable expected results.
|
|
42
|
+
Every probe remains mandatory for builder and verifier. Breakage checks are not required by default; do not add them to every criterion automatically.
|
|
43
|
+
Describe selected breakages as wrong behavior to detect, not code edits. The builder chooses test code, fixtures, mocks, commands, and safe temporary changes.
|
|
44
|
+
Do not copy agent procedures, repository rules, investigation logs, or workflow history into the spec.
|
|
45
|
+
|
|
38
46
|
During spec preparation and revisions, investigate each technical decision before presenting options or recommending an answer. Do not wait for the owner to request code analysis.
|
|
39
47
|
Trace the relevant code and data flow across affected components, including transformations that limit the available data.
|
|
40
48
|
Use repository evidence to explain each option's feasibility, required changes, scope, and effects on existing behavior.
|
|
41
49
|
Cite the relevant files. Distinguish confirmed facts from assumptions and state what you could not verify, including deployed state.
|
|
42
50
|
Do not ask the owner questions that repository inspection can answer. Keep requirement choices and technical decisions with the owner.
|
|
43
|
-
|
|
51
|
+
In spec.md, keep only a brief reason, essential references, and unresolved limits that affect the decision. Follow the check and experiment permissions below.
|
|
44
52
|
|
|
45
53
|
### Spec edits, checks, and experiments
|
|
46
54
|
|
|
@@ -59,7 +67,7 @@ Do not create commits or change workflow.json, handoffs, or other protected work
|
|
|
59
67
|
Get explicit owner approval before installing packages or adding or updating dependencies.
|
|
60
68
|
Before requesting spec approval or continuing the workflow, restore only your experiment changes and remove your temporary files.
|
|
61
69
|
If cleanup fails, report the remaining changes and stop. Do not discard pre-existing uncommitted or untracked work.
|
|
62
|
-
After cleanup,
|
|
70
|
+
After cleanup, summarize only experiment conclusions and limits that affect the contract in spec.md. Experiments do not replace builder or verifier work.
|
|
63
71
|
|
|
64
72
|
### Run the workflow
|
|
65
73
|
|
|
@@ -18,7 +18,7 @@ export const BUILDER_HANDOFF_TOOL = {
|
|
|
18
18
|
NAME: 'maestro_record_builder_handoff',
|
|
19
19
|
LABEL: 'Record Builder Handoff',
|
|
20
20
|
DESCRIPTION:
|
|
21
|
-
'Record the builder pass as done or failed. Put
|
|
21
|
+
'Record the builder pass as done or failed. Put selected breakage evidence and significant discoveries that do not require an owner decision in notes. After success, commit the implementation, handoff, and workflow state together with Bash and Git.',
|
|
22
22
|
} as const;
|
|
23
23
|
|
|
24
24
|
const BuilderHandoffContentFields = {
|
package/templates/spec.md
CHANGED
|
@@ -2,102 +2,65 @@
|
|
|
2
2
|
|
|
3
3
|
> After owner approval, this specification is the contract for the builder and verifier.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<!--
|
|
6
|
+
Write for the owner, not only for agents. Keep detail proportional to the change.
|
|
7
|
+
State each requirement once. Refer to it from acceptance criteria instead of repeating it.
|
|
8
|
+
Use the topics below as guidance, not a checklist to fill. Omit empty subsections and these instructions.
|
|
9
|
+
Leave local implementation choices, test code, fixtures, mocks, and commands to the builder.
|
|
10
|
+
-->
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
## 1. Context, goals, and scope
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
- <Metric or verifiable condition that defines success.>
|
|
14
|
+
<Briefly describe the problem, who is affected, and the intended outcome.>
|
|
13
15
|
|
|
14
16
|
### Out of scope
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
- <Existing behavior that remains unchanged and is not being redesigned.>
|
|
18
|
-
|
|
19
|
-
Write `No additional out-of-scope items.` when none are known.
|
|
18
|
+
<Name related changes that are explicitly excluded.>
|
|
20
19
|
|
|
21
20
|
## 2. Requirements and constraints
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- <Behavior the system must provide.>
|
|
26
|
-
- <Actor or system action and its required outcome.>
|
|
27
|
-
|
|
28
|
-
Write `No new functional behavior.` when the change is purely technical.
|
|
29
|
-
|
|
30
|
-
### Non-functional requirements
|
|
31
|
-
|
|
32
|
-
- <Measurable performance, reliability, security, accessibility, privacy, or compatibility requirement.>
|
|
22
|
+
<Describe required behavior and measurable limits. Include performance, reliability, accessibility, or other quality requirements only when relevant.>
|
|
33
23
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### Constraints
|
|
37
|
-
|
|
38
|
-
- <Non-negotiable technical, business, legal, security, operational, or compatibility boundary.>
|
|
39
|
-
- <Existing behavior or contract that must remain unchanged.>
|
|
40
|
-
|
|
41
|
-
Write `No additional constraints.` when none are known.
|
|
24
|
+
<Include non-negotiable boundaries and existing behavior that this change must preserve. Do not copy repository or agent instructions.>
|
|
42
25
|
|
|
43
26
|
### Edge cases and error handling
|
|
44
27
|
|
|
45
|
-
|
|
46
|
-
|---|---|---|
|
|
47
|
-
| <Boundary or error condition> | <Observable system behavior> | <Preserved state, rollback, retry, or recovery behavior> |
|
|
48
|
-
| <Unavailable dependency> | <Error presented to the caller or user> | <Partial state handling and retry behavior> |
|
|
49
|
-
| <Repeated or concurrent operation> | <Idempotent, serialized, or conflict behavior> | <Resulting authoritative state> |
|
|
50
|
-
|
|
51
|
-
Every required edge case must be covered by an acceptance criterion.
|
|
52
|
-
|
|
53
|
-
Write `No additional edge cases.` only when none apply.
|
|
54
|
-
|
|
55
|
-
## 3. Technical design
|
|
56
|
-
|
|
57
|
-
<Describe the approved technical decisions that affect the repository architecture. Do not list every file or local implementation detail.>
|
|
28
|
+
<Describe boundary conditions, failures, and required recovery behavior not already covered above. Cover each required case in the acceptance criteria.>
|
|
58
29
|
|
|
59
|
-
|
|
30
|
+
## 3. Technical decisions and prototypes
|
|
60
31
|
|
|
61
|
-
|
|
32
|
+
<Record only approved architectural decisions or technical constraints that affect scope or behavior. Explain their reasons briefly. Leave routine implementation choices to the builder.>
|
|
62
33
|
|
|
63
|
-
<
|
|
34
|
+
<For each relevant topic below, add a short subsection. Omit topics that do not apply.>
|
|
64
35
|
|
|
65
|
-
|
|
36
|
+
1. Components and data flow: changed responsibilities, data contracts, and important boundaries. No file inventory or function-level design.
|
|
37
|
+
2. API specification: changed operations, permissions, inputs, outputs, errors, side effects, and delivery guarantees.
|
|
38
|
+
3. Prototype and user interaction: link prototypes and identify approved states and interactions. Distinguish illustrative content from requirements.
|
|
39
|
+
4. External integrations: affected services, failure behavior, and retries.
|
|
40
|
+
5. Security and privacy: access rules, sensitive data, retention, and trust boundaries.
|
|
41
|
+
6. Compatibility and migration: compatibility limits, migration, rollout, and rollback requirements.
|
|
42
|
+
7. Monitoring and observability: required signals, alerts, and ownership.
|
|
66
43
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
For each operation, define the protocol and operation, caller permissions, input, successful output, errors and side effects, and delivery or consistency rules.
|
|
70
|
-
|
|
71
|
-
### Prototype and user interaction
|
|
72
|
-
|
|
73
|
-
Write `Not applicable.` when there is no visual or interactive behavior.
|
|
74
|
-
|
|
75
|
-
- `prototypes/<surface-name>.<html|png|jpg|jpeg>`: <surface and states represented by the prototype>
|
|
76
|
-
|
|
77
|
-
<Describe user triggers, state transitions, validation, feedback, accessibility, and recovery behavior.>
|
|
78
|
-
|
|
79
|
-
### External integrations
|
|
80
|
-
|
|
81
|
-
<Describe affected services, SDKs, events, queues, webhooks, failure boundaries, and retry behavior.>
|
|
82
|
-
|
|
83
|
-
### Security and privacy
|
|
84
|
-
|
|
85
|
-
<Describe authentication, authorization, trust boundaries, sensitive-data handling, retention, encryption, and redaction.>
|
|
86
|
-
|
|
87
|
-
### Compatibility and migration
|
|
88
|
-
|
|
89
|
-
<Describe backward compatibility, migration, rollout, rollback, and coexistence with older versions.>
|
|
90
|
-
|
|
91
|
-
### Monitoring and observability
|
|
92
|
-
|
|
93
|
-
Write `Not applicable.` when no operational signal changes.
|
|
94
|
-
|
|
95
|
-
<Describe required signals, triggers, diagnostic information, alerts, thresholds, ownership, and sensitive data that must not be recorded.>
|
|
44
|
+
<Include only evidence and unresolved limits that affect an owner decision. Do not include investigation logs or general verification disclaimers.>
|
|
96
45
|
|
|
97
46
|
## 4. Acceptance criteria
|
|
98
47
|
|
|
48
|
+
<Give each criterion a unique ID and one observable claim. A probe is the scenario used to check that claim. Describe it in plain language.>
|
|
49
|
+
|
|
99
50
|
### AC1: <short observable claim>
|
|
100
51
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
52
|
+
1. Probe: <starting conditions and action or observation, without prescribing test implementation>
|
|
53
|
+
2. Expected result: <observable and measurable outcome>
|
|
54
|
+
3. Breakage: Not required. <Only when selected with the owner: describe the wrong behavior that a safe temporary change must cause and the probe must detect.>
|
|
55
|
+
|
|
56
|
+
<!--
|
|
57
|
+
Example:
|
|
58
|
+
Probe: Save a change, then reopen the item.
|
|
59
|
+
Expected result: The saved change is still present.
|
|
60
|
+
Breakage (if selected): Discard the change instead of saving it.
|
|
61
|
+
|
|
62
|
+
Breakage checks are not required by default. Select them with the owner only when proving error detection adds value.
|
|
63
|
+
The builder and verifier each run every probe. For selected breakages only, they also run the same probe during breakage and after restoration.
|
|
64
|
+
The builder chooses executable checks and safe temporary changes. The verifier checks their coverage independently.
|
|
65
|
+
Keep execution evidence in handoffs, not in this spec.
|
|
66
|
+
-->
|