cadre-ai 3.7.0 → 3.8.0

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.
Files changed (62) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +21 -1
  4. package/README.md +41 -6
  5. package/agents/cadre-phase-worker.md +1 -1
  6. package/agents/cadre-task-worker.md +1 -1
  7. package/dist/cadre-cli.mjs +3 -3
  8. package/dist/cadre-mcp.mjs +1212 -867
  9. package/package.json +1 -1
  10. package/skills/archive/SKILL.md +1 -1
  11. package/skills/implement/SKILL.md +22 -10
  12. package/skills/implement/agents/openai.yaml +1 -1
  13. package/skills/implement/references/conflict-handling.md +1 -1
  14. package/skills/implement/references/resume-recovery.md +2 -0
  15. package/skills/refresh/SKILL.md +12 -1
  16. package/skills/revert/SKILL.md +1 -1
  17. package/skills/review/SKILL.md +75 -9
  18. package/skills/revise/SKILL.md +2 -1
  19. package/skills/track/SKILL.md +1 -1
  20. package/templates/v4/init/archive/.gitkeep +1 -0
  21. package/templates/v4/init/gitignore.template +8 -0
  22. package/templates/v4/init/guidelines.md +25 -0
  23. package/templates/v4/init/operations/.gitkeep +1 -0
  24. package/templates/v4/init/patterns/index.md +8 -0
  25. package/templates/v4/init/product.md +30 -0
  26. package/templates/v4/init/project.json +27 -0
  27. package/templates/v4/init/refreshes/.gitkeep +1 -0
  28. package/templates/v4/init/styleguides/general.md +14 -0
  29. package/templates/v4/init/styleguides/language.md +21 -0
  30. package/templates/v4/init/tech-stack.md +21 -0
  31. package/templates/v4/init/tracks/.gitkeep +1 -0
  32. package/templates/v4/init/tracks.md +6 -0
  33. package/templates/v4/init/wisps/.gitkeep +1 -0
  34. package/templates/v4/init/workflow.md +91 -0
  35. package/templates/v4/project/archive-operation.json +19 -0
  36. package/templates/v4/project/pattern.md +20 -0
  37. package/templates/v4/project/refresh-operation.json +18 -0
  38. package/templates/v4/project/refresh.md +21 -0
  39. package/templates/v4/styleguides/dart.md +27 -0
  40. package/templates/v4/styleguides/flutter.md +27 -0
  41. package/templates/v4/styleguides/go.md +29 -0
  42. package/templates/v4/styleguides/gradle.md +28 -0
  43. package/templates/v4/styleguides/html-css.md +39 -0
  44. package/templates/v4/styleguides/index.md +27 -0
  45. package/templates/v4/styleguides/java.md +27 -0
  46. package/templates/v4/styleguides/javascript.md +27 -0
  47. package/templates/v4/styleguides/kotlin.md +26 -0
  48. package/templates/v4/styleguides/maven.md +28 -0
  49. package/templates/v4/styleguides/python.md +27 -0
  50. package/templates/v4/styleguides/react.md +28 -0
  51. package/templates/v4/styleguides/swift.md +27 -0
  52. package/templates/v4/styleguides/swiftui.md +27 -0
  53. package/templates/v4/styleguides/typescript.md +26 -0
  54. package/templates/v4/track/bug.md +14 -0
  55. package/templates/v4/track/execution.json +20 -0
  56. package/templates/v4/track/learning.md +45 -0
  57. package/templates/v4/track/plan.md +39 -0
  58. package/templates/v4/track/revert-operation.json +17 -0
  59. package/templates/v4/track/revise-operation.json +18 -0
  60. package/templates/v4/track/revision.md +36 -0
  61. package/templates/v4/track/spec.md +38 -0
  62. package/templates/v4/track/state.json +31 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre-ai",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "description": "Cross-agent, human-governed software delivery harness",
