Repository navigation
fix(OMN-13521): batch doc-freshness resolver to O(repos) + time-budget guard - #2952
Conversation
…guard The doc_freshness_sweep resolver ran one grep -r subprocess per class/function reference per repo-root (O(refs x roots)). On the real 11-repo set that is tens of thousands of serial greps; a live sweep was still grepping at >70 min wall time with no terminal result. Batch class/function resolution: build an in-memory symbol index once per repo-root (one os.walk over each src/ tree, nested worktrees / .venv pruned in place) and resolve every reference against the prebuilt index in pure Python. No subprocess is spawned during resolution. Add a wall-clock time_budget_seconds guard (default 120s): once exhausted the resolver returns the remaining references marked exists=None (fail-loud, bounded) instead of running unbounded. Backward-compatible signature: resolve_references(references, repo_roots, env_file=None, time_budget_seconds=120.0). Benchmark on the real 10-repo set: 22,062 refs (3,588 class/func) resolved in 4.1s; collect+extract+resolve total 12.0s (was >70 min with no result). TDD: tests/unit/test_doc_reference_resolver.py pins index-backed resolution, no-subprocess guard, single-index-build-per-root, and the budget guard.
…-ref resolver contracts/OMN-13521.yaml + drift/dod_receipts/OMN-13521/ (dod-001 resolver unit tests + lint/mypy, dod-002 real-repo benchmark, dod-occ-pr contract presence). Receipt Honesty + Hardening gates pass; receipts bind the current contract hash; verifier (claude-code-review) distinct from runner (claude-code).
|
Warning Review limit reached
More reviews will be available in 2 minutes and 30 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. 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 (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…y) for omnimarket deploy-gate The omnimarket PR touches a runtime path (handler_doc_freshness_sweep.py); the deploy-gate requires the cited ticket's OCC contract to carry a deploy-flavored dod_evidence item. doc_freshness_sweep is a COMPUTE-only skill run in-process via 'onex skill' — no live deploy/restart/docker-exec/rpk needed before merge. Add dod-deploy-assessment + matching PASS receipt; rebind all receipts to the updated contract hash.
…MN-16755 binding Two corrections to the autobind output on this companion. 1. DROPPED contracts/OMN-16755.yaml and its three receipts. The autobind bound OMN-16755 because that ticket id appears in omnibase_infra#2952's prose -- the PR cites it as the SOURCE of the finding, not as work it closes. OMN-16755's own ACs are about a gateway link-health bus hop, and its premise was falsified on 2026-08-27T20:21Z (the chain routes in-process and is alive). #2952 satisfies none of them. Left in place, that contract is a live false-autoclose hazard: the evidence-autoclose sweep would have read three passing surrogates against OMN-16755 and had grounds to flip a ticket whose real work is untouched. Removing the binding is the honest state; OMN-16755 keeps its own separate disposition. 2. ADDED a BEHAVIOR-PROVING evidence item to OMN-16813. The three autobind items are all surrogates and would leave behavior_proving_count = 0: - two BYTE-IDENTICAL file-content greps (static inspection, and they grep a class NAME rather than any assertion, so they pass on a file whose tests were all deleted), - one foreign suite (tests/test_evidence_admissibility.py, this repo's own), - one bare PR-state read. None executes the chain the ticket is about. The new item runs the actual suite -- the same command the required `Event Chain Gate` CI job runs. RECEIPT IS ADVERSARIAL, runner != verifier (OMN-12791). My first attempt set both to this lane and the receipt-honesty gate correctly rejected it as SELF_ATTESTATION. The independent verifier is GitHub Actions' own required `Event Chain Gate` job 98727318636 (run 33133247111, conclusion=success) on omnibase_infra#2952, whose log is reproduced verbatim in probe_stdout: test_intent_arm_reaches_the_real_effect_handler .................... PASSED test_a_dead_intent_leg_is_invisible_on_every_topic_the_gate_watches PASSED test_missing_intent_executor_refuses_rather_than_publishing_a_terminal PASSED test_validation_is_what_keeps_the_executors_silent_drop_unreachable PASSED 8 passed in 1.22s check_value carries a `repos/OmniNode-ai/omnibase_infra/tree/<sha>` reference because commit_sha is an omnibase_infra commit and COMMIT_SHA_EXISTS cannot resolve it in this repo -- also caught by the gate on the first attempt, not assumed. Existing receipts are unaffected: contract_entry_sha256 is per-entry (OMN-13888) and authoritative when present, so appending an item does not unbind them. Verified: check_receipt_hardening.py exit 0; pre-commit clean on both files. Evidence-Ticket: OMN-16813
#7353) * evidence: OCC companion pass 1 for OmniNode-ai/omnibase_infra#2952 * evidence: OCC companion self-bind for #7353 * evidence(OMN-16813): behavior-proving check, and drop the incorrect OMN-16755 binding Two corrections to the autobind output on this companion. 1. DROPPED contracts/OMN-16755.yaml and its three receipts. The autobind bound OMN-16755 because that ticket id appears in omnibase_infra#2952's prose -- the PR cites it as the SOURCE of the finding, not as work it closes. OMN-16755's own ACs are about a gateway link-health bus hop, and its premise was falsified on 2026-08-27T20:21Z (the chain routes in-process and is alive). #2952 satisfies none of them. Left in place, that contract is a live false-autoclose hazard: the evidence-autoclose sweep would have read three passing surrogates against OMN-16755 and had grounds to flip a ticket whose real work is untouched. Removing the binding is the honest state; OMN-16755 keeps its own separate disposition. 2. ADDED a BEHAVIOR-PROVING evidence item to OMN-16813. The three autobind items are all surrogates and would leave behavior_proving_count = 0: - two BYTE-IDENTICAL file-content greps (static inspection, and they grep a class NAME rather than any assertion, so they pass on a file whose tests were all deleted), - one foreign suite (tests/test_evidence_admissibility.py, this repo's own), - one bare PR-state read. None executes the chain the ticket is about. The new item runs the actual suite -- the same command the required `Event Chain Gate` CI job runs. RECEIPT IS ADVERSARIAL, runner != verifier (OMN-12791). My first attempt set both to this lane and the receipt-honesty gate correctly rejected it as SELF_ATTESTATION. The independent verifier is GitHub Actions' own required `Event Chain Gate` job 98727318636 (run 33133247111, conclusion=success) on omnibase_infra#2952, whose log is reproduced verbatim in probe_stdout: test_intent_arm_reaches_the_real_effect_handler .................... PASSED test_a_dead_intent_leg_is_invisible_on_every_topic_the_gate_watches PASSED test_missing_intent_executor_refuses_rather_than_publishing_a_terminal PASSED test_validation_is_what_keeps_the_executors_silent_drop_unreachable PASSED 8 passed in 1.22s check_value carries a `repos/OmniNode-ai/omnibase_infra/tree/<sha>` reference because commit_sha is an omnibase_infra commit and COMMIT_SHA_EXISTS cannot resolve it in this repo -- also caught by the gate on the first attempt, not assumed. Existing receipts are unaffected: contract_entry_sha256 is per-entry (OMN-13888) and authoritative when present, so appending an item does not unbind them. Verified: check_receipt_hardening.py exit 0; pre-commit clean on both files. Evidence-Ticket: OMN-16813 * evidence(OMN-16813): name the receipt for its check_type so the eligibility gate resolves it The receipt id validator_occ_merge_eligibility looks for is <ticket>:<evidence_item_id>:<check_type>, and it resolves the file by check_type name -- command.yaml for check_type: command, test_passes.yaml for check_type: test_passes. The autobind only ever emits command receipts, so the new behavior-proving item (check_type: test_passes) was written to command.yaml by pattern-matching its siblings, and the gate correctly reported: missing_or_nonpass_receipts: ["OMN-16813:dod-behavior-intent-arm-chain-gate:test_passes"] Renamed, not re-typed. Downgrading the check to check_type: command to match the filename would have made the gate pass while turning the only behavior-proving leg back into a surrogate -- which is the whole defect this item exists to fix. Content unchanged; check_receipt_hardening.py still exits 0 (contract_entry_sha256 binds the entry, not the path). Evidence-Ticket: OMN-16813 --------- Co-authored-by: node-occ-companion-effect <occ-companion-effect@omninode.ai> Co-authored-by: jonahgabriel <jonah@omninode.ai>
OMN-13521 — doc_freshness_sweep resolver: O(refs x repos) serial grep, non-terminating
Fixes the primary root cause of OMN-13521: the
/onex:doc_freshness_sweepskill never completed (a background run was still grepping at >70 min wall time / ~28s CPU with no terminal result).Root cause
doc_reference_resolver._resolve_class_or_functionran onegrep -r -lsubprocess per class/function reference per repo-root — O(total_refs × repo_roots) serial subprocess spawns, each scanning entiresrc/trees, each with a 10s timeout. With tens of thousands of references across the repo set, wall time was dominated by subprocess + filesystem latency.Fix
os.walkover eachsrc/tree, nested-worktree /.venv/ generated dirs pruned in place), then resolve every class/function reference in pure Python against the prebuilt index. No subprocess is spawned during resolution. Cost drops from O(refs × roots) subprocess spawns to O(roots) tree walks + O(refs) dict lookups.time_budget_secondsparameter (default 120s); once the wall-clock budget is exhausted, remaining references are returnedexists=None(fail-loud, bounded) rather than running unbounded. Backward-compatible signature:resolve_references(references, repo_roots, env_file=None, time_budget_seconds=120.0).The nested-worktree exclusion that amplified this is fixed in the paired omnimarket PR.
Evidence (dod_evidence — verified)
tests/unit/test_doc_reference_resolver.py10/10 — including a no-subprocess guard (patches stdlibsubprocess.runto raise), single-index-build-per-root, and the budget guard.test_doc_freshness.py42/42 unchanged; full unit suite 910 passed / 32 skipped. ruff + mypy --strict clean.exists=Truevia the index.OCC contract + PASS receipts carried in this PR:
contracts/OMN-13521.yaml+drift/dod_receipts/OMN-13521/.Ticket: OMN-13521
Evidence-Ticket: OMN-13521