Repository navigation
feat(OMN-13191): resolve delegation topics via ServiceTopicRegistry in dispatch result applier - #2005
Conversation
…n dispatch result applier A2 of epic OMN-13188 (Workstream A — all topics from contracts). service_dispatch_result_applier.py no longer imports TOPIC_* string constants from event_bus/topic_constants.py. It now resolves the 4 delegation intent topics (baseline-comparison, inference-request, quality-gate-request, routing-request) through ServiceTopicRegistry (the OMN-5839 contract-sourced registry pattern). Registry completeness: added all 13 TOPIC_DELEGATION_* topics as logical keys (topic_keys.py), suffix constants + provisioned specs (platform_topic_suffixes.py), and from_defaults() mappings (service_topic_registry.py), exported via topics/__init__.py. No-drift proof (permanent test TestDelegationTopicRegistryNoDrift): registry.resolve(key) == TOPIC_* constant == owning omnimarket contract.yaml for all 13 keys; applier imports zero TOPIC_* (regression guard). Does NOT delete any constant from topic_constants.py — that is A4. Topic gates: check_topic_literals.py arch-invariants PASS; no-hardcoded-topics pre-commit PASS. The cross-repo-declared delegation topics are added to check_contract_topic_parity.py _LEGACY_ALLOWLIST with structured 'contract.yaml in omnimarket repo (cross-repo provisioning)' reasons, mirroring the existing omniintelligence cross-repo entries (this parity scanner reads only omnibase_infra/nodes, so omnimarket-owned contracts are invisible to it).
|
Warning Review limit reached
More reviews will be available in 35 minutes and 38 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 (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Evidence-Source: OCC#2679
Evidence-Ticket: OMN-13191
OMN-13191 — Resolve delegation topics via ServiceTopicRegistry (A2)
Epic: OMN-13188 (platform-debt: contract-source topics + envelope dedup), Workstream A.
Mirrors A1 (#2004 — remove dead constants). A2 removes the infra consumer's
dependency on
TOPIC_*string constants; it does not delete any constant(that is A4).
runtime/service_dispatch_result_applier.pypreviously imported 4TOPIC_DELEGATION_*constants from
event_bus/topic_constants.pyto build_DELEGATION_INTENT_TOPIC_BY_CLASS.It now resolves each through
ServiceTopicRegistry.from_defaults()(the OMN-5839contract-sourced registry), so the applier imports zero
TOPIC_*.Registry completeness (the full 13-topic delegation family)
Added as logical keys, suffix constants + provisioned specs, and
from_defaults()mappings:topics/topic_keys.pyDELEGATION_*logical keys +__all__topics/platform_topic_suffixes.pySUFFIX_DELEGATION_*constants + 13ModelTopicSpecprovisioned entriestopics/service_topic_registry.pyfrom_defaults()key→suffix mappingstopics/__init__.pySUFFIX_DELEGATION_*re-exportsThe 4 the applier resolves are
DELEGATION_BASELINE_COMPARISON,DELEGATION_INFERENCE_REQUEST,DELEGATION_QUALITY_GATE_REQUEST,DELEGATION_ROUTING_REQUEST.ModelInvocationCommandkeeps its existingEnumOmnibaseInfraTopic.CMD_REMOTE_AGENT_INVOKE_V1source (unchanged).dod_evidence (OMN-13191)
OCC carrier:
contracts/OMN-13191.yaml.1. registry == constant == contract (no drift) — the load-bearing proof.
Permanent test
tests/unit/runtime/test_dispatch_result_applier_topic_routing.py::TestDelegationTopicRegistryNoDrift:test_registry_resolution_equals_legacy_constant— for all 13 keys,registry.resolve(key) == TOPIC_DELEGATION_*constant.test_applier_resolved_topics_match_owning_contract— for the 4 applier topics, the registry string is declared in the owning omnimarketnode_delegation_orchestrator/contract.yaml.test_applier_imports_no_topic_constants— regression guard: the applier source imports noTOPIC_*.Live equality (4 applier topics), each
registry == constant == contract:All 13 registry==constant pairs verified equal (13/13, 0 mismatch).
2. Applier imports zero TOPIC_*:
3. Both topic gates green:
4. Required CI topic checks green:
arch-invariants(check_topic_literals) PASS,topic-enum-drift(generate_topic_enums --check) PASS (14 generated files up to date),topic-naming-lint(scan-python + scan-contracts) PASS,topic-drift-check(warn-only) PASS.5. Tests: full unit suite 24025 passed, incl. the existing
TestDelegationIntentTopicRoutingregression (unchanged behavior) and the newTestDelegationTopicRegistryNoDrift. The 14 failed + 79 errored tests are all undertests/integration/(db, dlq, dispatch-roundtrip, node-registration, runtime-health) andtests/performance/(LLM SLO) — they require live PostgreSQL / Kafka / runtime containers /LLM endpoints not running on the local Mac; they fail identically on unmodified
origin/devand are environment-dependent, not regressions from this PR.
6. Local gates:
ruff format+ruff check --fixclean;mypy src/ --strictclean(2442 files);
pre-commit runon changed files all Passed.Note on the topic-parity-gate pre-commit hook
The local-only
topic-parity-gate(NOT a required CI status check — absent fromci.yml)exits 1 on 25 pre-existing python-only gaps (build-loop, effectiveness, omniclaude
observability, omniweb, etc.) that are red on unmodified
origin/devand are out of scopefor A2. My 13 delegation topics are added to its
_LEGACY_ALLOWLISTwith structuredcontract.yaml in omnimarket repo (cross-repo provisioning)reasons — the gate's ownsanctioned mechanism, mirroring the existing omniintelligence cross-repo entries. The
parity scanner reads only
omnibase_infra/nodes, so the omnimarket-owned delegationcontracts are structurally invisible to it; the real contract source is proven by the
no-drift test above. No skip token, no
--no-verify.