@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzlaa/rcode",
3
- "version": "4.10.6",
3
+ "version": "4.12.0",
4
4
  "description": "rcode — the AI team that never forgets. Persistent memory, specialist agents, and slash commands for AI IDEs. Works in Claude Code, Cursor, Gemini, VS Code, and Antigravity.",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
@@ -9,6 +9,7 @@ color: green
9
9
  @.rcode/references/karpathy-guidelines-full.md
10
10
  @.rcode/references/output-realism.md
11
11
  @.rcode/brain/best-practices/no-theoretical-suggestions.md
12
+ @.rcode/references/source-of-truth-grounding.md
12
13
  @.rcode/references/planner-playbook.md
13
14
 
14
15
  <role>
@@ -8,6 +8,7 @@ color: cyan
8
8
 
9
9
  @.rcode/references/response-style.md
10
10
  @.rcode/references/karpathy-guidelines.md
11
+ @.rcode/references/source-of-truth-grounding.md
11
12
  @.rcode/references/researcher-shared.md
12
13
 
13
14
  <role>
@@ -89,7 +90,7 @@ Named rules. Cite by name when applying.
89
90
  ## Workflow
90
91
 
91
92
  1. **Read `<files_to_read>` block** — mandatory before any other action.
92
- 2. **Understand the domain** — what ecosystem is this? What are the key libraries, frameworks, competitors?
93
+ 2. **Understand the domain** — what ecosystem is this? What are the key libraries, frameworks, competitors? Also verify: what roles/permission model does this project need (single-user, multi-role, multi-tenant)? What auth mechanism/provider fits (e.g. Clerk, Auth0, NextAuth, custom JWT)? What languages/locales must the project support (single-locale, i18n from day one, RTL)? Record findings in STACK.md's Auth & Identity and Localization rows — don't let this surface only implicitly in FEATURES.md or ARCHITECTURE.md.
93
94
  3. **Verify current state** — Context7 or official docs for critical technology claims. Flag LOW confidence for training-only findings.
94
95
  4. **Select research mode** — Ecosystem (default) / Feasibility / Comparison.
95
96
  5. **Write 5 output files** in `.rcode/research/`:
@@ -9,6 +9,7 @@ color: purple
9
9
  @.rcode/references/response-style.md
10
10
  @.rcode/references/output-realism.md
11
11
  @.rcode/references/karpathy-guidelines.md
12
+ @.rcode/references/source-of-truth-grounding.md
12
13
  @.rcode/references/roadmapper-playbook.md
13
14
 
14
15
  <role>
@@ -7,6 +7,7 @@ color: green
7
7
 
8
8
  @.rcode/references/response-style.md
9
9
  @.rcode/references/karpathy-guidelines.md
10
+ @.rcode/references/source-of-truth-grounding.md
10
11
  @.rcode/references/sprint-checker-playbook.md
11
12
 
12
13
  <role>
@@ -29,6 +29,8 @@ Named rules. Cite by name when applying.
29
29
  - **10th-time-user** — delight happens through invisible efficiency. Design for the person who has done this 10 times, not just the first-timer.
30
30
  - **Ship-then-layer** — recommend the simplest version that ships, then layer complexity. Perfect designs that never launch are zero value.
31
31
  - **Name-one-misconception** — for every confusing design element, name the specific misconception and design around it.
32
+ - **Library-not-invention** — when producing UI-SPEC.md or WIREFRAMES.md, ground tokens and palette choices in `rcode/references/design-library/` AND real reference sites actually looked at (not just search snippets), not invented values. WIREFRAMES.md's loading/empty/error/populated coverage per screen is Silence-kills-trust made concrete, per-screen.
33
+ - **Variants-not-a-verdict** — visual direction is a taste-and-tradeoff decision, not a data lookup with one right answer. When asked to propose a design direction, generate genuinely distinct options and let the user pick — don't rank them or present a "recommended" one, that's the same failure as silently locking in a stack choice without asking.
32
34
 
33
35
  ## Anti-Patterns / Refuse List
34
36
 
@@ -26,8 +26,8 @@ Goal-backward verification. Start from what the phase SHOULD deliver, verify it
26
26
  - **DO NOT assume existence = implementation** — need level 2 (substantive), 3 (wired), and 4 (data flowing) for dynamic-data artifacts.
