Repository navigation
fix(OMN-17324): a sibling clone git cannot read is not a sibling clone - #1631
Merged
jonahgabriel merged 1 commit intoAug 31, 2026
Merged
Conversation
test_passes_on_committed_infra_flips failed on pristine dev for any user of the
shared .201 box who did not own the omnibase_infra clone there, reddening the
whole governed suite and blocking EVERY omnibase_core push.
Root cause, from a real run rather than inference.
`_resolve_infra_root` walks up from the test file looking for a sibling
omnibase_infra and accepts the first candidate whose
`scripts/ci/adequacy_receipts` is a readable directory. On .201 a collaborator's
clone lives at /data/omninode/<user>/omnibase_core, so the walk reaches
/data/omninode and finds omnibase_infra there -- owned by another user, mode
drwxrwxr-x, therefore world-readable and accepted.
Git then refuses every query against it:
fatal: detected dubious ownership in repository at
'/data/omninode/omnibase_infra'
That is git's safe.directory protection (CVE-2022-24765) declining a repo owned
by a different uid. So `_git_ref_exists(repo_root, "origin/dev")` exits
non-zero, `load_base_baseline` returns None, and `_assert_twin_baseline` fails
closed -- correctly, on a question it was never able to ask.
Reproduced: 2 failed / 24 passed in the collaborator account on .201; 26 passed
where the sibling clone is owned by the same user. Only two commits separate the
reported dev from current dev and neither touches this machinery, so this is
environmental and standing, not a regression.
The defect is the guard, not the fail-closed. `is_dir()` tests filesystem
readability; the assertions need git to be able to answer ref queries. Those are
different properties, and the skipif's own reason -- "omnibase_infra canonical
clone not present" -- already anticipates unavailability. It was testing for the
wrong kind.
`_resolve_infra_root` now requires a candidate to be both shaped like the clone
AND readable by git as the current user, and skips a failing candidate rather
than returning it so the search continues to one that qualifies. When none does
it returns None and the infra assertions skip, which is the documented
behaviour.
The probe scrubs GIT_DIR/GIT_WORK_TREE/GIT_INDEX_FILE/GIT_COMMON_DIR via
scrub_git_location_env (OMN-14891). That is load-bearing here rather than
boilerplate: git exports those into every hook environment and they override
both cwd= and `git -C`, so an unscrubbed probe would answer about the worktree
that invoked the pre-push hook instead of about the candidate -- reporting True
for a repo it never looked at, which is the precise failure it exists to
prevent. Caught by the repo's own gate on the first commit attempt. Config is
left intact so a real safe.directory exemption is still honoured.
Three tests. A counter-test pins a directory shaped like the infra clone but
unusable by git; a uid mismatch cannot be simulated portably, so it pins the
property the old guard lacked rather than the exact mechanism. A positive test
stops the counter-test being satisfiable by a function returning False
unconditionally, which would silently skip the infra coverage everywhere and
retire it instead of fixing it. An invariant test asserts whatever the walk-up
selects is always git-readable, so a future candidate source cannot reintroduce
the defect by a route these tests did not anticipate.
29 passed, ruff clean, ruff format clean. The one mypy --strict error on this
path (verify_flip_bundle.py:881, canonical_handler_shape "yaml" not explicitly
exported) is pre-existing on pristine origin/dev and untouched here.
jonahgabriel
enabled auto-merge (squash)
August 31, 2026 22:03
jonahgabriel
pushed a commit
to OmniNode-ai/onex_change_control
that referenced
this pull request
Aug 31, 2026
…#7880) * evidence: OCC companion pass 1 for OmniNode-ai/omnibase_core#1631 * evidence: OCC companion self-bind for #7880 --------- Co-authored-by: node-occ-companion-effect <occ-companion-effect@omninode.ai>
jonahgabriel
deleted the
lakshman/omn-17324-flip-bundle-sibling-repo-guard
branch
August 31, 2026 22:23
Contributor
Author
|
Closing this out for OMN-17324. No review comments were left on this PR, so this is the record of what landed. Merged 2026-08-31T22:23:41Z as How it was verified:
It unblocked the OMN-16998 re-push, which landed as omnibase_core#1632. Nothing is left on this PR. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes OMN-17324.
test_verify_flip_bundle::test_passes_on_committed_infra_flipsfails on pristinedevfor any user of the shared .201 box who does not own theomnibase_infraclone there, reddening the whole governed suite and blocking EVERYomnibase_corepush.Root cause, from a real run
_resolve_infra_root()walks up from the test file looking for a siblingomnibase_infraand accepts the first candidate whosescripts/ci/adequacy_receiptsis a readable directory. On .201 a collaborator clone lives at/data/omninode/<user>/omnibase_core, so the walk reaches/data/omninodeand findsomnibase_infrathere — owned by another user, modedrwxrwxr-x, therefore world-readable and accepted.Git then refuses every query against it:
That is git safe.directory (CVE-2022-24765) declining a repo owned by a different uid. So
_git_ref_exists(repo_root, "origin/dev")exits non-zero,load_base_baselinereturns None, and_assert_twin_baselinefails closed — correctly, on a question it was never able to ask.Not a missing artifact, not wrong ref derivation, not a shallow clone, not a genuinely shrunk baseline.
The fix
Fail-closed on an unresolvable baseline is correct and is unchanged.
is_dir()tests filesystem readability; the assertions need git to answer ref queries. Those are different properties, and the skipif reason — "omnibase_infra canonical clone not present" — already anticipates unavailability. It was testing for the wrong kind._resolve_infra_rootnow requires a candidate to be both shaped like the clone AND readable by git as the current user, and skips a failing candidate rather than returning it, so the search continues to one that qualifies. When none does it returns None and the infra assertions skip, which is the documented behaviour.The probe scrubs GIT_DIR/GIT_WORK_TREE/GIT_INDEX_FILE/GIT_COMMON_DIR via
scrub_git_location_env(OMN-14891). Load-bearing rather than boilerplate: git exports those into every hook environment and they override bothcwd=andgit -C, so an unscrubbed probe would answer about the worktree that invoked the pre-push hook instead of about the candidate — reporting True for a repo it never looked at. Caught by the repo own gate on the first commit attempt.Regression proof on .201, same box, same account, detached worktree:
Environmental and standing rather than a regression: only two commits separate the reported dev from current dev and neither touches this machinery.
29 passed locally, ruff clean, ruff format clean. Governed pre-push green — 2104 passed, 1 skipped, no PREPUSH_* override, no --no-verify, no skip token.
The one
mypy --stricterror on this path (verify_flip_bundle.py:881,canonical_handler_shapeyaml not explicitly exported) is pre-existing on pristineorigin/devand untouched here.Tests
Three. A counter-test pins a directory shaped like the infra clone but unusable by git — a uid mismatch cannot be simulated portably, so it pins the property the old guard lacked rather than the exact mechanism. A positive test stops the counter-test being satisfiable by a function returning False unconditionally, which would silently skip the infra coverage everywhere and retire it instead of fixing it. An invariant test asserts whatever the walk-up selects is always git-readable.
Unblocks the OMN-16998 re-push.
Evidence-Ticket: OMN-17324
Evidence-Source: OCC#7880