Merge bugfix/degraded-tool-line into develop

This commit is contained in:
bchanot committed 2026-11-19 14:07:42 +01:00
commit 4a8dffb0ba
12 files changed
+291 -16

No files matched your search

+5
View File
@@ -132,4 +132,9 @@
<!-- /ship-feature advisor-points-b3 2026-11-18 (2b7aeb8, 51f343f): STEP 6 review root fix, not in the run's file scope --> <!-- /ship-feature advisor-points-b3 2026-11-18 (2b7aeb8, 51f343f): STEP 6 review root fix, not in the run's file scope -->
- lib/verify-secure-loop.md:111,:126-128 + agents/security-auditor.md:184,:190-192 — teach parsing DEGRADED off the `SECURITY — VERDICT:` line, but the auditor prints `VERDICT: PASS` on a DEGRADED scan and DEGRADED only on its `TOOL:` line (agents/security-auditor.md:133-134). A reader checking the VERDICT line misses it. feat/bugfix skip text now names the TOOL line at the site (51f343f). Fix direction: say DEGRADED shows on the TOOL line beside a PASS, in both. Severity: low. Discovered while: /ship-feature advisor-points-b3 STEP 6 opus review. - lib/verify-secure-loop.md:111,:126-128 + agents/security-auditor.md:184,:190-192 — teach parsing DEGRADED off the `SECURITY — VERDICT:` line, but the auditor prints `VERDICT: PASS` on a DEGRADED scan and DEGRADED only on its `TOOL:` line (agents/security-auditor.md:133-134). A reader checking the VERDICT line misses it. feat/bugfix skip text now names the TOOL line at the site (51f343f). Fix direction: say DEGRADED shows on the TOOL line beside a PASS, in both. Severity: low. Discovered while: /ship-feature advisor-points-b3 STEP 6 opus review.
FIXED 2026-11-19 (9814720, /bugfix degraded-tool-line): the three readers (+ hotfix) read the `TOOL:` line inside the PASS bullet, the VERDICT-line `DEGRADED` value is gone, a PASS without `TOOL:` is structural; lib/effort-shift.md item 3 names the line; loops-light locks it.
- Run B3 residuals (plan purged at finish, recorded here): (a) the challenge route line pairs `mcp__model-router__route` with the server-side advisor call, unverified in this repo (lib/effort-shift.md: the router cannot see the advisor tool; pairing only saves a request). (b) skills/{feat,bugfix} end line prints the diff stat even on a skip (cost one cheap command, nothing reads it). (c) lib/effort-shift.md item 3 "Two skips only" sentence ~65 words; feat/bugfix end-line first sentence ~60 words (prose length, oracle-safe splits exist). (d) contract 2026-11-18-advisor-points-b3-1056 criterion 9 says the exempt rows "run as wide as the rows beside them"; they run wider (Advisor rows 125-132 cols vs 77-96), wording only. Severity: low. Discovered while: /ship-feature advisor-points-b3 STEP 2b/STEP 6. - Run B3 residuals (plan purged at finish, recorded here): (a) the challenge route line pairs `mcp__model-router__route` with the server-side advisor call, unverified in this repo (lib/effort-shift.md: the router cannot see the advisor tool; pairing only saves a request). (b) skills/{feat,bugfix} end line prints the diff stat even on a skip (cost one cheap command, nothing reads it). (c) lib/effort-shift.md item 3 "Two skips only" sentence ~65 words; feat/bugfix end-line first sentence ~60 words (prose length, oracle-safe splits exist). (d) contract 2026-11-18-advisor-points-b3-1056 criterion 9 says the exempt rows "run as wide as the rows beside them"; they run wider (Advisor rows 125-132 cols vs 77-96), wording only. Severity: low. Discovered while: /ship-feature advisor-points-b3 STEP 2b/STEP 6.
<!-- /bugfix degraded-tool-line 2026-11-19 (9814720): confirmation-pass minors, pre-existing, not fixed -->
- A DEGRADED scan that BLOCKs and hits the cap: the STOP/escalation text (lib/verify-secure-loop.md, agents/security-auditor.md) does not name the missing semgrep or `make plugin`, so the human sees a checklist-only BLOCK without the remedy. Severity: low. Discovered while: /bugfix degraded-tool-line STEP 3b.
- DEGRADED is read by word presence on the `TOOL:` line: a garbled `TOOL:` line (no `semgrep <ver>`, no DEGRADED) reads as a full scan. Fix direction: allowlist `TOOL: semgrep <ver>` as the only full-scan shape, anything else DEGRADED or structural. Severity: low. Discovered while: same.
+6
View File
@@ -424,3 +424,9 @@ rules:
- **Real cause**: lib/memory.sh `memory_index` `[ -f "$file" ] || continue` treated present non-regular registry as absent; awk rc of `_mem_index_rows` dropped (fn rc = trailing echo). hooks/session-start.sh `_digest_blockers` skipped unparsable `| BLK-` rows. - **Real cause**: lib/memory.sh `memory_index` `[ -f "$file" ] || continue` treated present non-regular registry as absent; awk rc of `_mem_index_rows` dropped (fn rc = trailing echo). hooks/session-start.sh `_digest_blockers` skipped unparsable `| BLK-` rows.
- **Solution**: 87aecc1. Kind named (strict) → rc 2 + stderr `memory: <file>: not a readable regular file`; no kind (lax, mods/memory register.ts recall) → skip bad registry + stderr, rc 0. Rows captured before print, healthy output byte-identical. Digest prints `- open: unknown (memory.sh index failed)` on unparsable row. Tests SD9b/c re-pinned, SD9f/g/h, T20*. Residuals BUGS-FOUND 07f9a7f. - **Solution**: 87aecc1. Kind named (strict) → rc 2 + stderr `memory: <file>: not a readable regular file`; no kind (lax, mods/memory register.ts recall) → skip bad registry + stderr, rc 0. Rows captured before print, healthy output byte-identical. Digest prints `- open: unknown (memory.sh index failed)` on unparsable row. Tests SD9b/c re-pinned, SD9f/g/h, T20*. Residuals BUGS-FOUND 07f9a7f.
- **Reference**: lib/memory.sh, hooks/session-start.sh, lib/tests/memory.test.sh, lib/tests/session-digest.test.sh - **Reference**: lib/memory.sh, hooks/session-start.sh, lib/tests/memory.test.sh, lib/tests/session-digest.test.sh
## BLK-051 — DEGRADED security scan read as clean PASS: readers parsed VERDICT line, DEGRADED prints on TOOL line [resolved] (2026-11-19)
- **Friction**: DEGRADED security scan (semgrep absent) read as clean PASS: checklist + `make plugin` hint never surfaced, hotfix `SECURITY: DEGRADED (checklist only)` unreachable.
- **Real cause**: security-auditor prints `SECURITY — VERDICT: PASS` on DEGRADED scan, DEGRADED only on `TOOL:` line. lib/verify-secure-loop.md, agents/security-auditor.md ORCHESTRATOR PROTOCOL, skills/hotfix/SKILL.md STEP 4 listed `DEGRADED` as VERDICT-line sibling value after terminal `PASS` bullet → never fired. PASS without `TOOL:` line not structural → also read as full scan. Shipped in v3.0.0.
- **Solution**: 9814720. PASS bullet reads `TOOL:` line first; old DEGRADED bullets removed; PASS without `TOOL:` = structural (retry once, escalate). lib/effort-shift.md item 3 names line (LRN-300). loops-light section locks readers + feat/bugfix skip sentence (78/78; 16 FAIL on develop). Residual minors BUGS-FOUND 2026-11-19.
- **Reference**: lib/verify-secure-loop.md, agents/security-auditor.md, skills/hotfix/SKILL.md, lib/effort-shift.md, lib/tests/loops-light.test.sh, BUGS-FOUND:134
+3
View File
@@ -781,3 +781,6 @@ rules:
## 2026-11-18 ## 2026-11-18
- gates.sh hotfix c25a7ea (bugfix/gates-label-timeout): digit label not `N. text` = parse error; 2nd CHECK/EXPECT/EVIDENCE on one criterion = error (indented/bullet/bold labels gave same false MET, advisor caught it); no-criteria die names first parse error; default timeout 120 -> 600. GATE 0 MET 5/5 incl full make test at default, security PASS, 3 challengers SOLID. ABANDON-id aliasing + verify-secure-loop cause list -> TODO. - gates.sh hotfix c25a7ea (bugfix/gates-label-timeout): digit label not `N. text` = parse error; 2nd CHECK/EXPECT/EVIDENCE on one criterion = error (indented/bullet/bold labels gave same false MET, advisor caught it); no-criteria die names first parse error; default timeout 120 -> 600. GATE 0 MET 5/5 incl full make test at default, security PASS, 3 challengers SOLID. ABANDON-id aliasing + verify-secure-loop cause list -> TODO.
- Advisor run B3 (/ship-feature, 2b7aeb8 51f343f): 12 callers route rides first challenge-plan call + summary Advisor row; feat/bugfix skip end call on strict clean gates (MET, CONFORME, PASS not DEGRADED, first attempt), ADVISOR field; item 3 commit step + reuse names later code commits. 3 lenses + re-challenge (3 MAJOR fixed), opus STEP 6 caught DEGRADED on TOOL line (LRN-300). Gates clean x2. - Advisor run B3 (/ship-feature, 2b7aeb8 51f343f): 12 callers route rides first challenge-plan call + summary Advisor row; feat/bugfix skip end call on strict clean gates (MET, CONFORME, PASS not DEGRADED, first attempt), ADVISOR field; item 3 commit step + reuse names later code commits. 3 lenses + re-challenge (3 MAJOR fixed), opus STEP 6 caught DEGRADED on TOOL line (LRN-300). Gates clean x2.
## 2026-11-19
- /bugfix degraded-tool-line 9814720: 3 security readers read DEGRADED off TOOL line (BLK-051), BUGS-FOUND:134 FIXED, TODO:13 done, 2 pre-existing minors logged; CHANGELOG Fixed entry.
+1 -1
View File
@@ -10,7 +10,7 @@ Done history before 2026-10-08 removed 2026-10-23 (git keeps it: `git log -p --
- [x] DONE 2b7aeb8, merged 366f1f6 (docs 575408c, audits 8733669 8f23683, memory 49cc13c) (run B3, /ship-feature feature/advisor-points-b3): route line now "send it with the first tool call of lib/challenge-plan.md, the advisor call when one is due" in the 12 callers. Was: The 12 skills send their reflect route with the challenger dispatch, after the advisor call now (low; moved out of B2 by the user 2026-11-17) - [x] DONE 2b7aeb8, merged 366f1f6 (docs 575408c, audits 8733669 8f23683, memory 49cc13c) (run B3, /ship-feature feature/advisor-points-b3): route line now "send it with the first tool call of lib/challenge-plan.md, the advisor call when one is due" in the 12 callers. Was: The 12 skills send their reflect route with the challenger dispatch, after the advisor call now (low; moved out of B2 by the user 2026-11-17)
- [x] DECIDED user 2026-11-18 "skip when gates clean" (strict), DONE 2b7aeb8 + 51f343f (run B3). Was: Decide: feat/bugfix end-of-run advisor call has no skip (audit-delta/tour skip when no fix was applied); nominal /feat or /bugfix = 2 main-loop advisor calls (plan + end), ~0.6-1.4M uncached tokens late in a session; ship-feature STEP 6 opus review and the end call review the same branch back to back (B2 STEP 6 review, user decision) - [x] DECIDED user 2026-11-18 "skip when gates clean" (strict), DONE 2b7aeb8 + 51f343f (run B3). Was: Decide: feat/bugfix end-of-run advisor call has no skip (audit-delta/tour skip when no fix was applied); nominal /feat or /bugfix = 2 main-loop advisor calls (plan + end), ~0.6-1.4M uncached tokens late in a session; ship-feature STEP 6 opus review and the end call review the same branch back to back (B2 STEP 6 review, user decision)
- [x] After B1 DONE (doc commit + BDR-150 status + LRN-296): README/USAGE/CHANGELOG say "before writing a skill's plan (/feat, /bugfix, /ship-feature)" and list 3 agents → doc-sync; BDR-150 status line - [x] After B1 DONE (doc commit + BDR-150 status + LRN-296): README/USAGE/CHANGELOG say "before writing a skill's plan (/feat, /bugfix, /ship-feature)" and list 3 agents → doc-sync; BDR-150 status line
- [ ] loops-light lock on the feat/bugfix skip sentence ("each on its first attempt", "(not DEGRADED)"): B3 contract CHECKs are one-shot (robustness challenger, run B3) - [x] DONE 9814720 (/bugfix degraded-tool-line, with BUGS-FOUND:134). Was: loops-light lock on the feat/bugfix skip sentence ("each on its first attempt", "(not DEGRADED)"): B3 contract CHECKs are one-shot (robustness challenger, run B3)
- [ ] a11y:201, guardrails:278, ship-feature:325, init-project:361 end lines: restate item 3's merge-reuse clause ("reuses the last run's answer, or its skip, and names any code commit made after it"); item 3 loads only via the lib (B3 final review, low) - [ ] a11y:201, guardrails:278, ship-feature:325, init-project:361 end lines: restate item 3's merge-reuse clause ("reuses the last run's answer, or its skip, and names any code commit made after it"); item 3 loads only via the lib (B3 final review, low)
- [ ] Run C /feat: advisor usage section in /memory-feedback (main loop vs sub-agents, model served, input tokens; dedupe usage rows by message.id, model from the `advisor_message` iteration) - [ ] Run C /feat: advisor usage section in /memory-feedback (main loop vs sub-agents, model served, input tokens; dedupe usage rows by message.id, model from the `advisor_message` iteration)
- [x] Stale citers after A: README/USAGE/CHANGELOG patched, BUGS-FOUND residual superseded + LOW logged, BDR-150 status, LRN-295 (LRN-294 kept: its lesson holds) - [x] Stale citers after A: README/USAGE/CHANGELOG patched, BUGS-FOUND residual superseded + LOW logged, BDR-150 status, LRN-295 (LRN-294 kept: its lesson holds)
@@ -0,0 +1,41 @@
# CONTRACT — degraded-tool-line
- date: 2026-11-19 | flow: bugfix | branch: bugfix/degraded-tool-line
- status: active
## REQUEST (verbatim — IMMUTABLE)
Merge et corrige le bug et fais les todo
Scope of this run (main loop, from the previous turn's report): "le bug" = BUGS-FOUND.md:134 (security-auditor prints `VERDICT: PASS` on a DEGRADED scan, DEGRADED only on its `TOOL:` line; lib/verify-secure-loop.md, agents/security-auditor.md and skills/hotfix/SKILL.md teach DEGRADED as a VERDICT-line value); TODO:13 (loops-light lock on the feat/bugfix skip sentence) folds in as the regression test. TODO:14 and Run C are separate runs.
## CLARIFICATIONS
Q: fix plan (.claude/tasks/plans/2026-11-19-degraded-tool-line-0930.md, STEP 3 gate with challenge summary) / A: yes [gated 2026-11-19]
## ACCEPTANCE CRITERIA
1. loops-light carries the new locks and is green: 78 pass, 0 fail.
CHECK: cd /home/bchanot/Documents/claude && bash lib/tests/loops-light.test.sh 2>&1 | tail -1 | grep -qF '78 pass, 0 fail' && echo LOCKS-78
EXPECT: LOCKS-78
EVIDENCE: MET exit=0 marker-found :: LOCKS-78
2. No reader lists DEGRADED as a VERDICT value: the backticked token `DEGRADED` is gone from the three readers.
CHECK: cd /home/bchanot/Documents/claude && ! grep -qF '`DEGRADED`' lib/verify-secure-loop.md agents/security-auditor.md skills/hotfix/SKILL.md && echo OLD-VALUE-GONE
EXPECT: OLD-VALUE-GONE
EVIDENCE: MET exit=0 marker-found :: OLD-VALUE-GONE
3. Each of the three readers' PASS branch reads the TOOL line first and makes a PASS without it a structural failure (joined text).
CHECK: cd /home/bchanot/Documents/claude && n=0; for f in lib/verify-secure-loop.md agents/security-auditor.md skills/hotfix/SKILL.md; do tr '\n' ' ' < "$f" | tr -s ' ' | grep -qF '`PASS` → read the `TOOL:` line first: DEGRADED (semgrep absent) shows there, never on the VERDICT line; a PASS with no `TOOL:` line is a structural failure (below).' && n=$((n+1)); done; [ "$n" -eq 3 ] && echo READERS-3
EXPECT: READERS-3
EVIDENCE: MET exit=0 marker-found :: READERS-3
4. The auditor's and hotfix's structural-failure lists name a PASS with no TOOL line (joined text).
CHECK: cd /home/bchanot/Documents/claude && tr '\n' ' ' < agents/security-auditor.md | tr -s ' ' | grep -qF 'PASS without PROOF or without `TOOL:` line) → retry ONCE fresh' && tr '\n' ' ' < skills/hotfix/SKILL.md | tr -s ' ' | grep -qF 'Structural failure (mute / unparsable / no VERDICT line / PASS with no `TOOL:` line) → treat as a failed gate' && echo STRUCT-2
EXPECT: STRUCT-2
EVIDENCE: MET exit=0 marker-found :: STRUCT-2
5. lib/effort-shift.md § Advisor item 3 names the line DEGRADED prints on, and hotfix's DEGRADED PASS sets its SECURITY field.
CHECK: cd /home/bchanot/Documents/claude && tr '\n' ' ' < lib/effort-shift.md | tr -s ' ' | grep -qF '`skipped (gates clean on first pass)`; DEGRADED shows on the auditor'"'"'s `TOOL:` line. A skipped call discharges' && tr '\n' ' ' < skills/hotfix/SKILL.md | tr -s ' ' | grep -qF 'a DEGRADED PASS sets the summary'"'"'s SECURITY field to `DEGRADED (checklist only)`' && echo EFF-HOT-OK
EXPECT: EFF-HOT-OK
EVIDENCE: MET exit=0 marker-found :: EFF-HOT-OK
6. Full make test green.
CHECK: cd /home/bchanot/Documents/claude && PATH=$HOME/.bun/bin:$PATH make test </dev/null 2>&1 | tail -1
EXPECT: all suites green
EVIDENCE: MET exit=0 marker-found :: all suites green
7. The new locks are red on develop's readers (16 FAIL simulated on a scratch clone before dispatch); no wording changed outside the plan's blocks; new prose lines ≤ 80 columns (manual).
## FILE SCOPE
lib/verify-secure-loop.md, agents/security-auditor.md, skills/hotfix/SKILL.md, lib/effort-shift.md, lib/tests/loops-light.test.sh
@@ -0,0 +1,190 @@
# Bugfix plan: DEGRADED read off the wrong line (BUGS-FOUND:134 + TODO:13)
## DIAGNOSIS
BUG: three gate readers teach DEGRADED as a value of the `SECURITY — VERDICT:` line.
ROOT CAUSE: agents/security-auditor.md OUTPUT (:133-134) prints
`SECURITY — VERDICT: PASS | BLOCK(n) | ERROR(<reason>)`; DEGRADED appears only on the
`TOOL:` line (`ABSENT (DEGRADED — checklist only; install: make plugin)`). The parse
lists in lib/verify-secure-loop.md:111-128, agents/security-auditor.md:184-192 and
skills/hotfix/SKILL.md:182-183 end their parse at a terminal `PASS` bullet and list
`DEGRADED` as a sibling value of the VERDICT line. A reader parsing the VERDICT line
never sees it: a DEGRADED scan reads as a clean PASS (the hotfix SECURITY summary field,
the feat/bugfix end-of-run skip, the "surface the checklist + recommend make plugin"
step never fires). A PASS with no `TOOL:` line is not named a structural failure, so it
also reads as non-DEGRADED.
EVIDENCE: OUTPUT template vs the three parse lists; B3 STEP 6 opus review.
PRIOR: LRN-300 (a rule keyed on a gate verdict names the line its qualifier prints on) —
applied to the three readers and to lib/effort-shift.md item 3, the canonical skip rule.
The auditor's output format stays unchanged (no parser contract change).
BLAST RADIUS: the three readers + lib/effort-shift.md:124 ("security PASS (not
DEGRADED)" names no line). agents/security-auditor.md STEP 1 (:44-48) already puts
DEGRADED on the `TOOL:` line: untouched. feat/bugfix already name the TOOL line
(51f343f): untouched, now locked. README:84 / USAGE / CHANGELOG cite no parse list:
untouched (doc-sync re-checks). audit-delta:271, tour:156, onboard:549 say "semgrep
ABSENT → DEGRADED" (audit mode, non-blocking): untouched. a11y/guardrails/ship-feature/
init-project inherit lib/verify-secure-loop.md (their "PASS → STEP n" lines point at it).
Rejected alternative: change the auditor to print `VERDICT: DEGRADED` — breaks every
`PASS | BLOCK(n)` parser and the PROOF rule; the logged fix direction is the reader side.
A DEGRADED BLOCK needs no own sentence: the BLOCK bullet handles every BLOCK.
## FIX PLAN (exact text; each `old` occurs exactly once in its file)
1. lib/verify-secure-loop.md — the PASS bullet reads the TOOL line; the old
DEGRADED bullet is deleted.
### Block vsl-pass-old
```
- `PASS` → done, proceed to commit.
```
### Block vsl-pass-new
```
- `PASS` → read the `TOOL:` line first: DEGRADED (semgrep absent) shows
there, never on the VERDICT line; a PASS with no `TOOL:` line is a
structural failure (below). Then done, proceed to commit; a DEGRADED
PASS also surfaces the checklist result + recommends `make plugin`
(the tool's absence never blocks).
```
### Block vsl-degraded-old
```
- `DEGRADED` (semgrep absent) → does NOT block on the tool's absence; surface
the checklist result + recommend `make plugin`. A DEGRADED run that still
BLOCKs (grep-caught secret/injection) blocks like any other.
```
(replaced by nothing: the three lines are removed)
2. agents/security-auditor.md — same shape.
### Block aud-pass-old
```
- `PASS` → proceed (to commit / next step).
```
### Block aud-pass-new
```
- `PASS` → read the `TOOL:` line first: DEGRADED (semgrep absent)
shows there, never on the VERDICT line; a PASS with no `TOOL:` line
is a structural failure (below). Then proceed (to commit / next
step); a DEGRADED PASS also surfaces the checklist result +
recommends `make plugin` (the tool's absence never blocks).
```
### Block aud-degraded-old
```
- `DEGRADED` (semgrep absent) → does NOT block; surface the checklist
result + recommend `make plugin`. A DEGRADED BLOCK (grep-caught
hardcoded secret etc.) blocks like any other.
```
(removed)
### Block aud-struct-old
```
unparsable, crash, PASS without PROOF) → retry ONCE fresh; 2nd
structural failure → human escalation. A mute auditor is never a PASS.
```
### Block aud-struct-new
```
unparsable, crash, PASS without PROOF or without `TOOL:` line) →
retry ONCE fresh; 2nd structural failure → human escalation. A mute
auditor is never a PASS.
```
3. skills/hotfix/SKILL.md
### Block hot-pass-old
```
- `PASS` (or `DEGRADED` with no BLOCK) → proceed to commit.
```
### Block hot-pass-new
```
- `PASS` → read the `TOOL:` line first: DEGRADED (semgrep absent)
shows there, never on the VERDICT line; a PASS with no `TOOL:` line
is a structural failure (below). Then proceed to commit; a DEGRADED
PASS sets the summary's SECURITY field to `DEGRADED (checklist only)`.
```
### Block hot-struct-old
```
- Structural failure (mute / unparsable / no VERDICT line) → treat as a
failed gate: retry ONCE fresh; a 2nd structural failure → revert +
escalate. A mute auditor is never a PASS.
```
### Block hot-struct-new
```
- Structural failure (mute / unparsable / no VERDICT line / PASS with
no `TOOL:` line) → treat as a failed gate: retry ONCE fresh; a 2nd
structural failure → revert + escalate. A mute auditor is never a
PASS.
```
4. lib/effort-shift.md § Advisor item 3 — name the line (LRN-300).
### Block eff-old
```
`skipped (gates clean on first pass)`. A skipped call discharges
```
### Block eff-new
```
`skipped (gates clean on first pass)`; DEGRADED shows on the
auditor's `TOOL:` line. A skipped call discharges
```
5. lib/tests/loops-light.test.sh — regression locks. Single-line fragments with the
file's own `tf`/`tn` (LRN-093: a clause spanning lines → lock a distinctive single-line
fragment), double quotes with escaped backticks (the file's idiom). The section lives
here, not in security-auditor.test.sh, so one section locks this bug across its five
files (that file's `tn` is ERE: the parenthesised strings would match vacuously there).
### Block t-vars-old
```
HSKL="$REPO/skills/hotfix/SKILL.md"
```
### Block t-vars-new
```
HSKL="$REPO/skills/hotfix/SKILL.md"
AUD="$REPO/agents/security-auditor.md"
EFF="$REPO/lib/effort-shift.md"
```
### Block t-locks-old
```
echo ""
echo "loops-light structure locks: $PASS pass, $FAIL fail"
```
### Block t-locks-new
```
echo "── DEGRADED on the TOOL line, feat/bugfix skip (BUGS-FOUND:134) ──"
for f in "$FSK" "$BSK"; do
n=$(basename "$(dirname "$f")")
tf "$n skip not DEGRADED" "$f" "security PASS (not DEGRADED),"
tf "$n skip first attempt" "$f" "each on its first attempt;"
tf "$n skip out of view" "$f" "a verdict no longer in view runs the call."
tf "$n skip names TOOL" "$f" "auditor's \`TOOL:\` line, beside a PASS."
done
tf "effort-shift names TOOL" "$EFF" "auditor's \`TOOL:\` line. A skipped call"
for f in "$INC" "$AUD" "$HSKL"; do
n=$(basename "$(dirname "$f")")/$(basename "$f")
tf "$n PASS reads TOOL" "$f" "\`PASS\` → read the \`TOOL:\` line first"
tf "$n DEGRADED off VERDICT" "$f" "never on the VERDICT line;"
tf "$n no TOOL structural" "$f" "a PASS with no \`TOOL:\` line"
tf "$n structural (below)" "$f" "structural failure (below)"
tn "$n DEGRADED no verdict" "$f" "\`DEGRADED\`"
tn "$n DEGRADED no branch" "$f" "DEGRADED (semgrep absent) →"
done
echo ""
echo "loops-light structure locks: $PASS pass, $FAIL fail"
```
The two `tn` catch the old shapes coming back: the backticked `DEGRADED` value and a
`DEGRADED (semgrep absent) →` branch (none of the three files keeps that token after the fix; hotfix's
`DEGRADED (checklist only)` does not match). The paired `tf` on the same file fails on
an unreadable file, which `tn` alone would pass.
Simulated on a scratch clone (locks first, fix second): develop = 16 FAIL (effort-shift
lock + 3 files × 4 reader `tf` + 3 backticked `tn`), the 8 feat/bugfix locks PASS, the
3 `DEGRADED (semgrep absent) →` `tn` PASS (they guard the un-backticked variant, absent
on both sides); fix applied = 78/78 PASS.
Deferred (confirmation pass, logged to BUGS-FOUND at bookkeeping): a DEGRADED BLOCK's
cap STOP does not name the missing semgrep / `make plugin`; DEGRADED is read by word
presence, a garbled `TOOL:` line reads as a full scan (allowlist `semgrep <ver>` would
close it). Both were already true before this fix (the old bullet keyed on the wrong
line).
6. Bookkeeping (main loop, not executor): BUGS-FOUND:134 FIXED, TODO:13 done.
RISK: low — prose only, no output format change. New prose lines ≤ 80 cols; the lock
lines follow the test file's existing width (it already has lines past 80).
+1
View File
@@ -43,6 +43,7 @@ The BDR-125 context queue is delivered: phases 0, 0b, 4a, 1, 5, 2 and 4b-4d ship
- model-router: a Skill call whose answer carries `isError` (refused or unknown skill) no longer opens the write guard for the rest of the session. Test: `mods/model-router/hooks/register.test.ts` (GUARD: an isError Skill answer leaves the latch closed). - model-router: a Skill call whose answer carries `isError` (refused or unknown skill) no longer opens the write guard for the rest of the session. Test: `mods/model-router/hooks/register.test.ts` (GUARD: an isError Skill answer leaves the latch closed).
- `settings.json`: the `autoMode.hard_deny` entry "Disarming the guardrails" now names turning a mod off as disarming: `"enabled": false` in `~/.claude/<mod>.json`, a mod's `enabledPlugins` entry set to false, or `profile.sh disable` of a mod. These switches turn off the model-router write guard and the memory mod; the user still sets them by hand. - `settings.json`: the `autoMode.hard_deny` entry "Disarming the guardrails" now names turning a mod off as disarming: `"enabled": false` in `~/.claude/<mod>.json`, a mod's `enabledPlugins` entry set to false, or `profile.sh disable` of a mod. These switches turn off the model-router write guard and the memory mod; the user still sets them by hand.
- `lib/gates.sh` (GATE 0 floor): an unindented line under `## ACCEPTANCE CRITERIA` that starts with a digit but is not `N. text` (`1b.`, `1.1`, `2)`) is now a parse error, `malformed criterion label at line N`, and a second `CHECK:`, `EXPECT:` or `EVIDENCE:` on one criterion is one too, `second CHECK: at line N in criterion M`. Either gives `VERDICT: ERROR(n)` (rc 2) and no CHECK runs. An oracle under a label the parser missed used to overwrite the previous criterion's, so a failing criterion could read MET. A label that is not digit-led (indented, bullet) is caught only when the criterion before it already has that attribute; after a manual criterion its oracle is still absorbed. With no criterion parsed, the `no numbered criteria` error now ends with the first parse error. Test: `lib/tests/gates.test.sh`. - `lib/gates.sh` (GATE 0 floor): an unindented line under `## ACCEPTANCE CRITERIA` that starts with a digit but is not `N. text` (`1b.`, `1.1`, `2)`) is now a parse error, `malformed criterion label at line N`, and a second `CHECK:`, `EXPECT:` or `EVIDENCE:` on one criterion is one too, `second CHECK: at line N in criterion M`. Either gives `VERDICT: ERROR(n)` (rc 2) and no CHECK runs. An oracle under a label the parser missed used to overwrite the previous criterion's, so a failing criterion could read MET. A label that is not digit-led (indented, bullet) is caught only when the criterion before it already has that attribute; after a manual criterion its oracle is still absorbed. With no criterion parsed, the `no numbered criteria` error now ends with the first parse error. Test: `lib/tests/gates.test.sh`.
- Security gate readers (`lib/verify-secure-loop.md`, `agents/security-auditor.md` ORCHESTRATOR PROTOCOL, `skills/hotfix/SKILL.md` STEP 4) no longer read `DEGRADED` as a value of the `SECURITY — VERDICT:` line. The auditor prints `VERDICT: PASS` on a scan without semgrep and reports DEGRADED on its `TOOL:` line, so the old `DEGRADED` branch never fired: a degraded scan read as a clean PASS, the checklist result and the `make plugin` hint were never surfaced, and hotfix's `SECURITY: DEGRADED (checklist only)` summary could not be reached. The `PASS` branch now reads the `TOOL:` line first, and a PASS with no `TOOL:` line is a structural failure (one fresh retry, then escalation). `lib/effort-shift.md` § Advisor names the `TOOL:` line in the feat/bugfix skip condition. The auditor's output format is unchanged. Test: `lib/tests/loops-light.test.sh` (DEGRADED on the TOOL line).
## [3.0.0] — 2026-11-12 ## [3.0.0] — 2026-11-12
+8 -6
View File
@@ -182,14 +182,16 @@ In audit mode, ALSO write this same block (plus per-finding detail) to
- Dispatch a FRESH auditor each iteration — no context reuse. Input = mode + - Dispatch a FRESH auditor each iteration — no context reuse. Input = mode +
scope + (report) + (context), nothing else. scope + (report) + (context), nothing else.
- Parse the `SECURITY — VERDICT:` line: - Parse the `SECURITY — VERDICT:` line:
- `PASS` → proceed (to commit / next step). - `PASS` → read the `TOOL:` line first: DEGRADED (semgrep absent)
shows there, never on the VERDICT line; a PASS with no `TOOL:` line
is a structural failure (below). Then proceed (to commit / next
step); a DEGRADED PASS also surfaces the checklist result +
recommends `make plugin` (the tool's absence never blocks).
- `BLOCK(n)` → the dev subagent receives the BLOCKING list + the contract - `BLOCK(n)` → the dev subagent receives the BLOCKING list + the contract
path. After the fix: re-verify the REQUEST first (verifier), THEN re-run path. After the fix: re-verify the REQUEST first (verifier), THEN re-run
this gate — in that order. Max 3 security iterations → STOP + human this gate — in that order. Max 3 security iterations → STOP + human
escalation with the BLOCKING table. escalation with the BLOCKING table.
- `DEGRADED` (semgrep absent) → does NOT block; surface the checklist
result + recommend `make plugin`. A DEGRADED BLOCK (grep-caught
hardcoded secret etc.) blocks like any other.
- Structural failure (`ERROR(…)`, missing/duplicated VERDICT line, - Structural failure (`ERROR(…)`, missing/duplicated VERDICT line,
unparsable, crash, PASS without PROOF) → retry ONCE fresh; 2nd unparsable, crash, PASS without PROOF or without `TOOL:` line) →
structural failure → human escalation. A mute auditor is never a PASS. retry ONCE fresh; 2nd structural failure → human escalation. A mute
auditor is never a PASS.
+2 -1
View File
@@ -124,7 +124,8 @@ triggers in CLAUDE.global.md § Workflow):
security PASS (not DEGRADED), each on its first attempt (any other security PASS (not DEGRADED), each on its first attempt (any other
verdict, a retry, a loop iteration or a verdict no longer in view verdict, a retry, a loop iteration or a verdict no longer in view
runs the call), their summary then reading runs the call), their summary then reading
`skipped (gates clean on first pass)`. A skipped call discharges `skipped (gates clean on first pass)`; DEGRADED shows on the
auditor's `TOOL:` line. A skipped call discharges
its point and the trigger it covers. In the six flows that run the its point and the trigger it covers. In the six flows that run the
gates (feat, bugfix, ship-feature, init-project, a11y, guardrails), gates (feat, bugfix, ship-feature, init-project, a11y, guardrails),
the main loop first prints the run's diff stat, a fix the answer the main loop first prints the run's diff stat, a fix the answer
+21
View File
@@ -17,6 +17,8 @@ HSK="$REPO/skills/hotfix/SKILL.md"
GSK="$REPO/skills/guardrails/SKILL.md" GSK="$REPO/skills/guardrails/SKILL.md"
ASK="$REPO/skills/a11y/SKILL.md" ASK="$REPO/skills/a11y/SKILL.md"
HSKL="$REPO/skills/hotfix/SKILL.md" HSKL="$REPO/skills/hotfix/SKILL.md"
AUD="$REPO/agents/security-auditor.md"
EFF="$REPO/lib/effort-shift.md"
PASS=0; FAIL=0 PASS=0; FAIL=0
tf() { # tf <label> <file> <fixed-string> tf() { # tf <label> <file> <fixed-string>
@@ -108,6 +110,25 @@ tf "hotfix no verifier" "$HSKL" "No verifier is dispatched at hotfix wei
tf "hotfix skill has Agent" "$HSK" " - Agent" tf "hotfix skill has Agent" "$HSK" " - Agent"
tf "hotfix dispatches hotfixer" "$HSKL" 'subagent_type="hotfixer"' tf "hotfix dispatches hotfixer" "$HSKL" 'subagent_type="hotfixer"'
echo "── DEGRADED on the TOOL line, feat/bugfix skip (BUGS-FOUND:134) ──"
for f in "$FSK" "$BSK"; do
n=$(basename "$(dirname "$f")")
tf "$n skip not DEGRADED" "$f" "security PASS (not DEGRADED),"
tf "$n skip first attempt" "$f" "each on its first attempt;"
tf "$n skip out of view" "$f" "a verdict no longer in view runs the call."
tf "$n skip names TOOL" "$f" "auditor's \`TOOL:\` line, beside a PASS."
done
tf "effort-shift names TOOL" "$EFF" "auditor's \`TOOL:\` line. A skipped call"
for f in "$INC" "$AUD" "$HSKL"; do
n=$(basename "$(dirname "$f")")/$(basename "$f")
tf "$n PASS reads TOOL" "$f" "\`PASS\` → read the \`TOOL:\` line first"
tf "$n DEGRADED off VERDICT" "$f" "never on the VERDICT line;"
tf "$n no TOOL structural" "$f" "a PASS with no \`TOOL:\` line"
tf "$n structural (below)" "$f" "structural failure (below)"
tn "$n DEGRADED no verdict" "$f" "\`DEGRADED\`"
tn "$n DEGRADED no branch" "$f" "DEGRADED (semgrep absent) →"
done
echo "" echo ""
echo "loops-light structure locks: $PASS pass, $FAIL fail" echo "loops-light structure locks: $PASS pass, $FAIL fail"
[ "$FAIL" -eq 0 ] [ "$FAIL" -eq 0 ]
+5 -4
View File
@@ -110,7 +110,11 @@ stdout-only, no Write).
Parse its single `SECURITY — VERDICT:` line: Parse its single `SECURITY — VERDICT:` line:
- `PASS` → done, proceed to commit. - `PASS` → read the `TOOL:` line first: DEGRADED (semgrep absent) shows
there, never on the VERDICT line; a PASS with no `TOOL:` line is a
structural failure (below). Then done, proceed to commit; a DEGRADED
PASS also surfaces the checklist result + recommends `make plugin`
(the tool's absence never blocks).
- `BLOCK(n)` → hand the dev the `BLOCKING` list + the CONTRACT path - `BLOCK(n)` → hand the dev the `BLOCKING` list + the CONTRACT path
(re-dispatch a FRESH executor, never fix by hand). Then re-run GATE 0, then (re-dispatch a FRESH executor, never fix by hand). Then re-run GATE 0, then
**re-verify the REQUEST first** (GATE 1, fresh verifier) — a security fix **re-verify the REQUEST first** (GATE 1, fresh verifier) — a security fix
@@ -123,9 +127,6 @@ Parse its single `SECURITY — VERDICT:` line:
the main loop calls it before the re-dispatch the main loop calls it before the re-dispatch
(`lib/effort-shift.md` § Advisor); the answer stays here, never (`lib/effort-shift.md` § Advisor); the answer stays here, never
in the dev brief. in the dev brief.
- `DEGRADED` (semgrep absent) → does NOT block on the tool's absence; surface
the checklist result + recommend `make plugin`. A DEGRADED run that still
BLOCKs (grep-caught secret/injection) blocks like any other.
- Structural failure → retry ONCE fresh; 2nd → human escalation. A mute - Structural failure → retry ONCE fresh; 2nd → human escalation. A mute
auditor is NEVER a PASS. auditor is NEVER a PASS.
A 2nd structural failure with no main-loop advisor call since GATE 0 A 2nd structural failure with no main-loop advisor call since GATE 0
+8 -4
View File
@@ -180,16 +180,20 @@ Parse the `HOTFIX-EXEC REPORT`:
fresh dispatch, never inline-load: the repo convention and the FRESH fresh dispatch, never inline-load: the repo convention and the FRESH
requirement both forbid it) with `MODE: gate`, `SCOPE:` the working-tree requirement both forbid it) with `MODE: gate`, `SCOPE:` the working-tree
diff vs `$PRE`. Parse its `SECURITY — VERDICT:` line: diff vs `$PRE`. Parse its `SECURITY — VERDICT:` line:
- `PASS` (or `DEGRADED` with no BLOCK) → proceed to commit. - `PASS` → read the `TOOL:` line first: DEGRADED (semgrep absent)
shows there, never on the VERDICT line; a PASS with no `TOOL:` line
is a structural failure (below). Then proceed to commit; a DEGRADED
PASS sets the summary's SECURITY field to `DEGRADED (checklist only)`.
- `BLOCK(n)` → this is hotfix: do NOT loop. Revert ONLY the executor's - `BLOCK(n)` → this is hotfix: do NOT loop. Revert ONLY the executor's
files (`git restore --source=$PRE -- <FILE(S)>` + delete report-listed files (`git restore --source=$PRE -- <FILE(S)>` + delete report-listed
NEW files), print the `BLOCKING` list, and STOP: NEW files), print the `BLOCKING` list, and STOP:
`"Hotfix introduced a security finding. Reverted. Escalate to /bugfix `"Hotfix introduced a security finding. Reverted. Escalate to /bugfix
for a fix under the full verify+security loop."` The hotfix model is for a fix under the full verify+security loop."` The hotfix model is
one attempt; any gate failure (smoke OR security) reverts and escalates. one attempt; any gate failure (smoke OR security) reverts and escalates.
- Structural failure (mute / unparsable / no VERDICT line) → treat as a - Structural failure (mute / unparsable / no VERDICT line / PASS with
failed gate: retry ONCE fresh; a 2nd structural failure → revert + no `TOOL:` line) → treat as a failed gate: retry ONCE fresh; a 2nd
escalate. A mute auditor is never a PASS. structural failure → revert + escalate. A mute auditor is never a
PASS.
3. Commit only after smoke AND security pass, message per 3. Commit only after smoke AND security pass, message per
`$HOME/.claude/lib/commit-message.md` (no convention: one subject line, `$HOME/.claude/lib/commit-message.md` (no convention: one subject line,
`fix(<scope>): <what was wrong>`). `fix(<scope>): <what was wrong>`).