Skip to content

test(OMN-17437): cross-branch invariant — governance-path exclusion must exist on every grant-PR base branch - #7938

Closed
jonahgabriel wants to merge 7 commits into
devfrom
jonah/omn-17437-governance-exclusion-cross-branch-test
Closed

jonahgabriel wants to merge 7 commits into
devfrom
jonah/omn-17437-governance-exclusion-cross-branch-test

Conversation

@jonahgabriel

Copy link
Copy Markdown
Contributor

Backmerge companion to the main hotfix for OMN-17437. Draft until the main hotfix lands — see "Why this is a draft" below.

Why

dev already carries the OMN-16117 governance-path exclusion and scripts/ci/check_governance_paths.py. What no branch carried was a check that the other base branch has them too — which is exactly how OMN-16117 came to be installed on the branch grant PRs never target.

Every merged prod-promotion grant PR — #7084, #7213, #7418, #7464, #7554, #7561, #7662, #7731 — targeted main, not dev. For pull_request events GitHub resolves the workflow from the PR's merge ref, so main-based grant PRs ran main's unprotected 165-line copy of auto-merge.yml, which arms gh pr merge --auto --squash for any PR authored by jonahgabriel — the identity agent sessions act under.

What this adds

tests/ci/test_auto_merge_governance_exclusion.py, identical to the file the main hotfix adds:

  • three per-branch invariants — the Check governance-path exclusion step exists, every arming step is gated on steps.governance_gate.outputs.exclude != 'true', and scripts/ci/check_governance_paths.py resolves and guards the grant file;
  • one cross-branch invariant over GRANT_PR_BASE_BRANCHES = ("main", "dev"). The branch under edit is read from the worktree (on an open PR the fix is in the tree, not yet on the ref); the others are read from the git object store.

Plus contracts/OMN-17437.yaml so the ticket contract resolves on dev.

Why this is a draft

Run from dev against a full clone today, the cross-branch leg correctly fails:

E   AssertionError: ref main:.github/workflows/auto-merge.yml: no 'Check
    governance-path exclusion' step in .github/workflows/auto-merge.yml.

That is the test doing its job — main is genuinely unprotected until the hotfix lands. It turns green on merge. In OCC's test CI job the other branch is not resolvable (actions/checkout@v6 at the default fetch-depth: 1), so that leg skips there and the per-branch legs still run; the real cross-branch proof comes from any full clone, including every local pre-push run.

DoD receipts are added before this leaves draft, once the main hotfix has landed and the contract's check commands pass on this branch too.

Blast radius

Test-only plus one contract file. No workflow, no source, no governance file is touched on dev. Nothing here can arm, merge, or authorize anything.

@onexbot-occ-writer

Copy link
Copy Markdown
Contributor

No OCC evidence companion was minted for this PR.

the product repo 'OmniNode-ai/onex_change_control' IS the OCC repo, so this PR is itself an OCC evidence record; no companion is authored for one (OMN-16440, specimens OCC#6927/#6958)

Matched in the repo: OmniNode-ai/onex_change_control

To clear this: Nothing to do. An OCC evidence PR carries its own evidence in its own diff; the companion it was declined would have carried only a bare existence probe.

Reported by node_occ_companion_effect (decline code occ_self_companion, OMN-16665). This decision was made against the PR's LIVE state at compute time, not at publish time — a green publisher job only means the command reached the broker.

@onexbot-occ-writer

Copy link
Copy Markdown
Contributor

OCC autobind stood down for OmniNode-ai/onex_change_control#7938 (OMN-17437): this PR (hand_authored) already carries evidence for that ticket, so no competing companion was minted (OMN-15247 defer-on-contention).

@jonahgabriel
jonahgabriel enabled auto-merge (squash) September 15, 2026 10:56
…on must exist on every branch that serves grant-PR traffic

Backmerge companion to the `main` hotfix. `dev` already carries the
OMN-16117 exclusion and `scripts/ci/check_governance_paths.py`; what it
lacked was any check that the OTHER base branch carries them too, which is
precisely how OMN-16117 came to be installed on the branch grant PRs never
target.

Adds the same test file the `main` hotfix adds. Three per-branch invariants
(the exclusion step exists, every arming step is gated on it, the checker
module resolves and guards the grant file) plus a cross-branch check that
applies the invariant to each branch in GRANT_PR_BASE_BRANCHES, reading the
branch under edit from the worktree and the others from the git object
store.

Run from `dev` today the cross-branch leg correctly reports
`ref main: no 'Check governance-path exclusion' step` — it turns green when
the `main` hotfix lands. In OCC's `test` CI job the other branch is not
resolvable (checkout is fetch-depth 1) so that leg skips there; the
per-branch legs still run.

Also lands contracts/OMN-17437.yaml so the ticket contract resolves on dev.
…tream}

Mirrors the same correction on the main hotfix: once a feature branch is
pushed, @{upstream} is the branch itself rather than its base, so the
cross-branch leg reported "no branch under edit" and then demanded the fix
already be on the ref. Ancestry answers it structurally.
@jonahgabriel
jonahgabriel force-pushed the jonah/omn-17437-governance-exclusion-cross-branch-test branch from 78b626e to 65b3937 Compare September 16, 2026 06:00
@jonahgabriel

Copy link
Copy Markdown
Contributor Author

Claimed by codex-merge-sweep for supersession.

Closing this human-authored PR because the required Human-Authored Privileged PR Gate refuses .github/workflows/ci.yml changes from a human account. The branch has been patched to cite OMN-17437 in the workflow diff (0859d9f6a4), and I am reopening the same branch through .github/workflows/open-pr-as-writer-app.yml so the replacement PR is authored by the onexbot-occ-writer App instead of weakening the gate.

@jonahgabriel

Copy link
Copy Markdown
Contributor Author

Closed by codex-merge-sweep after claim: superseded by the App-authored replacement required by Human-Authored Privileged PR Gate. Branch head patched at 0859d9f before re-dispatch.

auto-merge was automatically disabled September 17, 2026 02:07

Pull request was closed

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