@hanzlaa/rcode 4.10.6 → 4.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +1 -1
  3. package/CONTRIBUTING.md +5 -0
  4. package/cli/install.js +160 -0
  5. package/dist/rcode.js +254 -234
  6. package/package.json +1 -1
  7. package/rcode/agents/rcode-planner.md +1 -0
  8. package/rcode/agents/rcode-project-researcher.md +2 -1
  9. package/rcode/agents/rcode-roadmapper.md +1 -0
  10. package/rcode/agents/rcode-sprint-checker.md +1 -0
  11. package/rcode/agents/rcode-ux-designer.md +2 -0
  12. package/rcode/agents/rcode-verifier.md +2 -2
  13. package/rcode/agents/rules/planner/common-patterns.md +2 -1
  14. package/rcode/agents/rules/planner/goal-backward-thinking.md +33 -0
  15. package/rcode/agents/rules/planner/sprint-verification.md +1 -0
  16. package/rcode/agents/rules/planner/task-templates.md +20 -1
  17. package/rcode/agents/rules/project-researcher/detailed-guide.md +10 -0
  18. package/rcode/agents/rules/sprint-checker/dimensions.md +129 -0
  19. package/rcode/agents/rules/sprint-checker/process.md +12 -0
  20. package/rcode/agents/rules/verifier/behavioral-spot-checks.md +5 -1
  21. package/rcode/agents/rules/verifier/gap-output.md +5 -0
  22. package/rcode/agents/rules/verifier/reachability-check.md +69 -0
  23. package/rcode/bin/rcode-tools.cjs +91 -8
  24. package/rcode/commands/ui-phase.md +1 -1
  25. package/rcode/references/design-library/LICENSE +21 -0
  26. package/rcode/references/design-library/README.md +37 -0
  27. package/rcode/references/design-library/charts.csv +26 -0
  28. package/rcode/references/design-library/colors.csv +97 -0
  29. package/rcode/references/design-library/icons.csv +101 -0
  30. package/rcode/references/design-library/styles.csv +68 -0
  31. package/rcode/references/design-library/typography.csv +58 -0
  32. package/rcode/references/design-library/ui-reasoning.csv +101 -0
  33. package/rcode/references/design-library/ux-guidelines.csv +100 -0
  34. package/rcode/references/design-library/web-interface.csv +31 -0
  35. package/rcode/references/domain-probes.md +8 -0
  36. package/rcode/references/project-types.yaml +29 -0
  37. package/rcode/references/questioning.md +3 -0
  38. package/rcode/references/roadmapper-playbook.md +90 -0
  39. package/rcode/references/source-of-truth-grounding.md +80 -0
  40. package/rcode/references/sprint-checker-playbook.md +14 -0
  41. package/rcode/references/verifier-playbook.md +20 -7
  42. package/rcode/skills/actions/2-plan/rcode-create-epics-and-stories/workflow.md +1 -1
  43. package/rcode/skills/actions/2-plan/rcode-create-prd/workflow.md +9 -1
  44. package/rcode/workflows/autonomous.md +78 -16
  45. package/rcode/workflows/complete-milestone.md +1 -1
  46. package/rcode/workflows/council.md +51 -6
  47. package/rcode/workflows/discuss-phase.md +10 -2
  48. package/rcode/workflows/execute-sprint.md +35 -7
  49. package/rcode/workflows/execute-waves.md +2 -2
  50. package/rcode/workflows/execute.md +21 -6
  51. package/rcode/workflows/help.md +1 -1
  52. package/rcode/workflows/new-milestone.md +5 -1
  53. package/rcode/workflows/new-project-research.md +22 -0
  54. package/rcode/workflows/new-project-roadmap.md +19 -0
  55. package/rcode/workflows/plan-research-validation.md +1 -1
  56. package/rcode/workflows/plan.md +49 -3
  57. package/rcode/workflows/ship.md +22 -0
  58. package/rcode/workflows/ui-phase.md +187 -23
  59. package/rcode/workflows/ui-review.md +9 -1
  60. package/rcode/workflows/verify-work.md +1 -1
  61. package/server/lib/scanner.js +25 -4
@@ -0,0 +1,80 @@
1
+ # Source-of-Truth Grounding
2
+
3
+ Loaded by any workflow/agent that generates domain terminology, schema fields,
4
+ enum values, or seed data — discuss-phase, roadmapper, project-researcher,
5
+ planner, sprint-checker.
6
+
7
+ ## The failure this prevents
8
+
9
+ A real incident: a competency-tracking app's requirements referenced an
10
+ authoritative Excel file (the actual HR competency matrix) and a meeting
11
+ transcript explaining it. The planner never opened the Excel — it invented
12
+ plausible-sounding competency names (`TECH`, `DELIV`, `COLLAB`, `GROWTH`,
13
+ `IMPACT`) and level names (`Junior`, `Associate`, `Senior I/II/III`) that
14
+ *sounded* right for a generic engineering-competency system. The real Excel
15
+ defined different names (`Technical Skills`, `Delivery & Quality`,
16
+ `Communication & Collaboration`, `Leadership & Coaching`, `Strategic Impact`,
17
+ `Innovation & Improvement`) and different levels (`Potential`, `Competency`,
18
+ `Proficiency`, `Expertise`, `Mastery`). The invented values got baked into
19
+ the database schema, seed data, and UI labels — an entire app built on
20
+ plausible-sounding fiction instead of the actual source of truth, discovered
21
+ only when the user manually re-fed the same files back in and asked for a
22
+ gap check.
23
+
24
+ This is not a hypothetical edge case. Any project with domain-specific
25
+ terminology defined by an external document (an HR/compliance matrix, a
26
+ partner's API spec, a legal/regulatory definition list, a brand's existing
27
+ design system, a client's glossary) is exposed to this failure the moment a
28
+ planner treats "sounds plausible" as good enough.
29
+
30
+ ## The rule
31
+
32
+ **If a source document exists — the user references it, provides a file
33
+ path, pastes its content, or it's already sitting in the project (`docs/`,
34
+ an attached spreadsheet, a transcript, an existing spec) — and it defines
35
+ domain terminology, categories, enum values, or a data model that the
36
+ current work touches, that document MUST be read in full before generating
37
+ anything that uses those concepts. Extract the actual values verbatim.**
38
+
39
+ - Don't paraphrase a defined term into a shorter or "cleaner" one. If the
40
+ source says `Communication & Collaboration`, the schema/seed/UI say
41
+ `Communication & Collaboration` — not `COLLAB`, not `Comm & Collab`.
42
+ - Don't guess the count or order. If the source defines 6 categories, use
43
+ the 6 it defines — don't invent 5 that seem close enough.
44
+ - Don't treat "I've seen similar systems before" as a substitute for reading
45
+ this one's actual source. Training-data familiarity with how competency
46
+ matrices *usually* look is exactly what produces plausible-but-wrong output.
47
+ - Excel/spreadsheet files: read the actual cell contents (via a script,
48
+ `openpyxl`/`pandas`-equivalent, or unzipping the `.xlsx` and parsing the
49
+ shared-strings XML if no library is available) — not the filename, not an
50
+ assumption about what a file named "Competency Matrix" probably contains.
51
+ - Transcripts/recordings-as-text: read the whole thing, not just the first
52
+ few lines — the real values are often stated once, in the middle, in
53
+ passing ("we have six core competencies, which is technical skills,
54
+ delivery quality, communication, collaboration...").
55
+
56
+ ## Self-check before presenting or committing
57
+
58
+ After generating requirements/schema/seed-data/UI copy that should be
59
+ grounded in a source document, do one pass comparing what you generated
60
+ against the source: does every category/level/field name match verbatim?
61
+ If you can't point to the specific line/cell in the source for a value you
62
+ used, that value is invented — fix it before presenting, not after the user
63
+ catches it.
64
+
65
+ ## Where this applies
66
+
67
+ - **discuss-phase / new-project**: when a source document is mentioned or
68
+ present, read it during context-gathering, before requirements get
69
+ drafted — not after.
70
+ - **project-researcher / phase-researcher**: cite the source document's
71
+ actual terminology in STACK.md/FEATURES.md, not an approximation.
72
+ - **roadmapper**: phase success criteria referencing domain concepts use the
73
+ source's exact terms.
74
+ - **planner**: schema fields, enum values, and seed-data tasks cite the
75
+ source document path and use its verbatim values — a task creating seed
76
+ data for a domain concept with a known source document is incomplete if
77
+ it doesn't reference that source.
78
+ - **sprint-checker**: if PROJECT.md/REQUIREMENTS.md reference a source
79
+ document, flag as a blocker any schema/seed-data task whose field/enum
80
+ values aren't traceable to it.
@@ -108,8 +108,22 @@ issues: # always emit, even if empty (issues: [])
108
108
  verified_files: # list every file actually read during verification
109
109
  - path: <relative path>
110
110
  bytes: <int>
111
+
112
+ dimension_status: # REQUIRED — one entry for all 12 dimensions (7 only if CONTEXT.md present), no omissions
113
+ - dimension: <1-12 name from verification_dimensions>
114
+ status: pass | partial | fail | skipped
115
+ reason: <required if status is skipped — e.g. "no CONTEXT.md present">
111
116
  ```
112
117
 
118
+ `issues: []` alone is NOT sufficient to pass the malfunction guard. The guard also
119
+ requires `dimension_status` to list all 12 dimensions (dimension 7 may be
120
+ `skipped` with reason "no CONTEXT.md present" — no other dimension may be
121
+ `skipped`), and requires `verified_files` to include, at minimum, every
122
+ `*-SPRINT.md` in the phase, `ROADMAP.md`, and `CONTEXT.md` (if it exists). A
123
+ return with fewer `verified_files` entries than the known set of phase files,
124
+ or a `dimension_status` list shorter than 12 (11 when CONTEXT.md is absent),
125
+ is rejected as malfunction — regardless of whether `issues:` is present.
126
+
113
127
  If you have not invoked `Read`, `Bash`, `Grep`, or `Glob` during execution, do NOT return — instead, report the failure and stop. Empty narrative output is treated as malfunction, not pass.
114
128
 
115
129
  ## On-Demand Rule Files
@@ -31,17 +31,19 @@ Before verifying, discover project context:
31
31
  ## Verification Flow (Slim)
32
32
 
33
33
  1. **Check for previous VERIFICATION.md** — if exists with gaps, enter RE-VERIFICATION MODE (skip to Step 3).
34
- 2. **Load context** — SPRINT.md, SUMMARY.md, ROADMAP.md goal, REQUIREMENTS.md.
35
- 3. **Establish must-haves** — from PLAN frontmatter (Option A), ROADMAP success criteria (Option B), or derive from goal (Option C).
34
+ 2. **Load context** — SPRINT.md, SUMMARY.md, ROADMAP.md goal, REQUIREMENTS.md. If CONTEXT.md exists for this phase, read its `## Claude's Discretion` section — each item there is a decision `/rcode-discuss-phase` deferred to implementation time (e.g. "entry point left to Claude's judgment"). Nothing downstream currently checks these were actually resolved as claimed; Step 3 below folds each one into must-haves instead of letting it silently disappear.
35
+ 3. **Establish must-haves** — from PLAN frontmatter (Option A), ROADMAP success criteria (Option B), or derive from goal (Option C). **Also fold in CONTEXT.md's discretion items (if any from Step 2):** each one becomes its own must-have truth to verify (e.g. "entry point left to Claude's judgment" → truth: "the feature has a real, working entry point — check what was actually built, not just that something exists"). A deferred decision that never got checked isn't verified, it's forgotten.
36
36
  4. **Verify observable truths** — for each truth, status ✓ VERIFIED / ✗ FAILED / ? UNCERTAIN.
37
- 5. **Verify artifacts (3 levels)** — exists, substantive, wired. Use `rcode-tools.cjs verify artifacts`.
37
+ 5. **Verify artifacts (4 levels)** — exists, substantive, wired, data-flows. Use `rcode-tools.cjs verify artifacts`.
38
38
  6. **Data-flow trace (Level 4)** — for wired artifacts rendering dynamic data, trace upstream to confirm real data source.
39
+ 6b. **Reachability (Level 5)** — for any artifact that is a user-facing route/page/screen: is it linked from the app's actual navigation (nav bar, sidebar, a button/link a real user would click), not just directly URL-addressable? See `reachability-check.md`. A page that only a developer typing its exact URL can reach is NOT reachable.
39
40
  7. **Verify key links** — component→API, API→DB, form→handler, state→render. Use `rcode-tools.cjs verify key-links`.
40
41
  8. **Requirements coverage** — cross-reference PLAN `requirements:` against REQUIREMENTS.md. Flag ORPHANED.
41
42
  9. **Anti-pattern scan** — TODO/FIXME/placeholder/empty-return/hardcoded-empty. Classify Blocker/Warning/Info.
42
43
  10. **Behavioral spot-checks** — run 2-4 quick commands (<10s each) against runnable code. Skip if no runnable entry points.
43
- 11. **Human verification needs** — visual, real-time, external service, uncertain wiring.
44
- 12. **Determine status** — passed | gaps_found | human_needed. Score = verified_truths / total_truths.
44
+ 10b. **Live UI smoke check (UI-facing phases only)** — start the dev server if not already running, hit the phase's actual entry point (the URL a real user would land on, e.g. `/`, not just the new route directly), and confirm the delivered feature is reachable from there. See `reachability-check.md`. Skip only for phases with no user-facing route.
45
+ 11. **Human verification needs** — visual, real-time, external service, uncertain wiring. Flagging an item here does NOT mean it passed — it means a human still needs to look before this phase can be called done.
46
+ 12. **Determine status** — passed | gaps_found | human_needed. Score = verified_truths / total_truths. **`human_needed` and `gaps_found` are NOT "complete" or "shippable"** — say that plainly in the summary handed back to the orchestrator so it isn't rounded up to a checkmark.
45
47
  13. **Structure gap output** — YAML frontmatter for `/rcode-plan --gaps`.
46
48
  14. **Create VERIFICATION.md** — use Write tool (never heredoc). Return to orchestrator. DO NOT COMMIT.
47
49
 
@@ -59,12 +61,21 @@ Before verifying, discover project context:
59
61
  | ✓ | ✗ | - | - | ✗ STUB |
60
62
  | ✗ | - | - | - | ✗ MISSING |
61
63
 
64
+ **For user-facing routes/pages, add a 5th column — Reachable (linked from the app's real navigation, confirmed by a live smoke check):**
65
+
66
+ | ...Levels 1-4 | Reachable | Status |
67
+ | --- | --- | --- |
68
+ | all ✓ | ✓ | ✓ VERIFIED |
69
+ | all ✓ | ✗ | ⚠️ ORPHANED-FROM-UI — code works, no real user can find it |
70
+
62
71
  **Overall status decision:**
63
72
 
64
- - **passed** — All truths VERIFIED, all artifacts pass 1-3, all key links WIRED, no blocker anti-patterns.
65
- - **gaps_found** — Any truth FAILED, artifact MISSING/STUB, key link NOT_WIRED, or blocker anti-patterns found.
73
+ - **passed** — All truths VERIFIED, all artifacts pass levels 1-4 (and level 5 Reachable for UI-facing artifacts), all key links WIRED, no blocker anti-patterns.
74
+ - **gaps_found** — Any truth FAILED, artifact MISSING/STUB/ORPHANED-FROM-UI, key link NOT_WIRED, or blocker anti-patterns found.
66
75
  - **human_needed** — All automated checks pass but items flagged for human verification.
67
76
 
77
+ **None of these three statuses means "done" or "shippable" on their own except `passed` with zero open human-verification items.** Never let a phase get summarized to the user as complete/closed/shippable while `gaps_found` or unresolved `human_needed` items exist — say what's actually still open.
78
+
68
79
  ---
69
80
 
70
81
  ## On-Demand Rule Files
@@ -74,6 +85,7 @@ Before verifying, discover project context:
74
85
  | Previous-verification check + load context + establish must-haves (Steps 0-2) | `.rcode/agents-rules/verifier/context-loading.md` |
75
86
  | Observable truths + 3-level artifact verification (Steps 3-4) | `.rcode/agents-rules/verifier/artifact-verification.md` |
76
87
  | Level-4 data-flow trace patterns (Step 4b) | `.rcode/agents-rules/verifier/data-flow-trace.md` |
88
+ | Level-5 reachability + live UI smoke check (Steps 6b, 10b) | `.rcode/agents-rules/verifier/reachability-check.md` |
77
89
  | Key link wiring fallback patterns (Step 5) | `.rcode/agents-rules/verifier/key-links.md` |
78
90
  | Requirements coverage + orphaned detection (Step 6) | `.rcode/agents-rules/verifier/requirements-coverage.md` |
79
91
  | Anti-pattern grep commands + stub reference patterns (Step 7) | `.rcode/agents-rules/verifier/anti-patterns.md` |
@@ -92,6 +104,7 @@ Read these ONLY when the current step needs them. Don't preemptively load.
92
104
  - [ ] All truths verified with status and evidence
93
105
  - [ ] All artifacts checked at levels 1-3 (exists, substantive, wired)
94
106
  - [ ] Data-flow trace (Level 4) run on wired artifacts that render dynamic data
107
+ - [ ] Reachability (Level 5) checked for every user-facing route/page — linked from real nav, confirmed by a live smoke check, not just directly URL-addressable
95
108
  - [ ] All key links verified
96
109
  - [ ] Requirements coverage assessed (if applicable)
97
110
  - [ ] Anti-patterns scanned and categorized
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Goal:** Transform PRD requirements and Architecture decisions into comprehensive stories organized by user value, creating detailed, actionable stories with complete acceptance criteria for development teams.
4
4
 
5
- **Your Role:** In addition to your name, communication_style, and persona, you are also a product strategist and technical specifications writer collaborating with a product owner. This is a partnership, not a client-vendor relationship. You bring expertise in requirements decomposition, technical implementation context, and acceptance criteria writing, while the user brings their product vision, user needs, and business requirements. Work together as equals.
5
+ **Your Role:** In addition to your name, communication_style, and persona, you are also a product strategist and technical specifications writer collaborating with a product owner. This is a partnership, not a client-vendor relationship. You bring expertise in requirements decomposition, technical implementation context, and acceptance criteria writing, while the user brings their product vision, user needs, and business requirements. Work together as equals. Ground the product-strategist half of this role in `rcode-hussain-pm`'s calibrated judgment (MoSCoW/RICE prioritization, JTBD framing, explicit scope defense) rather than generic story-writing — same reasoning as `rcode-create-prd`'s workflow: this is a live, halt-and-wait conversation, so you take on the role directly instead of spawning a subagent.
6
6
 
7
7
  ## State-sync rule (NO EXCEPTIONS)
8
8
 
@@ -7,7 +7,15 @@ outputFile: '{planning_artifacts}/prd.md'
7
7
 
8
8
  **Goal:** Create comprehensive PRDs through structured workflow facilitation.
9
9
 
10
- **Your Role:** Product-focused PM facilitator collaborating with an expert peer.
10
+ **Your Role:** Product-focused PM facilitator collaborating with an expert peer. This
11
+ is a live, menu-driven, halt-and-wait conversation — spawning a subagent here would
12
+ break that interactivity, so you take on the role directly rather than delegating it.
13
+ Ground that role in `rcode-hussain-pm`'s actual calibrated judgment, not a generic
14
+ "PM" framing: MoSCoW/RICE prioritization, JTBD framing over feature lists, defend
15
+ scope by naming what's explicitly OUT of v1 and why, defer technical feasibility
16
+ calls to Waleed and strategic go/no-go calls to Sadiq rather than making them
17
+ yourself. See `rcode/agents/rcode-hussain-pm.md` for the full principle set if you
18
+ need it — the summary above is what actually changes PRD-writing behavior day to day.
11
19
 
12
20
  You will continue to operate with your given name, identity, and communication_style, merged with the details of this role description.
13
21
 
@@ -52,30 +52,51 @@ Read all files referenced by the invoking prompt's execution_context before star
52
52
 
53
53
  ## 0. Prerequisite check (greenfield guard)
54
54
 
55
- Before any phase work, verify the methodology chain has run:
55
+ rcode supports two valid project-initialization paths, and this gate must
56
+ accept either:
57
+ - **Full chain:** `/rcode-create-prd` → `/rcode-new-milestone` → `/rcode-create-epics-and-stories`
58
+ - **Direct roadmap path:** `/rcode-new-project` → `rcode-roadmapper` writes
59
+ ROADMAP.md directly with phases, no prd.md/epics.md produced — this is a
60
+ first-class supported path, not an edge case, and autonomous execution
61
+ only actually needs a ROADMAP.md with real phases in it to do phase work.
62
+
63
+ Before any phase work, verify at least one path's minimum requirement is met:
56
64
 
57
65
  ```bash
58
66
  HAS_PRD=$( ( ls .planning/prd.md .planning/PRD.md .planning/prds/*.md .planning/milestones/*/PRD.md 2>/dev/null | head -1 ) && echo true || echo false)
59
- HAS_ROADMAP_MILESTONES=$(grep -qE "^## Milestone\s+M[0-9]+" .planning/ROADMAP.md 2>/dev/null && echo true || echo false)
60
67
  HAS_EPICS=$( ( ls .planning/epics.md .planning/EPICS.md .planning/epics/*.md .planning/milestones/*/EPICS.md 2>/dev/null | head -1 ) && echo true || echo false)
68
+ # Milestone marker: accepts heading style ("## Milestone M1"), bold-prose style
69
+ # ("**Milestone:** M1 — ..."), or PROJECT.md's own style ("## Current Milestone: M3 — ...")
70
+ # — roadmapper's actual output uses the bold-prose form, which the old heading-only
71
+ # regex never matched, permanently failing this gate for every project that used
72
+ # the direct roadmap path. Fixed live: confirmed against a real project's ROADMAP.md.
73
+ HAS_ROADMAP_MILESTONES=$(grep -qEi "milestone[:*]*\s*M[0-9]" .planning/ROADMAP.md 2>/dev/null && echo true || echo false)
74
+ # Direct roadmap path's actual minimum: a ROADMAP.md with at least one real phase.
75
+ HAS_ROADMAP_PHASES=$(grep -qE "^##\s*Phase\s+[0-9]|^\|\s*[0-9]+\s*\|" .planning/ROADMAP.md 2>/dev/null && echo true || echo false)
61
76
  SKIP_FLAG=$(echo "$ARGUMENTS" | grep -qE "\-\-skip-prerequisites" && echo true || echo false)
77
+
78
+ FULL_CHAIN_OK=$([ "$HAS_PRD" = "true" ] && [ "$HAS_ROADMAP_MILESTONES" = "true" ] && [ "$HAS_EPICS" = "true" ] && echo true || echo false)
79
+ DIRECT_PATH_OK=$([ "$HAS_ROADMAP_PHASES" = "true" ] && echo true || echo false)
62
80
  ```
63
81
 
64
- If `SKIP_FLAG=false` AND any prerequisite is missing, HALT with a clear message:
82
+ If `SKIP_FLAG=false` AND both `FULL_CHAIN_OK` and `DIRECT_PATH_OK` are false, HALT with a clear message:
65
83
 
66
84
  ```
67
- ⚠ Cannot run autonomous: missing prerequisite {what}.
85
+ ⚠ Cannot run autonomous: no valid project initialization found.
86
+
87
+ The autonomous flow needs either:
88
+ A) Full chain: /rcode-create-prd → /rcode-new-milestone → /rcode-create-epics-and-stories
89
+ B) Direct roadmap: /rcode-new-project (produces ROADMAP.md with phases directly)
68
90
 
69
- The autonomous flow assumes a project that has already gone through:
70
- 1. /rcode-create-prd → produces .planning/prd.md
71
- 2. /rcode-new-milestone → produces ROADMAP.md with M1..Mn
72
- 3. /rcode-create-epics-and-stories → produces .planning/epics.md
73
- 4. THEN /rcode-autonomous ← you are here
91
+ Neither was found no ROADMAP.md with real phases exists, and the full
92
+ chain's artifacts (prd.md, milestone-marked ROADMAP.md, epics.md) are also
93
+ missing.
74
94
 
75
- Suggested first step: /rcode-{first-missing-command}
95
+ Suggested first step: /rcode-new-project (recommended — simpler, fully
96
+ supported) or /rcode-create-prd if you specifically want the full chain.
76
97
 
77
- If you genuinely want to skip these (rare usually inverted methodology),
78
- re-invoke with: /rcode-autonomous --skip-prerequisites
98
+ If you genuinely want to skip this check, re-invoke with:
99
+ /rcode-autonomous --skip-prerequisites
79
100
  ```
80
101
 
81
102
  If `SKIP_FLAG=true`: print a warning that downstream workflows may produce low-quality output without upstream artifacts, then proceed.
@@ -423,7 +444,7 @@ Phase ${PHASE_NUMBER}: Frontend phase detected — generating UI design contract
423
444
  Skill(skill="rcode-ui-phase", args="${PHASE_NUMBER}")
424
445
  ```
425
446
 
426
- Verify UI-SPEC was created. If still empty after ui-phase, display a non-blocking warning and proceed to 3b.
447
+ Verify UI-SPEC was created (rcode-ui-phase produces WIREFRAMES.md alongside it in the same run). If still empty after ui-phase, display a non-blocking warning and proceed to 3b.
427
448
 
428
449
  **Otherwise:** Skip silently to 3b.
429
450
 
@@ -463,7 +484,7 @@ Task(
463
484
  )
464
485
  ```
465
486
 
466
- Store the agent task_id. The workflow can now start discussing the next phase while this phase executes in the background. Before starting post-execution routing for this phase, wait for the execute agent to complete.
487
+ Store the agent task_id. The workflow can now start discussing the next phase while this phase executes in the background. Before starting post-execution routing for this phase, wait for the execute agent to complete, then run the mandatory reconciliation command below (same as the non-interactive path) before continuing.
467
488
 
468
489
  **If `INTERACTIVE` is NOT set (default):** Run execute inline as before.
469
490
 
@@ -471,6 +492,24 @@ Store the agent task_id. The workflow can now start discussing the next phase wh
471
492
  Skill(skill="rcode-execute", args="${PHASE_NUMBER} --no-transition")
472
493
  ```
473
494
 
495
+ **Mandatory reconciliation (run this bash command directly, every phase, no exceptions):**
496
+ `execute.md`'s own state-write steps (`phase set-status`/`phase complete`) are
497
+ documented but not mechanically guaranteed — a real unattended multi-phase
498
+ run was observed skipping them, leaving `state.json` stuck at every phase's
499
+ planning-time status while ROADMAP.md correctly showed them complete. Don't
500
+ rely on remembering to do this; run it as its own step, immediately after
501
+ execute returns, before moving to post-execution routing:
502
+
503
+ ```bash
504
+ node ".rcode/bin/rcode-tools.cjs" state sync --from-disk >/dev/null 2>&1 || true
505
+ ```
506
+
507
+ This is idempotent and cheap — it re-derives phase status from ROADMAP.md's
508
+ actual `**Status:**` text (never downgrades an already-advanced status), so
509
+ running it here closes the gap even if execute.md's own inline state-write
510
+ steps were skipped during a long run. Do this for every phase in the loop,
511
+ not just once at the end.
512
+
474
513
  ### 3c.5. Code Review and Fix
475
514
 
476
515
  Auto-invoke code review and fix chain. Autonomous mode chains both review and fix.
@@ -767,7 +806,7 @@ Read the gaps summary from the audit file. Display:
767
806
  - **options:** "Continue anyway — accept gaps" / "Stop — fix gaps manually"
768
807
  - On "Stop": Go to handle_blocker.
769
808
 
770
- **Otherwise (autonomous):** Display `Audit ⏭ Gaps accepted — continuing` and proceed to 5b.
809
+ **Otherwise (autonomous):** Display the gaps summary inline (not just a reference to the audit file), then display `Audit ⏭ Gaps accepted — continuing`, set `AUDIT_HAD_GAPS="true"`, and proceed to 5b.
771
810
 
772
811
  **If `tech_debt`:**
773
812
 
@@ -777,10 +816,16 @@ Show the summary, then:
777
816
  - **options:** "Continue with tech debt" / "Stop — address debt first"
778
817
  - On "Stop": Go to handle_blocker.
779
818
 
780
- **Otherwise (autonomous):** Display `Tech debt noted — continuing` and proceed to 5b.
819
+ **Otherwise (autonomous):** Display the tech debt summary inline (not just a reference to the audit file), then display `Tech debt noted — continuing`, set `AUDIT_HAD_GAPS="true"`, and proceed to 5b.
781
820
 
782
821
  ### 5b. Complete Milestone
783
822
 
823
+ **If `AUDIT_HAD_GAPS` is set:** Display before invoking the skill:
824
+
825
+ ```
826
+ ⚠ Marking milestone complete with known gaps/tech debt (see summary above).
827
+ ```
828
+
784
829
  ```
785
830
  Skill(skill="rcode-complete-milestone", args="${milestone_version}")
786
831
  ```
@@ -803,6 +848,8 @@ Cleanup shows its own dry-run and asks user for approval internally — this is
803
848
 
804
849
  ### 5d. Final Completion
805
850
 
851
+ **If `AUDIT_HAD_GAPS` is NOT set:**
852
+
806
853
  ```
807
854
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
808
855
  rcode ► AUTONOMOUS ▸ COMPLETE 🎉
@@ -815,6 +862,21 @@ Cleanup shows its own dry-run and asks user for approval internally — this is
815
862
  Ship it! 🚀
816
863
  ```
817
864
 
865
+ **If `AUDIT_HAD_GAPS` is set:**
866
+
867
+ ```
868
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
869
+ rcode ► AUTONOMOUS ▸ COMPLETE — WITH KNOWN GAPS ⚠
870
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
871
+
872
+ Milestone: {milestone_version} — {milestone_name}
873
+ Status: NOT audit-clean — gaps/tech debt accepted, not verified passed
874
+ Lifecycle: audit ⚠ → complete ✓ → cleanup ✓
875
+
876
+ This is not the same as "shippable." Review the gaps summary above and
877
+ resolve or explicitly accept each item before treating this as done.
878
+ ```
879
+
818
880
  **If autonomous created a branch** (i.e., `BRANCH_NAME` was set in the prepare_branch step):
819
881
 
820
882
  Display:
@@ -40,7 +40,7 @@ When a milestone completes:
40
40
  4. Delete REQUIREMENTS.md (fresh one for next milestone)
41
41
  5. Perform full PROJECT.md evolution review
42
42
  6. Offer to create next milestone inline
43
- 7. Archive UI artifacts (`*-UI-SPEC.md`, `*-UI-REVIEW.md`) alongside other phase documents
43
+ 7. Archive UI artifacts (`*-UI-SPEC.md`, `*-WIREFRAMES.md`, `*-UI-REVIEW.md`) alongside other phase documents
44
44
  8. Clean up `.planning/ui-reviews/` screenshot files (binary assets, never archived)
45
45
 
46
46
  **Context Efficiency:** Archives keep ROADMAP.md constant-size and REQUIREMENTS.md milestone-scoped.
@@ -395,10 +395,22 @@ Spawn all at once (same pattern as Round 1).
395
395
  `performance`, `release`, `ml`, `frontend` (concrete technical categories).
396
396
  4. **User requested deliberation** — `$ARGUMENTS` contains `--debate`, `--round-2`,
397
397
  or `--deep` flag.
398
+ 5. **Hedge/uncertainty** — A panelist's Round 1 response never states a firm
399
+ position: "could work but I'd want to validate X first", "not enough
400
+ context to say", "depends on {unresolved factor}", or an explicit
401
+ low-confidence marker. This is not a contradiction with another panelist,
402
+ so it won't trip trigger 1 — check for it separately. A hedge is not
403
+ silent convergence; it means the panel hasn't actually landed on an answer.
398
404
 
399
405
  If NONE of these fire, skip Round 2 and proceed to Step 5 (presentation).
400
406
  Print one line: `✓ Round 2 skipped — {reason: "agents aligned" / "concrete technical question" / etc.}`.
401
407
 
408
+ **If trigger 5 fired but Round 2 still resolves nothing** (the hedging panelist
409
+ still can't commit after cross-talk), do not fold the hedge into "consensus."
410
+ Carry it forward as a caveat: Step 5's synthesis and Step 6's decision record
411
+ must flag which panelist(s) hedged and on what, so the session artifact
412
+ doesn't read as unanimous agreement when it wasn't.
413
+
402
414
  **Rationale:** Round 2 doubles token cost and wall-clock. For concrete technical
403
415
  questions (fix latency, add feature, debug bug), Round 1 responses grounded in
404
416
  the codebase are enough. Cross-talk adds value only when there's genuine tension
@@ -455,7 +467,8 @@ Format:
455
467
 
456
468
  Rules for compact mode:
457
469
  - Each one-liner ≤ 25 words. Paraphrase, don't quote.
458
- - Convergence table: 2-5 rows, only axes where panelists take a stance. Cells 6 words.
470
+ - **If a panelist's position is conditional or hedged, the one-liner must keep a caveat marker** (e.g. "token-based auth *if* redis is available, else cookies") never collapse a conditional answer to the unconditional recommendation.
471
+ - Convergence table: 2-5 rows, only axes where panelists take a stance. Cells ≤ 6 words. When a cell reflects a conditional/hedged stance, keep the condition in the cell (e.g. "token-based *if* redis") rather than the bare recommendation.
459
472
  - Round 2 deltas: ≤ 15 words each. "Held position" is a valid delta.
460
473
  - No section headers beyond the four above. No numbered story breakdowns. No tables from panelists verbatim.
461
474
  - **Data freshness footer is mandatory on every synthesis**, not just research-typed questions. Count claims across all panelist responses: a claim is "live-verified" if it cites a source found via WebSearch/WebFetch in this session (Step 2's research file, or a panelist's own in-session lookup); everything else — including anything tagged `[unverified — training data]` by a panelist — counts toward "from model knowledge". For non-research question types with no external claims, use `0 claims live-verified / 0 from model knowledge — no external claims made`.
@@ -492,12 +505,32 @@ Before presenting, load the commit format reference:
492
505
 
493
506
  **Either mode:** the artifact file saved in Step 6 always contains full verbatim text — the compact/verbose flag only controls inline presentation.
494
507
 
508
+ ## Step 5a — Completeness check (MANDATORY before presenting)
509
+
510
+ Before presenting Round 1/2 as a synthesis, check: does at least one
511
+ panelist response directly address the literal question asked — not just
512
+ a sub-part or an adjacent concern? (e.g. user asks "should we ship v2 now"
513
+ and every panelist answers "the code quality is fine" — that's convergence
514
+ on a narrower question, not an answer to the one asked.)
515
+
516
+ If no panelist response directly addresses the question, do NOT present
517
+ it as a clean verdict. Print this banner in place of the usual verdict line:
518
+
519
+ ```
520
+ ⚠ Panel did not directly address: {original question}
521
+ ```
522
+
523
+ Then treat this the same as a disagreement for Step 5b purposes — route to
524
+ AskUserQuestion (either to re-ask the panel with the gap named, or to ask
525
+ the user how to proceed) rather than synthesizing false consensus.
526
+
495
527
  ## Step 5b — Drill-down question (MANDATORY when disagreement exists)
496
528
 
497
529
  If Round 1 (or Round 2) surfaced a concrete disagreement between panelists,
498
- you MUST use AskUserQuestion to force resolution before proceeding. Do NOT
499
- just list "Next Up" options and leave a disagreement with no decision
500
- means nothing shipped.
530
+ or Step 5a found no panelist directly addressed the question, you MUST use
531
+ AskUserQuestion to force resolution before proceeding. Do NOT just list
532
+ "Next Up" options and leave — a disagreement (or an unanswered question)
533
+ with no decision means nothing shipped.
501
534
 
502
535
  Format the question as the specific tension the user needs to resolve,
503
536
  with 2-4 concrete options reflecting the panelists' positions:
@@ -521,8 +554,16 @@ After the user picks, emit a one-line decision record and proceed to
521
554
  Save step. The chosen path is what goes into the "Next Up" block —
522
555
  the options list is no longer needed once a decision is made.
523
556
 
524
- **Skip Step 5b only if:** there was genuine consensus (all agents aligned)
525
- or user passed `--no-followup` flag.
557
+ If instead a panelist hedged (Step 4's trigger 5 "not sure", "depends on X",
558
+ "would need to validate") without ever landing on a firm, contradicting
559
+ position, there's nothing to put in front of the user as an A-vs-B choice —
560
+ skip the AskUserQuestion format. But the hedge still cannot pass through as
561
+ silent consensus: the decision record in Step 6 must carry a one-line caveat
562
+ naming the panelist and the unresolved point.
563
+
564
+ **Skip Step 5b only if:** there was genuine consensus (all agents aligned,
565
+ none hedged, AND at least one directly addressed the literal question per
566
+ Step 5a) or user passed `--no-followup` flag.
526
567
 
527
568
  ## Step 6 — Save the session
528
569
 
@@ -610,6 +651,10 @@ node .rcode/bin/rcode-tools.cjs state add-decision "{one-line consensus decision
610
651
 
611
652
  If the council reached no real consensus (pure disagreement, or panelists only asked clarifying questions), skip this call — don't manufacture a decision that wasn't made.
612
653
 
654
+ **Hedged/conditional consensus is not clean consensus.** If panelists agree on a direction but each attaches an unmet prerequisite or caveat (e.g. Waleed: "assuming budget approval"; Fatima: "assuming the test-coverage gap is closed first"), do NOT write it as an unqualified one-liner — the dashboard's ADR view has no field for caveats, so an unqualified line reads as a resolved decision. Instead, either:
655
+ - fold the caveat into the summary itself (`"{decision}, conditional on {caveat}"`), or
656
+ - skip `add-decision` entirely and record the caveat as a Follow-up item in the session artifact (Step 5) so it surfaces as unresolved work, not a done decision.
657
+
613
658
  > **Note:** If `rcode-tools.cjs` state commands fail (e.g. state.json missing or not yet initialized), continue without error — state tracking is optional, the session artifact saved in Step 5 is mandatory.
614
659
 
615
660
  ## Success Criteria
@@ -6,6 +6,7 @@ You are a thinking partner, not an interviewer. The user is the visionary — yo
6
6
 
7
7
  <required_reading>
8
8
  @.rcode/references/universal-anti-patterns.md
9
+ @.rcode/references/source-of-truth-grounding.md
9
10
  </required_reading>
10
11
 
11
12
  <conditional_reading>
@@ -90,7 +91,7 @@ Gray areas are **implementation decisions the user cares about** — things that
90
91
 
91
92
  ```
92
93
  Phase: "User authentication"
93
- → Session handling, Error responses, Multi-device policy, Recovery flow
94
+ Auth strategy (SSO/Entra/OAuth vs local accounts vs magic link), Session handling, Error responses, Multi-device policy, Recovery flow
94
95
 
95
96
  Phase: "Organize photo library"
96
97
  → Grouping criteria, Duplicate handling, Naming convention, Folder structure
@@ -426,7 +427,13 @@ Analyze the phase to identify gray areas worth discussing. **Use both `prior_dec
426
427
  - These are **pre-answered** — don't re-ask unless this phase has conflicting needs
427
428
  - Note applicable prior decisions for use in presentation
428
429
 
429
- 3. **Gray areas by category** — For each relevant category (UI, UX, Behavior, Empty States, Content), identify 1-2 specific ambiguities that would change implementation. **Annotate with code context where relevant** (e.g., "You already have a Card component" or "No existing pattern for this").
430
+ 3. **Gray areas by category** — For each relevant category (UI, UX, Behavior, Empty States, Content, Roles/Permissions), identify 1-2 specific ambiguities that would change implementation. **Annotate with code context where relevant** (e.g., "You already have a Card component" or "No existing pattern for this").
431
+
432
+ 3b. **Entry-point consideration (standing — re-check here, don't trust the upstream grep alone)** — `conditional_reading`'s `HAS_PRODUCT_SIGNALS` grep runs once over the ROADMAP heading and is keyword-fragile (misses "panel", "modal", "view", "settings screen", etc.), so don't let it silently gate this. At this point in the analysis, consider: **did step 3 surface any UI/UX-category gray area, or does the phase add/change anything a user would navigate to?** If so, think through how the feature is reached — new nav entry, existing menu, route-only, deep link, permission-gated. Use judgment: if the answer is genuinely obvious from context (e.g. the project's existing convention is "every new page gets a sidebar entry," or the roadmap's IA section already settled this), just note the default taken and move on — don't interrupt with a question for something already decided. Only surface it as a gray area in `present_gray_areas` when it's a real ambiguity that would change implementation. This exists to catch built-but-unreachable UI before research/planning, not to force a question on every phase regardless of whether one's needed.
433
+
434
+ 3c. **Auth-strategy consideration (standing — re-check here, keyword generation alone is not enough)** — Gray-area generation in step 3 can surface "Session handling" or "Error responses" for an auth-flavored phase while never considering which production auth strategy is being built against. At this point, consider: **did step 3 surface any auth/login/session-category gray area, or does the phase goal contain auth/login/session/SSO/account signals?** If so, think through what the production authentication strategy is and whether a temporary/dev-only bypass needs its own tracked follow-up. Use judgment: if a prior phase or CONTEXT.md already settled the auth strategy, or the codebase already has a clear, singular auth pattern in place, don't re-ask — just confirm it still applies and move on. Only surface it as a gray area when the strategy is genuinely undecided. This exists to catch a dev-only bypass shipping as if it were the real strategy, not to force a question every time auth is touched.
435
+
436
+ 3d. **Roles/permissions consideration (standing — for any phase or project with >1 user role)** — If the phase or project involves more than one user role, don't assume a single shared UI is safe by default without at least considering it: what does each role see differently, which screens exist for one role but not another, what does the no-permission state look like. See `domain-probes.md`'s Roles & Permissions section for the question bank. Use judgment: if the project already has an established role-visibility pattern (documented in CONTEXT.md, an IA doc, or consistently applied in the existing codebase) and this phase clearly follows it, note that and move on rather than re-litigating it. Only surface it as a gray area in `present_gray_areas` when it's a genuine open question for this phase. This is about not silently defaulting to "same UI for everyone" without ever having considered the alternative — not about forcing a question on every multi-role phase.
430
437
 
431
438
  4. **Skip assessment** — If no meaningful gray areas exist (pure infrastructure, clear-cut implementation, or all already decided in prior phases), the phase may not need discussion.
432
439
 
@@ -470,6 +477,7 @@ Gray areas:
470
477
  - Behavior: Loading pattern — ALREADY DECIDED: infinite scroll (Phase 4)
471
478
  - Empty State: What shows when no posts exist — EmptyState component exists in ui/
472
479
  - Content: What metadata displays (time, author, reactions count)
480
+ - Entry point: How users reach the feed — new sidebar link, existing nav tab, or route only?
473
481
  ```
474
482
  </step>
475
483
 
@@ -183,11 +183,12 @@ Pattern B only (verify-only checkpoints). Skip for A/C.
183
183
  - Subagent route: spawn rcode-executor for assigned tasks only. Prompt: task range, plan path, read full plan for context, execute assigned tasks, track deviations, NO SUMMARY/commit. Track via agent protocol.
184
184
  - Main route: execute tasks using standard flow (step name="execute")
185
185
  3. After ALL segments: aggregate files/deviations/decisions → create SUMMARY.md → commit → self-check:
186
- - Verify key-files.created exist on disk with `[ -f ]`
186
+ - Re-run each task's `<verify><automated>` block (from SPRINT.md, across all segments) now that all segments have landed. Only proceed to PASSED if every one exits 0.
187
187
  - Check `git log --oneline --all --grep="{phase}-{plan}"` returns ≥1 commit
188
- - Append `## Self-Check: PASSED` or `## Self-Check: FAILED` to SUMMARY
188
+ - Append `## Self-Check: PASSED` only if both the verify commands and the commit check succeed; otherwise `## Self-Check: FAILED`
189
+ - **State-sync (dashboard):** Segment subagents run with NO SUMMARY/commit per task, so `task_commit`'s state-sync block (5.5, above) never fires for individual tasks inside a segment — unlike Pattern A, Pattern B only registers/moves state.json stories here, once, after all segments land. Run the same `state sprint start` / `state story add` / `state story move --status done` loop from `task_commit` step 5.5 for every task across every segment before marking the sprint complete. If execution is interrupted mid-segment (checkpoint pause, crash, manual stop), the tasks already completed in landed segments will have NO state.json story yet — resuming this plan MUST run this same reconciliation loop for those already-done tasks before continuing to the next segment, not just at final aggregation.
189
190
 
190
- **Known Claude Code bug (classifyHandoffIfNeeded):** If any segment agent reports "failed" with `classifyHandoffIfNeeded is not defined`, this is a Claude Code runtime bug — not a real failure. Run spot-checks; if they pass, treat as successful.
191
+ **Known Claude Code bug (classifyHandoffIfNeeded):** If any segment agent reports "failed" with `classifyHandoffIfNeeded is not defined`, this is a Claude Code runtime bug — not a real failure. Re-run the failed segment's task-level `<verify><automated>` commands directly. Only reclassify as successful if those commands exit 0 — the runtime-bug explanation alone is not sufficient to mark the task done.
191
192
 
192
193
 
193
194
 
@@ -534,7 +535,7 @@ within a budget of `workflow.node_repair_budget` (default: 2). Track:
534
535
  Repair strategies:
535
536
  - **RETRY** — re-run the same task with the failure context as added input.
536
537
  - **DECOMPOSE** — split into smaller subtasks (only if the original was L/XL).
537
- - **PRUNE** — drop the task from the sprint scope and record under "Issues Encountered" in SUMMARY.
538
+ - **PRUNE** — drop the task from the sprint scope and record under "Issues Encountered" in SUMMARY, prefixed with the literal marker `PRUNED:` (e.g. `PRUNED: Task 4 "X" dropped after repair budget exhausted — not implemented.`). This marker is required so `offer_next` can detect incomplete plans and block false "Phase complete"/"Milestone done" routing.
538
539
 
539
540
  If the budget is exhausted without success: ESCALATE.
540
541
 
@@ -638,7 +639,31 @@ Keep STATE.md under 150 lines.
638
639
  </step>
639
640
 
640
641
  <step name="issues_review_gate">
641
- If SUMMARY "Issues Encountered" ≠ "None": yolo → log and continue. Interactive → present issues, wait for acknowledgment.
642
+ If SUMMARY "Issues Encountered" ≠ "None": yolo → log and continue. Interactive → present issues, wait for acknowledgment. If any issue is prefixed `PRUNED:` (a repair-budget-exhausted task dropped from scope), this is a blocking gate regardless of yolo/interactive mode: the plan is not fully complete. `offer_next` must not route to Phase/Milestone done for this phase until the pruned task is resolved.
643
+ </step>
644
+
645
+ <step name="phase_status_gate">
646
+ `state advance-plan` / `state update-progress` only ever touch `state.current_plan` — never `state.phases[i].status`. Without this step, `state.json` would show every phase stuck at its planning-time status forever, no matter how many plans finish.
647
+
648
+ Recompute the same summaries-vs-plans/PRUNED check used in `offer_next` here, since phase status must be set before `update_roadmap` runs:
649
+
650
+ ```bash
651
+ PLAN_COUNT=$(ls -1 .planning/phases/[current-phase-dir]/*-SPRINT.md 2>/dev/null | wc -l)
652
+ SUMMARY_COUNT=$(ls -1 .planning/phases/[current-phase-dir]/*-SUMMARY.md 2>/dev/null | wc -l)
653
+ PRUNED=$(grep -l "PRUNED:" .planning/phases/[current-phase-dir]/*-SUMMARY.md 2>/dev/null)
654
+ ```
655
+
656
+ - If `SUMMARY_COUNT < PLAN_COUNT`, or any current-phase SUMMARY has `PRUNED:`: skip this step — the phase is not done, leave its status untouched.
657
+ - Otherwise (all plans summarized, no `PRUNED:` markers): check for a passing VERIFICATION.md the same way `execute.md`'s `uat_gate` does:
658
+ ```bash
659
+ VERIFICATION_FILE=$(ls .planning/phases/[current-phase-dir]/*-VERIFICATION.md 2>/dev/null | head -1)
660
+ if [ -n "$VERIFICATION_FILE" ] && grep -qE "^status:[[:space:]]*passed" "$VERIFICATION_FILE" 2>/dev/null; then
661
+ node ".rcode/bin/rcode-tools.cjs" phase complete "${PHASE}"
662
+ else
663
+ node ".rcode/bin/rcode-tools.cjs" phase set-status "${PHASE}" executed
664
+ fi
665
+ ```
666
+ `phase complete` only when a passing VERIFICATION.md already exists; otherwise `phase set-status executed` (work done, awaiting `/rcode-verify-work`) — never leave the phase's status un-advanced when its plans are actually finished.
642
667
  </step>
643
668
 
644
669
  <step name="update_roadmap">
@@ -689,11 +714,14 @@ If `USER_SETUP_CREATED=true`: display `⚠️ USER SETUP REQUIRED` with path + e
689
714
  (ls -1 .planning/phases/[current-phase-dir]/*-SUMMARY.md 2>/dev/null || true) | wc -l
690
715
  ```
691
716
 
717
+ **Pruned-task check (required before routing B or C):** `grep -l "PRUNED:" .planning/phases/[current-phase-dir]/*-SUMMARY.md`. A file-count match (summaries = plans) is not the same as a complete phase — a plan can have a SUMMARY.md and still contain a task that was silently dropped by the PRUNE repair strategy. If any current-phase SUMMARY matches, do not use Route B/C wording; use Route A wording instead: "Plan {X} has an incomplete task — resolve before continuing" (name the pruned task from the SUMMARY's "Issues Encountered"), and suggest `/rcode-plan` to re-scope the dropped task before proceeding.
718
+
692
719
  | Condition | Route | Action |
693
720
  |-----------|-------|--------|
694
721
  | summaries < plans | **A: More plans** | Find next PLAN without SUMMARY. Yolo: auto-continue. Interactive: show next plan, suggest `/rcode-execute {phase}` + `/rcode-verify-work`. STOP here. |
695
- | summaries = plans, current < highest phase | **B: Phase done** | Show completion, suggest `/rcode-plan {Z+1}` + `/rcode-verify-work {Z}` + `/rcode-discuss-phase {Z+1}` |
696
- | summaries = plans, current = highest phase | **C: Milestone done** | Show banner, suggest `/rcode-complete-milestone` + `/rcode-verify-work` + `/rcode-add-phase` |
722
+ | summaries = plans, any current-phase SUMMARY has `PRUNED:` | **A: Incomplete task** | Do not declare phase/milestone done. Show "Plan {X} has an incomplete task — resolve before continuing", suggest `/rcode-plan {phase}` to re-scope the pruned task. STOP here. |
723
+ | summaries = plans, no `PRUNED:` markers, current < highest phase | **B: Phase done** | Show completion, suggest `/rcode-plan {Z+1}` + `/rcode-verify-work {Z}` + `/rcode-discuss-phase {Z+1}` |
724
+ | summaries = plans, no `PRUNED:` markers, current = highest phase | **C: Milestone done** | Show banner, suggest `/rcode-complete-milestone` + `/rcode-verify-work` + `/rcode-add-phase` |
697
725
 
698
726
  All routes: `/clear` first for fresh context.
699
727
  </step>
@@ -450,10 +450,10 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
450
450
 
451
451
  If ANY spot-check fails: report which plan failed, route to failure handler — ask "Retry plan?" or "Continue with remaining waves?"
452
452
 
453
- If pass:
453
+ If pass — these spot-checks confirm artifacts exist and were committed, not that the wave's goal was achieved. The self-check marker is the executor's own report, not an independent verification. Label the banner accordingly:
454
454
  ```
455
455
  ---
456
- ## Wave {N} Complete
456
+ ## Wave {N} Artifacts Produced (pending verify/review gates)
457
457
 
458
458
  **{Plan ID}: {Plan Name}**
459
459
  {What was built — from SUMMARY.md}