Skip to content

feat(OMN-13973): wire governed impacted-test selector as pre-push hook (omnimarket, WS7 fan-out) - #1793

Merged
jonahgabriel merged 1 commit into
devfrom
jonah/omn-13973-omnimarket-prepush-smart-tests
Jul 16, 2026
Merged

jonahgabriel merged 1 commit into
devfrom
jonah/omn-13973-omnimarket-prepush-smart-tests

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

OMN-13973 — governed impacted-test selector as a PRE-PUSH hook (omnimarket, WS7 fan-out)

Fan-out of the proven canary omnibase_core#1451 (verified real=TRUE) to omnimarket. Wires a repo:local pre-commit hook prepush-smart-tests (stages:[pre-push]) backed by scripts/hooks/prepush_smart_tests.sh. The wrapper computes changed files vs the origin/dev merge-base and DRY-invokes the EXACT CI selector module (uv run python -m scripts.ci.detect_test_paths), then runs uv run pytest <selected_paths> --ignore=tests/integration.

This is a per-repo SEAM-MATCH, not a paste

omnimarket's scripts/ci/detect_test_paths.py is hardcoded to SRC_PREFIX="src/omnimarket/" + its own scripts/ci/test_selection_adjacency.yaml. Its CLI does NOT accept --base-ref (the canary's selector does, for a pyproject classifier omnimarket lacks) — a paste of the canary invocation would hard-error unrecognized arguments. The wrapper therefore matches omnimarket's live CI seam exactly (.github/workflows/ci.yml: --changed-files-from/--ref-name/--event-name/--feature-flag, default adjacency, no --base-ref) and computes the diff base itself for git diff only.

Label / scope

Fast local impacted subset, ADVISORY of the full CI suite — NOT byte-parity. On CI the selector is behind ENABLE_SMART_TESTS (off by default); the enforced merge gate is the full suite. tests/integration is always ignored (CI-only).

NET-NEGATIVE-SURFACE (retired surface)

Retires the "run the whole unit suite by hand before every push" manual default for omnimarket — root CLAUDE.md Rule #4: "Local pre-push: use the governed selector where wired (OMN-13973); until that lands, the full local suite remains the fail-closed default." This hook makes that governed selector the wired pre-push default.

