Skip to content

fix(OMN-16326): interpreter-free pre-push load probe restores the pinned-interpreter gate - #2824

Merged
jonahgabriel merged 1 commit into
devfrom
jonah/omn-16326-prepush-load-probe-pinned-interpreter
Aug 21, 2026
Merged

jonahgabriel merged 1 commit into
devfrom
jonah/omn-16326-prepush-load-probe-pinned-interpreter

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Aug 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes OMN-16326. Fixes a regression introduced by OMN-16295 (d36b7ccba, #2816).

host_load_ratio() shipped with three bare python3 -c invocations in scripts/hooks/prepush_smart_tests.sh, which regressed the OMN-14953 pinned-interpreter gate (tests/ci/test_prepush_hook_pinned_interpreter.py, #2421). Both tests in that file were RED on a clean origin/dev checkout.

Blast radius (measured, not assumed): the pre-push impacted-test selector maps .github/workflows/** to tests/ci/, so every PR touching a workflow file hit the red gate at push time. OMN-16323 (release.yml security fix) was stalled behind exactly this. A scripts/hooks/** change selects scripts/tests/ tests/scripts/ tests/unit/scripts/ instead, so the bug did not block its own fix.

$ uv run python -m scripts.ci.detect_test_paths --changed-files-from <(echo .github/workflows/release.yml) --ref-name test
{"selected_paths":["tests/ci/"],...}

Why not uv run

The gate's exemption is literal: a python/python3 token passes only when immediately preceded by uv run. That is not an available fix here — two of the three invocations execute on the remote hosts, and .201 has no uv binary at all. Read-only probe, 2026-08-20:

Host OS login shell uv cores load source
local Darwin — yes 24 sysctl -n vm.loadavg
.200 stickybeatz-studio Darwin zsh /Users/jonah/.local/bin/uv 24 sysctl -n vm.loadavg
.201 192.168.86.201 Linux bash absent 32 /proc/loadavg

The alternative — teaching the test to exempt ssh-embedded strings — was rejected: the ssh token sits on the preceding line continuation, so the scan would need context-aware parsing, and carving an exception out of a static gate to accommodate new code inverts the point of the gate.

Fix

Drop the interpreter from the probe entirely. With no interpreter, there is nothing left to float: OMN-14953's assertion is satisfied as written and unweakened (no test change in this PR), and interpreter startup leaves the pre-push critical path.

Two portability constraints are encoded and commented:

  • cut(1) instead of set -- $(...) — .200's remote login shell is zsh, which does not word-split unquoted command substitution, so set -- would collapse the line into $1 there while working fine on .201's bash.
  • POSIX-only and single-quote-free — the snippet is handed to ssh(1) and executed by whatever login shell the remote user has.

Proof host_load_ratio still routes correctly

Real function block sourced from the committed file (not a re-implementation), against live hosts:

Target load1 nproc ratio host_is_fit
local 15.90 24 0.662 0 (fit)
.200 15.90 24 0.662 0 (fit)
.201 32.05 32 1.002 1 (over threshold)

.201 landing at 1.002 against a 1.0 threshold shows the discriminator is live, not stuck returning "fit".

Failure and override paths preserved:

  • unreachable target → host_load_ratio rc=1 in 3.0s (ConnectTimeout-bounded, no hang); host_is_fit rc=2 ("could not check"), still distinct from 1 ("over capacity")
  • PREPUSH_LOAD_OVERRIDE_LOCAL="4.0 8" → 4.0 8 0.500
  • PREPUSH_LOAD_OVERRIDE_REMOTE="16.0 8" → 16.0 8 2.000, host_is_fit rc=1

Test plan

  • uv run pytest tests/ci/test_prepush_hook_pinned_interpreter.py — RED on origin/dev (2 failed), GREEN here (2 passed)
  • uv run pytest tests/ci/ — 1503 passed (the exact subset OMN-16323 selects, i.e. proof it is unblocked)
  • shellcheck scripts/hooks/prepush_smart_tests.sh — clean
  • pre-commit run --all-files — rc=0, all passed
  • The fixed hook passed its own gauntlet: git push ran the real pre-push chain (canonical-clone guard → pre-commit hook-impl → prepush-smart-tests → this script) — impacted subset 1685 passed, 6 skipped in 336.77s, "impacted tests passed; allowing push"
  • No test was weakened, deleted, or skipped; no --no-verify

Sibling repos

The same OMN-16295 trio merged into omnibase_core (#1567) and omnimarket (#2115). Neither repo has tests/ci/test_prepush_hook_pinned_interpreter.py, so neither has a failing gate and no push path is blocked there. Both also carry a pre-existing bare python3 - heredoc that predates OMN-16295 (core L376, omnimarket L395). Tracked on OMN-16326 as follow-up rather than fixed speculatively here.

Evidence-Ticket: OMN-16326
Evidence-Source: OCC#6813

…953 gate)

OMN-16295 (d36b7cc) added host_load_ratio() with three bare `python3 -c`
invocations, which regressed the OMN-14953 pinned-interpreter gate
(tests/ci/test_prepush_hook_pinned_interpreter.py). Both tests in that file
failed on a clean origin/dev checkout, and because the file lives under
scripts/hooks/ the test lands in the pre-push impacted subset -- blocking
pushes to this repo from every worktree.

`uv run` is not an available fix for the two ssh-embedded invocations: they
execute on .200/.201, and .201 has no `uv` binary at all (probed 2026-08-20).
Rather than carve an ssh-shaped exception out of a static gate, this drops the
interpreter from the probe entirely -- there is no interpreter left to float,
so OMN-14953's assertion is satisfied as written and not weakened, and
interpreter startup leaves the pre-push critical path.

Two portability constraints are encoded in the new probe:
  - cut(1) instead of `set -- $(...)`, because .200's remote login shell is
    zsh, which does not word-split unquoted command substitution.
  - no single quotes and POSIX-only, because the snippet is handed to ssh(1)
    and run by whatever login shell the remote user has (bash on .201,
    zsh on .200).

Verified equivalent to the removed python probe on all three hosts:
  local  15.90 24 -> 0.662 (fit)
  .200   15.90 24 -> 0.662 (fit)
  .201   32.05 32 -> 1.002 (over threshold, correctly discriminated at 1.0)
Failure path: unreachable target returns rc=1 in 3.0s (ConnectTimeout-bounded,
no hang) and host_is_fit returns 2 ("could not check"), still distinct from 1
("over capacity"). Both PREPUSH_LOAD_OVERRIDE_* deterministic paths unchanged.

Evidence-Ticket: OMN-16326
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your current included review allowance is based on your included PR review attempts over the past 7 days.

Next review available in: 46 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.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 995abc7d-91fe-466c-b11f-589b9d4036f3

📥 Commits

Reviewing files that changed from the base of the PR and between 2444b99 and 6738960.

📒 Files selected for processing (1)
  • scripts/hooks/prepush_smart_tests.sh

Comment @coderabbitai help to get the list of available commands.

@onexbot-occ-writer

Copy link
Copy Markdown
Contributor

OCC autobind did not mint a companion for this PR: no changed-file candidate could be proven RED against the merge base, and emitting a PR-existence probe instead would be non-falsifiable evidence (OMN-15247). Hand-authored evidence is required.

@jonahgabriel jonahgabriel changed the title fix(OMN-16326): interpreter-free pre-push load probe restores the OMN-14953 pinned-interpreter gate fix(OMN-16326): interpreter-free pre-push load probe restores the pinned-interpreter gate Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❓ Hostile Reviewer — UNKNOWN

Blocking findings (critical): 0
Total findings: 0
Models succeeded: none


Gate semantics (pilot phase)

Verdict Meaning Blocks merge?
passed No critical findings No
blocked CRITICAL findings found Yes
degraded All models unavailable (infra) No (pilot)

Powered by omniintelligence.review_pairing.cli_review — node-based adversarial review via HandlerLlmCliSubprocess (OMN-8468/OMN-8524)

@jonahgabriel
jonahgabriel merged commit 063cf6e into dev Aug 21, 2026
232 of 259 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-16326-prepush-load-probe-pinned-interpreter branch August 21, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant