Repository navigation
Description
Status
In review through PR #653 with all checks green and review still required; keep this out of Ready until the PR merges.
Roadmap fields
Status: In review; Priority: P1; Size: M; Order: 3; Depends on: none
Validated against main on 2026-07-13. Still valid and not duplicated by #393/#450.
#393/#450 only prevents an oversized full-body response from failing. The shipped skill is still one 71,850-byte, 270-line SKILL.md with an estimated-token budget of 17,920, and it has no lazy modules. A real review therefore still loads the large checklist slice.
A June 2026 proof of concept split the skill into a ~1.9k-token routing root plus 14 cold references, kept the full suite green, and measured 31-79% savings across representative review paths (30.4% over one four-turn MCP probe). That branch/PR is no longer present locally or on GitHub, so this ticket owns recreating the design on current main.
Decision
Use the existing modules/*.md progressive-loading contract, not finer headings and not duplicated content.
- Keep
SKILL.mdas the canonical routing root: frontmatter, Iron Law, execution order, module-routing table, verdict gate, and red flags needed on every review. - Move deep, conditionally used probe and evidence rules into cohesive
modules/*.mdfiles. - Every moved rule has one canonical source. Do not retain a second prose copy in
SKILL.md. - Preserve stable user-visible terminology and output contracts. Module filenames/IDs are implementation details and may be chosen during the change.
- Update eval assembly so each seed receives the root plus only the modules its declared scenario requires. Do not make the eval green by restoring the entire old body for every seed.
Required work
- Recreate the compact root and lazy modules from current
main; do not resurrect the stale June text without reconciling changes merged since then. - Extend cross-reference, packaging, installer/symlink, content-hash, and MCP resource tests so shipped module files are discoverable and included.
- Add a manifest contract test proving every routing-table module ID exists and every shipped module is reachable from the root.
- Add a content-integrity regression test for the load-bearing review rules moved out of the root.
- Replace the documented token-budget exception with measured root, per-module, and representative-path budgets.
- Run the complete reviewing-before-merge promptfoo matrix and the full Python suite.
Acceptance criteria
-
SKILL.mdis at most 3,000 estimated tokens. - Each lazy module is at most 1,500 estimated tokens unless a narrowly documented exception has a measured reason.
- A standard runtime-code review loads the root plus required modules at least 50% below the current 17,812-token full-body baseline.
- At least three representative paths are measured separately: ordinary runtime change, test/eval-only change, and documentation/configuration change. Report exact root, module, and total estimates.
- The zero-argument/full over-cap behavior from [Task]: full-body skill MCP tools can exceed the host per-response token cap (reviewing-before-merge) #393/fix: serve over-cap skill bodies as a progressive-loading pointer (#393) #450 remains compatible: it still returns an actionable progressive-loading pointer rather than an oversized body.
- All existing reviewing-before-merge promptfoo evals pass without weakening rubrics, removing seeds, or loading every module unconditionally.
- Tests fail for an unknown routing-table module, an orphan shipped module, a missing packaged module, and loss of a named load-bearing rule.
- The full test suite and package/install smoke tests pass.
Boundaries
- No new MCP tool is required;
mode="module"already exists. - No duplicated/generated mirror of module prose.
- No unrelated rewrite of the review discipline.
- Per-load token measurements are the acceptance evidence; noisy whole-session totals are supplementary only.
Relationships
- Follow-up to [Task]: full-body skill MCP tools can exceed the host per-response token cap (reviewing-before-merge) #393, implemented by PR fix: serve over-cap skill bodies as a progressive-loading pointer (#393) #450.
- Complements the existing progressive-loading infrastructure from [Task]: Progressive skill loading PR1 — skill manifests + section/module index + partial skill-context loader #285/test: add cumulative token-budget tests + host docs for progressive skill loading #301/feat(skills): add content-hash digest + change-detection to partial skill loads #304.
- [Task]: Relocate optional LLM eval harness to separately-maintained tooling #449 was closed as not planned; the modules remain tracked and packaged with the skill.
Activity
[-][Task]: split reviewing-before-merge's 9.2k-token checklist so progressive loading saves on actual use (#393 follow-up)[/-][+][Task]: split reviewing-before-merge into a compact root and lazy modules[/+]sumithr commentedon Sep 7, 2026
Drift reconciliation against
main@ 2930a3a (2026-09-07), before implementing:18330intests/test_skill_md_token_budget.py. The ">=50% below the full-body baseline" AC will be measured against the live ~18,295 figure (a stricter bar), not the stale 17,812.modules/dir today;_index_modules,mode="module", thesumoqa://skills/{name}/modules/{id}resource and the 1,500-token module ceiling are all exercised only against tmp fakes. This PR makes reviewing-before-merge the first shipped consumer, so the "bundled skills have no modules/ dir yet" assumptions intests/test_skill_manifest.py,tests/test_skill_resources.pyandtests/test_skill_modules.pydocstrings get retargeted.tests/test_skill_response_oversize.py::test_reviewing_before_merge_is_the_over_cap_skilland theassert overintest_no_served_full_body_exceeds_the_default_cappin the review skill as the one over-cap body. After the split no bundled skill is over cap, so the [Task]: full-body skill MCP tools can exceed the host per-response token cap (reviewing-before-merge) #393/fix: serve over-cap skill bodies as a progressive-loading pointer (#393) #450 contract keeps its synthetic over-cap fixtures (boundary tests unchanged) and the library-wide test flips to "every bundled skill is served byte-for-byte, none degrade". The pointer behaviour itself is unchanged and still tested.docs/SKILLS.md,docs/TOOLS.mdx3,docs/ARCHITECTURE.md) and theDOCUMENTED_ROOT_BUDGET_EXCEPTIONSentry are updated in the same PR.skill-reviewing-before-merge*.yamlconfigs loadskill_content: file://…/SKILL.md(the.ab.yamlcontrols keep their frozenfixtures/*-PRE-*.SKILL.mdold bodies). Assembly moves to a shared promptfoo JS var function that concatenates the root plus only the modules each config/seed declares, per the Decision section.test(review-modules): pin conditional path obligations, declared orde…
fix(skills): restore dropped review rules, name module cross-referenc…
sumithr commentedon Sep 9, 2026
finish-pr verification for PR #653 (head
a095060)Acceptance criteria checked against the branch, not the PR text. Estimator is the shared
(len(text)+3)//4.SKILL.mdat most 3,000 est. tokensmode="full"returned the body withestimated_tokens: 2996, hash equal to the manifest's);tests/test_skill_md_token_budget.py:43entry 3000;tests/test_review_skill_modules.py:1078coverage-ledger1,475, smallestfeedback-memory475, each served bymode="module"with the same figure;tests/test_review_skill_modules.py:1086tests/test_review_skill_modules.py:1145. Real headless runs on the same runtime commit loaded 4, 7 and 11 modules (60.0%, 40.6%, 20.0% below); routing-row looseness filed as #659REPRESENTATIVE_PATHSattests/test_review_skill_modules.py:85, tests :1115-1174SUMO_QA_SKILL_RESPONSE_TOKEN_CAP=1000: zero-arg tool returned the pointer naming manifest, section and module routes;mode="full"returnedoversize: truewithavailable_modesand the section index; the module route then servedruntime-scopeat 755 tokens;tests/test_skill_response_oversize.py:94-147, :276credit_balance_exhaustedon 2026-09-07, 2026-09-08 and again on 2026-09-09 (probed with the eval'sgpt-4o-mini); the local tier is a relative instrument, not the merge gate. Static side holds: 28 configs diff removes no rubric line, no seed removed, no config declares all 19, A0 fixtures untouched, per-seed assembly verified under node (declared modules only, declared order, traversal and unknown ids rejected, no CR bytes)test_review_skill_modules.py:389red),modules/orphan.md(:398 red), module on disk but excluded from the wheel via narrowed force-include (tests/test_wheel_packaging.py:100red, 19 missing), gutted pinned body with header kept (:464 red), deleted rule line (:464 red); control greena095060: 3,728 passed, 5 skipped, 1 xfailed, 0 failed, 100% coverage; CI 33/33 ona095060incl. pip/uvx/plugin install smoke on three OSes; mutation gate run 34354962379 passed, 0 survivorsBehaviour ledger (4.7, observed on the real surface)
Surface: branch wheel built with
uv build --wheelfrom192af4c(skill and source content identical througha095060), installed into a clean venv, driven by a headlessclaude -p --strict-mcp-config --allowedTools mcp__sumo-qaagent (model sonnet). Repo: this clone, reviewing real commits frommainhistory.sumo_qa_reviewing_before_merge()andsumo_qa_load_skill_context(mode="full")estimated_tokens 2996, routing table present withruntime-scopeanddiscovery-probesas first rowsmode="manifest"thenmode="module"for all 19 idsf51dc78(repo-map resolver hardening) via the router, root,mode="module"d28be6a(tests only)discovery-probesciting the test-only routing; verdict SAFE TO MERGE2930a3a(release bump)mode="full"oversize: trueenvelope; module route served 755 tokensreview_modulesof three configs and six per-seed overrides../SKILLand unknown ids rejected; 0 CR bytesgit checkoutSupporting slots:
real_repo:/Users/SumithRamsookbhai/Desktop/repos/apo/sumo-qa(primary checkout, real history) as the agent cwd; worktreesumo-qa-issue-451for the build and fault injection.real_surface: clean wheel install (19 modules present in the wheel) driven through the MCP tools by a headless agent; tool-call traces parsed from the stream-json transcripts.existing_flow: base2930a3avs candidate wheel on two prompts viacompare-mcp-versions: the router sent both tostrengthen-test-coverage/sumo-qa-strengthening-testswith the identical first step quoted;sumo_qa_load_principlesidentical (7 ids); candidate used 312,662 tokens over 7 turns against 367,040 over 9.evals: not run: OpenAI 429credit_balance_exhaustedon 2026-09-09.Review evidence: per-file
sumo-qa-reviewing-before-mergepass over all 65 changed files ona095060returned SAFE with no high or medium finding; six review-driven fix commits (3e5446a..a095060) closed the first pass's blockers and five codex rounds on the test guard; final codex round: no P1/P2. Zero open review threads.sumithr commentedon Sep 9, 2026
Merge hold (2026-09-09): PR #653 stays open and unmerged until #660 lands. The OpenAI + promptfoo eval gate is retired; AC6 (the graded reviewing-before-merge matrix) will be run once under the new Claude judge/candidate gate from #660 and its result posted here, which unblocks the merge. Every other gate on #653 is green (CI 33/33 on a095060, mutation gate clean, per-file review SAFE, zero threads, behaviour ledger above).
feat(skills): split reviewing-before-merge into a compact root and la…
test(review-modules): pin conditional path obligations, declared orde…
fix(skills): restore dropped review rules, name module cross-referenc…
sumithr commentedon Sep 25, 2026
AC6 verified on the Claude gate (#660, #665)
Command.
SUMO_EVAL_BACKEND=claude bash tests/evals/promptfoo/run-eval.sh <config>, once for each of the 28skill-reviewing-before-merge*configs, single pass.Model pair. Candidate
claude-haiku-4-5, judgeclaude-opus-5, on the Claude subscription.Tree graded. PR #653's head
a095060withmainmerged in locally, as6296f94. The branch was then rebased ontomainand pushed as92fb593. The skill, module, config and provider files are byte-identical between the graded tree and92fb593; the only differences are the eval README and the token-budget test.Result. 92 cases, 90 passed, 0 provider or judge errors. About 1.3M tokens, $3.99 notional list price. That is
costUSDat list price, not an invoice.adversarial.abreviewing-before-merge.abverifier-evidence.abunproven-escalation.abeval-validity.ab,feature-flow.ab,feedback-memory.ab,fence-parser.ab,runtime-scope.abEvery leg that loads this PR's skill passed. The two failing cases are control legs that are meant to fail.
The seven controls that don't separate fail because their control legs pass too. Those legs read no skill, or a frozen
fixtures/reviewing-before-merge-PRE-*.SKILL.mdsnapshot that is byte-identical tomain, so the split cannot cause it. It is the same class of problem as the #679 run onmain, and it is owned by #685. #665's criterion that all 7 controls hold is handed to #685 and not claimed here.The AC's static half holds on the branch. Seed counts are unchanged in all 28 configs. Config edits are limited to the skill var,
review_modules,disableVarExpansionand comments, so no rubric was touched. No config loads every module.The promptfoo JSON reports, one per config, are retained on the maintainer's machine, outside the repo, because
tests/evals/results/is gitignored.Behaviour ledger (finish-pr 4.7), observed on
92fb593The branch wheel was installed into a clean venv. Each row was driven by a headless
claude -pagent,claude-sonnet-5, restricted to the installed sumo-qa MCP server through--strict-mcp-config.SKILL.md<= 3,000 tokenssumo_qa_load_skill_contextwith skillsumo-qa-reviewing-before-merge,mode="full"estimated_tokens: 2996mode="manifest"coverage-ledgerat 147541875b3, a heading-fence parser fix insrc/plus its testruntime-scope755,discovery-probes1384,contract-and-fence-probes1349,coverage-ledger1475 = 7,958, 55% below92fb593, a test-only changeruntime-scope,test-only-diff,surface-verifier,external-contract= 7,121, 60% belowa5f0ea0, README + docsruntime-scope,inventory-drift= 4,513, 75% belowsumo_qa_reviewing_before_mergewith no args, andmode="full"mode="module"fetch; no oversized bodymode="module",module="no-such-module"{"error": "Unknown module 'no-such-module' ...", "available_modules": [19 ids]}mode="module",module="runtime-scope"estimated_tokens: 755,content_hashpresentuv run pyteston92fb593; CIAll three review agents ended NOT SAFE for one stated reason: they were told not to run tests, and the skill will not issue a SAFE verdict without a fresh run. Each said its reading of the diff found no defect.
real_repo: this clone. The three reviews ran against real commits in its history.existing_flow: the same agent,claude-haiku-4-5, calledusing_sumo_qa,sumo_qa_load_classificationsandsumo_qa_load_skill_contextfor thepreparing-for-workmanifest on a clean install of this branch and oforigin/main. All three outputs were byte-identical: 16,249, 2,297 and 2,687 chars.evals: the 28-config run above.