Repository navigation
fix(OMN-15845): fail fast on stale OCC base before companion force-push - #2097
Conversation
OccCompanionEmitter clones OCC once and captures base_sha; both force-pushes that follow never fetch/merge/rebase. A sibling companion for the same ticket merging to OCC between this runs clone and either push was invisible: the run silently rewrote the ticket-scoped admissibility-validator receipt and force-pushed a stale full-regenerate diff, orphaning the sibling companion. Add a cheap git ls-remote freshness check immediately before each force-push. A moved default branch now raises StaleCompanionBaseError instead of pushing, so the OMN-14793 lease still releases in the finally and the producer safely retries on the next PR-lifecycle event. No live merge/rebase attempted (out of scope, larger change). RED-then-GREEN: new stale-base test module fails to import against pre-fix source (no StaleCompanionBaseError export); passes after the fix. Existing git-mock harnesses in three sibling test files updated to answer the new ls-remote call so their own (unrelated) properties keep passing. Checked and not reproduced: the OMN-16116-described unscoped dod-occ-self id defect -- every self-bind id in this file is already PR-scoped. Evidence-Ticket: OMN-15845 Also addresses: OMN-16116
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 41 minutes Limit details: You’ve used all 1 included review currently available under your plan. You completed 111 included PR reviews in the past 7 days; at that activity level, included reviews refill at 1 review per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
Comment |
✅ Architectural Review — PASSEDErrors: 0 What this checks
No architectural violations found. Static architectural lint — no model inference (OMN-14176). |
✅ Hostile Reviewer — PASSEDBlocking findings (critical/error): 0 Gate semantics
Powered by omniintelligence.review_pairing.cli_review — node-based adversarial review via HandlerLlmCliSubprocess (OMN-8524) |
…llisions Round-2 adversarial-review remediation (F-1, MEDIUM): the OMN-15845 force-push freshness guard compared raw remote-vs-base SHAs, so ANY commit to OCC's default branch -- not just a sibling companion for the SAME ticket -- tripped StaleCompanionBaseError. Live measurement showed OCC dev churns roughly every 24 minutes on average, so this converted a rare same-ticket race into a frequent liveness problem. _assert_base_still_fresh now takes the run's tickets, and on a SHA mismatch does a minimal single-commit fetch + git diff --name-only against base_sha, raising only when the diff touches this run's own contracts/<ticket>.yaml or drift/dod_receipts/<ticket>/** paths. An unrelated-ticket move on OCC's default branch now proceeds normally. Test: extends test_occ_companion_emitter_stale_base_omn_15845.py with test_moved_base_unrelated_ticket_does_not_raise, RED/GREEN-verified against the pre-round-2 naive SHA-only predicate. OMN-15845
…imarket#2097 (#6670) * evidence(OMN-15845): author OCC companion for OmniNode-ai/omnimarket#2097 Hand-authored OCC companion (occ-autobind producer blocked tonight on GitHub Actions self-hosted runner-fleet capacity: 0 idle runners org-wide). Contract + downstream/CI/admissibility receipts rendered via the REAL live occ_evidence_stamp render_* functions (node_pr_lifecycle_fix_effect / OMN-13317 F1 / OMN-13990 / OMN-14285), fed with live-probed values (real content-bound RED/GREEN check against merge-base 88f62b95..., real gh pr view --json files diff-scope probe), so this companion is structurally identical to a machine-minted one. Product PR head c4ef00c8f648ead1148a824a45cef2881fd4d4c5. * evidence(OMN-15845): self-bind OCC#6670 + rebind contract_sha256
|
Hostile Reviewer red — root-caused, both check names trace to one infra event, not two review failures. Investigated the two red "Hostile" checks on this PR (run 32147768558):
The full log of the reviewer job shows it never reached an actual review step: it failed while cloning sibling repos needed for context ( Conclusion: this is one infra event (git-clone contention against |
Summary
_clone_and_branch, shallow clone) and captures a single base SHA; the two force-pushes that follow never fetch/merge/rebase. If a sibling product PR mints a companion for the SAME ticket and merges to OCC between this run's clone and either of its pushes, this run cannot see it: it silently treats the ticket as still companion-less, re-writes the ticket-scoped write-once admissibility-validator receipt, and force-pushes a stale full-regenerate diff that orphans the sibling companion or produces an add/add conflict at merge time.git ls-remote <occ-url> HEADfreshness check immediately before EACH force-push. A moved OCC default branch now raises a newStaleCompanionBaseErrorinstead of pushing. The existingfinallystill releases the single-producer lease on this path, so the abort is fail-fast and safe to retry: the emitter is re-invoked on the product PR's next lifecycle event (synchronize, etc.) and will clone a fresh base then.occ_companion_emitter.py's self-bind id (occ-self-bind-pr-<occ_pr_number>) and the sibling compute handler are already PR-scoped everywhere; no unscoped self-bind id exists anywhere insrc/orscripts/. No change made for this sub-defect.Test plan
tests/unit/nodes/node_pr_lifecycle_fix_effect/test_occ_companion_emitter_stale_base_omn_15845.py: fails to even import against pre-fix source (noStaleCompanionBaseErrorexport — confirmed by stashing the source change and re-running); passes after the fix. Covers: stale base before the first push raises and the push never fires; a base that moves between the first and second push is caught on the second; the single-producer lease is still released infinally; the unchanged-base happy path still pushes normally on both force-pushes (regression guard).test_occ_companion_emitter.py,test_occ_companion_emitter_friction_omn_14741.py,test_occ_autobind_contention_omn_15247.py) to answer the newgit ls-remotecall with a SHA matching their existing mocked base, so their own (unrelated) properties keep passing.uv run pytest tests/unit/nodes/node_pr_lifecycle_fix_effect/ -m "not kafka": 286 passed, 18 skipped.uv run mypy src/omnimarket/nodes/node_pr_lifecycle_fix_effect/handlers/occ_companion_emitter.py --strictand full-packageuv run mypy src/omnimarket/ --strict: both clean.uv run ruff format --check/uv run ruff check: clean.git commit: all hooks passed.Also addresses: OMN-16116
Evidence-Ticket: OMN-15845
Evidence-Source: OCC#6670