Skip to content

feat(OMN-13191): resolve delegation topics via ServiceTopicRegistry in dispatch result applier - #2005

Merged
jonahgabriel merged 3 commits into
devfrom
jonah/omn-13191-infra-registry-keys
Jun 17, 2026
Merged

jonahgabriel merged 3 commits into
devfrom
jonah/omn-13191-infra-registry-keys

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Jun 17, 2026 •

Copy link
Copy Markdown
Collaborator

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.py previously imported 4 TOPIC_DELEGATION_*
constants from event_bus/topic_constants.py to build _DELEGATION_INTENT_TOPIC_BY_CLASS.
It now resolves each through ServiceTopicRegistry.from_defaults() (the OMN-5839
contract-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:

File Added
topics/topic_keys.py 13 DELEGATION_* logical keys + __all__
topics/platform_topic_suffixes.py 13 SUFFIX_DELEGATION_* constants + 13 ModelTopicSpec provisioned entries
topics/service_topic_registry.py 13 from_defaults() key→suffix mappings
topics/__init__.py 13 SUFFIX_DELEGATION_* re-exports

The 4 the applier resolves are DELEGATION_BASELINE_COMPARISON,
DELEGATION_INFERENCE_REQUEST, DELEGATION_QUALITY_GATE_REQUEST,
DELEGATION_ROUTING_REQUEST. ModelInvocationCommand keeps its existing
EnumOmnibaseInfraTopic.CMD_REMOTE_AGENT_INVOKE_V1 source (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 omnimarket node_delegation_orchestrator/contract.yaml.
  • test_applier_imports_no_topic_constants — regression guard: the applier source imports no TOPIC_*.

Live equality (4 applier topics), each registry == constant == contract:

ModelBaselineIntent    -> onex.cmd.omnibase-infra.baseline-comparison-request.v1     (declared in node_delegation_orchestrator/contract.yaml)
ModelInferenceIntent   -> onex.cmd.omnibase-infra.delegation-inference-request.v1    (declared)
ModelQualityGateIntent -> onex.cmd.omnibase-infra.delegation-quality-gate-request.v1 (declared)
ModelRoutingIntent     -> onex.cmd.omnibase-infra.delegation-routing-request.v1      (declared)

All 13 registry==constant pairs verified equal (13/13, 0 mismatch).

2. Applier imports zero TOPIC_*:

$ grep -E 'from omnibase_infra.event_bus.topic_constants import|TOPIC_DELEGATION_' \
    src/omnibase_infra/runtime/service_dispatch_result_applier.py
(no match)

3. Both topic gates green:

$ uv run python scripts/validation/check_topic_literals.py
OK: No new raw topic literals found in 2416 file(s) (9 pre-existing violations suppressed)

$ pre-commit run no-hardcoded-topics --files <changed files>
No hardcoded ONEX topic strings..........................................Passed

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
TestDelegationIntentTopicRouting regression (unchanged behavior) and the new
TestDelegationTopicRegistryNoDrift. The 14 failed + 79 errored tests are all under
tests/integration/ (db, dlq, dispatch-roundtrip, node-registration, runtime-health) and
tests/performance/ (LLM SLO) — they require live PostgreSQL / Kafka / runtime containers /
LLM endpoints not running on the local Mac; they fail identically on unmodified origin/dev
and are environment-dependent, not regressions from this PR.

6. Local gates: ruff format + ruff check --fix clean; mypy src/ --strict clean
(2442 files); pre-commit run on 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 from ci.yml)
exits 1 on 25 pre-existing python-only gaps (build-loop, effectiveness, omniclaude
observability, omniweb, etc.) that are red on unmodified origin/dev and are out of scope
for A2. My 13 delegation topics are added to its _LEGACY_ALLOWLIST with structured
contract.yaml in omnimarket repo (cross-repo provisioning) reasons — the gate's own
sanctioned mechanism, mirroring the existing omniintelligence cross-repo entries. The
parity scanner reads only omnibase_infra/nodes, so the omnimarket-owned delegation
contracts are structurally invisible to it; the real contract source is proven by the
no-drift test above. No skip token, no --no-verify.

…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).
@coderabbitai

coderabbitai Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@jonahgabriel, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8ba27f57-efd8-428e-908b-c3f007bfc3c1

📥 Commits

Reviewing files that changed from the base of the PR and between 1c1a5b1 and 4884dfc.

📒 Files selected for processing (8)
  • contracts/OMN-13191.yaml
  • scripts/check_contract_topic_parity.py
  • src/omnibase_infra/runtime/service_dispatch_result_applier.py
  • src/omnibase_infra/topics/__init__.py
  • src/omnibase_infra/topics/platform_topic_suffixes.py
  • src/omnibase_infra/topics/service_topic_registry.py
  • src/omnibase_infra/topics/topic_keys.py
  • tests/unit/runtime/test_dispatch_result_applier_topic_routing.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-13191-infra-registry-keys

Comment @coderabbitai help to get the list of available commands and usage tips.

@jonahgabriel
jonahgabriel added this pull request to the merge queue Jun 17, 2026
Merged via the queue into dev with commit e2505b9 Jun 17, 2026
78 of 80 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-13191-infra-registry-keys branch June 17, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant