Repository navigation
test: add tests/checks.sh and scale local checks with the change - #123
Merged
Merged
Conversation
Measured usage came from agents rerunning the full ten-minute suite after every edit and polling it, not from the checks CI needs. tests/checks.sh runs, by default, only the tests that name a changed file or a script loading it, plus check_static and codespell; NAME... runs given modules and --all reproduces CI's steps but gitleaks. It runs without the person's git configuration, as CI does, so the tests' throwaway commits are not signed: the unit tests drop from 599s to 435s locally. .claude/CLAUDE.md gains a table of what each kind of change runs before review, and the session habits that keep usage down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Why
Transcripts from Nov 5 to 7 show where usage went. Long Opus agents and sessions took about 72% of it: one build agent ran 496 turns at up to 671K context, and one main session ran 1,257 turns. Sandbox runs took about 18%. A turn's cost grows with the context it carries, and much of those turns went to rerunning the full suite (about ten minutes) after each edit, polling it with
sleep/pgrep, and grepping one thing at a time. CI already runs every check on every pull request, so a full local run after each edit duplicated CI.What changes
tests/checks.shruns the checks serially, one line per step; only a failing step prints output, its last 40 lines. A contributor tool; nothing in the plugin calls it.origin/main, and the tests of scripts that load it, pluscheck_static.pyand codespell. Some changes run the whole suite instead: a data file that no test names,tests/fixtures/,pyproject.tomlor.python-version. Skills, agents and docs get the static checks only. The header lists every rule.NAME...runs the named test modules only.--allruns CI's steps except its gitleaks scan.commit.gpgsign=true..claude/CLAUDE.mdgains a table of what each kind of change runs before review: static checks, mapped tests or--all, the sandbox, and adversarial review rounds. It also gains the session habits behind the cost: a fresh agent per phase, Sonnet for mechanical agents, long commands in the background rather than polled, and batched reads. The pre-PR bullet now names the runner.Reviewing
tests/checks.shlines 99-114, is the part to read. It deliberately selects more than it strictly needs:scripts/record.pyselects 17 test files.Origin:/Sandbox:/Canary:lines are left out.Verification
bash tests/checks.sh --all: all 11 steps pass.test_comment_listforrecord.pythrough its loader andtest_captureforguidance_check.py. A harvest data file and a fixture each selected the whole suite.hooks.jsonselected the gate tests. A bad name exits 2 before anything runs.--check --repeat 2requirements in the table. The review's reading of model ownership was declined: the habits bullet is about contributors' sessions, not the plugin's agent models.Not in this PR
test_profile,test_window_mergesandtest_surface_diffshare temporary state when run together, and that needs finding first.standard.sh's real partial-clone fetch, which accounts for most oftest_profile's time.🤖 Generated with Claude Code