@hanzlaa/rcode 4.8.0 → 4.9.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.
@@ -157,9 +157,12 @@ test -f "${PHASE_DIR}/${PADDED_PHASE}-VALIDATION.md" && echo "VALIDATION_CREATED
157
157
  > Skip if `workflow.security_enforcement` is explicitly `false`. Absent = enabled.
158
158
 
159
159
  ```bash
160
- SECURITY_CFG=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.security_enforcement --raw 2>/dev/null || echo "true")
161
- SECURITY_ASVS=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.security_asvs_level --raw 2>/dev/null || echo "1")
162
- SECURITY_BLOCK=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.security_block_on --raw 2>/dev/null || echo "high")
160
+ SECURITY_CFG=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.security_enforcement --raw 2>/dev/null)
161
+ SECURITY_CFG=${SECURITY_CFG:-true} # config-get exits 0 with empty output when key absent; || fallback won't fire
162
+ SECURITY_ASVS=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.security_asvs_level --raw 2>/dev/null)
163
+ SECURITY_ASVS=${SECURITY_ASVS:-1} # config-get exits 0 with empty output when key absent; || fallback won't fire
164
+ SECURITY_BLOCK=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.security_block_on --raw 2>/dev/null)
165
+ SECURITY_BLOCK=${SECURITY_BLOCK:-high} # config-get exits 0 with empty output when key absent; || fallback won't fire
163
166
  ```
164
167
 
165
168
  **If `SECURITY_CFG` is `false`:** Skip to step 5.6.
@@ -183,8 +186,10 @@ Continue to step 5.6. Security config is passed to the planner in step 8.
183
186
  > Skip if `workflow.ui_phase` is explicitly `false` AND `workflow.ui_safety_gate` is explicitly `false` in `.rcode/config.yaml`. If keys are absent, treat as enabled.
184
187
 
185
188
  ```bash
186
- UI_PHASE_CFG=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.ui_phase 2>/dev/null || echo "true")
187
- UI_GATE_CFG=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.ui_safety_gate 2>/dev/null || echo "true")
189
+ UI_PHASE_CFG=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.ui_phase 2>/dev/null)
190
+ UI_PHASE_CFG=${UI_PHASE_CFG:-true} # config-get exits 0 with empty output when key absent; || fallback won't fire
191
+ UI_GATE_CFG=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.ui_safety_gate 2>/dev/null)
192
+ UI_GATE_CFG=${UI_GATE_CFG:-true} # config-get exits 0 with empty output when key absent; || fallback won't fire
188
193
  ```
189
194
 
190
195
  **If both are `false`:** Skip to step 6.
@@ -114,7 +114,7 @@ ${AGENT_SKILLS_PLANNER}
114
114
  <downstream_consumer>
115
115
  Output consumed by /rcode-execute. Plans need:
116
116
  - Frontmatter (wave, depends_on, autonomous, **files_modified** — aggregated list of all file paths from `<files>` blocks across every task; used by executor for intra-wave parallel-safety overlap detection)
117
- - Tasks in XML format with read_first, files, acceptance_criteria, verify (with `<automated>` child), and done fields (MANDATORY on every task)
117
+ - Tasks in XML format with read_first, files, evidence, verify (with `<automated>` child), and done fields (MANDATORY on every task)
118
118
  - Verification criteria
119
119
  - must_haves for goal-backward verification
120
120
  - **`## Files Touched`** section (see below) — required on every SPRINT.md
@@ -257,17 +257,13 @@ Every task MUST include these fields — they are NOT optional:
257
257
  - Executor checkpoint (knows what to stage after each task)
258
258
  - Example: `src/auth/auth.service.ts`, `tests/auth/auth.service.test.ts`
259
259
 
