cadre-ai 4.2.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +35 -0
  4. package/README.md +27 -24
  5. package/agents/cadre-phase-worker.md +4 -0
  6. package/agents/cadre-task-worker.md +4 -0
  7. package/dist/cadre-cli.mjs +35 -18
  8. package/dist/cadre-mcp.mjs +2979 -2610
  9. package/package.json +2 -2
  10. package/skills/create/SKILL.md +3 -3
  11. package/skills/implement/SKILL.md +8 -0
  12. package/skills/implement/references/decisions.md +33 -0
  13. package/skills/implement/references/parallel-workers.md +4 -0
  14. package/skills/implement/references/resume-recovery.md +2 -0
  15. package/skills/quick/SKILL.md +3 -34
  16. package/skills/quick/agents/openai.yaml +1 -1
  17. package/skills/quick/references/bounded-work.md +36 -0
  18. package/skills/refresh/SKILL.md +6 -0
  19. package/skills/revert/SKILL.md +1 -1
  20. package/skills/review/SKILL.md +4 -0
  21. package/skills/revise/SKILL.md +6 -0
  22. package/skills/start/SKILL.md +15 -0
  23. package/skills/start/agents/openai.yaml +4 -0
  24. package/skills/track/SKILL.md +8 -2
  25. package/skills/wisp/SKILL.md +3 -3
  26. package/templates/{v8 → v10}/init/workflow.md +11 -0
  27. package/templates/{v8 → v10}/styleguides/index.md +2 -1
  28. package/templates/v10/styleguides/rust.md +27 -0
  29. package/templates/{v8 → v10}/track/dependency-context.json +1 -1
  30. package/templates/v10/track/design.md +32 -0
  31. package/templates/{v8 → v10}/track/spec.md +4 -0
  32. package/templates/{v8 → v10}/track/state.json +8 -2
  33. /package/templates/{v8 → v10}/init/archive/.gitkeep +0 -0
  34. /package/templates/{v8 → v10}/init/gitignore.template +0 -0
  35. /package/templates/{v8 → v10}/init/guidelines.md +0 -0
  36. /package/templates/{v8 → v10}/init/operations/.gitkeep +0 -0
  37. /package/templates/{v8 → v10}/init/patterns/index.md +0 -0
  38. /package/templates/{v8 → v10}/init/product.md +0 -0
  39. /package/templates/{v8 → v10}/init/project.json +0 -0
  40. /package/templates/{v8 → v10}/init/refreshes/.gitkeep +0 -0
  41. /package/templates/{v8 → v10}/init/styleguides/general.md +0 -0
  42. /package/templates/{v8 → v10}/init/styleguides/language.md +0 -0
  43. /package/templates/{v8 → v10}/init/tech-stack.md +0 -0
  44. /package/templates/{v8 → v10}/init/tracks/.gitkeep +0 -0
  45. /package/templates/{v8 → v10}/init/tracks.md +0 -0
  46. /package/templates/{v8 → v10}/init/wisps/.gitkeep +0 -0
  47. /package/templates/{v8 → v10}/project/pattern.md +0 -0
  48. /package/templates/{v8 → v10}/project/refresh-operation.json +0 -0
  49. /package/templates/{v8 → v10}/project/refresh.md +0 -0
  50. /package/templates/{v8 → v10}/quick/record.json +0 -0
  51. /package/templates/{v8 → v10}/styleguides/dart.md +0 -0
  52. /package/templates/{v8 → v10}/styleguides/flutter.md +0 -0
  53. /package/templates/{v8 → v10}/styleguides/go.md +0 -0
  54. /package/templates/{v8 → v10}/styleguides/gradle.md +0 -0
  55. /package/templates/{v8 → v10}/styleguides/html-css.md +0 -0
  56. /package/templates/{v8 → v10}/styleguides/java.md +0 -0
  57. /package/templates/{v8 → v10}/styleguides/javascript.md +0 -0
  58. /package/templates/{v8 → v10}/styleguides/kotlin.md +0 -0
  59. /package/templates/{v8 → v10}/styleguides/maven.md +0 -0
  60. /package/templates/{v8 → v10}/styleguides/python.md +0 -0
  61. /package/templates/{v8 → v10}/styleguides/react.md +0 -0
  62. /package/templates/{v8 → v10}/styleguides/swift.md +0 -0
  63. /package/templates/{v8 → v10}/styleguides/swiftui.md +0 -0
  64. /package/templates/{v8 → v10}/styleguides/typescript.md +0 -0
  65. /package/templates/{v8 → v10}/track/bug.md +0 -0
  66. /package/templates/{v8 → v10}/track/execution.json +0 -0
  67. /package/templates/{v8 → v10}/track/learning.md +0 -0
  68. /package/templates/{v8 → v10}/track/plan.md +0 -0
  69. /package/templates/{v8 → v10}/track/revert-operation.json +0 -0
  70. /package/templates/{v8 → v10}/track/revise-operation.json +0 -0
  71. /package/templates/{v8 → v10}/track/revision.md +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre-ai",
3
- "version": "4.2.0",
3
+ "version": "4.3.1",
4
4
  "description": "Cross-agent, human-governed software delivery harness",
5
5
  "author": {
6
6
  "name": "Dhivon AI",
@@ -39,7 +39,7 @@
39
39
  "marketplace/",
40
40
  "README.md",
41
41
  "skills/",
42
- "templates/v8/",
42
+ "templates/v10/",
43
43
  "NOTICE"
44
44
  ],
45
45
  "scripts": {
@@ -26,11 +26,11 @@ At every required clarification or approval boundary, show a concise summary or
26
26
  1. Resolve the exact project root. Inspect its manifests, source layout, tests, agent guidance, Git status, and recent history. Run `git rev-parse --show-toplevel`: if it succeeds, never initialize a nested repository; if it fails, record that the approved root requires `git init`. Ask which root to use if the boundary is materially ambiguous. Read every existing file before proposing an edit.
27
27
  2. Explicitly classify the context as `greenfield` or `brownfield`, with evidence. A substantive implementation, behavior, user/data/interface contract, or delivery history is brownfield. If a scaffold, prototype, migration, or incomplete evidence makes the classification unclear, ask a blocking question before drafting or mutating anything.
28
28
  3. Call `project_status` with `view: "project"` when `.cadre/project.json` exists and use its embedded structured validation; do not repeat `state_validate` at command entry. Stop on unexplained validation errors. Reconcile its setup journal, worktree, and recent commits. Resume the recorded checkpoint exactly; do not restart or overwrite setup. Offer the Cadre refresh or status workflow only after completed setup.
29
- 4. Call `template_get_many` once for `project/product`, `project/guidelines`, and `project/tech-stack`. Retain that versioned bundle across approval turns and do not refetch it unless its version or content hash changes. Use each response's `artifactPath` as its eventual `.cadre/`-relative destination. `workflow.md`, selected default styleguides, `patterns/index.md`, `.gitignore`, `project.json`, `tracks.md`, and the empty lifecycle directories are initialization outputs generated by the MCP; stage only an explicitly edited workflow or styleguide override. For greenfield work, use explicit user intent and ask about missing material product/stack choices. For brownfield work, distinguish evidenced current reality from desired change and preserve deliberate conventions.
29
+ 4. Call `template_get_many` once for `project/product`, `project/guidelines`, and `project/tech-stack`. Retain that versioned bundle across approval turns and do not refetch it unless its version or content hash changes. Use each response's `artifactPath` as its eventual `.cadre/`-relative destination. `workflow.md`, selected default styleguides, `patterns/index.md`, `.gitignore`, `project.json`, `tracks.md`, and the empty lifecycle directories are initialization outputs generated by the MCP. Stage workflow edits, styleguide overrides, and additional project-authored guides. For greenfield work, use explicit user intent and ask about missing material product/stack choices. For brownfield work, distinguish evidenced current reality from desired change and preserve deliberate conventions.
30
30
  5. Draft `product.md`, `guidelines.md`, and `tech-stack.md`. Resolve any material ambiguity through targeted questions; do not invent product behavior, constraints, or stack decisions.
31
31
  6. Identify the proposed `workflow.md` by template ID, template-set version, content hash, and a concise summary of its material rules and consequences. Do not print the complete unchanged bundled workflow unless the human asks. If changes are requested, show a focused diff and summarize the resulting behavior; show the complete revised workflow only on request. Do not create a standalone workflow approval.
32
- 7. Call `styleguide_resolve` with the proposed technologies. Always include the general guide and resolve the applicable language, framework, markup, and build-tool guides as one set. Preserve evidenced brownfield conventions. Ask only when a material convention choice cannot be resolved from the request and repository; do not ask the human to accept each default guide or the final set separately.
33
- 8. Expected human decision count is one. Call `candidate_stage_prepare` for candidate `create` with `expectedFiles` equal to `product.md`, `guidelines.md`, `tech-stack.md`, and only requested `workflow.md` or `styleguides/*.md` overrides; this prunes removed files and enforces `/stage/`. Write them beneath `.cadre/stage/create` (for example `.cadre/stage/create/product.md`). Never write `.cadre/init/*` or canonical artifacts before apply, and do not pass artifact bodies through MCP. Call `project_init_candidate` with `request: { mode: "prepare", projectRoot, projectName, context, gitDisposition, baseCommit, approvedAt, stagedFiles, styleguideIds }`. After explicit confirmation, call only `request: { mode: "apply", proposalToken }`. Never make those two calls consecutively without the human decision, and do not add later approval prompts.
32
+ 7. Call `styleguide_resolve` with the proposed languages, frameworks, and build tools from the user’s stack or repository evidence (for example Rust for a Cargo workspace). Always include the general guide and resolve the applicable language, framework, markup, and build-tool guides as one set. Preserve evidenced brownfield conventions. Ask only when a material convention choice cannot be resolved from the request and repository; do not ask the human to accept each default guide or the final set separately.
33
+ 8. Expected human decision count is one. Call `candidate_stage_prepare` for candidate `create` with `expectedFiles` equal to `product.md`, `guidelines.md`, `tech-stack.md`, any requested `workflow.md` override, and every edited or project-authored `styleguides/<slug>.md` (lowercase letters, digits, and hyphens); this prunes removed files and enforces `/stage/`. Write them beneath `.cadre/stage/create` (for example `.cadre/stage/create/product.md`). Never write `.cadre/init/*` or canonical artifacts before apply, and do not pass artifact bodies through MCP. Call `project_init_candidate` with `request: { mode: "prepare", projectRoot, projectName, context, gitDisposition, baseCommit, approvedAt, stagedFiles, styleguideIds }`. List every staged path in `stagedFiles`. Use `styleguideIds` for selected bundled IDs only. Each custom guide is its own approved file under `.cadre/styleguides/`. After explicit confirmation, call only `request: { mode: "apply", proposalToken }`. Never make those two calls consecutively without the human decision, and do not add later approval prompts.
34
34
  9. If Git disposition is `initialize`, run `git init` only at the approved root and verify its top level. The approved recovery journal remains durable if initialization fails. Existing Git roots are never reinitialized.
35
35
  10. Apply has already written completed state using its stable operation reference. A pre-commit status may report only `commit_pending`; any other structural or artifact error blocks the commit. Commit `cadre(create): initialize project harness` once with the returned receipt trailers. Reconcile it and remove only the matching candidate stage. Do not call a separate Git-initialization checkpoint or make a provenance commit.
36
36
 
@@ -41,6 +41,14 @@ Read only the references required by current state:
41
41
 
42
42
  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.
43
43
 
44
+ ## Clarification and technical Autopilot
45
+
46
+ Before affected edits, apply the clarification gate: inspect evidence and distinguish routine conventional choices, factual uncertainty to investigate, and unresolved material choices. Confidence is not authority. Ask about material choices unless the persisted decision policy delegates them; pause only affected work and continue independent ready tasks. Workers escalate to main before implementing the choice. Ordinary follow-up questions in handoffs are not blocking decision records.
47
+
48
+ When a material choice arises, read `references/decisions.md`, record it before dependent edits, and resolve it through main using exact question/digest and actual authority. Read the same reference when Autopilot is requested. The explicit **Autopilot** preset selects `approvalMode: "autonomous"` and `decisionPolicy: "technical-autopilot"` at execution_start; `auto` keeps its existing Autonomous-only meaning. Default decision policy is `ask`; never infer delegation from approval mode or host permissions. New delegation requires the approved v9 workflow contract. Resume persisted authority; changing policy requires an explicitly authorized new execution at a quiescent revision boundary. Scope/design revisions require explicit reassessment and otherwise return to `ask`.
49
+
50
+ Read the full approved design when present through context_read. Preserve it during implementation; record execution choices in the journal. Changed approved constraints or newly required design go through revise. Final completion approval and every existing verification requirement remain mandatory.
51
+
44
52
  ## Execute ready work
45
53
 
46
54
  Use the scheduler returned by the preflight or latest mutation receipt. Plan order only breaks ties.
@@ -0,0 +1,33 @@
1
+ # Material decisions
2
+
3
+ Inspect repository evidence before classifying a choice. Follow established conventions for routine details without another call. Investigate unknown facts; never invent evidence. A material choice has multiple plausible outcomes affecting behavior, contracts, data, compatibility, security, architecture, or operational consequences. Main records it before affected edits; workers escalate and wait. Continue independent ready work.
4
+
5
+ Use `execution_checkpoint` with the existing `scope` (including an affected task's exact nodeId). For `action.event: "record_decision"`, provide `decision`:
6
+
7
+ ```json
8
+ {
9
+ "id": "retry-storage",
10
+ "question": "Which existing internal retry store satisfies AC-003?",
11
+ "category": "technical",
12
+ "affectedTasks": ["T1.1"],
13
+ "options": [
14
+ {"id": "existing-queue", "description": "Use the configured durable queue"},
15
+ {"id": "existing-table", "description": "Use the existing transactional store"}
16
+ ],
17
+ "recommendation": "existing-queue",
18
+ "evidence": "Both are already approved; inspected retry and recovery contracts",
19
+ "sources": [{"path": "path/to/inspected/source", "sha256": "EXACT_SHA256"}]
20
+ }
21
+ ```
22
+
23
+ Categories are `technical`, `product`, `external`, and `factual`. Public contracts, destructive data changes, security/privacy policy, new production dependencies/services, spending, and scope changes are never delegated technical choices. A new requirement needs revise rather than merely a decision resolution. Source paths are repository-relative; hashes must match inspected bytes. Never manufacture an option or source to satisfy the schema.
24
+
25
+ Under `ask`, present the question, meaningful options, recommendation and consequence using the host's clarification mechanism. Wait for the answer before dependent edits. Under explicit `technical-autopilot`, main may choose only an evidenced internal technical option preserving approved behavior, stack, design and constraints. If evidence is insufficient, investigate or ask. Approval mode and confidence do not delegate decisions.
26
+
27
+ Resolve using `action: {event: "resolve_decision", decisionId, expectedDecisionDigest, resolution: {optionId, authority, rationale, authorization, verification}}`. Copy the digest from the returned decision. `authority` is `human` or `delegated`; authorization describes the actual answer or persisted delegation, never a fabricated human approval. Verification describes the evidence supporting the choice, not future tests falsely claimed as passed.
28
+
29
+ If evidence/question changes before resolution, record the revised pending decision with the same ID and `expectedDecisionDigest`. Preserve category and affected tasks; previous bytes remain in decisionHistory. Never clear a pending choice by changing its category. A resolved choice cannot be rewritten: record a new decision, or use revision if the approved baseline changes. Exact retries are idempotent; conflicting resolutions fail.
30
+
31
+ Pending decisions gate task starts, commits, groups, integration, verification and finish. Phases can start to enable unaffected siblings. No decision checkpoint is needed for a routine choice. Read recorded authority and decisions through context_read on resume; a fresh worker must receive their actual text. Historical decisions are evidence only. Final completion still requires human approval.
32
+
33
+ Pending decisions carry into successor executions. Before removing an affected task, obtain an exact human disposition (reassess its options to include cancellation when appropriate); revision approval alone does not answer the question. Context includes prior execution choices for review, but historical authority never grants new delegation. Changes to project workflow, stack, product or guidelines invalidate the execution baseline; recover through an approved quiescent revision and explicitly reassess the next execution policy. Metadata-only revisions with unchanged constraints retain the current baseline.
@@ -13,3 +13,7 @@ Supply workers a bounded context handoff with required source paths/hashes and e
13
13
  ## Cohesive execution contract
14
14
 
15
15
  For a new cohesive-v1 execution, main may assign a whole approved commit group. Execute its internal dependencies in order, verify every task, and return individual authorization, verification and handoff evidence with one shared product commit. Never split a group across workers or independently schedule a member before the group's external dependencies. Legacy executions keep their original task boundaries. Main owns atomic complete_group, Git integration, receipts and all Cadre state. Use only the owned build-cache path main supplies. Fast-forward integration is valid provenance; do not require a merge object.
16
+
17
+ ## Material uncertainty
18
+
19
+ Before affected edits, inspect evidence. Follow established conventions for routine details; investigate unknown facts. Stop affected work and report materially different choices to main with the question, options, recommendation, affected tasks, and source evidence. Never silently select product behavior or treat confidence as authority. Main records and resolves blocking decisions; wait for its exact resolution even under Autopilot. Preserve approved design, and distinguish these blockers from harmless follow-up questions. Continue other assigned independent work only when main authorizes it.
@@ -18,3 +18,5 @@ After an approved receipt-based revision changes the graph, reconcile its receip
18
18
  ## Cohesive execution contract
19
19
 
20
20
  For a new cohesive-v1 execution, main may assign a whole approved commit group. Execute its internal dependencies in order, verify every task, and return individual authorization, verification and handoff evidence with one shared product commit. Never split a group across workers or independently schedule a member before the group's external dependencies. Legacy executions keep their original task boundaries. Main owns atomic complete_group, Git integration, receipts and all Cadre state. Use only the owned build-cache path main supplies. Fast-forward integration is valid provenance; do not require a merge object.
21
+
22
+ Restore persisted decision authority, pending choices, exact digests and resolutions before affected edits. Never interpret legacy openQuestions as resolved or as automatic blockers. Reinspect changed evidence before resolving; obtain explicit reassessment after scope/design revision. Read `decisions.md` when decision recovery is needed.
@@ -1,41 +1,10 @@
1
1
  ---
2
2
  name: quick
3
- description: Implement a bounded fix, refactor, documentation change, test, or small feature without a track, then record its verified outcome in Cadre. Use when one locally verifiable outcome needs no coordinated delivery, migration, or change to approved track scope.
3
+ description: Deprecated 4.3.0 entry point for an explicitly requested Quick change. Use Start for new work.
4
4
  ---
5
5
 
6
6
  # Cadre Quick
7
7
 
8
- Read `.cadre/workflow.md` first. Quick requires an initialized, healthy project that has adopted the quick contract through create or an approved refresh. `QUICK_REFRESH_REQUIRED` means propose that one-time refresh; never silently edit policy or version labels. This workflow does not apply to the Cadre harness repository itself unless testing an explicitly requested fixture.
8
+ For a direct invocation, say once: “Quick is deprecated and is scheduled for removal in the next release. Use Start for new work.” Continue with the original request in this conversation.
9
9
 
10
- ## Scope and context
11
-
12
- A clear request authorizes reversible product edits. Ask a short scope question before editing only when inspection reveals a material choice or wider consequence. Use impact and verification to judge size, not a line-count threshold. One bounded feature can qualify; migrations, coordinated phases, and changes to an active track's approved requirements need track or revise.
13
-
14
- Call `project_status` with `view: "project"`. Stop on invalid state, unresolved operations, stale memory, or conflicting work. Inspect affected active-track scope and require a quiescent worker boundary; quick v1 does not run beside active Cadre workers. Status includes unconsolidated quick records and staged intent separately from tracks; inspect further quickCursor pages only when relevant, independently of track cursors. Archived records contribute to counts without listing their history.
15
-
16
- Read `context_read` with `scope: "project"`, without trackId. Consume every page and require `contextReady`. Default context contains no quick history. Use a focused `quickSearch: {query, paths, limit}` (query or paths required, default 5 hits, maximum 10) and the pattern index to select relevant `quickIds` and `patternIds`, then start a new read with those selections. Search includes archived records; never drain its optional nextSearchCursor pages automatically. Reuse a retainedContextToken only while its source text remains available, with unchanged scope/selections across continuation pages; clear it after context loss. Quick outcomes are historical evidence, not authority overriding requirements. Read relevant code, callers, tests, and repository instructions separately.
17
-
18
- ## Implement and verify
19
-
20
- 1. Before editing, call `candidate_apply` with `request: {mode: "begin_quick", projectRoot, quickId, intent}`. Choose a stable unused ID and a short exact intent. This writes only an ignored checkpoint and returns candidateId, stagePath, and baseCommit. On interruption, resume that checkpoint and existing work; do not overwrite the baseline or retroactively adopt earlier edits.
21
- 2. Preserve unrelated work, including staged changes. Paths dirty at the checkpoint cannot be included in quick delivery. If work overlaps those edits, pause to resolve ownership. Do not reset, stash, or discard user work to satisfy a gate.
22
- 3. Implement the bounded change in the current checkout. Run proportionate verification and review the complete resulting diff. Fix findings within scope; failed or unavailable required checks block completion. If scope grows, preserve the checkpoint and diff, summarize remaining work, and route to track or revise without claiming quick completion.
23
- 4. Fetch `quick/record` through `template_get_many`. Render only `quick/<quickId>.json` beneath the returned stage. Keep `checkpoint.json`; do not use candidate_stage_prepare with a manifest that removes it. Match the exact checkpoint intent. Include actual acceptance, outcome, all new affected product paths, passing verification evidence, reviewed: true, and relevant context path/hash references. Leave operation null and omit product: the runtime derives both. Lessons and relatedQuickIds may be empty; never invent learning.
24
-
25
- ## One completion approval
26
-
27
- Call `candidate_apply` with `request: {mode: "prepare", projectRoot, candidateId, workflow: "quick", files: ["quick/<quickId>.json"]}`. Present the focused product diff, verification/review evidence, completion record (including runtime-derived stateChanges), receipt manifest, and one combined local commit. Ask once for explicit approval of the unchanged proposal. An earlier scope discussion does not approve completion. Rejection leaves the candidate and product diff uncommitted; do not promote or claim completion.
28
-
29
- At a decision boundary, inspect host policy before workflow_elicit. Under approval policy `never`, ask once in chat; otherwise use workflow_elicit and fall back to chat on fallback_required. Host tool permission is not Cadre approval. Do not repeat answered questions or approvals, and never approve your own proposal.
30
-
31
- After approval, call `request: {mode: "apply", proposalToken}`. Changed product bytes, context, Git baseline, unrelated index entries, or verification inputs require reassessment and a fresh proposal. Do not weaken checks or erase recovery intent to bypass drift.
32
-
33
- Create one local Conventional Commit containing exactly the approved product paths, `.cadre/quick/<quickId>.json`, and the returned immutable receipt. Include both exact receipt trailers. Stage only owned files and use a path-limited commit (for example, `git commit --only ... -- <owned paths>`) to preserve unrelated staged work. Verify the final commit includes no unrelated changes. Do not push. Then call `candidate_apply` with `request: {mode: "reconcile", projectRoot, operationId}`. Reconciliation verifies the product manifest and cleans temporary recovery state; there is no bookkeeping commit.
34
-
35
- ## Recovery and outcome
36
-
37
- If interrupted after approval, reconcile an existing commit first. Otherwise use `request: {mode: "resume", projectRoot, operationId, approvalDigest}` with the persisted original approval. Staging owned product files for the combined commit does not invalidate approval; unmerged index entries still block recovery. Resume validates both context and product evidence; never replace the journal or repeat completed product work. Report commit_pending as unresolved provenance, not completion.
38
-
39
- Before pausing unfinished work, add or update only checkpoint.json's optional `progress: {status: "working" | "blocked" | "escalated", summary, nextAction}`. Preserve its original identity, intent, and baseline. Status surfaces blocked/escalated intent and nextAction; these are unapproved working notes, not completion evidence. Resolve the recorded blocker before setting progress back to working and preparing completion.
40
-
41
- Report the outcome, verification, commit, and any lesson briefly. Completed records await consolidation in `.cadre/quick/`. A later approved refresh batch records source assessments, consolidates durable guidance, and moves the unchanged records to `.cadre/archive/.quick/`. Archived records remain retrievable by ID or focused search and are omitted from routine status rows and context. Corrections use a new linked quick record or a track; quick records are not track dependency nodes and have no dedicated archive/revert lifecycle.
10
+ Read `.cadre/workflow.md` and follow [bounded work](references/bounded-work.md), including recovery and the final approval.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Cadre: Quick"
3
- short_description: "Small changes with durable Cadre context"
3
+ short_description: "Deprecated in 4.3.0. Use Cadre: Start"
4
4
  default_prompt: "Use $quick to implement a bounded change and record its verified outcome in Cadre."
@@ -0,0 +1,36 @@
1
+ # Bounded work
2
+
3
+ Read `.cadre/workflow.md` first. When resuming, inspect the existing checkpoint and pending operation first, preserve its original intent, ID, baseline, and approval, and continue at its recorded step. Quick requires an initialized, healthy project that has adopted the quick contract through create or an approved refresh. `QUICK_REFRESH_REQUIRED` means propose that one-time refresh; never silently edit policy or version labels. This workflow does not apply to the Cadre harness repository itself unless testing an explicitly requested fixture.
4
+
5
+ ## Scope and context
6
+
7
+ A clear request authorizes reversible product edits. Ask a short scope question before editing only when inspection reveals a material choice or wider consequence. Use impact and verification to judge size, not a line-count threshold. One bounded feature can qualify; migrations, coordinated phases, and changes to an active track's approved requirements need track or revise.
8
+
9
+ Call `project_status` with `view: "project"`. Stop on invalid state, unresolved operations, stale memory, or conflicting work. Inspect affected active-track scope and require a quiescent worker boundary; quick v1 does not run beside active Cadre workers. Status includes unconsolidated quick records and staged intent separately from tracks; inspect further quickCursor pages only when relevant, independently of track cursors. Archived records contribute to counts without listing their history.
10
+
11
+ Read `context_read` with `scope: "project"`, without trackId. Consume every page and require `contextReady`. Default context contains no quick history. Use a focused `quickSearch: {query, paths, limit}` (query or paths required, default 5 hits, maximum 10) and the pattern index to select relevant `quickIds` and `patternIds`, then start a new read with those selections. Search includes archived records; never drain its optional nextSearchCursor pages automatically. Reuse a retainedContextToken only while its source text remains available, with unchanged scope/selections across continuation pages; clear it after context loss. Quick outcomes are historical evidence, not authority overriding requirements. Read relevant code, callers, tests, and repository instructions separately.
12
+
13
+ ## Implement and verify
14
+
15
+ 1. For new work only, before editing, call `candidate_apply` with `request: {mode: "begin_quick", projectRoot, quickId, intent}`. Choose a stable unused ID and a short exact intent. This writes only an ignored checkpoint and returns candidateId, stagePath, and baseCommit. On interruption, resume that checkpoint and existing work; do not overwrite the baseline or retroactively adopt earlier edits.
16
+ 2. Preserve unrelated work, including staged changes. Paths dirty at the checkpoint cannot be included in quick delivery. If work overlaps those edits, pause to resolve ownership. Do not reset, stash, or discard user work to satisfy a gate.
17
+ 3. Implement the bounded change in the current checkout. Run proportionate verification and review the complete resulting diff. Fix findings within scope; failed or unavailable required checks block completion. If scope grows, preserve the checkpoint and diff, summarize remaining work, and route to track or revise without claiming quick completion.
18
+ 4. Fetch `quick/record` through `template_get_many`. Render only `quick/<quickId>.json` beneath the returned stage. Keep `checkpoint.json`; do not use candidate_stage_prepare with a manifest that removes it. Match the exact checkpoint intent. Include actual acceptance, outcome, all new affected product paths, passing verification evidence, reviewed: true, and relevant context path/hash references. Leave operation null and omit product: the runtime derives both. Lessons and relatedQuickIds may be empty; never invent learning.
19
+
20
+ ## One completion approval
21
+
22
+ Call `candidate_apply` with `request: {mode: "prepare", projectRoot, candidateId, workflow: "quick", files: ["quick/<quickId>.json"]}`. Present the focused product diff, verification/review evidence, completion record (including runtime-derived stateChanges), receipt manifest, and one combined local commit. Ask once for explicit approval of the unchanged proposal. An earlier scope discussion does not approve completion. Rejection leaves the candidate and product diff uncommitted; do not promote or claim completion.
23
+
24
+ At a decision boundary, inspect host policy before workflow_elicit. Under approval policy `never`, ask once in chat; otherwise use workflow_elicit and fall back to chat on fallback_required. Host tool permission is not Cadre approval. Do not repeat answered questions or approvals, and never approve your own proposal.
25
+
26
+ After approval, call `request: {mode: "apply", proposalToken}`. Changed product bytes, context, Git baseline, unrelated index entries, or verification inputs require reassessment and a fresh proposal. Do not weaken checks or erase recovery intent to bypass drift.
27
+
28
+ Create one local Conventional Commit containing exactly the approved product paths, `.cadre/quick/<quickId>.json`, and the returned immutable receipt. Include both exact receipt trailers. Stage only owned files and use a path-limited commit (for example, `git commit --only ... -- <owned paths>`) to preserve unrelated staged work. Verify the final commit includes no unrelated changes. Do not push. Then call `candidate_apply` with `request: {mode: "reconcile", projectRoot, operationId}`. Reconciliation verifies the product manifest and cleans temporary recovery state; there is no bookkeeping commit.
29
+
30
+ ## Recovery and outcome
31
+
32
+ If interrupted after approval, reconcile an existing commit first. Otherwise use `request: {mode: "resume", projectRoot, operationId, approvalDigest}` with the persisted original approval. Staging owned product files for the combined commit does not invalidate approval; unmerged index entries still block recovery. Resume validates both context and product evidence; never replace the journal or repeat completed product work. Report commit_pending as unresolved provenance, not completion.
33
+
34
+ Before pausing unfinished work, add or update only checkpoint.json's optional `progress: {status: "working" | "blocked" | "escalated", summary, nextAction}`. Preserve its original identity, intent, and baseline. Status surfaces blocked/escalated intent and nextAction; these are unapproved working notes, not completion evidence. Resolve the recorded blocker before setting progress back to working and preparing completion.
35
+
36
+ Report the outcome, verification, commit, and any lesson briefly. Completed records await consolidation in `.cadre/quick/`. A later approved refresh batch records source assessments, consolidates durable guidance, and moves the unchanged records to `.cadre/archive/.quick/`. Archived records remain retrievable by ID or focused search and are omitted from routine status rows and context. Corrections use a new linked quick record or a track; quick records are not track dependency nodes and have no dedicated archive/revert lifecycle.
@@ -88,3 +88,9 @@ Adopt the current workflow template's `<!-- cadre:refresh-archival:v1 -->` contr
88
88
  Present the semantic diff, resolved selection, moves and derived state changes together with the digest. After approval apply only its candidate_apply token. Commit all approved moves and derived changes together with the refresh receipt and exact returned trailers, then reconcile. Interrupted promotion uses `request: {mode: "resume", projectRoot, operationId, approvalDigest}` from the original approved journal, without another approval for unchanged consequences. Committed candidate retries make zero-change replay even after candidate cleanup. Do not redistill while a pending operation exists.
89
89
 
90
90
  Historical archive receipts remain readable and resolvable. Resume/reconcile already-approved archive journals through candidate_apply using their original operationId and approvalDigest, then commit only once. Unapplied archive proposals must be prepared again through Refresh. Legacy pre-receipt archive journals still require the documented 3.9.0 bridge; never rewrite or discard their approval.
91
+
92
+ ## v9 decision and design contract
93
+
94
+ Adopt the v9 workflow's `<!-- cadre:decisions:v1 -->` contract only in the approved workflow diff, preserving custom policy. Refresh does not silently grant Autopilot or synthesize historical design/decisions. Existing active tracks acquire design assessments when revised; new v9 tracks always assess design. Include changed design in a complete approved revision, with next design/plan revisions and dependency coverage. Preserve archived design and decision journals byte-for-byte. Context-only Refresh cannot rewrite decision authority. Consolidate evidenced execution choices into durable learning; changing an approved design still needs a revision.
95
+
96
+ Workflow, stack, product and guideline bytes are part of the execution decision baseline. If these constraints change during execution, include a complete quiescent track revision in the same approval or use revise afterward to reassess authority before resuming affected work. Do not edit journal fingerprints directly.
@@ -51,7 +51,7 @@ Preserve phase history and existing handoffs. For active tracks, keep the marked
51
51
 
52
52
  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.
53
53
 
54
- When temporarily replacing an implement operation with the approved revert operation, preserve `lastExecution: {executionId, journal, planRevision, graphDigest, headCommit, completedAt, approvalMode}` throughout the repair, copying those values from the persisted journal (including null head/completion values on an active run); include that exact proposed state in staging. After reconciliation restore the original implement operation, with the selected task pending as approved, before clearing the temporary revert. Preserve every handoff and original task SHA as evidence; workerHistory contains worker IDs, never commit SHAs. Never clear both execution references while a journal is in progress. Include state, execution journal, plan and reassessed learning in the single proposal. Do not change plan revisions or task descriptions merely to reset completion markers.
54
+ When temporarily replacing an implement operation with the approved revert operation, preserve `lastExecution: {executionId, journal, planRevision, graphDigest, headCommit, completedAt, approvalMode, approvalPolicyVersion, decisionAuthority}` 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. Copy decisionAuthority exactly when present; omit it for legacy journals. Preserve structured decisions, decision history and previousExecutionId in both the original snapshot and reset journal. Validate the temporary binding on interruption before resuming. 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.
55
55
 
56
56
  Candidate paths never include a leading `.cadre/`: use `state.json`, `plan.md`, `learning.md`, `executions/execution-<id>.json`, and `reverts/revert-<id>.md` for the owned track, or `tracks/<id>/...` for nested updates. Revert artifact IDs use lowercase letters, digits and hyphens: for target `T1.1`, use `reverts/revert-t1-1.md` and `reverts/revert-t1-1-execution-before.json`, while retaining `targetId: "T1.1"` in the evidence. Do not put uppercase node IDs or dots in artifact basenames. The stage already supplies the root. Use `candidate_inspect` to validate the full proposed overlay before asking for approval.
57
57
 
@@ -113,3 +113,7 @@ Every approval mode checks product and verification-policy content against the r
113
113
  ## Quick outcome context
114
114
 
115
115
  Default context_read includes no quick history. When prior small changes may matter, use quickSearch with a focused query or affected paths (default 5 hits, maximum 10), then load only relevant quickIds. Search covers pending consolidation and archive/.quick/ history. Do not exhaust search pages automatically; nextSearchCursor is optional discovery, separate from required context pagination. Consume all pages of selected records and retain existing required track context. Quick records are historical evidence, never authority to change an approved specification or dependency graph. Track creation can use scope: "project" without a trackId. Route a new bounded change that needs no coordinated delivery or approved-scope revision to quick; do not replace an existing track's execution with quick.
116
+
117
+ ## Decisions and design
118
+
119
+ Read the complete approved design and execution decision records. Verify consequential implementation choices against scope, evidence, and actual human or delegated authority. Apply the clarification gate to new material ambiguity before remediation edits; routine conventions need no question, unknown facts require investigation, and workers escalate to main. Autopilot delegates only recorded in-scope technical choices and never changes final approval. Do not rewrite design or resolve product/external decisions under Autonomous authority. Route changed approved design through revise. Pending material decisions prevent completion; ordinary historical openQuestions do not.
@@ -70,3 +70,9 @@ Use `revisions/revision-<id>.md` (including the `revision-` prefix), with lowerc
70
70
  ## Quick outcome context
71
71
 
72
72
  Default context_read includes no quick history. When prior small changes may matter, use quickSearch with a focused query or affected paths (default 5 hits, maximum 10), then load only relevant quickIds. Search covers pending consolidation and archive/.quick/ history. Do not exhaust search pages automatically; nextSearchCursor is optional discovery, separate from required context pagination. Consume all pages of selected records and retain existing required track context. Quick records are historical evidence, never authority to change an approved specification or dependency graph. Track creation can use scope: "project" without a trackId. Route a new bounded change that needs no coordinated delivery or approved-scope revision to quick; do not replace an existing track's execution with quick.
73
+
74
+ ## Design and delegation revisions
75
+
76
+ For v9 tracks, reassess `state.design` and use dependency-context schemaVersion 2. Include a required design in the exact candidate. A changed design increments its revision and the plan revision, reassesses learning/dependency context, and supersedes active execution at the same approved quiescent boundary as any graph change. Do not remove an approved design; revise it. Preserve commit references in authored state; runtime binds changed design to the receipt. Resolve new material planning choices with the human. Scope/design revision invalidates decision delegation; explicitly reassess it at the next implementation invocation, otherwise use `ask`. Preserve prior decisions in historical journals.
77
+
78
+ Preserve pending decision obligations for retained tasks. Resolve an exact disposition before removing their affected task IDs. A revision that changes only metadata retains execution authority; a revision that repairs changed governing project constraints supersedes stale authority even when the plan graph is unchanged.
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: start
3
+ description: Start a Cadre change or continue existing work. Inspect scope and checkpoints, then deliver a bounded Quick change or prepare a Track specification and plan.
4
+ ---
5
+
6
+ # Cadre Start
7
+
8
+ Read `.cadre/workflow.md` and repository instructions. Use Cadre's `project_status` with `view: "project"` and its embedded validation. If setup is missing, follow Create with the user. Stop on invalid state. Inspect relevant code, callers, tests, active and staged work, and pending operations. Follow status pagination when needed to establish ownership. Route before product edits, `begin_quick`, or preparing a track candidate.
9
+
10
+ 1. **Existing work takes precedence.** Match the request to actual intent, paths, track scope, and checkpoint. Resume an interrupted Quick at its recorded step. For an approved pending operation, reconcile an existing commit or resume with its original approval. Resume a matching staged or drafting track through Track. Follow Implement for approved delivery, Review for work awaiting review, and Revise for changed approved scope or a successor. Resolve conflicting ownership before starting new work. Never recreate a checkpoint, repeat an approval, or silently adopt earlier edits.
11
+ 2. **Honor explicit Track selection**, even for a small fix. Use Track for a migration, coordinated delivery, or work needing a specification and plan. Follow the installed Cadre Track skill in this conversation through its planning approval. On the v9 contract assess conditional `design.md` and include it in the same proposal when required.
12
+ 3. **Use Quick** for one bounded outcome that can be verified locally, such as fixing and checking a broken README link. Read and follow `references/bounded-work.md` from the installed Quick skill directory (named `cadre-quick` in Zed). This is the shared procedure for both new and interrupted Quick work. Enter it directly, without invoking the compatibility command or showing its deprecation notice.
13
+ 4. **Clarify only a material unknown.** If inspection leaves a choice that changes the route, scope, or acceptance, ask a focused question and wait before writing anything. Use the project's clarification policy. Reuse the answer when continuing.
14
+
15
+ Carry the original request and inspected evidence into the selected procedure in the same conversation. Routing needs no separate approval or second command.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cadre: Start"
3
+ short_description: "Start a bounded change or a planned track"
4
+ default_prompt: "Use $start to inspect my request and follow the appropriate Cadre workflow."
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: track
3
- description: Create or resume a Cadre feature or bug track, including a functional/non-functional specification, acceptance criteria, dependencies, phased task plan, manual-verification gates, and relevant pattern learning seed. Use for the track command or new scoped delivery work.
3
+ description: Create or resume a Cadre feature or bug track, including a functional/non-functional specification, acceptance criteria, dependencies, phased task plan, manual-verification gates, and relevant pattern learning seed. Use when the user explicitly wants a track or Start selects planning.
4
4
  ---
5
5
 
6
6
  # Cadre Track
@@ -29,6 +29,12 @@ Read `.cadre/workflow.md`, `project.json`, `product.md`, `guidelines.md`, `tech-
29
29
 
30
30
  Call `project_status` first with `view: "project"` for a new track or `view: "track"` plus `trackId` when resuming, and use its embedded structured validation; do not repeat `state_validate` at command entry. Stop when `valid` is false until every returned error is understood. A focused `kind: "staged_track_candidate"` is unapproved; resume it through `candidate_inspect`. A `kind: "canonical_track"` may resume here only in `drafting-spec` or `drafting-plan`. For `planned` or `in_progress`, use implementation or revision; for `ready_for_review`, use review; for terminal state, create a separately approved successor. Never replace a non-drafting canonical track.
31
31
 
32
+ ## Conditional design (v9 contract)
33
+
34
+ Assess design before drafting: cross-component architecture, public contracts, persisted data/migrations, and consequential reliability/security changes require design.md. Routine local changes following an established pattern may omit it. Record `state.design: {required, rationale, revision}` (revision 0 when omitted, initially 1 when required); explain omitted design through a short approach in spec. Never decide material planning questions silently; implementation Autopilot does not delegate planning.
35
+
36
+ When required, include `track/design` in the template bundle and `design.md` in both exact staging/apply manifests below. Document approach, interfaces/data flow, failure handling, alternatives/selected decisions and verification approach, referencing FR/AC/task IDs. Verification approach describes only design-specific evidence (for example concurrency, fault injection, migration or performance checks); do not repeat acceptance criteria or task-level commands. When ordinary tests suffice, one sentence referencing the criteria is enough. Aim for 300–800 tokens for an ordinary design without truncating constraints. Resolve material planning questions before the single combined approval. Use dependency-context schemaVersion 2, covering every dependency's spec, learning, and required design sources. Existing projects adopt v9 through approved Refresh; retain historical tracks unchanged.
37
+
32
38
  ## Procedure
33
39
 
34
40
  1. Normalize a stable track ID. Look for its state at the status-derived active or archive location. If track state exists, reconcile its operation journal, working tree, and recent commits first. If only `track-<track-id>` candidate state exists, retain its exact files and resume the pre-approval proposal instead of treating it as a track or restarting it. Otherwise determine title, type, goal, scope, dependencies, risks, and unknowns with the human.
@@ -54,4 +60,4 @@ Preserve phase history and existing handoffs. For active tracks, keep the marked
54
60
 
55
61
  ## Quick outcome context
56
62
 
57
- Default context_read includes no quick history. When prior small changes may matter, use quickSearch with a focused query or affected paths (default 5 hits, maximum 10), then load only relevant quickIds. Search covers pending consolidation and archive/.quick/ history. Do not exhaust search pages automatically; nextSearchCursor is optional discovery, separate from required context pagination. Consume all pages of selected records and retain existing required track context. Quick records are historical evidence, never authority to change an approved specification or dependency graph. Track creation can use scope: "project" without a trackId. Route a new bounded change that needs no coordinated delivery or approved-scope revision to quick; do not replace an existing track's execution with quick.
63
+ Default context_read includes no quick history. When prior small changes may matter, use quickSearch with a focused query or affected paths (default 5 hits, maximum 10), then load only relevant quickIds. Search covers pending consolidation and archive/.quick/ history. Do not exhaust search pages automatically; nextSearchCursor is optional discovery, separate from required context pagination. Consume all pages of selected records and retain existing required track context. Quick records are historical evidence, never authority to change an approved specification or dependency graph. Track creation can use scope: "project" without a trackId. An explicit Track request selects planning even for a bounded change. For an undecided new request, recommend Start.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wisp
3
- description: Perform lightweight exploration, investigation, spikes, or questions without creating or mutating Cadre project/track state. Use for the wisp command when work is intentionally untracked; route durable work to quick or track before implementation.
3
+ description: Perform lightweight exploration, investigation, spikes, or questions without creating or mutating Cadre project/track state. Use for the wisp command when work is intentionally untracked; route durable work to Start before implementation.
4
4
  ---
5
5
 
6
6
  # Cadre Wisp
@@ -11,9 +11,9 @@ When the exploration needs a material clarification and the Cadre MCP is availab
11
11
 
12
12
  1. Define the exploration question and expected disposable output. Use `.cadre/wisps/<timestamp>-<slug>/` only when an initialized project already has a regular `.cadre/.gitignore` containing `/wisps/`. Otherwise use an OS temporary directory and never create `.cadre` for a wisp.
13
13
  2. Inspect relevant repository files. Before editing any existing file, read it and its directly relevant context; inspect the directory before creating a file.
14
- 3. Prefer read-only investigation and temporary files outside the repository. Standard Wisp has zero approval prompts. Wisp files never enter Cadre state or commits. Route requested persistent product changes to quick for bounded work or track for coordinated delivery; only when the human explicitly insists on an untracked persistent edit, present one exact scope approval and do not commit automatically.
14
+ 3. Prefer read-only investigation and temporary files outside the repository. Standard Wisp has zero approval prompts. Wisp files never enter Cadre state or commits. Route requested persistent product changes to Start; only when the human explicitly insists on an untracked persistent edit, present one exact scope approval and do not commit automatically.
15
15
  4. Return findings, evidence, uncertainty, and a recommendation.
16
- 5. If the result should become product work, recommend quick for bounded work or track for coordinated delivery; do not retroactively mutate Cadre state from the wisp.
16
+ 5. If the result should become product work, recommend Start; do not retroactively mutate Cadre state from the wisp.
17
17
 
18
18
  Wisp bypasses delivery tracking, not safety, repository instructions, or read-before-edit discipline.
19
19
 
@@ -122,3 +122,14 @@ Refresh assesses at most 20 unconsolidated quick outcomes per approved batch, re
122
122
  Refresh owns project maintenance and completed-track archival in one digest-bound approval, receipt, and commit. By default select all eligible completed tracks in dependency order; explicit selectedTracks limits the batch and [] excludes track archival. Freeze selection at preparation. Require clean approved review, valid project state, reconciled operations, and quiescent workers. Assess track learning, repository changes, patterns and up to 20 quick outcomes together; no-change assessments are valid and must explain why. Reassess affected active-track seeds and dependency context and derive source-path relocation within the same approval. Preserve archived history byte-for-byte except status, checkpoint and appended archival provenance bound to the refresh receipt. Never manually stage archive destinations. A blocked-review retry remains focused and cannot archive tracks or consolidate quick outcomes.
123
123
 
124
124
  Existing supported projects adopt this contract through an approved workflow diff in Refresh, preserving custom policy. Version labels alone do not authorize archival. Historical archive receipts remain readable; recover already-approved archive journals with candidate_apply resume/reconcile. Unapplied archive proposals must be prepared again through Refresh.
125
+
126
+ ## Material decisions and conditional design
127
+
128
+ <!-- cadre:decisions:v1 -->
129
+
130
+ - Before affected implementation, inspect evidence. Routine conventions need no question; factual uncertainty needs investigation. Ask about unresolved material choices unless explicitly delegated. Confidence is not authority.
131
+ - Main owns structured journal decisions and human questions. Workers stop affected edits and escalate. Pending decisions block affected tasks/dependents, including integration and completion; independent work may continue. Ordinary handoff openQuestions are historical notes, not automatic gates.
132
+ - Default decision policy is `ask`. Explicit implementation Autopilot selects Autonomous plus `technical-autopilot`, permitting only in-scope internal technical choices within approved constraints/stack/design. Product behavior, public contracts, destructive data changes, security/privacy policy, new production dependencies/services, spending and scope changes still require human authority. Unknown facts are never invented.
133
+ - Resolve choices against their exact question digest and inspected evidence. Record rationale, selected option, verification and actual authority before dependent edits. Delegated resolutions are not human approval. Preserve final completion approval and verification/stall limits.
134
+ - Design is conditional on material architecture, contracts, data/migrations or reliability/security choices. Record assessment in track state and approve any required design together with spec and plan. Resolve material planning questions before approval; Autopilot applies only during implementation.
135
+ - Approved design is immutable during execution. Execution choices live in journals; changed constraints or newly necessary design require revision. Read required design through context_read and reuse only retained unchanged text. Scope/design revision requires reassessed delegation; never infer it from existing Autonomous mode.
@@ -21,7 +21,8 @@ Use this catalog during `create`. Always propose the project template's `stylegu
21
21
  | Swift | `swift.md` |
22
22
  | SwiftUI | `swift.md` and `swiftui.md` |
23
23
  | Python | `python.md` |
24
+ | Rust or Cargo | `rust.md` |
24
25
 
25
- If the stack is not represented, derive a project guide from `styleguides/language.md`, official ecosystem guidance, repository evidence, and user input. Do not invent conventions when a material choice is unclear.
26
+ If the stack is not represented, derive a project guide from `styleguides/language.md`, official ecosystem guidance, repository evidence, and user input. Stage each project-authored guide as a separate `styleguides/<slug>.md` file for the same setup approval.
26
27
 
27
28
  For brownfield projects, inspect formatter/linter/build configuration and representative source before proposing defaults. Existing automated conventions win unless the human explicitly approves a change.
@@ -0,0 +1,27 @@
1
+ # Rust Styleguide
2
+
3
+ Apply `general.md` first. Follow the workspace’s Rust edition, minimum supported Rust version, formatter settings, and lint policy.
4
+
5
+ ## Types and ownership
6
+
7
+ - Wrap identifiers in distinct newtypes when mixing them up would be a bug. For example, a function taking a `RequestId` should reject an `AgentId` at compile time.
8
+ - Borrow values for inspection and take ownership when the callee stores or consumes them. Make the owner of each file, child process, or terminal handle responsible for its lifetime and cleanup.
9
+ - Model mutually exclusive states with enums. Use exhaustive matches where a new variant requires a deliberate response.
10
+
11
+ ## Errors and interfaces
12
+
13
+ - Return `Result` for recoverable failures. Propagate errors with `?` and preserve the cause when adding context. Give callers typed error variants when they need to choose a recovery action.
14
+ - Reserve panics for broken invariants. Report malformed input, failed I/O, and disconnected peers through the normal error path.
15
+ - Keep library interfaces focused on domain types. Convert terminal, network, or storage representations at the boundary that owns them.
16
+
17
+ ## Verification
18
+
19
+ - Use the workspace’s established Cargo checks. Typical commands are `cargo fmt --all -- --check`, `cargo clippy --workspace --all-targets`, and `cargo test --workspace`.
20
+ - Exercise recovery and cleanup as well as success. Use unit tests for state transitions and integration tests for public crate behavior.
21
+
22
+ ## Sources
23
+
24
+ - [Rust API Guidelines on type safety](https://rust-lang.github.io/api-guidelines/type-safety.html)
25
+ - [The Rust Book on ownership](https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html)
26
+ - [The Rust Book on recoverable errors](https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html)
27
+ - [The Cargo Book on workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)
@@ -1,5 +1,5 @@
1
1
  {
2
- "schemaVersion": 1,
2
+ "schemaVersion": 2,
3
3
  "specRevision": 1,
4
4
  "planRevision": 1,
5
5
  "dependencies": [],
@@ -0,0 +1,32 @@
1
+ # Design: {{TRACK_TITLE}}
2
+
3
+ - Track: `{{TRACK_ID}}`
4
+ - Design revision: 1
5
+
6
+ ## Approach
7
+
8
+ {{APPROACH_AND_REQUIREMENT_IDS}}
9
+
10
+ ## Interfaces and data flow
11
+
12
+ {{COMPONENT_CONTRACTS_DATA_AND_CONSTRAINTS}}
13
+
14
+ ## Failure handling
15
+
16
+ {{FAILURES_RECOVERY_COMPATIBILITY_SECURITY}}
17
+
18
+ ## Alternatives and decisions
19
+
20
+ {{OPTIONS_SELECTED_APPROACH_RATIONALE_AND_AUTHORITY}}
21
+
22
+ ## Verification approach
23
+
24
+ {{DESIGN_SPECIFIC_EVIDENCE_WITH_ACCEPTANCE_CRITERIA_REFERENCES}}
25
+
26
+ <!-- Reference acceptance criteria by ID. Describe only design-specific evidence,
27
+ such as concurrency tests, fault injection, migration checks, or performance
28
+ measurements. Do not restate acceptance criteria or duplicate task-level test
29
+ commands. If ordinary tests suffice, one sentence referencing the criteria is enough. -->
30
+
31
+ <!-- Aim for 300–800 tokens for an ordinary design; never truncate required constraints. -->
32
+ <!-- Resolve material planning questions before combined approval. Execution decisions live in the journal. -->
@@ -25,6 +25,10 @@
25
25
 
26
26
  {{TRACK_DEPENDENCIES_OR_NONE}}
27
27
 
28
+ ## Approach
29
+
30
+ {{SHORT_APPROACH_OR_REFERENCE_TO_DESIGN}}
31
+
28
32
  ## Additional Information
29
33
 
30
34
  {{CONSTRAINTS_RISKS_ASSUMPTIONS_REFERENCES}}
@@ -9,11 +9,17 @@
9
9
  "dependencies": [],
10
10
  "commits": {
11
11
  "spec": null,
12
- "plan": null
12
+ "plan": null,
13
+ "design": null
13
14
  },
14
15
  "artifactProgress": [],
15
16
  "operation": null,
16
17
  "lastExecution": null,
17
18
  "reviewCycles": [],
18
- "history": []
19
+ "history": [],
20
+ "design": {
21
+ "required": false,
22
+ "rationale": "{{DESIGN_ASSESSMENT_RATIONALE}}",
23
+ "revision": 0
24
+ }
19
25
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes