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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
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.6.0",
3
+ "version": "3.7.0",
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,38 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## [3.7.0] - 2026-09-06
6
+
7
+ ### Memory, context, and recovery
8
+
9
+ - Introduce immutable template v3, preserving v1/v2 and requiring approved refresh before legacy delivery.
10
+ - Persist bounded task handoffs with existing execution checkpoints, without additional approval or mutation calls.
11
+ - Validate seed metadata/revisions/pattern fingerprints; distinguish stale active guidance from historical evidence and bind staged memory inputs to approval digests.
12
+ - Add read-only `context_read` with required-context selection, conservative fallback, source hashes, and drift-sensitive 16 KiB pagination.
13
+ - Default status to summaries with explicit full detail and paged/filtered track listings; retain project-wide validation and counts.
14
+ - Reuse reads/parses within validation and batch Git provenance resolution. Add correctness, compatibility, recovery, and byte-cost fixtures, including small-project overhead.
15
+ - Expand the measured catalog ceiling to 80 KiB for the additional typed context and handoff interfaces; byte counts are not billed token counts.
16
+
17
+ - Select one MCP result representation from the initialized client identity:
18
+ structured JSON for recognized Codex and Claude Code 2.0.21+ clients, compact
19
+ JSON text for Zed and unknown clients. Remove redundant summaries and JSON
20
+ copies, preserve template bodies once, and advertise output schemas only to
21
+ structured clients while retaining server-side validation for both formats.
22
+
23
+ ### Audit corrections
24
+
25
+ - Recognize Markdown pattern links and fenced learning examples; expand ambiguous sections and reject incomplete memory metadata.
26
+ - Add session-retained source inventories with explicit reuse and `contextReady`; changed sources must be reread.
27
+ - Reject invalid staged revision paths, stale revert seeds, and disconnected execution bindings before approval. Verify recorded plan revision/graph at its commit.
28
+ - Read archived execution journals, expose complete project/implementation detail, and preserve historical refresh/archive hashes against their artifact commits.
29
+ - Separate clean-review proposal evidence from the digest-bound confirmation recorded by apply. Return visible JSON-text errors in every client.
30
+ - Clarify direct-main checkpoints, revision provenance, refresh recovery ordering, fact-checked learning, and read-only revert preparation that preserves dirty work.
31
+ - Require an exact original execution snapshot before staged reverts reset evidence; retain a durable digest-bound revert receipt, history entry, and reconciliation commit provenance.
32
+ - Make receipt persistence and readback an explicit prerequisite to restoring implement ownership; record a null reconciliation SHA first so interruption cannot erase the revert approval while bookkeeping is unfinished.
33
+
34
+ Validated with 79 automated tests, package and documentation checks, native Claude/Codex audits, and native Zed installation, discovery, MCP, staged-revert, and fresh-session recovery tests. Native Zed support remains beta.
35
+
3
36
  ## [3.6.0] - 2026-09-02
4
37
 
5
38
  ### MCP Result Contract
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Cadre
2
2
 
3
+ **Cadre 3.7.0** adds durable task handoffs, freshness-checked learning, selective context with session reuse, and compact status. New projects use template set **v3**; existing projects remain readable and require one approved refresh before delivery. Published v1/v2 templates remain available.
4
+
3
5
  Cadre is a human-governed, Git-aware delivery harness for Codex, Claude Code,
4
6
  and Zed Agent. Codex and Claude Code support is stable; native Zed Agent support
5
7
  is beta. Cadre turns project context into resumable feature and bug tracks,
@@ -25,7 +27,7 @@ templates. A project keeps only approved, mutable delivery state under
25
27
  - Isolated phase and task workers in Cadre-managed Git worktrees, coordinated and integrated only by the main agent.
26
28
  - Feature and bug tracks with functional requirements, non-functional requirements, acceptance criteria, dependencies, phased tasks, and manual-verification gates.
27
29
  - Dependency enforcement before implementation and cascading-impact analysis after specification, workflow, stack, styleguide, or pattern changes.
28
- - Incremental learning in each track's `learning.md`; every phase reads the previous phase's learning before work starts.
30
+ - Incremental learning in each track's `learning.md`; each phase reads its declared dependency learning and applicable constraints before work starts.
29
31
  - Review → remediation → implementation cycles until the human accepts a clean review.
30
32
  - Single-track or multi-track archival with consolidated pattern distillation and relevant reseeding of active tracks.
31
33
  - Git-aware task, phase, setup, review, revision, refresh, revert, and archive provenance using Conventional Commits.
@@ -313,12 +315,13 @@ Important sources of truth:
313
315
 
314
316
  ## MCP capabilities
315
317
 
