cclaw-cli 0.51.22 → 0.51.24

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.
@@ -7,6 +7,8 @@ import { conversationLanguagePolicyMarkdown } from "./language-policy.js";
7
7
  */
8
8
  const SUBAGENT_AGENT_NAMES = [
9
9
  "planner",
10
+ "product-manager",
11
+ "critic",
10
12
  "reviewer",
11
13
  "security-reviewer",
12
14
  "test-author",
@@ -83,16 +85,26 @@ can enforce phase-appropriate write boundaries. Use separate workers only when t
83
85
  |---|---|---|---|---|
84
86
  | Claude | \`native\` | Task (named subagent_type) | AskUserQuestion | \`npx cclaw-cli doctor\` |
85
87
  | Cursor | \`generic-dispatch\` | Task (generic subagent_type: explore/generalPurpose/…) | AskQuestion | \`npx cclaw-cli doctor\` |
86
- | OpenCode | \`role-switch\` | plugin dispatch _or_ in-session role-switch | \`question\` (permission-gated; \`permission.question: "allow"\`) | \`npx cclaw-cli doctor\` |
87
- | Codex | \`role-switch\` | in-session role-switch (mandatory evidenceRefs) | \`request_user_input\` (experimental; Plan / Collaboration mode) | \`npx cclaw-cli doctor\` |
88
+ | OpenCode | \`native\` | generated \`.opencode/agents/<agent>.md\` subagents via Task / \`@agent\` mention | \`question\` (permission-gated; \`permission.question: "allow"\`) | \`npx cclaw-cli doctor\` |
89
+ | Codex | \`native\` | generated \`.codex/agents/<agent>.toml\` custom agents via native parallel subagent spawning | \`request_user_input\` (experimental; Plan / Collaboration mode) | \`npx cclaw-cli doctor\` |
88
90
 
89
91
  **Dispatch rules driven by \`subagentFallback\`:**
90
92
 
91
93
  - \`native\` — use the harness's own named subagent primitive; delegation entry uses \`fulfillmentMode: "isolated"\`.
92
94
  - \`generic-dispatch\` — map each cclaw agent onto the generic dispatcher with a role prompt; delegation entry uses \`fulfillmentMode: "generic-dispatch"\`.
93
- - \`role-switch\` — announce the role in-session, perform the work, append a delegation row with \`fulfillmentMode: "role-switch"\` and ≥1 \`evidenceRef\`. Without evidenceRefs the \`delegation:mandatory:current_stage\` check reports \`missingEvidence\` and blocks stage completion.
95
+ - \`role-switch\` — degraded fallback only when the active runtime cannot expose its declared dispatch surface. Announce the role in-session, perform the work, append a delegation row with \`fulfillmentMode: "role-switch"\` and ≥1 \`evidenceRef\`. Without evidenceRefs the \`delegation:mandatory:current_stage\` check reports \`missingEvidence\` and blocks stage completion.
94
96
 
95
- The only time a \`harness_limitation\` waiver fires automatically is when every installed harness declares \`subagentFallback: "waiver"\`. cclaw 0.33 no longer maps Codex onto auto-waiver — the agent must role-switch with evidence.
97
+ ### Native dispatch contract
98
+
99
+ Use real harness subagents for OpenCode and Codex:
100
+
101
+ 1. OpenCode: invoke the generated \`.opencode/agents/<agent>.md\` subagent via Task or \`@<agent>\`. Built-in \`general\` / \`explore\` remain fallback subagent types for ad hoc tasks, but cclaw's core roles are generated by name.
102
+ 2. Codex: ask Codex to spawn the generated \`.codex/agents/<agent>.toml\` custom agent(s) by name; for review-style independent lanes, request parallel spawning and wait for all results before reconciliation.
103
+ 3. Claude: use the native named Task subagent. Cursor: map the cclaw role onto the generic Task/Subagent surface with a self-contained prompt.
104
+ 4. Produce stage output in the current artifact, with anchors suitable for \`evidenceRefs\`.
105
+ 5. Append delegation ledger rows with \`stage\`, \`agent\`, \`mode\`, \`status: "completed"\`, and \`fulfillmentMode\` matching the dispatch mode (\`"isolated"\` for Claude/OpenCode/Codex, \`"generic-dispatch"\` for Cursor).
106
+
107
+ The only time a \`harness_limitation\` waiver fires automatically is when every installed harness declares \`subagentFallback: "waiver"\`. Do not map Codex or OpenCode onto auto-waiver or default role-switch; they have true subagent surfaces.
96
108
 
97
109
  ### Model routing
98
110
 
@@ -120,9 +132,9 @@ Concrete per-stage rules so the controller does not have to guess which tier fit
120
132
 
121
133
  | Stage | Deep slot | Balanced slot(s) | Fast fan-out | Trigger to escalate |
122
134
  |---|---|---|---|---|
123
- | brainstorm | planner (only if ambiguity spans >1 module) | | run in-thread research playbooks | promote to \`balanced\` reviewer once direction locks |
124
- | scope | planner (always) | | run \`research/git-history.md\` in-thread when churn is high | promote to \`balanced\` planner if scope touches external contracts |
125
- | design | planner (always) | security-reviewer (if trust boundary touched) | run \`research/framework-docs-lookup.md\` + \`research/best-practices-lookup.md\` in-thread | escalate one specialist to \`deep\` only if a failure mode is Critical-severity |
135
+ | brainstorm | planner (only if ambiguity spans >1 module) | product-manager / critic when product value or premise is uncertain | run in-thread research playbooks | promote to \`balanced\` critic if the do-nothing path may beat the idea |
136
+ | scope | planner (always) | product-manager / critic when mode changes user value or boundaries are soft | run \`research/git-history.md\` in-thread when churn is high | promote to \`balanced\` critic if scope mode is disputed |
137
+ | design | planner (always) | critic, security-reviewer, test-author when alternatives/trust/testability apply | run \`research/framework-docs-lookup.md\` + \`research/best-practices-lookup.md\` in-thread | escalate one specialist to \`deep\` only if a failure mode is Critical-severity |
126
138
  | spec | — | reviewer (if spec > 200 lines or multiple ACs) | — | escalate to \`deep\` only for spec ↔ design contradictions |
127
139
  | plan | planner (solo, always) | — | — | never fan out at plan stage; one owner for dependency graph |
128
140
  | tdd | — | ${formatAgentList(stageSummary("tdd").primaryAgents)} (per slice, carrying RED/GREEN/REFACTOR evidence) · reviewer (slice-local only when sliceReview triggers) | doc-updater (API surface changes) | escalate to \`deep\` only when a RED test cannot be expressed (design leak) |
@@ -591,6 +603,56 @@ Output format (mandatory):
591
603
  - Close with RISK_SUMMARY and SHIP_BLOCKERS (explicit list, possibly empty).
592
604
  \`\`\`
593
605
 
606
+ `;
607
+ }
608
+ function productManagerEnhancedBody() {
609
+ return `
610
+
611
+ ## Task Tool Delegation
612
+
613
+ Use this payload when product discovery needs an isolated lens:
614
+
615
+ \`\`\`
616
+ You are a product-manager subagent.
617
+
618
+ DISCOVERY GOAL: {problem/value decision to clarify}
619
+ CONTEXT: {existing artifact excerpts, user segment, constraints}
620
+ DEPTH: {lite|standard|deep}
621
+
622
+ Required output:
623
+ - PERSONA_JTBD: persona, job, pain/trigger
624
+ - VALUE_HYPOTHESIS: expected value and success metric
625
+ - EVIDENCE_SIGNAL: strongest evidence, weakest assumption
626
+ - WHY_NOW_AND_DO_NOTHING: why now plus consequence of no action
627
+ - NON_GOALS: explicit exclusions
628
+ - SCOPE_HANDOFF: one recommendation for hold/selective/expand/reduce
629
+ \`\`\`
630
+
631
+ `;
632
+ }
633
+ function criticEnhancedBody() {
634
+ return `
635
+
636
+ ## Task Tool Delegation
637
+
638
+ Use this payload when a premise, scope mode, or engineering path needs adversarial pressure:
639
+
640
+ \`\`\`
641
+ You are a critic subagent.
642
+
643
+ DECISION_UNDER_REVIEW: {direction/scope/design choice}
644
+ CONTEXT: {artifact excerpts, constraints, known risks}
645
+ DEPTH: {lite|standard|deep}
646
+
647
+ Required output:
648
+ - PREMISE_ATTACK: what could make this decision wrong
649
+ - CHEAPER_ALTERNATIVE: smaller or more reversible option
650
+ - SHADOW_ALTERNATIVE: viable competing path
651
+ - SWITCH_TRIGGER: signal that should change the decision
652
+ - FAILURE_RESCUE: likely failure and rescue/degraded behavior
653
+ - VERIFICATION_EVIDENCE: evidence needed before locking
654
+ \`\`\`
655
+
594
656
  `;
595
657
  }
