Skip to content

feat(OMN-14462): scripts/merge-proof local-proof env wrapper (F-20) - #1805

Merged
jonahgabriel merged 4 commits into
devfrom
jonah/omn-14462-merge-proof-omnimarket
Jul 18, 2026
Merged

jonahgabriel merged 4 commits into
devfrom
jonah/omn-14462-merge-proof-omnimarket

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

OMN-14462 (F-20): local-proof env wrapper

Closes OMN-14462 (partial — omnimarket half; omnibase_infra half is a sibling PR under the same ticket).

Friction

Local proof gates (topic-naming lint) resolve their validator from a sibling omnibase_infra checkout. Under the mandated worktree layout ($OMNI_HOME/omni_worktrees/<ticket>/omnimarket) the naive ../omnibase_infra sibling path does not exist, so a correct change fails locally until the hidden environment is reconstructed by hand — the natural workaround pressure being --no-verify, which rule #10 bans. Source: docs/tracking/friction/2026-07-16-overnight-merge-sweep-friction-report.md (F-20).

Change

scripts/merge-proof resolves OMNI_HOME + OMNIBASE_INFRA_PATH deterministically from its own on-disk location (rule #8 — Path-relative resolution, never a hardcoded default) and, when it cannot, prints the exact export lines to run rather than proceeding on a silent wrong path. Modes:

  • --check — resolve, verify the validator exists, print resolved paths, exit 0 (non-zero + guidance if unresolved).
  • --print-env — eval-able export lines.
  • -- CMD ... — run any gate with env guaranteed (e.g. scripts/merge-proof -- pre-commit run --files X).
  • default — run the local topic-lint proof (the exact hook that needed the env).

dod_evidence

  • tests/scripts/test_merge_proof.py (7 tests, all green locally + on pre-push smart selector) drives the real script via subprocess in an isolated tmp location, asserting:
    • env UNSET + no derivable sibling → non-zero exit AND the literal export OMNI_HOME= / export OMNIBASE_INFRA_PATH= guidance is present (assert-on-absence => FAIL, so a silent wrong-path can't pass);
    • env SET → exit 0;
    • the real worktree auto-resolves with nothing exported (the ergonomic win);
    • no /Users/ or /Volumes/ hardcoded path (rule feat: PostgresDataSource adapter for data verification [OMN-7624] #6).
  • Git env vars (GIT_DIR/GIT_INDEX_FILE/GIT_WORK_TREE) stripped from the child env per the OMN-14746/14744 worktree-safety lesson.
  • shellcheck --severity=style clean.

Rule #5 note

F-20 is an ergonomic wrapper, not a detector; its correctness is enforced by the committed pytest (runs in CI), not by a new advisory sweep.

DO NOT MERGE — Codex owns the merge.

Summary by CodeRabbit

  • New Features

    • Added a command-line utility to resolve the required local proof environment.
    • Supports validation, environment export instructions, proof execution, and arbitrary command execution.
    • Provides clear guidance and fails fast when required paths or validation files are unavailable.
  • Tests

    • Added automated coverage for environment resolution, validation modes, executable setup, and failure handling.

Evidence-Ticket: OMN-14462
Evidence-Source: OCC#4380
Evidence-Commit: 9991acf3294a6c8f99fb4bf8d9cf0cfb6e593422
Evidence-Head: 5119adc82a0fee7eec5f5951c51320f28fa5af64

Local proof gates (topic-naming lint) resolve their validator from a sibling
omnibase_infra checkout. Under the mandated worktree layout the naive
../omnibase_infra sibling path does not exist, so a correct change fails
locally until the hidden environment is reconstructed by hand — the natural
workaround pressure being --no-verify, which rule #10 bans.

scripts/merge-proof resolves OMNI_HOME + OMNIBASE_INFRA_PATH deterministically
from its own on-disk location (rule #8) and, when it cannot, prints the exact
export lines to run rather than proceeding on a silent wrong path. Modes:
--check, --print-env, -- CMD, default (run topic-lint proof).

Test: tests/scripts/test_merge_proof.py drives the real script via subprocess
in an isolated tmp location (git env stripped per OMN-14746/14744).
@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The PR adds a Bash scripts/merge-proof wrapper that resolves omni_home and omnibase_infra, validates the topic-lint validator, supports multiple execution modes, and provides pytest coverage for resolution and failure behavior.

Merge proof wrapper

Layer / File(s) Summary
Environment resolution
scripts/merge-proof
Derives checkout paths, validates the required infrastructure directory, and emits explicit export guidance when resolution fails.
Proof execution modes
scripts/merge-proof
Implements --check, --print-env, help, command passthrough, and default topic-lint execution while exporting resolved paths.
Wrapper validation
tests/scripts/test_merge_proof.py
Tests executable status, hardcoded paths, environment resolution, validator presence, printed exports, and real checkout behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant merge-proof
  participant Filesystem
  participant TopicLint
  User->>merge-proof: invoke proof mode
  merge-proof->>Filesystem: resolve omni_home and omnibase_infra
  Filesystem-->>merge-proof: return paths and validator status
  merge-proof->>TopicLint: run topic-lint validator
  TopicLint-->>merge-proof: return validation result
  merge-proof-->>User: report status
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the new merge-proof environment wrapper and its ticket context.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-14462-merge-proof-omnimarket

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/merge-proof`:
- Line 95: Update scripts/merge-proof lines 95-95 to emit RESOLVED_OMNI_HOME
with Bash printf '%q' in the guidance export, and lines 155-156 to shell-quote
both emitted export values. Update tests/scripts/test_merge_proof.py lines
122-132 to evaluate the generated output with a whitespace/metacharacter path
and assert exact round-tripping.
- Around line 137-140: Clear inherited GIT_DIR, GIT_INDEX_FILE, and
GIT_WORK_TREE in scripts/merge-proof before dispatching either delegated
commands or the default proof execution, while preserving the existing
OMNIBASE_INFRA_PATH and OMNI_HOME setup. In tests/scripts/test_merge_proof.py,
add a contract test that seeds all three variables and verifies the delegated
child receives none.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dbbe18f7-ae58-4796-87c2-92bdf4374633

📥 Commits

Reviewing files that changed from the base of the PR and between 5b239aa and 5dbcfc3.

📒 Files selected for processing (2)
  • scripts/merge-proof
  • tests/scripts/test_merge_proof.py

Comment thread scripts/merge-proof Outdated
Comment thread scripts/merge-proof
@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

github-actions Bot commented Jul 18, 2026 •

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 18, 2026
…imarket#1805 (#4372)

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

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

* evidence(OMN-14462): self-bind OCC#4372 + rebind contract_sha256

---------

Co-authored-by: omnimarket-bot <bot@omninode.ai>
@jonahgabriel
jonahgabriel merged commit 21a6a09 into dev Jul 18, 2026
156 of 158 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-14462-merge-proof-omnimarket branch July 18, 2026 09:24
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