Repository navigation
test(tool-loader): measure reduction guards against a same-run baseline - #4125
Conversation
…seline The four failures in this file were one stale measurement, not a CORE regression. CORE's share of the doc tool registry has barely moved (40% -> 43% native since the pins were set); the registry itself grew 23%, so every guard that divided a live numerator by a frozen June denominator went red at once. Re-pin the absolute constants to values measured on this checkout, and change the two reduction guards to take their ratio against a baseline measured in the same run. Absolute drift is now detected only by test_harness_runs_and_pins_baseline, which is the test that is supposed to notice it.
#4038 re-pins EXPECTED_DOC_TOOL_COUNT, BASELINE_NATIVE_CHARS and BASELINE_NATIVE_TOKENS on the same lines, and earns those numbers by changing the schema: dropping the duplicated Args: block from description and trimming 21 docstrings. The values measured here are correct on main today and ~17% too high the moment that lands, so a conflict resolved in this PR's favour would re-break the band it is meant to protect. Back the re-pins out and keep the structural change. The share ceilings hold on both sides: CORE measures 42.8% native on main and 41.0% with #4038 applied, against a 45% ceiling.
The doc profile has had 38 tools since #3670 added `read_tool_output` on 2026-09-18, so the pinned 37 is a stale measurement rather than a regression. It registers unconditionally — there is no platform gate and no optional-import gate anywhere in the doc profile's registration path — so the count is the same on every machine. Only the count. The char and token pins stay where they are: #4038 re-pins them on the same lines and earns those numbers by trimming the docstrings they measure, so a value pinned here would be ~18% outside the band the moment it lands. A docstring trim cannot move a count, so both PRs make the identical edit to this line and neither side can lose it.
|
The only file this PR changes is never executed by any CI lane, so the green checks here are not evidence that the change works. Review the diff on its merits rather than reading green as verification — the behaviour it guards is untested in CI today. Nothing to fix in this PR itself: the gap is in the lane, not the change. Tracked systemically in #4121, and #4124 adds the guard that would have flagged it automatically. 🔍 Technical details
Receipt from this PR's own
It is not even reported as skipped. The job prints No other lane covers it. First spotted while verifying a different PR's test execution in run |
The tool-loader budget tests went red on
mainwithout anything regressing. Fourtests failed at once, three of them pointing at CORE bloat that never happened —
CORE's share of the registry moved from ~40% to ~43% while the registry itself
grew. The cause is that the reduction guards divided a freshly-measured numerator
by a constant frozen in June, so any registry-wide edit trips every guard
simultaneously and buries the one failure that actually means something. Those
guards now take their baseline from the same run, so a real CORE regression fails
the CORE test and a schema-wide change fails only the pin test.
This PR does not turn the file green, and that is deliberate. The tool count
is re-pinned to 38, because #3670 added
read_tool_outputto the doc profile on2026-09-18 — an unconditional 12th CORE tool, so the old 37 is a stale
measurement, not a regression. The char and token pins are left alone: #4038
re-pins them on the same lines and earns those numbers by trimming the very
docstrings they measure (~17% smaller), so any value pinned here is wrong the
moment it lands. One failure therefore survives this PR —
test_token_baseline_when_tiktoken_available— and it is #4038's to fix. Theshare ceilings hold on both sides: CORE measures 42.8% native today and 41.0%
with #4038 applied, against a 45% ceiling.
A green check on this PR verifies none of the above. No CI lane executes this
file:
test_unit.ymlcollects it but never installs the chat wheel, so the rootconftest.pyleavesgaia_agent_chatunimportable andpytest.importorskipskips the whole module at collection without printing a line. That is why the
pins rotted unnoticed — tracked in #4121, not fixed here. Every result below was
produced locally.
Test plan
pytest tests/unit/test_tool_loader_token_budget.pyon this branch at currentmain→ 1 failed, 9 passed (was 2 failed, 8 passed before the count re-pin); the survivor is the native-token pin perf(tools): a budget for tool descriptions, enforced by lint #4038 ownstest_tool_loader_token_budget.py+test_tool_description_budget.py→ 19 passedCORE native tokens 3104 exceeded 45% of the 6762-token registry measured in this run. Reverted; not committed._register_tools()is profile, config, or constructor-arg;platform.system()appears only in prompt text and tool bodies, never around a registration.python util/lint.py --all→ exit 0.