Repository navigation
Stop the pre-push check flagging real files whose names start with tmp or scratch (GST-1944) - #4177
Merged
Merged
Conversation
…h (GST-1944) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…e tmp-word tradeoff Review-Finding: p1/specialist-batched#1 reader=testing Review-Finding: p1/red-team#2 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ing entry Co-authored-by: capy-ai[bot] <230910855+capy-ai[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.
The pre-push check's stray-file rule stops flagging real files whose names merely start with
tmporscratch, and still catches every real scratch name.tmpandscratchnow match only as the whole name stem, optionally numbered.tmp-watch.js,tmpfs-mount.js,tmpl.ts,tmp_cleanup.py,scratchpad.tsandscratch-card.tsxpass;tmp,tmp.js,tmp2.js,tmp_1.txt,tmp-1.js,TMP.js,scratch.md,scratch2.ts, everyzz-*name and every editor leftover are still flagged.lib/server/disk-space/tmp-watch.jsin alphaclaw, ALPH-74) failed withPREGATE_STRAYS, and no branch could clear it, becausestrays.allowis read from the base branch on purpose. That base-branch rule is unchanged. The narrower rule also stops catching a stem followed by a word, such astmp-repro.tsorscratch_notes.md; the changelog says so and suggestszz-*for scratch files.What changed
STRAY_NAMEinlib/pregate/checks/strays.tsgoes from^(?:zz-|tmp|scratch)to^(?:zz-|(?:tmp|scratch)\d*(?:[-_]\d+)?(?:\.|$)). Thezz-prefix stays a prefix. The match is still case-insensitive and still runs on the file's base name.docs/pregate.md, thePREGATE_STRAYSentry indocs/troubleshooting.mdand the check's header comment describe the new rule.Text before/after
Why
"A real module named
tmp-watch.jsfails the pre-push check and nothing on the branch can clear it" (ALPH-74). The check fails closed and the allowlist is read only from the base branch, so a false positive blocks a branch with no escape. Treatingtmpas a bare prefix caught module names liketmp-watchandtmpfs-mount, andscratchhad the same problem (scratchpad). Now those names pass, and real scratch names still fail.Summary
A branch that adds a real module whose name starts with
tmporscratchused to fail the pre-push check with no way out. The stray-name rule now matchestmpandscratchonly as the whole stem, so those modules pass whiletmp.js,tmp2.jsandscratch.mdstill fail. Review added a case-safe fixture and wrote the tradeoff into the changelog and both docs.Blast radius
Only the
strayscheck's name rule changes.STRAY_NAMEis used only bylib/pregate/checks/strays.tsand its tests (red-team read every consumer). Fewer files get flagged, and no file flagged today astmp,tmp<n>,tmp_<n>,scratch(with an optional extension) orzz-*stops being flagged (script ran: the GST-1944 table and fixture). Names with a word after the stem (tmp-repro.ts) are no longer caught, by design.Test Coverage
GST-1944test intest/pregate-selection.test.ts, written first and failing on main (tmp-watch.jsmatched). It checks the regex on the names above and runsgstack-pregate --only strayson a fixture:tmp-watch.js,tmpfs-mount.jsandscratchpad.jspass, and eight bypass names fail. Review moved the uppercase case todocs/TMP.jsso no two fixture paths differ only by case, and addedtmp-repro.tsandscratch-probe.shto the must-not-match list.lib/tmp-x.tsas its tmp stray. That name has the same shape astmp-watch.js, so it now passes by design; the fixture useslib/tmp.tsand keeps the same count of four strays.Coverage: deterministic (each of 2 changed runtime files has a changed test naming it; no audit reader).
Tests ran: test 1645 (files; carried from CI run 42522445413/1 at tree a255f136479a)
Pre-Landing Review
Pre-Landing Review: 5 issues — 2 auto-fixed, 0 asked, 0 deferred, 3 noted
test/pregate-selection.test.ts:559(testing, CRITICAL): the fixture wrote bothlib/tmp.jsandlib/TMP.js, which collide on case-insensitive disks (macOS, Windows) → uppercase case moved todocs/TMP.js.lib/pregate/checks/strays.ts:16(red-team, informational): the droppedtmp-<word>class was not written down → stated in the changelog fragment anddocs/pregate.md, and pinned in the test's must-not-match list.docs/troubleshooting.md:4244drift (red-team and the docs audit) was fixed after review in a docs-only commit; the docs re-audit is current.Gate edits: none detected (2 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Review notes
Below the blocking floor; recorded here and not fixed in this PR. Follow-ups:
lib/pregate/checks/strays.ts:16Root-leveltmp-*.mdandscratch-*.mdfiles now pass strays silently:STRAY_NAMEmisses them andROOT_OKallows any root*.md. The old prefix rule caught them; roottmp-debug.jsis still caught as a new root file. A root-only prefix check inrun()would close it.test/pregate-selection.test.ts:552Subdirectory scratch names with a word after the stem (tmp_test.py,tmp-debug.js,scratch-notes.ts) are no longer caught, and the must-not-match list pinstmp-repro.tsandscratch-probe.sh. Restoring them (a word list, or a warning instead of a pass) is a policy call.Exploratory QA
Smoke only: the focused GST-1944 and GST-1211 tests passed (4 pass, 0 fail) at the fix commit. QA's method files were not read; no other probe ran.
Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Review bot comments
No review bot comments.
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Bug fix, exempt from plan review.
TODOS
No TODO items completed in this PR.
Documentation
Status: current. The docs on this branch already match the new pregate
straysnaming rule, so nothing needed editing.Scope: committed diff from base 1999310 to head 3247e41 on
stop-pregate-flagging-tmp-prefixed-files. Nothing was staged, unstaged or new. Changed files:lib/pregate/checks/strays.ts,docs/pregate.md,docs/troubleshooting.mdandchangelog.d/stop-pregate-flagging-tmp-prefixed-files.md. I checked the newSTRAY_NAMEregex against 13 example names, and its results match every example the docs give.Documentation health:
docs/pregate.md: current. Thestraysentry gives the whole-stem rule with correct examples.docs/troubleshooting.md: current. ThePREGATE_STRAYSmeaning matches the code.changelog.d/stop-pregate-flagging-tmp-prefixed-files.md: current. It is accurate and states the tradeoff.CHANGELOG.md,docs/designs/MULTI_AGENT_WAVE_2026_10_10.md: left as they are. Theirtmp*andscratch*wording records past behavior.Coverage debt: none found. Diagram drift: none, because no diagrams cover this check.
Test plan
Agent notes
GST-1944, for Alphaclaw's ALPH-74. A
tmp/directory was never caught by the name rule: the check matches the file's base name, solib/tmp/x.jspasses on main and on this branch, and a new top-leveltmp/only warns as a new directory. This PR doesn't change that.Approvals
No approvals recorded for branch stop-pregate-flagging-tmp-prefixed-files.
Plan: exempt: bug fix
Plan check: exempt bug fix
REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=1 fixed=2 scope=frozen unbound=2 ledgers_read=5 dispatches=8
Gate edits: none detected (2 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Refs GST-1944