Repository navigation
fix(OMN-16333): unblock every omnibase_infra push — scope the pinned-interpreter gate to local invocations - #2825
jonahgabriel wants to merge 1 commit into
Conversation
…d probe, scope the gate to local invocations The pinned-interpreter gate (OMN-14953) and the ssh load probe (OMN-16295) were mutually incompatible, so `git push` failed for every developer on every branch: the pre-push hook ran a test that rejected the hook script. Two changes: 1. prepush_smart_tests.sh — route the LOCAL probe through `uv run python3`. This one was a real violation of the invariant; the gate was right. 2. test_prepush_hook_pinned_interpreter.py — exempt python tokens that follow an `ssh` token in the same LOGICAL line. Those execute on a remote host, which has no uv venv for this repo (`ssh .201 'command -v uv'` -> not found), so the pinned-venv invariant is unsatisfiable there by construction; requiring `uv run` would forbid the call, not pin it. The scan now joins backslash continuations, because the real probe puts `ssh` and the remote `python3` on different physical lines — scanning physical lines is what made the carve-out miss and the repo deadlock. Narrowing an over-broad matcher rather than bypassing, per omni_home CLAUDE.md rule 10. Four tests cover the narrowing so it cannot silently widen: a local bare python3 is still flagged (with or without ssh elsewhere in the file), the exemption spans a continuation, and it does not leak past a completed ssh command.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 53 minutes Limit details: You’ve used the included review currently available. Your 117 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Comment |
❓ Hostile Reviewer — UNKNOWNBlocking findings (critical): 0 Gate semantics (pilot phase)
Powered by omniintelligence.review_pairing.cli_review — node-based adversarial review via HandlerLlmCliSubprocess (OMN-8468/OMN-8524) |
|
Superseded by #2824 (OMN-16326), which landed on Both PRs fix the same deadlock — the pre-push hook running a test that rejected the hook script, blocking every push for every developer. #2824's approach is better and I'm withdrawing this one in its favour. Mine narrowed the OMN-14953 matcher to exempt python invocations inside #2824 instead makes the probe interpreter-free — Verified on The four regression tests I wrote here (local bare Follow-on release.yml security fix for this repo continues in #2827. |
Summary
git pushto omnibase_infra has been failing for every developer, on every branch, from every worktree. The pre-push hook runs a test that rejects the hook script itself.Found while trying to land OMN-16323; reproduced independently against
origin/dev.Root cause — two correct changes that are mutually incompatible
The pinned-interpreter gate (OMN-14953) asserts no
scripts/hooks/*.shinvokespython3unless immediately preceded byuv run. Its stated rationale is local interpreter skew.OMN-16295 then added
host_load_ratio()toprepush_smart_tests.sh, which invokespython3three times:ssh ... "$target" "python3 -c ...", executing on.200/.201.The scanner is a line-level regex with one exemption, so it cannot tell local from remote and flags all three.
Why the obvious fixes are wrong
Prefixing the remote calls with
uv runbreaks the feature —ssh jonah@192.168.86.201 "command -v uv"returns command not found.uvis a property of this local checkout, not of the remote hosts, so the gate's invariant is unsatisfiable by construction for a remote command: requiringuv runthere forbids the call rather than pinning it.Dropping python from the remote probe is also wrong.
_PREPUSH_LOAD_PROBE_PYusesos.getloadavg()+os.cpu_count()precisely because both are POSIX-portable, letting one snippet serve the Linux.201and macOS.200targets. A shell equivalent needs/proc/loadavg+nprocon Linux andsysctlon macOS — exactly the branching the author avoided.Fix
Narrowing an over-broad matcher rather than bypassing it, per omni_home CLAUDE.md rule 10.
scripts/hooks/prepush_smart_tests.sh— route the local probe throughuv run python3. Verified working:uv run python3 -c "$PROBE"returns13.87 24.tests/ci/test_prepush_hook_pinned_interpreter.py— exempt python tokens following ansshtoken in the same logical line.The scan now joins backslash continuations. That detail is load-bearing: the real probe puts
sshand the remotepython3on different physical lines, so a physical-line carve-out silently misses and the repo stays deadlocked — which is exactly what happened on my first attempt.Coverage for the narrowing
Four tests so the carve-out cannot silently widen:
test_local_bare_python_is_still_flagged— a bare localpython3is still a violation even when the same file also contains ssh calls.test_ssh_embedded_python_is_exempt— single-line ssh form.test_ssh_exemption_spans_a_line_continuation— the real backslash-continued form.test_continuation_does_not_leak_exemption_to_later_commands— once the ssh command ends, a later localpython3is flagged again.uv run pytest tests/ci/test_prepush_hook_pinned_interpreter.py→ 7 passed.Proof the deadlock is broken
This PR's own branch pushed successfully with the pre-push hook enabled and no
--no-verify, which was impossible ondevimmediately before it.Ticket
OMN-16333. Blocks OMN-16323 (release.yml shell-injection fix) in this repo, which in turn gates OMN-16289 step 2.
Evidence-Ticket: OMN-16333
Evidence-Source: OCC#6815