cadre-ai 4.0.0 → 4.1.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 (71) hide show
  1. package/.claude-plugin/plugin.json +13 -4
  2. package/.codex-plugin/plugin.json +11 -7
  3. package/CHANGELOG.md +54 -8
  4. package/LICENSE +202 -21
  5. package/NOTICE +13 -0
  6. package/README.md +93 -52
  7. package/dist/cadre-cli.mjs +30 -13
  8. package/dist/cadre-mcp.mjs +4008 -3691
  9. package/marketplace/claude.json +2 -1
  10. package/marketplace/codex.json +1 -1
  11. package/package.json +9 -7
  12. package/skills/create/SKILL.md +1 -1
  13. package/skills/implement/SKILL.md +5 -1
  14. package/skills/quick/SKILL.md +41 -0
  15. package/skills/quick/agents/openai.yaml +4 -0
  16. package/skills/refresh/SKILL.md +36 -8
  17. package/skills/refresh/agents/openai.yaml +2 -2
  18. package/skills/revert/SKILL.md +2 -2
  19. package/skills/review/SKILL.md +6 -2
  20. package/skills/revise/SKILL.md +5 -1
  21. package/skills/status/SKILL.md +5 -1
  22. package/skills/track/SKILL.md +6 -2
  23. package/skills/wisp/SKILL.md +3 -3
  24. package/templates/{v6 → v8}/init/workflow.md +24 -3
  25. package/templates/v8/project/refresh.md +37 -0
  26. package/templates/v8/quick/record.json +15 -0
  27. package/skills/archive/SKILL.md +0 -56
  28. package/skills/archive/agents/openai.yaml +0 -4
  29. package/templates/v6/project/archive-operation.json +0 -19
  30. package/templates/v6/project/refresh.md +0 -21
  31. /package/templates/{v6 → v8}/init/archive/.gitkeep +0 -0
  32. /package/templates/{v6 → v8}/init/gitignore.template +0 -0
  33. /package/templates/{v6 → v8}/init/guidelines.md +0 -0
  34. /package/templates/{v6 → v8}/init/operations/.gitkeep +0 -0
  35. /package/templates/{v6 → v8}/init/patterns/index.md +0 -0
  36. /package/templates/{v6 → v8}/init/product.md +0 -0
  37. /package/templates/{v6 → v8}/init/project.json +0 -0
  38. /package/templates/{v6 → v8}/init/refreshes/.gitkeep +0 -0
  39. /package/templates/{v6 → v8}/init/styleguides/general.md +0 -0
  40. /package/templates/{v6 → v8}/init/styleguides/language.md +0 -0
  41. /package/templates/{v6 → v8}/init/tech-stack.md +0 -0
  42. /package/templates/{v6 → v8}/init/tracks/.gitkeep +0 -0
  43. /package/templates/{v6 → v8}/init/tracks.md +0 -0
  44. /package/templates/{v6 → v8}/init/wisps/.gitkeep +0 -0
  45. /package/templates/{v6 → v8}/project/pattern.md +0 -0
  46. /package/templates/{v6 → v8}/project/refresh-operation.json +0 -0
  47. /package/templates/{v6 → v8}/styleguides/dart.md +0 -0
  48. /package/templates/{v6 → v8}/styleguides/flutter.md +0 -0
  49. /package/templates/{v6 → v8}/styleguides/go.md +0 -0
  50. /package/templates/{v6 → v8}/styleguides/gradle.md +0 -0
  51. /package/templates/{v6 → v8}/styleguides/html-css.md +0 -0
  52. /package/templates/{v6 → v8}/styleguides/index.md +0 -0
  53. /package/templates/{v6 → v8}/styleguides/java.md +0 -0
  54. /package/templates/{v6 → v8}/styleguides/javascript.md +0 -0
  55. /package/templates/{v6 → v8}/styleguides/kotlin.md +0 -0
  56. /package/templates/{v6 → v8}/styleguides/maven.md +0 -0
  57. /package/templates/{v6 → v8}/styleguides/python.md +0 -0
  58. /package/templates/{v6 → v8}/styleguides/react.md +0 -0
  59. /package/templates/{v6 → v8}/styleguides/swift.md +0 -0
  60. /package/templates/{v6 → v8}/styleguides/swiftui.md +0 -0
  61. /package/templates/{v6 → v8}/styleguides/typescript.md +0 -0
  62. /package/templates/{v6 → v8}/track/bug.md +0 -0
  63. /package/templates/{v6 → v8}/track/dependency-context.json +0 -0
  64. /package/templates/{v6 → v8}/track/execution.json +0 -0
  65. /package/templates/{v6 → v8}/track/learning.md +0 -0
  66. /package/templates/{v6 → v8}/track/plan.md +0 -0
  67. /package/templates/{v6 → v8}/track/revert-operation.json +0 -0
  68. /package/templates/{v6 → v8}/track/revise-operation.json +0 -0
  69. /package/templates/{v6 → v8}/track/revision.md +0 -0
  70. /package/templates/{v6 → v8}/track/spec.md +0 -0
  71. /package/templates/{v6 → v8}/track/state.json +0 -0
@@ -1,56 +0,0 @@
1
- ---
2
- name: archive
3
- description: Archive one or more completed Cadre tracks in one approved, resumable batch; distill their incremental learning with existing patterns, rebuild the pattern catalog, and reseed non-completed tracks by relevance. Use for the archive command after clean approved reviews.
4
- ---
5
-
6
- # Cadre Archive
7
-
8
- ## Cohesive commits and retained context
9
-
10
- Each approved operation produces one immutable receipt under `.cadre/receipts/` and a temporary recovery journal under `.cadre/stage/operations/`. Apply returns `receipt` (or the receipt fields directly): `operationId`, `receiptHash`, `trailers`, and `status: commit_pending`. Include the promoted files and receipt in one agent-created Git commit with both exact returned trailers. Commit execution stays with the agent. Use `candidate_apply` with `request: {mode: "reconcile", projectRoot, operationId}` after committing; reconciliation verifies a unique reachable commit and committed artifacts and changes temporary state only. Never add a follow-up record-SHA commit. An operation reference is `op:<operationId>`, not a Git revision to pass directly to shell Git. Resolve it through receipt reconciliation before Git range commands.
11
-
12
- Before any dependent delivery, resolve `commit_pending`. On interruption, inspect the persisted recovery journal and original approval; use `candidate_apply` with `request: {mode: "resume", projectRoot, operationId, approvalDigest}` to finish the already-approved promotion. Reconcile an existing commit before creating another. Any drift or ambiguous/forged receipt blocks continuation. Never replace an approved recovery journal or fabricate its approval. Resume checks the approved unchanged-input fingerprints before further writes. `OPERATION_INPUT_DRIFT` preserves the pending operation; retain changed files and deliberately restore the approved inputs or obtain an exact repair approval. Never alter recovery hashes, delete the journal, or repeat product work to bypass this gate.
13
-
14
- Use the scheduler and validation in mutation results. Do not immediately request the same status again. For `context_read`, retain `retainedContextToken` only after a complete successful read. Pass it on later reads only while that text remains in context, with the same scope, token and knowledge arguments across continuation pages. Do not add or change `knownSources` midway through a paginated read; changing those arguments invalidates its cursor. Clear it after compaction, context loss, expiration, or a fresh task. Default pages are 48 KiB, maximum 64 KiB. Section identity/content hashes allow reuse despite unrelated file changes; source freshness is checked independently. Required project instructions, full current spec/plan, applicable constraints, and repository instructions remain authoritative. Consume every page and require `contextReady`. An explicit full-source dependency fallback must be read completely and reassessed; do not silently omit guidance.
15
-
16
- Serialized errors are bounded to 8 KiB. Use `diagnostic_read` with the returned diagnostic ID only when fuller evidence is needed; paginate it. Do not dump cache path lists into conversation. Build outputs belong in the runtime-returned owned `buildCachePath`, never an arbitrary `.cadre/.build-cache` directory.
17
-
18
- Existing 3.9.0/3.9.1/3.9.2 projects using schema-2 state and template v5 continue without a version-only refresh. If status reports `PROJECT_UPGRADE_REQUIRED`, stop mutations: install Cadre 3.9.0, reconcile interrupted operations and perform its approved refresh to schema-2/v5 at a quiescent boundary, then install 4.0.0 and reload the client. Preserve approvals, historical journals, SHA references and archived learning; never edit version labels to bypass this gate.
19
-
20
- Archive one or more `completed` tracks in a single batch. Read `.cadre/workflow.md`, every artifact and recorded commit for every selected track, the complete pattern catalog, active-track status summaries, and relevant implementation files. Use catalog applicability, provenance, and supersession summaries to identify affected patterns and active tracks, then read their full pattern/spec/plan/seed artifacts before proposing changes. If metadata is missing, incomplete, or ambiguous, read the full catalog bodies and active specs/plans/seeds. Never exclude guidance by keyword alone.
21
-
22
- At every required selection or approval boundary, show a concise batch summary or focused diff. Inspect the active host policy before calling `workflow_elicit`: if the task context reports approval policy `never`, including Codex Full Access, skip the form and ask the same short question once in chat. Otherwise prefer `workflow_elicit`, using `clarification` for at most three questions and `approval` bound to the archive proposal digest. Treat only an `approved` result as approval. If it returns `fallback_required`, or immediately returns `declined` while the task explicitly reports policy `never`, ask the same short question once in chat; the latter is policy rejection, not a human decline. Never request secrets or retry the form.
23
-
24
- Call `project_status` first with `view: "project"` and use its embedded structured validation; do not repeat `state_validate` at command entry. Stop when `valid` is false or the Cadre MCP is unavailable; do not start or advance an archive batch.
25
-
26
- Build one bounded archive inventory after selection. Read every selected artifact exactly once, summarize execution journals structurally in one pass, and verify recorded commit reachability in one Git pass. Do not precede reads with line counts, rediscover the same paths, or restart full reads after truncation; continue from the first unread line. Reuse unchanged workflow/product/styleguide context already loaded in the same flow. Fetch known pattern templates directly with one `template_get_many` call and use descriptor tools when an ID must be resolved; do not discover MCP resources. The declared mutation surface is adaptive `archive_batch_candidate` followed by receipt reconciliation; do not inspect the installed runtime or tool catalog for alternatives.
27
-
28
- The approved batch includes the generated index. With no pattern or seed updates, use `expectedFiles: []` and `updates: []`. Active dependency-context source paths are rebased under this same approval; changed inherited guidance requires a staged `active_dependency_context` descriptor and reassessment.
29
-
30
- Expected human decision count is one for the complete batch. Ask again only when its selection, content, or consequences change.
31
-
32
- 1. Accept an explicit list of track IDs. When selection is omitted or the human says `all completed`, omit `selectedTracks`; the server selects every eligible completed track in dependency order. Preserve an explicit order and remove duplicates.
33
- 2. Verify the entire selection before changing anything. Every selected track must be `completed`, have clean centralized `state_validate`, and have no pending state mutation. Do not recompute its DAG, manual-verification barriers, or review evidence inside archive; those are completed-state invariants. Reject the batch without partial mutation if any selected track is ineligible. Ignore completed tracks that were not selected.
34
- 3. If an ignored receipt recovery journal exists, reconcile or resume it before accepting a new batch. An older `.cadre/operations/archive-<timestamp>.json` batch must be completed using Cadre 3.9.0 before returning to 4.0. Never reinterpret or discard its approval.
35
- 4. Distill durable, evidenced learning across the selected tracks as one corpus; discard track-specific trivia. Merge, replace, split, or retire existing patterns when justified, preserving provenance to every contributing track/phase/task commit. Reconcile overlapping or conflicting learning once so batch order cannot silently change the result.
36
- 5. Keep catalog summaries and applicability/provenance/supersession information complete. Compute relevant Pattern Seed section changes in `learning.md` for every non-completed, non-archived track using the final proposed pattern set. Never seed by keyword alone; explain semantic relevance.
37
- 6. Call `candidate_stage_prepare` for `archive-<proposal-id>` with `expectedFiles` equal to every proposed pattern, pattern-index, and active-track seed path, then write exactly that set. Call `archive_batch_candidate` with `request: { mode: "prepare", projectRoot, candidateId, selectedTracks?, updates }`; `updates` contains the required body-free descriptors. Present the resulting proposal once.
38
- 7. After approval, call only `request: { mode: "apply", proposalToken }` on `archive_batch_candidate`; it re-reads staged files and rejects drift. Never make the two calls consecutively without the human decision between them. Commit all approved moves and derived changes together, keep the matching candidate stage through that checkpoint, and never stage it.
39
- 8. Include the returned receipt and exact trailers in that one archive commit, then reconcile using `candidate_apply`. Do not create a second archive commit.
40
- 9. Reuse the apply validation. Verify the receipt, one archive commit, and clean worktree; do not reread all completed histories.
41
-
42
- If interrupted, inspect the matching `.cadre/stage/operations/<operationId>.json` and Git evidence. If its receipt is already committed, use `candidate_apply` reconcile. Otherwise use `candidate_apply` with `request: {mode: "resume", projectRoot, operationId, approvalDigest}` from that original approved intent to converge remaining moves/writes, then commit the receipt once and reconcile. Repeating `archive_batch_candidate` apply before reconciliation encounters `COMMIT_PENDING`; it is not the pending-promotion recovery route. The original archive apply token supports zero-change replay after commit/reconciliation. Recovery and replay converge without another approval for unchanged consequences. Provenance recording is idempotent and never duplicates track/project history. Never redistill or start a second batch while one is active.
43
-
44
- Do not delete learning, review cycles, revisions, bug reports, or commit provenance.
45
-
46
- ## Memory contract
47
-
48
- Preserve phase history and existing handoffs. For active tracks, keep the marked `cadre:memory` JSON block inside Pattern Seed synchronized with the proposed spec/plan revisions and exact approved pattern hashes. Every applicable pattern requires its safe `patterns/<slug>.md` path, SHA-256, and human-readable relevance/constraints; never invent or silently omit guidance. When a staged plan changes revisions, include the reassessed learning file in `expectedFiles`. Inspect `candidate_inspect.learning` and `memoryInputs` as well as `plans`; resolve invalid or stale memory before approval. Immediately before direct promotion, re-inspect and compare the complete approved digest, including unchanged memory inputs; changed inputs require reassessment and a corrected approval. Archive apply performs this check in the runtime. Completed and archived learning remains historical evidence, not a claim that old hashes describe current patterns.
49
-
50
- ## Evidence quality and proposal identity
51
-
52
- Archive prepare returns `stateChanges` for each moved track state and project history. Read its `sourcePath`, apply the exact `set`/array `append` changes, and serialize with two-space indentation and a trailing newline; verify the returned SHA-256 for the final `path`. Include these automatic status, checkpoint, history and operation-reference changes in the same archive approval envelope. Preserve all other source fields and historical artifacts.
53
-
54
- Before promoting an observation into a pattern, verify it against actual imports, source and relevant tests; distinguish observed facts, hypotheses and scope decisions. Hashes establish freshness, not truth. Do not infer that an assertion is loose from its method name without checking the imported module, or that no I/O implies no trust boundary. Correct mistaken historical claims explicitly in new guidance with evidence, preserving completed history.
55
-
56
- Prepare results describe prospective paths; they do not prove a journal exists. Apply persists the receipt recovery intent under `.cadre/stage/operations/<operationId>.json`. Use the returned receipt operationId and the original approvalDigest for resume/reconcile. Never create a legacy `.cadre/operations/` journal from preview metadata or compare that prospective path to the actual recovery intent.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "Cadre: Archive"
3
- short_description: "Archive completed tracks as one batch"
4
- default_prompt: "Use $archive to archive one or more completed tracks in a resumable batch and distill their patterns."
@@ -1,19 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "action": "archive",
4
- "batchId": "archive-{{ARCHIVE_TS}}",
5
- "status": "in_progress",
6
- "checkpoint": "approved",
7
- "baseCommit": "{{BASE_COMMIT}}",
8
- "expectedCommit": "{{EXPECTED_COMMIT}}",
9
- "selectedTracks": ["{{TRACK_ID}}"],
10
- "completedTracks": [],
11
- "approvedArtifacts": ["{{APPROVED_ARTIFACT}}"],
12
- "approvalDigest": "{{APPROVAL_DIGEST}}",
13
- "approvedArtifactHashes": [
14
- { "path": "{{APPROVED_ARTIFACT}}", "sha256": "{{ARTIFACT_SHA256}}" }
15
- ],
16
- "artifactProgress": [],
17
- "approvedAt": "{{APPROVED_AT}}",
18
- "archiveCommit": null
19
- }
@@ -1,21 +0,0 @@
1
- # Refresh {{REFRESH_TS}}
2
-
3
- - Status: proposed
4
- - Previous refresh/setup commit: `{{BASE_COMMIT}}`
5
- - Refresh commit: pending
6
-
7
- ## Inputs and evidence
8
-
9
- {{INPUTS_AND_COMMIT_RANGE}}
10
-
11
- ## Proposed context changes
12
-
13
- {{PROPOSED_CHANGES}}
14
-
15
- ## Active-track impact
16
-
17
- {{TRACK_IMPACT}}
18
-
19
- ## Approval
20
-
21
- {{APPROVAL_RECORD}}
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