FAIL-LOUD (CLAUDE.md Rule #8)

Hard-errors (exit 1) with remediation if the diff base, the selector, or its adjacency config cannot resolve. Never a green skip — a gate that cannot run is indistinguishable from a failing gate.

dod_evidence (all run in worktree off latest origin/dev)

Fresh-worktree selector resolution (systemic uv-run/worktree fragility, parity plan §3d.2/3): uv run python -m scripts.ci.detect_test_paths resolves cleanly from a fresh worktree (builds venv, emits valid JSON) — no sibling-resolution repro; plain uv run from repo root is the worktree-safe invocation.

Installation proof — fresh pre-commit install --hook-type pre-commit --hook-type pre-push --hook-type commit-msg wrote .git/hooks/pre-push (# File generated by pre-commit). A real git push then fired it:

mypy (type checking - strict)...........................(no files to check)Skipped
Governed impacted-test selector (pre-push, OMN-13973).......................Passed
[prepush-smart-tests] selection: is_full_suite=False reason=None paths=[ tests/ ] (feature-flag=on)
[prepush-smart-tests] running impacted subset: uv run pytest tests/ --ignore=tests/integration --co -q

(config-only diff maps nothing → tests/ fallback; the real-push pytest was bounded to collect-only via PREPUSH_PYTEST_ARGS=--co -q because the omnimarket unit suite is 12,270 tests incl. kafka-marked. mypy auto-skipped: its files: regex ^src/omnimarket/.*\.py$ matched none of this PR's files.)

Subset proof (real execution + wall-clock) — temp commit touching only tests/intelligence/:

[prepush-smart-tests] selection: is_full_suite=False reason=None paths=[ tests/intelligence/ ]
[prepush-smart-tests] running impacted subset: uv run pytest tests/intelligence/ --ignore=tests/integration
9 passed in 0.07s
[prepush-smart-tests] impacted tests passed; allowing push.   exit 0
wall-clock: 4.844s total (incl. uv resolution)

Fail-closed escalation proof — temp commit touching shared module src/omnimarket/models/:

[prepush-smart-tests] selection: is_full_suite=True reason=shared_module paths=[ tests/ ]
[prepush-smart-tests] running FULL suite (fail-closed escalation): uv run pytest tests/ --ignore=tests/integration
12270 tests collected

(bounded --co; pyproject.toml/tests/conftest.py/tests/fixtures//pytest.ini → test_infrastructure, ≥6 modules → threshold_modules, main → main_branch, flag off → feature_flag_off all likewise force the full suite — verified against the selector.)

Fail-loud (hard-error) proofs — both exit 1, never green-skip:

  • unresolvable base ref (PREPUSH_BASE_REF=origin/omn13973-no-such-ref-xyz) → ERROR: base ref ... could not be resolved → exit 1
  • unresolvable selector/adjacency (PREPUSH_ADJACENCY=/tmp/nonexistent.yaml) → selector FileNotFoundError surfaced → ERROR: governed test selector failed to resolve a selection → exit 1

Local gates — pre-commit run (pre-commit stage) on the two changed files: all applicable hooks Passed (incl. Pre-commit fail-loud meta-gate (OMN-14666) and Pre-commit/CI pin-parity check), rest Skipped. default_install_hook_types already includes pre-push (verified on origin/dev); the hook uses no literal exit 0 and no SKIP/BYPASS env-gated exit, so it does not trip the fail-loud meta-gate.

Notes

  • OCC companion NOT self-authored (implementer ≠ evidence author). Held for Codex.
  • Do NOT merge — reporting verified state only.

Closes OMN-13973

Evidence-Ticket: OMN-13973
Evidence-Source: OCC#4290

Evidence-Commit: 6b429f38613e2577c9d7872269cd10072c82b563
Evidence-Head: aae7e2c

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 56 minutes

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?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 21da85cf-97de-4495-882f-5d2a97f2dbe3

📥 Commits

Reviewing files that changed from the base of the PR and between 371e8b5 and aae7e2c.

📒 Files selected for processing (2)
  • .pre-commit-config.yaml
  • scripts/hooks/prepush_smart_tests.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-13973-omnimarket-prepush-smart-tests

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

@github-actions

Copy link
Copy Markdown

✅ Architectural Review — PASSED

Errors: 0
Warnings: 0

What this checks

Rule Description
ARCH-TOPIC-001 No hardcoded Kafka topic strings in handler code
ARCH-DI-001 No event_bus=None bypass
ARCH-DI-002 No direct Handler instantiation outside workflow_runner/adapters
ARCH-DI-003 No reinvented DI containers
ARCH-TOPIC-002 contract.yaml topics follow `onex.{cmd

No architectural violations found.

Static architectural lint — no model inference (OMN-14176).

@github-actions

Copy link
Copy Markdown

✅ Hostile Reviewer — PASSED

Blocking findings (critical/error): 0
Total findings: 0
Models succeeded: qwen3-review,qwen3-review-b


Gate semantics (pilot phase)

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

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

jonahgabriel added a commit to OmniNode-ai/onex_change_control that referenced this pull request Jul 16, 2026
…imarket#1793 (#4290)

* evidence(OMN-13973): author OCC companion for OmniNode-ai/omnimarket#1793

OCC companion by node_pr_lifecycle_fix_effect (OMN-13317 F1 / OMN-13990 / OMN-14285). Product PR head aae7e2c5c1032660c548a8c26b941612baeadb09.

* evidence(OMN-13973): self-bind OCC#4290 + rebind contract_sha256

* fix(OMN-13973): repair generated OCC companion placeholders

---------

Co-authored-by: omnimarket-bot <bot@omninode.ai>
@jonahgabriel
jonahgabriel merged commit 9067a97 into dev Jul 16, 2026
164 of 179 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-13973-omnimarket-prepush-smart-tests branch July 16, 2026 22:07
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