@hanzlaa/rcode 4.10.5 → 4.11.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 (55) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +1 -1
  3. package/CONTRIBUTING.md +3 -0
  4. package/cli/install.js +272 -1
  5. package/dist/rcode.js +259 -236
  6. package/package.json +1 -1
  7. package/rcode/agents/rcode-project-researcher.md +1 -1
  8. package/rcode/agents/rcode-ux-designer.md +1 -0
  9. package/rcode/agents/rcode-verifier.md +2 -2
  10. package/rcode/agents/rules/planner/common-patterns.md +2 -1
  11. package/rcode/agents/rules/planner/goal-backward-thinking.md +33 -0
  12. package/rcode/agents/rules/planner/sprint-verification.md +1 -0
  13. package/rcode/agents/rules/planner/task-templates.md +20 -1
  14. package/rcode/agents/rules/project-researcher/detailed-guide.md +10 -0
  15. package/rcode/agents/rules/sprint-checker/dimensions.md +74 -0
  16. package/rcode/agents/rules/sprint-checker/process.md +12 -0
  17. package/rcode/agents/rules/verifier/behavioral-spot-checks.md +5 -1
  18. package/rcode/agents/rules/verifier/gap-output.md +5 -0
  19. package/rcode/agents/rules/verifier/reachability-check.md +69 -0
  20. package/rcode/bin/rcode-tools.cjs +39 -3
  21. package/rcode/commands/ui-phase.md +1 -1
  22. package/rcode/references/design-library/LICENSE +21 -0
  23. package/rcode/references/design-library/README.md +37 -0
  24. package/rcode/references/design-library/charts.csv +26 -0
  25. package/rcode/references/design-library/colors.csv +97 -0
  26. package/rcode/references/design-library/icons.csv +101 -0
  27. package/rcode/references/design-library/styles.csv +68 -0
  28. package/rcode/references/design-library/typography.csv +58 -0
  29. package/rcode/references/design-library/ui-reasoning.csv +101 -0
  30. package/rcode/references/design-library/ux-guidelines.csv +100 -0
  31. package/rcode/references/design-library/web-interface.csv +31 -0
  32. package/rcode/references/domain-probes.md +8 -0
  33. package/rcode/references/project-types.yaml +29 -0
  34. package/rcode/references/questioning.md +3 -0
  35. package/rcode/references/roadmapper-playbook.md +90 -0
  36. package/rcode/references/sprint-checker-playbook.md +14 -0
  37. package/rcode/references/verifier-playbook.md +20 -7
  38. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/SKILL.md +10 -1
  39. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/templates/wave-prompt.md +2 -0
  40. package/rcode/workflows/autonomous.md +26 -3
  41. package/rcode/workflows/complete-milestone.md +1 -1
  42. package/rcode/workflows/council.md +51 -6
  43. package/rcode/workflows/discuss-phase.md +9 -2
  44. package/rcode/workflows/execute-sprint.md +35 -7
  45. package/rcode/workflows/execute-waves.md +2 -2
  46. package/rcode/workflows/execute.md +21 -6
  47. package/rcode/workflows/help.md +1 -1
  48. package/rcode/workflows/plan-research-validation.md +1 -1
  49. package/rcode/workflows/plan.md +31 -0
  50. package/rcode/workflows/ship.md +22 -0
  51. package/rcode/workflows/ui-phase.md +104 -22
  52. package/rcode/workflows/ui-review.md +9 -1
  53. package/rcode/workflows/verify-work.md +1 -1
  54. package/server/dashboard.js +18 -1
  55. package/server/lib/scanner.js +25 -4
@@ -43,6 +43,95 @@ NEVER include phases for:
43
43
 
44
44
  If it sounds like corporate PM theater, delete it.
45
45
 
