Merge bugfix/gates-label-timeout into develop
This commit is contained in:
commit
2d8e4578d3
8 files changed
+320
-7
No files matched your search
@@ -777,3 +777,6 @@ rules:
|
||||
- Advisor call points run A (6ef3069): transcript count showed main loop 2 calls on Opus (409k/680k uncached) vs 18/20 opus sub-agents on Fable (~70k); doctrine now names main-loop points (plan, first gate loop failing twice, merge) + judgment agents once, advice add-only; 2 challenge rounds, gates found block E double count, fixed r5. Runs B, C next.
|
||||
- Advisor run B1 (58a5273): plan point moved into lib/challenge-plan.md (once per skill run, Advisor: row), stuck lines inline in verify-secure-loop (main-loop calls only), analyzer joins, trigger for doctrine/architecture/public-interface recommendations. 2 challenge rounds (2 BLOCKERs were my own oracle markers), scratch simulation then MET first run; gates sequential, CONFORME + PASS.
|
||||
- Advisor run B2 (/ship-feature, f48343e 24354d9 6022b9d): stuck line in 6 gate skills, end-of-run call at each flow's end step (9 flows, capitalize-commit untouched), 3 judgment agents dispatch-scoped, auditor raise upward only; plan r3 after 3 lenses + confirm; STEP 6 review fix restated fix path in skills (LRN-297); gates green first pass and after fix. Merge waits for user go.
|
||||
|
||||
## 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.
|
||||
@@ -2152,3 +2152,8 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s
|
||||
- **Context**: 2026-11-17 run B2: scratch-clone simulation 15/15 MET, yet challengers found end call after FEAT COMPLETE (done already printed), tour runners (sub-agents) execute STEP 3 holding main-loop call, skip "fixed or committed anything" always true (tour commits report each run). Fixed in plan r2/r3 before dispatch.
|
||||
- **Apply**: anchor position oracles on flow's done/merge moment (summary or finish line), not nearby heading; per site list executor (main loop vs runner/sub-agent) and falsifiable condition. Non-idempotent applier fix after commit: delta group from HEAD + byte-compare with fresh apply from base (review1 == fresh).
|
||||
- **Reference**: docs plan 2026-11-17-advisor-points-b2 (purged at finish, git keeps), LRN-296, LRN-284
|
||||
|
||||
## LRN-299 — Cursor parser: refuse the overwrite at the sink, not the label shapes at the source (2026-11-18)
|
||||
**Context**: gates.sh hotfix c25a7ea (2026-11-17). LRN-284 named `1b.` label: parser drops it as prose, cursor `_CUR` still on previous criterion, stray CHECK/EXPECT overwrite its oracle → false MET. First plan: reject `^[0-9]` non-`N. text` lines. Advisor + scratch fixtures: indented ` 2.`, `- `, `**2.**` labels gave same false MET.
|
||||
**Pattern**: line parser with current-record cursor → close overwrite at sink: refuse second write of already-set field (`_set_attr` guard), not enumerate bad label shapes at source. Source-side rule only names the common shape (better error message).
|
||||
**Apply**: any cursor parser (contract ledger, registry, config sections). Before fixing a reported bad input shape, fixture sibling shapes (indent, bullet, bold) against the same sink; scan existing data for repeated fields first so guard changes no past verdict.
|
||||
@@ -85,8 +85,11 @@ Open children of the shipped phases (History 2026-11-12), text verbatim.
|
||||
- [ ] feature (G2 split, user 2026-11-10): measured passive-cost API, one source for doctor / /status / plugin-advisor (probe COSTS field). Spec input = the two challenge rounds in the G2 plan: unit = pack or ON plugin (skills + agents + commands descriptions; pr-review-toolkit ~1550t, example-skills ~2350t), doctor counts OFF packs (higgsfield, extras), `detect_plugin_dev` globs the wrong cache level and ignores enabled state, `?` for not-installed or empty units, rc-0 sentinels (`costs-unavailable`/`unknown`) for doctor's `set -euo pipefail`, profile.sh failure → unknown, `python3 -I` (probe runs in the user's project), installPath from installed_plugins.json. Doctor keeps its measured ui-ux 670 until then.
|
||||
- [x] D3 add-ons (done 9b12b12) from G2 (plugin-advisor.md): plan-budget WARN :317 (unreachable: plugin-gate never sends PLAN, detect_plan gone), :42 "absolute COST ESTIMATE still reported", :105 `(budget: ~<N>t | n/a)`, :222 "passive cost estimate = highest-cost package profile", "0t passive" claims for impeccable / design-motion-principles (:226 :227 :268 :269); USAGE.md :248 "Budget Pro (~11k tokens/5h)", :494 `(~400t)`, :923 `(~200t)`; session-banner.test.sh SB10 `gone()` passes on a missing file (add an existence check)
|
||||
- [x] D6 project rule (done c69ce9c; lead paragraph fixed too, follow-ups in BUGS-FOUND): .claude/rules/graphify-vendored.md says `graphify install --platform claude` "touches nothing else", but graphifyy 0.9.67 appends a `# graphify` block to ~/.claude/CLAUDE.md (= CLAUDE.global.md); `graphify claude install` writes into the caller's cwd, so the install-plugins.sh trap protects $REPO only when run from $REPO
|
||||
- [ ] gates.sh: warn or reject a criterion row labelled `^[0-9]+[a-z]\.` (LRN-284: `1b.` absorbed into criterion 1, its CHECK/EXPECT overwritten, false MET)
|
||||
- [ ] gates.sh default `GATES_TIMEOUT=120` < full `make test` (~135 s on 2026-11-16): a "Full make test green" criterion goes NOT-MET on timeout alone (A6 run, re-run with GATES_TIMEOUT=400). Raise the default or have contract-interview write the timeout for full-suite criteria.
|
||||
- [x] DONE c25a7ea (bugfix/gates-label-timeout, user 2026-11-17 "reject"; also rejects a 2nd CHECK/EXPECT/EVIDENCE on one criterion: indented ` 2.`, `- `, `**2.**` gave the same false MET) gates.sh: warn or reject a criterion row labelled `^[0-9]+[a-z]\.` (LRN-284: `1b.` absorbed into criterion 1, its CHECK/EXPECT overwritten, false MET)
|
||||
- [x] DONE c25a7ea (user 2026-11-17: default 600 s, env override kept) gates.sh default `GATES_TIMEOUT=120` < full `make test` (~135 s on 2026-11-16): a "Full make test green" criterion goes NOT-MET on timeout alone (A6 run, re-run with GATES_TIMEOUT=400). Raise the default or have contract-interview write the timeout for full-suite criteria.
|
||||
- [ ] gates.sh:93 ABANDON regex `([0-9]+)?` reads `ABANDON: 1b …` / `1.1` as id 1: after a renumber (LRN-284) criterion 1 is masked ABANDONED (rc 3) instead of "unknown criterion" ERROR. Anchor the id `([0-9]+)([[:space:]]|$)` + test (robustness challenger, gates hotfix 2026-11-17)
|
||||
- [ ] gates.sh residual: a stray oracle (indented ` 2.`, `- `, `**2.**` label) after a MANUAL criterion still attaches to it, row MANUAL → MET/NOT-MET on an unrelated oracle (no red oracle overwritten; accepted 2026-11-17)
|
||||
- [ ] lib/verify-secure-loop.md:46-47 ERROR(n) cause list is examples, incomplete: missing "no numbered criteria", "ABANDON names unknown criterion", malformed label, second attribute (c25a7ea)
|
||||
- [ ] lib/design-tool-gate.sh:70 `perl -e 'alarm shift; exec @ARGV' 15 21st whoami` kills one process only (same limit as the old session-start runner, fixed 490ad83): reuse the group-kill runner when this file is next touched.
|
||||
- [ ] parked (code-clean 2026-11-09): hooks/rtk-rewrite.sh:84 no-op `[ "$CMD" = "$REWRITTEN" ] && REWRITTEN="$CMD"`: remove with the next real rtk-hook edit, re-pin `hooks/.rtk-hook.sha256` + rtk-rewrite.test.sh T13 in the same step
|
||||
- [ ] deferred (BDR-123): remap inline-writing best-tier skills (design Build stack, writing-skills, deprecation-and-migration, /tour single-project, /audit-delta 3d, /harden STEP 3); stale citers skills/feat/SKILL.md:6, skills/code-clean/SKILL.md:36; + impeccable row in routing.json (design Build stack has none; frontend-design has `reflect`; census test pins the table)
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# CONTRACT — gates-label-timeout
|
||||
- date: 2026-11-17 | flow: hotfix | branch: bugfix/gates-label-timeout
|
||||
- status: active
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
corrige les deux bugs mis dans le todos puis passe a C
|
||||
|
||||
Bug description (TODO:88-89): (1) gates.sh: warn or reject a criterion row labelled `^[0-9]+[a-z]\.` (LRN-284: `1b.` absorbed into criterion 1, its CHECK/EXPECT overwritten, false MET). (2) gates.sh default `GATES_TIMEOUT=120` < full `make test` (~135 s on 2026-11-16): a "Full make test green" criterion goes NOT-MET on timeout alone (A6 run, re-run with GATES_TIMEOUT=400). Raise the default or have contract-interview write the timeout for full-suite criteria.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: the two bugs? / A: inferred, not asked: TODO:88-89, the two gates.sh items (TODO:90 design-tool-gate is deferred to its next touch by its own text); the user's answers to the two questions below approve both fixes
|
||||
Deviation 2026-11-17 (advisor, reported to the user): the same false MET reproduces with an indented ` 2. sub`, `- sub` or `**2.** sub` label, so `_set_attr` also rejects a second CHECK/EXPECT/EVIDENCE on one criterion (no past contract has one; every past verdict unchanged)
|
||||
Q: bad label handling? / A: reject: an unindented ACCEPTANCE CRITERIA line starting with a digit that is not `N. text` (`1b.`, `1.1`, `2)`) is a parse error naming the line, its attributes belong to no criterion, verdict ERROR [gated 2026-11-17]
|
||||
Q: timeout fix? / A: default 600 s, the GATES_TIMEOUT env override kept [gated 2026-11-17]
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. A `1b.` label after a failing criterion makes `gates.sh run` return ERROR rc 2 naming line 6 (before the fix this fixture is a false MET).
|
||||
CHECK: cd /home/bchanot/Documents/claude && f=$(mktemp) && printf '## ACCEPTANCE CRITERIA\n1. real\n CHECK: exit 1\n EXPECT: x\n EVIDENCE: pending\n1b. sub\n CHECK: echo y\n EXPECT: y\n EVIDENCE: pending\n' > "$f"; out=$(bash lib/gates.sh run "$f" 2>&1); rc=$?; rm -f "$f"; [ "$rc" -eq 2 ] && printf '%s' "$out" | grep -q 'malformed criterion label at line 6' && printf '%s' "$out" | grep -q 'VERDICT: ERROR' && echo LABEL-REJECTED
|
||||
EXPECT: LABEL-REJECTED
|
||||
EVIDENCE: MET exit=0 marker-found :: LABEL-REJECTED
|
||||
2. With GATES_TIMEOUT unset, gates.sh reports a 600 s timeout; with GATES_TIMEOUT=7 it reports 7 s.
|
||||
CHECK: cd /home/bchanot/Documents/claude && f=$(mktemp) && printf '## ACCEPTANCE CRITERIA\n1. manual\n' > "$f"; a=$(env -u GATES_TIMEOUT bash lib/gates.sh status "$f" 2>&1); b=$(GATES_TIMEOUT=7 bash lib/gates.sh status "$f" 2>&1); rm -f "$f"; printf '%s' "$a" | grep -q 'timeout 600s' && printf '%s' "$b" | grep -q 'timeout 7s' && echo DEFAULT-600
|
||||
EXPECT: DEFAULT-600
|
||||
EVIDENCE: MET exit=0 marker-found :: DEFAULT-600
|
||||
3. lib/tests/gates.test.sh carries the regression cases and is green; shellcheck clean on both files.
|
||||
CHECK: cd /home/bchanot/Documents/claude && grep -q '1b\. sub' lib/tests/gates.test.sh && grep -q '1\.1 dotted' lib/tests/gates.test.sh && grep -q 'timeout 600s' lib/tests/gates.test.sh && shellcheck -S warning lib/gates.sh lib/tests/gates.test.sh && bash lib/tests/gates.test.sh 2>&1 | tail -1 | grep -q ', 0 fail' && echo SUITE-GREEN
|
||||
EXPECT: SUITE-GREEN
|
||||
EVIDENCE: MET exit=0 marker-found :: SUITE-GREEN
|
||||
4. An indented ` 2. sub` label with a passing oracle after a failing criterion 1 makes `gates.sh run` return ERROR naming the second CHECK (before the fix: false MET).
|
||||
CHECK: cd /home/bchanot/Documents/claude && f=$(mktemp) && printf '## ACCEPTANCE CRITERIA\n1. real\n CHECK: exit 1\n EXPECT: x\n EVIDENCE: pending\n 2. sub\n CHECK: echo y\n EXPECT: y\n EVIDENCE: pending\n' > "$f"; out=$(bash lib/gates.sh run "$f" 2>&1); rc=$?; rm -f "$f"; [ "$rc" -eq 2 ] && printf '%s' "$out" | grep -q 'second CHECK: at line 7' && printf '%s' "$out" | grep -q 'VERDICT: ERROR' && echo STRAY-REJECTED
|
||||
EXPECT: STRAY-REJECTED
|
||||
EVIDENCE: MET exit=0 marker-found :: STRAY-REJECTED
|
||||
5. Full make test green, run by gates.sh with no GATES_TIMEOUT set (proves the new default covers the suite).
|
||||
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
|
||||
|
||||
## FILE SCOPE
|
||||
lib/gates.sh
|
||||
lib/tests/gates.test.sh
|
||||
(bookkeeping: .claude/tasks/TODO.md, .claude/memory via memory.sh, this contract, the challenge plan .claude/tasks/plans/2026-11-17-gates-label-timeout-2342.md)
|
||||
@@ -0,0 +1,173 @@
|
||||
# Fix plan — gates.sh stray oracle + default timeout (hotfix)
|
||||
|
||||
Contract: .claude/tasks/contracts/2026-11-17-gates-label-timeout-2342.md
|
||||
Branch: bugfix/gates-label-timeout. Files: lib/gates.sh, lib/tests/gates.test.sh.
|
||||
|
||||
## Root causes
|
||||
1. `_absorb` (lib/gates.sh:86-98) opens a criterion only on
|
||||
`^([0-9]+)\.[[:space:]]+(.*)$`. Any other label (`1b. sub`, `1.1 dotted`,
|
||||
`2) paren`, an indented ` 2. sub`, `- sub`, `**2.** sub`) matches no
|
||||
branch and is dropped as prose, but `_CUR` still points at the previous
|
||||
criterion, so `_set_attr` lets the CHECK/EXPECT/EVIDENCE under it
|
||||
overwrite that criterion's oracle. Criterion 1 with `CHECK: exit 1`
|
||||
followed by a stray passing oracle yields VERDICT: MET (LRN-284; all six
|
||||
shapes reproduced on a scratch copy).
|
||||
2. `TIMEOUT="${GATES_TIMEOUT:-120}"` (lib/gates.sh:32) is per CHECK; the full
|
||||
`make test` takes ~135 s, so a "full suite green" criterion goes NOT-MET
|
||||
on timeout unless the caller exports GATES_TIMEOUT (contracts used
|
||||
400/600/1200).
|
||||
|
||||
## Edit — lib/gates.sh (exact)
|
||||
A. Line 32: `TIMEOUT="${GATES_TIMEOUT:-600}"`, with three comment lines
|
||||
right above it:
|
||||
```bash
|
||||
# TIMEOUT is per CHECK and a run lasts their sum: the caller's own limit (a
|
||||
# foreground tool call stops at 600 s) must cover it, else run it in the
|
||||
# background. A killed run writes nothing back; the floor stays PENDING.
|
||||
```
|
||||
|
||||
B. `_set_attr`: a comment line above the function, then a guard between the
|
||||
`_CUR -lt 0` block and the assigning `case`:
|
||||
```bash
|
||||
# A second attribute on one criterion is an error, never an overwrite: it
|
||||
# is what an oracle under a label the parser missed looks like (LRN-284).
|
||||
_set_attr() { # _set_attr <CHECK|EXPECT|EVIDENCE> <value> <lineno>
|
||||
if [ "$_CUR" -lt 0 ]; then
|
||||
_err "$1 at line $3 belongs to no criterion"
|
||||
return 0
|
||||
fi
|
||||
local seen=""
|
||||
case "$1" in
|
||||
CHECK) seen="${_CHECK[_CUR]}" ;;
|
||||
EXPECT) seen="${_EXPECT[_CUR]}" ;;
|
||||
EVIDENCE) [ "${_EVLINE[_CUR]}" = 0 ] || seen=yes ;;
|
||||
esac
|
||||
if [ -n "$seen" ]; then
|
||||
_err "second $1: at line $3 in criterion ${_ID[_CUR]}"
|
||||
return 0
|
||||
fi
|
||||
case "$1" in
|
||||
```
|
||||
C. `_absorb`: new branch right after the criterion branch, before ABANDON:
|
||||
```bash
|
||||
elif [[ "$1" =~ ^[0-9] ]]; then
|
||||
_err "malformed criterion label at line $2 (want \`N. text\`)"
|
||||
_CUR=-1
|
||||
```
|
||||
It covers the case B cannot: a digit label after a MANUAL criterion
|
||||
(no attribute yet) would otherwise lend it the stray oracle. The comment
|
||||
above `_absorb` gains: "A digit-led line that is not `N. text` (`1b.`,
|
||||
`1.1`, `2)`) is rejected and orphans what follows, like a duplicate id."
|
||||
|
||||
D. `main`: when no criterion parsed, the die message carries the first
|
||||
parse error, so an all-malformed block (`1) a`, `2) b`) still names its
|
||||
line:
|
||||
`main`'s locals become `local mode="$1" file="$2" first`, and the
|
||||
two-line `[ "${#_ID[@]}" -gt 0 ] || _die "no numbered criteria …"`
|
||||
becomes:
|
||||
```bash
|
||||
if [ "${#_ID[@]}" -eq 0 ]; then
|
||||
first="${_ERRORS[0]:+; ${_ERRORS[0]}}"
|
||||
_die "no numbered criteria under ## ACCEPTANCE CRITERIA$first"
|
||||
fi
|
||||
```
|
||||
|
||||
Any `_ERRORS` entry already makes the verdict ERROR rc 2 and executes
|
||||
nothing (existing "malformed ledger executes nothing" case).
|
||||
|
||||
Scans done on all 90+ .claude/tasks/contracts/*.md: no unindented digit-led
|
||||
non-criterion line and no criterion with a repeated attribute; `gates.sh
|
||||
status` verdicts identical before/after on every contract (scratch copy).
|
||||
|
||||
## Edit — lib/tests/gates.test.sh (exact)
|
||||
1. Section "fail-closed execution", right after
|
||||
`has "timeout recorded" "NOT-MET timeout=1s"`:
|
||||
```bash
|
||||
# The default must outlast the full suite (~135 s on 2026-11-16): at 120 s
|
||||
# a "full make test green" criterion went NOT-MET on the timeout alone.
|
||||
LAST="$WORK/default-timeout.md"
|
||||
printf '## ACCEPTANCE CRITERIA\n1. manual\n' > "$LAST"
|
||||
out="$(env -u GATES_TIMEOUT bash "$GATES" status "$LAST" 2>&1)"
|
||||
if [[ "$out" == *"timeout 600s"* ]]; then
|
||||
ok "default timeout 600s"
|
||||
else
|
||||
bad "default timeout 600s" "status did not print timeout 600s"
|
||||
fi
|
||||
```
|
||||
2. Section "parse strictness", right after the "duplicate orphans what
|
||||
follows" case (its closing `EOF`):
|
||||
```bash
|
||||
# An oracle under a label the parser does not read as `N. text` must never
|
||||
# overwrite the previous criterion's: criterion 1 fails, the stray oracle
|
||||
# passes, a false MET (LRN-284). A digit-led label is rejected by name;
|
||||
# any other shape trips the second-attribute guard when the previous
|
||||
# criterion already has that attribute (after a manual one it does not).
|
||||
gate "1b. label rejected" run "malformed criterion label at line 6" 2 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. real
|
||||
CHECK: exit 1
|
||||
EXPECT: x
|
||||
EVIDENCE: pending
|
||||
1b. sub
|
||||
CHECK: echo y
|
||||
EXPECT: y
|
||||
EVIDENCE: pending
|
||||
EOF
|
||||
|
||||
gate "1.1 label rejected" run "malformed criterion label at line 3" 2 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. first
|
||||
1.1 dotted
|
||||
EVIDENCE: pending
|
||||
EOF
|
||||
|
||||
gate "no valid label" run "malformed criterion label at line 2" 2 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
2) paren
|
||||
EOF
|
||||
|
||||
gate "indented label: second CHECK" run "second CHECK: at line 7" 2 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. real
|
||||
CHECK: exit 1
|
||||
EXPECT: x
|
||||
EVIDENCE: pending
|
||||
2. sub
|
||||
CHECK: echo y
|
||||
EXPECT: y
|
||||
EVIDENCE: pending
|
||||
EOF
|
||||
|
||||
gate "bullet label: second EVIDENCE" run "second EVIDENCE: at line 9" 2 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. real
|
||||
CHECK: exit 1
|
||||
EXPECT: x
|
||||
EVIDENCE: pending
|
||||
- sub
|
||||
CHECK: echo y
|
||||
EXPECT: y
|
||||
EVIDENCE: pending
|
||||
EOF
|
||||
```
|
||||
(Plan text is indented 3 for the list; in the file every heredoc body
|
||||
line starts at column 0 exactly as in the existing cases, the oracle
|
||||
attributes indented 3 spaces.)
|
||||
|
||||
## Residual (accepted)
|
||||
- Any label branch C misses (indented ` 2.`, `- `, `**2.**`) after a MANUAL
|
||||
criterion still lends it the stray oracle: that row turns MANUAL into
|
||||
MET/NOT-MET on an unrelated oracle. No failing oracle is overwritten.
|
||||
- `ABANDON: 1b …` parses as id 1 (gates.sh:90 regex): pre-existing, same
|
||||
class, logged to TODO, not fixed here.
|
||||
- lib/verify-secure-loop.md:46-47 lists ERROR causes as examples; it already
|
||||
omits "no numbered criteria" and "ABANDON names unknown criterion", so the
|
||||
two new causes do not make it newly stale. Logged to TODO (complete the
|
||||
list), not a third file here.
|
||||
- ~/.claude/lib is a symlink to this repo's lib: an in-flight contract in
|
||||
another repo with a repeated attribute or a digit-led prose line now goes
|
||||
ERROR (fail-closed, names the line).
|
||||
|
||||
## Out of scope
|
||||
lib/design-tool-gate.sh:70 (TODO:90, deferred by its own text). The test
|
||||
helper's own `${GATES_TIMEOUT:-120}` stays (fast fixtures only).
|
||||
@@ -21,6 +21,7 @@ The BDR-125 context queue is delivered: phases 0, 0b, 4a, 1, 5, 2 and 4b-4d ship
|
||||
- **model-router write guard fails closed**: when the guard's own check throws or times out, a main-loop Edit, Write or NotebookEdit of a code file outside a skill run is held with `model-router: the write guard failed (<kind>), so this write is held. Enter /hotfix, /feat, /bugfix or /ship-feature, or re-enter the skill you were running, then make this edit.` One log line per session: `model-router: write guard failed (<kind>): main-loop code writes are held until a skill runs`. Sub-agents, skill runs (typed, model-declared phase, typed `/route`) and `.md` / `.txt` files still pass; an error raised by a downstream tool is replayed as before. The guard used to let the write through on its own failure. Tests: `mods/model-router/hooks/register.test.ts` (GUARD: a failing guard …).
|
||||
- **model-router: Fable leaves auto-routing**: the `best` and `big` tiers default to opus then sonnet (were fable>opus>sonnet and opus>fable>sonnet), so Opus is the strongest model the router routes to and Fable is the advisor (`advisorModel` in settings.json). Fable stays in the model table and first in the fallback rank, so a hand pick of fable ranks above opus. The first-use Change dialog offers opus, sonnet and haiku; the bare `/model` dialog still offers fable, labelled `fable (custom)`. The ask before Fable only fires when a machine override puts fable at the head of `best`: otherwise `/route ask-tier on` answers `(inert: best is not headed by fable)` and `/route show` prints `ask-tier: inert`. An agent on a best or big row keeps its opus frontmatter when Opus is down. The `tiers.best does not lead the fallback chain` log is gone; `routing.json` is unchanged. Tests: `mods/model-router/hooks/register.test.ts`; `lib/tests/effort-routing.test.sh` floors every row on its tier's head. The `/client-handover` skill-runner children and the `lib/model-gate.md` dispatch doctrine pin `model: "opus"` instead of `"fable"` (BDR-150: Fable is the advisor, never a dispatch target), and the model gate lets a sub-agent pass when the route answer says its model is `fixed at spawn`. Tests: `lib/tests/model-routing.test.sh` refuses any fable dispatch pin under agents/, skills/ and lib/; `lib/tests/effort-routing.test.sh` checks the 7 opus/effort="high" client-handover dispatches.
|
||||
- **Advisor doctrine (`CLAUDE.global.md` § Workflow, `lib/effort-shift.md` § Advisor, `lib/challenge-plan.md`, `lib/verify-secure-loop.md`, `agents/plan-challenger.md`, `agents/verifier.md`, `agents/security-auditor.md`, `agents/analyzer.md`, `skills/{feat,bugfix,ship-feature,init-project,a11y,guardrails,audit-delta,tour,release-candidate}/SKILL.md`)**: when a stronger model is needed (an approach to settle before building, a stuck problem, a long task before calling it done, a change to recommend to the doctrine, the architecture or a public interface), the main loop calls the advisor tool (Fable, settings `advisorModel`, set by `/advisor`), at least on the written plan before the plan challengers are dispatched (`lib/challenge-plan.md`, every skill that challenges a plan, once per skill run, not before a re-challenge: an answer that lands a real flaw revises the plan file as plain plan text with no advisor attribution, the advice never enters a challenger brief, and the CHALLENGE SUMMARY gains an `Advisor:` row; the ORCHESTRATOR PROTOCOL in `agents/plan-challenger.md` mirrors this advisor-first step and the row), once per verify-secure run at the first gate loop to fail twice (floor, conformity, security, or a second structural failure, counting main-loop calls since GATE 0 first ran; the advice stays in the main loop and never enters an executor brief; every cap or escalation STOP carries it and says whether it predates the last iteration), and before proposing a merge (`gitflow finish`) or calling a long task done: one end-of-run call per skill run, never skipped for an earlier plan or stuck call. It sits at the end step of feat, bugfix, ship-feature, init-project, a11y and guardrails: the main loop first prints the run's diff stat, the answer goes into the reply, summary or finish proposal as an `Advisor:` line, a fix it drives goes back through the gates, and a later proposal reuses the answer and says it predates the newer commits. It also sits at the end of audit-delta and tour when the run applied a fix (tour: main loop only, never a runner), and at release-candidate STEP 4 before the go / hold ask. In those three the answer is reported only: a fix it calls for waits for a new run, and at the release gate it makes hold the recommended answer. The same six gate skills carry a `Stuck:` line that points at the verify-secure rule. Inside a skill run these points cover the triggers: no second call for the same recommendation. `plan-challenger`, `verifier`, `security-auditor` and `analyzer` may call it only when dispatched as a sub-agent, at most once per dispatch, late, before their verdict or report; the analyzer's output rests on the code it read, never on the advice alone, and advice proposing a design or a fix counts only where the brief asks for one. For the three gates advice only adds: the verifier may go back to a contract criterion and tags a resulting NOT-MET `(advisor-prompted)`, never clearing a gap on advice; the challenger never drops or lowers a finding on advice alone; the security-auditor tags an added finding `advisor:<STEP 3 class>` at that class's severity (REPORTED LOW when it matches no class), and tags a raised one `<rule>+advisor` only when the class's severity is higher than the finding's own; a raise that does not apply, or matches no class, changes nothing (no tag, no PROOF count). Its PROOF ends with `; advisor <n> added/raised`. Executors and every other sub-agent do not call it, even when the tool is listed. Advisor absent or erroring → proceed as written; advice waives no gate, cap or guard and, at a loop cap, feeds the STOP diagnosis. Fable on main comes only from a hand pick, a typed `/route model=fable`, a phase naming `model: fable` or a machine override that puts fable in a tier (BDR-150). Prose that still named Fable as the `audit` row head or a skill-runner pin (`agents/plan-challenger.md`, `lib/challenge-plan.md`, `lib/effort-shift.md`, `skills/tour/SKILL.md`) now says opus.
|
||||
- **gates.sh timeout**: the default per-CHECK timeout (`GATES_TIMEOUT`) is 600 s, up from 120 s. A full `make test` (about 135 s) went NOT-MET on the timeout alone. A run lasts the sum of its CHECKs: a caller with a shorter limit (a foreground tool call stops at 600 s) runs it in the background, and a killed run writes nothing back, so the floor stays PENDING.
|
||||
|
||||
### Removed
|
||||
- `hooks/design-toolchain-reminder.sh`, its `UserPromptSubmit` entry in `settings.json` (`ctx7-reminder` stays the only one) and its suite `lib/tests/design-toolchain-reminder.test.sh`. Measured 2026-10-31: 59 fires, 0 Reads of `rules/web-building.md`. Design routing stays with the `rules/web-building.md` path rule and the `CLAUDE.global.md` pointer. The fire log `~/.claude/logs/design-toolchain-fires.log` is left in place.
|
||||
@@ -41,6 +42,7 @@ The BDR-125 context queue is delivered: phases 0, 0b, 4a, 1, 5, 2 and 4b-4d ship
|
||||
- `mods/` type-check under `claude plugin validate --strict` (CLI 2.1.323 started type-checking mods): 17 sites narrowed, failure behaviour unchanged (6433e4d, BLK-049); the write guard has since moved to fail-closed (see Changed).
|
||||
- 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.
|
||||
- `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`.
|
||||
|
||||
## [3.0.0] — 2026-11-12
|
||||
|
||||
|
||||
+27
-5
@@ -29,7 +29,10 @@
|
||||
# lib/url-guard.sh first.
|
||||
set -uo pipefail
|
||||
|
||||
TIMEOUT="${GATES_TIMEOUT:-120}"
|
||||
# TIMEOUT is per CHECK and a run lasts their sum: the caller's own limit (a
|
||||
# foreground tool call stops at 600 s) must cover it, else run it in the
|
||||
# background. A killed run writes nothing back; the floor stays PENDING.
|
||||
TIMEOUT="${GATES_TIMEOUT:-600}"
|
||||
EVIDENCE_CAP=140
|
||||
|
||||
# Module-level parse tables, index-aligned. Bash has no record type; threading
|
||||
@@ -68,11 +71,23 @@ _new_crit() { # _new_crit <id> <text>
|
||||
_CUR=$((${#_ID[@]} - 1))
|
||||
}
|
||||
|
||||
# A second attribute on one criterion is an error, never an overwrite: it
|
||||
# is what an oracle under a label the parser missed looks like (LRN-284).
|
||||
_set_attr() { # _set_attr <CHECK|EXPECT|EVIDENCE> <value> <lineno>
|
||||
if [ "$_CUR" -lt 0 ]; then
|
||||
_err "$1 at line $3 belongs to no criterion"
|
||||
return 0
|
||||
fi
|
||||
local seen=""
|
||||
case "$1" in
|
||||
CHECK) seen="${_CHECK[_CUR]}" ;;
|
||||
EXPECT) seen="${_EXPECT[_CUR]}" ;;
|
||||
EVIDENCE) [ "${_EVLINE[_CUR]}" = 0 ] || seen=yes ;;
|
||||
esac
|
||||
if [ -n "$seen" ]; then
|
||||
_err "second $1: at line $3 in criterion ${_ID[_CUR]}"
|
||||
return 0
|
||||
fi
|
||||
case "$1" in
|
||||
CHECK) _CHECK[_CUR]="$2" ;;
|
||||
EXPECT) _EXPECT[_CUR]="$2" ;;
|
||||
@@ -82,11 +97,16 @@ _set_attr() { # _set_attr <CHECK|EXPECT|EVIDENCE> <value> <lineno>
|
||||
|
||||
# An UNINDENTED attribute is diagnosed, never absorbed: silently ignoring it
|
||||
# would demote a runnable criterion to a manual one, which is the one parse
|
||||
# bug that turns this checker into a rubber stamp.
|
||||
# bug that turns this checker into a rubber stamp. A digit-led line that is
|
||||
# not `N. text` (`1b.`, `1.1`, `2)`) is rejected and orphans what follows, like
|
||||
# a duplicate id.
|
||||
_absorb() { # _absorb <raw-line> <lineno>
|
||||
local body
|
||||
if [[ "$1" =~ ^([0-9]+)\.[[:space:]]+(.*)$ ]]; then
|
||||
_new_crit "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}"
|
||||
elif [[ "$1" =~ ^[0-9] ]]; then
|
||||
_err "malformed criterion label at line $2 (want \`N. text\`)"
|
||||
_CUR=-1
|
||||
elif [[ "$1" =~ ^ABANDON:[[:space:]]*([0-9]+)?[[:space:]]*(.*)$ ]]; then
|
||||
_ABANDON_ID+=("${BASH_REMATCH[1]}"); _ABANDON_WHY+=("${BASH_REMATCH[2]}")
|
||||
elif [[ "$1" =~ ^(CHECK|EXPECT|EVIDENCE): ]]; then
|
||||
@@ -300,11 +320,13 @@ _runnable_count() {
|
||||
# ── entry point ─────────────────────────────────────────────────────────────
|
||||
|
||||
main() { # main <status|run> <contract>
|
||||
local mode="$1" file="$2"
|
||||
local mode="$1" file="$2" first
|
||||
[ -r "$file" ] || _die "contract unreadable: $file"
|
||||
_parse "$file"
|
||||
[ "${#_ID[@]}" -gt 0 ] ||
|
||||
_die "no numbered criteria under ## ACCEPTANCE CRITERIA"
|
||||
if [ "${#_ID[@]}" -eq 0 ]; then
|
||||
first="${_ERRORS[0]:+; ${_ERRORS[0]}}"
|
||||
_die "no numbered criteria under ## ACCEPTANCE CRITERIA$first"
|
||||
fi
|
||||
_validate_oracles
|
||||
_validate_abandons
|
||||
if [ "$mode" = "run" ] && [ "${#_ERRORS[@]}" -eq 0 ]; then
|
||||
|
||||
@@ -89,6 +89,17 @@ GATES_TIMEOUT=1 gate "timeout = UNMET" run "GATES — VERDICT: UNMET(1)" 2 <<'EO
|
||||
EOF
|
||||
has "timeout recorded" "NOT-MET timeout=1s"
|
||||
|
||||
# The default must outlast the full suite (~135 s on 2026-11-16): at 120 s
|
||||
# a "full make test green" criterion went NOT-MET on the timeout alone.
|
||||
LAST="$WORK/default-timeout.md"
|
||||
printf '## ACCEPTANCE CRITERIA\n1. manual\n' > "$LAST"
|
||||
out="$(env -u GATES_TIMEOUT bash "$GATES" status "$LAST" 2>&1)"
|
||||
if [[ "$out" == *"timeout 600s"* ]]; then
|
||||
ok "default timeout 600s"
|
||||
else
|
||||
bad "default timeout 600s" "status did not print timeout 600s"
|
||||
fi
|
||||
|
||||
gate "manual-only contract passes through" run "RUNNABLE: 0 of 2" 0 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. a human reads the copy
|
||||
@@ -203,6 +214,59 @@ gate "duplicate orphans what follows" run "belongs to no criterion" 2 <<'EOF'
|
||||
EVIDENCE: pending
|
||||
EOF
|
||||
|
||||
# An oracle under a label the parser does not read as `N. text` must never
|
||||
# overwrite the previous criterion's: criterion 1 fails, the stray oracle
|
||||
# passes, a false MET (LRN-284). A digit-led label is rejected by name;
|
||||
# any other shape trips the second-attribute guard when the previous
|
||||
# criterion already has that attribute (after a manual one it does not).
|
||||
gate "1b. label rejected" run "malformed criterion label at line 6" 2 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. real
|
||||
CHECK: exit 1
|
||||
EXPECT: x
|
||||
EVIDENCE: pending
|
||||
1b. sub
|
||||
CHECK: echo y
|
||||
EXPECT: y
|
||||
EVIDENCE: pending
|
||||
EOF
|
||||
|
||||
gate "1.1 label rejected" run "malformed criterion label at line 3" 2 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. first
|
||||
1.1 dotted
|
||||
EVIDENCE: pending
|
||||
EOF
|
||||
|
||||
gate "no valid label" run "malformed criterion label at line 2" 2 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
2) paren
|
||||
EOF
|
||||
|
||||
gate "indented label: second CHECK" run "second CHECK: at line 7" 2 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. real
|
||||
CHECK: exit 1
|
||||
EXPECT: x
|
||||
EVIDENCE: pending
|
||||
2. sub
|
||||
CHECK: echo y
|
||||
EXPECT: y
|
||||
EVIDENCE: pending
|
||||
EOF
|
||||
|
||||
gate "bullet label: second EVIDENCE" run "second EVIDENCE: at line 9" 2 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. real
|
||||
CHECK: exit 1
|
||||
EXPECT: x
|
||||
EVIDENCE: pending
|
||||
- sub
|
||||
CHECK: echo y
|
||||
EXPECT: y
|
||||
EVIDENCE: pending
|
||||
EOF
|
||||
|
||||
gate "no numbered criteria" run "no numbered criteria" 2 <<'EOF'
|
||||
## ACCEPTANCE CRITERIA
|
||||
nothing numbered here
|
||||
|
||||
Reference in new issue
Block a user