Repository navigation
cmux-next gate: a stale hook install refuses; never fall back to the pushed checks - #34237
Conversation
…tests in the hook (red) The pre-push hook never runs code the push controls (docs/contributor- verification.md, trust boundary). perf_cron_tests runs the pushed head's own test_perf_cron.py (git archive, then unittest), so a pushed branch's test file runs on the machine that pushes it. This test pushes one that writes a marker. Red on 18753d8: (cd tests && python3 -m unittest -k perf_cron_never test_cmux_next_prepush_gate)
… its code in the hook The pre-push hook never runs code the push controls (docs/contributor- verification.md, trust boundary). perf_cron_tests ran the pushed head's own test_perf_cron.py (git archive, then unittest), so a pushed branch's test file, or the perf-cron.py it imports, ran on the machine that pushes it. Running the reviewed copy of the tests would still import the pushed perf-cron.py. The gate now names the changed perf cron files and the command to run its tests on code the person trusts, and never refuses the push for them. CI does not run them either (no new CI tests), as before this gate step was added (9d483d2). Red on 18753d8 (tests in 6d8a01f), green here: (cd tests && python3 -m unittest -k perf_cron_never test_cmux_next_prepush_gate) python3 tests/test_cmux_next_prepush_gate.py: 88 tests OK.
… check (red) Review of e2550b6 (#34219): on a hook install older than a check, the gate fell back to the pushed head's check-leo-bans.py and check-ghostty-reserved- keys.py, and the check trees took the pushed scripts/swift_source_mask.py. The hook never runs code the push controls, so these tests expect a refusal that says to rerun scripts/install-git-hooks.sh, and no pushed code run. Red on e2550b6: (cd tests && python3 -m unittest -k stale_install -k refuse_an_install_without_the_masker test_cmux_next_prepush_gate) 3 failures.
…he pushed checks Review of e2550b6 (#34219): on a hook install older than a check, the gate ran the pushed head's check-leo-bans.py and check-ghostty-reserved-keys.py, and the check trees took the pushed scripts/swift_source_mask.py. The hook never runs code the push controls. - check_script(): on a hook run (--trusted-scripts-dir), a check the pushed head has but the install lacks refuses the push with "the installed hook is older than the checks this push needs: rerun scripts/install-git-hooks.sh". A head older than the check skips it, as before; a manual run reads the checkout's. - build_trees(): on a hook run the masker comes only from the install; an install without it refuses the same way, and the pushed copy is never written. - Folded cleanups: the perf cron comment, the refusal message no longer names the perf cron tests, and the dead `guarded = perf_cron_tests(...) or guarded` line. Red on 8b66cd3^ (tests in 8b66cd3), green here. python3 tests/test_cmux_next_prepush_gate.py: 90 tests OK.
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next page strings generate; base red: the same failure on the base d668dcf; does not block Shipped in:
|
…e checkout (red) Review of 9b89be5: an install with no lint-tools.lock read the checkout's lock (the pushed branch) and downloaded and ran the binary it names; the sha256 check proves nothing, as it comes from the same lock. This test pushes a lock that names a marker binary and removes the installed lock. Red on 9b89be5: (cd tests && python3 -m unittest -k tool_pins_from_the_checkout test_cmux_next_prepush_gate)
… checkout Review of 9b89be5: on a hook run with an install that has no lint-tools.lock, the gate read the lock and lint configs from the checkout (the pushed branch) and downloaded and ran the binary the lock named; its sha256 proved nothing, as it comes from the same file. A hook run now takes the pins only from the installed reviewed copy and refuses an install without them with the stale-install message. A manual run reads the head's, else the checkout's, as before. Also: check_script's docstring says a manual run reads HEAD's copy. Red on ae1e761^ (test in ae1e761), green here. python3 tests/test_cmux_next_prepush_gate.py: 91 tests OK.
|
Found 36 test failures on Blacksmith runners: Failures
...and 26 more test failures. View all on Blacksmith
|
|
Review (independent-subagent): SHIP at 092d020 Two rounds. The BLOCK at 9b89be5 found one more fallback of the same kind: an install with no On a hook run, when the installed hook lacks a check, the masker or the tool pins, the gate refuses with "the installed hook is older than the checks this push needs: rerun scripts/install-git-hooks.sh". It never runs or writes the pushed copy.
Nit: |
…-stale-install-refuses # Conflicts: # scripts/cmux-next/prepush-gate.py
|
Review (independent-subagent): SHIP at a6ad589 Renewed after #34219 merged as a squash (c874cb9) and #34197 merged first (884c330). This is a merge of feat-cmux-next into the earlier SHIP head 092d020; no force push.
|
…eam in the Chromium page fake (#34430) * tests: web lint hook fixture pins stand-in lint tools for the cmux-next gate #34237 made the installed gate refuse an install with no lint-tools.lock. The web lint fixture copied no lock, so all 32 fixture pushes failed with "the installed hook is older than the checks this push needs". The fixture now commits a lock pinning no-op stand-ins and puts them in CMUX_LINT_TOOLS_DIR, so the gate runs and nothing is downloaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64 * cmux-next: the hanging Chromium page fake's stream has a buffer cap #34250 added an AsyncStream.makeStream() with the default unbounded buffer, which the Main-thread concurrency check refuses. Nothing yields to it, so .bufferingNewest(1) changes no behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
Its base #34219 has merged (c874cb9), and #34197 merged first (884c330), so feat-cmux-next was merged into this branch (a6ad589, no force push). Neither touches this PR's lines: feat's
prepush-gate.pyis byte-identical to #34219's head, and #34197 changed onlyweb_lint_prepush.py. This PR's own change over feat is two files.The pre-push hook must never run code that the push controls (
docs/contributor-verification.md, trust boundary). When the installed hook was older than a check, the cmux-next gate fell back to the pushed head's copy:check-leo-bans.pyandcheck-ghostty-reserved-keys.py, which it then ran;scripts/swift_source_mask.py, which it wrote into the check trees, wherecheck-package-dependency-lists.pyimports it.Now, on a hook run (
--trusted-scripts-dir), a check that the pushed head has but the install lacks refuses the push with:The pushed copy is never run or written. A head older than the check skips it, as before. A manual run, with no
--trusted-scripts-dir, still reads the checkout's copy. A current install has all three files, so it is not affected.Folded in, per the earlier review of #34219:
guarded = perf_cron_tests(...) or guardedline is gone.Testing
Red on e2550b6 (#34219's head; the tests are in their own commit), green on the head:
check-leo-bans.pyand a pushedcheck-ghostty-reserved-keys.py(each writes a marker file), andbuild_treesdid not refuse an install without the masker.Observed / Not run
Observed:
python3 tests/test_cmux_next_prepush_gate.py: 91 tests OK, including the stale-install lint-tools.lock test added after review.python3 scripts/cmux-next/prepush-gate.py: no new violations.Not run:
git push, with the file removed from the installed copy.Changelog
none
Proof
No capture: hook tooling only.