Skip to content

chore(context): runbook slice for helpers; runbook drops its copy of the baseline table (stub diet T2+T3) - #378

Closed
MendixMau wants to merge 4 commits into
masterfrom
chore/stub-diet-runbook
Closed

MendixMau wants to merge 4 commits into
masterfrom
chore/stub-diet-runbook

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

Direct lane

What changed and why (one paragraph):
Items T2 and T3 of the stub-diet context-cost research (r-stub-diet). T2: skills/conversion-runbook.md held a fourth rendered copy of the baseline routing table, inside a baseline file that every role reads. The same table is already in README, ROUTING.md and every project's CLAUDE.local.md. The runbook is out of render-routing.sh's SURFACES, and the block is replaced by a one-line pointer to CLAUDE.local.md / ROUTING.md. T3: new bin/runbook-slice.sh <stage> prints §1b (Live Checklist) plus that stage's section (build-ready = 5; --spans prints only the line spans). gate-check's runbook_span moved into bin/lib/runbook-span.sh, which gate-check, the slice and the word count now share. The runbook routing row is split: conversion-runbook now goes to lead,ba,architect, and a new runbook-slice row (baseline, same stages) goes to mdl,gate,test,review. routing_baseline_pack counts the slice's printed output for those roles (1,475 words at Stage 5), not zero, so the per-role lines from render-routing.sh --check stay honest. For the full pack with an unknown stage it counts the whole runbook. Render path: the helper stubs and the generated CLAUDE.local.md baseline block (routing_sync_claude_local, called by both init-project and sync-project) carry the slice row automatically. init-project's hand-written "process authority" item 1 also gains one sentence telling helpers to run the slice. Existing projects get the routing row on their next sync; their item 1 text is unchanged, because sync only rewrites the older "read whole" wording.

Word counts (LC_ALL=C bin/render-routing.sh --check, base d16f578 → this PR):

before after
Baseline total (budget 80,000) 75,028 73,233
Stage 5: mdl / gate / test / review 56,236 / 34,629 / 33,689 / 44,818 43,352 / 21,745 / 20,805 / 31,934
Stage 5: lead / ba / architect 27,862 / 27,950 / 26,037 26,067 / 26,155 / 24,242
Stage 6: mdl / gate / test / review 32,983 / 33,880 / 33,689 / 39,723 19,875 / 20,772 / 20,581 / 26,615
Stage P–3: helpers (each) 21,106 7,694–8,603

The stage totals (union over roles) rise slightly at some stages (e.g. Stage 0: 29,667 → 29,728), because both the runbook and the slice are now in the union. PR-B (stacked on this one, T1) takes mdl at Stage 5 to 30,400. T4 (narrative moves) is a separate PR. T5 (detection-gaps register) is untouched; it is waiting for a maintainer ruling.

Mechanical no-loss check: tests/bench/trim-noloss.sh d16f578 HEAD. It is generic, so later trim PRs can reuse it. Each line removed from a .md is either found again with grep -F at head, or is a row from a ROUTING block whose path the table still routes. Result: 9 found elsewhere, 41 routing rows still routed, 3 left for hand review:

  1. and 2. "This table is the canonical baseline set. It is rendered from the toolkit's one routing / table; a skill missing here is a skill no agent will find." These described the removed copy. They are replaced by the pointer sentence, which says where the canonical set lives.
  2. The runbook's "How to read this file" paragraph. Only its last sentence changed: "The baseline table above is rendered here so this file is complete, not so it is re-read." This described the removed table and is replaced by the pointer to bin/runbook-slice.sh. The rest of the paragraph is unchanged.

None of the three is a rule, STOP row, denominator or failure example.