27
27
  - **DO NOT skip key link verification** — 80% of stubs hide in wiring.
28
28
  - **Structure gaps in YAML frontmatter** for `/rcode-plan --gaps`.
29
- - **DO flag for human verification when uncertain** (visual, real-time, external service).
30
- - **Keep verification fast**use grep/file checks, not running the app.
29
+ - **DO flag for human verification when uncertain** (visual, real-time, external service) — but flagging is NOT a pass. A phase with unresolved human-verification items on its user-facing surface is NOT "complete" or "shippable"; say so explicitly in the summary you return to the orchestrator.
30
+ - **Static checks (grep/file-existence) stay fast for levels 1-3 but a UI-facing phase is not verified until Level 5 (Reachability, see `reachability-check.md`) runs.** A page component existing, importing cleanly, and rendering real data is not the goal — a real user finding and using it from the app's actual navigation is. Don't let "keep it fast" become "never open the app."
31
31
  - **DO NOT commit** — leave committing to the orchestrator.
32
32
  - **Use Write tool for VERIFICATION.md** — never `Bash(cat << 'EOF')`.
33
33
 
@@ -23,11 +23,12 @@ Plan X.2 (Wave 1): API Endpoint
23
23
  Plan X.3 (Wave 2): UI Form/Component
24
24
  - Build React component
25
25
  - Wire to API endpoint
26
+ - Wire route into nav/menu (sidebar, header, or route table) so the feature is reachable without a direct URL
26
27
  - Integration test: form → API → database
27
28
 
28
29
  Plan X.4 (Wave 3): End-to-End Verification
29
30
  - Test full user flow (UI → API → DB → UI)