46
+ ### UI Projects Need a Shell Phase — Not an Assumption
47
+
48
+ **If the project has any user-facing UI, an early phase MUST explicitly cover
49
+ the app shell: navigation (nav bar/sidebar), layout, and auth entry (login
50
+ screen) if auth exists.** Do not assume this "comes for free" alongside a
51
+ domain/feature phase — it doesn't. A roadmap built entirely from
52
+ domain-sliced phases (e.g. "Org graph," "Evidence ledger," "Attainment
53
+ engine," "Authorization," "Audit trail") can ship every one of those phases
54
+ individually verified and working, while the app itself has no way for a real
55
+ user to navigate between them — every page only reachable by typing its exact
56
+ URL. That is a real, observed failure mode, not a hypothetical.
57
+
58
+ Concretely: the roadmap's Phase 1 (or the first UI-touching phase) success
59
+ criteria must include something like "user can log in and see navigation to
60
+ every top-level area the project will eventually have" — even if most of
61
+ those areas are placeholder links until their own phase lands. Every later
62
+ phase that adds a new user-facing route must include "linked from the app's
63
+ navigation" as one of its own success criteria, not just "the page renders."
64
+
65
+ This is what `rcode-verifier`'s Level-5 Reachability check enforces at
66
+ verification time — but it can only enforce what the roadmap and plan
67
+ actually asked for. If no phase ever planned the nav, no plan ever built it,
68
+ and the verifier is left checking pages that are correct in isolation but
69
+ orphaned from the UI. Plan the shell so verification has something to check.
70
+
71
+ **Run `/rcode-ui-phase` before planning the shell phase's sprints, not after.**
72
+ It produces UI-SPEC.md (design tokens grounded in `rcode/references/design-library/`,
73
+ not invented) and WIREFRAMES.md (every screen from the IA decision in step 3b
74
+ of the Workflow section below, with role visibility and required
75
+ loading/empty/error/success states). Planning the
76
+ shell phase's tasks without these means the planner is guessing at what to
77
+ build — the shell phase's success criteria should reference both artifacts as
78
+ existing, not just "nav exists."
79
+
80
+ ### Enterprise Projects Need Auth Strategy and Role Mapping Decided Up Front
81
+
82
+ **If the project is multi-role, SSO-integrated, or compliance-sensitive, an
83
+ early phase MUST explicitly decide auth strategy (SSO/SAML/OIDC vs local
84
+ auth, session/tenant model) and produce a role-to-screen mapping — not defer
85
+ either to whichever phase happens to touch auth first.** Do not assume these
86
+ "come for free" alongside the shell phase — they don't. A roadmap that plans
87
+ navigation and a login screen but never decides which roles can reach which
88
+ screens can ship every phase individually verified and working, while an
89
+ Auditor role sees write actions it should never have access to, or SSO gets
90
+ retrofitted in a later phase and breaks every session model earlier phases
91
+ assumed. That is a real, observed failure mode, not a hypothetical.
92
+
93
+ Concretely: for multi-role/SSO/compliance-sensitive projects, the roadmap's
94
+ foundation phase (the same phase that plans the shell) success criteria must
95
+ also include something like "auth strategy (SSO provider or local auth) is
96
+ decided and documented" and "each role in scope is mapped to the
97
+ screens/actions it can access" — even if some roles' full permission sets are
98
+ refined in later phases. Every later phase that adds a new user-facing route
99
+ must include "role access defined for this route" as one of its own success
100
+ criteria, not just "linked from the app's navigation."
101
+
102
+ This is what `rcode-verifier`'s Level-5 Reachability check does NOT enforce —
103
+ it verifies a page is linked from nav, not that it's linked only for the
104
+ correct roles. If no phase ever planned the role mapping, no plan ever built
105
+ access control, and the verifier passes pages that are reachable but
106
+ reachable by everyone.
107
+
108
+ ### Multi-Role Projects Need Role-Differentiated UI Success Criteria
109
+
110
+ **If the project has more than one user role/permission level, at least one
111
+ phase's success criteria MUST include an observable statement of what each
112
+ role sees differently on screen** (e.g. "Employee sees own-record views only;
113
+ Manager sees a Team Approvals screen; Admin sees a Users/Roles management
114
+ screen") — not just "RBAC enforced at the API" or "permissions checked on the
115
+ backend." A roadmap can cleanly plan and ship Auth, RBAC-enforcement, and
116
+ Audit-trail phases, all individually verified and working, while never
117
+ producing a phase whose success criteria mentions what a Manager's screen has
118
+ that an Employee's doesn't. That is the same class of orphan-feature failure
119
+ the Shell Phase rule above exists to prevent, just for role visibility instead
120
+ of nav reachability: backend permission checks shipped, zero
121
+ role-differentiated UI ever asked about.
122
+
123
+ This applies to the nav itself, not just screen content: the Shell Phase's
124
+ success criteria must state which roles see which top-level nav
125
+ sections/menu items, not only "user can log in and see navigation to every
126
+ top-level area." Showing every role an identical full nav and relying on
127
+ route-level auth to 403 the sections they can't use is a common but bad
128
+ pattern — it leaks the existence of features a role shouldn't know about and
129
+ is worse UX than a nav that's filtered per role. For 2+-role projects, the
130
+ IA decision in step 3b below must include a `{top-level section -> roles
131
+ that see it}` mapping, and the Shell Phase success criteria must include an
132
+ observable statement like "user logged in as role X sees only the nav
133
+ sections role X is entitled to."
134
+
46
135
  ### On-Demand Rule Files
47
136
 
48
137
  | When you need... | Read |
@@ -58,6 +147,7 @@ Read only when the current task needs the detail. Don't preemptively load.
58
147
  1. **Read context** — REQUIREMENTS.md, FEATURES.md, ARCHITECTURE.md, STACK.md, RESEARCH.md (per `<files_to_read>`).
59
148
  2. **Cluster requirements** — group related requirements into natural delivery units.
60
149
  3. **Derive phases** — name each phase by what the user can DO after it, not what was built.
150
+ 3b. **Declare the Information Architecture** (UI projects only) — before phases are finalized, explicitly decide the app's eventual final-state IA, not per-phase: enumerate the top-level sections (e.g. Dashboard / Operations / Reports / Admin), pick sidebar vs topbar vs tabs, state max nesting depth (e.g. 2 levels: section > subsection), and group every planned phase's screens under one of those sections. Persist this as an `IA.md` (or a "## Information Architecture" section in ROADMAP.md). A flat list of nav links that grows by one item per phase is not an IA decision — it's the failure mode this step exists to prevent. Later phases must slot new routes under an existing top-level section or explicitly propose adding one, never silently append a new sidebar item.
61
151
  4. **Map 100% of requirements** — every req maps to exactly one phase. Verify coverage.
62
152
  5. **Write success criteria** — 2-5 observable behaviors per phase. Goal-backward.
63
153
  6. **Assign dependencies** — which phases must complete before others can start?
@@ -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
@@ -54,6 +54,14 @@ independent agents.
54
54
  fires when `/loop` is active — clarify the heartbeat path with the user first.
55
55
  6. **Ignore stray buffer text in panes.** Leftover user text at an idle prompt is NOT
56
56
  an agent question — do not Enter it.
57
+ 7. **First message to every newly spawned agent starts with `/rcode-do`.** After `cld`
58
+ launches in a pane and the agent is ready, the very first line sent via
59
+ `herdr pane send-text` must be the literal `/rcode-do <task description>`, followed by
60
+ the rest of the task context (worktree path, branch, scope). This routes the agent's
61
+ first action through rcode's command picker instead of a hand-rolled instruction, so
62
+ ad-hoc orchestration prompts stay consistent with the rest of the toolset. Applies to
63
+ both Mode 1 (single-shot) and Mode 2 (wave) dispatch — not to follow-up messages sent
64
+ later in the same pane.
57
65
 
58
66
  ---
59
67
 
@@ -95,7 +103,8 @@ Use when work is bounded and can finish in one batch.
95
103
  2. Create worktrees: `git worktree add ../sm-worktrees/$A -b audit-$A master` for each area.
96
104
  3. Create tab + split panes, one per worktree.
97
105
  4. Launch `cld` in every pane (`send-text "cld"` + `send-keys Enter`). Sleep 7s after.
98
- 5. Send each agent a self-contained prompt with worktree path, branch, and task.
106
+ 5. Send each agent a self-contained prompt with worktree path, branch, and task
107
+ the first line must be the literal `/rcode-do <task description>` (Golden rule 7).
99
108
  - Audits: diagnose-only first. Fixes: incremental edits, no rewrites, commit each fix.
100
109
  6. Monitor: `herdr pane list` every ~2 min. Unblock stuck panes via `send-keys`/`send-text`.
101
110
  7. Merge back: `git add -f .planning/audits/*.md && git commit` inside each worktree, then
@@ -5,6 +5,8 @@ Use this as the body of `herdr pane send-text` when dispatching each agent in a
5
5
  ---
6
6
 
7
7
  ```
8
+ /rcode-do fix top pending items from <AUDIT_DOC_PATH> on branch <BRANCH_NAME>
9
+
8
10
  You are in an isolated worktree at <WORKTREE_PATH> on branch <BRANCH_NAME>. <REPO_NAME> repo.
9
11
 
10
12
  YOUR PARENT BRANCH IS <INTEGRATION_BRANCH> (NOT master). Your branch was forked from <INTEGRATION_BRANCH>. When you finish, the orchestrator will merge your branch INTO <INTEGRATION_BRANCH> (not master). Master stays untouched throughout the campaign.
@@ -423,7 +423,7 @@ Phase ${PHASE_NUMBER}: Frontend phase detected — generating UI design contract
423
423
  Skill(skill="rcode-ui-phase", args="${PHASE_NUMBER}")
424
424
  ```
425
425
 
426
- Verify UI-SPEC was created. If still empty after ui-phase, display a non-blocking warning and proceed to 3b.
426
+ 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
427
 
428
428
  **Otherwise:** Skip silently to 3b.
429
429
 
@@ -767,7 +767,7 @@ Read the gaps summary from the audit file. Display:
767
767
  - **options:** "Continue anyway — accept gaps" / "Stop — fix gaps manually"
768
768
  - On "Stop": Go to handle_blocker.
769
769
 
770
- **Otherwise (autonomous):** Display `Audit ⏭ Gaps accepted — continuing` and proceed to 5b.
770
+ **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
771
 
772
772
  **If `tech_debt`:**
773
773
 
@@ -777,10 +777,16 @@ Show the summary, then:
777
777
  - **options:** "Continue with tech debt" / "Stop — address debt first"
778
778
  - On "Stop": Go to handle_blocker.
779
779
 
780
- **Otherwise (autonomous):** Display `Tech debt noted — continuing` and proceed to 5b.
780
+ **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
781
 
782
782
  ### 5b. Complete Milestone
783
783
 
784
+ **If `AUDIT_HAD_GAPS` is set:** Display before invoking the skill:
785
+
786
+ ```
787
+ ⚠ Marking milestone complete with known gaps/tech debt (see summary above).
788
+ ```
789
+
784
790
  ```
785
791
  Skill(skill="rcode-complete-milestone", args="${milestone_version}")
786
792
  ```
@@ -803,6 +809,8 @@ Cleanup shows its own dry-run and asks user for approval internally — this is
803
809
 
804
810
  ### 5d. Final Completion
805
811
 
812
+ **If `AUDIT_HAD_GAPS` is NOT set:**
813
+
806
814
  ```
807
815
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
808
816
  rcode ► AUTONOMOUS ▸ COMPLETE 🎉
@@ -815,6 +823,21 @@ Cleanup shows its own dry-run and asks user for approval internally — this is
815
823
  Ship it! 🚀
816
824
  ```
817
825
 
826
+ **If `AUDIT_HAD_GAPS` is set:**
827
+
828
+ ```
829
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
830
+ rcode ► AUTONOMOUS ▸ COMPLETE — WITH KNOWN GAPS ⚠
831
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
832
+
833
+ Milestone: {milestone_version} — {milestone_name}
834
+ Status: NOT audit-clean — gaps/tech debt accepted, not verified passed
835
+ Lifecycle: audit ⚠ → complete ✓ → cleanup ✓
836
+
837
+ This is not the same as "shippable." Review the gaps summary above and
838
+ resolve or explicitly accept each item before treating this as done.
839
+ ```
840
+
818
841
  **If autonomous created a branch** (i.e., `BRANCH_NAME` was set in the prepare_branch step):
819
842
 
820
843
  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
@@ -90,7 +90,7 @@ Gray areas are **implementation decisions the user cares about** — things that
90
90
 
91
91
  ```
92
92
  Phase: "User authentication"
93
- → Session handling, Error responses, Multi-device policy, Recovery flow
93
+ Auth strategy (SSO/Entra/OAuth vs local accounts vs magic link), Session handling, Error responses, Multi-device policy, Recovery flow
94
94
 
95
95
  Phase: "Organize photo library"
96
96
  → Grouping criteria, Duplicate handling, Naming convention, Folder structure
@@ -426,7 +426,13 @@ Analyze the phase to identify gray areas worth discussing. **Use both `prior_dec
426
426
  - These are **pre-answered** — don't re-ask unless this phase has conflicting needs
427
427
  - Note applicable prior decisions for use in presentation
428
428
 
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").
429
+ 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").
430
+
431
+ 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.
432
+
433
+ 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.
434
+
435
+ 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
436
 
431
437
  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
438
 
@@ -470,6 +476,7 @@ Gray areas:
470
476
  - Behavior: Loading pattern — ALREADY DECIDED: infinite scroll (Phase 4)
471
477
  - Empty State: What shows when no posts exist — EmptyState component exists in ui/
472
478
  - Content: What metadata displays (time, author, reactions count)
479
+ - Entry point: How users reach the feed — new sidebar link, existing nav tab, or route only?
473
480
  ```
474
481
  </step>
475
482
 
@@ -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}
@@ -202,7 +202,12 @@ Per-agent completion:
202
202
  ✓ rcode-executor complete: {plan-id} → SUMMARY.md ({N} commits)
203
203
  ```
204
204
 
205
- Closure:
205
+ Closure: this banner is NOT printed here, right after the wave loop. It is
206
+ gated behind `uat_gate` — see that step's "Only when `VERIFICATION_STATUS`
207
+ is `pass`" branch, which is the only point in `<process>` where phase
208
+ completion is actually confirmed (after code_review_gate, run_verify_commands,
209
+ close_parent_artifacts, the regression gate, and verify_phase_goal have all
210
+ passed):
206
211
  ```
207
212
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
208
213
  rcode ► PHASE {NN} COMPLETE ✓
@@ -514,13 +519,15 @@ After all waves:
514
519
  ```markdown
515
520
  ## Phase {X}: {Name} Execution Complete
516
521
 
517
- **Waves:** {N} | **Plans:** {M}/{total} complete
522
+ **Waves:** {N} | **Plans:** {M}/{total} executed
523
+
524
+ Verification gates (run_verify_commands, code_review_gate, regression gate, uat_gate) have not run yet — this table reflects agent execution only, not verification.
518
525
 
519
526
  | Wave | Plans | Status |
520
527
  |------|-------|--------|
521
- | 1 | plan-01, plan-02 | ✓ Complete |
522
- | CP | plan-03 | ✓ Verified |
523
- | 2 | plan-04 | ✓ Complete |
528
+ | 1 | plan-01, plan-02 | ✓ Executed |
529
+ | CP | plan-03 | ✓ Checkpoint passed |
530
+ | 2 | plan-04 | ✓ Executed |
524
531
 
525
532
  ### Plan Details
526
533
  1. **03-01**: [one-liner from SUMMARY.md]
@@ -823,7 +830,15 @@ fi
823
830
  2. Surface the tasks whose `<done>` criteria failed human verification.
824
831
  3. STOP. Don't mark complete on a failing verification.
825
832
 
826
- **Only when `VERIFICATION_STATUS` is `pass`** — proceed to `update_roadmap` below.
833
+ **Only when `VERIFICATION_STATUS` is `pass`** — print the closure banner, then proceed to `update_roadmap` below:
834
+ ```
835
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
836
+ rcode ► PHASE {NN} COMPLETE ✓
837
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
838
+ ```
839
+ This is the only point in `<process>` where the banner may be emitted — never
840
+ print it right after the wave loop finishes, and never before this gate
841
+ resolves to `pass`.
827
842
 
828
843
  The previous behaviour (printing "Next Up: /rcode-verify-work" without state-gating) caused phases to reach `status: complete` without any human-verified UAT.
829
844
  </step>
@@ -198,7 +198,7 @@ init → new-project → plan → execute → next → status → ship
198
198
  | `/rcode-check-implementation-readiness` | Verify a feature is fully ready to implement before writing code. |
199
199
  | `/rcode-review-edge-case-hunter` | Hunt for edge cases and boundary conditions before execution. |
200
200
  | `/rcode-diagnose-issues` | Triage and diagnose systemic issues before a debug session. |
201
- | `/rcode-ui-phase <n>` | Generate UI design contract (UI-SPEC.md) for frontend phases. |
201
+ | `/rcode-ui-phase <n>` | Generate UI design contract (UI-SPEC.md) and screen inventory (WIREFRAMES.md) for frontend phases. |
202
202
  | `/rcode-ui-review` | Retroactive 6-pillar visual audit of completed UI work. |
203
203
  | `/rcode-review --attack` | Hostile-perspective report — vulnerabilities, race conditions, abuse. |
204
204
  | `/rcode-review --edge-cases` | Enumerate edge cases by category and severity. |
@@ -204,7 +204,7 @@ HAS_UI=$?
204
204
 
205
205
  **If `HAS_UI` is 0 (frontend indicators found):**
206
206
 
207
- Check for existing UI-SPEC:
207
+ Check for existing UI-SPEC (rcode-ui-phase produces this alongside WIREFRAMES.md as a pair, so its presence is a reliable proxy for both):
208
208
  ```bash
209
209
  UI_SPEC_FILE=$(ls "${PHASE_DIR}"/*-UI-SPEC.md 2>/dev/null | head -1)
210
210
  ```