Repository navigation
perf(server): fit the core tools/list in the 6,000-token budget - #854
Merged
Merged
Conversation
Rewrite the 15 core plumbing-tool descriptions as short, self-contained selection text that keeps each argument shape and safety guarantee, and drop the issue references, design rationale and repeated "Common natural-language phrasings" blocks (docs/TOOLS.md carries the full detail). Input schemas are unchanged. Core tools/list: 9,261 -> 5,943 estimated tokens; full: 12,161 -> 8,843. The core budget is now the 6,000 target, pinned in the audit test as well as pyproject.toml; full's ratchet moves to 9,000. Refs #808
…ion rule in their descriptions Refs #808
State that only a relative write_to is confined to root, when the diff impact map is persisted, the freshness, evidence_status, residual and confidence values, the test-data product_id/sku duplicate keys, exact classification matching and the repo-map match cap. Trim output lists the response schemas already carry to stay in budget (core 5,989). Refs #808
The trimmed description listed scope as an entry key and then described the top-level scope argument, so haiku passed scope only at the top level and every first capture failed validation (3 of 3 runs; main 2 of 2 got it right). The description now says the entry needs its own scope; 3 of 3 haiku runs capture on the first call. Core tools/list stays at 5,998.
Main's description said never to persist without explicit user confirmation; the trimmed text limited that to a capture, so update and delete, which also persist, lost the rule the host enforces. Core tools/list is 5,999.
This was referenced Oct 5, 2026
sumithr
added a commit
that referenced
this pull request
Oct 7, 2026
🤖 I have created a release *beep* *boop* --- ## [0.76.1](v0.76.0...v0.76.1) (2026-10-07) ### Performance Improvements * **server:** fit the core tools/list in the 6,000-token budget ([#854](#854)) ([be1faa2](be1faa2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <release-please[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fits the
coreprofile's serializedtools/listinside the 6,000 estimated-token target from #808. Core goes from 9,261 to 5,999 tokens and full from 12,161 to 8,899. A test enforces the target.The 15 core plumbing-tool descriptions (test data, repo map, diff impact, ledger, context bundle, scorecard, report, coverage and mutation records, review-feedback memory,
load_skill_context) now carry short, self-contained selection text. They keep every argument shape and allowed-value list a host needs, plus the safety rules. Dropped: issue references, design rationale, and the "Common natural-language phrasings that map to this tool" block that 13 tools repeated. The long-form argument detail is indocs/TOOLS.mdand the per-feature docs it links, for exampledocs/TEST-DATA.mdforfind_test_datapaging. Input schemas are unchanged:scripts/regen_tools_list_snapshot.pyproduces no diff. Nothing was merged into a mega-tool.The 20 workflow tools still serve their SKILL.md frontmatter unchanged. Those descriptions drive native skill triggering and are the first hop on hosts that drop server instructions.
Related issue
Closes #808
Changes
src/sumo_qa/server.py: rewrote the 15 core plumbing-tool docstrings, which are the served descriptions. No code change: the module is AST-equal to main ignoring docstrings.pyproject.toml:tools_list = { core = 6000, full = 9000 }. Core's budget is the target; full's is a ratchet just above its measurement.tests/test_audit_context_budget.py:test_core_tools_list_stays_within_the_6000_token_targetpins the shipped core budget at no more than 6,000, so raising it inpyproject.tomlfails the suite.tests/test_server_format_qa_scorecard_tool.py: the scorecard description must name every required ledger-row field and the fullevidence_status/residualvalue lists. A host can load the scorecard without the ledger tool.tests/test_server.py: the review-feedback description must keep its rules: every write needs the user's explicit confirmation, nothing is auto-captured, sensitive input is rejected, andentryneeds its ownscope.docs/DEVELOPMENT.md: the test list names the new test.Headroom: core is 1 token under its budget. Any new or longer core description now needs a matching cut, or a deliberate budget decision on #515.
Fixes made during merge review
63676fd4: the review-feedback description saidscopeis anentrykey and then described the top-levelscopeargument, so haiku passedscopeonly at the top level and its first capture failed validation in 3 of 3 runs, where main got it right in 2 of 2. The description now saysentryneeds its ownscope; 4 of 4 first captures succeed.8d4c85bc: the trimmed description limited the confirmation rule to a capture. Update and delete also persist and the tool does not gate them, so the rule now covers every write, as main's did.How it was verified
Budget audit (
python scripts/audit_context_budget.py, main 9d7ea94 vs head 8d4c85b):context budget: OK. Raising core to 6,100 fails the new test (assert 6100 <= 6000); padding one core description by about 28 tokens fails the audit (6027 > budget 6000).Real host, clean install (
uv build --wheelof 8d4c85b, a clean venv, profilecore,claude -p --model haiku --strict-mcp-config, Bash/Write/Edit/Skill denied, tool search off, run in a clone of this repo with its real.sumo-qaartifacts), 10 prompts, main vs branch:load_skill_contextcall, repo-map query, diff impact (14 tests, no unmapped risk surface), test-data requirements, QA report, coverage record, review-feedback list and capture.load_classificationsgive the same result on both builds.Tests:
mypy (static type check).Mutation: the Linux
mutation.ymldispatch on 8d4c85b (run 37327270954) is green.Review passes:
sumo-qa-reviewing-before-mergeper changed file, over origin/main...8d4c85b: every file SAFE, no high or medium findings./code-reviewhigh on each fix delta (fresh agents): 86d6261..63676fd and 63676fd..8d4c85b, no findings.generate_qa_reportdescription no longer points to the ledger and bundle shapes for its override arguments; the scorecard'scoverage/mutationdict fields are not named;format_context_bundledoes not list its optionalcaptured_at/detailfields.Evals: none run. No
skills/*/SKILL.mdortests/evals/promptfoo/*.yamlchanged. The live haiku runs above exercise the changed descriptions.Checklist
pytest) and lint/type checks are green (pre-commit run --all-files,python -m mypy)