30
- - Checkpoint: Visual/functional review
31
+ - Checkpoint: Visual/functional review — can you reach this feature from the main nav without a direct URL?
31
32
  ```
32
33
 
33
34
  **Dependencies:** 1.3 → {1.1, 1.2}, 1.4 → 1.3
@@ -38,6 +38,37 @@ Must be TRUE:
38
38
 
39
39
  **Test:** Each truth verifiable by a human using the application without reading code.
40
40
 
41
+ **UI goals — add a reachability truth.** If any artifact for this goal is a page, route, or screen a user navigates to, one of the truths must be that the user can reach it through existing navigation, not just that it works once they're on it:
42
+ - "User can reach {feature} from existing navigation without typing the URL directly"
43
+
44
+ This must carry through to Step 3 (a nav component — header, sidebar, menu — is a required artifact alongside the new page) and Step 5 (a key link from that nav component to the new route). A feature that functions perfectly at an orphan route with no menu entry or link pointing to it does not satisfy the goal.
45
+
46
+ **Nav artifact precondition.** "Nav/menu component updated with a link" is not itself a valid artifact — it is single-role and structure-agnostic, and satisfying it by bolting one more top-level `<a>` onto whatever markup exists guarantees IA drift across phases. Before writing that artifact line:
47
+ - Reference the existing IA decision (the ROADMAP-level nav/IA plan) that this route slots into. If no IA doc exists yet — this is genuinely the first UI phase — this phase must produce one (containers, nesting levels, role visibility) before the nav artifact can be written; do not defer it to a later phase.
48
+ - State which nav container the link belongs in (e.g. sidebar primary, topbar, settings submenu), not just "the nav."
49
+ - State the nesting depth (top-level vs. nested under an existing section).
50
+ - State which roles see it, if the app has more than one role.
51
+
52
+ **Multi-role goals — add a role-visibility truth.** If the project has more than one user role/permission level (per REQUIREMENTS.md/PROJECT.md), one of the truths must state what that role sees or cannot see on screen — nav items, dashboard content, visible/hidden fields, enabled/disabled actions — not only what API calls it can or cannot make:
53
+ - "Employee sees only their own timesheet in nav; Manager additionally sees a Team Approvals nav item; Admin additionally sees a Users/Roles admin screen."
54
+
55
+ A truth like "User can't access protected pages without logging in" covers the route gate but not RBAC — it says nothing about what an authenticated Employee vs Manager vs Admin actually sees. RBAC = each role has a different UI, not just a blocked route.
56
+
57
+ **Example: Settings Page Goal**
58
+
59
+ Must be TRUE:
60
+ - User can view and edit their profile settings
61
+ - Changes save and persist
62
+ - User can reach the settings page from existing navigation without typing the URL directly
63
+
64
+ Artifacts:
65
+ - Settings page component
66
+ - Settings API route
67
+ - Nav/menu component updated with a link to the settings route, per existing IA plan: sidebar primary nav, top-level, visible to all authenticated roles
68
+
69
+ Key link:
70
+ - Nav component → `/settings` route link → if broken: page works but is undiscoverable
71
+
41
72
  ---
42
73
 
43
74
  ## Step 3: Derive Required Artifacts
@@ -161,6 +192,7 @@ must_haves:
161
192
  5. User stays logged in after page refresh
162
193
  6. User can log out
163
194
  7. User can't access protected pages without logging in
195
+ 8. Each role sees a different UI: Employee's nav shows only their own timesheet; Manager's nav additionally shows Team Approvals; Admin's nav additionally shows a Users/Roles admin screen
164
196
 
165
197
  ### Artifacts Needed
166
198
  - Login form component
@@ -169,6 +201,7 @@ must_haves:
169
201
  - User database model
170
202
  - Session/JWT infrastructure
171
203
  - Protected route wrapper
204
+ - Role-aware nav component (renders nav items conditionally per role)
172
205
 
173
206
  ### Wiring
174
207
  - Form → API endpoint
@@ -41,6 +41,7 @@ Before outputting a SPRINT.md file, run this self-check to catch common planning
41
41
  - [ ] No references to files that don't exist
42
42
  - [ ] Every task references concrete, existing file paths
43
43
  - [ ] Context bloat < 50% (if context section > 300 lines, trim it)
44
+ - [ ] If any artifact is a new page/route/screen, at least one truth/key_link covers reachability from existing navigation (or explicitly notes it is intentionally direct-link-only)
44
45
 
45
46
  ### Objective & Output
46
47
 
@@ -181,17 +181,36 @@ Use for unavoidable manual steps (1% of checkpoints).
181
181
  5. Success behavior: call onSubmit({ email, password })
182
182
  6. Use Sonner toast on error (not alert())
183
183
  7. Disabled state during submission (no double-click)
184
+ 8. Navigation wiring: add entry to nav/menu component so page is reachable
185
+ without direct URL (skip only if this task does not introduce a new
186
+ route/page)
184
187
  </action>
185
188
  <verify>
186
189
  <automated>npm test -- --filter=LoginForm</automated>
190
+ <automated>grep -r "login" src/components/nav/ src/config/routes*</automated>
187
191
  </verify>
188
192
  <done>
189
193
  Component renders, accepts input, calls onSubmit, disables during submission,
190
- shows errors with toast notification
194
+ shows errors with toast notification, page is reachable from nav/menu
195
+ (not just direct URL)
191
196
  </done>
192
197
  </task>
193
198
  ```
194
199
 
