From ef5784675433e2d8baef70d5a67b7d640239a3a0 Mon Sep 17 00:00:00 2001 From: bchanot Date: Mon, 16 Nov 2026 23:59:21 +0100 Subject: [PATCH] chore(memory): Fable pins journal, doctrine tracker --- .claude/memory/journal.md | 1 + .claude/tasks/TODO.md | 3 +- .../2026-11-16-fable-pins-to-opus-1300.md | 28 +++++++ .../2026-11-16-fable-pins-to-opus-1300.md | 75 +++++++++++++++++++ 4 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 .claude/tasks/contracts/2026-11-16-fable-pins-to-opus-1300.md create mode 100644 .claude/tasks/plans/2026-11-16-fable-pins-to-opus-1300.md diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 6c4735e..6019f9d 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -770,3 +770,4 @@ rules: - C7 hard_deny mod off-switch clause: entry 6 names enabled:false in ~/.claude/.json, enabledPlugins false, profile.sh disable of mod (8c21c4b); off switches only, no source paths (2026-10-25 challenge). Staged via crafted index blob so user's dirty settings.json /model change stayed out. Residuals (closed list, /route off in run, over-refusal risk) BUGS-FOUND e22893d. - C1-C3 BDR-125 gap: 11 status lines (BDR-125 summary; BDR-079/017 + LRN-155 superseded, 7 amended by BDR-134/136; amended entries still recalled with old title, only superseded/deprecated leave recall); C3 deferrals → 7 TODO lines + 3 dated drops; C6 dropped (throwaway repos, user). - Router no-Fable (BDR-150, 24b0f35, docs 42385d2): best/big = opus>sonnet, fable ranked + hand pick only, Change dialog drops fable, askTier inert unless override heads best with fable; routing.json untouched (live install). 2 challenge rounds caught dialog labels, live-install consent gap, legacy rig masking. BDR-123/135 amended, LRN-224 superseded. Next: Fable pins → opus, advisor doctrine. +- Fable pins → opus (beebfe2, docs): client-handover 7 skill-runner pins + model-gate doctrine opus, gate row 'fixed at spawn' proceeds in sub-agent, repo-wide census refuses fable pins. Amends BDR-077 W1 per BDR-150. Next: doctrine run (effort-shift, advisor rule, Fable prose). diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 2473742..c57c9ef 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -95,6 +95,7 @@ Open children of the shipped phases (History 2026-11-12), text verbatim. - [ ] lib/tests/project-rules.test.sh:296 T11b hardcodes '4 rule(s) ok': a 5th .claude/rules/*.md turns it red (BDR-128 residual) - [ ] MIGRATION.md: one sentence that hooks/instructions-loaded.sh needs a CLI emitting InstructionsLoaded (older CLI: no log, no path-rule load proof); check claude --version on the work machine (BDR-128 residual) - [ ] raw registry text to the terminal (TODO:57 leftover, not phase-tied): lib/reconcile.sh:137 prints ${st:0:80} of an unreadable status line, lib/memory.sh:493 check prints the bad heading $0; control chars pass (upgrade's clean() maps them to ?, these two do not) +- [ ] doctrine run (BDR-150, next): lib/effort-shift.md:30-32 wiring point 5 still names `fable` skill-runners and "high for fable runners" (split across lines, the census regex misses it); stale Fable-routing prose in agents/plan-challenger.md:111,:115, lib/challenge-plan.md:48,:51, skills/tour/SKILL.md:83; advisor rule into CLAUDE.global.md + effort-shift.md ### Release 3.0.0 Scope (user 2026-11-11) [gated]: D1-D6 + the 6 dead deny entries + MIGRATION/CHANGELOG land before the cut. Decisions: D1 digest + on-demand read (capitalize:375 aligned); D2 remove plugin-dev everywhere (OFF row disappears when empty); D3 advisor + USAGE rewritten to packs vocabulary, no budget/token claims, G2 add-ons included, SB10 fails on a missing file; D4 /prune-memory reads statuses through memory.sh (v1+v2), example IDs 9xx; D5 web-security keeps only its unique rules, points to secure-by-default, password = argon2id; D6 rule text names the CLAUDE.global.md append + install-plugins.sh runs the graphify step from $REPO. Runs: /feat D2+D3, /feat D4, /feat D1+D5+D6, /feat dead denies, docs, /release-candidate. @@ -148,7 +149,7 @@ Scope (user 2026-11-11) [gated]: D1-D6 + the 6 dead deny entries + MIGRATION/CHA ### Known limits (accepted, no action) - model-router spawn path unprobed: 1st gate of an outage window dies once (seen live 2026-10-23, retry lands on the opus floor); tour/onboard/audit-delta no retry; onAutoSwitch with main on opus marks nothing if the engine auto-falls a gate off Fable -- Residuals (accepted): explicit `Agent(model:"fable")` pins (client-handover) still fail w/o credits (BDR-115 kept); spawn path not probed; session model itself out of credits → CLOSED 2026-10-16 c11cd3b (kept cur probed too); no cross-session persistence → ≤8 s stall per new session; timed-out probe keeps retrying in engine (no cancel); `[1m]` gating unverified (bare id probed); no Esc regression test (kit cannot abort signal); probe sleep eats ~8 of 10 s `turn.step` budget. +- Residuals (accepted): explicit `Agent(model:"fable")` pins (client-handover) moved to opus 2026-11-16 (beebfe2, BDR-150): an opus runner failure now marks opus down in the breaker and demotes main to the sonnet stand-in for the cooldown (accepted); spawn path not probed; session model itself out of credits → CLOSED 2026-10-16 c11cd3b (kept cur probed too); no cross-session persistence → ≤8 s stall per new session; timed-out probe keeps retrying in engine (no cancel); `[1m]` gating unverified (bare id probed); no Esc regression test (kit cannot abort signal); probe sleep eats ~8 of 10 s `turn.step` budget. - Residuals left (accepted): TTL known only after the first PostModelSwitch of the process (no API exposes the account TTL; 60 min default before); hooks-below `context` and a dropped prompt leave the estimate conservative/stale; `onAutoSwitch` targets main's `lastPlan` even for a sub-agent's auto fallback (pre-existing); `agent_id: null` on a main switch (if the engine ever sends null) would freeze sessionModel/TTL updates. - W1-C accepted-by-design (security 2026-10-09, MEDIUM, not coded around;): (1) the model itself can raise the main loop to fable for the rest of a turn through the `route` tool (plan/reflect/escalate/judge) or a background dispatch (derived orchestrate = best tier) — bounded by the turn and `upgradeMaxTokens`, no sticky route is model-callable; (2) CLOSED by feat C 786ee13 (keywords, ultrathink and derived orchestrate set effort only). Residuals: `PostModelSwitch` `auto` covers "other programmatic change" (a healthy model could be marked 15 min); strikes never decay inside a session; a `[1m]` variant's `model_not_found` marks the base model until reload; classifier deferred to W2. 2026-10-23 feat C 786ee13: (1) derived-orchestrate part and (2) keyword/ultrathink part CLOSED (effort-only routes); (1) route-tool lift stays by design (sanctioned path) - W3-B residuals: SKILL.md symlink follow (LOW, kept: `skills/` itself is a symlink); `descs` cap and "(custom)" label untested. (security-auditor `changed` entry purged 2026-10-11.) diff --git a/.claude/tasks/contracts/2026-11-16-fable-pins-to-opus-1300.md b/.claude/tasks/contracts/2026-11-16-fable-pins-to-opus-1300.md new file mode 100644 index 0000000..99bff27 --- /dev/null +++ b/.claude/tasks/contracts/2026-11-16-fable-pins-to-opus-1300.md @@ -0,0 +1,28 @@ +# CONTRACT — fable-pins-to-opus (BDR-150 follow-up, amends BDR-077 W1) +- date: 2026-11-16 | flow: feat | branch: feature/fable-pins-to-opus (off develop) +- status: active + +## REQUEST (verbatim — IMMUTABLE) +Fable dispatch pins → opus (user 2026-11-16, BDR-150: Fable is the advisor, never auto-routed; this amends BDR-077 W1 "skill-runner children pinned fable"). Explicit `model: "fable"` sub-agent pins become `model: "opus"` (effort stays "high"): agents/client-handover-writer.md (7 sites: :270, :273, :432, :463, :476, :565, :685), skills/client-handover/SKILL.md:34, lib/model-gate.md:27 (dispatch tiers paragraph: skill-runners get opus). The census tests follow: lib/tests/model-routing.test.sh:88-95 (BDR-077 W1 block asserts 'model: "fable"' in client-handover-writer.md and model-gate.md) and lib/tests/effort-routing.test.sh:231-232 (client-handover-writer skill-runner lines carry effort="high"). model-gate's table keeps accepting a fable id (a hand-picked Fable session may still run a skill). + +## CLARIFICATIONS +- [internal 2026-11-16] plan .claude/tasks/plans/2026-11-16-fable-pins-to-opus-1300.md, section r2 wins (same-line pins, exact count 7, repo-wide fable census, gate row for `fixed at spawn`). +- [deferred 2026-11-16] lib/effort-shift.md:30-32 and the prose citers (plan-challenger, challenge-plan, tour, README) go to the doctrine run next (feat 5-file cap); TODO line written at close. + +## ACCEPTANCE CRITERIA +1. No `model: "fable"` pin left in the dispatch sites. + CHECK: cd /home/bchanot/Documents/claude && { grep -c 'model: "fable"' agents/client-handover-writer.md skills/client-handover/SKILL.md lib/model-gate.md || true; } | awk -F: '{s+=$2} END {print s}' + EXPECT: 0 + EVIDENCE: MET exit=0 marker-found :: 0 +2. The seven skill-runner pins in client-handover-writer.md are opus with effort high. + CHECK: cd /home/bchanot/Documents/claude && grep 'model: "opus"' agents/client-handover-writer.md | grep -c 'effort="high"' + EXPECT: 7 + EVIDENCE: MET exit=0 marker-found :: 7 +3. model-routing and effort-routing suites green. + CHECK: cd /home/bchanot/Documents/claude && PATH=$HOME/.bun/bin:$PATH make test suite=lib/tests/model-routing.test.sh &1 | tail -1 && PATH=$HOME/.bun/bin:$PATH make test suite=lib/tests/effort-routing.test.sh &1 | tail -1 + EXPECT: all suites green + EVIDENCE: MET exit=0 marker-found :: all suites green all suites green +4. Full make test green (GATES_TIMEOUT=400); the census assertions bite (a reintroduced `model: "fable"` pin or an opus skill-runner line without effort="high" turns a suite red; shown on a scratch copy) (manual). + +## FILE SCOPE +agents/client-handover-writer.md (7 pin lines + the BDR-077 paragraph ~:268-271), skills/client-handover/SKILL.md (~:34), lib/model-gate.md (Dispatch tiers paragraph ~:23-29), lib/tests/model-routing.test.sh (~:88-95), lib/tests/effort-routing.test.sh (~:224-225). diff --git a/.claude/tasks/plans/2026-11-16-fable-pins-to-opus-1300.md b/.claude/tasks/plans/2026-11-16-fable-pins-to-opus-1300.md new file mode 100644 index 0000000..1fe03eb --- /dev/null +++ b/.claude/tasks/plans/2026-11-16-fable-pins-to-opus-1300.md @@ -0,0 +1,75 @@ +# PLAN — fable-pins-to-opus (BDR-150 follow-up) + +## APPROACH +1. agents/client-handover-writer.md: the 7 `model: "fable"` occurrences + become `model: "opus"`, `effort="high"` kept on each. In the BDR-077 + paragraph (~:268-271) the sentence keeps its meaning: skill-runners carry + `model: "opus"` and `effort="high"`, never inherit the session model; add + "(BDR-150: Fable is the advisor, never a dispatch target)". +2. skills/client-handover/SKILL.md ~:34: "skill-runner children dispatched + `model: "fable"`" → `model: "opus"`. +3. lib/model-gate.md Dispatch tiers paragraph: "`model: "fable"` when the + child reflects/orchestrates for the main loop (skill-runners), else its + tier (opus = dispatched judgment, ...)" → "`model: "opus"` for + skill-runners (the child reflects/orchestrates for the main loop) and + for dispatched judgment, sonnet = execution, haiku = mechanical probes; + Fable is never a dispatch target, it is the advisor (BDR-150)". The + gate's answer table stays (a fable id still proceeds: a hand-picked + Fable session may run a skill); its STOP text stays "require Fable or + Opus". +4. lib/tests/model-routing.test.sh block 12 (~:88-95): comment says + skill-runner children are pinned opus since BDR-150 (Fable = advisor); + `has client-handover-writer.md 'model: "opus"'`, `has model-gate.md + 'model: "opus" for skill-runners'` (the new phrase), plus `lacks` on + 'model: "fable"' in client-handover-writer.md, skills/client-handover/ + SKILL.md and model-gate.md. +5. lib/tests/effort-routing.test.sh ~:224-225: count the `model: "opus"` + lines of client-handover-writer.md (must be ≥ 1, else ko: a vacuous + pass) and require every one to carry `effort="high"`. + +## EDGE CASES +- lib/effort-shift.md ("`high` for fable runners", wiring point 5) is the + doctrine run's file, out of scope here; it stays stale until that run + (next, same session). +- README.md:107 and :132 citers → doc-sync step. + +## DISPOSITION +Amends BDR-077 W1 (skill-runner pins fable → opus) per BDR-150. Honors +BDR-108 (pins stay tier aliases). + +## FILES +agents/client-handover-writer.md, skills/client-handover/SKILL.md, +lib/model-gate.md, lib/tests/model-routing.test.sh, +lib/tests/effort-routing.test.sh. + +## r2 (challenge r1: correctness CONCERNS(1), robustness CONCERNS(1), simplicity SOLID) — amends APPROACH 1-5 +1. client-handover-writer.md: swap the 7 `model: "fable"` for `model: "opus"` + only; `model: "opus"` and `effort="high"` stay on the SAME physical line + at each site; no BDR-150 parenthetical in this file. +2. model-gate.md Dispatch tiers paragraph: one tier list, e.g. "its tier: + `model: "opus"` = skill-runners (the child reflects/orchestrates for the + main loop) and dispatched judgment, sonnet = execution, haiku = + mechanical probes; never fable (BDR-150, the advisor)." Keep the file + short (≤ 31 lines). Gate table: add one row: the answer says the model + is `fixed at spawn` (the route tool called inside a sub-agent, e.g. a + pinned skill-runner running a gated skill) → proceed, SILENT. +3. model-routing.test.sh block 12: replace the whole block comment (spike + lines included) with: skill-runner children pinned opus since BDR-150 + (Fable is the advisor, never a dispatch target). Assertions: `has + client-handover-writer.md 'model: "opus"'`, `has lib/model-gate.md + 'model: "opus"'` (no backtick in the needle; the string is absent from + model-gate.md today), `has lib/model-gate.md 'fixed at spawn'`, and ONE + repo-wide census: `git -C "$R" grep -nE 'model ?[:=] ?"fable"' -- + agents skills lib ':!lib/tests'` must print nothing (ko with the hits). +4. effort-routing.test.sh ~:224-225: following the onboard idiom + (:220-222): count the lines of client-handover-writer.md holding + `model: "opus"`; require `-eq 7` and that the same 7 carry + `effort="high"` (equal counts). +5. Tracking (closing step, not the executor): TODO.md Actionable line for + lib/effort-shift.md:30-32 (wiring point 5 still names fable runners) + + README.md:109, :134, plan-challenger.md:111,:115, challenge-plan.md:48, + :51, skills/tour/SKILL.md:83 → the doctrine run (next); TODO.md:151 + residual ("explicit Agent(model:"fable") pins … fail w/o credits") + rewritten: now an opus runner failure marks opus down in the breaker + and demotes main to the sonnet stand-in for the cooldown (accepted + residual, BDR-150).