cadre-ai 3.8.0 → 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +90 -0
  4. package/README.md +6 -5
  5. package/agents/cadre-phase-worker.md +5 -1
  6. package/agents/cadre-task-worker.md +4 -0
  7. package/dist/cadre-cli.mjs +5 -2
  8. package/dist/cadre-mcp.mjs +2200 -1126
  9. package/package.json +1 -1
  10. package/skills/archive/SKILL.md +20 -4
  11. package/skills/create/SKILL.md +15 -3
  12. package/skills/implement/SKILL.md +22 -6
  13. package/skills/implement/references/governed-mode.md +1 -1
  14. package/skills/implement/references/parallel-workers.md +4 -0
  15. package/skills/implement/references/resume-recovery.md +4 -0
  16. package/skills/refresh/SKILL.md +17 -5
  17. package/skills/revert/SKILL.md +25 -3
  18. package/skills/review/SKILL.md +27 -13
  19. package/skills/revise/SKILL.md +18 -5
  20. package/skills/status/SKILL.md +4 -0
  21. package/skills/track/SKILL.md +19 -9
  22. package/skills/wisp/SKILL.md +4 -0
  23. package/templates/v5/init/archive/.gitkeep +1 -0
  24. package/templates/v5/init/gitignore.template +9 -0
  25. package/templates/v5/init/guidelines.md +25 -0
  26. package/templates/v5/init/operations/.gitkeep +1 -0
  27. package/templates/v5/init/patterns/index.md +8 -0
  28. package/templates/v5/init/product.md +30 -0
  29. package/templates/v5/init/project.json +27 -0
  30. package/templates/v5/init/refreshes/.gitkeep +1 -0
  31. package/templates/v5/init/styleguides/general.md +14 -0
  32. package/templates/v5/init/styleguides/language.md +21 -0
  33. package/templates/v5/init/tech-stack.md +21 -0
  34. package/templates/v5/init/tracks/.gitkeep +1 -0
  35. package/templates/v5/init/tracks.md +6 -0
  36. package/templates/v5/init/wisps/.gitkeep +1 -0
  37. package/templates/v5/init/workflow.md +103 -0
  38. package/templates/v5/project/archive-operation.json +19 -0
  39. package/templates/v5/project/pattern.md +20 -0
  40. package/templates/v5/project/refresh-operation.json +18 -0
  41. package/templates/v5/project/refresh.md +21 -0
  42. package/templates/v5/styleguides/dart.md +27 -0
  43. package/templates/v5/styleguides/flutter.md +27 -0
  44. package/templates/v5/styleguides/go.md +29 -0
  45. package/templates/v5/styleguides/gradle.md +28 -0
  46. package/templates/v5/styleguides/html-css.md +39 -0
  47. package/templates/v5/styleguides/index.md +27 -0
  48. package/templates/v5/styleguides/java.md +27 -0
  49. package/templates/v5/styleguides/javascript.md +27 -0
  50. package/templates/v5/styleguides/kotlin.md +26 -0
  51. package/templates/v5/styleguides/maven.md +28 -0
  52. package/templates/v5/styleguides/python.md +27 -0
  53. package/templates/v5/styleguides/react.md +28 -0
  54. package/templates/v5/styleguides/swift.md +27 -0
  55. package/templates/v5/styleguides/swiftui.md +27 -0
  56. package/templates/v5/styleguides/typescript.md +26 -0
  57. package/templates/v5/track/bug.md +14 -0
  58. package/templates/v5/track/dependency-context.json +9 -0
  59. package/templates/v5/track/execution.json +21 -0
  60. package/templates/v5/track/learning.md +45 -0
  61. package/templates/v5/track/plan.md +42 -0
  62. package/templates/v5/track/revert-operation.json +17 -0
  63. package/templates/v5/track/revise-operation.json +18 -0
  64. package/templates/v5/track/revision.md +36 -0
  65. package/templates/v5/track/spec.md +38 -0
  66. package/templates/v5/track/state.json +19 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre",
3
- "version": "3.8.0",
3
+ "version": "3.9.1",
4
4
  "description": "A human-governed, Git-aware product delivery harness for Codex, Claude Code, and Zed Agent.",
