Repository navigation
refactor(OMN-13944): relocate stray topic literals into canonical registries (omnibase_infra) - #2212
Conversation
…istries (omnibase_infra)
Clears all 80 hardcoded-topics aislop-sweep findings in omnibase_infra to 0
without changing any wire topic string value.
Changes:
- event_bus/topic_constants.py: doctest continuation lines showing topic
literals converted to RST double-backticks (docstring example only,
testpaths is tests/ only so src/ doctests are never executed).
- runtime/models/model_projector_notification_config.py,
runtime/models/model_transition_notification_publisher_metrics.py,
runtime/publisher_topic_scoped.py,
runtime/transition_notification_publisher.py: same backtick treatment for
docstring/doctest examples showing "onex.fsm.state.transitions.v1".
- topics/contract_topic_extractor.py: YAML-shaped docstring examples
converted to backticks.
- services/cost_api/snapshot_cache.py: added `# onex-topic-sot` file-level
marker — this module IS the canonical registry for the three cost-snapshot
projection topic constants it defines.
- services/observability/agent_actions/tests/{test_consumer.py,
test_hardening.py, test_routing_decision_schema_handshake.py}: true
relocation — imported the existing SUFFIX_OMNICLAUDE_* constants from
omnibase_infra.topics.platform_topic_suffixes and replaced 57 duplicate
inline topic literals with references to them (no more test-fixture
markers needed since canonical constants already existed for every
literal used).
dod_evidence (OMN-13944):
- hardcoded-topics scanner: 80 findings -> 0 findings (self-verify replica
of node_aislop_sweep._check_hardcoded_topics)
- ruff format + ruff check --fix: clean on all 10 changed files
- mypy --strict on 7 changed non-test src files: Success, no issues
- pytest targeted: 94/94 passed (test_consumer.py +
test_routing_decision_schema_handshake.py), 120/124 passed in
test_hardening.py (4 pre-existing failures reproduced identically on
unmodified dev HEAD — missing OMNIBASE_INFRA_AGENT_ACTIONS_KAFKA_BOOTSTRAP_SERVERS
env var in this shell, unrelated to this change)
- pytest tests/unit (full unit suite, 21109 tests): 21071 passed, 9 failed
(pre-existing perf-benchmark timing flakiness + unrelated
test_provision_infisical.py failures, none touching changed files), 29
skipped
- pre-commit run --files <changed>: all hooks passed, including "Check for
AI-slop patterns" and "No hardcoded ONEX topic strings"
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 54 minutes 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 (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Auto-merged by merge-sweep | correlation_id: |
2 similar comments
|
Auto-merged by merge-sweep | correlation_id: |
|
Auto-merged by merge-sweep | correlation_id: |
Summary
Clears the aislop-sweep
hardcoded-topicscheck foromnibase_infrafrom 80 findings to 0, without changing any wire topic string value (OMN-13944).Per-file changes
event_bus/topic_constants.py(3)onex.evt.*literals converted to RST double-backticks. Docstrings only —testpaths=["tests"]meanssrc/doctests are never collected/executed, so this is purely cosmetic for the detector.runtime/models/model_projector_notification_config.py(4)onex.fsm.state.transitions.v1.runtime/models/model_transition_notification_publisher_metrics.py(2)runtime/publisher_topic_scoped.py(2)Example Usagefenced code block).runtime/transition_notification_publisher.py(2)services/cost_api/snapshot_cache.py(3)# onex-topic-sotmarker — this module is the canonical registry forTOPIC_COST_SUMMARY/TOPIC_COST_BY_REPO/TOPIC_COST_TOKEN_USAGE, so the definitions are the source of truth, not stray literals.topics/contract_topic_extractor.py(7)services/observability/agent_actions/tests/test_consumer.py(50)SUFFIX_OMNICLAUDE_*constants fromomnibase_infra.topics.platform_topic_suffixesand replaced all inline literal usages with references.services/observability/agent_actions/tests/test_hardening.py(6)SUFFIX_OMNICLAUDE_AGENT_ACTIONS,SUFFIX_OMNICLAUDE_AGENT_ACTIONS_DLQ,SUFFIX_OMNICLAUDE_ROUTING_DECISION.services/observability/agent_actions/tests/test_routing_decision_schema_handshake.py(1)SUFFIX_OMNICLAUDE_ROUTING_DECISION.No topic wire value was changed anywhere in this diff — only where/how the literal is expressed in source.
dod_evidence (OMN-13944)
node_aislop_sweep._check_hardcoded_topics): 80 findings → 0 findings.Success: no issues found in 7 source files.test_consumer.py+test_routing_decision_schema_handshake.py— 94/94 passed.test_hardening.py— 120/124 passed; the 4 failures (TestDLQConfiguration,TestHealthCheckHostDefault) reproduce identically on unmodifieddevHEAD (missingOMNIBASE_INFRA_AGENT_ACTIONS_KAFKA_BOOTSTRAP_SERVERSenv var in this shell) — pre-existing, unrelated to this change.pytest tests/unit, 21109 tests): 21071 passed, 9 failed (pre-existing perf-benchmark timing flakiness intest_mixin_node_introspection.py/test_handler_bootstrap_source.py/test_policy_registry_performance.py, plus unrelatedtest_provision_infisical.pyfailures — none touch files changed in this PR), 29 skipped.<changed>: all hooks passed, including "Check for AI-slop patterns" and "No hardcoded ONEX topic strings".Test plan
ruff format/ruff check --fixcleanmypy --strictclean on changed src filestests/unitsuite run: no new failures introducedpre-commit run --files <changed>all greenEvidence-Source: OCC#3623
Evidence-Ticket: OMN-13944