cadre-ai 4.3.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 (54) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +5 -0
  4. package/README.md +9 -8
  5. package/dist/cadre-cli.mjs +13 -5
  6. package/dist/cadre-mcp.mjs +42 -20
  7. package/package.json +2 -2
  8. package/skills/create/SKILL.md +3 -3
  9. package/templates/{v9 → v10}/styleguides/index.md +2 -1
  10. package/templates/v10/styleguides/rust.md +27 -0
  11. /package/templates/{v9 → v10}/init/archive/.gitkeep +0 -0
  12. /package/templates/{v9 → v10}/init/gitignore.template +0 -0
  13. /package/templates/{v9 → v10}/init/guidelines.md +0 -0
  14. /package/templates/{v9 → v10}/init/operations/.gitkeep +0 -0
  15. /package/templates/{v9 → v10}/init/patterns/index.md +0 -0
  16. /package/templates/{v9 → v10}/init/product.md +0 -0
  17. /package/templates/{v9 → v10}/init/project.json +0 -0
  18. /package/templates/{v9 → v10}/init/refreshes/.gitkeep +0 -0
  19. /package/templates/{v9 → v10}/init/styleguides/general.md +0 -0
  20. /package/templates/{v9 → v10}/init/styleguides/language.md +0 -0
  21. /package/templates/{v9 → v10}/init/tech-stack.md +0 -0
  22. /package/templates/{v9 → v10}/init/tracks/.gitkeep +0 -0
  23. /package/templates/{v9 → v10}/init/tracks.md +0 -0
  24. /package/templates/{v9 → v10}/init/wisps/.gitkeep +0 -0
  25. /package/templates/{v9 → v10}/init/workflow.md +0 -0
  26. /package/templates/{v9 → v10}/project/pattern.md +0 -0
  27. /package/templates/{v9 → v10}/project/refresh-operation.json +0 -0
  28. /package/templates/{v9 → v10}/project/refresh.md +0 -0
  29. /package/templates/{v9 → v10}/quick/record.json +0 -0
  30. /package/templates/{v9 → v10}/styleguides/dart.md +0 -0
  31. /package/templates/{v9 → v10}/styleguides/flutter.md +0 -0
  32. /package/templates/{v9 → v10}/styleguides/go.md +0 -0
  33. /package/templates/{v9 → v10}/styleguides/gradle.md +0 -0
  34. /package/templates/{v9 → v10}/styleguides/html-css.md +0 -0
  35. /package/templates/{v9 → v10}/styleguides/java.md +0 -0
  36. /package/templates/{v9 → v10}/styleguides/javascript.md +0 -0
  37. /package/templates/{v9 → v10}/styleguides/kotlin.md +0 -0
  38. /package/templates/{v9 → v10}/styleguides/maven.md +0 -0
  39. /package/templates/{v9 → v10}/styleguides/python.md +0 -0
  40. /package/templates/{v9 → v10}/styleguides/react.md +0 -0
  41. /package/templates/{v9 → v10}/styleguides/swift.md +0 -0
  42. /package/templates/{v9 → v10}/styleguides/swiftui.md +0 -0
  43. /package/templates/{v9 → v10}/styleguides/typescript.md +0 -0
  44. /package/templates/{v9 → v10}/track/bug.md +0 -0
  45. /package/templates/{v9 → v10}/track/dependency-context.json +0 -0
  46. /package/templates/{v9 → v10}/track/design.md +0 -0
  47. /package/templates/{v9 → v10}/track/execution.json +0 -0
  48. /package/templates/{v9 → v10}/track/learning.md +0 -0
  49. /package/templates/{v9 → v10}/track/plan.md +0 -0
  50. /package/templates/{v9 → v10}/track/revert-operation.json +0 -0
  51. /package/templates/{v9 → v10}/track/revise-operation.json +0 -0
  52. /package/templates/{v9 → v10}/track/revision.md +0 -0
  53. /package/templates/{v9 → v10}/track/spec.md +0 -0
  54. /package/templates/{v9 → v10}/track/state.json +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre",
3
- "version": "4.3.0",
3
+ "version": "4.3.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": "Dhivon AI",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre",
3
- "version": "4.3.0",
3
+ "version": "4.3.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": "Dhivon AI",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.3.1] - 2026-12-03
4
+
5
+ - Create accepts project-authored guides such as `.cadre/styleguides/terminal-ownership.md` alongside bundled defaults in the same setup approval. Custom guides need only their staged paths and contents.
6
+ - Template catalog v10 adds a Rust guide for Rust and Cargo projects. Existing v9 projects remain supported.
7
+
3
8
  ## [4.3.0] - 2026-12-03
4
9
 
5
10
  Start is the primary command for new work. Use Cadre: Start in Codex,
package/README.md CHANGED
@@ -2,14 +2,15 @@
2
2
 
3
3
  Cadre is a product of [Dhivon AI](https://dhivon.ai).
4
4
 
5
- **Cadre 4.3.0** introduces Start for new work. Describe the change once. Cadre
5
+ **Cadre 4.3.1** adds a bundled Rust guide and lets Create include separate project-authored styleguides in the setup approval.
6
+
7
+ Cadre 4.3.0 introduced Start for new work. Describe the change once. Cadre
6
8
  verifies a bounded fix through Quick or prepares a Track specification and plan for
7
9
  a migration or coordinated change. Invoke Track directly when you want a plan,
8
- even for a small fix. Direct Quick is deprecated in 4.3.0 and scheduled for
9
- removal in the following release.
10
+ even for a small fix. Direct Quick is deprecated in 4.3.0 and remains available in 4.3.1.
10
11
 
11
- Install `cadre-ai@4.3.0`, run `cadre-ai install --target all`, and reload your
12
- client to discover Start. Existing supported projects adopt template v9 through an
12
+ Install `cadre-ai@4.3.1`, run `cadre-ai install --target all`, and reload your
13
+ client to discover Start. Existing supported projects adopt template v10 through an
13
14
  approved Refresh. Quick records, receipts, and interrupted work carry forward.
14
15
 
15
16
  Cadre is a human-governed, Git-aware delivery harness for Codex, Claude Code,
@@ -71,7 +72,7 @@ execution. See the [testing and release documentation](https://cadre.dhivon.ai/t
71
72
 
72
73
  ## Unified Refresh
73
74
 
74
- Refresh now combines context maintenance, learning consolidation and completed-track archival under one approval, receipt and commit. Cadre 4.3.0 ships ten primary commands, the temporary Quick alias, 21 MCP tools, and template v9. The standalone archive skill and MCP tool are removed. Existing approved archive journals remain recoverable through `candidate_apply`. Older supported projects adopt the new workflow contract in an approved Refresh.
75
+ Refresh now combines context maintenance, learning consolidation and completed-track archival under one approval, receipt and commit. Cadre 4.3.1 ships ten primary commands, the temporary Quick alias, 21 MCP tools, and template v10. The standalone archive skill and MCP tool are removed. Existing approved archive journals remain recoverable through `candidate_apply`. Older supported projects adopt the new workflow contract in an approved Refresh.
75
76
 
76
77
  ```text
77
78
  Create → Start ┬→ Quick → verified outcome ────────────┐
@@ -444,7 +445,7 @@ Important sources of truth:
444
445
 
445
446
  ## MCP capabilities
446
447
 
447
- The `cadre` stdio server exposes active immutable resources at `cadre://templates/v9/...` and 21 tools:
448
+ The `cadre` stdio server exposes active immutable resources at `cadre://templates/v10/...` and 21 tools:
448
449
 
449
450
  | Tool | Mutation | Purpose |
450
451
  | --- | --- | --- |
@@ -536,7 +537,7 @@ pnpm --filter cadre-ai validate
536
537
 
537
538
  ### Memory format upgrade
538
539
 
539
- Cadre 4.3.0 packages template set v9 and supports existing 4.0.0, 4.1.0 and 4.2.0 projects. Existing 3.9.0/3.9.1/3.9.2 schema-2/v5 projects need no project migration or version-only refresh. Older formats must use Cadre 3.9.0 for an approved refresh to schema-2/v5 before installing 4.3.0. Published v1–v8 templates remain unchanged in source, and terminal learning remains historical evidence. 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.
540
+ Cadre 4.3.1 packages template set v10 and supports existing 4.0.0, 4.1.0, 4.2.0, and 4.3.0 projects. Existing 3.9.0/3.9.1/3.9.2 schema-2/v5 projects need no project migration or version-only refresh. Older formats must use Cadre 3.9.0 for an approved refresh to schema-2/v5 before installing 4.3.1. Published v1–v9 templates remain unchanged in source, and terminal learning remains historical evidence. 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.
540
541
 
541
542
  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.
542
543
 
@@ -40,21 +40,25 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
40
40
  ));
41
41
 
42
42
  // src/domain/version.ts
43
- var CADRE_RUNTIME_VERSION, TEMPLATE_SET_VERSION;
43
+ var CADRE_RUNTIME_VERSION, TEMPLATE_SET_VERSION, COMPATIBLE_TEMPLATE_SET_VERSIONS, LEGACY_TEMPLATE_SET_VERSIONS, templateVersions;
44
44
  var init_version = __esm({
45
45
  "src/domain/version.ts"() {
46
46
  "use strict";
47
- CADRE_RUNTIME_VERSION = "4.3.0";
48
- TEMPLATE_SET_VERSION = "v9";
47
+ CADRE_RUNTIME_VERSION = "4.3.1";
48
+ TEMPLATE_SET_VERSION = "v10";
49
+ COMPATIBLE_TEMPLATE_SET_VERSIONS = ["v5", "v6", "v7", "v8", "v9", TEMPLATE_SET_VERSION];
50
+ LEGACY_TEMPLATE_SET_VERSIONS = ["v1", "v2", "v3", "v4"];
51
+ templateVersions = [...LEGACY_TEMPLATE_SET_VERSIONS, ...COMPATIBLE_TEMPLATE_SET_VERSIONS];
49
52
  }
50
53
  });
51
54
 
52
55
  // cadre-build-telemetry:defaults
53
- var DEFAULT_DSN, TELEMETRY_AVAILABLE;
56
+ var DEFAULT_DSN, TELEMETRY_AVAILABLE, DEBUG_IMAGE;
54
57
  var init_defaults = __esm({
55
58
  "cadre-build-telemetry:defaults"() {
56
59
  DEFAULT_DSN = "https://c7549a6dbb434b68729da9a75be19898@o4512395646468096.ingest.de.sentry.io/4512395656233040";
57
60
  TELEMETRY_AVAILABLE = true;
61
+ DEBUG_IMAGE = { "type": "sourcemap", "code_file": "app:///cadre-cli.mjs", "debug_id": "d404b933-0e96-47a1-91b5-7f6169038686" };
58
62
  }
59
63
  });
60
64
 
@@ -11548,7 +11552,8 @@ function createSentryExporter(config) {
11548
11552
  transaction: record.name,
11549
11553
  tags: { ...attributes, error_code: error2.code },
11550
11554
  fingerprint: [record.name, error2.code],
11551
- exception: { values: [{ type: error2.code, value: error2.message, ...error2.frames.length ? { stacktrace: { frames: error2.frames } } : {} }] }
11555
+ ...DEBUG_IMAGE && error2.frames.some((frame) => frame.filename === DEBUG_IMAGE?.code_file) ? { debug_meta: { images: [DEBUG_IMAGE] } } : {},
11556
+ exception: { values: [{ type: error2.code, value: error2.message, ...error2.frames.length ? { stacktrace: { frames: error2.frames.map((frame) => ({ ...frame, abs_path: frame.filename })) } } : {} }] }
11552
11557
  });
11553
11558
  const labels = { ...attributes };
11554
11559
  delete labels.installation_id;
@@ -11604,6 +11609,7 @@ var init_sentry = __esm({
11604
11609
  init_esm4();
11605
11610
  init_version();
11606
11611
  init_config();
11612
+ init_defaults();
11607
11613
  init_privacy();
11608
11614
  eventId = () => randomBytes(16).toString("hex");
11609
11615
  release = `cadre-ai@${CADRE_RUNTIME_VERSION}`;
@@ -12069,6 +12075,7 @@ var TEMPLATE_IDS = [
12069
12075
  "styleguide/maven",
12070
12076
  "styleguide/python",
12071
12077
  "styleguide/react",
12078
+ "styleguide/rust",
12072
12079
  "styleguide/swift",
12073
12080
  "styleguide/swiftui",
12074
12081
  "styleguide/typescript",
@@ -15229,3 +15236,4 @@ stopTelemetry();
15229
15236
  export {
15230
15237
  runCli
15231
15238
  };
15239
+ //# debugId=d404b933-0e96-47a1-91b5-7f6169038686
@@ -45,25 +45,30 @@ function isCompatibleRuntimeVersion(version2) {
45
45
  function isCompatibleTemplateSet(version2) {
46
46
  return typeof version2 === "string" && COMPATIBLE_TEMPLATE_SET_VERSIONS.includes(version2);
47
47
  }
48
- var CADRE_RUNTIME_VERSION, COMPATIBLE_RUNTIME_VERSIONS, TEMPLATE_SET_VERSION, COMPATIBLE_TEMPLATE_SET_VERSIONS, LEGACY_RUNTIME_VERSIONS, LEGACY_TEMPLATE_SET_VERSIONS;
48
+ function hasTemplateContract(version2, since) {
49
+ return templateVersions.findIndex((entry) => entry === version2) >= templateVersions.indexOf(since);
50
+ }
51
+ var CADRE_RUNTIME_VERSION, COMPATIBLE_RUNTIME_VERSIONS, TEMPLATE_SET_VERSION, COMPATIBLE_TEMPLATE_SET_VERSIONS, LEGACY_RUNTIME_VERSIONS, LEGACY_TEMPLATE_SET_VERSIONS, templateVersions;
49
52
  var init_version = __esm({
50
53
  "src/domain/version.ts"() {
51
54
  "use strict";
52
- CADRE_RUNTIME_VERSION = "4.3.0";
53
- COMPATIBLE_RUNTIME_VERSIONS = ["3.9.0", "3.9.1", "3.9.2", "4.0.0", "4.1.0", "4.2.0"];
54
- TEMPLATE_SET_VERSION = "v9";
55
- COMPATIBLE_TEMPLATE_SET_VERSIONS = ["v5", "v6", "v7", "v8", TEMPLATE_SET_VERSION];
55
+ CADRE_RUNTIME_VERSION = "4.3.1";
56
+ COMPATIBLE_RUNTIME_VERSIONS = ["3.9.0", "3.9.1", "3.9.2", "4.0.0", "4.1.0", "4.2.0", "4.3.0"];
57
+ TEMPLATE_SET_VERSION = "v10";
58
+ COMPATIBLE_TEMPLATE_SET_VERSIONS = ["v5", "v6", "v7", "v8", "v9", TEMPLATE_SET_VERSION];
56
59
  LEGACY_RUNTIME_VERSIONS = ["3.8.0", "3.7.1", "3.7.0", "3.6.0", "3.5.1", "3.5.0", "3.4.0", "3.3.0"];
57
60
  LEGACY_TEMPLATE_SET_VERSIONS = ["v1", "v2", "v3", "v4"];
61
+ templateVersions = [...LEGACY_TEMPLATE_SET_VERSIONS, ...COMPATIBLE_TEMPLATE_SET_VERSIONS];
58
62
  }
59
63
  });
60
64
 
61
65
  // cadre-build-telemetry:defaults
62
- var DEFAULT_DSN, TELEMETRY_AVAILABLE;
66
+ var DEFAULT_DSN, TELEMETRY_AVAILABLE, DEBUG_IMAGE;
63
67
  var init_defaults = __esm({
64
68
  "cadre-build-telemetry:defaults"() {
65
69
  DEFAULT_DSN = "https://c7549a6dbb434b68729da9a75be19898@o4512395646468096.ingest.de.sentry.io/4512395656233040";
66
70
  TELEMETRY_AVAILABLE = true;
71
+ DEBUG_IMAGE = { "type": "sourcemap", "code_file": "app:///cadre-mcp.mjs", "debug_id": "855bf23f-78f6-4107-b4b4-cb77fbec564f" };
67
72
  }
68
73
  });
69
74
 
@@ -11581,7 +11586,8 @@ function createSentryExporter(config2) {
11581
11586
  transaction: record2.name,
11582
11587
  tags: { ...attributes, error_code: error52.code },
11583
11588
  fingerprint: [record2.name, error52.code],
11584
- exception: { values: [{ type: error52.code, value: error52.message, ...error52.frames.length ? { stacktrace: { frames: error52.frames } } : {} }] }
11589
+ ...DEBUG_IMAGE && error52.frames.some((frame) => frame.filename === DEBUG_IMAGE?.code_file) ? { debug_meta: { images: [DEBUG_IMAGE] } } : {},
11590
+ exception: { values: [{ type: error52.code, value: error52.message, ...error52.frames.length ? { stacktrace: { frames: error52.frames.map((frame) => ({ ...frame, abs_path: frame.filename })) } } : {} }] }
11585
11591
  });
11586
11592
  const labels = { ...attributes };
11587
11593
  delete labels.installation_id;
@@ -11637,6 +11643,7 @@ var init_sentry = __esm({
11637
11643
  init_esm4();
11638
11644
  init_version();
11639
11645
  init_config();
11646
+ init_defaults();
11640
11647
  init_privacy();
11641
11648
  eventId = () => randomBytes(16).toString("hex");
11642
11649
  release = `cadre-ai@${CADRE_RUNTIME_VERSION}`;
@@ -33013,6 +33020,9 @@ function date4(params) {
33013
33020
  // ../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
33014
33021
  config(en_default());
33015
33022
 
33023
+ // src/domain/memory.ts
33024
+ init_version();
33025
+
33016
33026
  // src/telemetry/runtime.ts
33017
33027
  init_version();
33018
33028
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -33571,7 +33581,7 @@ function inspectMemory(input) {
33571
33581
  function requireFreshTrackMemory(projectRoot, trackId) {
33572
33582
  const root = safeProjectRoot(projectRoot);
33573
33583
  const project = JSON.parse(readSafeArtifact(root, ".cadre/project.json"));
33574
- if (!["v3", "v4", "v5", "v6", "v7", "v8", "v9"].includes(project.templateSetVersion ?? "")) return;
33584
+ if (!hasTemplateContract(project.templateSetVersion, "v3")) return;
33575
33585
  const path2 = `.cadre/tracks/${trackId}/learning.md`;
33576
33586
  if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(trackId)) throw new Error("invalid trackId");
33577
33587
  const plan = readSafeArtifact(root, `.cadre/tracks/${trackId}/plan.md`);
@@ -33786,6 +33796,9 @@ function directorySnapshot(path2) {
33786
33796
  return files;
33787
33797
  }
33788
33798
 
33799
+ // src/domain/state.ts
33800
+ init_version();
33801
+
33789
33802
  // src/domain/design.ts
33790
33803
  import { existsSync as existsSync22 } from "node:fs";
33791
33804
  import { join as join27 } from "node:path";
@@ -33801,6 +33814,9 @@ var spawnSync = ((...args) => {
33801
33814
  import { realpathSync as realpathSync5 } from "node:fs";
33802
33815
  import { resolve as resolve13 } from "node:path";
33803
33816
 
33817
+ // src/domain/quick.ts
33818
+ init_version();
33819
+
33804
33820
  // src/domain/quick-consolidation.ts
33805
33821
  import { existsSync as existsSync4 } from "node:fs";
33806
33822
  import { join as join5 } from "node:path";
@@ -34183,6 +34199,7 @@ var TEMPLATE_IDS = [
34183
34199
  "styleguide/maven",
34184
34200
  "styleguide/python",
34185
34201
  "styleguide/react",
34202
+ "styleguide/rust",
34186
34203
  "styleguide/swift",
34187
34204
  "styleguide/swiftui",
34188
34205
  "styleguide/typescript",
@@ -34228,6 +34245,7 @@ var TEMPLATE_ARTIFACT_PATHS = {
34228
34245
  "styleguide/maven": "styleguides/maven.md",
34229
34246
  "styleguide/python": "styleguides/python.md",
34230
34247
  "styleguide/react": "styleguides/react.md",
34248
+ "styleguide/rust": "styleguides/rust.md",
34231
34249
  "styleguide/swift": "styleguides/swift.md",
34232
34250
  "styleguide/swiftui": "styleguides/swiftui.md",
34233
34251
  "styleguide/typescript": "styleguides/typescript.md"
@@ -34327,7 +34345,8 @@ var STYLEGUIDE_RULES = [
34327
34345
  [/\bmaven\b/i, ["maven"]],
34328
34346
  [/\bgradle\b/i, ["gradle"]],
34329
34347
  [/\bgo(lang)?\b/i, ["go"]],
34330
- [/\bpython\b/i, ["python"]]
34348
+ [/\bpython\b/i, ["python"]],
34349
+ [/\b(?:rust|rustlang|rustc|cargo)\b/i, ["rust"]]
34331
34350
  ];
34332
34351
  function resolveStyleguides(technologies) {
34333
34352
  const joined = technologies.join("\n");
@@ -34507,6 +34526,9 @@ function listCandidatePaths(projectRootInput, candidateIdInput) {
34507
34526
  import { lstatSync as lstatSync11 } from "node:fs";
34508
34527
  import { isAbsolute as isAbsolute3, join as join15, relative as relative6, resolve as resolve11, sep as sep4 } from "node:path";
34509
34528
 
34529
+ // src/domain/execution.ts
34530
+ init_version();
34531
+
34510
34532
  // src/domain/autonomous-review.ts
34511
34533
  import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
34512
34534
  var commit = external_exports.string().regex(/^[0-9a-f]{7,40}$/);
@@ -35296,7 +35318,7 @@ function previewExecutionStart(input) {
35296
35318
  const decisionPolicy = decisionPolicySchema.parse(input.decisionPolicy ?? inherited?.policy ?? "ask");
35297
35319
  if (decisionPolicy === "technical-autopilot") {
35298
35320
  const project = JSON.parse(readSafeArtifact(input.projectRoot, ".cadre/project.json"));
35299
- if (project.templateSetVersion !== "v9" || !readSafeArtifact(input.projectRoot, ".cadre/workflow.md").includes("<!-- cadre:decisions:v1 -->")) throw new Error("Technical Autopilot requires approved Refresh to the v9 workflow contract");
35321
+ if (!hasTemplateContract(project.templateSetVersion, "v9") || !readSafeArtifact(input.projectRoot, ".cadre/workflow.md").includes("<!-- cadre:decisions:v1 -->")) throw new Error("Technical Autopilot requires approved Refresh to the v9 workflow contract");
35300
35322
  }
35301
35323
  const decisionAuthority = input.decisionPolicy === void 0 && inherited ? inherited : {
35302
35324
  policyVersion: 1,
@@ -36634,7 +36656,7 @@ var beginQuickInputSchema = external_exports.strictObject({
36634
36656
  });
36635
36657
  function requireQuickContract(root) {
36636
36658
  const project = JSON.parse(readSafeArtifact(root, ".cadre/project.json"));
36637
- if (!["v7", "v8", "v9"].includes(project.templateSetVersion) || !readSafeArtifact(root, ".cadre/workflow.md").includes(QUICK_CONTRACT)) {
36659
+ if (!hasTemplateContract(project.templateSetVersion, "v7") || !readSafeArtifact(root, ".cadre/workflow.md").includes(QUICK_CONTRACT)) {
36638
36660
  throw new Error("QUICK_REFRESH_REQUIRED: adopt the quick contract through an approved refresh before quick delivery");
36639
36661
  }
36640
36662
  }
@@ -38930,7 +38952,7 @@ function validateProjectSnapshot(projectRoot) {
38930
38952
  path: learningPath,
38931
38953
  body: readInspectionText(learningPath, "utf8"),
38932
38954
  graph: planGraph,
38933
- required: ["v3", "v4", "v5", "v6", "v7", "v8", "v9"].includes(project.templateSetVersion ?? "") && !["drafting-spec", "drafting-plan"].includes(track.status),
38955
+ required: hasTemplateContract(project.templateSetVersion, "v3") && !["drafting-spec", "drafting-plan"].includes(track.status),
38934
38956
  historical: ["completed", "archived"].includes(track.status),
38935
38957
  readPattern: (path2) => readSafeArtifact(projectRoot, `.cadre/${path2}`)
38936
38958
  });
@@ -39203,6 +39225,9 @@ function deriveNextStep(projectRoot, state, readiness = {}) {
39203
39225
  }
39204
39226
  }
39205
39227
 
39228
+ // src/domain/context.ts
39229
+ init_version();
39230
+
39206
39231
  // src/domain/quick-search.ts
39207
39232
  init_errors();
39208
39233
  var quickSearchSchema = external_exports.strictObject({
@@ -39431,7 +39456,7 @@ function collectContext(input) {
39431
39456
  path: path2,
39432
39457
  body,
39433
39458
  graph: plan,
39434
- required: ["v3", "v4", "v5", "v6", "v7", "v8", "v9"].includes(project.templateSetVersion ?? ""),
39459
+ required: hasTemplateContract(project.templateSetVersion, "v3"),
39435
39460
  historical,
39436
39461
  readPattern: (path3) => read(`.cadre/${path3}`)
39437
39462
  });
@@ -39639,6 +39664,7 @@ import { existsSync as existsSync28, readdirSync as readdirSync19 } from "node:f
39639
39664
  import { join as join35 } from "node:path";
39640
39665
 
39641
39666
  // src/domain/staged-memory.ts
39667
+ init_version();
39642
39668
  import { existsSync as existsSync25, readdirSync as readdirSync18 } from "node:fs";
39643
39669
  import { dirname as dirname7, join as join31 } from "node:path";
39644
39670
  function inspectStagedMemory(projectRoot, candidateId, files) {
@@ -39696,7 +39722,7 @@ function inspectStagedMemory(projectRoot, candidateId, files) {
39696
39722
  path: reportedPath,
39697
39723
  body: read(path2),
39698
39724
  graph,
39699
- required: ["v3", "v4", "v5", "v6", "v7", "v8", "v9"].includes(project.templateSetVersion ?? ""),
39725
+ required: hasTemplateContract(project.templateSetVersion, "v3"),
39700
39726
  historical,
39701
39727
  readPattern: read
39702
39728
  });
@@ -40141,7 +40167,7 @@ function previewCandidateApply(input) {
40141
40167
  }
40142
40168
  const designPath = `${parent}/design.md`;
40143
40169
  const designBody = overlay.has(designPath) || existsSync28(join35(root, ".cadre", designPath)) ? read(designPath) : null;
40144
- const requiresV9TrackContract = templateSetVersion === "v9" && (["track", "revise"].includes(input.workflow) || Boolean(refreshRevision));
40170
+ const requiresV9TrackContract = hasTemplateContract(templateSetVersion, "v9") && (["track", "revise"].includes(input.workflow) || Boolean(refreshRevision));
40145
40171
  validateDesign(state, designBody, requiresV9TrackContract);
40146
40172
  if (modified("design.md")) state.commits = { ...state.commits, design: reference };
40147
40173
  if (previous && !["track", "revise", "refresh"].includes(input.workflow) && !isDeepStrictEqual17(previous.design, state.design)) throw new Error("Design assessment changes require revision");
@@ -50017,11 +50043,6 @@ function buildProjectInitProposal(input) {
50017
50043
  const content = template.id === "project/styleguides/general" ? template.content.replace("{{GENERAL_STYLE_ADDITIONS}}", "- None.") : template.content;
50018
50044
  generatedContext.set(descriptor.artifactPath, content);
50019
50045
  }
50020
- for (const path2 of approved.keys()) {
50021
- if (path2.startsWith("styleguides/") && !generatedContext.has(path2)) {
50022
- throw new Error(`Initialization override ${path2} is not in the selected styleguide set`);
50023
- }
50024
- }
50025
50046
  for (const [path2, content] of approved) generatedContext.set(path2, content);
50026
50047
  const approvedPaths = [...generatedContext.keys()].sort();
50027
50048
  const approvedArtifactHashes = approvedPaths.map((path2) => ({ path: path2, sha256: hash6(generatedContext.get(path2)) }));
@@ -52356,3 +52377,4 @@ export {
52356
52377
  createCadreServer,
52357
52378
  runCadreServer
52358
52379
  };
52380
+ //# debugId=855bf23f-78f6-4107-b4b4-cb77fbec564f
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre-ai",
3
- "version": "4.3.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/v9/",
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
 
@@ -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)
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
File without changes
File without changes
File without changes
File without changes
File without changes