200
+ **Required states for any component that fetches or displays dynamic data**
201
+ (list views, dashboards, detail pages — not static content): the `<action>`
202
+ and `<done>` must each name all four, not just the happy path:
203
+ - **Loading** — what renders while data is in flight (skeleton, spinner — not a blank screen)
204
+ - **Empty** — what renders when the fetch succeeds but returns nothing (a message + next action, not a blank screen)
205
+ - **Error** — what renders when the fetch/action fails (specific, not a generic "something went wrong")
206
+ - **Populated** — the normal case
207
+
208
+ A task whose `<done>` only describes the populated case ("shows the list of
209
+ items") is incomplete for any component with a real data dependency — sprint-
210
+ checker's Dimension 2 now flags this (see `sprint-checker/dimensions.md`).
211
+ If WIREFRAMES.md exists for this screen (`/rcode-ui-phase` output), copy its
212
+ per-state description here rather than re-deriving it.
213
+
195
214
  ---
196
215
 
197
216
  ## Configuration Task Template
@@ -207,6 +207,16 @@ Based on research, suggested phase structure:
207
207
  |------------|---------|---------|-----|
208
208
  | [tech] | [ver] | [what] | [rationale] |
209
209
 
210
+ ### Auth & Identity
211
+ | Technology | Version | Purpose | Why |
212
+ |------------|---------|---------|-----|
213
+ | [tech] | [ver] | [roles/auth mechanism] | [rationale] |
214
+
215
+ ### Localization
216
+ | Technology | Version | Purpose | Why |
217
+ |------------|---------|---------|-----|
218
+ | [tech] | [ver] | [locales/i18n mechanism] | [rationale] |
219
+
210
220
  ### Supporting Libraries
211
221
  | Library | Version | Purpose | When to Use |
212
222
  |---------|---------|---------|-------------|
@@ -47,6 +47,24 @@ issue:
47
47
  - Missing `<done>` — no acceptance criteria
48
48
  - Vague `<action>` — "implement auth" instead of specific steps
49
49
  - Empty `<files>` — what gets created?
50
+ - `<verify>` present but not semantically capable of proving the task's claim — see check below
51
+
52
+ **Check — Verify Semantically Matches Claim (links to Dimension 6):**
53
+ Presence of `<verify>` is not enough. Cross-check it against the must_haves truth the task claims to satisfy (Dimension 6):
54
+ - If the task's `<action>` implements user-observable behavior (login, checkout, search, any flow a user drives), a `<verify>` consisting only of build/lint/typecheck commands (`npm run build`, `tsc --noEmit`, `eslint`, `echo done`) does **not** satisfy this dimension — it proves the code compiles, not that the behavior works.
55
+ - Require instead an assertion against actual output/behavior: a curl/HTTP call checking status/body, a test that exercises the route or flow, or an explicit manual-verification checkpoint (`checkpoint:*` task type).
56
+ - Flag as blocker: "Task N's <verify> only compiles/lints but action implements user-facing behavior X — no assertion on actual behavior."
57
+
58
+ **Check — Required States for Dynamic-Data Components:**
59
+ If a task's `<action>` creates or modifies a component that fetches or
60
+ displays dynamic data (a list, dashboard, detail page — check for
61
+ fetch/query/API-call language in the action), its `<action>` and `<done>`
62
+ must each name all four states: loading, empty, error, populated. A task
63
+ whose `<done>` only describes the populated case ("shows the list of items")
64
+ is incomplete — flag as blocker, not warning, since a missing empty/error
65
+ state is a real UX gap a user will hit, not a style nitpick.
66
+ - Flag as blocker: "Task N's component fetches/displays dynamic data but `<action>`/`<done>` only cover the populated case — no loading/empty/error state defined."
67
+ - Exception: if WIREFRAMES.md exists (`/rcode-ui-phase` output) and already defines the four states for this screen, a task that references WIREFRAMES.md instead of re-listing them inline is fine — check WIREFRAMES.md's entry for this screen before flagging.
50
68
 
51
69
  **Example issue:**
52
70
  ```yaml
@@ -59,6 +77,17 @@ issue:
59
77
  fix_hint: "Add verification command for build output"
60
78
  ```
61
79
 
80
+ **Example issue — verify doesn't prove the claim:**
81
+ ```yaml
82
+ issue:
83
+ dimension: task_completeness
84
+ severity: blocker
85
+ description: "Task 3 implements login flow but <verify> only runs `npm run build`"
86
+ plan: "16-01"
87
+ task: 3
88
+ fix_hint: "Replace with a curl against /api/login checking 200 + session cookie, or a test exercising the login route"
89
+ ```
90
+
62
91
  ## Dimension 3: Dependency Correctness
63
92
 
64
93
  **Question:** Are plan dependencies valid and acyclic?
@@ -103,6 +132,7 @@ issue:
103
132
  - API route created but component doesn't call it
104
133
  - Database model created but API doesn't query it
105
134
  - Form created but submit handler is missing or stub
135
+ - New page/component has no task adding it to the router, nav, or an existing page's imports — unreachable by any user
106
136
 
107
137
  **What to check:**
108
138
  ```
@@ -110,8 +140,27 @@ Component -> API: Does action mention fetch/axios call?
110
140
  API -> Database: Does action mention Prisma/query?
111
141
  Form -> Handler: Does action mention onSubmit implementation?
112
142
  State -> Render: Does action mention displaying state?
143
+ Nav -> Route: For any new page/route/component in must_haves.artifacts, does a task action mention adding it to the router config, nav/sidebar, or an existing page's import?
113
144
  ```
114
145
 
146
+ A top-level UI artifact (page/route/component) with no Nav -> Route reference anywhere in the sprint's tasks is a blocker — internal wiring can be perfect while the feature stays unreachable by any user.
147
+
148
+ **Check — Role Access Defined (multi-role/SSO/compliance projects only):**
149
+ `roadmapper-playbook.md`'s "Enterprise Projects Need Auth Strategy and Role
150
+ Mapping Decided Up Front" rule requires every later phase adding a
151
+ user-facing route to include "role access defined for this route" as a
152
+ success criterion — explicitly NOT covered by `rcode-verifier`'s Level-5
153
+ Reachability check (which only confirms a page is linked from nav, not that
154
+ it's linked/gated correctly per role). If PROJECT.md/REQUIREMENTS.md show
155
+ more than one user role, cross-reference each new route in
156
+ `must_haves.artifacts` against the roadmap's role-to-screen mapping (IA.md or
157
+ ROADMAP.md's IA section — see roadmapper-playbook.md step 3b): does a task
158
+ state which roles can/cannot reach this route, or is role access left
159
+ undefined? A new route with no role-access statement anywhere in the sprint's
160
+ tasks is a blocker for multi-role projects — the same orphan-feature failure
161
+ as unreachable nav, just for authorization instead of discoverability.
162
+ - Flag as blocker: "Route {path} added with no role-access statement — roadmap's role mapping shows N roles but no task defines who can/cannot reach this route."
163
+
115
164
  **Example issue:**
116
165
  ```yaml
117
166
  issue:
@@ -167,12 +216,26 @@ issue:
167
216
  2. Verify truths are user-observable (not implementation details)
168
217
  3. Verify artifacts support the truths
169
218
  4. Verify key_links connect artifacts to functionality
219
+ 5. Cross-reference each truth to a falsifiable `<verify>` command: for each `must_haves.truths` entry, search every task's `<verify>` block (across all plans in the sprint) for a command that could actually falsify that truth — a curl/HTTP assertion, a UI interaction test (playwright/cypress selector + assertion), or an explicit manual checkpoint script tied to the same feature. Wording alone (the truth "sounds" user-facing) does not count as a check.
220
+ 6. If no task's `<verify>` traces to a truth, flag it as unverifiable — do not accept the phrasing as proof the behavior is tested.
221
+
222
+ **Check — Truth-to-Verify Traceability (do not rely on wording alone):**
223
+ Judging "user-observable" from phrasing is not a check — a planner can trivially write `"The auth system is secure"` without any task exercising login. Treat this the same way Dimension 12 cross-references evidence claims to grep hit counts:
224
+ 1. For each `must_haves.truths` entry, extract the subject/action it claims (e.g., "user can log in", "search returns results").
225
+ 2. Scan every task's `<verify>` block across the sprint's plans for a command whose target matches that subject — a route/endpoint the truth implies (`/api/login`, `/search`), a selector the truth implies (login form, search box), or a checkpoint script named for the same feature.
226
+ 3. A match requires the `<verify>` command to actually exercise real input against the feature and assert on real output (status code, response body, rendered DOM state) — not just that the words in the truth and the `<verify>` block resemble each other.
227
+ 4. No match found → the truth is **unverifiable**, regardless of how user-facing its wording sounds. Flag it; do not accept the phrasing as proof.
170
228
 
171
229
  **Red flags:**
172
230
  - Missing `must_haves` entirely
173
231
  - Truths are implementation-focused ("bcrypt installed") not user-observable ("passwords are secure")
174
232
  - Artifacts don't map to truths
175
233
  - Key links missing for critical wiring
234
+ - Truth uses user-facing wording but no task's `<verify>` exercises the corresponding user path (e.g., "The auth system is secure" with no login/reject-bad-credentials check anywhere in the sprint) — unfalsifiable marketing language, not a verified outcome
235
+
236
+ **Severity rules:**
237
+ - **blocker:** a `must_haves.truths` entry has zero traceable `<verify>` command in any task across the sprint's plans
238
+ - **warning:** the traced `<verify>` command exists but only checks an implementation detail (e.g., process exits 0) rather than the user-observable behavior the truth claims
176
239
 
177
240
  **Example issue:**
178
241
  ```yaml
@@ -187,6 +250,17 @@ issue:
187
250
  fix_hint: "Reframe as user-observable: 'User can log in', 'Session persists'"
188
251
  ```
189
252
 
253
+ **Example issue — untraceable truth:**
254
+ ```yaml
255
+ issue:
256
+ dimension: verification_derivation
257
+ severity: blocker
258
+ description: "Truth 'The auth system is secure' has no task <verify> that exercises login or rejects bad credentials"
259
+ plan: "02"
260
+ truth: "The auth system is secure"
261
+ fix_hint: "Add a <verify> with a curl/HTTP assertion (e.g. POST /login with wrong password returns 401) or a UI test that logs in and confirms session state, then reference it from this truth"
262
+ ```
263
+
190
264
  ## Dimension 7: Context Compliance (if CONTEXT.md exists)
191
265
 
192
266
  **Question:** Do plans honor user decisions from /rcode-discuss-phase?
@@ -409,6 +483,61 @@ issue:
409
483
  fix_hint: "Plan was built on hallucinated findings. Re-run /rcode-debug to verify actual code state before replanning."
410
484
  ```
411
485
 
486
+ ## Dimension 12: Evidence Grounding
487
+
488
+ **Question:** Is every claim in the plan traceable to something real — a codebase grep, or an external source-of-truth document — rather than plausible-sounding invention?
489
+
490
+ This dimension has two halves. Both exist because agents produce fluent,
491
+ confident, wrong output when nothing forces them to cite a real source —
492
+ codebase claims and domain-terminology claims fail the same way, just
493
+ against different ground truths.
494
+
495
+ ### 12a — Codebase Evidence (issue #649)
496
+
497
+ Every task body that names a file count, component, pattern, or existing
498
+ behavior MUST include an `<evidence>` block citing real grep hit counts,
499
+ real `path:line` ranges, or an explicit `creates:` justification (for
500
+ genuinely new files/symbols that can't have prior evidence). A task claiming
501
+ "13 usages of `useAuth`" with no evidence, or citing a grep that doesn't
502
+ actually return 13, is theoretical — reject it.
503
+
504
+ **Process:**
505
+ 1. For each task with a factual claim about existing code, check for an `<evidence>` block.
506
+ 2. If present, re-run a sample of the cited greps/searches yourself. If the claimed count doesn't match reality, downgrade to blocker regardless of what the task otherwise looks like.
507
+ 3. If absent for a claim that isn't a `creates:` (brand new file/symbol), flag as blocker — the claim is unfalsifiable as written.
508
+
509
+ ### 12b — Source-Document Evidence
510
+
511
+ If PROJECT.md/REQUIREMENTS.md/CONTEXT.md reference an external source-of-truth
512
+ document (a spreadsheet, transcript, spec, glossary — see
513
+ `source-of-truth-grounding.md`) that defines domain terminology, enum values,
514
+ or a data model, any task creating schema fields, enum values, or seed data
515
+ for that domain MUST cite the source document and use its verbatim values —
516
+ not an invented approximation that merely sounds plausible for "this kind of
517
+ system." This is exactly how a competency-tracking app once shipped invented
518
+ category names (`TECH`, `DELIV`, `COLLAB`) instead of the real Excel's actual
519
+ categories (`Technical Skills`, `Delivery & Quality`, `Communication &
520
+ Collaboration`) — plausible, well-formatted, and wrong.
521
+
522
+ **Process:**
523
+ 1. Check whether PROJECT.md/REQUIREMENTS.md mention a source document for this domain.
524
+ 2. If yes, for each schema/seed-data task touching that domain, verify the task cites the source document path and that its field/enum values are traceable to it (spot-check by reading the source yourself if it's available).
525
+ 3. A schema/seed task for a domain with a known source document, with no citation and no traceable match, is a blocker — not a style nitpick. This is exactly the class of mistake that's expensive to unwind once it's in a live database.
526
+
527
+ **Severity rules:**
528
+ - **blocker:** 12a claim with no evidence and no `creates:` justification, evidence that doesn't check out on re-run, OR 12b schema/seed task for a known-source domain with no citation/traceable match
529
+ - **warning:** evidence present but thin (e.g. cites a grep pattern too broad to actually confirm the specific claim)
530
+
531
+ **Example issue:**
532
+ ```yaml
533
+ issue:
534
+ dimension: evidence_grounding
535
+ severity: blocker
536
+ description: "Task 3 seeds 'competency' enum with TECH/DELIV/COLLAB/GROWTH/IMPACT — PROJECT.md references docs/Competency-Matrix.xlsx as the source of truth for these categories, but no task reads it or cites its actual values"
537
+ plan: "01"
538
+ fix_hint: "Read docs/Competency-Matrix.xlsx (or its extracted contents) and replace the enum values with what it actually defines, verbatim"
539
+ ```
540
+
412
541
  </verification_dimensions>
413
542
 
414
543
  <verification_process>
@@ -84,6 +84,18 @@ Session persists | 01 | 3 | COVERED
84
84
 
85
85
  For each requirement: find covering task(s), verify action is specific, flag gaps.
86
86
 
87
+ **Sub-behavior check (concrete, not eyeballed):** A task ID in the `Tasks` column is not proof of coverage by itself. For each requirement:
88
+ 1. Split the requirement's acceptance-criteria text (from ROADMAP.md/PRD, or the `must_haves.truths` derived from it) into discrete sub-behaviors — each verb phrase is one sub-behavior (e.g. "user can reset password" -> ["request reset email", "receive token", "verify token", "set new password"]).
89
+ 2. For each sub-behavior, check the covering task's `<action>` and `<verify>` text contains a concrete reference to it (a matching noun/verb, file, or endpoint) — not just the requirement's headline phrase.
90
+ 3. If one task covers a multi-sub-behavior requirement, list which sub-behaviors its action/verify actually address. Any sub-behavior with zero matching action/verify text is **unaddressed**.
91
+ 4. Status is `COVERED` only if every sub-behavior maps to at least one action/verify pair. If any sub-behavior is unaddressed, status is `PARTIAL` and is a **blocker**, not a note — list the specific missing sub-behavior(s), not a generic "may be incomplete" remark.
92
+
93
+ ```
94
+ Requirement | Plans | Tasks | Status | Missing sub-behaviors
95
+ ----------------------|-------|-------|---------|----------------------
96
+ User can reset password | 01 | 4 | PARTIAL | token verification, email send
97
+ ```
98
+
87
99
  **Exhaustive cross-check:** Also read PROJECT.md requirements (not just phase goal). Verify no PROJECT.md requirement relevant to this phase is silently dropped. A requirement is "relevant" if the ROADMAP.md explicitly maps it to this phase or if the phase goal directly implies it — do NOT flag requirements that belong to other phases or future work. Any unmapped relevant requirement is an automatic blocker — list it explicitly in issues.
88
100
 
89
101
  ## Step 5: Validate Task Structure
@@ -44,6 +44,10 @@ Record pass/fail:
44
44
  ## Constraints
45
45
 
46
46
  - Each check must complete in under 10 seconds
47
- - Do not start servers or services — only test what's already runnable
47
+ - Do not start servers or services for these checks specifically — only test
48
+ what's already runnable. (This does NOT apply to the Level-5 reachability
49
+ live smoke check in `reachability-check.md`, which exists precisely because
50
+ UI-facing phases need a running server to verify — see that file for when
51
+ and how to start one.)
48
52
  - Do not modify state (no writes, no mutations, no side effects)
49
53
  - If the project has no runnable entry points yet, skip with: "Step 7b: SKIPPED (no runnable entry points)"
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Step 8: Identify Human Verification Needs
4
4
 
5
+ A flagged item here is an open item, not a pass. Do not describe a phase with
6
+ unresolved human-verification items as "complete," "closed," "passed," or
7
+ "shippable" anywhere in the summary handed back to the orchestrator — say
8
+ what's still unconfirmed and by whom (the user, not another agent).
9
+
5
10
  **Always needs human:** Visual appearance, user flow completion, real-time behavior, external service integration, performance feel, error message clarity.
6
11
 
7
12
  **Needs human if uncertain:** Complex wiring grep can't trace, dynamic state behavior, edge cases.
@@ -0,0 +1,69 @@
1
+ # Verifier — Reachability + Live UI Smoke Check (Steps 6b, 10b)
2
+
3
+ Levels 1-4 (exists, substantive, wired, data-flows) verify an artifact works in
4
+ isolation. None of them verify that a real user, starting from the app's actual
5
+ entry point, can ever land on it. That gap is how a phase gets marked "passed"
6
+ while the delivered page has no nav link, no sidebar entry, and no way in
7
+ except typing its exact URL — code-complete, unusable.
8
+
9
+ **When to run:** Any phase whose must-haves include a user-facing route, page,
10
+ or screen (not API-only, not CLI-only, not backend/schema-only phases).
11
+
12
+ ## Step 6b — Reachability (static)
13
+
14
+ For each user-facing route delivered by this phase:
15
+
16
+ 1. Find the app's navigation surface — the layout/shell component(s) that
17
+ render on every page (e.g. `layout.tsx`, `Nav.tsx`, `Sidebar.tsx`,
18
+ `AppShell.tsx` — whatever this project actually uses).
19
+ 2. Grep it for a link to the route:
20
+ ```bash
21
+ grep -rn "$ROUTE_PATH" src/app/layout.tsx src/components/Nav* src/components/*Sidebar* 2>/dev/null
22
+ ```
23
+ 3. If found → Reachable ✓. If not found → Reachable ✗, classify as
24
+ **ORPHANED-FROM-UI**: the code works but no real user can find it without
25
+ the URL bar.
26
+
27
+ **If the project has no shell/nav component at all yet** — that is itself a
28
+ gap, not a reason to skip this check. A phase that ships pages with nowhere to
29
+ click from IS the gap. Report it as: "No app shell/navigation exists — every
30
+ delivered page is orphaned from UI by definition."
31
+
32
+ ## Step 10b — Live smoke check (dynamic)
33
+
34
+ Static reachability (6b) can be fooled by a nav link that renders but is
35
+ broken, hidden, or dead. Confirm it live:
36
+
37
+ 1. Start the dev server if one isn't already running (check first —
38
+ `curl -s -o /dev/null -w '%{http_code}' $BASE_URL` — don't start a
39
+ duplicate). Note the port and PID so it can be left running or killed
40
+ depending on project convention.
41
+ 2. Fetch the app's real entry point — the URL a user actually opens first
42
+ (usually `/`, or the post-login landing page), not the new route directly:
43
+ ```bash
44
+ curl -s $BASE_URL/ | grep -o "$ROUTE_PATH" | head -1
45
+ ```
46
+ A hit means the entry point's rendered HTML contains a link to the route.
47
+ No hit means either the link isn't there, it's client-rendered (acceptable
48
+ — note it and move to a browser check if available), or the entry point
49
+ itself is broken.
50
+ 3. If a browser automation tool is available in this session, prefer it over
51
+ curl: open the entry point, look for the nav element, click through to the
52
+ route, confirm the expected content renders. This catches what curl can't
53
+ (JS-rendered nav, auth redirects, broken client routing).
54
+ 4. If neither curl nor a browser tool can settle it, route to human
55
+ verification (Step 8) — but say explicitly what's unconfirmed ("nav link
56
+ renders in JS, could not click through without a browser tool") rather than
57
+ silently passing it.
58
+
59
+ ## Constraints
60
+
61
+ - Time-box this to the phase's own routes — don't crawl the whole app.
62
+ - If starting the dev server fails (missing DB, missing env vars, port
63
+ conflict) — that is itself a finding. Report it, don't silently skip
64
+ reachability and mark the phase passed.
65
+ - Kill any dev server this check started, unless the project's own workflow
66
+ expects it to stay up (check for an existing `pnpm dev` process first).
67
+ - This step existing does not replace a human actually looking at the app.
68
+ It catches the mechanical case (no link exists at all). Visual/UX quality
69
+ still routes to human verification per Step 8.