cadre-ai 3.5.0 → 3.6.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre",
3
- "version": "3.5.0",
3
+ "version": "3.6.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.5.0",
3
+ "version": "3.6.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,86 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.6.0] - 2026-09-02
4
+
5
+ ### MCP Result Contract
6
+
7
+ - Added output schemas for all 22 MCP tools. The schemas advertise every
8
+ stable agent-facing top-level field while the server enforces the exact
9
+ success and structured-error variants.
10
+ - Made the final text block of every tool response a compact JSON mirror of
11
+ `structuredContent`. This applies to successes, elicitation outcomes,
12
+ template descriptors, and structured errors, so agents can recover every
13
+ decision and follow-up field even when a client does not expose structured
14
+ results directly.
15
+ - Kept template and candidate bodies out of mirrored descriptor data. Their
16
+ existing text or embedded-resource blocks remain unchanged and appear before
17
+ the final JSON mirror.
18
+ - Tightened adaptive response variants: `proposalToken` is required only when
19
+ `commandStatus` is `approval_required` and is absent after application.
20
+ - Raised the validated serialized MCP tool-catalog ceiling from 18 KiB to
21
+ 64 KiB to accommodate the complete output schemas while retaining Node 18
22
+ compatibility.
23
+ - Made Zed installation safely refresh a changed Node executable path when the
24
+ existing `context_servers.cadre` entry still targets the exact managed Cadre
25
+ MCP file. Entries targeting any other MCP file remain protected conflicts.
26
+
27
+ This is an additive transport contract change. It does not change canonical
28
+ artifact formats, template set v2, tool names, or the prepare/apply token
29
+ lifecycle. Existing 3.5.1 projects remain readable and use the normal approved
30
+ refresh workflow to record runtime 3.6.0 before further mutation.
31
+
32
+ ## [3.5.1] - 2026-08-27
33
+
34
+ Cadre 3.5.1 is a workflow-recovery hotfix for candidate validation, staged
35
+ track resumption, and interrupted multi-file operations. Codex and Claude Code
36
+ remain stable integrations; native Zed Agent support remains beta.
37
+
38
+ ### Fixed
39
+
40
+ - Replaced the faulty single-plan candidate contract with exact
41
+ `planValidations` for every staged root or nested `plan.md`. Candidate
42
+ digests now bind normalized plan paths and intended target statuses.
43
+ - Made `project_status` distinguish canonical, candidate-only, shadowed,
44
+ malformed, and unknown track state. Focused status now returns complete
45
+ validation errors plus track/dependency-specific `focusedErrors`.
46
+ - Added exact `expectedFiles` pruning for candidate stages so clarification or
47
+ scope contraction cannot leave stale proposal files behind.
48
+ - Made project initialization, execution finish, clean review, archive apply,
49
+ and archive provenance recording converge safely after interruption without
50
+ duplicate cycles or history.
51
+ - Derived clean-review ranges from the completed execution base through its
52
+ recorded HEAD, including the first implementation commit.
53
+ - Corrected lifecycle routing across all ten workflows, including staged-track
54
+ recovery, immutable terminal tracks, final implementation bookkeeping, and
55
+ Wisp output outside uninitialized repositories.
56
+ - Removed client-specific cross-workflow command references from canonical
57
+ guidance and kept generated Zed adapters on text template mode with
58
+ `/cadre-*` recommendations.
59
+
60
+ ### MCP Contract Corrections
61
+
62
+ - `candidate_inspect` removes the retired singular `targetStatus` input and
63
+ `plan` result in favor of `planValidations` and sorted `plans`.
64
+ - `project_init_candidate`, `review_complete`, `archive_batch_candidate`, and
65
+ `integration` now publish strict `request` prepare/apply unions that reject
66
+ mixed-mode calls at schema validation.
67
+ - `execution_checkpoint` now publishes a strict `scope` plus event-specific
68
+ `action` contract with explicit evidence requirements.
69
+ - `review_complete` no longer accepts `commitRangeStart`.
70
+ - The surface remains 22 tools and the generated catalog remains below the
71
+ 18 KiB budget.
72
+
73
+ ### Compatibility And Upgrade
74
+
75
+ - Existing approved operation journals remain readable and resumable.
76
+ - Unapproved 3.5.0 candidate stages must be re-inspected under the corrected
77
+ validation contract before approval or promotion.
78
+ - Existing 3.5.0 projects remain readable and use the normal approved refresh
79
+ workflow to record runtime 3.5.1 before further mutation. Template set v2 is
80
+ unchanged.
81
+ - Reinstall all selected clients and start fresh client sessions so the
82
+ corrected schemas and workflow guidance replace cached 3.5.0 definitions.
83
+
3
84
  ## [3.5.0] - 2026-08-27
4
85
 
5
86
  Cadre 3.5.0 adds beta support for the native Zed Agent while keeping the
package/README.md CHANGED
@@ -170,8 +170,9 @@ Cadre will:
170
170
  1. Inspect the repository and Git state.
171
171
  2. Classify it as greenfield or brownfield, asking when the evidence is unclear.
172
172
  3. Propose product, engineering, tech-stack, workflow, and applicable styleguide artifacts.
173
- 4. Ask for separate approval of the default or amended workflow and styleguides.
174
- 5. Preview the exact `.cadre` file set before applying it.
173
+ 4. Present the default or amended workflow, styleguides, and exact `.cadre`
174
+ file set in one final initialization approval envelope.
175
+ 5. Apply only that digest-bound proposal.
175
176
  6. Initialize Git when the approved project root is not already in a worktree.
176
177
  7. Validate and commit the approved setup with resumable checkpoints.
177
178
 
@@ -183,7 +184,7 @@ Claude Code: /cadre:track Fix duplicate invoice creation as a bug
183
184
  Zed Agent: /cadre-track Add passwordless login as a feature
184
185
  ```
185
186
 
186
- Cadre proposes and separately approves:
187
+ Cadre proposes and approves together:
187
188
 
188
189
  - `spec.md`, containing functional requirements, non-functional requirements, acceptance criteria, dependencies, additional information, and dependent-track impact;
189
190
  - `plan.md`, defining an acyclic phase/task dependency graph with derived manual-verification barriers;
@@ -318,18 +319,18 @@ The `cadre` stdio server exposes active immutable resources at `cadre://template
318
319
  | --- | --- | --- |
319
320
  | `template_get_many` | No | Read an ordered template bundle in one call; immutable catalog contents are cached for the server lifetime. |
320
321
  | `styleguide_resolve` | No | Resolve default styleguide descriptors and hashes for an approved technology list. |
321
- | `project_status` | No | Return scoped project, track, or implementation status. |
322
+ | `project_status` | No | Return complete validation plus scoped canonical, staged, shadowed, or implementation status. |
322
323
  | `state_validate` | No | Validate project, track, plan, learning, dependency, review, and archive invariants. |
323
- | `candidate_stage_prepare` | Atomic | Create/resume `.cadre/stage/<id>` and enforce its Git ignore rule. |
324
- | `candidate_inspect` | No | Return one exact manifest and optional staged-plan graph validation. |
324
+ | `candidate_stage_prepare` | Atomic | Create/resume a stage and optionally prune files outside its exact `expectedFiles` set. |
325
+ | `candidate_inspect` | No | Return one exact manifest and validate every staged root or nested plan against its declared target status. |
325
326
  | `execution_graph_validate` | No | Parse and validate phase/task dependencies, cycles, and derived manual-verification barriers. |
326
- | `review_complete` | Adaptive | Return `approval_required` for a clean-review decision, then apply the unchanged token after approval. |
327
+ | `review_complete` | Adaptive | Derive the full execution-base review range, then prepare/apply an idempotent clean completion. |
327
328
  | `archive_batch_candidate` | Adaptive | Read staged pattern/seed files, return the complete batch for approval, then apply its unchanged token. |
328
329
  | `archive_batch_record` | Atomic | Record the resulting archive commit in track, project, and batch provenance without a second decision. |
329
330
  | `execution_start` | Atomic | Create the authorized execution journal and enter `in_progress` in one call. |
330
- | `execution_checkpoint` | Atomic | Expand and apply one semantic event as a complete legal, evidence-gated transition sequence. |
331
+ | `execution_checkpoint` | Atomic | Apply one strict `scope` + event-specific `action` with required evidence. |
331
332
  | `execution_status` | No | Return a compact ready/active/blocked scheduler view, with optional focused node detail. |
332
- | `execution_finish` | Atomic | Require completed nodes, current plan evidence, and removed worktrees before writing `ready_for_review`. |
333
+ | `execution_finish` | Atomic | Convergently write completed execution, plan markers, `ready_for_review` state, and index. |
333
334
  | `worktree_create` | Atomic | Create/reconcile a worktree and record node start. |
334
335
  | `integration` | Adaptive | Merge and record integration; require a second call only in governed mode. |
335
336
  | `worktree_cleanup` | Atomic | Remove a verified integrated worktree and record completion. |
@@ -338,7 +339,20 @@ The `cadre` stdio server exposes active immutable resources at `cadre://template
338
339
  | `setup_record_commit` | Yes | Record the already-created setup commit SHA and complete setup state. |
339
340
  | `tracks_render` | Atomic | Validate and write deterministic `tracks.md` from current track state. |
340
341
 
341
- The MCP server cannot approve its own proposals or run arbitrary shell commands. Its Git surface is limited to derived Cadre worktree creation, non-squash integration, status, and verified cleanup. It never force-deletes a branch, resolves a conflict, edits product files, or commits on behalf of a worker. Already-authorized deterministic writes and Git mutations validate and apply atomically; genuine decision boundaries retain digest-bound proposal tokens and stale-state rejection.
342
+ The four adaptive tools use a strict `request` union: prepare accepts only its
343
+ 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
349
+ server cannot approve its own proposals or run arbitrary shell commands. Its
350
+ Git surface is limited to derived Cadre worktree creation, non-squash
351
+ integration, status, and verified cleanup. It never force-deletes a branch,
352
+ resolves a conflict, edits product files, or commits on behalf of a worker.
353
+ Multi-file state operations use atomic individual writes and converge from
354
+ matching partial state; mismatched bytes, hashes, journals, or Git HEAD remain
355
+ hard failures.
342
356
 
343
357
  Review and archive minimize approval fragmentation without weakening governance. A finding disposition and its exact remediation artifacts may share one approval; explicit reject-and-complete records accepted risks in the clean review; and a uniquely eligible archive target is included directly in the full batch proposal. Archive prepare computes the post-move `tracks.md` before approval, including archived rows. Any changed content, selection, digest, or consequence requires a corrected proposal and renewed approval.
344
358
 
@@ -74,7 +74,7 @@ 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.5.0";
77
+ var CADRE_RUNTIME_VERSION = "3.6.0";
78
78
  var TEMPLATE_SET_VERSION = "v2";
79
79
 
80
80
  // src/domain/templates.ts
@@ -193,6 +193,7 @@ import {
193
193
  mkdirSync,
194
194
  readFileSync as readFileSync2,
195
195
  readlinkSync,
196
+ rmSync,
196
197
  symlinkSync,
197
198
  unlinkSync,
198
199
  writeFileSync
@@ -213,7 +214,7 @@ var CADRE_WORKFLOWS = [
213
214
  ];
214
215
  var ZED_COMPATIBILITY = `## Zed compatibility
215
216
 
216
- Zed Agent consumes Cadre templates through tools rather than MCP resource discovery. Whenever this workflow calls \`template_get_many\`, include \`contentMode: "text"\`. Use known template IDs and descriptor tools such as \`styleguide_resolve\`; do not attempt to list or read MCP resources directly.`;
217
+ Zed Agent consumes Cadre templates through tools rather than MCP resource discovery. Whenever this workflow calls \`template_get_many\`, include \`contentMode: "text"\`. Use known template IDs and descriptor tools such as \`styleguide_resolve\`; do not attempt to list or read MCP resources directly. When recommending another Cadre workflow, use its Zed command \`/cadre-<workflow>\` and never a dollar-prefixed or colon command.`;
217
218
  function pathExists(path) {
218
219
  try {
219
220
  lstatSync(path);
@@ -239,6 +240,8 @@ function createZedSkillAdapters(pluginRoot) {
239
240
  const source = join3(pluginRoot, "skills", workflow);
240
241
  const target = join3(adapterRoot, `cadre-${workflow}`);
241
242
  cpSync(source, target, { recursive: true });
243
+ const codexMetadata = join3(target, "agents");
244
+ if (existsSync2(codexMetadata)) rmSync(codexMetadata, { recursive: true });
242
245
  const skillPath = join3(target, "SKILL.md");
243
246
  const body = readFileSync2(skillPath, "utf8");
244
247
  const expectedName = `name: ${workflow}`;
@@ -2697,7 +2700,7 @@ function configureZedCadre(settingsPath, nodePath, mcpPath, autoApproveMcp) {
2697
2700
  const { existing, root } = parseJsoncSettings(settingsPath);
2698
2701
  const contextServers = assertRecordField(root, "context_servers", settingsPath);
2699
2702
  const currentServer = contextServers.cadre;
2700
- if (currentServer !== void 0 && !zedServerMatches(currentServer, nodePath, mcpPath)) {
2703
+ if (currentServer !== void 0 && !zedServerTargetsMcp(currentServer, mcpPath)) {
2701
2704
  throw new Error(
2702
2705
  `${settingsPath}: context_servers.cadre is not the Cadre-managed server; remove or rename it before installation`
2703
2706
  );
@@ -2721,7 +2724,7 @@ function configureZedCadre(settingsPath, nodePath, mcpPath, autoApproveMcp) {
2721
2724
  }
2722
2725
  }
2723
2726
  const formattingOptions = { insertSpaces: true, tabSize: 2, eol: "\n" };
2724
- const serverChanged = currentServer === void 0;
2727
+ const serverChanged = currentServer === void 0 || !zedServerMatches(currentServer, nodePath, mcpPath);
2725
2728
  let proposed = existing;
2726
2729
  if (serverChanged) {
2727
2730
  proposed = applyEdits(proposed, modify(
@@ -2973,7 +2976,7 @@ function runInstall(args) {
2973
2976
  }
2974
2977
 
2975
2978
  // scripts/uninstall.ts
2976
- import { existsSync as existsSync6, readFileSync as readFileSync6, readdirSync as readdirSync2, rmSync } from "node:fs";
2979
+ import { existsSync as existsSync6, readFileSync as readFileSync6, readdirSync as readdirSync2, rmSync as rmSync2 } from "node:fs";
2977
2980
  import { basename as basename3, dirname as dirname6, join as join6, resolve as resolve6 } from "node:path";
2978
2981
  var marketplaceName2 = "cadre";
2979
2982
  var pluginId2 = "cadre@cadre";
@@ -3055,7 +3058,7 @@ function removeOwnedMarketplaces(root) {
3055
3058
  }
3056
3059
  for (const candidate of candidates) {
3057
3060
  if (!ownedMarketplace(candidate)) continue;
3058
- rmSync(candidate, { recursive: true, force: true });
3061
+ rmSync2(candidate, { recursive: true, force: true });
3059
3062
  removed.push(candidate);
3060
3063
  }
3061
3064
  return removed;