Repository navigation
perf(scripts): run the script tests beside ci and skip repeated hooks - #325
Merged
Merged
Conversation
added 3 commits
November 18, 2026 22:34
scripts/check ran the script suites, then ci, then a pre-commit sweep that re-ran structure and payload-parity, which the gate had already run over the whole tree. The suites and ci both wait mostly on git and child processes, so running them together takes about as long as ci alone. The suites' output is held until ci ends so the two never interleave, both statuses must pass, and an interrupt exits at once and stops the suites rather than waiting on them. The pre-commit sweep now skips the hooks that repeat a gate step: structure, payload-parity, and the template's addon-adoption and reference-assertions, which ci's pytest already collects. They still run at commit time. repo-builder's pytest suite gains a conftest that points git's global and system config at /dev/null, as the shell harness already does. A global core.hooksPath attribution hook otherwise ran on every fixture commit and took about a sixth of the suite's time. Generated-By: claude-opus-5-5
Review found the recursive pgrep walk could miss a suite started between the walk and the kill, and it leaned on pgrep, which doctor does not require. set -m puts the suites in a process group of their own, so one kill reaches every member, in pure bash. The Commands contract lines in both CLAUDE.md copies still described the old order, script tests first; they now say the tests run beside ci. Generated-By: claude-opus-5-5
In their own process group, the background script tests miss a TERM sent to the gate's group, as timeout and agent harnesses send it. That signal also kills tee, so the gate's next write raised SIGPIPE, which exited without running the EXIT trap and left the suites running. Trapping PIPE routes that exit through the trap. A group SIGKILL still leaves them to finish on their own, as no trap can catch it. Generated-By: claude-opus-5-5
Owner
Author
|
Code review: standard scan, clean. Axes: Standards+Spec, Correctness/Logic Reviewed-Head: fb5ef63 |
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.
Intent
Operator request in session: make
scripts/checkand its test runs faster.scripts/checkran script-tests, thenci, then a pre-commit sweep that repeatedstructureandpayload-parity(and, here,addon-adoptionandreference-assertions, whichci's pytest already collects). The gate now runs script-tests in the background besideci, holds the suites' output untilcifinishes, fails on either status, and skips the repeated hooks in the sweep. The repo-builder pytest suite now isolates git from the operator's global config, so a globalcore.hooksPathattribution hook no longer runs on every fixture commit.Read first
scripts/check:93— background launch, traps, and the two-status joinscripts/check:143— the pre-commitSKIPlistapps/repo-builder/src/scripts/tests/conftest.py— git config isolationCLAUDE.mdand the payloadCLAUDE.mdCommands line —scripts/checkorder now says script tests run besideciapps/github-repository-template/src/base-repo/scripts/{check,tests/check-test}are byte-identical mirrors (payload-parityholds them)Decisions
cirather than insidexargs -Pwith it: both mostly wait on git and subprocesses, so a second job costs almost no wall time, and their outputs stay separate.trap 'exit 130' INT/'exit 143' TERMplus a process-group kill: a background job in a non-interactive shell ignores SIGINT, so without them Ctrl-C left the gate blocked inwait.set -mlaunches the suites in their own group, sokill -- -PGIDreaches a suite started mid-shutdown with nopgrepdependency. Being its own group, it misses a TERM sent to the gate's group (timeout), sotrap 'exit 141' PIPEcatches the gate's write to theteethat signal killed and still runs the EXIT trap. A group SIGKILL leaves the suites to finish on their own. Afterwaitthe EXIT trap drops the kill, since the reaped PID may be reused.Out of scope
conftest.pyinto the payload: generated repositories carry no repo-builder unit.Verified
scripts/check→exited 0: 0 FAIL, 0 unavailable, 5 not-applicable, 26 passscripts/tests/check-test→ 10 passed, including the new "a failing script test fails the gate after ci has run" (exit 3,cioutput shown,securitynever runs)timeout 4..14 scripts/check, 6 runs: no gate process left in the worktreesetsid, signalling the process group) exits at once and leaves noscript-testschildrenNot verified
Merge danger
Door: two-way: a revert restores everything
Blast radius:
scripts/checkin this repository and in every repository generated or updated after merge;scripts/tests/check-test; repo-builder's pytest run.