316
- The `cadre` stdio server exposes active immutable resources at `cadre://templates/v2/...` and 22 tools:
318
+ The `cadre` stdio server exposes active immutable resources at `cadre://templates/v3/...` and 23 tools:
317
319
 
318
320
  | Tool | Mutation | Purpose |
319
321
  | --- | --- | --- |
320
322
  | `template_get_many` | No | Read an ordered template bundle in one call; immutable catalog contents are cached for the server lifetime. |
321
323
  | `styleguide_resolve` | No | Resolve default styleguide descriptors and hashes for an approved technology list. |
324
+ | `context_read` | No | Read required track/node context with source hashes, freshness findings, and complete continuation pages. |
322
325
  | `project_status` | No | Return complete validation plus scoped canonical, staged, shadowed, or implementation status. |
323
326
  | `state_validate` | No | Validate project, track, plan, learning, dependency, review, and archive invariants. |
324
327
  | `candidate_stage_prepare` | Atomic | Create/resume a stage and optionally prune files outside its exact `expectedFiles` set. |
@@ -341,11 +344,7 @@ The `cadre` stdio server exposes active immutable resources at `cadre://template
341
344
 
342
345
  The four adaptive tools use a strict `request` union: prepare accepts only its
343
346
  declared fields, while apply accepts only an unchanged `proposalToken`. The MCP
344
- publishes an output schema for every tool and appends compact JSON as the final
345
- text block of every response; parsing it yields the exact `structuredContent`,
346
- including proposal tokens and structured errors. Template and candidate bodies
347
- remain outside mirrored descriptor data. The Node-18-compatible serialized
348
- tool catalog is kept below 64 KiB. The MCP
347
+ selects one result representation: structured JSON and output schemas for recognized structured clients, compact text for other clients. Server-side output validation remains strict in both cases. Template bodies appear once. The Node-18-compatible serialized tool catalog is kept below 80 KiB, including the context and handoff contracts. The MCP
349
348
  server cannot approve its own proposals or run arbitrary shell commands. Its
350
349
  Git surface is limited to derived Cadre worktree creation, non-squash
351
350
  integration, status, and verified cleanup. It never force-deletes a branch,
@@ -405,3 +404,9 @@ pnpm --filter cadre-ai check
405
404
  pnpm --filter cadre-ai test
406
405
  pnpm --filter cadre-ai validate
407
406
  ```
407
+
408
+ ### Memory format upgrade
409
+
410
+ Cadre 3.7.0 uses template set v3 and requires an approved refresh of older projects before delivery. It preserves v1/v2 templates and terminal learning. Active Pattern Seeds record revisions and exact pattern fingerprints; changed guidance requires reassessment. Task handoffs preserve decisions, failed approaches, uncertainty, and next actions alongside existing checkpoints. Use all `context_read` pages before acting, and retain source inspection and approval gates. Routine `project_status` uses summaries; request `detail: "full"` for history/graph diagnostics. Filtered/paged listings never narrow validation coverage.
411
+
412
+ Release preparation includes regression tests, package inspection, and documentation checks. Publishing still requires native installer/discovery/activation checks for Codex, Claude Code, and Zed. Local model tests and byte benchmarks do not establish universal token savings or semantic correctness of generated learning.
@@ -15,3 +15,7 @@ You are a Cadre phase implementation worker holding a temporary execution lease.
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
16
  - Commit only after main reports either explicit human approval in `governed` or approval-mode authorization in `phase`/`autonomous`. Commit only that task, return its distinct 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
+
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
+
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.
@@ -14,3 +14,7 @@ You are a Cadre task implementation worker. The main agent is the only scheduler
14
14
  - Stop with the proposed diff uncommitted and report changed files, checks, risks, learning candidates, and the proposed Conventional Commit message.
15
15
  - Obey the persisted approval mode supplied by main. Commit only after main reports either explicit human approval in `governed` or approval-mode authorization in `phase`/`autonomous`, then return the commit SHA.
16
16
  - 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.
17
+
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
+
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.
@@ -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.6.0";
78
- var TEMPLATE_SET_VERSION = "v2";
77
+ var CADRE_RUNTIME_VERSION = "3.7.0";
78
+ var TEMPLATE_SET_VERSION = "v3";
79
79
 
80
80
  // src/domain/templates.ts
81
81
  var TEMPLATE_IDS = [
@@ -2482,6 +2482,7 @@ var CADRE_MCP_TOOLS = {
2482
2482
  workflowElicit: "workflow_elicit",
2483
2483
  templateGetMany: "template_get_many",
2484
2484
  styleguideResolve: "styleguide_resolve",
2485
+ contextRead: "context_read",
2485
2486
  projectStatus: "project_status",
2486
2487
  stateValidate: "state_validate",
2487
2488
  candidateStagePrepare: "candidate_stage_prepare",