Owed before merge: behaviour A/B (maintainer's session, measurement plan from r-stub-diet, process/preflight-skill-baseline-2026-08-31.md method):

  • Fresh Sonnet drafting agents, 5 reps per arm. One arm gets the master stubs and skills, the other this PR's (and A+B stacked). Two tasks: one page task and one microflow task with a loop.
  • Score: shell violations (check-page-shell.sh), page-fidelity.js --no-log, the report block with its denominators, write mode per operation, whether the microflow-preflight checklist is posted, and whether a seeded STOP operation is refused. Pass if no metric is worse than n=5 noise.
  • For this PR in particular, check that a helper actually runs runbook-slice.sh and still posts the §1b live checklist.
  • Retrieval probe (skill rule 8): a helper given a Stage 5 task runs the slice rather than opening the whole runbook, in 5 of 5 reps.
  • Start tokens per helper from bin/context-audit.sh on the next field build.

Field evidence: none yet, from a project. The slice's golden input is the real skills/conversion-runbook.md (no hand-written runbook). test-runbook-slice.sh checks every stage token against it and checks that the spans agree with gate-check's "Read for this gate" line.

  • No client data anywhere in the diff
  • Size cap: 19 files / ~340 lines. Excluding tests and CHANGELOG it is 15 files, but 6 of those are generated re-renders (README, ROUTING, 4 agent stubs) of 1–3 lines each. Lines are under 400.
  • Test tier: T0, plus T1 scoped fixtures, plus render-routing --check. Fixtures run (all green): test-routing-tier 14/0, test-runbook-slice (new) 21/0, test-baseline-pack 16/0, test-render-routing 5/0, test-pipefail-grep-q 3/0, test-bug03-gates 31/0, test-bug06-freshness 64/0, test-source-sufficiency-gate 7/0, test-source-ledger 55/0, test-bug12-sync 61/0, test-triage-report 66/0, test-surface-column 13/0, test-context-audit 16/0, test-guide-reopen 10/0, test-ritual-slim 17/0. Also clean: bin/check-skill-routing.sh, check-scripts, check-portability, the leak guard, private citations and pr-discipline. T2 field run: none.
  • New instrument: golden input is the real runbook. Layouts: N/A (it reads the toolkit, not a project). Platforms: bash 3.2 / POSIX awk / sed only, and check-portability is clean.
  • Routing row added (runbook-slice) and re-rendered
  • CHANGELOG.md line appended, crediting r-stub-diet
  • No bug entries

🤖 Generated with Claude Code

https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw


Generated by Claude Code

…the baseline table

T2: skills/conversion-runbook.md is no longer a render-routing surface; its rendered
baseline table (a fourth copy) is replaced by a one-line pointer to CLAUDE.local.md and
ROUTING.md.

T3: bin/runbook-slice.sh <stage> prints §1b plus that stage's section. The span logic
moves from gate-check.sh into bin/lib/runbook-span.sh, shared by both and by the per-role
count. The runbook routing row is split: lead/ba/architect keep the runbook,
mdl/gate/test/review get the slice; routing_baseline_pack counts the slice's printed words.

Adds tests/wave2/test-runbook-slice.sh and tests/bench/trim-noloss.sh; updates
test-routing-tier.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
MendixMau pushed a commit that referenced this pull request Oct 14, 2026
…aded skills (T4)

Review: independent review MERGE (stub moves; durable-text moves only, no deletions). Behaviour A/B (process/preflight-skill-baseline method, sonnet reps, packs read in full): arm T = #369+#378+#380 trimmed mdl context (33,274 words) vs arm M = master (60,041). Drafting 5 reps x 2 tasks: planted STOP refused 10/10 both arms; scan 0 both; mxcli check PARSE page T 2/5 vs M 3/5, mf T 0/5; crumbs missing page T 1/5 vs M 2/5. Retrieval probes (5 re-tiered triggers x 3 reps): T probe_first 15/15. Decision rule (T no worse than M on every metric) met. Side finding: 3 of 5 M-arm probe agents skipped most of the 4,822-line pack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
… verdicts and §3b ownership

Review findings on #378:
- routing_baseline_pack counted bin/runbook-slice.sh on top of skills/conversion-runbook.md
  whenever both rows reached the pack (no role). The no-role full pack read 85,797 words, over
  the 80,000 budget, on gate-check's advisory line. The slice now counts 0 when the runbook row
  is already counted; full pack 73,233. test-baseline-pack asserts it on a scratch table and on
  the real one.
- runbook-slice.sh now also prints the gate-verdict table (five verdicts + exit codes) and
  §3b's "Ownership is split" paragraph (a helper reports BRD-touching decisions to the lead),
  located by heading/anchor in lib/runbook-span.sh. test-runbook-slice T6 asserts both for
  every stage. mdl at Stage 5: 43,599 words.
- CHANGELOG: behaviour A/B result replaces "owed before merge".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
MendixMau pushed a commit that referenced this pull request Oct 14, 2026
MendixMau pushed a commit that referenced this pull request Oct 14, 2026
…duplicate the merge left

The merge of #378's review fixes kept both the old and the updated copy of #378's CHANGELOG
line (the adjacent T1 line differs between the branches). Remove the stale copy and replace
"Behaviour A/B owed before merge" on this PR's own line with the result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
… slice gained verdicts + §3b

Measured with bin/render-routing.sh --check on this head (master: 56,236; baseline
75,028 → 73,233 unchanged). The line carries no review figure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
MendixMau pushed a commit that referenced this pull request Oct 14, 2026
MendixMau pushed a commit that referenced this pull request Oct 14, 2026
… review 32,181 → 30,265)

