cadre-ai 3.9.0 → 3.9.1
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +37 -0
- package/README.md +5 -5
- package/dist/cadre-cli.mjs +1 -1
- package/dist/cadre-mcp.mjs +376 -108
- package/package.json +1 -1
- package/skills/archive/SKILL.md +2 -0
- package/skills/implement/SKILL.md +4 -2
- package/skills/implement/references/governed-mode.md +1 -1
- package/skills/revert/SKILL.md +5 -1
- package/skills/review/SKILL.md +13 -11
- package/skills/revise/SKILL.md +1 -1
- package/skills/track/SKILL.md +1 -1
package/package.json
CHANGED
package/skills/archive/SKILL.md
CHANGED
|
@@ -49,6 +49,8 @@ Preserve phase history and existing handoffs. For active v3/v4/v5 tracks, keep t
|
|
|
49
49
|
|
|
50
50
|
## Evidence quality and proposal identity
|
|
51
51
|
|
|
52
|
+
V5 archive prepare returns `stateChanges` for each moved track state and project history. Read its `sourcePath`, apply the exact `set`/array `append` changes, and serialize with two-space indentation and a trailing newline; verify the returned SHA-256 for the final `path`. Include these automatic status, checkpoint, history and operation-reference changes in the same archive approval envelope. Preserve all other source fields and historical artifacts.
|
|
53
|
+
|
|
52
54
|
Before promoting an observation into a pattern, verify it against actual imports, source and relevant tests; distinguish observed facts, hypotheses and scope decisions. Hashes establish freshness, not truth. Do not infer that an assertion is loose from its method name without checking the imported module, or that no I/O implies no trust boundary. Correct mistaken historical claims explicitly in new guidance with evidence, preserving completed history.
|
|
53
55
|
|
|
54
56
|
Prepare results describe prospective operation paths; check disk before claiming that a journal exists or is duplicated. Apply alone persists the archive journal. The public proposal digest binds the complete preview; the persisted approvalDigest binds the batch inputs/updates. They serve different purposes. Resume using the persisted batch identity, approved file hashes and actual artifact commit; do not interpret the differing digests alone as source drift.
|
|
@@ -33,8 +33,8 @@ Read only the references required by current state:
|
|
|
33
33
|
## Entry and modes
|
|
34
34
|
|
|
35
35
|
1. Call `project_status` once with `view: "implementation"`, `trackId`, and the known persisted `executionId` if resuming. Omit `executionId` (or use null) when unknown; never infer it from the track ID. This is the complete preflight: validation, graph, scheduler, dependency, and worktree state; do not repeat `state_validate` at command entry. Stop if `valid` or `graph.valid` is false, `upgradeRequired` is true, the track is candidate-only, or the MCP is unavailable. Follow `nextStep` before choosing an implementation node. A review handoff or pending final approval does not require a ready node or another `execution_start`.
|
|
36
|
-
2. Use `context_read` for the selected ready or resumed node (`projectRoot`, `trackId`, optional `executionId`, `nodeId`). Consume every `nextCursor` page until `complete: true`; stop on returned errors or relevant `staleMemory`. This supplies `.cadre/workflow.md`, full spec/plan, relevant learning, and pattern/styleguide sources. Read repository instructions and relevant code/callers/tests separately. Read full state or other artifacts before editing them. Reuse unchanged sources already loaded in this session by path/hash; a source hash is not a substitute for reading it after context loss.
|
|
37
|
-
3. Scheduling defaults to `parallel`; use `sequential` only when requested. Approval mode defaults to `track`; use `governed`, `phase`, or `autonomous` only when explicitly requested. Resume journaled modes. Stop on `APPROVAL_MODE_MIGRATION_REQUIRED` and use the approved refresh migration; never reinterpret legacy Autonomous authority. A mode authorizes only work bounded by the approved spec and plan.
|
|
36
|
+
2. Use `context_read` for the selected ready or resumed node (`projectRoot`, `trackId`, optional `executionId`, `nodeId`). Copy the exact node ID from the returned graph or scheduler, such as `P1` or `T1.1`; a track ID, phase title/slug, or commit-group name is not a node ID. For a commit group, read its phase or a member task. Consume every `nextCursor` page until `complete: true`; stop on returned errors or relevant `staleMemory`. This supplies `.cadre/workflow.md`, full spec/plan, relevant learning, and pattern/styleguide sources. Read repository instructions and relevant code/callers/tests separately. Read full state or other artifacts before editing them. Reuse unchanged sources already loaded in this session by path/hash; a source hash is not a substitute for reading it after context loss.
|
|
37
|
+
3. Scheduling defaults to `parallel`; use `sequential` only when requested. Approval mode defaults to `track`; use `governed`, `phase`, or `autonomous` only when explicitly requested. Treat `auto` as an alias for the `autonomous` approval mode; it does not change scheduling defaults. Resume journaled modes. Stop on `APPROVAL_MODE_MIGRATION_REQUIRED` and use the approved refresh migration; never reinterpret legacy Autonomous authority. A mode authorizes only work bounded by the approved spec and plan.
|
|
38
38
|
4. For a new execution, the implement invocation authorizes `execution_start`; call it once with the modes. Do not add a start approval outside `governed`. Resume an existing operation instead of creating another.
|
|
39
39
|
|
|
40
40
|
`governed` pauses for regular task diffs and integrations. `phase` runs regular phase work autonomously and pauses at each phase's final `User Manual Verification`. `track` also performs phase verification autonomously and pauses at `Track-level User Manual Verification`, then hands off to ordinary review. `autonomous` performs all available verification, invokes review, and implements in-scope remediation until clean; it pauses for one explicit final completion approval.
|
|
@@ -81,6 +81,8 @@ Follow `nextStep` from focused `project_status` and `execution_finish` using its
|
|
|
81
81
|
|
|
82
82
|
Satisfy `prerequisite` before handoff: `implementation_bookkeeping_commit` means finish and commit the implementation journal/plan/state/index; `review_bookkeeping_commit` means finish review promotion, provenance, commits, and operation clearance. Check Git and journal evidence on resume so an already satisfied prerequisite does not create another commit. `await_approval` routes to review to revalidate evidence, prepare the exact completion proposal, and obtain the missing human decision. `blocked` stops automatic work with its reason. `null` supplies no Autonomous continuation and leaves ordinary mode gates in effect. MCP returns routing data; the agent performs the skill invocation. Routing never grants new authority or replaces validation.
|
|
83
83
|
|
|
84
|
+
For v5, a reachable verified receipt satisfies its bookkeeping prerequisite; status then returns a null prerequisite. A retried `execution_finish` may return `receipt.status: committed` and no changed paths: continue to review without another commit. The completed execution HEAD remains the verified product commit; never replace it with a bookkeeping HEAD just to make the two SHAs equal.
|
|
85
|
+
|
|
84
86
|
## Direct-main checkpoint order
|
|
85
87
|
|
|
86
88
|
Start the ready phase once. For a commit group, follow `readyGroups` and execute internal dependencies in order, retaining verification, authorization and handoff for every task. Make one product commit for the cohesive change; then call `execution_checkpoint` with `event: "complete_group"`, the shared `commit`, and `tasks: [{nodeId, verification, authorization, handoff}, ...]` containing every member exactly once. The transition is atomic. Independent groups may use isolated worker worktrees; integrate their product commit before atomic completion.
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Governed mode requires human review of each regular task diff before its commit, every conflict resolution, each manual-verification barrier, and each integration or other material mutation required by the approved workflow.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Present a ready diff once and proceed only after explicit approval. The checkpoint API has no standalone `awaiting_approval` event: preserve a paused, uncommitted task with `event: "block"`, its verification and handoff, and a blocker explaining the pending task-diff approval. After approval use the returned `resume` guidance before recording the approved commit or completing its group. Never invent an event or record authorization before the decision. Bind integration approval to the `integration` prepare digest. After approval call the same tool with only `request: { mode: "apply", proposalToken }`; changed content or Git/state drift requires a fresh prepare and decision.
|
|
6
6
|
|
|
7
7
|
Do not convert deterministic bookkeeping or cleanup following the approved unchanged operation into another decision.
|
package/skills/revert/SKILL.md
CHANGED
|
@@ -41,6 +41,8 @@ A task sharing a product commit cannot be reverted alone. Enumerate every task u
|
|
|
41
41
|
|
|
42
42
|
After the authorized additive Git reversal commits, use `candidate_apply` prepare/apply with `workflow: "revert"` for the approved reconciliation manifest. Include the actual reversal receipt, original journal snapshot, restored execution bindings, plan, learning and dependency context. This replaces direct promotion and steps 6–7's two-commit bookkeeping on v5. Make one reconciliation commit with the immutable operation receipt and exact trailers; reconcile it without filling a self-referential SHA or making a record-revert commit. Never repeat recorded reversal commits on recovery.
|
|
43
43
|
|
|
44
|
+
The pre-reversal authorization binds the `candidate_inspect` digest, exact authored reconciliation files, Git targets and resulting semantics. A pre-reversal `candidate_apply` preview is a structural check, not a token to apply after Git changes: its digest also binds HEAD and canonical state. After the approved reversal, prepare the final promotion from the same approved files plus the explicitly authorized reversal record with actual SHAs and approval fields. Verify that every authored file still matches the approved inspection, except those named bookkeeping consequences, and that runtime `stateChanges` preserve the approved execution ownership. Apply that post-reversal token under the original combined approval only when all consequences remain within that envelope. Changed product semantics, targets, artifacts or dependencies require a corrected proposal and approval. Do not apply a stale pre-reversal token or ask again solely because the authorized reversal advanced HEAD.
|
|
45
|
+
|
|
44
46
|
## Memory contract
|
|
45
47
|
|
|
46
48
|
Preserve phase history and existing handoffs. For active v3/v4/v5 tracks, keep the marked `cadre:memory` JSON block inside Pattern Seed synchronized with the proposed spec/plan revisions and exact approved pattern hashes. Every applicable pattern requires its safe `patterns/<slug>.md` path, SHA-256, and human-readable relevance/constraints; never invent or silently omit guidance. When a staged plan changes revisions, include the reassessed learning file in `expectedFiles`. Inspect `candidate_inspect.learning` and `memoryInputs` as well as `plans`; resolve invalid or stale memory before approval. Immediately before direct promotion, re-inspect and compare the complete approved digest, including unchanged memory inputs; changed inputs require reassessment and a corrected approval. Archive apply performs this check in the runtime. Completed and archived learning remains historical evidence, not a claim that old hashes describe current patterns.
|
|
@@ -51,10 +53,12 @@ Preparation is read-only outside the declared candidate stage. Never run `git re
|
|
|
51
53
|
|
|
52
54
|
When temporarily replacing an implement operation with the approved revert operation, preserve `lastExecution: {executionId, journal, planRevision, graphDigest, headCommit, completedAt, approvalMode}` throughout the repair, copying those values from the persisted journal (including null head/completion values on an active run); include that exact proposed state in staging. After reconciliation restore the original implement operation, with the selected task pending as approved, before clearing the temporary revert. Preserve every handoff and original task SHA as evidence; workerHistory contains worker IDs, never commit SHAs. Never clear both execution references while a journal is in progress. Include state, execution journal, plan and reassessed learning in the single proposal. Do not change plan revisions or task descriptions merely to reset completion markers.
|
|
53
55
|
|
|
54
|
-
Candidate paths never include a leading `.cadre/`: use `state.json`, `plan.md`, `learning.md`, `executions/execution-<id>.json`, and `reverts/revert-<id>.md` for the owned track, or `tracks/<id>/...` for nested updates. The stage already supplies the root. Use `candidate_inspect` to validate the full proposed overlay before asking for approval.
|
|
56
|
+
Candidate paths never include a leading `.cadre/`: use `state.json`, `plan.md`, `learning.md`, `executions/execution-<id>.json`, and `reverts/revert-<id>.md` for the owned track, or `tracks/<id>/...` for nested updates. Revert artifact IDs use lowercase letters, digits and hyphens: for target `T1.1`, use `reverts/revert-t1-1.md` and `reverts/revert-t1-1-execution-before.json`, while retaining `targetId: "T1.1"` in the evidence. Do not put uppercase node IDs or dots in artifact basenames. The stage already supplies the root. Use `candidate_inspect` to validate the full proposed overlay before asking for approval.
|
|
55
57
|
|
|
56
58
|
Stage the final post-reconciliation state, retaining the original implement operation, rather than a temporary revert operation containing unknown approval fields. After approval, materialize the temporary revert journal from the template with the actual digest/time before Git mutation, retaining the execution binding in lastExecution. The final staged state restores implement ownership. Do not put unresolved approval placeholders or a self-referential digest into approved candidate bytes.
|
|
57
59
|
|
|
60
|
+
V5 `candidate_apply` prepare returns `stateChanges` for runtime-derived fields: apply each `set` or array `append` to the staged state (or canonical state when none was staged), then verify the reconstructed final state against its returned manifest hash. A changed state hash alone does not mean execution ownership was removed. Include these exact derived changes in the reviewable proposal; never inspect the installed runtime to reconstruct them.
|
|
61
|
+
|
|
58
62
|
## Legacy SHA durable revert receipt
|
|
59
63
|
|
|
60
64
|
When resetting node evidence, stage the exact original execution journal as `reverts/revert-<id>-execution-before.json` before changing the proposed journal. Include it in the same inspected manifest and approval. This preserves original verification, authorization, commit pointers and handoffs; keeping only the old commit SHA is insufficient. Preserve all other nodes and derived dependencies. Set the proposed journal checkpoint to `reverted:<target-id>` so status does not claim the reset task remains completed.
|
package/skills/review/SKILL.md
CHANGED
|
@@ -27,7 +27,7 @@ Call `project_status` first with `view: "track"` and `trackId`; use its embedded
|
|
|
27
27
|
|
|
28
28
|
Build one bounded context inventory from `project_status`, the current track paths, and the reviewed Git range. Read each required artifact once. Do not run a line-count pass before reading, repeat `rg --files` discovery, or reread a whole file after truncated output; continue from the first unread line. During consecutive review cycles in the same flow, reuse unchanged product, workflow, pattern, and styleguide context and verify it by Git path/hash; reread the current state, plan, execution, new review range, and affected files/callers. Use batched parallel reads where independent.
|
|
29
29
|
|
|
30
|
-
The declared review mutation surface is adaptive `review_complete` for clean completion.
|
|
30
|
+
The declared review mutation surface is adaptive `review_complete` for clean completion and `candidate_apply` for v5 remediation. Legacy recovery uses its original explicitly journaled direct-write procedure. Do not inspect the installed runtime, global tool catalog, or generated MCP bundle looking for another review-state tool.
|
|
31
31
|
|
|
32
32
|
Expected human decision count is one per review cycle outside policy-v2 Autonomous when the human accepts the recommended exact remediation, approves a clean review, or explicitly rejects findings and approves clean completion. Ask again only when the human changes the proposal or new evidence changes its content or consequences.
|
|
33
33
|
|
|
@@ -36,14 +36,14 @@ Expected human decision count is one per review cycle outside policy-v2 Autonomo
|
|
|
36
36
|
1. Read the completed execution journal and review its exact `baseCommit..headCommit` range (Autonomous uses persisted `initialBaseCommit..headCommit` across all remediation executions), which includes the first implementation commit. Inspect diffs and affected callers, tests, security boundaries, error paths, compatibility, acceptance criteria, and non-functional requirements.
|
|
37
37
|
2. Run relevant verification without mutating production behavior. Report findings by severity with file/line evidence, impact, reproduction, and proposed acceptance criteria. Do not write a bug file yet.
|
|
38
38
|
3. Prepare one decision-ready proposal before asking for approval (Autonomous binds in-scope findings to persisted authorization as described below):
|
|
39
|
-
- If findings exist, call `template_get_many` for `track/bug`, then `candidate_stage_prepare` for `review-<track-id>` with `expectedFiles` equal to the exact bug artifact paths plus `plan.md`. Draft only those files beneath the stage so removed findings cannot remain. Do not pass plan Markdown through MCP or create a temporary project copy.
|
|
40
|
-
- Append remediation phases and a new final `Track-level User Manual Verification` phase. Preserve every completed former final verification phase with its exact title, task IDs, checkboxes, and commit markers; its dependencies remain the preceding phases it verified. Do not rename it, insert a fictitious delivery task, or reopen it to satisfy validation.
|
|
39
|
+
- If findings exist, call `template_get_many` for `track/bug`, then `candidate_stage_prepare` for `review-<track-id>` with `expectedFiles` equal to the exact bug artifact paths plus `plan.md`. Use `bugs/review-<cycle>.md` for the cycle's report, or `bugs/bug-<number>.md` for individual reports, with numeric suffixes (for example `bugs/review-1.md`). Keep the `bugs/` directory in candidate-relative paths; root `bugs.md`, root `bug-1.md`, and descriptive filenames are not promotion paths. Draft only those files beneath the stage so removed findings cannot remain. Do not pass plan Markdown through MCP or create a temporary project copy.
|
|
40
|
+
- Append remediation phases and a new final `Track-level User Manual Verification` phase. Every appended phase includes `- Phase completion commit: pending`. Preserve every completed former final verification phase with its exact title, task IDs, checkboxes, and commit markers; its dependencies remain the preceding phases it verified. Do not rename it, insert a fictitious delivery task, or reopen it to satisfy validation.
|
|
41
41
|
- Call `candidate_inspect` once for the complete staged bug/plan set with `planValidations: [{ path: "plan.md", targetStatus: "in_progress" }]`. Present findings, exact diff, graph summary, manifest, consequences, and choices together, bound to its digest. One response may approve both the finding disposition and the unchanged exact artifacts, or reject all findings while explicitly accepting their risks and approve clean completion.
|
|
42
42
|
- Inspection validates that target status without changing canonical state. Keep the canonical track `ready_for_review` and its completed execution unchanged until human approval or the exact Autonomous remediation authorization is journaled. If a staged state is included, its status must agree with `targetStatus`; an active execution still requires reconciliation at a safe boundary.
|
|
43
43
|
- If the human changes the finding subset or remediation, rebuild and validate the exact proposal and request approval once for that changed proposal. Do not reuse approval for superseded content.
|
|
44
44
|
- If no findings exist, prepare the clean completion proposal in step 5 before presenting its exact transition for approval.
|
|
45
|
-
4. For v5 approved changes, include
|
|
46
|
-
5. For a clean review, call `review_complete` with `request: { mode: "prepare", projectRoot, trackId, approval, acceptedRisks? }`. The server derives the cumulative range for Autonomous and the completed execution range for other modes. Present its exact proposal and evidence, then ask once for explicit approval. After approval, call only `request: { mode: "apply", proposalToken }`. A retry converges a matching cycle/index without duplicating history. Commit `cadre(review): complete <track-id
|
|
45
|
+
4. For v5 approved changes, include findings, appended plan, reassessed learning and dependency context in `candidate_apply` prepare with `workflow: "review"`. Autonomous also includes `reviews/loop-<next-cycle>.json` and omits `state.json`: the runtime derives the state transition, changes-requested cycle, attempted finding IDs and receipt reference from canonical authority and the exact snapshot. Keep canonical state and operation unchanged while preparing. Other modes include the proposed `in_progress` state and require the human decision. Apply only the unchanged approved token; the receipt binds its digest without a self-referential operation. Commit `cadre(review): request changes for <track-id>` once with receipt trailers and reconcile before the next execution. For legacy recovery, retain the original candidate_inspect planValidations and SHA journal contract.
|
|
46
|
+
5. For a clean review, call `review_complete` with `request: { mode: "prepare", projectRoot, trackId, approval, acceptedRisks? }`. The server derives the cumulative range for Autonomous and the completed execution range for other modes. Present its exact proposal and evidence, then ask once for explicit approval. After approval, call only `request: { mode: "apply", proposalToken }`. A retry converges a matching cycle/index without duplicating history. Commit `cadre(review): complete <track-id>` with the receipt trailers and reconcile. If a retry returns `receipt.status: committed` and no changed paths, completion is already committed; do not create another commit or ask for another approval.
|
|
47
47
|
|
|
48
48
|
Repeat review → implement → review until a human approves a clean review. Autonomous continues the loop in this task without asking permission for in-scope remediation. Other approval modes retain their existing gates. Only this command may mark a track completed.
|
|
49
49
|
|
|
@@ -59,11 +59,13 @@ Preserve phase history and existing handoffs. For active v3/v4/v5 tracks, keep t
|
|
|
59
59
|
|
|
60
60
|
The legacy input field `approval` carries prepared review evidence, not a claim of a human decision. State stores it as `reviewEvidence`. Prepare once, obtain approval of the exact digest, and apply its token unchanged. The runtime adds `approvalConfirmation` with the bound digest, confirmation time and `explicit-apply` method, separately from the evidence. Do not re-prepare merely to replace pending-approval prose. This receipt records the approved application, not an authenticated identity or a fabricated quotation from a human.
|
|
61
61
|
|
|
62
|
+
The clean-review prepare state hash excludes the future `approvalConfirmation`. After apply, verify the applied state/index against the returned immutable receipt's artifact hashes, and confirm that the state differs from the prepared proposal only by this exact confirmation. Do not require the prepared and applied state hashes to be identical or treat that documented addition as source drift. Preserve the original approval and finish its pending commit/reconciliation.
|
|
63
|
+
|
|
62
64
|
## Autonomous authorization
|
|
63
65
|
|
|
64
66
|
These rules override intermediate human gates only for a valid policy-v2 persisted Autonomous loop. Use the same candidate, journal, promotion, memory, and commit procedure above. Main owns scheduling and state and performs a separate review pass; no additional reviewer agent is required. Never duplicate a review cycle, execution, or commit during recovery.
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
For legacy executions only, use this exact canonical `state.operation` shape for remediation; a finding disposition such as `request_changes` is not an operation action. V5 uses `candidate_apply` and its ignored recovery journal instead; never create this legacy operation for a new v5 promotion:
|
|
67
69
|
|
|
68
70
|
```json
|
|
69
71
|
{
|
|
@@ -80,7 +82,7 @@ Use this exact canonical `state.operation` shape for remediation; a finding disp
|
|
|
80
82
|
}
|
|
81
83
|
```
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
For that legacy journal, list every inspected file in both artifact arrays, including the loop snapshot and learning. `approvedArtifacts` contains path strings; `approvedArtifactHashes` contains path/hash objects. `expectedCommit` is the intended commit message, not a SHA. After journaling, call `state_validate` and require valid state before the first canonical promotion; repair journal metadata without changing its inspected manifest or authority if validation fails. Record the findings assigned to the next remediation execution as `attemptedFindingIds` on the changes-requested cycle, even though their completed-attempt counters are initially empty. V5 derives this cycle in the promotion preview and records no new human confirmation for automatic remediation.
|
|
84
86
|
|
|
85
87
|
## Durable authority and checkpoints
|
|
86
88
|
|
|
@@ -105,11 +107,11 @@ Checkpoints are `implementing`, `reviewing`, `remediating`, `awaiting_approval`,
|
|
|
105
107
|
## Review and remediation
|
|
106
108
|
|
|
107
109
|
1. Finish the current implementation journal and commit its bookkeeping before invoking review. At `ready_for_review`, review `initialBaseCommit..lastExecution.headCommit`, all acceptance criteria, affected callers/tests, and prior findings. Verify actual product changes and re-run affected checks. Do not treat the latest remediation diff alone as a clean track review.
|
|
108
|
-
2. Keep each finding's ID stable across renames, moves, rewritten fixes, and review wording. Reopen a recurring finding using the same ID. After reviewing a completed execution that attempted that finding, append that execution ID to `attemptExecutionIds` only if absent; never count the original discovery execution or count an interrupted attempt twice. Mark resolved only from actual verification and review evidence. Preserve resolved finding history.
|
|
110
|
+
2. Keep each finding's ID stable across renames, moves, rewritten fixes, and review wording. Use lowercase slug IDs such as `exact-integer-precision` in loop JSON; uppercase bug labels in report headings are not finding IDs. Reopen a recurring finding using the same ID. After reviewing a completed execution that attempted that finding, append that execution ID to `attemptExecutionIds` only if absent; never count the original discovery execution or count an interrupted attempt twice. Mark resolved only from actual verification and review evidence. Preserve resolved finding history.
|
|
109
111
|
3. If an open finding has two recorded remediation execution IDs, stop with checkpoint `blocked` and a precise blocker. Do the same for material scope decisions, unavailable human-only verification, or external blockers. Present the evidence and ask how to continue; never reset IDs/attempt counts to bypass the stop. Persist this evidence in canonical state using a focused bookkeeping commit. On explicit instructions to retry a stalled finding, use a digest-bound refresh to record those instructions and start a new authorized loop while retaining the former loop in track history.
|
|
110
|
-
4. For progressable in-scope findings, stage bug artifacts, appended remediation phases and final verification, learning, and `reviews/loop-<cycle>.json` at the review candidate root. The loop snapshot contains the complete updated `autonomousReview` object: retained authority/findings, reviewed execution/HEAD, and checkpoint `remediating`. Include
|
|
111
|
-
5. Re-inspect the exact complete staged set immediately before promotion; require valid plan and fresh learning/memory inputs.
|
|
112
|
-
6.
|
|
112
|
+
4. For progressable in-scope findings, stage bug artifacts, appended remediation phases and final verification, learning, reassessed `dependency-context.json`, and `reviews/loop-<cycle>.json` at the review candidate root. Use the next cycle number. The loop snapshot contains the complete updated `autonomousReview` object: retained authority/findings, reviewed execution/HEAD, and checkpoint `remediating`. Include every exact path in `expectedFiles`; validate the proposed plan as `in_progress`. Keep canonical state `ready_for_review` until promotion; omit staged `state.json` in v5. Do not reopen or rename completed verification phases or change the specification revision; increment the plan revision once.
|
|
113
|
+
5. Re-inspect the exact complete staged set immediately before promotion; require valid plan and fresh learning/memory inputs. For v5, prepare `candidate_apply` with that exact manifest and `workflow: "review"`, verify its derived proposal against the persisted authority, then apply its unchanged token. The runtime journals the approved receipt and records attempted finding IDs; do not hand-write canonical state, `state.operation`, or `approvalConfirmation`. The candidate_inspect digest and candidate_apply digest bind different previews: use the apply tool's proposal token for promotion. Legacy recovery retains the journal authorization and digest procedure above.
|
|
114
|
+
6. For v5, commit all promoted files and the immutable receipt once with both returned trailers, then reconcile the operation. On interruption, resume or reconcile that original receipt; never create a second commit to record its SHA or clear an operation in tracked state. The runtime copies the approved snapshot into `state.autonomousReview` and clears the canonical operation in the same promotion. Legacy recovery retains its original promotion/commit/provenance contract. After reconciliation, call focused `project_status` and follow its `nextStep` into implement with a new execution ID and inherited Autonomous mode. No additional user prompt is needed for these bounded changes.
|
|
113
115
|
|
|
114
116
|
## Clean result and approval
|
|
115
117
|
|
package/skills/revise/SKILL.md
CHANGED
|
@@ -55,4 +55,4 @@ Preserve phase history and existing handoffs. For active v3/v4/v5 tracks, keep t
|
|
|
55
55
|
|
|
56
56
|
## Revision provenance
|
|
57
57
|
|
|
58
|
-
Use `revisions/revision-<id>.md` (including the `revision-` prefix) and
|
|
58
|
+
Use `revisions/revision-<id>.md` (including the `revision-` prefix), with lowercase letters, digits and hyphens in the artifact ID, such as `revisions/revision-2.md` or `revisions/revision-20261001t064657z.md`. Uppercase ISO timestamp letters and dots are not allowed in that basename. Include the same path in the approved manifest and operation. Before clearing the revision operation, set `state.commits.spec` and `state.commits.plan` to the revision artifact commit for every spec/plan changed by that commit. Confirm the committed plan has the proposed revisions and graph; a reachable SHA alone is insufficient. For v5, candidate_apply includes stable operation references in the original approval envelope; reconcile them without a follow-up commit. Do not start delivery with pointers to an older revision. Retain the previous execution binding and handoffs while an approved repair operation owns state.
|
package/skills/track/SKILL.md
CHANGED
|
@@ -35,7 +35,7 @@ Call `project_status` first with `view: "project"` for a new track or `view: "tr
|
|
|
35
35
|
4. Draft an acyclic phase/task graph from that proposed specification. Every regular phase explicitly declares phase dependencies and every regular task explicitly declares same-phase task dependencies. Do not repeat derived barriers: each phase's final `User Manual Verification` depends on every sibling task, while the final `Track-level User Manual Verification` phase contains only its manual task and depends on every preceding phase. Include tests, formatting, documentation, and Definition of Done work explicitly. Do not pass plan Markdown through MCP, write it into canonical `.cadre/`, or create a temporary project copy for validation.
|
|
36
36
|
5. Build the marked `Pattern Seed` section at the top of `learning.md` from patterns relevant to the proposed spec and plan. Root phases read the seed; other phases read learning from their declared dependency phases. Cite pattern file paths and explain relevance. Do not invent patterns.
|
|
37
37
|
6. Draft final `state.json` alongside spec, plan and learning. Assign closely related tasks within one phase a ` - Commit group: <slug>`; preserve each task's dependency, verification and handoff requirements. Group dependencies must be acyclic after collapsing internal edges; independent groups may run in parallel.
|
|
38
|
-
7. Author `dependency-context.json` from every transitive dependency's spec and learning. Record spec/plan revisions, direct dependency IDs, the dependency-graph fingerprint, exact source SHA-256s, and stable constraint IDs with source-linked text. Every source needs an explicit applicability assessment, including no applicable constraints when justified. This curated context is part of the same human approval; never silently summarize away uncertain requirements. An empty dependency set uses the supplied template.
|
|
38
|
+
7. Author `dependency-context.json` from every transitive dependency's spec and learning. Record spec/plan revisions, direct dependency IDs, the dependency-graph fingerprint, exact source SHA-256s, and stable constraint IDs with source-linked text. Source records contain exactly `{path, sha256}`; put applicability assessments in constraints shaped `{id, text, sources: [sourcePath]}`, not extra source fields or a singular `source` field. Every source needs an explicit applicability assessment, including no applicable constraints when justified. This curated context is part of the same human approval; never silently summarize away uncertain requirements. An empty dependency set uses the supplied template.
|
|
39
39
|
8. Call `candidate_apply` with `request: {mode: "prepare", projectRoot, candidateId: "track-<track-id>", workflow: "track", files: ["spec.md", "plan.md", "learning.md", "state.json", "dependency-context.json"]}`. It validates graphs, state and memory and generates the final state/index. Present the complete proposed content, manifest, commit groups, dependency coverage, and one combined commit. After approval, call `request: {mode: "apply", proposalToken}`. Commit `cadre(track): plan <track-id>` once with receipt trailers, then reconcile. No direct canonical promotion, separate specification commit, index call, or record-plan commit is needed.
|
|
40
40
|
|
|
41
41
|
For legacy candidates, `candidate_inspect` with exact `planValidations` remains available for diagnostics and the original recovery contract. New tracks use the combined v5 operation.
|