cadre-ai 3.0.1 → 3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cadre-ai",
3
- "version": "3.0.1",
3
+ "version": "3.1.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,6 +7,8 @@ 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.
@@ -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, consequences, and proposal digest. Identify unchanged defaults by path and hash instead of printing full contents; show changed content or focused diffs when material or requested. After explicit confirmation, call `project_init_apply` with the unchanged inputs and digest. 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 audit-only `approvedAt` timestamp may reflect the final approval and is excluded from the semantic proposal digest. 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` with that SHA, then call `tracks_render_preview` and `tracks_render_apply` with its unchanged digest if needed. 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, including task commits, clean integrations, conflict resolution within approved scope, worktree lifecycle, journal/index updates, and bookkeeping. Pause exactly once for that phase's final `User Manual Verification` task. The final track-level verification phase is also a phase and therefore pauses at its single 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`. Record the selected `approvalMode` 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` and pass its unchanged digest to `execution_start_apply`. In `phase` or `autonomous`, do not add an execution-start approval prompt; report a concise start summary and proceed. In `governed`, present the start proposal when the current workflow requires that mutation gate. The generated `tracks.md` update and execution-start bookkeeping are deterministic consequences of the same authorization: preview/apply and commit them without another human approval when unchanged. Stop for clarification if the preview exposes a material choice or consequence not covered by the approved plan and invocation. 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 an execution or when no mutation response is available, then use its `transitionGuidance` to construct legal transitions with the required evidence. After a successful execution mutation, use its returned `derivedStatus` instead of making a redundant status call. Every preview exposes the apply-ready digest as `proposalDigest`; pass that value unchanged instead of guessing field names.
53
+
54
+ Use `execution_nodes_preview` and `execution_nodes_apply` when one already-approved scheduling or bookkeeping decision produces multiple immediately valid transitions. Never batch across a human approval, commit, verification, integration, conflict resolution, or other external action whose evidence does not exist at preview time. Once that evidence exists, batch the consecutive journal transitions it unlocks: for example, record verified/authorized task progress through `committed` in one batch after the commit exists, record `integrated` through `completed` after merge evidence exists, and complete a cleaned phase while starting already-ready dependents in one batch. Preview validates a constructed transition; it is never a trial request used to discover the state machine. Plan display order breaks 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` and `worktree_create_apply`; the MCP derives a task's phase from its `T<phase>.<task>` node ID, so omit redundant `phaseId`. Record the returned absolute path/branch through an execution-node batch before spawning. In `phase` and `autonomous`, these deterministic worktree and journal mutations run under the implementation authorization without another approval. In `governed`, present them when the current workflow requires an explicit mutation 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.
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.
72
86
  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.
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. Call `execution_finish_preview` after the approved track-level verification. Its completed journal, `ready_for_review` transition, and derived `tracks.md` update share one digest and apply together; do not call `tracks_render_preview` as a repair step. Validation and the single `cadre(implement): ready <track-id>` checkpoint are deterministic consequences of that approval, so complete them without another prompt when unchanged.
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 and apply `tracks.md` through `tracks_render_preview` and `tracks_render_apply` with its unchanged 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. 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
@@ -22,7 +24,7 @@ Expected human decision count is one per review cycle when the human accepts the
22
24
  1. Determine the commit range from the plan's recorded task commits. Inspect diffs and affected callers, tests, security boundaries, error paths, compatibility, acceptance criteria, and non-functional requirements.
23
25
  2. Run relevant verification without mutating production behavior. Report findings by severity with file/line evidence, impact, reproduction, and proposed acceptance criteria. Do not write a bug file yet.
24
26
  3. Prepare one decision-ready proposal before asking for approval:
25
- - If findings exist, call `template_get_many` for `track/bug`, retain the versioned result, and draft the exact bug artifact plus the recommended dependency-aware remediation phases for all actionable findings. Every regular task declares same-phase dependencies, every added phase declares the phases it consumes and ends in the derived `User Manual Verification` barrier. Renumber the final phase/tasks as needed, reset that final manual barrier and phase completion to pending, and preserve its prior verification provenance in the review cycle/execution journal rather than leaving a second final phase. Call `execution_graph_validate` on the draft.
27
+ - If findings exist, call `template_get_many` for `track/bug`, retain the versioned result, and draft the exact bug artifact plus the recommended dependency-aware remediation phases for all actionable findings. Every regular task declares same-phase dependencies, every added phase declares the phases it consumes and ends in the derived `User Manual Verification` barrier. Renumber the final phase/tasks as needed, reset that final manual barrier and phase completion to pending, and preserve its prior verification provenance in the review cycle/execution journal rather than leaving a second final phase. Call `execution_graph_validate_draft` with the complete proposed plan Markdown and target status `in_progress`; do not validate the stale canonical plan or create a temporary project copy.
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.
@@ -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
- 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, restore derived manual-verification barriers, and call `execution_graph_validate`. 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.
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.
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 and apply `tracks.md` through `tracks_render_preview` and `tracks_render_apply` using its unchanged digest 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`; resolve every unknown reference, cycle, missing declaration, or material ambiguity before approval.
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