Measured with bin/render-routing.sh --check on #378's head (760a423) and on this head. Also
drops the stale copy of #378's line the merge left beside the updated one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
MendixMau pushed a commit that referenced this pull request Oct 14, 2026
…its copy of the baseline table (stub diet T2+T3)

Review: independent review MERGE-AFTER-FIX — full pack double-counted the runbook (85,797 > 80,000 budget); runbook-slice dropped the gate-verdict table and §3b helper-ownership rule → both fixed (anchor-based spans with fallback pointer), in 760a423; confirmation MERGE: baseline 73,233/80,000 (master 75,028), Stage 5 mdl 56,236 → 43,599; fixtures routing-tier 14, runbook-slice 31, baseline-pack 22, render-routing 5, bug03 31, bug12 61, ritual-slim 17, check-skill-routing pass. Behaviour A/B (with #369/#380, 5 reps × 2 tasks + 5 probes × 3 reps, sonnet): trimmed context no worse than master on every scored metric (planted STOP 10/10 each arm, parse failures page 2/5 vs 3/5, probes 15/15).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
MendixMau pushed a commit that referenced this pull request Oct 14, 2026
…gents column (stub diet T1) — stacked on #378

Review: independent review MERGE — `<role>?` on-demand routing token; audit refuses all?, ? on non-baseline rows, and plain+? duplicates; the five re-tiered skills hold no rule mdl needs before drafting. Confirmation MERGE at 966caff (stacked on #378 via merge commits): Stage 5 mdl 43,599 → 30,647, review 32,181 → 30,265, baseline 73,233; fixtures routing-tier 26, runbook-slice 31, baseline-pack 22, render-routing 5, bug03 31, bug12 61, ritual-slim 17. Behaviour A/B as on #378: no worse than master on every metric. Follow-up: completed agent stubs in existing projects are never re-rendered, so they don't get the saving.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
MendixMau added a commit that referenced this pull request Oct 15, 2026
…journey controls, fixes) (#385)

Lands #340 #363 #362 #355 #370 #368 #364 #365 #366 #372 #367 #371 #376 #369 #373 #377 #378 #380.

Review: each constituent PR independently reviewed by a fresh agent that did not write it; merged into integration/2026-10-15 only on a MERGE verdict with green CI (per-PR Review lines in the integration merge commits). After-fix rounds: #373 (env-var cap, rename/skip-loops freshness), #377 (inline URI fallback), #378 (full-pack double count, slice content). Stub diet (#369/#378/#380) behaviour A/B, 5 reps x 2 drafting tasks + 5 retrieval probes x 3 reps: trimmed context no worse than master on every scored metric (planted STOP refused 20/20, parse failures page 2/5 vs 3/5, probes 15/15); mdl Stage 5 56,236 -> 30,647 words, baseline 75,028 -> 73,233. Full suites on c9bc073: run-tests 33/0, wave2 111 fixtures 0 failing. Field evidence: none yet for the instruments (#355 warn-only, #373/#377 read-only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
@MendixMau

Copy link
Copy Markdown
Owner Author

Landed on master in #385 (squash 868b3cb), after its own independent review on the night integration branch. Closing this PR.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants