Skip to content

feat: call out dispatches that went below their agent's pin - #27

Merged
AqueGen merged 2 commits into
mainfrom
feat/below-pin-dispatches
Aug 11, 2026
Merged

feat: call out dispatches that went below their agent's pin#27
AqueGen merged 2 commits into
mainfrom
feat/below-pin-dispatches

Conversation

@AqueGen

@AqueGen AqueGen commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Stacked on #26 - base retargets to main once that merges.

A week of stats from another user showed reviewer and implementer running on haiku. The report scored all four as wins, because they genuinely were cheaper than the session: they padded the routed-down percentage while breaking the thing they were routed for.

A pin is a ceiling and a floor. Only the ceiling was enforced anywhere.

2 of the cheaper ones went BELOW their agent's own pin, which is not a saving - the pin is the tier the role needs, and the session could afford it.

Ran BELOW the agent''s pin (counted cheaper above, but the role was undercut - drop the model= override, or use an agent whose pin matches the work):
   3  model-routing:reviewer (model=haiku, pin=opus)
   1  model-routing:implementer (model=haiku, pin=sonnet)

The rule

The floor is min(pin, session model), not the pin. The pins-are-ceilings rule requires capping at the session model, so reviewer running sonnet on a sonnet session is the rule being followed and must not be flagged. Two more exclusions:

  • unpinned agent types have no floor at all;
  • CLAUDE_CODE_SUBAGENT_MODEL is excluded, because it forces every subagent at once. That is a deliberate machine-wide setting rather than a per-dispatch judgement, and its only remedy is unsetting the variable - which the env= rows already say plainly. Including it would fill the section with rows carrying advice that does not apply to them.

What does not change

The headline. These dispatches really are cheaper than the session, so redefining "routed down" would break comparison with every report anyone has already run. The annotation qualifies the figure instead, and the rows move out of the win column into their own section so nothing is double-listed.

Validation on real data

On my own 14-day window this immediately surfaces 23 model-routing:reviewer (model=sonnet, pin=opus). I had spotted that same pattern earlier this week only by reading the per-agent rows by hand and comparing them against the pin table from memory - which is exactly the work a report should be doing.

Tests

71 pass, three new: the flag firing on two different depths of undercut, the ceiling cap explicitly NOT firing, and unpinned agents having no floor. One existing test moved behaviour rather than breaking - the env-override row stayed in the win column once env was excluded, which is what its name asserts.

@AqueGen
AqueGen changed the base branch from feat/cost-estimate to main August 11, 2026 07:49
@AqueGen
AqueGen force-pushed the feat/below-pin-dispatches branch from 09227c0 to 2f005e5 Compare August 11, 2026 07:54
A week of another user's stats showed reviewer and implementer running on haiku,
and the report scored all four as wins: they were genuinely cheaper than the
session, so they padded the routed-down percentage while breaking the thing they
were routed for. A pin is a ceiling and a floor, and only the ceiling was
enforced anywhere.

The floor is min(pin, session model), not the pin, because the pins-are-ceilings
rule requires capping at the session model - reviewer running sonnet on a sonnet
session is the rule being followed, so it must not be flagged. Unpinned agent
types have no floor, and CLAUDE_CODE_SUBAGENT_MODEL is excluded because it forces
every subagent at once: that is a deliberate machine-wide setting, not a
per-dispatch judgement, and its only remedy is unsetting the variable, which the
env= rows already say.

Below-pin dispatches now carry the pin in their row key, group into their own
section rather than the win column, and add a line under the headline. The
headline itself does not move - they really are cheaper than the session - so the
annotation qualifies the figure instead of redefining it and breaking comparison
with older reports.

On the author's own 14-day window this immediately surfaces 23 reviewer
dispatches on sonnet against an opus pin, which had needed a manual read of the
per-agent rows to notice.

The rule is stated in the skill next to the ceiling half, and the README gains a
section, including the part that matters when the cheap tier really was right:
pick an agent pinned for it rather than overriding a role agent downward.

71 tests pass, three of them new - the flag firing on two tiers of undercut, the
ceiling cap explicitly NOT firing, and unpinned agents having no floor.
…known

Both review axes found the same bug independently. The floor fell back to the
raw pin when the session tier could not be ranked, which broke the report two
ways at once. A reviewer dispatched on haiku from a session on an unrecognized
family was announced in the headline as going below its pin, while verdictOf
called the same entry non-comparable and filed the row under "not
tier-comparable" - a claim with no section under it. And a pre-0.5.3 entry with
no session at all was flagged against the pin even though it may have been the
correct cap on a cheap session. An unknown tier on any of the three sides now
yields no verdict, which is the rule this file already applies to its own pair.

The flag also moved out of a Set of formatted row keys into the per-key
aggregate. Two accumulators existed only because the fact lived in a display
string; s.underPin removes both, and the grouping condition s.underPin === s.n
makes the collision above impossible by construction rather than by argument.
The key suffix stays, and its comment now records that it PARTITIONS the keys -
the property the grouping depends on, which a later edit moving it into the row
text would break silently.

The headline claimed "the session could afford it", which is false for the case
where the session sits below the pin and the dispatch went under the cap
anyway - it now claims only that nothing required going under. The README
sample was impossible: its headline said two while its rows totalled four,
because I took the count from a test fixture and the rows from a real report.
Both docs also stated the min(pin, session) floor unconditionally, which was
only true after this fix.

Tests 71 to 74. The three new ones cover the unknown and absent session, the
session-below-pin case, and the env exclusion - which turned out already
covered by the env-override test, contrary to the review claim that deleting
the guard passed everything; verified by deleting it and watching that test
fail. The existing assertions were also section-scoped: reaching from a heading
to the end of the report would have passed with a row in the wrong group, which
is the whole thing under test.
@AqueGen
AqueGen force-pushed the feat/below-pin-dispatches branch from 2f005e5 to a95b4b1 Compare August 11, 2026 07:56
@AqueGen
AqueGen merged commit 2b9b433 into main Aug 11, 2026
2 checks passed
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.

1 participant