pi-gauntlet 8.0.1 → 8.0.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/CHANGELOG.md +7 -0
- package/agents/implementer.md +5 -2
- package/agents/plan-writer.md +3 -3
- package/agents/spec-council-member.md +1 -1
- package/package.json +3 -2
- package/skills/brainstorming/reference/amendment-surface.md +2 -2
- package/skills/brainstorming/reference/spec-finalization.md +8 -5
- package/skills/forge-skill/SKILL.md +1 -1
- package/skills/subagent-driven-development/SKILL.md +23 -8
- package/skills/subagent-driven-development/implementer-prompt.md +1 -1
- package/skills/subagent-driven-development/reference/dispatch-contract.md +3 -3
- package/skills/subagent-driven-development/reference/implement-amendments.md +3 -3
- package/skills/writing-plans/SKILL.md +5 -5
- package/skills/writing-plans/reference/plan-contract.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v8.0.2 - 2026-10-31
|
|
4
|
+
|
|
5
|
+
- **Implementer identity and guard exception.** Structured returns copy the dispatched `anchor` or `anchors` so failed tasks remain identifiable. Explicit `completionGuard: false` preserves edit-less `NEEDS_CONTEXT` and `BLOCKED` returns; isolated waves reject edit-less `DONE` through their patch requirement, while in-place and non-wave callers retain gate/review coverage.
|
|
6
|
+
- **Artifact-first failed-chain recovery.** Recover missing structured results from identity-matched `output.json` captures before diagnosis, retaining accepted siblings. The fallback carrier names `agent: "delegate"` and `Do not edit any file.` so it is addressable and stays read-only. Missing or empty initial patches count as failed attempts; nonempty apply failures still hard-stop.
|
|
7
|
+
- **Committed amendment originals and plan handoff.** Commit the plan after the parent check passes and before tracker initialization, and commit dirty plan/spec originals before the first wave. Amend-apply reads both originals from git HEAD instead of copying inventory into its report, preserving semantic comparisons after partial attempts. Failed baseline reads write nothing and stop without retry; prior reports carry findings only.
|
|
8
|
+
- **PR-source critique direction.** Council and worker critiques flag requirements justified by a PR title or body: the approved input or agreed design produces the PR, not the reverse. Re-source the clause or ask for a Design scope decision before cutting it; PR provenance mentions and design-sourced rework remain exempt.
|
|
9
|
+
|
|
3
10
|
## v8.0.1 - 2026-10-31
|
|
4
11
|
|
|
5
12
|
- Single-repo loops omit coordinated instructions; coordinated entry and resume load the extracted reference before admission. (#107)
|
package/agents/implementer.md
CHANGED
|
@@ -6,7 +6,7 @@ defaultContext: fork
|
|
|
6
6
|
inheritProjectContext: true
|
|
7
7
|
inheritSkills: false
|
|
8
8
|
systemPromptMode: replace
|
|
9
|
-
completionGuard:
|
|
9
|
+
completionGuard: false
|
|
10
10
|
defaultProgress: true
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -51,6 +51,7 @@ Tests are supporting constructs for the code. Follow these defaults; decline one
|
|
|
51
51
|
- Run ONLY the test commands your dispatch hands you (`SCOPED_TEST_COMMANDS`). Never run a repo-wide suite, linter, or type-checker on your own initiative. Dispatch carries no test commands: say so in your report; run nothing.
|
|
52
52
|
- Never claim a task is done without running the dispatch-supplied scoped commands and observing them pass. Quote the actual command and the actual output. If none were supplied, say so in your report - that is sufficient for DONE.
|
|
53
53
|
- Never invent or paraphrase test output. If you skipped tests, say so and why.
|
|
54
|
+
- Never open the final message with `BLOCKED:`; report a blocked state through structured `status: BLOCKED` and the report's `Reasoning:` line.
|
|
54
55
|
- If the plan does not cover a design decision, **stop and report**, do not guess. Escalate via the return value rather than improvising.
|
|
55
56
|
- Stay inside the scope the parent assigned. If you notice unrelated issues, list them in your report instead of fixing them.
|
|
56
57
|
|
|
@@ -58,7 +59,9 @@ Tests are supporting constructs for the code. Follow these defaults; decline one
|
|
|
58
59
|
|
|
59
60
|
Keep the existing report layout. When structured output is requested, emit the following contract; its status mirrors the report, not a separate assessment:
|
|
60
61
|
|
|
61
|
-
`{ status: DONE|DONE_WITH_CONCERNS|NEEDS_CONTEXT|BLOCKED, reasoning: string (one sentence, 300 chars), concerns?: string[] (required for DONE_WITH_CONCERNS, one line each), question?: string (required for NEEDS_CONTEXT), anchorUnreadable?: string, measured?: object (values an `orchestrator:` instruction consumes) }`.
|
|
62
|
+
`{ status: DONE|DONE_WITH_CONCERNS|NEEDS_CONTEXT|BLOCKED, reasoning: string (one sentence, 300 chars), anchor?: string, anchors?: string[], concerns?: string[] (required for DONE_WITH_CONCERNS, one line each), question?: string (required for NEEDS_CONTEXT), anchorUnreadable?: string, measured?: object (values an `orchestrator:` instruction consumes) }`.
|
|
63
|
+
|
|
64
|
+
Copy the dispatched `anchor` or `anchors` verbatim into every status, including unreadable-anchor returns: exactly one identity field for an anchored dispatch. For inline callers without either field, invent no identity.
|
|
62
65
|
|
|
63
66
|
Read any supplied previous-task or review report by path before implementing its repair; do not rely on a parent summary.
|
|
64
67
|
|
package/agents/plan-writer.md
CHANGED
|
@@ -36,9 +36,9 @@ Read the spec and existing plan, the supplied amendment surface, and the evidenc
|
|
|
36
36
|
|
|
37
37
|
### Amend-apply:
|
|
38
38
|
|
|
39
|
-
Treat this block alone as permission to write the granted items verbatim to their named spec sections, using full-file `write` with every other section preserved. Accept only the granted items carried by the caller, not additional recommendations. Read the spec and plan
|
|
39
|
+
Treat this block alone as permission to write the granted items verbatim to their named spec sections, using full-file `write` with every other section preserved. Accept only the granted items carried by the caller, not additional recommendations. Read the current spec and plan. Derive home-relative paths using the Baseline path inventory, never absolute paths after `HEAD:`. Read both committed home plan/spec originals before the first edit with `git -C "<abs home worktree>" show HEAD:<home-relative plan path>` and `git -C "<abs home worktree>" show HEAD:<home-relative spec path>`. Use their original task numbers, titles, spec anchors, wave positions, anchored obligation text, task bodies and Tests as the comparison inventory; add no sidecar or report-carried copy. If either read fails, the worker writes nothing and returns `passed: false` with `failLines[0]` beginning `baseline read failed: git -C `, followed by the exact failed command and first stderr line, preserving the actual path and diagnostic. Fail closed for jj-only without git HEAD. In this implement-only mode, patch only affected task entries, coverage and shifted anchors, using full-file write; do not regenerate the plan. Preserve unaffected text, ids, titles, wave order, state and evidence. Write `**Baseline policy:** implement-local` in the plan header and use the implement-local Baseline branch in the skill, with no endpoint-tree equivalence or rerun-all sweep. Preserve original per-leg declarations and unchanged command bullets byte-for-byte, including pass-via, skipped and artifact suffixes. Run only changed/added commands or missing/invalid evidence on an identified execution tree, recording leg, checkout, revision, admitted changes, command, exit and nonzero executed-test count in the existing provenance and saved report. Never call a dirty execution clean HEAD. Keep mechanical self-check and coverage updates. An explicit `Findings: rerun baseline` instead executes all commands and restores ordinary uniform evidence; do not infer mode from differing SHAs. Admit only these two committed-original `git show` reads as the extra bash permission; keep all other shell restrictions unchanged. The only extra writable file is the supplied spec, limited to those named sections.
|
|
40
40
|
|
|
41
|
-
Return `{ amendedSections: string[], tasksAdded: number[], tasksAnchorChanged: number[], tasksRemoved: number[], passed: boolean, failLines?: string[] }`. Derive deltas from pre-apply task numbers, never tracker positions: added numbers name new tasks, anchor-changed numbers name surviving tasks with semantic obligation or work changes against the original anchored text, task bodies and Tests, not line offsets or meaning-preserving rewording, and removed numbers name deleted tasks. Return `passed: true` only after the self-check passes with no open questions. On failure return `passed: false` with verbatim checker findings and substantive baseline failure rows in `failLines`, so the parent need not open the plan. On a retry carrying `failLines` as the rule and `previousApplyReport` set to the first apply report path, read
|
|
41
|
+
Return `{ amendedSections: string[], tasksAdded: number[], tasksAnchorChanged: number[], tasksRemoved: number[], passed: boolean, failLines?: string[] }`. Derive deltas from pre-apply task numbers, never tracker positions: added numbers name new tasks, anchor-changed numbers name surviving tasks with semantic obligation or work changes against the original anchored text, task bodies and Tests, not line offsets or meaning-preserving rewording, and removed numbers name deleted tasks. Return `passed: true` only after the self-check passes with no open questions. On failure return `passed: false` with verbatim checker findings and substantive baseline failure rows in `failLines`, so the parent need not open the plan. On a retry carrying `failLines` as the rule and `previousApplyReport` set to the first apply report path, read prior findings only from that report and reread both committed home plan/spec originals before writing. Repair the failure and apply the granted edits idempotently without duplicating already-applied edits; compute deltas and amendedSections against those committed originals rather than the already-mutated plan/spec. Return `passed: true` for a successful one-bullet edit after self-check. The parent owns the one-failure retry and escalation.
|
|
42
42
|
|
|
43
43
|
## Procedure
|
|
44
44
|
|
|
@@ -52,7 +52,7 @@ Return `{ amendedSections: string[], tasksAdded: number[], tasksAnchorChanged: n
|
|
|
52
52
|
|
|
53
53
|
## Rules
|
|
54
54
|
|
|
55
|
-
- Use `bash` only for Baseline provenance (`git rev-parse`, `git status --porcelain`, `git diff --quiet`, `jj -R "<abs worktree path>" diff --from <recorded> --to <BASE> --summary`, or the contract's other jj equivalents) and the plan's own `Tests:` commands in the worktree
|
|
55
|
+
- Use `bash` only for Baseline provenance (`git rev-parse`, `git status --porcelain`, `git diff --quiet`, `jj -R "<abs worktree path>" diff --from <recorded> --to <BASE> --summary`, or the contract's other jj equivalents) and the plan's own `Tests:` commands in the worktree, plus only the two home-relative HEAD reads specified in `Amend-apply:`. Write only the plan, plus the named spec sections in `Amend-apply:`. Never edit tracked source, commit, run `stash`, `checkout`, `restore`, `clean`, or mutate jj's working copy or revisions (`new`, `commit`, `abandon`, `restore`, `squash`).
|
|
56
56
|
- Never leave a placeholder in authored plan prose; retain verbatim failure evidence in row continuation fences. Derive decisions from source per Contract decisions; name only an unsettled decision as an open question.
|
|
57
57
|
- Never call `plan_tracker`, `phase_tracker`, or `subagent`; the orchestrator owns them.
|
|
58
58
|
- Use the mode's structured result for implement-only amendment blocks; otherwise never reply with more than the one line.
|
|
@@ -31,7 +31,7 @@ When the first line of your task is `Mode: amendment-review`, this section repla
|
|
|
31
31
|
Assess the spec on five axes:
|
|
32
32
|
|
|
33
33
|
1. **Addresses the problem.** Does the spec actually solve the problem in the problem statement? Answer yes / partial / no and say why. A well-written spec for the wrong problem is unsound.
|
|
34
|
-
2. **Logical gaps.** Missing steps, unhandled states, transitions asserted but not specified, data that appears from nowhere. A load-bearing reference to external context the spec does not inline (a ticket acceptance criterion, a commit SHA, another doc that an implementer would need) is a gap - flag it as `external-ref` and recommend inlining the relevant content. Compare the `Human input` ticket AC rows against the spec's `## Acceptance criteria`: a row absent or reworded is `external-ref`. A `deferred:` or `deviates:` row is a `[blocker] scope` finding unless `Human input` carries a cut question and the user's answer picking that cut for that row - a prompt sentence never counts, and with no `Human input` block the finding reads "no human input to match". A `deferred:` destination that is no tracker ref, spec path, or URL is `scope`. An `elsewhere: <repo>` row is `[blocker] scope` unless its `Human input` row sits under a repo-group heading naming a repo other than this one (this repo: the overrides `## Issue tracker` `repo:` value, else the `owner/name` path of `git remote get-url origin` with any `.git` suffix stripped; a group name matches when it equals that value or its basename, case-insensitive). A `venue:` carrying `prd`, `prod`, or `production` is `[blocker] scope`.
|
|
34
|
+
2. **Logical gaps.** Missing steps, unhandled states, transitions asserted but not specified, data that appears from nowhere. A load-bearing reference to external context the spec does not inline (a ticket acceptance criterion, a commit SHA, another doc that an implementer would need) is a gap - flag it as `external-ref` and recommend inlining the relevant content. Compare the `Human input` ticket AC rows against the spec's `## Acceptance criteria`: a row absent or reworded is `external-ref`. A `deferred:` or `deviates:` row is a `[blocker] scope` finding unless `Human input` carries a cut question and the user's answer picking that cut for that row - a prompt sentence never counts, and with no `Human input` block the finding reads "no human input to match". A `deferred:` destination that is no tracker ref, spec path, or URL is `scope`. An `elsewhere: <repo>` row is `[blocker] scope` unless its `Human input` row sits under a repo-group heading naming a repo other than this one (this repo: the overrides `## Issue tracker` `repo:` value, else the `owner/name` path of `git remote get-url origin` with any `.git` suffix stripped; a group name matches when it equals that value or its basename, case-insensitive). A `venue:` carrying `prd`, `prod`, or `production` is `[blocker] scope`. Flag a requirement, acceptance-criteria row, or Design clause whose stated source is a PR title or body as a `[major] gap`, with `pr-source` in the finding text, including PR rework: the spec produces the PR, never the reverse. Suggest re-sourcing from the approved human input or the agreed design; without that evidence, ask for the user's Design scope decision before cutting the commitment or its drafted row. Never replace rows with `none`; never draft rows. Exempt a `supersedes` line, `## Rework record`, `## Problem` thread lists, `## PR under rework`, any other provenance mention of a PR number, and rework rows sourced from the agreed design.
|
|
35
35
|
3. **Oversimplifications.** Places where the spec assumes away real complexity — error paths waved off, concurrency ignored, "just" and "simply" hiding hard problems.
|
|
36
36
|
4. **Ambiguities.** Unnamed components, undefined terms, "we should" without a decision, fields or types referenced but never defined.
|
|
37
37
|
5. **Actionable and testable.** Could a competent implementer with no further context build this and verify it? If not, what is missing?
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-gauntlet",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"description": "Opinionated, gated workflow skills, subagent personas, and runtime extensions for the pi coding agent.",
|
|
5
5
|
"author": "Jacek Juraszek",
|
|
6
6
|
"type": "module",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@anthropic-ai/claude-code": "2.1.309",
|
|
72
|
-
"esbuild": "0.28.2"
|
|
72
|
+
"esbuild": "0.28.2",
|
|
73
|
+
"typebox": "^1.3.11"
|
|
73
74
|
}
|
|
74
75
|
}
|
|
@@ -40,7 +40,7 @@ When the spec file is mid-batch (uncommitted amend edits), the consent edit ride
|
|
|
40
40
|
|
|
41
41
|
## Implement-local maintenance boundaries
|
|
42
42
|
|
|
43
|
-
Apply this specialization only to implement callers with a task plan; keep planning callers and ordinary attribution/restoration below unchanged. Patch only affected task entries, coverage and shifted anchors, preserving unaffected ids, titles, wave order, state and historical evidence.
|
|
43
|
+
Apply this specialization only to implement callers with a task plan; keep planning callers and ordinary attribution/restoration below unchanged. Patch only affected task entries, coverage and shifted anchors, preserving unaffected ids, titles, wave order, state and historical evidence. Use committed home plan/spec originals read via home-relative `git -C "<abs home worktree>" show HEAD:<path>` before edits and on every retry for original task inventory, anchored obligation text, task bodies and Tests; retain prior findings in the report, not baseline copies. Interpret `tasksAnchorChanged` semantically, not as offset-only or meaning-preserving rewording changes.
|
|
44
44
|
|
|
45
45
|
For spec/plan maintenance requiring no test execution, admit declared `In-flight:` repairs and preserve staged repairs; never commit, restore or discard them merely to plan. Retain original declarations and unchanged evidence at measured revisions under `**Baseline policy:** implement-local`. Execute changed/added/missing/invalid evidence only on an identified execution tree, recording leg, checkout, revision, admitted changes, command, exit and nonzero executed-test count. Never call dirty execution clean HEAD; stop on unidentified trees, unknown dirty paths, contamination or moved test revision.
|
|
46
46
|
|
|
@@ -153,7 +153,7 @@ Reply grammar: one line per item, `<n>. <letter or free text>`; bare `1` applies
|
|
|
153
153
|
|
|
154
154
|
Before the aftermath, `read` this section again; never run it from memory.
|
|
155
155
|
|
|
156
|
-
**Implement callers only, with a task plan:** replace parent spec edits and the ordinary plan aftermath with a one-step chain to `plan-writer` carrying an implement-only `Amend-apply:` block, the granted items verbatim, the five absolute paths, and the parent's explicit `In-flight:` list. Authorize only those named spec sections. Require implement-local patching and historical Baseline under the boundaries above, preservation of unaffected titles and wave positions, Baseline ownership, dirty-baseline safety, and the child's self-check. Consume `{ amendedSections: string[], tasksAdded: number[], tasksAnchorChanged: number[], tasksRemoved: number[], passed: boolean, failLines?: string[] }`; use pre-apply task numbers, never tracker positions. Require
|
|
156
|
+
**Implement callers only, with a task plan:** replace parent spec edits and the ordinary plan aftermath with a one-step chain to `plan-writer` carrying an implement-only `Amend-apply:` block, the granted items verbatim, the five absolute paths, and the parent's explicit `In-flight:` list. Authorize only those named spec sections. Require implement-local patching and historical Baseline under the boundaries above, preservation of unaffected titles and wave positions, Baseline ownership, dirty-baseline safety, and the child's self-check. Consume `{ amendedSections: string[], tasksAdded: number[], tasksAnchorChanged: number[], tasksRemoved: number[], passed: boolean, failLines?: string[] }`; use pre-apply task numbers, never tracker positions. Require both committed home plan/spec originals before the first edit and on every retry, with home-relative HEAD paths; add no sidecar or report-carried inventory. When structured apply JSON is suppressed, read the sole capture at `<Artifacts>/structured-output/*/output.json` with the existing `read` bound `limit: 300`, no offset or pagination for that one-task dispatch and require a success envelope satisfying unchanged `APPLY_SCHEMA`. Stop on zero or two files naming paths, or malformed values; never recover from prose. Route captured `passed`/`failLines` like printed JSON. Only a failLines entry beginning exactly `baseline read failed: git -C ` bypasses retry: stop quoting the exact command and actual stderr. For every other `passed: false`, retry once with `failLines` as the rule and `previousApplyReport` set to the first apply report path for prior findings only. Require the fresh retry worker to reread both committed originals, apply granted edits idempotently without duplicating already-applied edits, and compute semantic deltas against those originals rather than the already-mutated plan/spec. Send a second failure to the human with verbatim findings, including substantive baseline failures. Keep the attribution, protected-path, and dirty-baseline exits below; no delegated restoration permission is granted. On pass, print `amended the spec: <title> - <location>` for each applied item, run the parent's `plan_check` for stamping, and use its fresh manifest with the returned task numbers without reading the plan or spec. Add `tasksAdded`, reopen completed `tasksAnchorChanged` as `in_progress`, and handle `tasksRemoved` through the removal rules below. Require parent PASS before tracker changes. Skip the ordinary parent edit, `Amend:` dispatch, and amended-plan read; preserve companion aftermath, audit, and the single batch commit below. Planning callers keep the ordinary apply and aftermath below; ledger and no-plan routes stay unchanged.
|
|
157
157
|
|
|
158
158
|
Apply accepted items only: reviewer clears, `accept`, `alt-n`, and state-changing `custom`. Print one line per applied item: `amended the spec: <title> - <what>`.
|
|
159
159
|
|
|
@@ -55,7 +55,7 @@ Spec-writing replaces the context draft, in this exact order:
|
|
|
55
55
|
[Marking superseded specs](superseding.md)). This position is fixed:
|
|
56
56
|
the banner is written after any slug rename, so it always cites the final path.
|
|
57
57
|
|
|
58
|
-
After writing the spec to `<project>/doc/specs/<filename>.md` (per [Filename Convention](../SKILL.md#filename-convention)) and before showing it to the user, run a self-review pass. Read all
|
|
58
|
+
After writing the spec to `<project>/doc/specs/<filename>.md` (per [Filename Convention](../SKILL.md#filename-convention)) and before showing it to the user, run a self-review pass. Read all seven bullets first, then act.
|
|
59
59
|
|
|
60
60
|
- **Placeholder scan.** Any `TODO`, `TBD`, `<fill in>`, `[example]`, `xxx`? Either resolve them or convert to explicit "Open Questions" with names.
|
|
61
61
|
- **Internal consistency.** Does Section 4 contradict Section 2? Does the header block carry `**Amend-grant:**` exactly once with the value `none` (the [predicate](amendment-surface.md#standing-grants))? Are component names and field names consistent throughout? If the spec replaces a prior design, confirm the predecessor carries the supersession banner and its href resolves to this spec's final filename.
|
|
@@ -63,8 +63,9 @@ After writing the spec to `<project>/doc/specs/<filename>.md` (per [Filename Con
|
|
|
63
63
|
- **Ticket contract present.** Require `## Acceptance criteria` in exactly three forms: ticket provenance (`Ticket <ref>, <heading or "checkbox list">, rows verbatim:`) with verbatim rows and dispositions; drafted provenance (`Drafted from the design, no ticket rows:` or `Drafted from the design, ticket <ref> has no acceptance criteria:`) with at least one `- [ ]` row and a disposition on every row; or the single line `none - ticket not fetched (<reason>)`. Reject `none - no ticket` and `none - ticket has no acceptance criteria` as final bodies. For a rework PR subject (a draft carrying `## PR under rework`), require the complete `## Rework record` per `pr-subject.md`; absence fails inline lint, including after a full replacement or redraw. Build expected identities and original heads from the provisioning Step 4 report (home plus `MEMBER_HEADS`), not from the record itself. Require each expected identity's `PR:`/`Pre-rework head:`/`Threads:` group with its full matching head and a `### PR #<N>` provenance subsection; reject a missing group or subsection naming the missing PR. Apply the same predicate for N=1.
|
|
64
64
|
- **Scope check.** Does every paragraph serve the goal? Cut filler. If something is out of scope, say it's out of scope.
|
|
65
65
|
- **Ambiguity check.** Is every "we should..." backed by a concrete decision? Replace "we could probably" with "we will" or "we won't".
|
|
66
|
+
- **PR-source check.** Apply the commitment-source predicate and re-source-or-ask correction in the worker payload below on the worker route; the council member owns the same check on the council route, including PR rework.
|
|
66
67
|
|
|
67
|
-
The first four are the inline **lint**: run them here and fix what they surface. The last
|
|
68
|
+
The first four are the inline **lint**: run them here and fix what they surface. The last three are the **critique pass**, dispatched per [Spec Council](#spec-council). After it returns, re-run the placeholder scan over the applied spec and reapply the same whole-section predicate from **Ticket contract present**: a correct provenance header with zero rows still fails. Have the main loop repair an invalid drafted section (including erased provenance, a triggering `none` line, or a header with no rows) from the applied Design by re-drafting at least one valid row using `ticket-acceptance.md`'s integrity recovery; never delegate drafting to the applier. With no valid outcome, obtain clarification or an explicit scope decision before the gate. On successful repair, append `Drafted AC repair: restored acceptance rows from the applied Design.` after the existing commit-body audit, preserving council cluster lines and counts; on the worker path append it to the otherwise empty body. Then re-apply the predicate to the header block - if the critique pass removed or altered the `**Amend-grant:**` line, repair it to `none`, exactly once; if a predecessor banner exists, confirm its `<scope>` still matches and reconcile it; carry any ambiguity the critique could not resolve to the [User Review Gate](#user-review-gate).
|
|
68
69
|
|
|
69
70
|
## Spec Council
|
|
70
71
|
|
|
@@ -74,7 +75,7 @@ Before dispatching the worker below, resolve `documentation-impact.md` relative
|
|
|
74
75
|
|
|
75
76
|
After the inline lint and before the user review gate, **brainstorming owns the critique-pass gate**; council **apply mechanics** live in `/skill:roasting-the-spec` (single source of truth - link, don't restate). Resolve the council with `gauntlet_setting({ key: "specCouncil" })` - the tool returns the merged (repo-over-preset) value as `{ verdict, members, chair, malformed, warning, errors }`. **Do not** hand-roll a settings read. When `verdict` is `"council"`, the council *is* the critique pass - invoke `/skill:roasting-the-spec` automatically (no offer, no prompt), passing `members`/`chair`; for a PR subject include every retained PR title and body verbatim beside the home-bound ticket rows in `Human input`; also pass the verbatim human input (the original prompt, any ticket AC snapshot - the raw rows under the gather draft's `## Ticket acceptance criteria (verbatim)` heading, never the spec's section, which holds the author's dispositions - and, for every question that offered a disposition (the cut question and the unmatched-group question in `ticket-acceptance.md`), the full question and the user's answer) - roasting-the-spec forwards it to members, chair, and applier as the `Human input (verbatim; off-limits for over-spec)` block; its dispatched applier applies the spec edits and supplies the returned audit (Applied/Deferred/Rejected). When `verdict` is `"worker"`, dispatch the worker below. If `malformed` is true or `errors` is non-empty, emit the `warning`/error as one line, then branch strictly on `verdict` - `malformed` can accompany *either* verdict (e.g. a bad `chair` with valid `members` still returns `council`), so never infer the worker path from `malformed` alone. If `gauntlet_setting` is unavailable, stop and report - never fall back to a manual bash/JSON settings merge. The already-applied council edits (or the worker's in-place fixes) ride in the same worktree commit. The conceptual precedence rule lives in `../../verification-before-completion/reference/settings-precedence.md`.
|
|
76
77
|
|
|
77
|
-
When `verdict` is `"worker"`, dispatch one fresh `worker` that applies the scope + ambiguity checks and fixes them in place:
|
|
78
|
+
When `verdict` is `"worker"`, dispatch one fresh `worker` that applies the scope + ambiguity + PR-source checks and fixes them in place:
|
|
78
79
|
|
|
79
80
|
```
|
|
80
81
|
subagent({ agent: "worker", context: "fresh", async: false, cwd: "<abs worktree path, from the using-git-worktrees Step 4 report>", task:
|
|
@@ -84,9 +85,11 @@ subagent({ agent: "worker", context: "fresh", async: false, cwd: "<abs worktree
|
|
|
84
85
|
"The `**Amend-grant:**` header line is flow machinery owned by the brainstorming gate; never cut, shrink, flag, or edit it.\n" +
|
|
85
86
|
"Drafted rows are spec requirements, not Human input; permit pre-approval rewrites only for integrity. Preserve every committed outcome and rewrite only its proof using Design-sourced values; never invent a baseline, target, measurement, or missing value. Flag missing inputs for main-loop clarification before the gate rather than dropping the outcome.\n" +
|
|
86
87
|
"Delete a drafted row only after its Design commitment is cut through the user's scope-decision procedure; quoting the row alone never permits deletion, and never replace the section with `none`. Preserve the cut's `deviates:`/`deferred:` disposition and `## Out of scope` entry for gate disclosure. Never draft new rows; leave drafting and integrity recovery requiring clarification to the main loop under `ticket-acceptance.md`.\n" +
|
|
87
|
-
"Apply
|
|
88
|
+
"Apply three checks and fix what you find in place: (1) Scope - does every paragraph serve the goal? Cut filler;\n" +
|
|
88
89
|
"state out-of-scope explicitly. (2) Ambiguity - is every 'we should' a concrete decision?\n" +
|
|
89
|
-
"Replace 'we could probably' with 'we will'/'we won't'.
|
|
90
|
+
"Replace 'we could probably' with 'we will'/'we won't'. (3) PR-source - flag a requirement, acceptance-criteria row, or Design clause whose stated source is a PR title or body as a [major] gap with pr-source in the finding text, including PR rework: the spec produces the PR, never the reverse.\n" +
|
|
91
|
+
"Re-source from the approved human input or the agreed design; without that evidence, flag the clause for the main loop to ask for the user's Design scope decision before cutting the commitment or its drafted row. Never replace rows with `none`; never draft rows.\n" +
|
|
92
|
+
"Exempt a `supersedes` line, `## Rework record`, `## Problem` thread lists, `## PR under rework`, any other provenance mention of a PR number, and rework rows sourced from the agreed design. Also inline any load-bearing\n" +
|
|
90
93
|
"external reference (ticket AC, commit SHA, doc) already given to you in the problem\n" +
|
|
91
94
|
"statement above; if the spec relies on one not provided here, flag it (do NOT fetch) in\n" +
|
|
92
95
|
"your summary. Return a summary of what you changed, and flag any ambiguity you could NOT\n" +
|
|
@@ -52,7 +52,7 @@ A persona is an `agents/<name>.md` file dispatched by name (pi-cohort `subagent(
|
|
|
52
52
|
- Whole prompt. pi-cohort assembles no base prompt, AGENTS.md, or skills catalog around the body unless `inheritProjectContext` or `inheritSkills` opts in; Claude Code replaces its default prompt with it. Open with the role and why it exists, state the output contract the caller parses before any method; when the caller parses a closing line, keep it last.
|
|
53
53
|
- Routing label. `description` is the one-sentence dispatch label the orchestrator's agent list shows: name when to dispatch, and write `Not for direct dispatch` when a skill owns the call. Never a summary of the body.
|
|
54
54
|
- Frontmatter pin. Leave every line the edit does not touch byte-identical, and leave frontmatter untouched unless the request names a knob - a pinned field removes the matching `agentOverrides` knob, so the request states the pin; a line the edit rewrites follows the ASCII rule like any other. Never pin `model`.
|
|
55
|
-
- Narrow tools. `tools` and `inherit*` list the operations the job performs and nothing else; a reviewer keeps `bash` when its caller injects a scoped command. A non-implementing persona with `bash` sets `completionGuard: false`; an implementing persona keeps the guard.
|
|
55
|
+
- Narrow tools. `tools` and `inherit*` list the operations the job performs and nothing else; a reviewer keeps `bash` when its caller injects a scoped command. A non-implementing persona with `bash` sets `completionGuard: false`; an implementing persona keeps the guard unless its caller owns an equivalent edit-less-completion check named in the project's personas doc. Document the exception there.
|
|
56
56
|
- Contract strings. A sentence a caller parses - closing line, mode discriminator, verdict word - changes only together with its caller; the project's validator pins them. Example: `lean: nothing to cut` stays verbatim.
|
|
57
57
|
- No skill machinery. No `/skill:` cross-reference and no `reference/` file: the body is read whole and nothing beside it is loaded (frontmatter `skills:` injects named skills; it is a knob, not a file split). A persona over 500 lines splits by job into a second persona.
|
|
58
58
|
- Reload. pi-cohort re-reads `agents/` on every dispatch, so an edit is live at the next call; Claude Code needs a new session.
|
|
@@ -21,9 +21,11 @@ Keep the plan_check manifest, tracker state, skill resources read at their absol
|
|
|
21
21
|
|
|
22
22
|
Consume structured `status`, `verdict`, `maxSeverity`, `findingCount`, `findings`, `touchedTasks`, `trajectory`, `concerns`, `question` and `anchorUnreadable` first. Use a direct `read` with `limit: 300` only for unresolved `DONE_WITH_CONCERNS` concerns, `BLOCKED` / `NEEDS_CONTEXT` question evidence, or `FIX_FIRST` / `REJECT` findings needed for repair or a stop note. Read at most once per printed `report <path>` observation per wave; never paginate or use an offset past the bound. When the read does not reach the report's footer (its `Parallel-safe:` line; `TRAJECTORY:` on a re-review), re-dispatch the same wave-reviewer once with `Compact report: findings and footer only, at most 150 lines`. Read its saved report under the same bound; stop naming the oversized path on a second overflow. Never dispatch `scout`, `delegate` or another child to relay reports. Retain delegated source-fact lookup.
|
|
23
23
|
|
|
24
|
+
For a dispatched task missing structured result text, also admit capture reads from `<Artifacts>/structured-output/*/output.json`, one file per `read`, `limit: 300`, no offset or pagination, under [Chain stopped or failed](#chain-stopped-or-failed). Keep saved prose reports outside this exception.
|
|
25
|
+
|
|
24
26
|
Read [reference/dispatch-contract.md](./reference/dispatch-contract.md) now for schemas, anchored payloads and one-step carriers. Read [reference/implement-amendments.md](./reference/implement-amendments.md) now for delegated amendments.
|
|
25
27
|
|
|
26
|
-
Use primary shell coordination only: `rev-parse`, `status --porcelain`, `diff --stat`, `apply`, `reset --soft`, `add -A`, `commit`, `update-ref`, plus the marked preflight, repair-base and scratch-index recipes and scoped-command redirection. Prohibit content-loading `cat`, `sed -n`, `git show <path>`, `git diff` without `--stat`, and contextual `grep`/`rg` over source. Route source questions, provenance and human escalation wording through the answer/evidence carrier; stop on delegated failure.
|
|
28
|
+
Use primary shell coordination only: `rev-parse`, `status --porcelain`, `diff --stat`, `apply`, `reset --soft`, `add -A`, path-scoped `add -- <plan> <spec>` for committed-original entry, `commit`, `update-ref`, `ls <Artifacts>/structured-output/*/output.json` only for missing-result recovery and `test -s <patch>` only for patch admission, plus the marked preflight, repair-base and scratch-index recipes and scoped-command redirection. Prohibit content-loading `cat`, `sed -n`, `git show <path>`, `git diff` without `--stat`, and contextual `grep`/`rg` over source. Route source questions, provenance and human escalation wording through the answer/evidence carrier; stop on delegated failure; for an exhausted-escalation stop note, emit it in the parent turn from held observations with no further dispatch or shell command.
|
|
27
29
|
|
|
28
30
|
## Continuous Execution
|
|
29
31
|
|
|
@@ -40,7 +42,7 @@ Periodic "should I continue?" prompts add latency without adding safety. The pla
|
|
|
40
42
|
## Prerequisites
|
|
41
43
|
|
|
42
44
|
- The worktree path is known - from the `using-git-worktrees` Step 4 report in this session or the handoff brief's `worktree:` row - and is passed as the top-level dispatch `cwd`. If no worktree path exists, stop and invoke `/skill:using-git-worktrees` first - implementation never lands directly on `main`. The process cwd is the primary checkout; nothing here changes it.
|
|
43
|
-
- Approved plan or clear task scope
|
|
45
|
+
- Approved plan or clear task scope. Before the first wave, establish committed originals at home: run `git -C "<abs home worktree>" status --porcelain -- "<home-relative plan path>" "<home-relative spec path>"`. If nonempty, run `git -C "<abs home worktree>" add -- "<home-relative plan path>" "<home-relative spec path>"` and `git -C "<abs home worktree>" commit -m "plan: <spec title>" -- "<home-relative plan path>" "<home-relative spec path>"`. Stop on failure before dispatch; never stage unrelated source or use dirty retry text as a baseline.
|
|
44
46
|
- `plan_tracker` list initialized at writing-plans handoff with the full wave-ordered task list. Consume and preserve it on continuation; only direct recovery with no tracker initializes the full plan list once, before dispatch, and never over an existing list.
|
|
45
47
|
|
|
46
48
|
Call `plan_check({ planPath })` for the manifest; stop on FAIL; for `manifest-size`, emit a stop note asking for plan reduction. Consume each task's `files`, `tests`, `leg`, `mode`, heading and explicit `orchestrator`. Pass isolated implementers only their own task's `tests` as `SCOPED_TEST_COMMANDS`, or `none` when empty. Give in-place implementers, the integrated test gate and wave reviews the wave union of `tests`. Preserve each array element as one command without splitting or joining command strings. Children read Tests metadata themselves.
|
|
@@ -117,7 +119,7 @@ Run every plan task through this loop in a wave of N >= 1 tasks. Run waves in se
|
|
|
117
119
|
|
|
118
120
|
1. **Independence check.** Assert pairwise-disjoint manifest `files`: Test/Test is allowed, Test/Create, Test/Modify and Modify/Modify overlap. Split overlaps into singleton waves. Trust the plan for runtime-resource disjointness; capture `WAVE_BASE_SHA` with `git -C <worktree> rev-parse HEAD`, print `wave <w> base <sha>` and hold it.
|
|
119
121
|
2. **Dispatch.** One one-step chain whose single `parallel` step contains only implementers, one item per task: `subagent({ async: false, context: "fresh", cwd: <worktree>, chain: [{ parallel: [{ agent: "implementer", as: "impl_<n>", outputSchema: IMPLEMENTER_STATUS_SCHEMA, output: "<REPORT_DIR>/wave<w>-task<n>.md", outputMode: "file-only", task: ... }], worktree: true, concurrency: 4, stopOn: { path: "/status", in: ["BLOCKED", "NEEDS_CONTEXT", "DONE_WITH_CONCERNS"] } }] })`. Use step `stopOn` to expose `## Outputs` structured JSON in the tool-result text; top-level `tasks` has no item schema and is not used. For manifest `"mode":"in-place"`: `cwd` the branch checkout, no `worktree:`, the wave union as `SCOPED_TEST_COMMANDS`. Payload is `planPath`, task anchor, spec path, `Leg:` with additive `Rules:` per [Leg routing](#leg-routing), `SCOPED_TEST_COMMANDS` (the task's own `tests` for isolated waves), status protocol. Dispatch no reviewer step after the implementers.
|
|
120
|
-
3. **Read and integrate.** Read each child's structured output and report under the bound above; print `wave <w> task <n> <status> report <path> patch <path>`. Isolated waves: `DONE` / `DONE_WITH_CONCERNS`
|
|
122
|
+
3. **Read and integrate.** Read each child's structured output and report under the bound above; print `wave <w> task <n> <status> report <path> patch <path>`. Isolated waves: before integrating `DONE` / `DONE_WITH_CONCERNS`, require an `Artifacts:` patch path and a successful `test -s <patch>`. A missing or zero-byte initial patch takes the transition-table repair row; apply nothing and retain siblings. A nonempty patch -> `git -C <worktree> apply --index <patch>` in plan index order, print `wave <w> integrated task <n>`; a nonempty initial patch that fails to apply prints `wave <w> task <n> apply failed`, leaves every already-integrated sibling staged, and stops with a stop note listing which tasks are integrated and which failed - no automatic rebuild (the human may ask for one, which runs the rebuild recipe below). In-place waves: nothing to apply; the checkout already carries the work. `BLOCKED` / `NEEDS_CONTEXT` -> the takeable-decision ladder below.
|
|
121
123
|
4. **Test gate.** Run each manifest test for the wave union separately, logs to `gate-<i>.log`; print `wave <w> gate <i> exit <code>`. A red gate enters step 6 as a gate repair for every task whose `files` the failing test belongs to (the manifest's `tests` owner), before any review; the review in step 5 runs only on a green gate.
|
|
122
124
|
5. **Review.** One `wave-reviewer` dispatch per wave, doc-only waves included (`context: "fresh"`, `async: false`, read-only, one-step carrier with `WAVE_VERDICT_SCHEMA` and `stopOn: { path: "/verdict", in: ["FIX_FIRST", "REJECT"] }`), `cwd` the integrated tree after `git -C <worktree> add -A`, with `planPath`, the wave's task `anchors`, `Spec:` (absolute home spec), `Leg:` with additive `Rules:` per [Leg routing](#leg-routing), `BASE_SHA: <WAVE_BASE_SHA>`, `HEAD_SHA: WORKTREE`, and the wave union as `SCOPED_TEST_COMMANDS` (`none` for a doc-only wave, so the reviewer runs nothing and applies the clause table and documentation checks only). Record the review tree per `## Fix delta`; print `wave <w> review <k> verdict <value> report <path> tree <sha>`. `SHIP` -> step 7; `FIX_FIRST` -> step 6; `REJECT` -> hard stop with a stop note.
|
|
123
125
|
6. **Repair round.** Attribute each finding to a task: the task whose manifest `files` contain the finding's file, else the tasks in the structured `touchedTasks`; a finding with neither a file inside any wave task's `files` nor a `touchedTasks` owner stops with `Recommendation: spec/plan amendment` through [delegated amendments](./reference/implement-amendments.md) - findings are never dropped from a repair payload. For each attributed task, dispatch one `implementer` on the current tree with the findings block or gate log as its task text, the prior report path under `## Previous review report`, the task's anchors, and `SCOPED_TEST_COMMANDS` (isolated: the task's own `tests`; in-place: the wave union), through the one-step carrier with no `context: "fresh"` override and no prior-patch path:
|
|
@@ -152,7 +154,8 @@ The redirected `diff --binary --cached` writes a file and loads nothing into the
|
|
|
152
154
|
| Event | Counts for task n | Next operation |
|
|
153
155
|
|---|---|---|
|
|
154
156
|
| Red gate at step 4 or after a repair (any implementer status, including `DONE`) | +1 for each task owning a failing test | repair from the gate log; no review until green |
|
|
155
|
-
| Dispatch error, missing structured output after diagnosis says `repair`, or `BLOCKED` / `NEEDS_CONTEXT` answered by the ladder | +1 | re-dispatch the
|
|
157
|
+
| Dispatch error, missing structured output after diagnosis says `repair`, or `BLOCKED` / `NEEDS_CONTEXT` answered by the ladder | +1 | For a ladder-answered `NEEDS_CONTEXT` / `BLOCKED` whose prior attempt produced no edits, re-dispatch the retained original payload verbatim with the answer appended under `## Answer to your BLOCKED question` into the tree the original attempt ran in (owning checkout for in-place and sequential tasks); ask the human nothing, because every required field is already retained in that payload, and use the registered `RP_TREE` or repair-base recipe only for isolated waves whose integrated tree changed. For dispatch errors and diagnosed repairs, re-dispatch the identical payload with neutral facts appended under `## Diagnosis context` (the initial chain exposed no structured output for the task, the diagnosis decision, and which siblings are retained); attribute no verdict or question to the prior implementer run, and dispatch into the registered `RP_TREE` with `worktree: true` for isolated waves; with no registered `RP_TREE`, first run the repair-base recipe on the current integrated tree and dispatch from the resulting `RP_TREE` with `worktree: true`. In-place waves dispatch into the owning checkout without `worktree:`. Reuse a registered `RP_TREE`; never remove, re-snapshot or rebuild it on re-dispatch |
|
|
158
|
+
| Missing or zero-byte initial patch for `DONE` / `DONE_WITH_CONCERNS` | +1 | apply nothing, retain siblings, and start a repair round on the current tree with "your work produced no patch" appended |
|
|
156
159
|
| Repair delta or in-place repair leaves `diff --stat` empty (`DONE` with an unchanged tree) | +1 | no re-review of the unchanged tree; next repair resends the prior report path with "your fix changed no tracked file" |
|
|
157
160
|
| Repair delta fails `git apply --index` | +1 | rebuild |
|
|
158
161
|
| Review 1 `FIX_FIRST` (no `TRAJECTORY:` line) | +1 for each attributed task | repair |
|
|
@@ -196,7 +199,7 @@ subagent({ async: false, context: "fresh", cwd: "<owning checkout>",
|
|
|
196
199
|
})
|
|
197
200
|
```
|
|
198
201
|
|
|
199
|
-
Keep context/async/cwd invocation-level; worktree/concurrency/stopOn step-level; as/output/outputMode/outputSchema/task item-level. Never use top-level `tasks`. Consume fenced structured JSON in `## Outputs` / `## Stop` from result text,
|
|
202
|
+
Keep context/async/cwd invocation-level; worktree/concurrency/stopOn step-level; as/output/outputMode/outputSchema/task item-level. Never use top-level `tasks`. Consume fenced structured JSON in `## Outputs` / `## Stop` from result text; admit the identity-matched capture as the second source after result text under [Chain stopped or failed](#chain-stopped-or-failed), never details or saved prose verdicts. Obtain patches from `Artifacts:` at `<Artifacts dir>/worktree-diffs/step-0/task-<i>-implementer.patch` (zero-based wave position). Keep known report paths. Require accepted statuses and a nonempty patch before initial isolated integration per step 3; count empty repair deltas through the transition table.
|
|
200
203
|
|
|
201
204
|
Run this guard once per implement phase before the first wave. Stop on any error before dispatch; read the peer floor from the installed gauntlet package, not the consumer repository.
|
|
202
205
|
|
|
@@ -248,17 +251,29 @@ Create `REPORT_DIR` with `mktemp -d`. Forward predecessor status and report path
|
|
|
248
251
|
|
|
249
252
|
### Chain stopped or failed
|
|
250
253
|
|
|
251
|
-
Retain accepted siblings; never repeat the initial chain or rerun accepted tasks. Inspect failed tasks alongside `## Stop`; a matched stop precedes sibling-error checking.
|
|
254
|
+
Retain accepted siblings; never repeat the initial chain or rerun accepted tasks. Inspect failed tasks alongside `## Stop`; a matched stop precedes sibling-error checking. Reconcile every dispatched task without a structured result in `## Outputs` or `## Stop`, including successful siblings suppressed by a chain failure. Repair rounds use this same recovery.
|
|
255
|
+
|
|
256
|
+
List captures once with `ls <Artifacts>/structured-output/*/output.json`. Read each listed file once with `limit: 300`, no offset or pagination. Accept only a complete `{"status":"success","value":{...}}` envelope whose `value` satisfies `IMPLEMENTER_STATUS_SCHEMA`: an allowed `value.status`, `question` for `NEEDS_CONTEXT`, `concerns` for `DONE_WITH_CONCERNS`, and exactly one identity. Match `value.anchor` to the dispatched anchor verbatim, or `value.anchors` to the dispatched heading list as a set. Read only this run's artifacts.
|
|
257
|
+
|
|
258
|
+
| Capture result | Action |
|
|
259
|
+
|---|---|
|
|
260
|
+
| One valid matching capture | Route `value.status` through Implementer Status and the transition table as an observed result. Reconcile accepted `DONE` / `DONE_WITH_CONCERNS` siblings through step 3 in plan index order before handling unanswered tasks; send `NEEDS_CONTEXT` / `BLOCKED` to the takeable-decision ladder. For a batch identity, route once for every task in that batch. Print the existing `wave <w> task <n> <status> report <path> patch <path>` observation per task. |
|
|
261
|
+
| Two captures claim the same dispatched identity | Stop naming both paths; never guess. |
|
|
262
|
+
| No file, error envelope, missing value, malformed/rejected schema, stale or unmatched identity, or a read truncated before the closing brace | Treat the task's capture as absent; diagnose below. |
|
|
263
|
+
|
|
264
|
+
Only a task with no accepted capture takes delegated identity-matched artifact diagnosis, once. Dispatch one sequential chain step, never a `parallel` item, with `agent: "delegate"`, `DIAGNOSIS_SCHEMA` and `stopOn` on `/decision`; put the literal sentence `Do not edit any file.` on its own line in the task text. After `decision: repair`, use the ordinary one-step implementer carrier.
|
|
252
265
|
|
|
253
266
|
```ts
|
|
254
267
|
subagent({ async: false, context: "fresh", cwd: "<owning checkout>",
|
|
255
|
-
chain: [{ task:
|
|
268
|
+
chain: [{ agent: "delegate", task: `Diagnose <run/task identities>; Artifacts: <dir>; known reports: <paths>; session artifacts: <locations>.
|
|
269
|
+
Do not edit any file.
|
|
270
|
+
Return compact statuses and retry/repair/stop; never invent a verdict.`,
|
|
256
271
|
output: "<REPORT_DIR>/wave<w>-diagnosis.md", outputMode: "file-only", outputSchema: DIAGNOSIS_SCHEMA,
|
|
257
272
|
stopOn: { path: "/decision", in: ["retry", "repair", "stop"] } }]
|
|
258
273
|
})
|
|
259
274
|
```
|
|
260
275
|
|
|
261
|
-
|
|
276
|
+
Keep this a sequential step, not a parallel item. Let the child alone inspect identity-matched session failure artifacts, not empty parallel-0 directories; diagnosis is not a saved-report relay. Route diagnosis JSON through the transition table. Missing/ambiguous artifacts or delegated failure stop; never recursively diagnose. An implementer anchor failure takes the failed-attempt path; reviewer anchorUnreadable hard-stops.
|
|
262
277
|
|
|
263
278
|
### Recovery
|
|
264
279
|
|
|
@@ -38,7 +38,7 @@ Dispatch a subagent with this prompt:
|
|
|
38
38
|
BLOCKED: Cannot complete the task.
|
|
39
39
|
NEEDS_CONTEXT: Need information not provided.
|
|
40
40
|
|
|
41
|
-
Keep the report layout and emit structured output matching the persona contract and report status. On an unreadable plan/anchor report BLOCKED with anchorUnreadable and the required Reasoning line.
|
|
41
|
+
Keep the report layout and emit structured output matching the persona contract and report status, copying exactly the dispatched anchor or anchors in every status. On an unreadable plan/anchor report BLOCKED with that identity, anchorUnreadable and the required Reasoning line; follow the persona's blocked-message rule.
|
|
42
42
|
|
|
43
43
|
Conduct (TDD scenarios, test economy, scope discipline, escalation, report shape) is your persona; this prompt carries only the task and its test scope.
|
|
44
44
|
```
|
|
@@ -7,7 +7,7 @@ Read these schemas and carrier rules before the first implement dispatch. Keep t
|
|
|
7
7
|
Mirror each child's saved report, not an independent verdict calculation. Bound implementer reasoning to one sentence and 300 characters; keep concerns and evidence entries one line each, questions explicit, and delegated answers one paragraph. Preserve `parallelSafe` as the `Parallel-safe:` line verbatim and `trajectory.line` as the `TRAJECTORY:` line verbatim. Use `measured` only for values an explicit `orchestrator` instruction consumes.
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
|
-
const IMPLEMENTER_STATUS_SCHEMA = {"type":"object","required":["status","reasoning"],"additionalProperties":false,"properties":{"status":{"type":"string","enum":["DONE","DONE_WITH_CONCERNS","NEEDS_CONTEXT","BLOCKED"]},"reasoning":{"type":"string","maxLength":300},"concerns":{"type":"array","items":{"type":"string"}},"question":{"type":"string"},"anchorUnreadable":{"type":"string"},"measured":{"type":"object"}},"allOf":[{"if":{"properties":{"status":{"const":"DONE_WITH_CONCERNS"}}},"then":{"required":["concerns"]}},{"if":{"properties":{"status":{"const":"NEEDS_CONTEXT"}}},"then":{"required":["question"]}}]};
|
|
10
|
+
const IMPLEMENTER_STATUS_SCHEMA = {"type":"object","required":["status","reasoning"],"additionalProperties":false,"properties":{"status":{"type":"string","enum":["DONE","DONE_WITH_CONCERNS","NEEDS_CONTEXT","BLOCKED"]},"reasoning":{"type":"string","maxLength":300},"anchor":{"type":"string"},"anchors":{"type":"array","items":{"type":"string"}},"concerns":{"type":"array","items":{"type":"string"}},"question":{"type":"string"},"anchorUnreadable":{"type":"string"},"measured":{"type":"object"}},"oneOf":[{"required":["anchor"]},{"required":["anchors"]}],"allOf":[{"if":{"properties":{"status":{"const":"DONE_WITH_CONCERNS"}}},"then":{"required":["concerns"]}},{"if":{"properties":{"status":{"const":"NEEDS_CONTEXT"}}},"then":{"required":["question"]}}]};
|
|
11
11
|
const WAVE_VERDICT_SCHEMA = {"type":"object","required":["verdict","reasoning","findingCount","findings"],"additionalProperties":false,"properties":{"reasoning":{"type":"string"},"findingCount":{"type":"integer","minimum":0},"parallelSafe":{"type":"string"},"touchedTasks":{"type":"array","items":{"type":"integer"}},"trajectory":{"type":"object","required":["verdict","line"],"additionalProperties":false,"properties":{"verdict":{"type":"string","enum":["CONVERGING","DIVERGING","STAGNANT"]},"line":{"type":"string"}}},"anchorUnreadable":{"type":"string"},"verdict":{"type":"string","enum":["SHIP","FIX_FIRST","REJECT"]},"maxSeverity":{"type":"string","enum":["Critical","Moderate","Minor"]},"findings":{"type":"object","required":["critical","moderate","minor"],"additionalProperties":false,"properties":{"critical":{"type":"integer","minimum":0},"moderate":{"type":"integer","minimum":0},"minor":{"type":"integer","minimum":0}}},"clauses":{"type":"array","items":{"type":"object","required":["clause","status","evidence"],"additionalProperties":false,"properties":{"clause":{"type":"string"},"status":{"type":"string","enum":["met","unmet","out-of-scope"]},"evidence":{"type":"string"}}}}}};
|
|
12
12
|
const ANSWER_SCHEMA = {"type":"object","required":["answer","evidence"],"additionalProperties":false,"properties":{"answer":{"type":"string"},"evidence":{"type":"array","items":{"type":"string"}}}};
|
|
13
13
|
const DIAGNOSIS_SCHEMA = {"type":"object","required":["tasks","decision","diagnostic"],"additionalProperties":false,"properties":{"tasks":{"type":"array","items":{"type":"object","required":["task","status","reportPath","diagnostic"],"additionalProperties":false,"properties":{"task":{"type":"integer"},"status":{"type":"string"},"reportPath":{"type":"string"},"patchPath":{"type":"string"},"diagnostic":{"type":"string"}}}},"decision":{"type":"string","enum":["retry","repair","stop"]},"diagnostic":{"type":"string"}}};
|
|
@@ -15,7 +15,7 @@ const PREPARE_SCHEMA = {"type":"object","required":["items","redraws"],"addition
|
|
|
15
15
|
const APPLY_SCHEMA = {"type":"object","required":["amendedSections","tasksAdded","tasksAnchorChanged","tasksRemoved","passed"],"additionalProperties":false,"properties":{"amendedSections":{"type":"array","items":{"type":"string"}},"tasksAdded":{"type":"array","items":{"type":"integer"}},"tasksAnchorChanged":{"type":"array","items":{"type":"integer"}},"tasksRemoved":{"type":"array","items":{"type":"integer"}},"passed":{"type":"boolean"},"failLines":{"type":"array","items":{"type":"string"}}}};
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Keep `APPLY_SCHEMA` unchanged. Interpret `tasksAnchorChanged` as semantic obligation or work changes against the original anchored obligation text, task bodies and Tests, not line offsets or meaning-preserving rewording; reopen completed tasks only for those semantic changes.
|
|
18
|
+
Keep `APPLY_SCHEMA` unchanged. Interpret `tasksAnchorChanged` as semantic obligation or work changes against the original anchored obligation text, task bodies and Tests, not line offsets or meaning-preserving rewording; reopen completed tasks only for those semantic changes. Derive that inventory from both committed home plan/spec originals through home-relative `git -C "<abs home worktree>" show HEAD:<path>` before edits and on idempotent retry; use previousApplyReport for prior findings only, never baseline copies. Recover a suppressed apply result from the sole capture under the existing bound, requiring a success envelope satisfying unchanged APPLY_SCHEMA; stop on zero/two files or malformed output. Route only the exact `baseline read failed: git -C ` prefix to a quoted immediate stop; every other false result keeps the one fresh retry.
|
|
19
19
|
|
|
20
20
|
## One-step carrier
|
|
21
21
|
|
|
@@ -35,6 +35,6 @@ For answer/evidence, preparation and apply results, retain their approved schema
|
|
|
35
35
|
|
|
36
36
|
## Anchored payload
|
|
37
37
|
|
|
38
|
-
Pass `planPath: <absolute plan path>`, `anchor: "### Task N:"` or `anchors: [<exact prefixes>]`, and `Spec: <absolute authoritative home spec path>` to every implementer and wave-reviewer. `### Task 4:` never matches `### Task 40:`; end each selected section at `^#{2,3}\s`. Children read the union of selected sections, `Spec:`, `Files:`, `Tests:`, `Rules:` and `Leg:` themselves. Combine task Rules with that leg's Rules in home `## Legs`; absent Leg uses the first `### Leg:`. Resolve rules in the owning checkout. Pass isolated implementers only their own task's manifest `tests` as `SCOPED_TEST_COMMANDS`, or `none` when empty, including isolated repairs. Give the integrated gate, in-place repairs and wave reviews the wave union; give initial in-place implementers that union too. Preserve command strings verbatim; keep dispatch-supplied commands independent of the Tests metadata children read.
|
|
38
|
+
Pass `planPath: <absolute plan path>`, `anchor: "### Task N:"` or `anchors: [<exact prefixes>]`, and `Spec: <absolute authoritative home spec path>` to every implementer and wave-reviewer. `### Task 4:` never matches `### Task 40:`; end each selected section at `^#{2,3}\s`. Require implementer returns to copy exactly one dispatched identity field (`anchor` or `anchors`) in every status, including unreadable anchors. Children read the union of selected sections, `Spec:`, `Files:`, `Tests:`, `Rules:` and `Leg:` themselves. Combine task Rules with that leg's Rules in home `## Legs`; absent Leg uses the first `### Leg:`. Resolve rules in the owning checkout. Pass isolated implementers only their own task's manifest `tests` as `SCOPED_TEST_COMMANDS`, or `none` when empty, including isolated repairs. Give the integrated gate, in-place repairs and wave reviews the wave union; give initial in-place implementers that union too. Preserve command strings verbatim; keep dispatch-supplied commands independent of the Tests metadata children read.
|
|
39
39
|
|
|
40
40
|
Forward dependent context as the prior status line plus report path. Put the saved prior report path under `## Previous review report (re-review trigger)`; require the child to read it and apply the existing trajectory block. Read report findings only under the bounded direct-read rule in SKILL.md; never dispatch a child to relay reports. Keep binary delta bytes child-owned.
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Read [amendment-surface.md](../../brainstorming/reference/amendment-surface.md) for the existing gate and Standing grants. Apply this delegation only during implement; keep the planning caller unchanged. Use the one-step carrier and schemas in [dispatch-contract.md](dispatch-contract.md) for every child, with saved output, file-only, fresh context and foreground execution.
|
|
4
4
|
|
|
5
5
|
1. Dispatch `plan-writer` with `Amend-prepare:`, the five absolute paths (worktree, approved spec, plan, plan skill and plan contract) and the evidence already in context: plan_check FAIL lines, structured concerns/question or measured baseline rows. Include the literal sentence `Do not edit any file.` in the `Amend-prepare:` task text. Preparation writes nothing. Require `{ items: [{ evidence, recommended: "accept" | "alt-<n>", location: "<spec section>", edit: string }], redraws: [{ location: "<spec section>", reason: string (max 300 characters) }] }`; keep each edit one paragraph. Keep the existing menu spelling `alt-n` for a named alternative; encode the selected number as `alt-<n>` in JSON. Require both items and redraws arrays, including empty arrays; put redraws only in redraws, never items. Fail malformed preparation output.
|
|
6
|
-
2. Inspect structured redraws first. A nonempty array holds the whole batch at the redraw gate before grant evaluation or applying any sibling item, for redraw-only and mixed batches alike. Never open the preparation report to discover redraws. With no redraws, delegate reading the current `Amend-grant:` and Value decoding through the answer/evidence carrier. Preserve the surface's grant predicate: malformed -> stop and quote; absent, none or no permission -> the existing human menu and escalation gate. Stop on changed problem statement or a component added, removed or re-bounded.
|
|
7
|
-
3. With amend permission, apply the recommended choice without reviewer, menu or confirmation turns; pass granted items verbatim to `plan-writer` under `Amend-apply:` plus the existing `Amend:` entry and parent-supplied `In-flight:` paths from `status --porcelain`, including staged in-place repair deliverables. Preserve Baseline ownership, protected-path and dirty-baseline exits; delegate attribution reads and human wording instead of loading documents in the primary. Authorize only the named spec sections and local patches to affected task entries, coverage and shifted anchors; preserve unaffected ids, titles, wave order, state and evidence. Use the implement-only historical Baseline policy, not wholesale regeneration. Admit declared in-flight repairs, including staged source, for maintenance requiring no execution; preserve staged repairs rather than committing, restoring or discarding them merely to plan. For necessary runs require an identified execution tree and nonzero executed-test count; stop on unidentified dirt, contamination or moved test revision.
|
|
8
|
-
4. Consume the unchanged apply result `{ amendedSections: string[], tasksAdded: number[], tasksAnchorChanged: number[], tasksRemoved: number[], passed: boolean, failLines?: string[] }`.
|
|
6
|
+
2. Inspect structured redraws first. A nonempty array holds the whole batch at the redraw gate before grant evaluation or applying any sibling item, for redraw-only and mixed batches alike. A nonempty `redraws` array stops before prescribing or templating any further plan-writer dispatch in any mode: prepare, apply or revalidation. Never open the preparation report to discover redraws. With no redraws, delegate reading the current `Amend-grant:` and Value decoding through the answer/evidence carrier. Preserve the surface's grant predicate: malformed -> stop and quote; absent, none or no permission -> the existing human menu and escalation gate. Stop on changed problem statement or a component added, removed or re-bounded.
|
|
7
|
+
3. With amend permission, apply the recommended choice without reviewer, menu or confirmation turns; pass granted items verbatim to `plan-writer` under `Amend-apply:` plus the existing `Amend:` entry and parent-supplied `In-flight:` paths from `status --porcelain`, including staged in-place repair deliverables. Preserve Baseline ownership, protected-path and dirty-baseline exits; delegate attribution reads and human wording instead of loading documents in the primary. Authorize only the named spec sections and local patches to affected task entries, coverage and shifted anchors; preserve unaffected ids, titles, wave order, state and evidence. Use the implement-only historical Baseline policy, not wholesale regeneration. Admit declared in-flight repairs, including staged source, for maintenance requiring no execution; preserve staged repairs rather than committing, restoring or discarding them merely to plan. For necessary runs require an identified execution tree and nonzero executed-test count; stop on unidentified dirt, contamination or moved test revision. Require both committed home plan/spec originals to be read through home-relative `git -C "<abs home worktree>" show HEAD:<path>` before any edit. Compare task numbers, titles, anchors, wave positions, anchored obligations, bodies and Tests against those originals, not dirty retry content; preserve semantic-only tasksAnchorChanged. Add no sidecar or report-carried inventory.
|
|
8
|
+
4. Consume the unchanged apply result `{ amendedSections: string[], tasksAdded: number[], tasksAnchorChanged: number[], tasksRemoved: number[], passed: boolean, failLines?: string[] }`. With no printed structured result, read the sole capture at `<Artifacts>/structured-output/*/output.json` for this one-task dispatch using the existing `read` bound `limit: 300`, no offset or pagination. Require a success envelope whose value satisfies unchanged `APPLY_SCHEMA`; zero or two files stops naming paths, and malformed output stops. Route captured `passed`/`failLines` exactly like printed JSON; never recover from prose. Only a failLines entry beginning exactly `baseline read failed: git -C ` stops immediately without retry, quoting the failed command and stderr in the stop note. For every other `passed: false`, retry once in a fresh child with failLines as the rule and `previousApplyReport` set to the first apply report path for prior findings only. Require rereading both committed home plan/spec originals, idempotent granted edits without duplicates, and deltas against those originals. Escalate a second failure; never repeat granted edits blindly.
|
|
9
9
|
Match retained failures by failing command, assertion or path plus corresponding repair evidence, never task membership. Preserve failed revision/output and resolving evidence; route outstanding repairs to their existing task gate loop and keep unrelated regressions substantive blockers. Decode the standing grant at each batch boundary. Repeated authorized intermediate evidence is neither new consent nor a refresh trigger; keep budget-only, malformed-grant and redraw stops and the existing funding unchanged.
|
|
10
10
|
|
|
11
11
|
5. After child success, run parent `plan_check({ planPath })`. Reconcile only after parent PASS: replace the manifest; use tracker update and `add` for tasksAdded, reopen completed tasksAnchorChanged as `in_progress`, and handle tasksRemoved through the surface's existing path. Print `amended the spec: <title> - <what>` from structured item location/edit observations, and make the existing single `amend:` audit commit. Keep the parent from opening spec, plan or reports. Persist measured values from explicit orchestrator instructions through this same path.
|
|
@@ -36,7 +36,7 @@ If no spec exists, recommend `/skill:brainstorming` and await the user's explici
|
|
|
36
36
|
- Dispatch `plan-writer` to write the plan to the sibling `plans/` dir of the spec: yes; the main loop never writes it
|
|
37
37
|
- Edit or create any other files: no
|
|
38
38
|
- Write implementation code: never inside this skill. After Self-Review + `phase_tracker` complete, auto-invoke `/skill:subagent-driven-development` to execute.
|
|
39
|
-
-
|
|
39
|
+
- Commit the plan on the worktree branch (same branch as the spec) at Execution Handoff; never land it on `main`.
|
|
40
40
|
- Edit the approved spec: only via brainstorming's [Amending an approved spec](../brainstorming/SKILL.md#amending-an-approved-spec)
|
|
41
41
|
|
|
42
42
|
## Scope Check
|
|
@@ -294,11 +294,11 @@ If a decision is genuinely open, put it in an explicit **Open Questions** sectio
|
|
|
294
294
|
|
|
295
295
|
The plan-writer runs Baseline, the deterministic checker, then the judgment checks before replying.
|
|
296
296
|
|
|
297
|
-
- **Implement-local Baseline (`Amend-apply:` only).** Use this branch instead of ordinary Baseline steps 1-4 during implement; keep initial planning and ordinary Findings/Amend below unchanged. Write `**Baseline policy:** implement-local` only in this mode. Preserve original per-leg declarations and valid unchanged command bullets at their measured revisions, including derived-pass, skipped and artifact suffixes; perform no endpoint-tree equivalence or rerun-all sweep.
|
|
297
|
+
- **Implement-local Baseline (`Amend-apply:` only).** Use this branch instead of ordinary Baseline steps 1-4 during implement; keep initial planning and ordinary Findings/Amend below unchanged. Write `**Baseline policy:** implement-local` only in this mode. Preserve original per-leg declarations and valid unchanged command bullets at their measured revisions, including derived-pass, skipped and artifact suffixes; perform no endpoint-tree equivalence or rerun-all sweep. Read both committed home plan/spec originals before editing using the two home-relative HEAD reads in plan-writer's `Amend-apply:`; use the committed plan for historical evidence. For retained skipped evidence whose anchors now exist, copy its exact leg, command and bullet value into the existing provenance note as `Baseline provenance: retained <leg or home> | <exact command> | <exact baseline value>`; require matching evidence in the committed plan original, never invent a skip or execution.
|
|
298
298
|
1. Inventory status using ordinary step 1 before maintenance and before/after each run. Admit only explicit parent `In-flight:` paths, spec/plan and eligible recorded artifacts. Unknown dirty paths block. With no test execution needed, preserve declared staged repairs without committing, restoring or discarding them.
|
|
299
299
|
2. Run only changed/added commands or missing/invalid evidence, exact or documented derived scoped commands by the ordinary selector procedure. Count already-created anchors as existing; create new skipped evidence only when all anchors are truly absent at the execution revision. Retained historical skips describe their recorded revision, not current existence.
|
|
300
300
|
3. Require an identified execution tree: current or retained implementation with revision and admitted changes identified, or an existing parent-owned committed snapshot. Never label a dirty run as clean HEAD. Stop on unidentified trees; create no snapshot, source edit or restoration yourself. Record leg, checkout, revision, admitted changes, exact/derived command, exit and nonzero executed-test count in the existing provenance and saved report. Exit 0 with zero tests fails. Apply ordinary contamination/artifact rules, stop on unknown dirty paths or moved test revision, and retain failed revision/output plus subsequent resolving evidence.
|
|
301
|
-
4. Match retained failures by failing command, assertion or path plus corresponding repair evidence, never task membership. Return outstanding repairs to the existing task gate loop; keep unrelated regressions substantive blockers. Preserve failure history in the report while removing only resolved Open Questions rows. Keep parent stamp, integrated gate, review and final verification mandatory. Explicit `Findings: rerun baseline` overrides this branch: execute all commands, remove the implement-local header and restore ordinary uniform evidence; preserve
|
|
301
|
+
4. Match retained failures by failing command, assertion or path plus corresponding repair evidence, never task membership. Return outstanding repairs to the existing task gate loop; keep unrelated regressions substantive blockers. Preserve failure history in the report while removing only resolved Open Questions rows. Keep parent stamp, integrated gate, review and final verification mandatory. Explicit `Findings: rerun baseline` overrides this branch: execute all commands, remove the implement-local header and restore ordinary uniform evidence; preserve prior failure findings in the report.
|
|
302
302
|
- **Baseline.** Execute the numbered procedure below for task `Tests:` commands only; leave header `**Verification:**` to verify. Never author baseline evidence without execution or a recorded tree-equivalence.
|
|
303
303
|
1. Read provenance: `BASE=$(git -C "<abs worktree path>" rev-parse --short HEAD)` and `git -C "<abs worktree path>" status --porcelain --untracked-files=all`. Match every `XY <path>` entry (including `??`) against the worktree-relative plan and spec paths, plus only the parent-supplied `In-flight:` paths on an `Amend:` re-dispatch; never infer that set. Also allow untracked paths already recorded in existing baseline bullets' ` - artifacts:` suffixes in the plan at the plan path, excluding every plan `Create:` or `Test:` path. Keep those suffixes on retained bullets. Any other entry blocks all commands: collect `- Baseline: worktree dirty on <BASE>: <paths>`. Allowed in-flight paths outside the spec and plan directories are source edits: collect `- Baseline: in-flight source edits on <BASE>: <paths>` and run nothing. Allow doc-only workflow edits. For plain jj (no `.git`, VCS kind `jj`), use `BASE=$(jj -R "<abs worktree path>" log -r @- --no-graph -T 'commit_id.short()')` and `jj -R "<abs worktree path>" diff --summary`; classify one-letter status and relative paths identically (`A` includes new files). Never revert or clean anything. Record a short baseline provenance note with the initial per-file inventory, BASE, and which exact paths were admitted before running commands; retain it even when a later run is contaminated or blocked.
|
|
304
304
|
2. On Findings/Amend, before any command runs, use step 1's BASE and prove endpoint-tree equivalence once per distinct recorded SHA in the plan. Derive `<spec dir>` and `<plan dir>` as the worktree-relative directories of the dispatched spec and plan paths. Run `git -C "<abs worktree path>" diff --quiet <recorded> <BASE> -- . ':!<spec dir>/' ':!<plan dir>/'`; only exit 0 proves equivalence. Keep the trailing `/` directory boundaries. For plain jj, run `jj -R "<abs worktree path>" diff --from <recorded> --to <BASE> --summary`: require exit 0 and empty stdout after dropping entries whose paths all lie under `<spec dir>/` or `<plan dir>/`. Reject entries that do not parse as `<status> <path>`; exclude stderr from filtered evidence. Prove every recorded SHA before rewriting any bullet; retention is all-or-nothing.
|
|
@@ -327,7 +327,7 @@ The plan-writer runs Baseline, the deterministic checker, then the judgment chec
|
|
|
327
327
|
- Under each contamination/global row indent `blocked: Task M `<command>`` for every command it blocked. Keep failure output verbatim, including `TODO` or `etc.` inside valid continuation fences; only those evidence fences are exempt from placeholder scanning.
|
|
328
328
|
|
|
329
329
|
With substantive rows remaining reply `OPEN QUESTIONS <abs plan path>` immediately; do not spend repair rounds on them.
|
|
330
|
-
- **Implement-local patch (`Amend-apply:` only).**
|
|
330
|
+
- **Implement-local patch (`Amend-apply:` only).** Derive original task numbers, titles, anchors, anchored obligation text, task bodies, Tests and wave positions from both committed home plan/spec originals using home-relative HEAD reads before any edit and on every retry. Use `previousApplyReport` for prior findings only, not baseline copies. Patch affected entries, coverage and shifted anchors only, preserving unaffected text, state and evidence. Compare semantic obligations/work, ignoring line shifts and meaning-preserving rewording; return no completed task in `tasksAnchorChanged` for a pure offset move. Keep full-file write mechanics, idempotent retry, write-free failed original reads and parent stamping.
|
|
331
331
|
- **Deterministic checker.** Run `plan_check({ planPath: "<abs plan path>" })` on the saved plan. Repair every `baseline-line` finding (missing, malformed, misplaced, invalid skipped/pass via or differing SHAs) and substantive baseline `open-questions` finding only through Baseline, never by authoring `pass`/`skipped` evidence or deleting/rewording a row. Normalize `## Open Questions malformed` into `- ` rows without changing substantive text. Fix every other finding yourself and rerun. With substantive rows remaining, reply `OPEN QUESTIONS <abs plan path>` without a passing check. Apply the 3-round budget only to ordinary findings: convert a finding surviving 3 rounds to an Open Questions row and stop. A child pass validates; the parent's call writes the execution stamp. Omit an empty questions section and reply `PLAN WRITTEN <abs plan path>` after all checks pass. Findings are defined in [reference/plan-contract.md](reference/plan-contract.md).
|
|
332
332
|
- **Contract decisions.** For every task crossing a boundary the spec leaves unsettled (a host-forwarded value, a caller's error type), derive the decision from code, the harness contract, or a sibling task. State `Decision: <what> - <caller/contract/sibling task cited>` in the task text. Ask only when the spec is silent or wrong and no source settles it; put that unresolved contract in Open Questions. Add no per-task `Decisions:` field.
|
|
333
333
|
- **Code-vs-anchor sanity.** For each task-owned requirement row, re-read the anchored spec lines and confirm the owner tasks' bodies do what they say - mechanism present, not just the quoted literal. For each `Verification` row, confirm the header command exercises the anchored requirement. Fix the task, don't annotate.
|
|
@@ -353,7 +353,7 @@ Fix what this review finds before handoff.
|
|
|
353
353
|
|
|
354
354
|
## Execution Handoff
|
|
355
355
|
|
|
356
|
-
After the parent `plan_check` passes and the plan has been read once (`## Author the plan` step 7), mark the planning phase complete
|
|
356
|
+
After the parent `plan_check` passes and the plan has been read once (`## Author the plan` step 7), check the plan-scoped status on the home worktree branch: `git -C "<abs home worktree>" status --porcelain -- "<home-relative plan path>"`. On empty output, skip staging and commit. On nonempty output, stage and commit only the home-relative plan: `git -C "<abs home worktree>" add -- "<home-relative plan path>"` then `git -C "<abs home worktree>" commit -m "plan: <spec title>" -- "<home-relative plan path>"`. Stop on any status, staging or commit failure; never stage unrelated source. Then mark the planning phase complete and initialize `plan_tracker` once with every plan task in wave order. Name each entry `W<k>: <title>` using its containing wave and task title. This is the execution list: do not initialize it again on continuation.
|
|
357
357
|
|
|
358
358
|
```
|
|
359
359
|
phase_tracker({ action: "complete", phase: "plan" })
|
|
@@ -44,7 +44,7 @@ Commands are written repo-relative and run in the worktree via `(cd "<abs worktr
|
|
|
44
44
|
|
|
45
45
|
Write the optional header `**Baseline policy:** implement-local` only from implement-phase `Amend-apply:`. Reject duplicate, misplaced, empty or unknown policy values. Absence preserves ordinary uniform-SHA checks. In local mode retain one valid original `Baseline <repo>: <sha>` declaration per admitted leg; allow genuinely evidenced mixed per-command revisions within that leg without implying freshness at current HEAD. Keep syntax, adjacency, leg ownership and anchor checks unchanged.
|
|
46
46
|
|
|
47
|
-
Count an existing Test path still declared Create as existing for new derived evidence; create new skipped evidence only for truly absent all-created anchors. Retain historical skipped evidence even when its anchors now exist only with matching original evidence in the
|
|
47
|
+
Count an existing Test path still declared Create as existing for new derived evidence; create new skipped evidence only for truly absent all-created anchors. Retain historical skipped evidence even when its anchors now exist only with matching original evidence in the committed plan from the committed home plan/spec originals and existing provenance note: `Baseline provenance: retained <leg or home> | <exact command> | <exact baseline value>`. The value is the whole text after `- baseline: `, including suffixes. The checker matches this note by leg, exact command and value; the writer owns validating the historical observation against the committed plan original, reread via `git -C "<abs home worktree>" show HEAD:<home-relative plan path>` before edits and on every retry; use previousApplyReport for prior findings only. Preserve pass-via and artifact suffixes byte-identically on retention. Explicit full refresh executes all commands and restores ordinary uniform evidence; never infer mode from mixed SHAs.
|
|
48
48
|
|
|
49
49
|
## Open Questions (`open-questions`)
|
|
50
50
|
|