260
- 3. **`<acceptance_criteria>`** — Verifiable conditions that prove the task was done correctly. Rules:
261
- - Every criterion must be checkable with grep, file read, test command, or CLI output
262
- - NEVER use subjective language ("looks correct", "properly configured", "consistent with")
263
- - ALWAYS include exact strings, patterns, values, or command outputs that must be present
264
- - Examples:
265
- - Code: `auth.py contains def verify_token(` / `test_auth.py exits 0`
266
- - Config: `.env.example contains DATABASE_URL=` / `Dockerfile contains HEALTHCHECK`
267
- - Docs: `README.md contains '## Installation'` / `API.md lists all endpoints`
268
- - Infra: `deploy.yml has rollback step` / `docker-compose.yml has healthcheck for db`
269
-
270
- 4. **`<verify>`** — Shell commands that PROVE the acceptance criteria are met. Run by executor after task completes and by verifier during post-execution check. The block MUST contain an `<automated>` child with the exact commands to run (Dimension 8 hard-blocks without it). Rules:
260
+ 3. **`<evidence>`** — REQUIRED (issue #649). Must show codebase grounding proving the task is real, not theoretical. At minimum one of:
261
+ - `grep:` a literal grep/Glob pattern + count of matches that justified this task (e.g. `` `rg '\.alert' apps/web/src` → 13 hits across 9 files ``)
262
+ - `lines:` exact `path:line-line` ranges of code being modified
263
+ - `creates:` the file paths being created from scratch (with one-line justification why no existing file fits)
264
+ A task without `<evidence>` is theoretical and MUST NOT be written. (Matches `rcode/references/planner-playbook.md`'s "Task Anatomy" section — single source of truth for this rule.)
265
+
266
+ 4. **`<verify>`** — Shell commands that PROVE the `<done>` criteria are met. Run by executor after task completes and by verifier during post-execution check. The block MUST contain an `<automated>` child with the exact commands to run (Dimension 8 hard-blocks without it). Rules:
271
267
  - `<automated>` commands must exit 0 on success, non-zero on failure
272
268
  - Prefer `grep -q` for presence checks, `test -f` for file existence, project test runner for behavior
273
269
  - Keep commands short and composable — one check per line
@@ -325,7 +321,7 @@ Every task MUST include these fields — they are NOT optional:
325
321
  - [ ] Tasks are specific and actionable
326
322
  - [ ] Every task has `<read_first>` with at least the file being modified
327
323
  - [ ] Every task has `<files>` listing exact files this task will modify or create
328
- - [ ] Every task has `<acceptance_criteria>` with grep-verifiable conditions
324
+ - [ ] Every task has `<evidence>` with grep/lines/creates codebase grounding per issue #649 — not a prose checklist tag (none exists in the real plan schema)
329
325
  - [ ] Every task has `<verify>` with an `<automated>` child containing at least one shell command (Dimension 8 blocker)
330
326
  - [ ] Every task has `<done>` with a single observable acceptance sentence (Dimension 2 requirement)
331
327
  - [ ] Every `<action>` contains concrete values (no "align X with Y" without specifying what)
@@ -49,8 +49,8 @@ Read all files referenced by the invoking prompt's execution_context before star
49
49
  ${PHASE_GOAL_HAS_UI ? '@.rcode/references/ui-brand.md' : ''}
50
50
  @.rcode/references/karpathy-guidelines.md
51
51
  <!-- Read .rcode/references/agent-contracts.md only if defining or debugging agent contracts -->
52
- <!-- Read .rcode/references/gates.md only if implementing or troubleshooting gate logic -->
53
- @.rcode/references/thinking-models-planning.md
52
+ <!-- Read .rcode/references/gates.md only if implementing or troubleshooting gate logic; thinking-models-planning.md (127 lines) only if features.thinking_partner is enabled -->
53
+ ${THINKING_PARTNER_ENABLED === 'true' ? '@.rcode/references/thinking-models-planning.md' : ''}
54
54
  </required_reading>
55
55
 
56
56
  <available_agent_types>
@@ -117,6 +117,21 @@ if [ -n "$fails" ]; then
117
117
  fi
118
118
  ```
119
119
 
120
+ ## Step 3.5 — Prove It Moved the Needle
121
+
122
+ Passing the 5-component check in Step 3 only proves the file has the right shape — a triggers block, an Overview, a Workflow, an Output Format, and Examples. It says nothing about whether loading the skill actually changes what an agent does. A skill can be structurally perfect and still be a no-op in practice: the model reads it, nods along, and then falls back to its untrained default the moment a real scenario hits.
123
+
124
+ Do not mark a new or edited skill as ready to ship until you've run this gate:
125
+
126
+ 1. **Write the pressure scenario.** Take the exact situation the skill's triggers describe — the moment the skill is supposed to change the agent's behavior — and phrase it as a concrete task an agent could be handed cold, with no mention of the skill.
127
+ 2. **Run the control.** Spawn a fresh subagent with no memory of this conversation and the skill NOT loaded (do not mention it, do not point at its path). Give it the pressure scenario. Record what it does by default — this is almost always the suboptimal or wrong behavior the skill exists to correct.
128
+ 3. **Run the treatment.** Spawn a second fresh subagent, same scenario, this time with the skill loaded (either by having it available for the model to invoke, or by including its content directly in the prompt). Record what it does.
129
+ 4. **Compare.** The treatment run must diverge from the control run in the specific direction the skill claims to produce. "Both agents produced fine-looking output" is not a pass — the question is whether the skill was the reason for the difference. If the two runs land on the same behavior, the skill has no measurable effect yet, no matter how clean its markdown is.
130
+
131
+ If the comparison shows no behavioral difference, the skill is not done. Go back and sharpen the Workflow section, the triggers, or the examples — whichever part failed to actually steer the model — and rerun this gate. Do not ship on structural compliance alone.
132
+
133
+ Skip this gate only when scaffolding a brand-new, still-empty skill (Step 2's placeholders haven't been filled in yet — there's no behavior to test). Once real content replaces the placeholders, this gate becomes mandatory before the skill is considered ready.
134
+
120
135
  ## Step 4 — Confirm and Next Up
121
136
 
122
137
  Print:
@@ -127,13 +142,16 @@ Print:
127
142
 
128
143
  All 5 required components are present (triggers, Overview, Workflow,
129
144
  Output Format, Examples). The placeholders need real content before
130
- the skill becomes useful.
145
+ the skill becomes useful — and once they're filled in, run Step 3.5
146
+ (Prove It Moved the Needle) before calling the skill done.
131
147
 
132
148
  ▶ Next Up
133
149
  $EDITOR rcode/skills/actions/<group>/rcode-<NAME>/SKILL.md
134
150
  # fill in placeholders
135
151
  npx @hanzlaa/rcode install --force # install to .claude/skills/
136
152
  node --test test/compliance.test.cjs # verify compliance
153
+ # then: control vs. treatment
154
+ # subagent run (Step 3.5)
137
155
  ```
138
156
 
139
157
  ## Next Up
@@ -3,7 +3,8 @@ Verify threat mitigations for a completed phase. Confirm SPRINT.md threat regist
3
3
  </purpose>
4
4
 
5
5
  <required_reading>
6
- @.rcode/references/ui-brand.md
6
+ <!-- ui-brand.md (254 lines): only load when the phase goal/CONTEXT.md contains UI signals — mirrors plan.md:49's PHASE_GOAL_HAS_UI pattern -->
7
+ ${PHASE_GOAL_HAS_UI ? '@.rcode/references/ui-brand.md' : ''}
7
8
  </required_reading>
8
9
 
9
10
  <available_agent_types>
@@ -50,6 +51,11 @@ Parse: `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`,
50
51
  ```bash
51
52
  AUDITOR_MODEL=$(node ".rcode/bin/rcode-tools.cjs" resolve-model rcode-security-auditor --raw)
52
53
  SECURITY_CFG=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.security_enforcement --raw 2>/dev/null || echo "true")
54
+
55
+ # Detect UI signals in phase goal + CONTEXT.md to decide whether to load ui-brand.md (254 lines)
56
+ PHASE_GOAL_HAS_UI=$(grep -iEl "frontend|ui|component|design|style|brand" \
57
+ .planning/phases/*${phase_number}*/*-CONTEXT.md \
58
+ .planning/ROADMAP.md 2>/dev/null | head -1)
53
59
  ```
54
60
 
55
61
  If `SECURITY_CFG` is `false`: exit with "Security enforcement disabled. Enable via /rcode-settings."
@@ -3,7 +3,8 @@ Audit Nyquist validation gaps for a completed phase. Generate missing tests. Upd
3
3
  </purpose>
4
4
 
5
5
  <required_reading>
6
- @.rcode/references/ui-brand.md
6
+ <!-- ui-brand.md (254 lines): only load when the phase goal/CONTEXT.md contains UI signals — mirrors plan.md:49's PHASE_GOAL_HAS_UI pattern -->
7
+ ${PHASE_GOAL_HAS_UI ? '@.rcode/references/ui-brand.md' : ''}
7
8
  @.rcode/references/karpathy-guidelines.md
8
9
  </required_reading>
9
10
 
@@ -32,6 +33,11 @@ Parse: `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`.
32
33
  ```bash
33
34
  AUDITOR_MODEL=$(node ".rcode/bin/rcode-tools.cjs" resolve-model rcode-nyquist-auditor --raw)
34
35
  NYQUIST_CFG=$(node ".rcode/bin/rcode-tools.cjs" config-get workflow.nyquist_validation --raw)
36
+
37
+ # Detect UI signals in phase goal + CONTEXT.md to decide whether to load ui-brand.md (254 lines)
38
+ PHASE_GOAL_HAS_UI=$(grep -iEl "frontend|ui|component|design|style|brand" \
39
+ .planning/phases/*${phase_number}*/*-CONTEXT.md \
40
+ .planning/ROADMAP.md 2>/dev/null | head -1)
35
41
  ```
36
42
 
37
43
  If `NYQUIST_CFG` is `false`: exit with "Nyquist validation is disabled. Enable via /rcode-settings."