Repository navigation
fix(OMN-12636): dirty-canonical sweep — base rescue worktree on canonical HEAD + expand untracked dirs (also OMN-12635) - #1023
Conversation
…D + expand untracked dirs Two bugs in HandlerDirtyCanonicalSweep (node_dirty_canonical_sweep), the backing node for /onex:ship_dirty_canonical (epic OMN-7466): OMN-12636 (stale-base diff): _ship_repo created the rescue worktree from origin/<base_branch> (dev) and then copied the canonical clone's dirty file contents onto that base. git status --porcelain reports dirtiness relative to the clone's actual HEAD, not origin/<base>. When the clone is behind dev, those two reference points diverge and the copy reverts already-merged dev commits, producing a regressive partial PR. Observed 2026-06-03: omnibase_infra was 20 commits behind dev -> PR #1845 had only 11 of 31 dirty files (+50/-329), closed and re-shipped as #1846. Fix: resolve the canonical clone HEAD via git rev-parse HEAD and branch the rescue worktree from that SHA, so copied dirty contents land on the same tree they were diffed against. The PR base branch on GitHub remains <base_branch> (dev) via --base. OMN-12635 (untracked-directory crash): the Step 2 copy loop called read_bytes() on each dirty path. git status --porcelain reports an untracked directory as a single entry (e.g. evidence/OMN-12584/); read_bytes() on a directory raises "[Errno 21] Is a directory" and the ship aborts with status=failed. Observed 2026-06-03 on onex_change_control (shipped manually). Fix: when a dirty path is a directory, recurse and copy every contained file with preserved relative paths. TDD: added test_worktree_based_on_canonical_head_not_origin_base and test_dirty_untracked_directory_is_expanded_to_files (both fail pre-fix), updated test_ship_calls_git_in_correct_sequence to assert the worktree branches from the canonical HEAD SHA (not origin/dev) and that rev-parse is invoked.
|
Warning Review limit reached
More reviews will be available in 12 minutes and 48 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
✅ Architectural Review — PASSEDErrors: 0 What this checks
No architectural violations found. Powered by node_pr_review_bot |
✅ PR Review Bot — CLEANFindings: 0
Verdict semantics
Powered by node_pr_review_bot — FSM pipeline with multi-model review fan-out |
|
| 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)
* ci(OMN-10475): wire zone-filter caller — skip heavy matrix on docs / declarative-evidence diffs Adds a `zone-filter` job at the head of ci.yml that calls the reusable workflow shipped in omnibase_core (OmniNode-ai/omnibase_core/.github/ workflows/zone-filter.yml@main). The four heaviest jobs gain `needs: zone-filter` plus `if: needs.zone-filter.outputs.docs_only != 'true'`: - typecheck (mypy --strict) - test (pytest) - e2e-workflow-runner (golden_chain_sweep E2E) - golden-chains (1000+ golden chain tests) `lint` (ruff + topic guards), `topic-naming-lint`, `runtime-sweep`, and `contract-compliance` continue to run on every PR. The `ci-summary` aggregator already accepts `skipped` (line ~340 in pre-existing logic), so docs-only PRs aggregate green even when the heavy jobs short-circuit. DOCS zone now covers `docs/`, `standards/`, plus the declarative-evidence trees `contracts/`, `drift/dod_receipts/`, `allowlists/`, and `.evidence/` (per OMN-10475 — see omnibase_core PR OmniNode-ai#1023). * ci(OMN-10475): pin zone-filter workflow
Evidence-Source: OCC#2119
Evidence-Ticket: OMN-12636
OCC contracts + DoD receipts: OmniNode-ai/onex_change_control#2119
Summary
Fixes two bugs in
HandlerDirtyCanonicalSweep(
src/omnimarket/nodes/node_dirty_canonical_sweep/handlers/handler_dirty_canonical_sweep.py),the backing node for
/onex:ship_dirty_canonical(epic OMN-7466).Tickets: OMN-12636 (primary) and OMN-12635 — both High, both in Active Sprint.
Bug 1 — stale-base diff (OMN-12636)
_ship_repocreated the rescue worktree fromorigin/<base_branch>(dev) andthen copied the canonical clone's dirty file contents onto that base.
git status --porcelainreports dirtiness relative to the clone's actualHEAD, not
origin/<base>. When the canonical clone is behind dev these tworeference points diverge, so the copy overwrites already-merged dev work and
produces a regressive partial PR.
Evidence (2026-06-03):
omnibase_infracanonical clone was 20 commitsbehind dev. The node produced PR #1845 with only 11 of 31 dirty files
(+50/-329) — reverting already-merged dev work — and had to be closed and
re-shipped as #1846. The -329 minus-heavy diff is the regression signature.
Fix: resolve the canonical clone's HEAD via
git rev-parse HEAD(new
_canonical_headhelper) and branch the rescue worktree from that SHA,so the copied dirty contents land on the same tree they were diffed against.
The PR base on GitHub stays
<base_branch>(dev) via--base— only theworktree's starting commit changed.
Bug 2 — untracked-directory crash (OMN-12635)
The Step 2 copy loop called
read_bytes()on each dirty path.git status --porcelainreports an untracked directory as a single entry(e.g.
evidence/OMN-12584/);read_bytes()on a directory raises[Errno 21] Is a directoryand the ship aborts withstatus="failed".Evidence (2026-06-03): observed on
onex_change_control(had an untrackedevidence/OMN-12584/dir) — the sweep crashed and the repo had to be shippedmanually.
Fix: when a dirty path is a directory, recurse (
rglob) and copy everycontained file with preserved relative paths. No directory ever has
read_bytes()called on it.dod_evidence
TDD red→green, both reproductions added first and confirmed failing pre-fix:
test_worktree_based_on_canonical_head_not_origin_base(OMN-12636) —asserts the worktree branches from the canonical HEAD SHA and not
origin/dev. Failed pre-fix (origin/devpresent), passes post-fix.test_dirty_untracked_directory_is_expanded_to_files(OMN-12635) —dirty set
?? evidence/OMN-12584/; failed pre-fix with the exact[Errno 21] Is a directoryerror andrepos_failed=1, now ships withrepos_shipped=1.test_ship_calls_git_in_correct_sequenceupdated to assertrev-parseisinvoked and the worktree uses the canonical HEAD SHA, not
origin/dev.Verification (worktree
omni_worktrees/OMN-12636/omnimarket):uv run pytest tests/unit/nodes/node_dirty_canonical_sweep/...— 6 passed.uv run pytest tests/ -m "not kafka"(CI's invocation) — 6011 passed,10 skipped. The only 4 failures are pre-existing
test_datasource_postgres.pyintegration tests that connect to
.201:5436; they skip cleanly whenOMNIDASH_ANALYTICS_DB_URLis unset (as in CI) and fail locally only due to astale local Postgres password — unrelated to this change.
uv run mypy src/omnimarket/nodes/node_dirty_canonical_sweep/ --strict— clean.uv run ruff format/ruff check --fix— clean.pre-commit run --files <changed>— all hooks pass.