Files
bullpen/lib
marfrit eafa29a074 grinder: report the cost tier that actually served, not the tier asked for (#118)
A worker reported `model qwen3.6-coding` — the rung it ASKED for. That cannot answer
"which rung solved this task", which on 2026-08-01 turned a question that should have
been a glance at the log into a 100-minute measurement.

lib/bullpen_modeltag.py is the pure function, built through the room: contract by
@testdesigner (17 cases, three rounds), implementation ground by @py, reviewed twice by
@reviewer. Each contract round closed a defect the previous one structurally could not
see:
  1. unsatisfiable — one case passed an unprefixed name but demanded the prefixed tier,
     contradicting a sibling. Caught by a reference implementation written from the
     docstring: 11/12, with exactly one impossible failure.
  2. incomplete — a same-model free->paid escalation showed no switch, because names
     were compared after stripping the prefix. In a cost-transparency module that is
     the case that matters. Caught by @reviewer probing the green implementation.
  3. false model of reality — the spec assumed `served` carries a prefix. Measured
     against the live gateway: the catalog prefixes every id (246 [$], 15 [free],
     4 [local], none bare) but the response echoes the model BARE, so every ordinary
     call reported an invented switch to [unknown]. Round 2's fix caused this:
     tightening the comparison removed the looseness the wire format relies on.
Resolution: a missing prefix on `served` means no tier information, not a different
tier — inherit the asked tier and compare names only.

Two more @reviewer findings folded in: the contract's `assert "modeltag.py" in
inspect.getsource(modeltag)` checked the wrong file (the harness needs the name in the
TEST source, for _infer_targets) and the model satisfied it by pasting the filename into
the docstring — a contract that rewards gaming; and a formatting-only difference
(`[free]x` vs `[free] x`) rendered as a switch to itself.

On integration: four if/else pairs producing identical strings collapsed, plus one
branch made unreachable by the inherit assignment above it — behaviour unchanged, the
17 cases still pass. The default gateway name is no longer a fleet hostname (it leaked
into every room message); GATEWAY derives from cfg.PROXY.

PY_GRIND_TIERS now carries prefixed ids, since the bare name has no tier to report.
Verified the gateway accepts the prefixed form and answers 200.
2026-08-02 00:40:10 +02:00
..