596
658
  function reviewerEnhancedBody() {
@@ -679,6 +741,10 @@ export function enhancedAgentBody(agentName) {
679
741
  switch (agentName) {
680
742
  case "planner":
681
743
  return plannerEnhancedBody();
744
+ case "product-manager":
745
+ return productManagerEnhancedBody();
746
+ case "critic":
747
+ return criticEnhancedBody();
682
748
  case "reviewer":
683
749
  return reviewerEnhancedBody();
684
750
  case "security-reviewer":
@@ -29,10 +29,28 @@ export const ARTIFACT_TEMPLATES = {
29
29
  ### Discovered context
30
30
  - (paths, prior artifacts, seeds, prompt fragments — referenced by downstream stages, or \`- None.\`)
31
31
 
32
- ## Problem
33
- - **What we're solving:**
34
- - **Success criteria:**
35
- - **Constraints:**
32
+ ## Problem Decision Record
33
+ - **Depth:** lite | standard | deep
34
+ - **Frame type:** product | technical-maintenance
35
+
36
+ ### Product framing (use when applicable)
37
+ - **Persona / user:**
38
+ - **Job to be done:**
39
+ - **Pain / trigger:**
40
+ - **Value hypothesis:**
41
+ - **Evidence / signal:**
42
+ - **Success metric:**
43
+ - **Why now:**
44
+ - **Do-nothing consequence:**
45
+ - **Non-goals:**
46
+
47
+ ### Technical-maintenance framing (use when product framing is not applicable)
48
+ - **Affected operator/developer:**
49
+ - **Current failure mode:**
50
+ - **Expected operational improvement:**
51
+ - **Verification signal:**
52
+ - **Do-nothing cost:**
53
+ - **Non-goals:**
36
54
 
37
55
  ## Premise Check
38
56
  - **Right problem?** (yes/no + one-line justification — take a position)
@@ -43,11 +61,10 @@ export const ARTIFACT_TEMPLATES = {
43
61
  - *How might we …?* — one line naming the user, the desired outcome, and the binding constraint.
44
62
 
45
63
  ## Sharpening Questions
64
+ > Ask one decision-changing question at a time. For concrete early exits, record \`None - early exit\` with rationale.
46
65
  | # | Question | Answer / Assumption | Decision impact |
47
66
  |---|---|---|---|
48
67
  | 1 | | | |
49
- | 2 | | | |
50
- | 3 | | | |
51
68
 
52
69
  ## Clarifying Questions
53
70
  | # | Question | Answer | Decision impact |
@@ -55,7 +72,7 @@ export const ARTIFACT_TEMPLATES = {
55
72
  | 1 | | | |
56
73
 
57
74
  ## Approach Tier
58
- - Tier: Lightweight | Standard | Deep
75
+ - Tier: lite | standard | deep
59
76
  - Why this tier:
60
77
 
61
78
  ## Short-Circuit Decision
@@ -80,7 +97,7 @@ export const ARTIFACT_TEMPLATES = {
80
97
  - **Approach:**
81
98
  - **Rationale:** Trace this to the prior Approach Reaction.
82
99
  - **Approval:** pending
83
- - **Next-stage handoff:** On standard track, hand this to \`scope\`; on medium track, hand this directly to \`spec\` with explicit requirements/constraints.
100
+ - **Next-stage handoff:** On standard track, hand this to \`scope\`; on medium track, hand this directly to \`spec\`. Include upstream decisions used, drift, confidence, unresolved questions, risk hints, and non-goals.
84
101
 
85
102
  ## Not Doing
86
103
  - (3-5 things this brainstorm is *not* committing to — distinct from \`Deferred\`. These will not appear in scope unless the user explicitly opts in.)
@@ -165,8 +182,21 @@ ${SEED_SHELF_SECTION}
165
182
  | HOUR 4-5 (integration) | | | |
166
183
  | HOUR 6+ (polish/tests) | | | |
167
184
 
185
+ ## Scope Contract
186
+ - **Selected mode:** HOLD SCOPE | SELECTIVE EXPANSION | SCOPE EXPANSION | SCOPE REDUCTION
187
+ - **In scope:**
188
+ - **Out of scope:**
189
+ - **Requirements:**
190
+ - **Locked decisions:**
191
+ - **Discretion areas:**
192
+ - **Deferred ideas:**
193
+ - **Accepted reference ideas:**
194
+ - **Rejected reference ideas:**
195
+ - **Success definition:**
196
+ - **Design handoff:**
197
+
168
198
  ## Scope Mode
169
- - [ ] SCOPE EXPANSION — dream bigger; user explicitly opts into the larger product slice.
199
+ - [ ] SCOPE EXPANSION — explore ambitious alternatives; user explicitly opts into the larger product slice.
170
200
  - [ ] SELECTIVE EXPANSION — hold baseline scope and cherry-pick one high-leverage addition.
171
201
  - [ ] HOLD SCOPE — preserve the approved brainstorm direction with maximum rigor.
172
202
  - [ ] SCOPE REDUCTION — strip to the smallest useful wedge when risk/blast radius is too high.
@@ -174,9 +204,24 @@ ${SEED_SHELF_SECTION}
174
204
  ## Mode-Specific Analysis
175
205
  | Selected mode | Rationale | Depth |
176
206
  |---|---|---|
177
- | | | default / deep |
207
+ | | | lite / standard / deep |
208
+
209
+ > Default path: one selected-mode row plus rationale. Deep/high-risk scope may expand with optional evidence headings below.
210
+
211
+ ## Landscape Check
212
+ - Optional for EXPAND/SELECTIVE/deep; omit for compact HOLD SCOPE.
213
+
214
+ ## Taste Calibration
215
+ - Optional quality-bar references from in-repo modules/files.
178
216
 
179
- > Default path: one selected-mode row plus rationale. Deep/high-risk scope may expand below with mode-specific analysis.
217
+ ## Reference Pull
218
+ - Optional evidence from \`/Users/zuevrs/Downloads/references\`; list accepted/rejected ideas or \`Not needed - compact scope\`.
219
+
220
+ ## Ambitious Alternatives
221
+ - Optional for SCOPE EXPANSION/SELECTIVE; list larger alternatives and disposition.
222
+
223
+ ## Ruthless Minimum Slice
224
+ - Optional for SCOPE REDUCTION/high-risk scope; define the smallest useful wedge.
180
225
 
181
226
  ## Requirements (stable IDs)
182
227
  | ID | Requirement (observable outcome) | Priority | Source (origin doc / prompt line) |
@@ -241,6 +286,9 @@ ${SEED_SHELF_SECTION}
241
286
 
242
287
  ## Scope Summary
243
288
  - Selected mode: (one of \`SCOPE EXPANSION\` | \`SELECTIVE EXPANSION\` | \`HOLD SCOPE\` | \`SCOPE REDUCTION\`)
289
+ - Confidence: high | medium | low
290
+ - Drift from brainstorm: None / <specific drift>
291
+ - Unresolved questions: None / <questions>
244
292
  - Strongest challenges resolved:
245
293
  - Recommended path:
246
294
  - Accepted scope:
@@ -291,7 +339,7 @@ ${SEED_SHELF_SECTION}
291
339
 
292
340
  ## Compact-First Scaffold
293
341
  - Default to the compact design spine unless risk requires Standard/Deep add-ons.
294
- - Compact required spine: Codebase Investigation, Architecture Boundaries, Architecture Diagram, Data Flow, Failure Mode Table, Test Strategy, and Completion Dashboard.
342
+ - Compact required spine: Upstream Handoff, Codebase Investigation, Engineering Lock, Architecture Boundaries, Architecture Diagram, Data Flow, Failure Mode Table, Test Strategy, Spec Handoff, and Completion Dashboard.
295
343
  - Mark optional Standard/Deep sections as \`Omitted - compact design\` when they do not apply; do not expand the scaffold just to fill empty tables.
296
344
 
297
345
  ## Upstream Handoff
@@ -302,9 +350,14 @@ ${SEED_SHELF_SECTION}
302
350
  - Drift from upstream (or \`None\`):
303
351
 
304
352
  ## Codebase Investigation
305
- | File | Current responsibility | Patterns discovered |
306
- |---|---|---|
307
- | | | |
353
+ | File | Current responsibility | Patterns discovered | Existing fit / reuse candidate |
354
+ |---|---|---|---|
355
+ | | | | |
356
+
357
+ ## Engineering Lock
358
+ | Decision area | Chosen path | Shadow alternative | Switch trigger | Failure/rescue/degraded behavior | Verification evidence | Confidence |
359
+ |---|---|---|---|---|---|---|
360
+ | | | | | | | |
308
361
 
309
362
  ## Search Before Building
310
363
  | Layer | Label | What to reuse first |
@@ -336,9 +389,9 @@ ${MARKDOWN_CODE_FENCE}
336
389
  ## Data-Flow Shadow Paths
337
390
  - Standard/Deep add-on; omit when compact design does not need a shadow path.
338
391
  <!-- diagram: data-flow-shadow-paths -->
339
- | Path | Trigger | Fallback/Degrade behavior |
340
- |---|---|---|
341
- | | | |
392
+ | Chosen path | Shadow alternative | Switch trigger | Failure/rescue/degraded behavior | Verification evidence |
393
+ |---|---|---|---|---|
394
+ | | | | | |
342
395
 
343
396
  ## Error Flow Diagram
344
397
  - Standard/Deep add-on; omit when the Failure Mode Table is sufficient.
@@ -387,6 +440,8 @@ ${MARKDOWN_CODE_FENCE}
387
440
  | | | | |
388
441
 
389
442
  ## Data Flow
443
+ - Data/state flow:
444
+ - Critical path:
390
445
  - Happy path:
391
446
  - Nil/empty input path:
392
447
  - Upstream error path:
@@ -431,6 +486,23 @@ ${MARKDOWN_CODE_FENCE}
431
486
  |---|---|---|
432
487
  | | | |
433
488
 
489
+ ## Rejected Alternatives
490
+ | Alternative | Why rejected | Revival signal |
491
+ |---|---|---|
492
+ | | | |
493
+
494
+ ## Design Decisions
495
+ | Decision Ref | Requirement / LD refs | Decision | Spec impact |
496
+ |---|---|---|---|
497
+ | DD-1 | | | |
498
+
499
+ ## Spec Handoff
500
+ - Requirements to carry forward:
501
+ - Design decisions to encode:
502
+ - Risks and rescue paths:
503
+ - Test/performance expectations:
504
+ - Unresolved questions (or \`None\`):
505
+
434
506
  ## Outside Voice Findings
435
507
  | ID | Dimension | Finding | Disposition | Rationale |
436
508
  |---|---|---|---|---|
@@ -645,7 +717,7 @@ Execution rule: complete and verify each batch before starting the next batch.
645
717
  # TDD Artifact
646
718
 
647
719
  ## Upstream Handoff
648
- - Source artifacts: \`04-spec.md\`; \`05-plan.md\` when present. Quick track uses spec acceptance items / bug reproduction slices instead of nonexistent plan tasks.
720
+ - Source artifacts: \`04-spec.md\` plus the active track's upstream source item (plan slice on standard/medium, spec acceptance item or bug reproduction slice on quick).
649
721
  - Decisions carried forward:
650
722
  - Constraints carried forward:
651
723
  - Open questions:
@@ -672,11 +744,11 @@ Execution rule: complete and verify each batch before starting the next batch.
672
744
  | S-1 | | | |
673
745
 
674
746
  ## Acceptance Mapping
675
- | Slice | Plan task ID or quick source | Spec criterion ID |
747
+ | Slice | Source item ID | Spec criterion ID |
676
748
  |---|---|---|
677
- | S-1 | T-1 / QS-1 | AC-1 |
749
+ | S-1 | SRC-1 | AC-1 |
678
750
 
679
- > On quick track, map to the \`Quick Reproduction Contract\` bug slice or spec acceptance item. Do not invent a plan task just to satisfy this table.
751
+ > Map each slice to the active track's source item: plan slice on standard/medium, or the \`Quick Reproduction Contract\` bug slice / spec acceptance item on quick.
680
752
 
681
753
  ## Failure Analysis
682
754
  | Slice | Expected missing behavior | Actual failure reason |
@@ -693,7 +765,7 @@ Execution rule: complete and verify each batch before starting the next batch.
693
765
  - Behavior preserved:
694
766
 
695
767
  ## Traceability
696
- - Plan task IDs:
768
+ - Source item IDs:
697
769
  - Spec criterion IDs:
698
770
 
699
771
 
@@ -729,22 +801,46 @@ Execution rule: complete and verify each batch before starting the next batch.
729
801
  # Review Artifact
730
802
 
731
803
  ## Upstream Handoff
732
- - Source artifacts: \`04-spec.md\`, \`06-tdd.md\`; \`05-plan.md\` only when present. Quick track reviews spec acceptance items / bug reproduction slices without requiring plan-task coverage.
804
+ - Source artifacts: \`04-spec.md\`, \`06-tdd.md\`, plus the active track's upstream source item when available.
733
805
  - Decisions carried forward:
734
806
  - Constraints carried forward:
735
807
  - Open questions:
736
808
  - Drift from upstream (or \`None\`):
737
809
 
810
+ ## Review Evidence Scope
811
+ - Base/head:
812
+ - Files inspected:
813
+ - Changed-file coverage summary:
814
+ - Diagnostics run:
815
+ - Omitted files with explicit reason:
816
+ - Reviewer delegation evidence:
817
+ - Security-reviewer delegation evidence:
818
+
819
+ ## Changed-File Coverage
820
+ | File | Coverage status | Evidence / no-impact reason |
821
+ |---|---|---|
822
+ | | inspected / broader-module / omitted-no-impact | |
823
+
738
824
  ## Layer 1 Verdict
739
825
  | Criterion | Verdict | Evidence |
740
826
  |---|---|---|
741
827
  | AC-1 | PASS/FAIL | |
742
828
 
743
829
  ## Layer 2 Findings
744
- | ID | Severity | Category | Description | Status |
745
- |---|---|---|---|---|
746
- | R-1 | Critical/Important/Suggestion | correctness/security/performance/architecture/external-safety | | open/resolved |
747
- - NO_CHANGE_ATTESTATION: <required when Category=security has no entries; explain why no security-relevant changes were detected>
830
+ | ID | Severity | Category | File:line / no-line reason | Description | Status |
831
+ |---|---|---|---|---|---|
832
+ | R-1 | Critical/Important/Suggestion | correctness/security/performance/architecture/external-safety | path:line | | open/resolved |
833
+ - NO_FINDINGS_ATTESTATION: <required when no findings are reported; cite inspected coverage>
834
+
835
+ ## Security Sweep Attestation
836
+ - Result: findings | NO_CHANGE_ATTESTATION | NO_SECURITY_IMPACT
837
+ - Inspected surfaces:
838
+ - Rationale:
839
+
840
+ ## Dependency & Version Audit
841
+ - Relevant: yes/no
842
+ - Manifests/lockfiles/generated clients/CI/runtime config/external APIs inspected:
843
+ - Result / no-impact rationale:
748
844
 
749
845
  ## Incoming Feedback Queue
750
846
  | ID | Source | Severity | File:line | Request | Status | Evidence |
@@ -766,15 +862,15 @@ Execution rule: complete and verify each batch before starting the next batch.
766
862
 
767
863
  ## Completeness Snapshot
768
864
  - AC coverage: <N>/<M> (<percent>%)
769
- - Task coverage (tasks backed by ≥1 test slice): <N>/<M> or \`N/A - quick track has no plan artifact\`
865
+ - Source item coverage (source items backed by ≥1 test slice): <N>/<M> or \`N/A - direct spec/reproduction coverage\`
770
866
  - Slice coverage (slices linked to ≥1 AC or bug reproduction slice): <N>/<M>
771
867
  - Adversarial review: not triggered | pass | fail
772
868
  - Overall: complete | concerns | blocked
773
869
 
774
870
  ## Trace Matrix Check
775
- - Command: \`cclaw internal trace-matrix\` when plan artifacts exist or the active track enforces it; quick track may record direct AC/reproduction-slice coverage instead.
871
+ - Command: \`cclaw internal trace-matrix\` when the active track enforces it; otherwise record direct AC/reproduction-slice coverage.
776
872
  - Orphaned criteria: 0
777
- - Orphaned tasks: 0 or \`N/A - quick track\`
873
+ - Orphaned source items: 0 or \`N/A - direct spec/reproduction coverage\`
778
874
  - Orphaned tests: 0
779
875
  - Evidence ref:
780
876
 
@@ -34,8 +34,15 @@ export function renderTrackTerminology(value, context) {
34
34
  }
35
35
  return value
36
36
  .replace(/\btask from the plan\b/giu, `${context.traceabilitySourceNoun} from the spec`)
37
+ .replace(/\bplan confirmation\b/giu, "spec approval")
38
+ .replace(/\bplan approval\b/giu, "spec approval")
39
+ .replace(/\bapproved plan slice\b/giu, `approved ${context.traceabilitySliceNoun}`)
40
+ .replace(/\bplanned slice\b/giu, context.traceabilitySliceNoun)
37
41
  .replace(/\bplan task ID\b/giu, context.traceabilityIdNoun)
38
42
  .replace(/\bplan task\b/giu, context.traceabilitySourceNoun)
43
+ .replace(/\bplan-task\b/giu, "acceptance-criterion")
44
+ .replace(/\btask coverage\b/giu, "source item coverage")
45
+ .replace(/\borphaned tasks\b/giu, "orphaned source items")
39
46
  .replace(/\bplan row\b/giu, "acceptance row")
40
47
  .replace(/\btraceable to plan slice\b/giu, `traceable to ${context.traceabilitySliceNoun}`)
41
48
  .replace(/\bplan slice\b/giu, context.traceabilitySliceNoun)
@@ -6,8 +6,8 @@ export type DelegationStatus = "scheduled" | "completed" | "failed" | "waived";
6
6
  * How a delegation was actually fulfilled. Advisory — mirrors the harness
7
7
  * `subagentFallback` that was in effect when the entry was recorded.
8
8
  *
9
- * - `isolated` — Claude-style isolated subagent worker.
10
- * - `generic-dispatch` — Cursor-style Task dispatch mapped to a named role.
9
+ * - `isolated` — native isolated subagent worker (Claude/OpenCode/Codex).
10
+ * - `generic-dispatch` — generic Task/Subagent dispatch mapped to a named role.
11
11
  * - `role-switch` — performed in-session with explicit role announce.
12
12
  * - `harness-waiver` — auto-waived due to missing dispatch capability.
13
13
  */
@@ -18,6 +18,13 @@ function delegationLockPath(projectRoot) {
18
18
  function createSpanId() {
19
19
  return `dspan-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
20
20
  }
21
+ function activeHarnessSubagentFallback() {
22
+ const activeHarness = process.env.CCLAW_ACTIVE_HARNESS;
23
+ if (!activeHarness)
24
+ return undefined;
25
+ return HARNESS_ADAPTERS[activeHarness]
26
+ ?.capabilities.subagentFallback;
27
+ }
21
28
  async function resolveReviewDiffBase(projectRoot) {
22
29
  let head = "";
23
30
  try {
@@ -229,10 +236,7 @@ export async function appendDelegation(projectRoot, entry) {
229
236
  stamped.evidenceRefs = [];
230
237
  }
231
238
  if (stamped.status === "completed" && stamped.fulfillmentMode === undefined) {
232
- const activeFallback = process.env.CCLAW_ACTIVE_HARNESS
233
- ? HARNESS_ADAPTERS[process.env.CCLAW_ACTIVE_HARNESS]
234
- ?.capabilities.subagentFallback
235
- : undefined;
239
+ const activeFallback = activeHarnessSubagentFallback();
236
240
  if (activeFallback) {
237
241
  stamped.fulfillmentMode = expectedFulfillmentMode([activeFallback]);
238
242
  }
@@ -291,8 +295,9 @@ export async function checkMandatoryDelegations(projectRoot, stage, options = {}
291
295
  const missingEvidence = [];
292
296
  const config = await readConfig(projectRoot).catch(() => null);
293
297
  const harnesses = config?.harnesses ?? [];
294
- const fallbacks = harnesses.map((h) => HARNESS_ADAPTERS[h].capabilities.subagentFallback);
295
- const expectedMode = expectedFulfillmentMode(fallbacks);
298
+ const configuredFallbacks = harnesses.map((h) => HARNESS_ADAPTERS[h].capabilities.subagentFallback);
299
+ const activeFallback = activeHarnessSubagentFallback();
300
+ const expectedMode = expectedFulfillmentMode(activeFallback ? [activeFallback] : configuredFallbacks);
296
301
  for (const agent of mandatory) {
297
302
  const rows = forRun.filter((e) => e.agent === agent);
298
303
  const completedRows = rows.filter((e) => e.status === "completed");
@@ -307,9 +312,11 @@ export async function checkMandatoryDelegations(projectRoot, stage, options = {}
307
312
  if (hasWaived) {
308
313
  waived.push(agent);
309
314
  }
310
- // Evidence is required for any non-isolated completion mode. Legacy rows
311
- // without fulfillmentMode are inferred to `isolated` during parse.
312
- const evidenceRequired = completedRows.some((e) => (e.fulfillmentMode ?? "isolated") !== "isolated");
315
+ // Evidence is required for non-isolated completions and for explicit
316
+ // degraded role-switch rows. Native OpenCode/Codex/Claude isolated
317
+ // dispatch is accepted as true subagent work; role-switch remains a
318
+ // fallback that must point at artifact evidence.
319
+ const evidenceRequired = expectedMode !== "isolated" || completedRows.some((e) => (e.fulfillmentMode ?? "isolated") !== "isolated");
313
320
  if (hasCompleted &&
314
321
  evidenceRequired &&
315
322
  !completedRows.some((e) => Array.isArray(e.evidenceRefs) && e.evidenceRefs.length > 0)) {
@@ -39,7 +39,7 @@ const RULES = [
39
39
  }
40
40
  },
41
41
  {
42
- test: /^(dir:|command:|utility_command:|skill:|utility_skill:|agent:|harness_tool_ref:|harness_ref:|stage_examples_ref:|doctor_ref:)/,
42
+ test: /^(dir:|command:|utility_command:|stage_command:|skill:|utility_skill:|agent:|harness_tool_ref:|harness_ref:|stage_examples_ref:|doctor_ref:)/,
43
43
  metadata: {
44
44
  severity: "error",
45
45
  summary: "Generated runtime surface presence check.",