|
| 1 | +# Behaviour suite — runbook |
| 2 | + |
| 3 | +Measures whether a change to agent-read text changes what the mdl agent does. Method: |
| 4 | +`process/preflight-skill-baseline-2026-08-31.md` (fresh agents, identical prompt core, only the |
| 5 | +context differs, mechanical scoring). Paths below are relative to `tests/behaviour/`. |
| 6 | + |
| 7 | +## When to run |
| 8 | + |
| 9 | +| Trigger | Arms | Reps | |
| 10 | +|---|---|---| |
| 11 | +| A PR that changes baseline-routed text or an agent stub (`docs/RELEASE-PROCESS.md` §4a, Behaviour row) | M = base, T = PR head | 5 × `page`, 5 × `mf`, 3 × each of the 5 probes, per arm (50 reps) | |
| 12 | +| Each release cut | N (no pack), and one ablation per baseline skill under review | N: 5 × `page`, 5 × `mf`. Ablation: M vs T-without-skill, same reps as a PR run | |
| 13 | + |
| 14 | +A full PR run is about 50 agent reps at 2–4 agent-minutes each (most of it reading the pack): |
| 15 | +roughly 100–200 agent-minutes, 10–20 minutes wall clock at the orchestrator's agent cap. |
| 16 | + |
| 17 | +## Build the packs |
| 18 | + |
| 19 | +``` |
| 20 | +bash build-packs.sh M origin/master # base |
| 21 | +bash build-packs.sh T <pr-head-ref> # candidate |
| 22 | +bash build-packs.sh T origin/master --without skills/<x>.md # ablation: value of <x> |
| 23 | +bash build-packs.sh N # no pack: preamble only |
| 24 | +``` |
| 25 | + |
| 26 | +Each writes `work/pack-<arm>.txt` (`work/` is ignored by git). A candidate and an ablation both |
| 27 | +write `work/pack-T.txt`: build one, run its reps, then build the other. The ref is checked out in a |
| 28 | +temporary detached worktree and removed again; the caller's tree is never touched. An ablation |
| 29 | +pack keeps the stub and its routing row naming the skill; only the skill's text is gone, which is |
| 30 | +the "routed but not read" case the skill would face. M vs ablated T is the skill's value; N vs M |
| 31 | +is the whole pack's value over plain reasoning. |
| 32 | + |
| 33 | +## One rep |
| 34 | + |
| 35 | +1. Pick arm `A` and task `K` (`page`, `mf`, or `probe-<name>`; task text is `tasks/<K>.md`). |
| 36 | +2. Spawn a **fresh** subagent per rep, never reused, with only Read and Write. **One model fixed |
| 37 | + for every rep of every arm.** Its prompt is `AGENT-PROMPT.txt` with PACK, TASK and OUT replaced |
| 38 | + by absolute paths: `work/pack-A.txt`, `tasks/K.md`, `work/out/A-K-rN.md`. |
| 39 | +3. Start the orchestrating session in a directory with no project `CLAUDE.md` in it or above |
| 40 | + it: the subagents inherit it. In the 2026-10-15 stub-diet run, 13 of its 20 M/T drafts named |
| 41 | + the host project's model file, which no pack or task contained (0 of the 10 N drafts did, but |
| 42 | + N inherited the same file); it reached every arm alike, so N measured "no toolkit rules", not |
| 43 | + "no guidance". |
| 44 | +4. From the subagent's result take its final reply and its usage line (`tool_uses`, |
| 45 | + `subagent_tokens`), then score: |
| 46 | + ``` |
| 47 | + bash score.sh work/out/A-K-rN.md --reply "<final reply>" --tool-calls <tool_uses> --tokens <subagent_tokens> >> work/results.tsv |
| 48 | + ``` |
| 49 | + `--reply` sets `read_all`: 1 when the reply equals the pack's `PACK-END:` line (the agent read |
| 50 | + to the end), else 0. The scorer reads arm and task from the file name. |
| 51 | + |
| 52 | +Run reps in parallel, up to the orchestrator's agent cap; interleave arms (M1, T1, M2, T2, …) |
| 53 | +so drift in the model service hits both. |
| 54 | + |
| 55 | +## Partial reads |
| 56 | + |
| 57 | +A `read_all=0` row stays in the results file: it is counted and reported, never deleted. It is |
| 58 | +left out of the metric comparison, and the rep is run again until each cell has its full count. |
| 59 | +Report the partial-read count per arm next to the verdict; more partial reads in T than in M is |
| 60 | +itself a regression (the pack got harder to read to the end). On 2026-10-15, 3 of 5 agents given |
| 61 | +the 4,822-line M pack in one batch stopped early. |
| 62 | + |
| 63 | +## Decision rule (agree it before running) |
| 64 | + |
| 65 | +Arm T is **no worse than arm M on every scored metric**: compare the median and the count of reps |
| 66 | +at the good value. Lower is better for `scan`, `check`, `txtcrumb`, `cinloop`, `rinloop`, `pos`; |
| 67 | +higher for the rest. Probes: `probe_first` T ≥ M − 1 per probe across its 3 reps. A loss on any |
| 68 | +metric is a finding the PR body reports with the rows; it is not averaged away. |
| 69 | + |
| 70 | +`tool_calls` and `tokens` are reported, not judged: here they mostly measure reading the pack, |
| 71 | +since the agent cannot run mxcli. |
| 72 | + |
| 73 | +## Known scorer gaps |
| 74 | + |
| 75 | +- `folder` counts `folder '…'` after the name, not the `Folder: '…'` page property. |
| 76 | +- `crumbs` counts link/action buttons whose action is `show page`; `Action: PAGE …` and a |
| 77 | + microflow that shows the page are not counted. |
| 78 | +- `check` is `mxcli check` with no project, so it is syntax only, and NA without a binary |
| 79 | + (`$MXCLI`, else `mxcli` on PATH). |
| 80 | +- `design-spacing.md` §3 shows the breadcrumb as one text widget; expect `txtcrumb` > 0 in every |
| 81 | + arm that carries it. |
0 commit comments