cadre-ai 3.6.0 → 3.7.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 +33 -0
  4. package/README.md +12 -7
  5. package/agents/cadre-phase-worker.md +4 -0
  6. package/agents/cadre-task-worker.md +4 -0
  7. package/dist/cadre-cli.mjs +3 -2
  8. package/dist/cadre-mcp.mjs +26320 -25387
  9. package/package.json +1 -1
  10. package/skills/archive/SKILL.md +12 -2
  11. package/skills/implement/SKILL.md +9 -2
  12. package/skills/implement/references/parallel-workers.md +2 -0
  13. package/skills/implement/references/resume-recovery.md +2 -0
  14. package/skills/refresh/SKILL.md +13 -1
  15. package/skills/revert/SKILL.md +22 -2
  16. package/skills/review/SKILL.md +6 -0
  17. package/skills/revise/SKILL.md +8 -0
  18. package/skills/status/SKILL.md +3 -1
  19. package/skills/track/SKILL.md +4 -0
  20. package/templates/v3/init/archive/.gitkeep +1 -0
  21. package/templates/v3/init/gitignore.template +8 -0
  22. package/templates/v3/init/guidelines.md +25 -0
  23. package/templates/v3/init/operations/.gitkeep +1 -0
  24. package/templates/v3/init/patterns/index.md +8 -0
  25. package/templates/v3/init/product.md +30 -0
  26. package/templates/v3/init/project.json +27 -0
  27. package/templates/v3/init/refreshes/.gitkeep +1 -0
  28. package/templates/v3/init/styleguides/general.md +14 -0
  29. package/templates/v3/init/styleguides/language.md +21 -0
  30. package/templates/v3/init/tech-stack.md +21 -0
  31. package/templates/v3/init/tracks/.gitkeep +1 -0
  32. package/templates/v3/init/tracks.md +6 -0
  33. package/templates/v3/init/wisps/.gitkeep +1 -0
  34. package/templates/v3/init/workflow.md +82 -0
  35. package/templates/v3/project/archive-operation.json +19 -0
  36. package/templates/v3/project/pattern.md +20 -0
  37. package/templates/v3/project/refresh-operation.json +18 -0
  38. package/templates/v3/project/refresh.md +21 -0
  39. package/templates/v3/styleguides/dart.md +27 -0
  40. package/templates/v3/styleguides/flutter.md +27 -0
  41. package/templates/v3/styleguides/go.md +29 -0
  42. package/templates/v3/styleguides/gradle.md +28 -0
  43. package/templates/v3/styleguides/html-css.md +39 -0
  44. package/templates/v3/styleguides/index.md +27 -0
  45. package/templates/v3/styleguides/java.md +27 -0
  46. package/templates/v3/styleguides/javascript.md +27 -0
  47. package/templates/v3/styleguides/kotlin.md +26 -0
  48. package/templates/v3/styleguides/maven.md +28 -0
  49. package/templates/v3/styleguides/python.md +27 -0
  50. package/templates/v3/styleguides/react.md +28 -0
  51. package/templates/v3/styleguides/swift.md +27 -0
  52. package/templates/v3/styleguides/swiftui.md +27 -0
  53. package/templates/v3/styleguides/typescript.md +26 -0
  54. package/templates/v3/track/bug.md +14 -0
  55. package/templates/v3/track/execution.json +19 -0
  56. package/templates/v3/track/learning.md +45 -0
  57. package/templates/v3/track/plan.md +39 -0
  58. package/templates/v3/track/revert-operation.json +17 -0
  59. package/templates/v3/track/revise-operation.json +18 -0
  60. package/templates/v3/track/revision.md +36 -0
  61. package/templates/v3/track/spec.md +38 -0
  62. package/templates/v3/track/state.json +31 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre-ai",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "Cross-agent, human-governed software delivery harness",
5
5
  "author": {
6
6
  "name": "Vishal Kumar",
@@ -5,7 +5,7 @@ description: Archive one or more completed Cadre tracks in one approved, resumab
5
5
 
6
6
  # Cadre Archive
7
7
 
8
- Archive one or more `completed` tracks in a single batch. Read `.cadre/workflow.md`, every artifact and recorded commit for every selected track, the full pattern catalog, all active track specs/plans and marked learning seeds, and relevant implementation files. Read existing pattern and learning files before proposing changes.
8
+ Archive one or more `completed` tracks in a single batch. Read `.cadre/workflow.md`, every artifact and recorded commit for every selected track, the complete pattern catalog, active-track status summaries, and relevant implementation files. Use catalog applicability, provenance, and supersession summaries to identify affected patterns and active tracks, then read their full pattern/spec/plan/seed artifacts before proposing changes. If metadata is missing, incomplete, or ambiguous, read the full catalog bodies and active specs/plans/seeds. Never exclude guidance by keyword alone.
9
9
 
10
10
  At every required selection or approval boundary, show a concise batch summary or 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 archive proposal digest. 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
 
@@ -19,7 +19,7 @@ Expected human decision count is one for the complete batch. Ask again only when
19
19
  2. Verify the entire selection before changing anything. Every selected track must be `completed`, have clean centralized `state_validate`, and have no pending state mutation. Do not recompute its DAG, manual-verification barriers, or review evidence inside archive; those are completed-state invariants. Reject the batch without partial mutation if any selected track is ineligible. Ignore completed tracks that were not selected.
20
20
  3. If an in-progress `.cadre/operations/archive-<timestamp>.json` exists, reconcile it before accepting a new batch. Resume from its first incomplete checkpoint. If its journal, files, Git state, or expected commit disagree, stop and present the mismatch.
21
21
  4. Distill durable, evidenced learning across the selected tracks as one corpus; discard track-specific trivia. Merge, replace, split, or retire existing patterns when justified, preserving provenance to every contributing track/phase/task commit. Reconcile overlapping or conflicting learning once so batch order cannot silently change the result.
22
- 5. Compute relevant Pattern Seed section changes in `learning.md` for every non-completed, non-archived track using the final proposed pattern set. Never seed by keyword alone; explain semantic relevance.
22
+ 5. Keep catalog summaries and applicability/provenance/supersession information complete. Compute relevant Pattern Seed section changes in `learning.md` for every non-completed, non-archived track using the final proposed pattern set. Never seed by keyword alone; explain semantic relevance.
23
23
  6. Call `candidate_stage_prepare` for `archive-<proposal-id>` with `expectedFiles` equal to every proposed pattern, pattern-index, and active-track seed path, then write exactly that set. Call `archive_batch_candidate` with `request: { mode: "prepare", projectRoot, candidateId, selectedTracks?, updates }`; `updates` contains the required body-free descriptors. Present the resulting proposal once.
24
24
  7. After approval, call only `request: { mode: "apply", proposalToken }` on `archive_batch_candidate`; it re-reads staged files and rejects drift. Never make the two calls consecutively without the human decision between them. Commit all approved moves and derived changes together, keep the matching candidate stage through that checkpoint, and never stage it.
25
25
  8. Call `archive_batch_record` once with the project root and batch ID; it derives the actual current HEAD and atomically records deterministic provenance and the generated index without another approval. Create `cadre(archive): record batch <batch-id>`, then remove only the matching candidate stage.
@@ -28,3 +28,13 @@ Expected human decision count is one for the complete batch. Ask again only when
28
28
  If interrupted, reuse the same approved apply token; the journal and approved hashes converge remaining moves/writes without another approval. Provenance recording is idempotent and never duplicates track/project history. Never redistill or start a second batch while one is active.
29
29
 
30
30
  Do not delete learning, review cycles, revisions, bug reports, or commit provenance.
31
+
32
+ ## Memory contract
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.
35
+
36
+ ## Evidence quality and proposal identity
37
+
38
+ 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.
39
+
40
+ 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.
@@ -21,7 +21,7 @@ Read only the references required by current state:
21
21
  ## Entry and modes
22
22
 
23
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.
24
- 2. Read `.cadre/workflow.md`, track spec/plan/learning/state, relevant dependency learning, pattern/styleguide context, and repository instructions. Read before editing.
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
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.
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
 
@@ -35,6 +35,7 @@ Use the scheduler returned by the preflight or latest mutation receipt. Plan ord
35
35
 
36
36
  - Execute one ready task directly in main when delegation adds no value. Follow returned `eventGuidance`: `record_commit` requires commit, verification, and authorization; `record_verification` requires those same fields; `record_integration` requires commit and verification; `block` requires a blocker. A running-phase `complete` also requires commit, verification, and authorization.
37
37
  - Delegate only independent or cohesive work. Read `references/parallel-workers.md` before doing so.
38
+ - Include a `handoff` with task `record_commit` and `block`: `decisions`, `failedApproaches`, `openQuestions`, `nextAction`, and `sources` containing repository-relative `path` and exact `sha256`. Keep its serialized JSON within 8 KiB; reference longer durable evidence instead of truncating it. Main records it with the existing checkpoint, without another call or approval. A handoff records observations and never authorizes work.
38
39
  - Never checkpoint evidence before it exists. Each regular task has one Conventional Commit and a distinct recorded SHA. `record_commit` includes focused verification and authorization evidence.
39
40
  - A `.cadre/**`-only bookkeeping commit does not invalidate product verification while product files, tests, inputs, and verification policy remain unchanged.
40
41
 
@@ -50,8 +51,14 @@ Do not add standalone `start`, `record_integration`, or `complete` calls around
50
51
  ## Verification, learning, and finish
51
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
- - After the barrier, integrate the phase, record dependency-aware learning 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.
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.
54
55
  - The final `Track-level User Manual Verification` runs in main against fully integrated canonical HEAD and always requires explicit human approval.
55
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.
56
57
 
57
58
  Never mark a track `completed`; only an approved clean review may do that.
59
+
60
+ ## Direct-main checkpoint order
61
+
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.
63
+
64
+ 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.
@@ -7,3 +7,5 @@ Use a main-owned phase integration worktree for non-trivial phases. Create task
7
7
  Every worker prompt includes its absolute worktree, track/execution/node IDs, approved outcome, dependencies and learning, relevant files, checks, and commit scope. Require the worker to read before editing, change product files only, avoid `.cadre/**`, avoid agent spawning and Git integration/history operations, run focused verification, and return changed files, checks, risks, learning, and proposed commit message. The worker returns an uncommitted diff for main scope review, then commits only after main authorizes it under the persisted approval mode. It returns the SHA and waits.
8
8
 
9
9
  Workers must not merge, rebase, reset, clean up, force Git operations, or switch to other plan work. A phase worker must stop at a clean handoff while task workers for that phase are active.
10
+
11
+ Supply workers a bounded context handoff with required source paths/hashes and exact relevant learning, not the parent's entire conversation. Workers must read required sources if they do not already have their current content. Their result includes the typed task handoff (`decisions`, `failedApproaches`, `openQuestions`, `nextAction`, `sources`) within 8 KiB; main persists it with the existing task checkpoint. Never silently trim required constraints to fit a prompt.
@@ -8,3 +8,5 @@ Reconcile the implementation status receipt with worker identities, branches, `g
8
8
  - Dirty, conflicted, divergent, unexpected, or unreachable state: stop and present the mismatch.
9
9
 
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
+
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.
@@ -16,5 +16,17 @@ Call `project_status` first with `view: "project"` and use its embedded structur
16
16
  3. Before changing execution-governing context, inspect all active implementation journals and workers. Include any required stop, preservation, or reconciliation at a safe quiescent boundary in the final refresh proposal; do not ask for a separate quiescence approval when the exact disposition can be assessed with the refresh. Draft focused diffs for product, guidelines, workflow, tech stack, general styleguide, and language/framework styleguides. Add/remove language guides only when the proposed tech stack requires it.
17
17
  4. Assess impact on all active track specs, plans, and marked Pattern Seed sections using the same rules as the Cadre revise workflow, but include every cascading change in this refresh envelope.
18
18
  5. Expected human decision count is one. Call `template_get_many` once for `project/refresh` and `project/refresh-operation`, then `candidate_stage_prepare` for `refresh-<ts>` with `expectedFiles` equal to the complete refresh record and project/track update set. Render exactly those files. Use `targetRuntimeVersion` and `targetTemplateSetVersion` from status for legacy projects. Call `candidate_inspect` with `planValidations` containing one entry for every staged root or nested `plan.md`, using its exact candidate-relative path and intended target status, or omit it for a plan-free refresh. Keep cascading changes inside this envelope instead of starting separate approval cycles.
19
- 6. After approval and before any context or track write, persist the refresh operation journal with the approved manifest digest and path/hash entries. Resume an existing matching journal from its first incomplete artifact; never replace it. Promote only authorized staged changes, verify canonical hashes, and advance its checkpoint and artifact progress after each write. Append project and track history, reseed affected active tracks, then call `tracks_render` once and call `state_validate` without another prompt.
19
+ 6. After approval and before any context or track write, persist the refresh operation journal with the approved manifest digest and path/hash entries. Resume an existing matching journal from its first incomplete artifact; never replace it. Promote only authorized staged changes, verify canonical hashes, and advance its checkpoint and artifact progress after each write. Reseed affected active tracks, retain prior project refresh/history until the artifact commit exists, then call `tracks_render` once and call `state_validate` without another prompt.
20
20
  7. Commit `cadre(refresh): update project context` without staging `.cadre/stage/`, then record that SHA in the refresh journal and as `lastRefresh.commit`, mark the journal completed, and create the follow-up `cadre(refresh): record refresh commit` state commit. Remove only the matching candidate stage after provenance is recorded. These unchanged deterministic consequences remain inside the one refresh envelope. If interrupted after the first commit, identify and record the existing expected commit rather than repeating context changes.
21
+
22
+ ## Memory contract
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.
25
+
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
+
28
+ ## Refresh bookkeeping contract
29
+
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
+
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.
@@ -18,7 +18,27 @@ Expected human decision count is one on the clean path. The exact revert proposa
18
18
  3. Call `candidate_inspect` once for the staged reconciliation set. Supply one `planValidations` entry for every staged root or nested `plan.md`, using its exact candidate-relative path and post-revert track status; omit the list only when the candidate contains no plans. Present every plan result, the manifest, Git operations, expected diff, downstream reconciliation, verification, index, and commits as one authorization envelope bound to its digest. Never rewrite public history by default.
19
19
  4. Call `template_get_many` for `track/revert-operation`, render the approved operation into `state.json.operation`, and persist it before any Git mutation. Record the target kind/ID, safe reverse commit order, base commit, expected reconciliation commit, approved manifest digest and path/hash entries, approval time, checkpoint, and applied revert commits. Resume a matching operation; never replace it.
20
20
  5. Reach the authorized quiescent execution boundary before reverting. Use `git revert` to create additive reversal commits, using the correct mainline parent for an approved merge-commit revert. After each successful revert commit, record its SHA and advance the operation checkpoint. If a conflict has one unambiguous in-scope resolution that preserves the approved resulting semantics, resolve and verify it inside the envelope. If it introduces a material choice or changes the proposed result, stop and present one corrected proposal rather than accumulating per-file approval prompts.
21
- 6. Promote only the approved staged Cadre files, verify their canonical hashes, reconcile plan checkboxes without erasing provenance, append a revert history entry, set the earliest affected task/phase back to pending or blocked, and mark dependent tracks for approved revision/reseed as needed.
22
- 7. Run relevant tests, report the resulting diffs, call `tracks_render` once, then validate. Commit Cadre bookkeeping as `cadre(revert): reconcile <track-id>` without staging `.cadre/stage/`, record that commit, clear the operation, and create a follow-up record commit when the bookkeeping cannot be included safely. Remove only the matching candidate stage after provenance is recorded. Do not turn these deterministic consequences into a second approval. On resume, never repeat a revert SHA already recorded by the operation.
21
+ 6. Before promoting any staged file that replaces the temporary revert operation, atomically persist `reverts/revert-<id>.json` from that actual approved operation, with the recorded reversal SHAs and `reconciliationCommit: null`. Read the receipt back and verify its digest, approval time, original snapshot path, and reversal SHAs against the still-persisted operation. Stop if the receipt is missing or differs. Only then promote the approved staged Cadre files, verify their canonical hashes, reconcile plan checkboxes without erasing provenance, set the earliest affected task/phase back to pending or blocked, and mark dependent tracks for approved revision/reseed as needed. The final staged state restores implement ownership; the receipt now preserves the revert authorization through that transition.
22
+ 7. Run relevant tests, report the resulting diffs, call `tracks_render` once, then validate. Include the already-persisted receipt in `cadre(revert): reconcile <track-id>` without staging `.cadre/stage/`. After that commit exists, fill its SHA into the receipt, append exactly one matching history entry, and create `cadre(revert): record <track-id> revert commit`. Do not wait for a reconciliation SHA before first writing the receipt. Remove only the matching candidate stage after provenance is recorded. Do not turn these deterministic consequences into a second approval. On resume, never repeat a revert SHA already recorded by the operation or receipt.
23
23
 
24
24
  If exact commit provenance is missing or commits mix unrelated work, stop with a precise manual recovery plan.
25
+
26
+ ## Memory contract
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.
29
+
30
+ ## Preparation safety and execution binding
31
+
32
+ Preparation is read-only outside the declared candidate stage. Never run `git revert` (including `--no-commit`), `git reset`, `git restore`, checkout, clean, stash, or index writes as a dry run in the target repository. A command described as a dry run can still destroy evidence. Inspect `git show`, `git diff`, status, and recorded commits to propose the reverse patch. If application must be tested, use an explicitly isolated disposable clone and retain all original dirty files; do not experiment in the delivery worktree. Before and after preparation verify unchanged HEAD, index, working tree, and hashes of uncommitted journals/learning. Host shell permission does not authorize a Cadre revert.
33
+
34
+ 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.
35
+
36
+ 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.
37
+
38
+ 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.
39
+
40
+ ## Durable revert receipt
41
+
42
+ 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.
43
+
44
+ After Git reversal, retain the actual digest-bound operation as `reverts/revert-<id>.json` before restoring final implement ownership. This receipt is a named bookkeeping consequence of the same approval, not a new proposal. It records `{action: "revert", targetKind, targetId, approvalDigest, approvedAt, baseCommit, commits, revertCommits, originalExecutionPath, approvedArtifacts, approvedArtifactHashes, reconciliationCommit}`. Initially `reconciliationCommit` is null; persist and reread this receipt before replacing the temporary operation. Include it in the reconciliation commit, then set its real SHA after that commit exists. Append exactly one state history entry `{action: "revert", targetId, approvalDigest, revertCommits, commit: reconciliationCommit, receiptPath}` and commit the receipt/history as `cadre(revert): record <track-id> revert commit`. Verify the receipt, history, original snapshot, both commit types, restored execution binding, and dirty-file preservation before removing the stage or reporting completion. Runtime state validity alone does not prove these workflow consequences were completed. On fresh recovery, a receipt with null reconciliationCommit means bookkeeping is unfinished: inspect Git for the matching reconciliation commit, reuse it if present, or create it if absent. Never repeat a reversal or request another approval for unchanged bookkeeping.
@@ -32,3 +32,9 @@ Expected human decision count is one per review cycle when the human accepts the
32
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>`.
33
33
 
34
34
  Repeat review → implement → review until a human approves a clean review. Only this command may mark a track completed.
35
+
36
+ ## Memory contract
37
+
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.
39
+
40
+ 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.
@@ -34,3 +34,11 @@ Expected human decision count is one when the requested change and partial-work
34
34
  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
35
  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.
36
36
  10. Call `state_validate` and commit `cadre(revise): update <track-id>`. Reconcile interruption using the workflow journal rules. Record the commit in every revision entry, clear each completed operation, and use a follow-up `cadre(revise): record <track-id>` commit when bookkeeping cannot be part of the artifact commit. These unchanged deterministic consequences remain inside the revision authorization envelope.
37
+
38
+ ## Memory contract
39
+
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
+
42
+ ## Revision provenance
43
+
44
+ Use `revisions/revision-<id>.md` (including the `revision-` prefix) and 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. Include these pointer updates in the original approval envelope and follow-up record 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.
@@ -5,10 +5,12 @@ description: Validate and summarize current Cadre project, track, dependency, ph
5
5
 
6
6
  # Cadre Status
7
7
 
8
- Read `.cadre/workflow.md`, `project.json`, generated `tracks.md`, and track-local state/spec/plan files discovered under both `tracks/` and `archive/`. Read dependency state from each track's `state.json`, never from `tracks.md`. This command is read-only. If the Cadre MCP is unavailable, stop and report it; do not use a copied or reconstructed runtime.
8
+ Read `.cadre/workflow.md` and use structured status for routine reporting. Do not open every active or archived spec/plan. Request `detail: "full"` or read a specific source only when diagnosing, quoting, or interpreting its contents. This command is read-only. If the Cadre MCP is unavailable, stop and report it; do not use a copied or reconstructed runtime.
9
9
 
10
10
  Call `project_status` once with the narrowest view and use its embedded structured validation; do not repeat `state_validate` at command entry. Treat `errors` as the complete explanation for `valid` and `focusedErrors` as the selected-track subset. Project view reports staged candidates; focused view distinguishes candidate-only, canonical-with-stage, malformed canonical, and unknown IDs. Never silently treat a stage as canonical or omit a shadowed candidate.
11
11
 
12
+ For a whole-project report, consume `listing.nextCursor` until `listing.complete` is true. `statuses` filters rows only; counts and validation remain project-wide. Restart on `STATUS_SNAPSHOT_CHANGED`. Label a deliberately partial or filtered report. Request focused implementation views only for tracks whose live scheduler details are needed. Report `staleMemory` separately from structural errors.
13
+
12
14
  Present:
13
15
 
14
16
  - project setup checkpoint, pending operation journal, setup commit, and last-refresh commit;
@@ -33,3 +33,7 @@ For either track commit, reconcile interruptions before continuing:
33
33
  - Any mismatch: present it and stop rather than regenerating approved spec, plan, or learning.
34
34
 
35
35
  The plan is the execution source of truth. Dependency changes or a modified approved spec require the Cadre revise workflow.
36
+
37
+ ## Memory contract
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.
@@ -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
+
@@ -0,0 +1,82 @@
1
+ # Cadre Workflow
2
+
3
+ This is the durable project-level Cadre contract. Installed skills supply command procedure; stop and present any conflict with this file.
4
+
5
+ ## Authority and project boundaries
6
+
7
+ - The installed Cadre MCP server is the authoritative runtime and immutable template provider.
8
+ - `.cadre/` contains approved mutable context, lifecycle state, and history only. Runtime code and template catalogs stay in the installed plugin.
9
+ - Read every existing artifact and its relevant repository context before editing it. Never reconstruct state or file content from memory.
10
+ - Resolve the exact repository root before mutation. Never create a nested repository or operate outside the approved root.
11
+ - A missing required MCP capability blocks stateful work; do not recreate it with shell or filesystem logic.
12
+
13
+ ## Human governance
14
+
15
+ - Semantic content, scope, selection, and material consequences remain proposals until the human explicitly approves them.
16
+ - Combine related decisions into one complete authorization envelope when their exact artifacts, focused diffs, consequences, and verification evidence are available together.
17
+ - Named deterministic consequences—validation, indexes, transitions, commits, and provenance—need no additional approval.
18
+ - Changed content, scope, selection, digest, or material consequences require a corrected proposal and approval.
19
+ - An MCP `approval_required` result is not approval. Call its adaptive command again in `apply` mode only after the human approves the unchanged digest-bound proposal.
20
+ - Host security permission is separate from Cadre approval and never approves product content, commits, merges, or lifecycle state.
21
+
22
+ ## Candidate artifacts
23
+
24
+ - Write unapproved artifact bodies only beneath `<project-root>/.cadre/stage/<candidate-id>/` at their eventual `.cadre/`-relative paths.
25
+ - Never place unapproved files in canonical `.cadre/` and never transport candidate bodies through MCP when a candidate command exists.
26
+ - Inspect the complete exact candidate set before approval. Approval binds its paths and SHA-256 hashes to one digest.
27
+ - Candidate paths must be relative and traversal-free. Stages reject symbolic links, unexpected files, and size-limit violations.
28
+ - After approval, journal the digest and manifest, promote only matching bytes, verify hashes, and retain the stage through commit recording.
29
+ - `.cadre/stage/` is never committed. A changed candidate requires fresh inspection and approval.
30
+
31
+ ## Resumability and Git safety
32
+
33
+ - Every multi-step mutation records an operation journal after approval and before canonical writes or Git mutation.
34
+ - On resume, reconcile the journal, candidate hashes, canonical files, Git status, expected commit, and recorded checkpoint. Continue only the first incomplete deterministic step.
35
+ - If an expected commit already exists with the correct base relationship and content, record it instead of repeating it.
36
+ - Stop on any journal, hash, path, worktree, branch, or history mismatch. Never reset, discard, force-delete, rewrite public history, or guess a repair.
37
+ - Use additive Git history and focused Conventional Commits. Do not include unrelated files or runtime-only worktrees.
38
+ - Reuse passing verification while product files, test inputs, and verification policy are unchanged. Cadre-only bookkeeping does not invalidate product verification.
39
+
40
+ ## Sources of truth
41
+
42
+ - `spec.md` defines approved scope, requirements, and acceptance criteria.
43
+ - `plan.md` defines phase/task identity, dependencies, verification barriers, completion markers, and commit provenance.
44
+ - Track `state.json` defines identity, lifecycle status, dependencies, revision, checkpoints, active operation, execution pointer, review cycles, and history.
45
+ - Execution journals define live scheduling and provenance; do not duplicate active node state.
46
+ - `project.json` defines project identity plus setup and refresh history; it does not duplicate track records.
47
+ - `tracks.md` is a generated summary. Never hand-edit it or use it as dependency state.
48
+ - Git is implementation history. Completion claims require reachable recorded commits.
49
+
50
+ ## Lifecycle and mutation rules
51
+
52
+ ```text
53
+ drafting-spec -> drafting-plan -> planned -> in_progress -> ready_for_review
54
+ | | | |
55
+ +-- revise ---+-------------+ +-- revise --> in_progress/planned
56
+ | | +-- approved bugs --> in_progress
57
+ +-------------+ +-- clean review --> completed --> archived
58
+ ```
59
+
60
+ - Only `review` may mark a track `completed`; only `archive` may mark it `archived`.
61
+ - Completed or archived intent changes create successor work rather than rewriting terminal history.
62
+ - Track dependencies are read from track state and must be completed or archived before dependent execution.
63
+ - Every delivery phase ends in a derived `User Manual Verification` barrier. The final phase is the track-level manual-verification barrier.
64
+ - An `implement` invocation authorizes the approved plan under its persisted approval mode. `phase` is the default; `governed` adds regular-task and integration decisions; `autonomous` still requires track-level manual verification.
65
+ - Deterministic MCP operations use one call. Approval-aware operations use `prepare`, pause for the human, then `apply` with the unchanged token.
66
+
67
+ ## Context reuse
68
+
69
+ - Inspect project status once at command entry using the narrowest applicable view. Use separate full validation only for final mutation gates or diagnostics.
70
+ - Read each required file once and reuse unchanged content by path and Git hash. Continue truncated reads from the first unread line.
71
+ - Fetch known immutable templates in one bundle and retain them through the decision. Do not rediscover known IDs through the catalog.
72
+ - Present concise status and focused diffs. Identify large unchanged defaults by version, path, and hash unless requested.
73
+
74
+ ## Durable memory and context
75
+
76
+ - Active Pattern Seeds contain one versioned `cadre:memory` JSON block with spec/plan revisions and safe pattern paths plus SHA-256 hashes. Reassess changed guidance within track/revise/refresh/archive authorization; do not silently refresh hashes without reviewing applicability.
77
+ - Preserve completed and archived learning as historical evidence. Missing old handoffs mean not recorded; never manufacture them during migration.
78
+ - Record bounded decisions, failed approaches, open questions, next action, and source fingerprints alongside task commit/block checkpoints. These handoffs are evidence, never approval or duplicated scheduler state.
79
+ - Use `context_read` for a selected node and consume all pages. It returns full approved scope/plan, applicable project instructions, dependency learning, and persisted handoffs. Read code and repository instructions separately before edits. Reuse hashes only when their source content is still available in the current session.
80
+ - Required context is never silently truncated. Continue pages, restart after snapshot drift, and expand ambiguous sections. Stop dependent execution on stale memory until reassessed.
81
+ - Routine status uses summaries; full history and graph are explicit detail reads. Project pagination filters rows, never validation coverage or counts.
82
+ - An approved refresh is required before delivery with a new runtime/template set. Keep staging, diagnostics, blocking, and verified cleanup available for recovery, preserve history, and resume the existing journal after interruption.
@@ -0,0 +1,19 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "action": "archive",
4
+ "batchId": "archive-{{ARCHIVE_TS}}",
5
+ "status": "in_progress",
6
+ "checkpoint": "approved",
7
+ "baseCommit": "{{BASE_COMMIT}}",
8
+ "expectedCommit": "{{EXPECTED_COMMIT}}",
9
+ "selectedTracks": ["{{TRACK_ID}}"],
10
+ "completedTracks": [],
11
+ "approvedArtifacts": ["{{APPROVED_ARTIFACT}}"],
12
+ "approvalDigest": "{{APPROVAL_DIGEST}}",
13
+ "approvedArtifactHashes": [
14
+ { "path": "{{APPROVED_ARTIFACT}}", "sha256": "{{ARTIFACT_SHA256}}" }
15
+ ],
16
+ "artifactProgress": [],
17
+ "approvedAt": "{{APPROVED_AT}}",
18
+ "archiveCommit": null
19
+ }
@@ -0,0 +1,20 @@
1
+ # Pattern: {{PATTERN_NAME}}
2
+
3
+ ## Use when
4
+
5
+ {{APPLICABILITY}}
6
+
7
+ ## Guidance
8
+
9
+ {{GUIDANCE}}
10
+
11
+ ## Tradeoffs and limits
12
+
13
+ {{TRADEOFFS}}
14
+
15
+ ## Provenance
16
+
17
+ - Track: `{{TRACK_ID}}`
18
+ - Phase/task: `{{PHASE_TASK}}`
19
+ - Commits: {{COMMITS}}
20
+ - Archived at: {{TIMESTAMP}}
@@ -0,0 +1,18 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "action": "refresh",
4
+ "operationId": "refresh-{{REFRESH_TS}}",
5
+ "status": "in_progress",
6
+ "checkpoint": "approved",
7
+ "baseCommit": "{{BASE_COMMIT}}",
8
+ "expectedCommit": "cadre(refresh): update project context",
9
+ "refreshPath": "refreshes/refresh-{{REFRESH_TS}}.md",
10
+ "approvedArtifacts": ["refreshes/refresh-{{REFRESH_TS}}.md"],
11
+ "approvalDigest": "{{APPROVAL_DIGEST}}",
12
+ "approvedArtifactHashes": [
13
+ { "path": "{{APPROVED_ARTIFACT}}", "sha256": "{{ARTIFACT_SHA256}}" }
14
+ ],
15
+ "artifactProgress": [],
16
+ "approvedAt": "{{APPROVED_AT}}",
17
+ "refreshCommit": null
18
+ }
@@ -0,0 +1,21 @@
1
+ # Refresh {{REFRESH_TS}}
2
+
3
+ - Status: proposed
4
+ - Previous refresh/setup commit: `{{BASE_COMMIT}}`
5
+ - Refresh commit: pending
6
+
7
+ ## Inputs and evidence
8
+
9
+ {{INPUTS_AND_COMMIT_RANGE}}
10
+
11
+ ## Proposed context changes
12
+
13
+ {{PROPOSED_CHANGES}}
14
+
15
+ ## Active-track impact
16
+
17
+ {{TRACK_IMPACT}}
18
+
19
+ ## Approval
20
+
21
+ {{APPROVAL_RECORD}}