5
5
  "author": {
6
6
  "name": "Cadre contributors"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre",
3
- "version": "3.8.0",
3
+ "version": "3.9.1",
4
4
  "description": "A human-governed, Git-aware product delivery harness for Codex, Claude Code, and Zed Agent.",
5
5
  "author": {
6
6
  "name": "Cadre contributors"
package/CHANGELOG.md CHANGED
@@ -1,5 +1,95 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.9.1] - 2026-10-01
4
+
5
+ Cadre 3.9.1 fixes implementation/review bookkeeping loops and interrupted-operation recovery. Native Zed Agent joins Codex and Claude Code as a stable integration. Track remains the default approval mode and Parallel remains the default scheduling mode; clean completion still requires explicit final approval.
6
+
7
+ ### Lifecycle and recovery fixes
8
+
9
+ - Preserve the verified implementation HEAD and original Autonomous execution authority across bookkeeping commits. Route already committed prerequisites forward instead of requesting another bookkeeping commit.
10
+ - Replay completed implementation, clean-review, revision, refresh, and archive operations from their original immutable receipts. Verify approval identity and unique reachable Git evidence; successful retries make zero changes and do not append history or create another commit.
11
+ - Resolve archive receipts before checking moved-track eligibility or reading removed candidate stages, and return the actual receipt path.
12
+ - Permit only exact runtime-generated track-index changes during parallel integration, with proposal-bound hashes. Continue rejecting tampered state, unrelated dirty files, and worker edits to protected Cadre artifacts.
13
+ - Include exact derived state changes in candidate and archive previews, including project history and refresh metadata. Archive preview and apply share one deterministic derivation so reviewers can reconstruct the final files and verify their hashes.
14
+ - Reject incomplete specification sections before promotion. Stale dependency diagnostics identify the exact expected sources and fingerprints for reassessment.
15
+ - Clarify exact scheduler node IDs, safe artifact filenames, governed pause/resume, apply-time approval confirmation, and approval ordering around additive Git reverts. Explicitly map `implement auto` to Autonomous approval mode.
16
+ - Fix the homepage Digests label contrast in dark mode by giving its amber background a matching dark-theme token.
17
+
18
+ ### Stable Zed Agent
19
+
20
+ Zed Agent support is stable as of 3.9.1. The integration continues to use ten global `cadre-*` skills, the packaged custom MCP server, exact tool permission entries, and the existing chat fallback for approval forms. Native plugins remain the integration path for Codex and Claude Code.
21
+
22
+ ### Validation
23
+
24
+ Native Codex fixtures exercised all ten workflows and all eight approval/scheduling combinations: Governed, Phase, Track, and Autonomous with Sequential and Parallel scheduling. Nine fixtures ended valid and clean with 11 archived tracks, 56 uniquely verified receipts, and no live workers or managed worktrees. Additional paths covered planned revision, active task reversal/reimplementation, archived revise and completed revert successors, batch archive, and two context refreshes. Fixtures used explicitly scoped test approvals; these results cover representative lifecycle paths rather than every possible repository or conflict.
25
+
26
+ All 118 harness tests passed, along with package and documentation checks. Automated regressions cover receipt replay, approval identity, derived-state hash reconstruction, integration tampering, dependency diagnostics, and patch compatibility. Installed Codex and Claude plugins are enabled at the candidate version; Zed discovers all ten skills with the packaged server active. Homepage checks cover light/dark themes and desktop/mobile rendering.
27
+
28
+ ### Upgrade and compatibility
29
+
30
+ ```bash
31
+ npm install -g cadre-ai@3.9.1
32
+ cadre-ai doctor
33
+ cadre-ai install --target all --scope user
34
+ ```
35
+
36
+ Start a new Codex task, reload Claude Code plugins, and open a new Zed Agent thread. Existing 3.9.0/v5 projects continue without a refresh, schema migration, or rewritten history. Template set v5 and schema-2 state are unchanged. Interrupted tracks may still need their existing receipt reconciled before continuation. Older runtime/template contracts retain their approved refresh requirements. Installation does not approve project work.
37
+
38
+ Direct MCP clients should accept the additional `stateChanges` preview fields and zero-change committed retry results. Re-run previews in a new server session; process-local proposal tokens are not portable between sessions.
39
+
40
+ ## [3.9.0] - 2026-09-25
41
+
42
+ Cadre 3.9.0 reduces bookkeeping commits and repeated context while preserving human approval, verification, provenance, and interruption recovery. Track remains the default approval mode and Parallel remains the default scheduling mode. Codex and Claude Code are stable integrations; native Zed Agent remains beta.
43
+
44
+ ### Cohesive commits and verifiable lineage
45
+
46
+ - Introduce immutable template set **v5** and schema-2 project/track state. Preserve published v1–v4 templates and historical SHA-based records.
47
+ - Replace follow-up SHA-recording commits with stable operation references and immutable receipts. Each receipt binds the approval digest, base commit, and exact artifact hashes; Git trailers identify it. Resolution verifies a unique commit reachable from HEAD and its committed contents rather than trusting a trailer alone.
48
+ - Persist recovery intent before promotion. Pending commits block dependent delivery; reconciliation changes temporary state only. Commit execution stays with the agent's Git tools.
49
+ - Use one initialization commit; one combined specification, plan, learning and dependency-context commit; one commit per approved revision, refresh or archive batch; and one execution-completion and clean-review commit each. Remove automatic execution-start, phase-record, final-verification-phase and clean-evidence-only commits. Explicit handoff/blocker checkpoints remain available.
50
+ - Let related tasks in one phase share an approved commit group. Preserve individual task verification, authorization and handoffs; validate the collapsed dependency graph and schedule independent groups in parallel. A shared-commit reversal requires approval and reconciliation for every affected task.
51
+
52
+ ### Bounded context and MCP work
53
+
54
+ - Capture approved, source-linked dependency contracts and inherited constraints on active tracks. Verify source fingerprints and approval provenance; missing or stale coverage triggers explicit reassessment or an identified full-source fallback. Required project instructions and the complete current specification/plan remain authoritative.
55
+ - Add compact retained-context tokens after complete retrieval, section-level reuse, 48 KiB default pages and the existing 64 KiB maximum. Preserve inventory compatibility, expiry handling, context-loss resets, stale-memory checks and pagination drift detection.
56
+ - Add atomic `complete_group` checkpoints, composite verification without separate starts, direct-main phase completion and reusable scheduler results.
57
+ - Add constrained `candidate_apply` for track, revise, refresh, review remediation and revert reconciliation. It promotes only approved Cadre artifacts and records recovery/provenance; it cannot edit arbitrary product files or execute Git commands.
58
+ - Cap ordinary serialized runtime errors at **8 KiB**, retaining complete diagnostics through explicit `diagnostic_read` pagination. The purpose-built MCP catalog now has 25 tools.
59
+
60
+ ### Integration and recovery fixes
61
+
62
+ - Permit only validated, execution-bound coordinator state/journal changes during integration, and verify their contents remain unchanged. Continue rejecting unrelated dirty files and worker edits to protected Cadre state.
63
+ - Prefer fast-forward integration; create merge commits only for divergent histories. Record integration provenance in either case.
64
+ - Provide a narrowly ignored, ownership-checked build-cache directory and reject unowned content or symlink escapes.
65
+ - Recover receipts whose trailers were supplied in separate Git message paragraphs, allow empty archive update manifests, and accept standard review bug artifact paths.
66
+ - Rebase active dependency-context source paths under the approved archive batch while preserving archived learning. Batch committed artifact reads and reuse receipt resolution during an inspection.
67
+
68
+ ### Measured validation
69
+
70
+ - **111 automated tests** cover receipts, crash recovery, grouped scheduling/reverts, dirty-state integration, bounded errors, context freshness/pagination, legacy migration and historical evidence.
71
+ - A fresh native Codex lifecycle completed create → track → implement → clean review → archive, plus status and read-only Wisp, with **6 commits, 37 Cadre calls and zero separate verification starts**.
72
+ - Disposable native Codex sessions exercised all ten workflows, including revision recovery, whole-group additive reversal and review remediation.
73
+ - Controlled FRM-shaped context replay reduced combined request/response bytes by **93.4%** (743,728 → 49,033) and calls from **45 to 5**. The smaller Dhivon-shaped replay reduced bytes by **19.9%** (46,742 → 37,442), with no call-count regression.
74
+ - A synthetic 6,113-path error serialized to **700 bytes** in the ordinary MCP response. Full diagnostics remained readable.
75
+
76
+ These are synthetic regression/native-fixture results, not a same-scope rerun of the original FRM and Dhivon sessions. Token usage, elapsed time, calls and bytes are reported separately in the audit; byte reduction is not a token-savings claim.
77
+
78
+ ### Upgrade and compatibility
79
+
80
+ ```bash
81
+ npm install -g cadre-ai@3.9.0
82
+ cadre-ai doctor
83
+ cadre-ai install --target all --scope user
84
+ ```
85
+
86
+ Start a new Codex task, reload Claude Code plugins, and open a new Zed Agent thread. Installation updates the runtime and skills; it does not migrate project state or approve work.
87
+
88
+ Use one approved refresh at a quiescent boundary to migrate an existing project to runtime 3.9.0, template set v5 and schema-2 state. Include reassessed dependency context for active tracks. Preserve approvals, findings, completed nodes, historical journals and SHA references. Existing executions retain their original contract; commit grouping applies to new executions. Cadre 3.8.0/v4 executions may continue their original contract to a safe boundary before refresh. Earlier legacy policy migrations still require their explicit authority choice.
89
+
90
+ Curated dependency context requires human review for completeness. Fingerprints establish freshness and receipt verification establishes provenance; neither substitutes for assessing the actual requirements. No existing Git history is rewritten.
91
+
92
+
3
93
  ## [3.8.0] - 2026-09-08
4
94
 
5
95
  - Make Track the default approval mode, retaining Governed and Phase with independent Parallel/Sequential scheduling.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Cadre
2
2
 
3
- **Cadre 3.8.0** makes **Track** the default approval mode and adds continuous **Autonomous** implementation, verification, review, and remediation until clean. Parallel remains the scheduling default; Sequential works with every approval mode. The author makes the final completion decision. Template set **v4** preserves v1–v3; existing projects require an approved refresh, and legacy Autonomous executions require an explicit Track-or-Autonomous migration choice.
3
+ **Cadre 3.9.1** fixes implementation/review bookkeeping loops, makes committed operation retries idempotent, and improves approval previews and recovery guidance. Codex, Claude Code, and native Zed Agent are stable integrations. Existing 3.9.0/v5 projects continue without a project refresh or state migration. Track remains the default approval mode; Parallel remains the default scheduling mode. Older project formats retain their approved refresh path and historical evidence.
4
4
 
5
5
  Cadre is a human-governed, Git-aware delivery harness for Codex, Claude Code,
6
- and Zed Agent. Codex and Claude Code support is stable; native Zed Agent support
7
- is beta. Cadre turns project context into resumable feature and bug tracks,
6
+ and Zed Agent. All three integrations are stable as of Cadre 3.9.1.
7
+ Cadre turns project context into resumable feature and bug tracks,
8
8
  carries learning forward between phases, and records implementation provenance
9
9
  in Git.
10
10
 
@@ -18,6 +18,7 @@ templates. A project keeps only approved, mutable delivery state under
18
18
  [Quickstart](https://cadre-docs.pages.dev/quickstart/) ·
19
19
  [Release notes](https://cadre-docs.pages.dev/release-notes/)
20
20
 
21
+
21
22
  ## Capabilities
22
23
 
23
24
  - Greenfield and brownfield project onboarding, with an explicit classification gate when the repository is ambiguous.
@@ -89,7 +90,7 @@ cadre-ai install --target codex
89
90
  # Claude Code only
90
91
  cadre-ai install --target claude
91
92
 
92
- # Zed Agent only (beta)
93
+ # Zed Agent only
93
94
  cadre-ai install --target zed
94
95
  ```
95
96
 
@@ -112,7 +113,7 @@ By default, installation applies these narrowly scoped rules:
112
113
  - Codex: `default_tools_approval_mode = "approve"` under `plugins."cadre@cadre".mcp_servers.cadre` in the user Codex configuration.
113
114
  - Claude Code: `cadre` in `enabledMcpjsonServers` and `mcp__cadre__*` in the
114
115
  user permission allowlist.
115
- - Zed Agent (beta): one exact `mcp:cadre:<tool>` allow entry for each Cadre MCP tool
116
+ - Zed Agent: one exact `mcp:cadre:<tool>` allow entry for each Cadre MCP tool
116
117
  under `agent.tool_permissions.tools`.
117
118
 
118
119
  Existing configuration, comments, and unrelated permission rules are preserved. A Claude deny rule is never removed or overridden. These rules suppress the host application's per-tool prompt; they do not bypass Cadre's requirement to present artifacts and lifecycle mutations to the human for approval.
@@ -13,9 +13,13 @@ You are a Cadre phase implementation worker holding a temporary execution lease.
13
13
  - Never edit concurrently with task workers for this phase. When main requests a mode handoff, finish only the approved current-task checkpoint, verify the worktree is clean, report its committed HEAD, release the lease, and remain inactive until main explicitly reassigns you.
14
14
  - Execute the assigned non-manual phase tasks in dependency order, with focused tests and checks, but checkpoint one regular task at a time.
15
15
  - Do not claim or perform human approval. Obey the persisted approval mode supplied by main. After each regular task, stop with only that task's proposed diff uncommitted and report changed files, verification, risks, learning candidates, and one Conventional Commit message.
16
- - Commit only after main reports either explicit human approval in `governed` or approval-mode authorization in `phase`/`track`/`autonomous`. Commit only that task, return its distinct SHA, and wait for confirmation that main recorded the checkpoint before starting the next task.
16
+ - Commit only after main reports either explicit human approval in `governed` or approval-mode authorization in `phase`/`track`/`autonomous`. For legacy execution, commit only that task and return its distinct SHA; for cohesive-v1, commit the assigned whole group and return its shared SHA, and wait for confirmation that main recorded the checkpoint before starting the next task.
17
17
  - Use available approved commands without prompting again. If an unexpected host permission is required, stop and report the exact command and reason to main instead of retrying variants.
18
18
 
19
19
  - Return a task handoff with `decisions`, `failedApproaches`, `openQuestions`, `nextAction`, and `sources` (repository-relative paths and exact SHA-256 hashes). Keep serialized JSON within 8 KiB, linking longer durable evidence. Main persists it with the existing checkpoint; it cannot replace verification or authorization. Read required source content, not only its hash, and never silently omit constraints to fit the context budget.
20
20
 
21
21
  - Reuse unchanged context only when its complete text remains in this session. A source hash alone is not context. Main must supply all required pages and any retained text a fresh worker lacks. Treat observed facts, inferred explanations, and untested claims distinctly in learning; inspect imports and tests before asserting library semantics.
22
+
23
+ ## Cohesive execution contract
24
+
25
+ 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.
@@ -18,3 +18,7 @@ You are a Cadre task implementation worker. The main agent is the only scheduler
18
18
  - Return a task handoff with `decisions`, `failedApproaches`, `openQuestions`, `nextAction`, and `sources` (repository-relative paths and exact SHA-256 hashes). Keep serialized JSON within 8 KiB, linking longer durable evidence. Main persists it with the existing checkpoint; it cannot replace verification or authorization. Read required source content, not only its hash, and never silently omit constraints to fit the context budget.
19
19
 
20
20
  - Reuse unchanged context only when its complete text remains in this session. A source hash alone is not context. Main must supply all required pages and any retained text a fresh worker lacks. Treat observed facts, inferred explanations, and untested claims distinctly in learning; inspect imports and tests before asserting library semantics.
21
+
22
+ ## Cohesive execution contract
23
+
24
+ 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.
@@ -74,8 +74,8 @@ import { dirname, extname, join as join2, relative, resolve as resolve2, sep } f
74
74
  import { fileURLToPath } from "node:url";
75
75
 
76
76
  // src/domain/version.ts
77
- var CADRE_RUNTIME_VERSION = "3.8.0";
78
- var TEMPLATE_SET_VERSION = "v4";
77
+ var CADRE_RUNTIME_VERSION = "3.9.1";
78
+ var TEMPLATE_SET_VERSION = "v5";
79
79
 
80
80
  // src/domain/templates.ts
81
81
  var TEMPLATE_IDS = [
@@ -109,6 +109,7 @@ var TEMPLATE_IDS = [
109
109
  "styleguide/swiftui",
110
110
  "styleguide/typescript",
111
111
  "track/bug",
112
+ "track/dependency-context",
112
113
  "track/execution",
113
114
  "track/learning",
114
115
  "track/plan",
@@ -2483,10 +2484,12 @@ var CADRE_MCP_TOOLS = {
2483
2484
  templateGetMany: "template_get_many",
2484
2485
  styleguideResolve: "styleguide_resolve",
2485
2486
  contextRead: "context_read",
2487
+ diagnosticRead: "diagnostic_read",
2486
2488
  projectStatus: "project_status",
2487
2489
  stateValidate: "state_validate",
2488
2490
  candidateStagePrepare: "candidate_stage_prepare",
2489
2491
  candidateInspect: "candidate_inspect",
2492
+ candidateApply: "candidate_apply",
2490
2493
  executionGraphValidate: "execution_graph_validate",
2491
2494
  reviewComplete: "review_complete",
2492
2495
  archiveBatchCandidate: "archive_batch_candidate",