cadre-ai 3.0.2 → 3.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre-ai",
3
- "version": "3.0.2",
3
+ "version": "3.2.0",
4
4
  "description": "Cross-agent, human-governed software delivery harness",
5
5
  "author": {
6
6
  "name": "Vishal Kumar",
@@ -33,6 +33,7 @@
33
33
  ".mcp.json",
34
34
  "agents/",
35
35
  "dist/",
36
+ "CHANGELOG.md",
36
37
  "LICENSE",
37
38
  "marketplace/",
38
39
  "README.md",
@@ -7,20 +7,22 @@ description: Archive one or more completed Cadre tracks in one approved, resumab
7
7
 
8
8
  Archive one or more `completed` tracks in a single batch. Read `.cadre/workflow.md`, every artifact and recorded commit for every selected track, the full pattern catalog, all active track specs/plans and marked learning seeds, and relevant implementation files. Read existing pattern and learning files before proposing changes.
9
9
 
10
+ 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 preview 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.
11
+
10
12
  Call `project_status` first and use its embedded structured validation; do not repeat `state_validate` at command entry. If the Cadre MCP is unavailable, stop without starting or advancing an archive batch.
11
13
 
12
14
  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; do not call `template_catalog`. The declared mutation surface is `archive_batch_preview`/`archive_batch_apply` followed by `archive_batch_record_preview`/`archive_batch_record_apply`; do not inspect the installed runtime or tool catalog for alternatives.
13
15
 
14
- Expected human decision count is one for an explicit or uniquely eligible selection and its complete batch. An ambiguous multi-track invocation may require one selection response followed by one complete batch approval. Ask again only when the selection, content, digest-bound proposal, or consequences change.
16
+ Expected human decision count is one for the complete batch. Ask again only when its selection, content, or consequences change.
15
17
 
16
- 1. Accept an explicit list of track IDs or `all completed`. If selection is omitted and exactly one track is eligible, use that unique track as the proposed selection and include it in the complete batch proposal without a selection-only approval. If multiple tracks are eligible or the request is otherwise ambiguous, list them and ask which to include. Preserve the approved order and remove duplicates.
18
+ 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.
17
19
  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.
18
20
  3. If an in-progress `.cadre/operations/archive-<timestamp>.json` exists, reconcile it before accepting a new batch. Resume from its first incomplete checkpoint. If its journal, files, Git state, or expected commit disagree, stop and present the mismatch.
19
21
  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.
20
22
  5. 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.
21
- 6. Call `archive_batch_preview` with the ordered selection and exact consolidated pattern/index and active-track seed updates. Present its complete moves, lifecycle states, operation journal, content diffs, generated `tracks.md`, and both expected commits as one batch proposal. Obtain one explicit approval for that complete digest-bound batch; a partial or changed approval requires a new preview. Do not ask separately for a uniquely eligible track.
22
- 7. After approval, pass the unchanged digest to `archive_batch_apply`. It journals before mutation, moves the selected directories, writes the approved content and exact post-archive index, and returns embedded validation. Commit all approved archive moves and derived changes together using the proposal's expected commit.
23
- 8. Pass the resulting archive commit SHA to `archive_batch_record_preview`, verify it only records the already-approved provenance in every selected track, project history, and batch journal, then call `archive_batch_record_apply` with its unchanged digest. This bookkeeping is part of the approved batch and needs no second human approval unless it differs from the original proposal. Create `cadre(archive): record batch <batch-id>`.
23
+ 6. Call `archive_batch_preview` with structured updates: `pattern` plus slug, `pattern_index`, or `active_track_seed` plus track ID. Fetch exact template IDs (`project/pattern`, `project/patterns/index`, and `track/learning`) when needed. Present its complete moves, lifecycle states, content diffs, generated index, and expected commits as one proposal and obtain one explicit approval.
24
+ 7. After approval, pass only the returned proposal token to `archive_batch_apply`. Commit all approved moves and derived changes together using the proposal's expected commit.
25
+ 8. Call `archive_batch_record_preview` with the project root and batch ID; it derives the actual current HEAD. Verify its deterministic provenance update, then pass only its proposal token to apply. This bookkeeping needs no second approval. Create `cadre(archive): record batch <batch-id>`.
24
26
  9. Use the final apply result instead of redundant `state_validate` or `project_status` calls when it is valid/current. Verify only the clean worktree and the two expected commits.
25
27
 
26
28
  If interrupted before the archive commit, reconcile the batch journal and resume its first incomplete track or artifact through the same approved input. If the worktree is clean and HEAD matches the journal's expected commit and base relationship, treat the archive commit as successful and record that SHA. If the SHA is recorded but follow-up state is uncommitted, finish only the state commit. Never repeat completed moves, redistill from a partial selection, or start a second archive batch while one is active.
@@ -7,20 +7,21 @@ description: Initialize or resume Cadre in a greenfield or brownfield repository
7
7
 
8
8
  Use the Cadre MCP as the authoritative runtime and template provider. Do not copy runtime code or templates into the project. Treat every rendered artifact and state mutation as a proposal until the human approves it. If required Cadre MCP tools are unavailable, stop and report that the plugin runtime is unavailable; never reconstruct templates from memory.
9
9
 
10
+ At every required clarification or approval boundary, show a concise 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 current 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.
11
+
10
12
  ## Procedure
11
13
 
12
14
  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.
13
15
  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.
14
16
  3. Call `project_status` when `.cadre/project.json` exists and use its embedded structured validation; do not repeat `state_validate` at command entry. Reconcile its setup journal, worktree, and recent commits. Resume the recorded checkpoint exactly; do not restart or overwrite setup. Offer `$refresh` or `$status` only after completed setup.
15
- 4. Call `template_get_many` once for `project/product`, `project/guidelines`, `project/tech-stack`, `project/workflow`, `project/styleguides/general`, and `project/patterns/index`. Retain that versioned bundle across approval turns and do not refetch it unless its version or content hash changes. 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.
17
+ 4. Call `template_get_many` once for `project/product`, `project/guidelines`, `project/tech-stack`, `project/workflow`, and `project/styleguides/general`. Retain that versioned bundle across approval turns and do not refetch it unless its version or content hash changes. `patterns/index.md`, `.gitignore`, `project.json`, `tracks.md`, and the empty lifecycle directories are initialization outputs derived by the MCP; do not render or pass them as caller-supplied files. 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.
16
18
  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.
17
- 6. Present the rendered `workflow.md` separately. Explicitly ask whether the default workflow is acceptable or the human wants changes. Apply requested changes, show the complete revision, and obtain explicit workflow acceptance; approval of other artifacts does not imply this approval.
18
- 7. Call `styleguide_resolve` with the approved technologies. Always include the general guide. For each resolved language, framework, markup, or build-tool guide, ask whether to use the default, amend it, or use a user-provided replacement. Preserve evidenced brownfield conventions. Show the complete final styleguide set for explicit approval.
19
- 8. Present all remaining rendered files and exact target paths. Approval must cover the complete artifact set, the context classification, project root, and Git disposition. Do not create Cadre state before approval.
20
- 9. Call `project_init_preview` with only the approved rendered project files and metadata. Show its complete file proposal—including the template-derived `.cadre/.gitignore` that excludes `.worktrees/` and `wisps/`—and digest. After explicit confirmation, call `project_init_apply` with the unchanged inputs and digest. It atomically creates mutable `.cadre` state and approved context only; it never installs a runtime or template copies there.
21
- 10. If Git disposition is `initialize`, run `git init` only at the approved root, verify `git rev-parse --show-toplevel` equals that root, then call `setup_record_git_initialized`. If Git is unavailable, initialization fails, or a different repository appears, stop with the setup journal intact. For an existing repository, verify its root again.
22
- 11. Call `state_validate` and show the result. Commit the approved setup as `cadre(create): initialize project harness` only when validation is clean and checkpoint is `commit-pending`.
23
- 12. Call `setup_record_commit` with that SHA, then call `tracks_render_preview`, show the derived result, and call `tracks_render_apply` with its unchanged digest if needed. Commit the bookkeeping as `cadre(create): record setup commit`.
19
+ 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.
20
+ 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.
21
+ 8. Call `project_init_preview` with only the proposed caller-supplied files and metadata. Do not pass `patterns/index.md` or any other MCP-derived output. Expected human decision count is one when root, classification, and material configuration choices are clear. Present one complete initialization envelope containing concise product/engineering/stack summaries, workflow identity and summary, styleguide set and amendments, the complete target-path and SHA-256 manifest, generated-state summary, context classification, project root, Git disposition, and consequences. After explicit confirmation, pass only its opaque proposal token to `project_init_apply`. This one approval authorizes unchanged Git initialization, validation, setup commits, derived `tracks.md`, and provenance bookkeeping; do not add later approval prompts for those deterministic consequences. The apply atomically creates mutable `.cadre` state and approved context only; it never installs a runtime or template copies there.
22
+ 9. If Git disposition is `initialize`, run `git init` only at the approved root, verify `git rev-parse --show-toplevel` equals that root, then call `setup_record_git_initialized`. If Git is unavailable, initialization fails, or a different repository appears, stop with the setup journal intact. For an existing repository, verify its root again.
23
+ 10. Call `state_validate` and report the result. Commit the authorized setup as `cadre(create): initialize project harness` only when validation is clean and checkpoint is `commit-pending`; validation failure is a blocker, not a request to approve an exception implicitly.
24
+ 11. Call `setup_record_commit`; it records the actual current HEAD. If the index needs regeneration, call `tracks_render_preview` and pass only its proposal token to apply. Commit the bookkeeping as `cadre(create): record setup commit` without another prompt and report the concise final result.
24
25
 
25
26
  ## Resume protocol
26
27
 
@@ -7,9 +7,11 @@ description: Execute or resume an approved Cadre plan as a dependency DAG, using
7
7
 
8
8
  Treat the approved `plan.md` as the source of truth. Implement only `planned` or `in_progress` tracks. The main agent is the sole scheduler and Cadre-state owner: workers must never spawn workers, edit `.cadre/**`, merge branches, resolve integration conflicts, remove worktrees, or record human approval.
9
9
 
10
+ At every required clarification or manual-verification boundary, show concise evidence. 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 execution ID, node ID, and verified commit. 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.
11
+
10
12
  Call `project_status`, `execution_graph_validate`, and `worktree_status` before selecting work. Use the structured validation embedded in `project_status`; do not repeat `state_validate` at command entry. If the required Cadre MCP is unavailable, stop at the current checkpoint.
11
13
 
12
- ## Select and persist execution mode
14
+ ## Select and persist execution modes
13
15
 
14
16
  - Default to `parallel` when the human does not specify a mode.
15
17
  - Use `sequential` only when explicitly requested.
@@ -17,7 +19,15 @@ Call `project_status`, `execution_graph_validate`, and `worktree_status` before
17
19
  - Bound worker count by ready nodes, host capacity, and the workflow maximum.
18
20
  - Persist requested/effective mode in the execution journal. Changing it during execution requires a clean safe boundary, a presented proposal, and approval.
19
21
 
20
- For a new execution, call `execution_start_preview`, show the exact journal/state proposal, obtain approval, and pass the unchanged digest to `execution_start_apply`. Then preview and apply the derived `tracks.md` update through its digest gate, verify `derivedStateCurrent`, and commit `cadre(implement): start <track-id>`. For an existing `implement` operation, reconcile it instead of creating another execution.
22
+ Select and persist one approval mode independently of scheduling:
23
+
24
+ - `governed`: present every regular task diff before commit, every conflict resolution, every manual-verification barrier, and every integration or other material mutation required by the approved workflow.
25
+ - `phase` (default): run all regular work inside a phase autonomously, but pause once for each phase's final `User Manual Verification` task.
26
+ - `autonomous`: run regular work and phase-level verification autonomously. Pause only for the `Track-level User Manual Verification` task.
27
+
28
+ Use `phase` unless the human explicitly requests `governed` or `autonomous`. On resume, inherit the journaled mode. Record it in both the execution journal and active track operation. A mode authorizes only work already bounded by the approved spec and plan; any material ambiguity, scope divergence, failed required check, unsafe state, or need for new authority is a blocker or clarification, not an approval prompt. Changing approval mode during execution requires an approved clean boundary and a journaled update.
29
+
30
+ For a new execution, the human's `implement` invocation authorizes an exact execution start using the requested modes or their documented defaults. Call `execution_start_preview`, then pass only its opaque `proposalToken` to `execution_start_apply`. Do not add an execution-start approval prompt outside `governed`; report a concise start summary and proceed. The server derives the execution ID, timestamp, and current Git base. Generated bookkeeping is a deterministic consequence of the same authorization. For an existing `implement` operation, reconcile it instead of creating another execution.
21
31
 
22
32
  ## Resume before scheduling
23
33
 
@@ -33,21 +43,24 @@ Before creating workers, inspect the approved plan, repository scripts, lockfile
33
43
  - Use already-approved commands and prefixes without asking again. Never request permission speculatively or retry equivalent command spellings to obtain a different prompt.
34
44
  - Centralize shared dependency installation, registry access, image pulls, code generation, and other network preparation in main before workers start. Workers should use locked/offline modes when the repository supports them.
35
45
  - Prefer existing repository scripts and narrowly scoped commands. Do not combine unrelated or differently privileged shell segments into one command, because the host evaluates each segment independently.
46
+ - Run independent read-only repository inspections and checks in parallel when the host supports parallel tool calls. Keep only commands with a real data, mutation, or Git dependency sequential.
36
47
  - Avoid scaffolding modes that create nested repositories or require deleting generated `.git` directories. Inspect generator options and target directories first.
37
48
  - When a required permission is not already available, request one narrow reusable command prefix with the exact reason. If a worker encounters an unexpected prompt, it stops and reports the exact blocked command to main instead of issuing repeated variants.
38
49
 
39
50
  ## Schedule the DAG
40
51
 
41
- Call `execution_status` when resuming an execution or when no mutation response is available. After a successful execution mutation, use its returned `derivedStatus` instead of making a redundant status call. Use `execution_nodes_preview` and `execution_nodes_apply` when one already-approved scheduling or bookkeeping decision produces multiple immediately valid transitions. The ordered batch is a transport optimization only: never batch across a human approval, commit, verification, integration, conflict resolution, or other external action whose evidence does not exist at preview time. Plan display order breaks ties only.
52
+ The Cadre tools named in this skill are declared contracts: call them directly. Do not list the global tool catalog, rediscover schemas, or probe previews to learn legal transitions. Call `execution_status` when resuming or when no mutation response is available. Use `execution_checkpoint_preview` with a semantic event (`start`, `record_commit`, `record_integration`, `record_verification`, `complete`, `block`, or `resume`); it expands the event into all required legal transitions. Pass only its `proposalToken` to `execution_checkpoint_apply`, then reuse the returned `derivedStatus`.
53
+
54
+ Never checkpoint evidence before it exists. `record_commit` consumes the verified commit and its authorization; `record_integration` consumes the merge commit and post-merge verification; `record_verification` records a manual barrier. Plan display order breaks scheduling ties only.
42
55
 
43
56
  - A root phase reads the Pattern Seed. Any other phase reads learning from all declared dependency phases.
44
57
  - Treat the track as a hierarchical DAG: phase dependencies determine active phases, task dependencies determine ready work inside each running phase, and main schedules one global ready queue subject to `maxWorkers`. Different phases may use different execution modes concurrently.
45
58
  - Every non-trivial active phase uses a main-owned integration worktree. A phase `workerId` is a temporary execution lease, not ownership of that worktree. Use direct main execution for one ready task, a phase worker for a tightly coupled sequential chain when delegation is already justified, and task-worker fan-out when at least two independent tasks in that phase are ready.
46
59
  - A phase has only one mutating execution mode at a time, but may switch modes at a clean checkpoint. Before phase-worker-to-task-worker fan-out, finish and record the current task, verify the phase worktree is clean, record its HEAD in the phase verification, release the phase worker through a `running`-to-`running` node update with `workerId: null`, and keep that worker inactive. Main may assign a new phase worker only after every active task worker in that phase is completed and its integration/cleanup is recorded.
47
- - Create every task-worker wave from the same recorded clean phase HEAD. Merge approved tasks into the phase worktree one at a time; derive the next wave only after those merges, so downstream tasks start from the updated phase HEAD.
60
+ - Create every task-worker wave from the same recorded clean phase HEAD. Merge ready tasks into the phase worktree one at a time; derive the next wave only after those merges, so downstream tasks start from the updated phase HEAD.
48
61
  - The main agent creates every worker. On Codex, use an available implementation worker subagent with the bounded prompt below. On Claude Code, prefer the plugin-provided `cadre-phase-worker` and `cadre-task-worker`. Do not use Claude agent teams.
49
62
  - If only one safe execution node is ready, execute it in main.
50
- - Phase and task worktrees are siblings. Use `worktree_create_preview` and `worktree_create_apply`; record the returned absolute path/branch through `execution_node_preview` and `execution_node_apply` before spawning.
63
+ - Phase and task worktrees are siblings. Use `worktree_create_preview`, then apply only its proposal token. The MCP derives both the task phase and correct parent HEAD, so omit `phaseId` and `baseCommit`. Record the returned absolute path/branch with a `start` checkpoint before spawning. In `phase` and `autonomous`, these deterministic mutations run without another approval.
51
64
 
52
65
  ### Worker prompt contract
53
66
 
@@ -58,34 +71,36 @@ Provide the exact absolute worktree, track/execution/node IDs, approved outcome,
58
71
  - do not spawn agents, merge, rebase, reset, clean up, or force Git operations;
59
72
  - a phase worker must stop at a requested clean handoff, report the committed phase HEAD and clean status, and remain inactive while task workers for that phase run;
60
73
  - run focused verification and return changed files, tests/checks, risks, learning candidates, and the proposed commit message for the current task;
61
- - stop after each regular task with that task's changes uncommitted at `awaiting_approval` until main presents them and the human approves;
62
- - after approval, commit only that task and return its SHA; do not begin the next phase task until main confirms the checkpoint is recorded.
74
+ - in `governed`, stop after each regular task with that task's changes uncommitted at `awaiting_approval` until main presents them and the human approves;
75
+ - in `phase` or `autonomous`, return each regular task's uncommitted diff and evidence to main for scope review; after main confirms it stays within the approved task and required checks pass, commit only that task without a human prompt;
76
+ - after commit, return the SHA and do not begin the next phase task until main confirms the checkpoint is recorded.
63
77
 
64
78
  ## Approve, commit, and integrate
65
79
 
66
- 1. Transition a worker node from `running` to `awaiting_approval` with its verification summary.
67
- 2. Read the worker diff and evidence. Present them to the human through main.
68
- 3. After approval, direct the worker to create its Conventional Commit, verify the worktree is clean, and record its SHA as `committed`.
69
- 4. For a task worker, call `integration_preview` and show the exact task merge. The MCP derives its parent as the registered phase worktree when one exists, otherwise the canonical worktree. Use the canonical fallback only for an explicitly direct, single-task phase; create a phase integration worktree before delegated work in multi-task or phase-verified delivery. Pass the unchanged digest to `integration_apply`. A task executed directly by main or internally by a phase worker is already on its parent branch: verify its approved commit is reachable and do not invent an integration step. For a phase worktree, use the same gate for phase-to-canonical integration. Never squash.
70
- 5. If integration reports conflicts, mark `conflicted`. Resolve task conflicts in the phase worktree and phase conflicts in main, read every conflicted file and both sides, rerun combined verification, present the resolution, and record the resulting merge commit only after approval.
71
- 6. For a worker worktree, mark the node `integrated`, then preview/apply worktree cleanup. Cleanup must refuse dirty, conflicted, or unintegrated work and must not force branch deletion.
72
- 7. Mark a task complete after its worker integration, or after its approved direct/phase-worker commit is verified on the parent branch. Mark it complete in `plan.md` with its reachable task commit SHA during canonical phase bookkeeping.
80
+ 1. Transition a worker node from `running` to `awaiting_approval` with its verification summary in `governed`; in `phase` or `autonomous`, record the same evidence at the autonomous commit checkpoint without presenting a human approval prompt.
81
+ 2. Main always reads the worker diff and evidence. In `governed`, present them to the human. In `phase` or `autonomous`, confirm that the diff stays inside the approved task and that required checks pass; stop for clarification only when intent or authority is materially ambiguous.
82
+ 3. Direct the worker to create its Conventional Commit, verify the worktree is clean, and record its SHA as `committed`. In `phase` or `autonomous`, record approval evidence as authorization by the persisted approval mode rather than claiming a new human approval.
83
+ 4. For a task worker, call `integration_preview` for the exact task merge. The MCP derives its parent as the registered phase worktree when one exists, otherwise the canonical worktree. Use the canonical fallback only for an explicitly direct, single-task phase; create a phase integration worktree before delegated work in multi-task or phase-verified delivery. In `governed`, show the merge when required by the workflow. In `phase` or `autonomous`, apply a clean in-scope merge without another approval. A task executed directly by main or internally by a phase worker is already on its parent branch: verify its commit is reachable and do not invent an integration step. For a phase worktree, use the same digest gate for phase-to-canonical integration. Never squash.
84
+ 5. If integration reports conflicts, mark `conflicted`. Resolve task conflicts in the phase worktree and phase conflicts in main, read every conflicted file and both sides, and rerun combined verification. In `governed`, present the resolution for approval. In `phase` or `autonomous`, apply and record an unambiguous in-scope resolution autonomously; stop for clarification when the resolution requires a material product or scope choice.
85
+ 6. For a worker worktree, mark the node `integrated`, then preview/apply worktree cleanup. Cleanup must refuse dirty, conflicted, or unintegrated work and must not force branch deletion. Cleanups in `phase` and `autonomous` never create a separate approval prompt.
86
+ 7. Mark a task complete after its worker integration, or after its approved direct/phase-worker commit is verified on the parent branch. The execution journal is the live provenance source; finalization writes the plan markers atomically.
73
87
 
74
88
  Every regular task in a phase has its own Conventional Commit and distinct recorded SHA, including tasks executed sequentially by one phase worker. Manual-verification nodes may record the approved phase-head or merge evidence instead of inventing an empty commit. A phase must remain `running` until every sibling task and its manual-verification barrier are `completed`; only then may it advance to approval, commit, integration, and cleanup.
75
89
 
90
+ Git commits are durability and provenance boundaries, not journal-transition boundaries. Keep each product task's required Conventional Commit, but combine Cadre-only plan, learning, journal, and index bookkeeping once per phase checkpoint and once at the final ready-for-review checkpoint. Do not create a Git commit for each intermediate execution status or for worktree create/integrate/cleanup metadata alone.
91
+
76
92
  ## Verification barriers and learning
77
93
 
78
- - Phase `User Manual Verification` is a derived barrier over all sibling tasks. After task workers are quiescent, prepare technical evidence in the phase worktree through an active phase worker when present, otherwise through main. The main agent always presents and records the human approval.
79
- - After approval, integrate the phase branch, record every task commit, the phase completion merge SHA, and dependency-aware phase learning in canonical `plan.md`/`learning.md`; commit `cadre(implement): record <track-id> <phase-id>`.
80
- - Track-level `User Manual Verification` is a derived barrier over every phase. Execute it only in main, against the fully integrated canonical worktree, and obtain explicit human approval.
94
+ - Phase `User Manual Verification` is a derived barrier over all sibling tasks. After task workers are quiescent, prepare technical evidence in the phase worktree through an active phase worker when present, otherwise through main. In `governed` and `phase`, present this final phase task once and record the human approval. In `autonomous`, verify and record it under the persisted mode without a human prompt.
95
+ - Record verification evidence with its command, working directory, result, and verified product HEAD/tree. Reuse a passing result while product files, test inputs, and required verification policy are unchanged. A commit that changes only `.cadre/**` bookkeeping does not invalidate product verification and must not trigger the same full suite again.
96
+ - After the barrier is approved or authorized, automatically checkpoint the journal, integrate the phase branch, record every task commit, the phase completion merge SHA, and dependency-aware phase learning in canonical `plan.md`/`learning.md`, and commit `cadre(implement): record <track-id> <phase-id>`. Keep the phase node `integrated`, clean its worktree, and only then mark the phase `completed` and start dependents. Cleanup also accepts an already-`completed` node as interruption recovery, without reopening that terminal state. Do not split those deterministic consequences into additional approvals in `phase` or `autonomous`.
97
+ - Track-level `User Manual Verification` is a derived barrier over every phase. Execute it only in main, against the fully integrated canonical worktree, and obtain explicit human approval in all modes.
81
98
 
82
99
  ## Complete execution
83
100
 
84
101
  When all journal nodes and plan tasks are complete, all phase learning/provenance is recorded, all worktrees are removed, and track verification is approved:
85
102
 
86
103
  1. Run the relevant full checks and inspect the final diff/history.
87
- 2. Call `execution_finish_preview`; present its exact completed journal and `ready_for_review` transition.
88
- 3. After approval, call `execution_finish_apply` with the unchanged digest.
89
- 4. Preview/apply `tracks.md`, call `state_validate`, and commit `cadre(implement): ready <track-id>`.
104
+ 2. Record that approval with `record_verification`, then call `execution_finish_preview`. It derives HEAD/time and atomically proposes plan commit markers, the completed journal, `ready_for_review` state, and `tracks.md`; pass only its proposal token to apply. Do not repair markers or the index separately, and do not ask for another approval.
90
105
 
91
106
  Never mark a track `completed`; only an approved clean `review` may do that.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Cadre: Implement"
3
3
  short_description: "Execute a track DAG with safe workers"
4
- default_prompt: "Use $implement to execute or resume an approved track DAG, in parallel by default when safe or sequentially when explicitly requested."
4
+ default_prompt: "Use $implement to execute or resume an approved track DAG, in parallel scheduling and phase approval mode by default unless explicitly requested otherwise."
@@ -7,12 +7,14 @@ description: Refresh Cadre product, guidelines, workflow, styleguides, and tech-
7
7
 
8
8
  Read `.cadre/workflow.md`, `project.json`, all project context files, the last refresh record, Git history since the recorded setup/refresh commit, completed-track outcomes, and current repository manifests/code. Read every target context file before editing it.
9
9
 
10
+ At every required clarification or approval boundary, show a concise context/impact 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 exact refresh proposal checkpoint. 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.
11
+
10
12
  Call `project_status` first and use its embedded structured validation; do not repeat `state_validate` at command entry. If the Cadre MCP or required versioned template is unavailable, stop without changing project context.
11
13
 
12
14
  1. Determine evidence sources: user input, committed repository changes, completed tracks, or a combination.
13
15
  2. Apply the workflow clarification gate before drafting. Ask when the refresh request or evidence does not clearly establish the commit/time range, which context artifacts are in scope, whether files should describe current reality or a desired future state, how to resolve conflicts between user input and repository evidence, or whether cascading active-track updates are intended now.
14
- 3. Before changing execution-governing context, inspect all active implementation journals and workers. Defer such changes until an approved quiescent boundary unless the human explicitly approves stopping and reconciling the affected executions through `$revise`. Draft focused diffs for product, guidelines, workflow, tech stack, general styleguide, and language/framework styleguides. Add/remove language guides only when the approved tech stack requires it.
15
- 4. Assess impact on all active track specs, plans, and marked Pattern Seed sections in learning files. Route required track changes through the same cascading approval rules as `$revise`. Ask if a material impact remains uncertain after inspection.
16
- 5. Call `template_get_many` once for `project/refresh` and `project/refresh-operation`, retain the versioned bundle, render `refreshes/refresh-<ts>.md`, and prepare `.cadre/operations/refresh-<ts>.json` with the evidence range, decisions, affected files, expected commit, approval, checkpoint, and progress. Present all artifacts and diffs for approval.
17
- 6. After approval and before any context write, persist the refresh operation journal. Resume an existing matching journal from its first incomplete artifact; never replace it. Apply only approved changes, advancing its checkpoint and artifact progress after each write. Append project history, reseed affected active tracks, then preview and apply `tracks.md` through its MCP digest gate and call `state_validate`.
18
- 7. Commit `cadre(refresh): update project context`, then record that SHA in the refresh journal and as `lastRefresh.commit`, mark the journal completed, and create the follow-up `cadre(refresh): record refresh commit` state commit. If interrupted after the first commit, identify and record the existing expected commit rather than repeating context changes.
16
+ 3. Before changing execution-governing context, inspect all active implementation journals and workers. Include any required stop, preservation, or reconciliation at a safe quiescent boundary in the final refresh proposal; do not ask for a separate quiescence approval when the exact disposition can be assessed with the refresh. Draft focused diffs for product, guidelines, workflow, tech stack, general styleguide, and language/framework styleguides. Add/remove language guides only when the proposed tech stack requires it.
17
+ 4. Assess impact on all active track specs, plans, and marked Pattern Seed sections in learning files. Apply the same impact analysis as `$revise`, but include every exact cascading track change in the refresh authorization envelope instead of starting separate approval cycles. Ask only if a material impact remains uncertain after inspection.
18
+ 5. Call `template_get_many` once for `project/refresh` and `project/refresh-operation`, retain the versioned bundle, render `refreshes/refresh-<ts>.md`, and prepare `.cadre/operations/refresh-<ts>.json` with the evidence range, decisions, affected files and tracks, expected commits, approval, checkpoint, and progress. Expected human decision count is one for a fully assessed refresh. Present project-context diffs, active-work dispositions, cascading track changes, generated index updates, validation, commits, and provenance bookkeeping as one exact proposal.
19
+ 6. After approval and before any context or track write, persist the refresh operation journal. Resume an existing matching journal from its first incomplete artifact; never replace it. Apply only authorized changes, advancing its checkpoint and artifact progress after each write. Append project and track history, reseed affected active tracks, then preview and apply `tracks.md` through its MCP digest gate and call `state_validate` without another prompt.
20
+ 7. Commit `cadre(refresh): update project context`, then record that SHA in the refresh journal and as `lastRefresh.commit`, mark the journal completed, and create the follow-up `cadre(refresh): record refresh commit` state commit. These unchanged deterministic consequences remain inside the one refresh envelope. If interrupted after the first commit, identify and record the existing expected commit rather than repeating context changes.
@@ -7,14 +7,18 @@ description: Prepare and execute a human-approved Git-aware revert of a Cadre ta
7
7
 
8
8
  Load `.cadre/workflow.md`, project/track state, spec, plan, learning, review/revision history, recorded task commits, Git history, working tree, and dependent tracks. Read every affected file and relevant later diff before proposing a revert.
9
9
 
10
+ At every required clarification or approval boundary, show a concise impact 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 exact revert proposal checkpoint. 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.
11
+
10
12
  Call `project_status` first and use its embedded structured validation; do not repeat `state_validate` at command entry. If the Cadre MCP is unavailable, stop without beginning the revert.
11
13
 
14
+ Expected human decision count is one on the clean path. The exact revert proposal authorizes additive Git reversals, tests, plan/state/learning reconciliation, generated indexes, commits, and provenance bookkeeping when their content and consequences remain unchanged.
15
+
12
16
  1. Resolve the exact task, phase, or track and its worker commits, task-to-phase merge commits, phase-to-canonical merge commits, and execution journal. Detect shared commits, later overlapping edits, active workers/worktrees, dirty changes, and dependent work.
13
17
  2. Build a revert proposal: commits in safe reverse order, conflicts/overlaps, expected file changes, state rollback, invalidated learning/patterns/marked learning seeds, and downstream impacts.
14
- 3. Present the proposal and exact Git operations. Wait for explicit approval. Never use destructive reset/checkout or rewrite public history by default.
18
+ 3. Present the proposal, exact Git operations, expected resulting diff, downstream reconciliation, verification, generated index, and commits as one authorization envelope. Wait for explicit approval. Never use destructive reset/checkout or rewrite public history by default.
15
19
  4. Call `template_get_many` for `track/revert-operation`, render the approved operation into `state.json.operation`, and persist it before any Git mutation. Record the target kind/ID, safe reverse commit order, base commit, expected reconciliation commit, approved artifacts, approval time, checkpoint, and applied revert commits. Resume a matching operation; never replace it.
16
- 5. Reach a quiescent execution boundary before reverting. Use `git revert` to create additive reversal commits, using the correct mainline parent for an approved merge-commit revert. After each successful revert commit, record its SHA and advance the operation checkpoint. Stop and present conflicts rather than guessing resolutions; rerun combined verification after resolution.
20
+ 5. Reach the authorized quiescent execution boundary before reverting. Use `git revert` to create additive reversal commits, using the correct mainline parent for an approved merge-commit revert. After each successful revert commit, record its SHA and advance the operation checkpoint. If a conflict has one unambiguous in-scope resolution that preserves the approved resulting semantics, resolve and verify it inside the envelope. If it introduces a material choice or changes the proposed result, stop and present one corrected proposal rather than accumulating per-file approval prompts.
17
21
  6. Reconcile plan checkboxes without erasing provenance, append a revert history entry, set the earliest affected task/phase back to pending or blocked, and mark dependent tracks for approved revision/reseed as needed.
18
- 7. Run relevant tests, present resulting diffs, preview and apply `tracks.md` through `tracks_render_preview` and `tracks_render_apply` with the unchanged approved digest, and call `state_validate`. Commit Cadre bookkeeping as `cadre(revert): reconcile <track-id>`, record that commit, clear the operation, and create a follow-up record commit when the bookkeeping cannot be included safely. On resume, never repeat a revert SHA already recorded by the operation.
22
+ 7. Run relevant tests, report the resulting diffs, preview `tracks.md` and pass only its proposal token to apply, then validate. Commit Cadre bookkeeping as `cadre(revert): reconcile <track-id>`, record that commit, clear the operation, and create a follow-up record commit when the bookkeeping cannot be included safely. Do not turn these deterministic consequences into a second approval. On resume, never repeat a revert SHA already recorded by the operation.
19
23
 
20
24
  If exact commit provenance is missing or commits mix unrelated work, stop with a precise manual recovery plan.
@@ -7,6 +7,8 @@ description: Review a Cadre track that is ready for review, present evidence-bac
7
7
 
8
8
  Review only a `ready_for_review` track. Load `.cadre/workflow.md`, all track artifacts and learning, dependency context, relevant patterns/styleguides, implementation commits, and repository tests. Read every reviewed file before judging or proposing edits.
9
9
 
10
+ At every required clarification or approval boundary, show a concise finding/evidence summary and 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 current preview digest or reviewed execution/HEAD. 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.
11
+
10
12
  Call `project_status` first and use its embedded structured validation; do not repeat `state_validate` at command entry. If the Cadre MCP is unavailable, stop without changing review state.
11
13
 
12
14
  ## Read context once
@@ -26,7 +28,7 @@ Expected human decision count is one per review cycle when the human accepts the
26
28
  - Present the findings, exact artifact/plan diff, consequences, and choices together. One response may approve both the finding disposition and the unchanged exact artifacts. The human may instead request a subset or different remediation, reject all findings while explicitly accepting their risks and approve clean completion, or stop without mutation.
27
29
  - If the human changes the finding subset or remediation, rebuild and validate the exact proposal and request approval once for that changed proposal. Do not reuse approval for superseded content.
28
30
  - If no findings exist, present clean-review evidence and the exact completion transition once, then ask approval to complete the track.
29
- 4. For approved changes, record a resumable `review` operation before changing the bug artifact, plan, or state. Increment the plan revision, set state to `in_progress`, reset review readiness, and record the review cycle. Call `tracks_render_preview`, show and apply its unchanged digest with `tracks_render_apply`, call `state_validate`, and commit `cadre(review): request changes for <track-id>`. Record that commit SHA as the new approved plan commit, clear the operation, and use `cadre(review): record changes for <track-id>` for follow-up bookkeeping when needed. The prior completed execution remains historical until `implement` starts a new execution ID for the changed graph.
30
- 5. For an approved clean review, including an explicit reject-and-complete decision, bind the clean cycle and any accepted risks to `lastExecution.executionId`, its plan revision, graph digest, and reviewed HEAD. Call `review_complete_preview` with the exact approval record, evidence, and accepted risks, then pass its unchanged digest to `review_complete_apply`; this writes the completed track state and derived index together and returns final validation. Do not repeat `tracks_render_*`, `state_validate`, or `project_status` when that result is valid/current. If the preview differs materially from the transition already shown to the human, present the correction and obtain new approval before apply. Commit `cadre(review): complete <track-id>`.
31
+ 4. For approved changes, record a resumable `review` operation before changing the bug artifact, plan, or state. Increment the plan revision, set state to `in_progress`, reset review readiness, and record the review cycle. Call `tracks_render_preview` and pass only its proposal token to apply, validate, and commit `cadre(review): request changes for <track-id>`. Record that commit SHA as the new approved plan commit, clear the operation, and use `cadre(review): record changes for <track-id>` for follow-up bookkeeping when needed. The prior completed execution remains historical until `implement` starts a new execution ID for the changed graph.
32
+ 5. For an approved clean review, call `review_complete_preview` with the range start, exact approval record, and accepted risks. It derives and verifies the current execution HEAD, range end, and timestamp. Pass only its proposal token to apply; this writes completed state and the derived index together. Do not repeat index or validation calls when its result is current. Commit `cadre(review): complete <track-id>`.
31
33
 
32
34
  Repeat review → implement → review until a human approves a clean review. Only this command may mark a track completed.
@@ -7,6 +7,8 @@ description: Route a requested track change according to lifecycle state, revise
7
7
 
8
8
  Read `.cadre/workflow.md`, the full target track, its dependencies, all tracks that depend on it, relevant repository files, and applicable patterns. Read each artifact before editing; never propose a revision from guessed contents.
9
9
 
10
+ At every required clarification or approval boundary, show a concise impact 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 exact revision proposal checkpoint. 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.
11
+
10
12
  Call `project_status` first and use its embedded structured validation; do not repeat `state_validate` at command entry. If the Cadre MCP is unavailable, stop without modifying the track.
11
13
 
12
14
  ## Route by current status
@@ -20,13 +22,15 @@ Call `project_status` first and use its embedded structured validation; do not r
20
22
 
21
23
  ## Semantic revision procedure
22
24
 
23
- 1. Reconcile `state.json.operation`, any execution journal, managed worktrees, workers, the working tree, and recent commits before drafting. Resume a matching `revise` operation from its first incomplete artifact. Before changing an active execution graph, reach an approved quiescent boundary: finish or stop workers, integrate approved work or preserve it on journaled branches, and clean no worktree by force. Finish or reconcile any other recorded operation first; never replace it.
24
- 2. Restate the requested change and identify specification, acceptance, plan, learning seed/phase history, review readiness, and state consequences. Inspect active and dirty task work. If it overlaps the requested change, present the exact work and obtain approval to complete it, preserve it as superseded, or revert it before applying the revision.
25
+ Expected human decision count is one when the requested change and partial-work disposition can be presented together. A separate preliminary decision is justified only when active work cannot be made safe or fully assessed without first choosing whether to complete, preserve, or revert it.
26
+
27
+ 1. Reconcile `state.json.operation`, any execution journal, managed worktrees, workers, the working tree, and recent commits before drafting. Resume a matching `revise` operation from its first incomplete artifact. Observe a safe quiescent boundary before changing an active execution graph; do not stop workers, integrate work, or clean worktrees before the authorization envelope permits the exact disposition. Finish or reconcile any other recorded operation first; never replace it.
28
+ 2. Restate the requested change and identify specification, acceptance, plan, learning seed/phase history, review readiness, and state consequences. Inspect active and dirty task work. When it overlaps the requested change, include its exact disposition—complete, preserve as superseded, or additive revert—in the combined revision proposal rather than creating a separate approval when that disposition can be safely assessed in advance.
25
29
  3. Apply the workflow clarification gate. Ask when materially different interpretations remain for the desired outcome, scope, acceptance criteria, compatibility, dependency changes, treatment of completed or partial work, or whether dependent tracks should change now. Do not infer permission to invalidate approved work.
26
30
  4. Trace transitive dependent tracks. For each, classify impact as none, reseed-only, plan change, spec change, or invalidated work, with evidence. If evidence cannot resolve a material impact, ask before choosing a classification.
27
31
  5. Call `template_get_many` once for `track/revision` and `track/revise-operation`, and retain the versioned bundle. Render `revisions/revision-<ts>.md` and draft exact diffs for every affected artifact. Record source and target status, the base commit, affected phases/tasks, completed and partial-work disposition, review impact, dependency impact, and verification work. Preserve completed tasks and commit markers; append or explicitly supersede work rather than erasing provenance.
28
32
  6. Increment the track revision exactly once. Increment the specification revision only if `spec.md` changes and the plan revision only if `plan.md` changes; keep the revision values in `state.json`, `spec.md`, `plan.md`, and the marked Pattern Seed consistent. Preserve completed task provenance, update explicit regular phase/task dependencies, and restore derived manual-verification barriers. When the plan changes, call `execution_graph_validate_draft` with the complete proposed plan Markdown and the intended post-approval target status; do not validate the stale canonical plan or create a temporary project copy. A changed plan graph uses a new execution ID; never reuse a completed or superseded execution journal.
29
- 7. Present the target revision and all cascading dependent-track changes together. Wait for explicit approval. Partial approval narrows the change set and requires a fresh impact assessment, transition calculation, and proposal.
33
+ 7. Present the target revision, partial-work disposition, quiescence actions, all cascading dependent-track changes, validation evidence, lifecycle transitions, expected commits, generated index updates, and provenance bookkeeping together. Wait for one explicit approval. Partial approval narrows the change set and requires a fresh impact assessment, transition calculation, and proposal.
30
34
  8. Before changing approved artifacts, write the rendered `revise` operation into every affected track's `state.json`. Use the same expected commit, record each approved artifact and per-artifact progress, and advance the durable checkpoint after each write.
31
- 9. Apply only the approved changes, update relevant marked Pattern Seed sections without overwriting phase learning, set the approved source-to-target states, mark the earliest affected plan nodes pending in the replacement execution graph, and append track-local history. Do not add singular active phase/task fields to track state. Preview and apply `tracks.md` through `tracks_render_preview` and `tracks_render_apply` using the unchanged approved digest.
32
- 10. Call `state_validate` and commit `cadre(revise): update <track-id>`. Reconcile interruption using the workflow journal rules. Record the commit in every revision entry, clear each completed operation, and use a follow-up `cadre(revise): record <track-id>` commit when bookkeeping cannot be part of the artifact commit.
35
+ 9. Apply only the authorized changes, update relevant marked Pattern Seed sections without overwriting phase learning, set the approved source-to-target states, mark the earliest affected plan nodes pending in the replacement execution graph, and append track-local history. Do not add singular active phase/task fields to track state. Preview `tracks.md` and pass only its proposal token to apply without another prompt.
36
+ 10. Call `state_validate` and commit `cadre(revise): update <track-id>`. Reconcile interruption using the workflow journal rules. Record the commit in every revision entry, clear each completed operation, and use a follow-up `cadre(revise): record <track-id>` commit when bookkeeping cannot be part of the artifact commit. These unchanged deterministic consequences remain inside the revision authorization envelope.
@@ -12,7 +12,7 @@ Call `project_status` and `worktree_status` with the exact project root. Use the
12
12
  Present:
13
13
 
14
14
  - project setup checkpoint, pending operation journal, setup commit, and last-refresh commit;
15
- - each track's type, status, durable checkpoint, pending operation, execution mode, ready/running/awaiting-approval/blocked/conflicted/integrated nodes, dependencies, revision, and next legal command;
15
+ - each track's type, status, durable checkpoint, pending operation, scheduling mode, approval mode, ready/running/awaiting-approval/blocked/conflicted/integrated nodes, dependencies, revision, and next legal command;
16
16
  - registered Cadre worktrees, worker branches, dirty/conflicted worktrees, and orphaned runtime directories;
17
17
  - blockers and stale dependent-track assessments;
18
18
  - ready-for-review, completed-not-archived, and archived counts;
@@ -7,6 +7,8 @@ description: Create or resume a Cadre feature or bug track, including a function
7
7
 
8
8
  Create only `feature` or `bug` tracks. Resume an existing drafting track instead of replacing it.
9
9
 
10
+ At every required clarification or approval boundary, show a concise 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 current 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.
11
+
10
12
  ## Required context
11
13
 
12
14
  Read `.cadre/workflow.md`, `project.json`, `product.md`, `guidelines.md`, `tech-stack.md`, relevant styleguides, `patterns/index.md`, and every declared dependency. Before editing an existing artifact, read it and its directly relevant context; never guess its contents.
@@ -17,15 +19,15 @@ Call `project_status` first and use its embedded structured validation; do not r
17
19
 
18
20
  1. Normalize a stable track ID. Look for its state at the status-derived active or archive location. If track state exists, reconcile its operation journal, working tree, and recent commits first. Resume the recorded checkpoint; never replace or restart an interrupted track. Otherwise determine title, type, goal, scope, dependencies, risks, and unknowns with the human.
19
21
  2. Apply the workflow clarification gate before drafting. Ask targeted questions whenever repository evidence and the request do not clearly establish a material choice such as feature versus bug, in/out of scope behavior, affected users/interfaces/data, compatibility or rollout expectations, acceptance measures, dependency tracks, or whether existing behavior must be preserved. Do not silently choose an interpretation.
20
- 3. Call `template_get_many` once for `track/spec` and `track/state`. Retain the versioned bundle across approval turns. Render the functional requirements, non-functional requirements, acceptance criteria, additional information, and dependency impact. Present both proposed artifacts and wait for approval before writing or changing state.
21
- 4. After approval, create/update track state with the spec operation journal before writing `spec.md`. Directly writing these approved track artifacts is intentional; do not search for an undeclared track-mutation MCP tool. Advance artifact checkpoints through written, then preview/apply the derived `tracks.md` update, call `state_validate`, require both canonical validity and current derived state, and advance to `commit-pending`. Commit as `cadre(track): specify <track-id>`, then record its SHA, clear the operation, move to `drafting-plan`, and commit the state record.
22
- 5. Call `template_get_many` once for `track/plan` and `track/learning`, retain the versioned bundle, then draft an acyclic phase/task graph. Every regular phase explicitly declares phase dependencies and every regular task explicitly declares same-phase task dependencies. Do not repeat derived barriers: each phase's final `User Manual Verification` depends on every sibling task, while the final `Track-level User Manual Verification` phase contains only its manual task and depends on every preceding phase. Include tests, formatting, documentation, and Definition of Done work explicitly. Call `execution_graph_validate_draft` with the proposed plan Markdown and target status `planned`; resolve every unknown reference, cycle, missing declaration, or material ambiguity before approval. Do not write an unapproved plan into `.cadre/` or create a temporary project copy for validation.
23
- 6. Build the marked `Pattern Seed` section at the top of `learning.md` from patterns relevant to this spec and plan. Root phases read the seed; other phases read learning from their declared dependency phases. Cite pattern file paths and explain relevance. Do not invent patterns. Present the plan, graph, and learning seed for approval.
24
- 7. After approval, journal the plan operation before writing `plan.md` and `learning.md`. Advance checkpoints through written, validated, and `commit-pending`; set track-local status to `planned`, call `tracks_render_preview`, present and apply its unchanged digest with `tracks_render_apply`, call `state_validate`, and commit `cadre(track): plan <track-id>`. Then record its SHA, clear the operation, set checkpoint `ready`, and commit `cadre(track): record plan <track-id>`.
22
+ 3. Call `template_get_many` once for `track/spec`, `track/state`, `track/plan`, and `track/learning`; retain the versioned bundle through the decision. Render the functional requirements, non-functional requirements, acceptance criteria, additional information, dependency impact, and proposed track state.
23
+ 4. Draft an acyclic phase/task graph from that proposed specification. Every regular phase explicitly declares phase dependencies and every regular task explicitly declares same-phase task dependencies. Do not repeat derived barriers: each phase's final `User Manual Verification` depends on every sibling task, while the final `Track-level User Manual Verification` phase contains only its manual task and depends on every preceding phase. Include tests, formatting, documentation, and Definition of Done work explicitly. Call `execution_graph_validate_draft` with the proposed plan Markdown and target status `planned`; resolve every unknown reference, cycle, missing declaration, or material ambiguity before approval. Do not write an unapproved plan into `.cadre/` or create a temporary project copy for validation.
24
+ 5. Build the marked `Pattern Seed` section at the top of `learning.md` from patterns relevant to the proposed spec and plan. Root phases read the seed; other phases read learning from their declared dependency phases. Cite pattern file paths and explain relevance. Do not invent patterns.
25
+ 6. Expected human decision count is one for a clear new track. Present the exact specification, state summary, validated plan graph, learning seed, two planned commits, lifecycle transition to `planned`, and deterministic derived-state consequences as one authorization envelope. A human may explicitly request staged specification/plan review; otherwise do not create a specification-only approval prompt. Changed scope or plan content requires one corrected combined proposal.
26
+ 7. After approval, create/update track state with one operation journal covering `spec.md`, `plan.md`, and `learning.md`, then write all three exact approved artifacts to the durable worktree before the first commit so a resumed session never has to reconstruct approved plan content from conversation memory. Direct writes are intentional; do not search for an undeclared mutation tool. Validate the specification, preview/apply derived `tracks.md`, stage only the specification-stage files, commit `cadre(track): specify <track-id>`, and record its SHA while the approved plan/learning remain journaled dirty artifacts. Preserve and transition the same approval envelope into planning instead of clearing it or asking again. Validate `plan.md` and `learning.md`, set status to `planned`, preview/apply `tracks.md`, commit `cadre(track): plan <track-id>`, record its SHA, clear the operation, set checkpoint `ready`, and commit `cadre(track): record plan <track-id>`. All generated indexes, validation, commits, and state-record bookkeeping are unchanged deterministic consequences and require no additional approval.
25
27
 
26
28
  For either track commit, reconcile interruptions before continuing:
27
29
 
28
- - Journal plus matching dirty artifacts: continue the pending write/validation/commit.
30
+ - Journal plus matching dirty artifacts: continue the pending write/validation/commit under the recorded combined envelope.
29
31
  - Journal plus clean tree and matching expected HEAD: record that commit; do not repeat it.
30
32
  - Recorded SHA plus dirty bookkeeping: finish the state-record commit.
31
33
  - Any mismatch: present it and stop rather than regenerating approved spec, plan, or learning.
@@ -7,9 +7,11 @@ description: Perform lightweight exploration, investigation, spikes, or question
7
7
 
8
8
  If `.cadre/workflow.md` exists, read it first and retain its safety, repository, human-review, and read-before-edit rules while bypassing its delivery-state mutations. You may call the read-only `project_status` tool and use its embedded validation for context, but MCP availability is not required for a stateless exploration. Keep the exploration outside Cadre state: except for ignored disposable output under `.cadre/wisps/`, do not change `.cadre/`, track status, learning, patterns, or Cadre history.
9
9
 
10
+ When the exploration needs a material clarification and the Cadre MCP is available, show concise context. 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` with at most three questions. 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. Standard Wisp still has no approval form unless the human explicitly insists on an untracked persistent edit.
11
+
10
12
  1. Define the exploration question and expected disposable output. When persistent disposable output is useful, use `.cadre/wisps/<timestamp>-<slug>/`; `.cadre/.gitignore` must exclude it from Git.
11
13
  2. Inspect relevant repository files. Before editing any existing file, read it and its directly relevant context; inspect the directory before creating a file.
12
- 3. Prefer read-only investigation and temporary files outside the repository. Wisp files under `.cadre/wisps/` never enter Cadre state or commits. If persistent product-file edits are requested, show the proposed scope and obtain approval; do not commit automatically.
14
+ 3. Prefer read-only investigation and temporary files outside the repository. Standard Wisp has zero approval prompts. Wisp files under `.cadre/wisps/` never enter Cadre state or commits. Promote requested persistent product changes into `$track`; only when the human explicitly insists on an untracked persistent edit, present one exact scope approval and do not commit automatically.
13
15
  4. Return findings, evidence, uncertainty, and a recommendation.
14
16
  5. If the result should become product work, recommend `$track`; do not retroactively mutate Cadre state from the wisp.
15
17