5
5
  "author": {
6
6
  "name": "Vishal Kumar",
@@ -31,7 +31,7 @@ Do not delete learning, review cycles, revisions, bug reports, or commit provena
31
31
 
32
32
  ## Memory contract
33
33
 
34
- Preserve phase history and existing handoffs. For active v3 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.
34
+ Preserve phase history and existing handoffs. For active v3/v4 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.
35
35
 
36
36
  ## Evidence quality and proposal identity
37
37
 
@@ -5,7 +5,7 @@ description: Execute or resume an approved Cadre plan as a dependency DAG, using
5
5
 
6
6
  # Cadre Implement
7
7
 
8
- Treat approved `plan.md` as the source of truth. Implement only `planned` or `in_progress` tracks. Main is the sole scheduler and `.cadre/**` owner; workers never spawn workers, edit Cadre state, integrate branches, resolve conflicts, clean worktrees, or record human approval.
8
+ Treat approved `plan.md` as the source of truth. Implement `planned` or `in_progress` tracks; a persisted policy-v2 Autonomous loop may resume `ready_for_review` by continuing review without starting another execution. Main is the sole scheduler and `.cadre/**` owner; workers never spawn workers, edit Cadre state, integrate branches, resolve conflicts, clean worktrees, or record human approval.
9
9
 
10
10
  At a clarification or manual-verification boundary, inspect host policy before `workflow_elicit`. Under approval policy `never`, including Codex Full Access, skip the form and ask the same short question once in chat. Otherwise use a concise form bound to execution ID, node ID, and verified commit. Treat only `approved` as approval. On `fallback_required`, or an immediate policy-driven `declined`, ask once in chat; policy rejection is not a human decline. Never request secrets or retry the form.
11
11
 
@@ -20,12 +20,12 @@ Read only the references required by current state:
20
20
 
21
21
  ## Entry and modes
22
22
 
23
- 1. Call `project_status` once with `view: "implementation"`, `trackId`, and the known `executionId` if resuming. 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.
23
+ 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`.
24
24
  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.
25
- 3. Scheduling defaults to `parallel`; use `sequential` only when requested. Approval mode defaults to `phase`; use `governed` or `autonomous` only when explicitly requested. Resume journaled modes. A mode authorizes only work bounded by the approved spec and plan.
25
+ 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.
26
26
  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.
27
27
 
28
- `governed` pauses for regular task diffs and integrations. `phase` runs regular phase work autonomously and pauses at each phase's final `User Manual Verification`. `autonomous` also performs phase verification autonomously and pauses only at `Track-level User Manual Verification`.
28
+ `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.
29
29
 
30
30
  Host security permission is distinct from Cadre approval. Request only a narrow required command permission, centralize shared network/dependency preparation in main, use existing scripts, and run independent read-only checks in parallel. A permission prompt never approves an artifact, commit, merge, or lifecycle transition.
31
31
 
@@ -43,22 +43,34 @@ For a delegated node, the normal lifecycle is four MCP calls:
43
43
 
44
44
  1. `worktree_create` creates or reconciles the derived worktree and records `start` with its path and branch.
45
45
  2. After main reviews the returned worker diff/checks and the worker creates its clean task commit, `execution_checkpoint` records `record_commit` with SHA, verification, and mode/human authorization.
46
- 3. `integration` with `request: { mode: "prepare", projectRoot, trackId, executionId, nodeId }` validates and merges immediately in `phase`/`autonomous`, recording `record_integration` in its receipt. In `governed` it returns `approval_required`; after human approval call only `request: { mode: "apply", proposalToken }`. Never make the governed calls consecutively without human input.
46
+ 3. `integration` with `request: { mode: "prepare", projectRoot, trackId, executionId, nodeId }` validates and merges immediately in `phase`/`track`/`autonomous`, recording `record_integration` in its receipt. In `governed` it returns `approval_required`; after human approval call only `request: { mode: "apply", proposalToken }`. Never make the governed calls consecutively without human input.
47
47
  4. `worktree_cleanup` verifies integration, removes the worktree/branch, and records `complete` when all invariants hold.
48
48
 
49
49
  Do not add standalone `start`, `record_integration`, or `complete` calls around this composite path. Retried calls reconcile an existing worktree, merge commit, removed worktree, or missing journal transition. Keep standalone checkpoints for direct-main work, manual verification, blockers, conflict recovery, and interruption repair.
50
50
 
51
51
  ## Verification, learning, and finish
52
52
 
53
- - A phase barrier depends on all sibling tasks. Prepare evidence against the phase head. In `governed` and `phase`, present it once and record human approval; in `autonomous`, record persisted-mode authorization.
53
+ - A phase barrier depends on all sibling tasks. Prepare evidence against the phase head. In `governed` and `phase`, present it once and record human approval; in `track` and `autonomous`, record persisted-mode authorization.
54
54
  - After the barrier, integrate the phase, record dependency-aware learning (including persisted task handoffs) and task/merge provenance in canonical plan/learning, and make one `cadre(implement): record <track-id> <phase-id>` bookkeeping commit. Start dependents only after cleanup/completion.
55
- - The final `Track-level User Manual Verification` runs in main against fully integrated canonical HEAD and always requires explicit human approval.
56
- - When every node is complete, learning/provenance is recorded, worktrees are gone, and final verification is approved, run full relevant checks and call `execution_finish`. It converges interrupted final writes using the persisted completion identity. Commit only its completed journal, plan markers, `ready_for_review` state, and `tracks.md` as `cadre(implement): complete <track-id>`; never let review absorb this bookkeeping.
55
+ - The final `Track-level User Manual Verification` runs in main against fully integrated canonical HEAD and requires explicit human approval in Governed, Phase, and Track. Autonomous records actual verification and persisted-mode authorization, never a fabricated human approval; unavailable human-only checks block the loop.
56
+ - When every node is complete, learning/provenance is recorded, worktrees are gone, and final verification is authorized under the applicable mode, run full relevant checks and call `execution_finish`. It converges interrupted final writes using the persisted completion identity. Commit only its completed journal, plan markers, `ready_for_review` state, and `tracks.md` as `cadre(implement): complete <track-id>`; never let review absorb this bookkeeping.
57
57
 
58
- Never mark a track `completed`; only an approved clean review may do that.
58
+ In Autonomous, follow the `execution_finish.nextStep` after the implementation bookkeeping commit; do not end the task at `ready_for_review`. Never mark a track `completed`; only an explicitly approved clean review may do that.
59
+
60
+ ## Autonomous execution and recovery
61
+
62
+ `execution_start` creates the policy-v2 `state.autonomousReview` authority and `implementing` checkpoint; `execution_finish` advances it to `reviewing`. Preserve its original authorization, initial review baseline, specification commit, finding identities, and attempted execution IDs across every remediation execution. The review skill owns review, remediation proposals, stalled findings, and final approval.
63
+
64
+ On resume, read canonical state, review cycles, the current operation, execution journals, staged manifest, and Git. Resume an active implementation rather than replacing it. A pending review operation belongs to review even when partial promotion has already set `in_progress`. After review promotion and its bookkeeping commit, a `remediating` checkpoint starts a new execution for the appended graph with inherited Autonomous mode and scheduling. Preserve all completed phases and execution history. Unavailable human-only checks, conflicting requirements, material scope decisions, and external blockers pause the loop; persist the precise blocker and actual evidence without fabricating approval. Continue while verifiable progress is possible, without a fixed cycle cap.
65
+
66
+ ## MCP skill continuation
67
+
68
+ Follow `nextStep` from focused `project_status` and `execution_finish` using its exact `projectRoot`, `trackId`, and current `executionId`. `invoke_skill` identifies the installed Cadre skill by `plugin` and `skill`; invoke it through the host's native skill mechanism in the same task. Codex/Claude resolve the Cadre plugin workflow; Zed resolves `cadre-<skill>`. If native invocation is unavailable, load the full skill from its host-advertised installed location and execute its procedure. Reuse an already loaded, unchanged skill; a next step naming the current skill means continue it, not recursive re-entry. Never derive sibling filesystem paths or merely print a slash command. If the installed skill cannot be resolved, stop with that blocker.
69
+
70
+ 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.
59
71
 
60
72
  ## Direct-main checkpoint order
61
73
 
62
- Start the ready phase with `execution_checkpoint(start)`, then start its ready task before editing. After tests and the distinct task commit, use `record_commit` with verification, mode/approval authorization and handoff, then `complete`. A manual node requires its parent phase running: start the node and record verification only after the applicable approval. After a phase barrier, append learning, make `cadre(implement): record <track-id> <phase-id>`, then record/complete the phase with that SHA. Fill learning's phase-completion SHA in the next authorized bookkeeping commit. Repeat for the final verification phase, with its separate human gate. `execution_finish` renders all plan task/phase commit markers from journal evidence; do not hand-edit those markers or create extra corrective commits. It does not author learning prose.
74
+ Start the ready phase with `execution_checkpoint(start)`, then start its ready task before editing. After tests and the distinct task commit, use `record_commit` with verification, mode/approval authorization and handoff, then `complete`. A manual node requires its parent phase running: start the node and record verification only after the applicable approval. After a phase barrier, append learning, make `cadre(implement): record <track-id> <phase-id>`, then record/complete the phase with that SHA. Fill learning's phase-completion SHA in the next authorized bookkeeping commit. Repeat for the final verification phase, with its mode-dependent verification gate. `execution_finish` renders all plan task/phase commit markers from journal evidence; do not hand-edit those markers or create extra corrective commits. It does not author learning prose.
63
75
 
64
76
  For `context_read`, supply `knownSources` only for complete source sections actually retained in this session: `{path, sha256, section, contentHash}` from fully consumed excerpts. Keep the same inventory across continuation pages. `reused: true` explicitly refers to those retained bytes; a changed file or section is returned in full. Clear inventory on fresh-session recovery or lost context. Consume pages until `complete`; require `contextReady` before editing. A complete page stream with errors or stale guidance is not permission to execute.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Cadre: Implement"
3
3
  short_description: "Execute a track DAG with safe workers"
4
- default_prompt: "Use $implement to execute or resume an approved track DAG, in parallel scheduling and phase approval mode by default unless explicitly requested otherwise."
4
+ default_prompt: "Use $implement to execute or resume an approved track DAG, in parallel scheduling and Track approval mode by default unless explicitly requested otherwise. Explicit Autonomous continues verification, review, and in-scope remediation until a clean review and one final human completion approval."
@@ -2,4 +2,4 @@
2
2
 
3
3
  When integration reports a conflict, record `conflicted` and preserve the worktree. Resolve task conflicts in the phase integration worktree and phase conflicts in main. Read every conflicted file and both sides, explain the chosen resolution, and rerun combined verification.
4
4
 
5
- In governed mode, present the exact resolution for approval. In phase/autonomous mode, apply only an unambiguous in-scope resolution; stop for clarification if product intent, scope, compatibility, or authority is material. Use standalone checkpoints to record recovery and the verified resulting integration. Never force-delete, reset, or silently choose a side.
5
+ In governed mode, present the exact resolution for approval. In phase/track/autonomous mode, apply only an unambiguous in-scope resolution; stop for clarification if product intent, scope, compatibility, or authority is material. Use standalone checkpoints to record recovery and the verified resulting integration. Never force-delete, reset, or silently choose a side.
@@ -10,3 +10,5 @@ Reconcile the implementation status receipt with worker identities, branches, `g
10
10
  Never reset, discard, reconstruct, force-delete, or silently restart. Use standalone `block`/`resume` checkpoints for interruption repair that cannot be completed by a composite call.
11
11
 
12
12
  Read the persisted handoff for the current node and declared dependencies through `context_read` or focused `execution_status`. Preserve decisions, failed approaches, open questions, and next action. Missing handoffs mean "not recorded"; never infer them as historical facts. Reconcile source fingerprints, plan identity, journal evidence, and Git before using a handoff. Changed sources require reinspection, and observations never replace authorization. Recovery reaches only the last persisted checkpoint; a crash before recording may leave work that still needs investigation.
13
+
14
+ For policy-v2 Autonomous, follow focused `project_status.nextStep` to the installed implement or review skill and resume its durable checkpoint. Legacy Autonomous requires an explicit Track-or-Autonomous migration through refresh before new work; preserve verification, findings, and execution history.
@@ -21,7 +21,7 @@ Call `project_status` first with `view: "project"` and use its embedded structur
21
21
 
22
22
  ## Memory contract
23
23
 
24
- Preserve phase history and existing handoffs. For active v3 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.
24
+ Preserve phase history and existing handoffs. For active v3/v4 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.
25
25
 
26
26
  When `upgradeRequired` is true, delivery mutations remain blocked until the approved refresh records the status-provided runtime/template targets. Upgrade active seed metadata and workflow instructions in the same staged, digest-bound envelope; keep legacy terminal history unchanged and do not fabricate old handoffs. Reach a quiescent worker boundary first. Blocking a node, verifying cleanup of already integrated work, inspecting/staging candidates, and rendering the validated derived index remain available for recovery. Do not perform new implementation or integrations to bypass the upgrade. Publish target versions only after the approved context files have been promoted, then run full validation. On interruption, continue the existing refresh journal rather than requesting a second approval for unchanged consequences.
27
27
 
@@ -30,3 +30,14 @@ When `upgradeRequired` is true, delivery mutations remain blocked until the appr
30
30
  Stage `project.json` with the target versions but preserve its existing `lastRefresh` and history until the artifact commit exists. Do not stage a new `lastRefresh` with a null commit. The pending operation belongs in `operations/refresh-<id>.json`; `project_status` with full detail and the operations directory identify it during recovery. Promote version metadata last, record every promoted file including `project.json` in artifactProgress, and verify all approved hashes before committing.
31
31
 
32
32
  After the artifact commit, atomically write the completed journal with `refreshCommit` and `status/checkpoint: completed`. Set `project.lastRefresh` to `{refreshPath, commit}`; append `{action: "refresh", commit, refreshPath}` to project history and affected track history exactly once. These are deterministic consequences of the original approval. Completed operation hashes are checked against the artifact commit, so subsequent provenance bookkeeping or later approved context changes do not invalidate historical evidence. Keep the completed journal; remove only the matching stage after the record commit. No generated-runtime inspection is needed to discover these shapes.
33
+
34
+
35
+ ## Approval policy v2 migration
36
+
37
+ Before delivery, resolve each `APPROVAL_MODE_MIGRATION_REQUIRED` warning by including an explicit Track-or-Autonomous choice and its consequences in this refresh proposal. Never infer the choice from the old spelling. Preserve legacy Governed and Phase choices and the Governed fallback for an absent mode.
38
+
39
+ At a quiescent worker boundary, stage `state.approvalModeMigration` as `{ executionId, approvalMode: "track" | "autonomous", approvedAt, refreshPath: "refreshes/refresh-<id>.md" }`. The existing refresh operation owns the inspected digest and exact path/hash manifest; the migration record points to that refresh without embedding its own digest. For an active execution, include its journal and implement operation in the same envelope: set both `approvalMode` to the selected mode and `approvalPolicyVersion` to `2`, preserving nodes, commits, timestamps, and graph identity. For a completed execution, leave the journal and `lastExecution` byte-for-byte unchanged; the migration record supplies the explicitly chosen effective mode for subsequent review or execution inheritance.
40
+
41
+ When Autonomous is selected, also create `state.autonomousReview` using the durable authority schema in the installed review skill: bind the original execution ID, approved specification commit, original `baseCommit`, migration approval time, empty findings, and `implementing` or `reviewing` according to lifecycle. Assess any existing review findings and carry their identities/attempt evidence forward instead of erasing them. Track selection does not authorize an automatic review loop. Preserve completed/archived track history; migrate only when a nonterminal track will continue or inherit legacy authority.
42
+
43
+ Include all changed context, active seed metadata, policy records, journals, and state in one staged refresh envelope. Promote target project versions last and verify the selected authority before resuming delivery. Recovery, blocking, and cleanup of proven integrated work remain available before the migration is complete. Never fabricate historical human verification or broaden an unchanged journal by merely changing the default.
@@ -25,7 +25,7 @@ If exact commit provenance is missing or commits mix unrelated work, stop with a
25
25
 
26
26
  ## Memory contract
27
27
 
28
- Preserve phase history and existing handoffs. For active v3 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.
28
+ Preserve phase history and existing handoffs. For active v3/v4 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.
29
29
 
30
30
  ## Preparation safety and execution binding
31
31
 
@@ -5,11 +5,11 @@ description: Review a Cadre track that is ready for review, present evidence-bac
5
5
 
6
6
  # Cadre Review
7
7
 
8
- Review only a `ready_for_review` track. Load `.cadre/workflow.md`, all track artifacts and learning, dependency context, relevant patterns/styleguides, implementation commits, and repository tests. Read every reviewed file before judging or proposing edits.
8
+ Review a `ready_for_review` track. A persisted policy-v2 Autonomous review operation may also resume interrupted promotion from `in_progress`; finish that operation before implementation starts. Apply the Autonomous rules below under the originating persisted authorization and retain explicit human approval for clean completion. Load `.cadre/workflow.md`, all track artifacts and learning, dependency context, relevant patterns/styleguides, implementation commits, and repository tests. Read every reviewed file before judging or proposing edits.
9
9
 
10
10
  At every required clarification or approval boundary, show a concise finding/evidence summary and focused diff. Inspect the active host policy before calling `workflow_elicit`: if the task context reports approval policy `never`, including Codex Full Access, skip the form and ask the same short question once in chat. Otherwise prefer `workflow_elicit`, using `clarification` for at most three questions and `approval` bound to the current proposal digest or reviewed execution/HEAD. Treat only an `approved` result as approval. If it returns `fallback_required`, or immediately returns `declined` while the task explicitly reports policy `never`, ask the same short question once in chat; the latter is policy rejection, not a human decline. Never request secrets or retry the form.
11
11
 
12
- Call `project_status` first with `view: "track"` and `trackId`; use its embedded structured validation and do not repeat `state_validate` at command entry. Stop when `valid` is false. Continue only for `kind: "canonical_track"` and `ready_for_review`; candidate-only or any other lifecycle state stops with its returned next action.
12
+ Call `project_status` first with `view: "track"` and `trackId`; use its embedded structured validation and do not repeat `state_validate` at command entry. Stop when `valid` is false, `upgradeRequired` is true, relevant memory is stale, or `nextStep.action` is `blocked`. Continue only for `kind: "canonical_track"` and `ready_for_review`, or a journaled Autonomous review operation recovering from `in_progress`. Follow a returned implementation handoff only after review bookkeeping is complete; candidate-only or other lifecycle states stop with their returned next action.
13
13
 
14
14
  ## Read context once
15
15
 
@@ -17,24 +17,90 @@ Build one bounded context inventory from `project_status`, the current track pat
17
17
 
18
18
  The declared review mutation surface is adaptive `review_complete` for clean completion. Finding-bearing review uses the explicitly journaled direct-write procedure below. Do not inspect the installed runtime, global tool catalog, or generated MCP bundle looking for another review-state tool.
19
19
 
20
- Expected human decision count is one per review cycle 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.
20
+ 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.
21
21
 
22
22
  ## Procedure
23
23
 
24
- 1. Read the completed execution journal and review its exact `baseCommit..headCommit` range, which includes the first implementation commit. Inspect diffs and affected callers, tests, security boundaries, error paths, compatibility, acceptance criteria, and non-functional requirements.
24
+ 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.
25
25
  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.
26
- 3. Prepare one decision-ready proposal before asking for approval:
26
+ 3. Prepare one decision-ready proposal before asking for approval (Autonomous binds in-scope findings to persisted authorization as described below):
27
27
  - 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.
28
+ - 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.
28
29
  - 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.
30
+ - 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.
29
31
  - 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.
30
- - If no findings exist, present clean-review evidence and the exact completion transition once, then ask approval to complete the track.
32
+ - If no findings exist, prepare the clean completion proposal in step 5 before presenting its exact transition for approval.
31
33
  4. For approved changes, record a resumable `review` operation containing the approved manifest digest and path/hash entries before changing the bug artifact, plan, or state. Promote only those staged files, verify their canonical hashes, increment the plan revision, set state to `in_progress`, reset review readiness, and record the review cycle. Call `tracks_render` once, validate, and commit `cadre(review): request changes for <track-id>` without staging `.cadre/stage/`. Record that commit SHA as the new approved plan commit, clear the operation, and use `cadre(review): record changes for <track-id>` for follow-up bookkeeping when needed. Remove only the matching candidate stage after its canonical hashes and commits are recorded. The prior completed execution remains historical until `implement` starts a new execution ID for the changed graph.
32
- 5. For an approved clean review, call `review_complete` with `request: { mode: "prepare", projectRoot, trackId, approval, acceptedRisks? }`. The server derives the range from the completed execution base through its reviewed HEAD. After approval, call only `request: { mode: "apply", proposalToken }`. A retry converges a matching cycle/index without duplicating history. Commit `cadre(review): complete <track-id>`.
34
+ 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>`.
33
35
 
34
- Repeat review → implement → review until a human approves a clean review. Only this command may mark a track completed.
36
+ 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.
37
+
38
+ ## MCP skill continuation
39
+
40
+ Follow `nextStep` from focused `project_status` and `execution_finish` using its exact `projectRoot`, `trackId`, and current `executionId`. `invoke_skill` identifies the installed Cadre skill by `plugin` and `skill`; invoke it through the host's native skill mechanism in the same task. Codex/Claude resolve the Cadre plugin workflow; Zed resolves `cadre-<skill>`. If native invocation is unavailable, load the full skill from its host-advertised installed location and execute its procedure. Reuse an already loaded, unchanged skill; a next step naming the current skill means continue it, not recursive re-entry. Never derive sibling filesystem paths or merely print a slash command. If the installed skill cannot be resolved, stop with that blocker.
41
+
42
+ 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.
35
43
 
36
44
  ## Memory contract
37
45
 
38
- Preserve phase history and existing handoffs. For active v3 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.
46
+ Preserve phase history and existing handoffs. For active v3/v4 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.
39
47
 
40
48
  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.
49
+
50
+ ## Autonomous authorization
51
+
52
+ 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.
53
+
54
+ Use this exact canonical `state.operation` shape for remediation; a finding disposition such as `request_changes` is not an operation action:
55
+
56
+ ```json
57
+ {
58
+ "action": "review",
59
+ "checkpoint": "approved",
60
+ "baseCommit": "<canonical HEAD before promotion>",
61
+ "expectedCommit": "cadre(review): request changes for <track-id>",
62
+ "approvedArtifacts": ["<each inspected relative path>"],
63
+ "approvedArtifactHashes": [{ "path": "<same relative path>", "sha256": "<inspected hash>" }],
64
+ "artifactProgress": [],
65
+ "approvedAt": "<ISO timestamp of this mode-authorized operation>",
66
+ "approvalDigest": "<complete inspected digest>",
67
+ "authorization": { "kind": "persisted-mode", "originExecutionId": "<original execution>", "proposalDigest": "<same digest>" }
68
+ }
69
+ ```
70
+
71
+ 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.
72
+
73
+ ## Durable authority and checkpoints
74
+
75
+ `execution_start` creates `state.autonomousReview` for a new explicit Autonomous selection. It preserves that object across remediation executions; `execution_finish` advances it to `reviewing`. Its schema is:
76
+
77
+ ```json
78
+ {
79
+ "policyVersion": 2,
80
+ "originExecutionId": "<original-execution-id>",
81
+ "authorizedAt": "<ISO timestamp of explicit invocation or migration>",
82
+ "initialBaseCommit": "<original implementation base SHA>",
83
+ "specCommit": "<approved specification SHA>",
84
+ "checkpoint": "implementing",
85
+ "findings": [
86
+ { "id": "stable-bug-id", "summary": "Root cause and violated acceptance criterion", "status": "open", "attemptExecutionIds": [] }
87
+ ]
88
+ }
89
+ ```
90
+
91
+ Checkpoints are `implementing`, `reviewing`, `remediating`, `awaiting_approval`, `blocked`, and `completed`. A reviewed result also records `reviewedExecutionId` and `reviewedHead`. A blocked loop records a nonempty `blocker`. Never change the originating authorization, specification commit, or initial baseline during automatic remediation. Changes to scope require human authority through refresh/revise.
92
+
93
+ ## Review and remediation
94
+
95
+ 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.
96
+ 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.
97
+ 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.
98
+ 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 that exact snapshot path in `expectedFiles`; validate the proposed plan as `in_progress`. Keep canonical state `ready_for_review` until promotion; do not stage `state.json` with a self-referential operation digest. Record attempted finding IDs on the changes-requested review cycle so the next review can identify which findings this execution attempted. Do not reopen or rename completed verification phases.
99
+ 5. Re-inspect the exact complete staged set immediately before promotion; require valid plan and fresh learning/memory inputs. Bind the current digest to `operation.authorization: { kind: "persisted-mode", originExecutionId, proposalDigest }`, with `proposalDigest` equal to `operation.approvalDigest`. Existing `approvedAt`/`approvedArtifacts` fields record the mode-authorized operation, not a new human decision. Journal the operation before any canonical promotion. Record verification and scope evidence in the review cycle; do not record `approvalConfirmation` for automatic remediation.
100
+ 6. Promote only the inspected files, copy the approved loop snapshot into `state.autonomousReview` as the deterministic state transition while retaining its active review operation, and follow the revision/index/commit/provenance procedure above. Retain the operation in canonical state until the commit is recorded; re-inspect changed candidates and reconcile interrupted promotion before resuming. After the review bookkeeping commit and operation clearance, 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.
101
+
102
+ ## Clean result and approval
103
+
104
+ When no unresolved findings remain, persist checkpoint `awaiting_approval`, findings, and `reviewedExecutionId`/`reviewedHead`, then commit only that evidence as `cadre(review): record clean evidence for <track-id>`. The track remains `ready_for_review`. Call `review_complete` prepare with review evidence, present verification results, remediation history, and its exact completion proposal, and ask once for explicit human approval. Apply only that unchanged token after approval; only the review runtime marks the loop and track completed. Autonomous does not use `acceptedRisks` to waive findings.
105
+
106
+ Resume `awaiting_approval` by checking the recorded execution/HEAD and product content, preparing a fresh token if needed, and requesting the still-missing final approval. A prior unresolved question is not approval. Changed product or verification inputs require renewed verification/review and a new clean checkpoint; ordinary Cadre bookkeeping alone does not. A request for changes returns to review under the existing scope; cancellation stops with state intact.
@@ -30,6 +30,7 @@ Expected human decision count is one when the requested change and partial-work
30
30
  4. Trace transitive dependent tracks. For each, classify impact as none, reseed-only, plan change, spec change, or invalidated work, with evidence. If evidence cannot resolve a material impact, ask before choosing a classification.
31
31
  5. Call `template_get_many` once for `track/revision` and `track/revise-operation`, then `candidate_stage_prepare` for `revise-<track-id>` with `expectedFiles` equal to the exact revision and affected artifact paths. Render only that set beneath the stage, preserving eventual track-relative paths and completed provenance.
32
32
  6. Increment revisions exactly once and restore derived manual-verification barriers. A changed plan uses a new execution ID. Do not pass plan Markdown through MCP, validate the stale canonical plan, or create a temporary project copy.
33
+ When appending work after completed track verification, preserve that historical phase's exact title, task IDs, checks, and commit markers and append a new final `Track-level User Manual Verification`. Historical verification depends only on its preceding phases. Candidate inspection uses the intended resulting status for a revision of `ready_for_review`; no pre-approval canonical status change is needed. A staged state must agree with its plan's `targetStatus`, and active execution bindings must still match the reconciled graph.
33
34
  7. Call `candidate_inspect` once for every staged revision and cascading artifact. Supply one `planValidations` entry for every staged root or nested `plan.md`, using its exact candidate-relative path and intended resulting track status; omit the list only when the candidate contains no plans. Present every plan result, the target revision, manifest, partial-work disposition, dependent changes, lifecycle transitions, commits, and bookkeeping together, bound to its digest. Partial approval requires a fresh inspection.
34
35
  8. Before changing approved artifacts, write the rendered `revise` operation into every affected track's `state.json`. Use the same expected commit, record the approved manifest digest and path/hash entries, record per-artifact progress, and advance the durable checkpoint after each promoted staged file.
35
36
  9. Promote only the authorized staged changes, verify their canonical hashes, update relevant marked Pattern Seed sections without overwriting phase learning, set the approved source-to-target states, mark the earliest affected plan nodes pending in the replacement execution graph, and append track-local history. Do not add singular active phase/task fields to track state. Call `tracks_render` once without another prompt. Never stage `.cadre/stage/`; remove only the matching candidate stage after its canonical hashes and commits are recorded.
@@ -37,7 +38,7 @@ Expected human decision count is one when the requested change and partial-work
37
38
 
38
39
  ## Memory contract
39
40
 
40
- Preserve phase history and existing handoffs. For active v3 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.
41
+ Preserve phase history and existing handoffs. For active v3/v4 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.
41
42
 
42
43
  ## Revision provenance
43
44
 
@@ -36,4 +36,4 @@ The plan is the execution source of truth. Dependency changes or a modified appr
36
36
 
37
37
  ## Memory contract
38
38
 
39
- Preserve phase history and existing handoffs. For active v3 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.
39
+ Preserve phase history and existing handoffs. For active v3/v4 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.
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,8 @@
1
+ # Cadre-managed temporary execution worktrees
2
+ /.worktrees/
3
+
4
+ # Disposable Wisp output
5
+ /wisps/
6
+
7
+ # Unapproved candidate artifacts
8
+ /stage/
@@ -0,0 +1,25 @@
1
+ # Engineering Guidelines
2
+
3
+ ## Architecture
4
+
5
+ {{ARCHITECTURE_GUIDANCE}}
6
+
7
+ ## Testing strategy
8
+
9
+ {{TEST_STRATEGY}}
10
+
11
+ ## Security and privacy
12
+
13
+ {{SECURITY_PRIVACY}}
14
+
15
+ ## Reliability and observability
16
+
17
+ {{RELIABILITY_OBSERVABILITY}}
18
+
19
+ ## Documentation and compatibility
20
+
21
+ {{DOCUMENTATION_COMPATIBILITY}}
22
+
23
+ ## Repository-specific commands
24
+
25
+ {{REPOSITORY_COMMANDS}}
@@ -0,0 +1,8 @@
1
+ # Pattern Catalog
2
+
3
+ Patterns are created only by distilling completed, cleanly reviewed tracks during archival.
4
+
5
+ | Pattern | Summary and applicability | Provenance | Supersedes |
6
+ | --- | --- | --- | --- |
7
+
8
+ Keep applicability and supersession explicit. Missing or ambiguous summaries require inspecting the full pattern; a keyword mismatch never proves irrelevance.
@@ -0,0 +1,30 @@
1
+ # Product
2
+
3
+ ## Project context
4
+
5
+ - Classification: `{{greenfield|brownfield}}`
6
+ - Evidence: {{CLASSIFICATION_EVIDENCE}}
7
+
8
+ ## Name and summary
9
+
10
+ {{PROJECT_NAME_AND_SUMMARY}}
11
+
12
+ ## Users and problems
13
+
14
+ {{USERS_AND_PROBLEMS}}
15
+
16
+ ## Outcomes and success measures
17
+
18
+ {{OUTCOMES_AND_MEASURES}}
19
+
20
+ ## Scope boundaries
21
+
22
+ {{SCOPE_BOUNDARIES}}
23
+
24
+ ## Domain language
25
+
26
+ {{DOMAIN_LANGUAGE}}
27
+
28
+ ## Open questions
29
+
30
+ {{OPEN_QUESTIONS}}
@@ -0,0 +1,27 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "runtimeVersion": "{{RUNTIME_VERSION}}",
4
+ "templateSetVersion": "{{TEMPLATE_SET_VERSION}}",
5
+ "project": {
6
+ "name": "{{PROJECT_NAME}}",
7
+ "context": "{{greenfield|brownfield}}"
8
+ },
9
+ "setup": {
10
+ "status": "in_progress",
11
+ "checkpoint": "approved",
12
+ "commit": null,
13
+ "artifactProgress": [],
14
+ "operation": {
15
+ "action": "create",
16
+ "baseCommit": "{{BASE_COMMIT_OR_NULL}}",
17
+ "expectedCommit": "cadre(create): initialize project harness",
18
+ "repositoryRoot": "{{PROJECT_ROOT}}",
19
+ "gitDisposition": "{{existing|initialize}}",
20
+ "approvedArtifacts": [],
21
+ "approvedArtifactHashes": [],
22
+ "approvedAt": "{{APPROVED_AT}}"
23
+ }
24
+ },
25
+ "lastRefresh": null,
26
+ "history": []
27
+ }
@@ -0,0 +1,14 @@
1
+ # General Coding Styleguide
2
+
3
+ - Read every existing file and directly relevant context before editing it.
4
+ - Prefer the smallest cohesive change that satisfies the approved plan task.
5
+ - Preserve established repository conventions unless an approved revision changes them.
6
+ - Make invalid states difficult to represent; validate at boundaries.
7
+ - Handle errors deliberately and keep failure messages actionable.
8
+ - Test externally visible behavior, failure paths, and meaningful edge cases.
9
+ - Keep comments focused on intent and tradeoffs rather than restating code.
10
+ - Avoid unrelated cleanup in delivery commits.
11
+
12
+ ## Project-specific additions
13
+
14
+ {{GENERAL_STYLE_ADDITIONS}}
@@ -0,0 +1,21 @@
1
+ # {{LANGUAGE_OR_FRAMEWORK}} Styleguide
2
+
3
+ ## Versions and conventions
4
+
5
+ {{VERSIONS_AND_CONVENTIONS}}
6
+
7
+ ## Structure and naming
8
+
9
+ {{STRUCTURE_AND_NAMING}}
10
+
11
+ ## Error handling and safety
12
+
13
+ {{ERROR_HANDLING_AND_SAFETY}}
14
+
15
+ ## Testing and tooling
16
+
17
+ {{TESTING_AND_TOOLING}}
18
+
19
+ ## Avoid
20
+
21
+ {{PROJECT_SPECIFIC_ANTI_PATTERNS}}
@@ -0,0 +1,21 @@
1
+ # Technology Stack
2
+
3
+ ## Runtime and languages
4
+
5
+ {{RUNTIMES_AND_LANGUAGES}}
6
+
7
+ ## Frameworks and libraries
8
+
9
+ {{FRAMEWORKS_AND_LIBRARIES}}
10
+
11
+ ## Data and infrastructure
12
+
13
+ {{DATA_AND_INFRASTRUCTURE}}
14
+
15
+ ## Tooling
16
+
17
+ {{BUILD_TEST_FORMAT_TOOLS}}
18
+
19
+ ## Version constraints
20
+
21
+ {{VERSION_CONSTRAINTS}}
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,6 @@
1
+ # Tracks
2
+
3
+ Generated from track-local `state.json` files by the Cadre MCP server.
4
+
5
+ | Track | Type | Status | Revision |
6
+ | --- | --- | --- | ---: |
@@ -0,0 +1 @@
1
+