Repository navigation
fix(OMN-14141): fail-closed guard + CI gate for handler_routing flat-schema silent-zero-parse - #2235
Conversation
…schema silent-zero-parse The flat handler_class:/handler_module: schema silently parsed to zero handlers, then auto-wiring reported WIRED with zero dispatchers while still subscribing to and committing Kafka offsets on the topic — silent phantom-wiring (the WI-14 root cause, OMN-14139/OMN-14135). Enforcement (CLAUDE.md Rule #5 — gate ships WITH the fixes): - Guard A (parse-time): discovery._parse_handler_routing raises on a flat/ malformed handlers[] entry instead of silently skipping it. Legacy top-level handler: fallback preserved (empty handlers list never raises). - Guard B (wire-time): _commit_contract_wiring reports FAILED (not WIRED) and does NOT subscribe when a contract declares subscribe topics but registers zero dispatchers. Never fires on legacy fallbacks (>=1 dispatcher) or resolver-ownership/quarantine skips. - CI gate + pre-commit hook: handler_routing_schema validator rejects flat entries across all node contracts (SYNC'd ci.yml step + pre-commit hook). Contract fixes (7 infra contracts the gate would reject; ledger done in #2234): node_savings_estimation_compute, node_build_loop_write_effect, node_session_state_effect, node_pattern_lifecycle_effect, node_validation_executor, node_decision_store_query_compute, node_baseline_comparison_compute. Verified: 111/111 contracts discover with zero errors; Guard B fires on zero real contracts; 354 auto-wiring/kernel tests + 11 new guard tests green. Follow-up (separate PR): 3 omnimarket flat-schema contracts + omnimarket-side gate.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 58 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 (14)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…losed-guard-ci-gate-for-contract-handler_routing-flat
Summary
Systemic enforcement for the contract handler_routing flat-schema silent-zero-parse defect class — the root cause behind the WI-14 saga (OMN-14139 / OMN-14135).
The defect (two-stage silent failure):
runtime/auto_wiring/discovery.py::_parse_handler_routingsilently skipped anyhandler_routing.handlers[]entry using the flathandler_class:/handler_module:keys instead of the nestedhandler: {name, module}dict — producinghandlers=()with no error.handler_wiring.py::_commit_contract_wiringthen reportedEnumWiringOutcome.WIREDwith zero dispatchers while still subscribing to and committing Kafka offsets on the topic — silent phantom-wiring (topic looks consumed, no handler ever runs).Enforcement (CLAUDE.md Rule #5 — gate ships WITH the fixes, wired as CI gate + pre-commit in the same PR)
_parse_handler_routingnow raisesValueErroron a flat/malformedhandlers[]entry instead of silently skipping it. The legacy top-levelhandler: {module, class}fallback is preserved (an empty/absenthandlerslist never raises)._commit_contract_wiringreturns FAILED (not WIRED) and does not subscribe when a contract declares subscribe topics but registers zero dispatchers. It never fires on legacy fallbacks (they produce ≥1 dispatcher) or on resolver-ownership / quarantine skips.omnibase_infra.validators.handler_routing_schemascans every nodecontract.yamland rejects flat entries. Wired asci.ymlstep "handler_routing flat-schema gate (OMN-14141)" + pre-commit hookhandler-routing-schema-gate, alongside the existing operation_match gate.Contract fixes (7 infra contracts the gate would reject)
Converted flat
handler_class/handler_module→ nestedhandler: {name, module}(routing semantics preserved;node_ledger_write_effectalready fixed in #2234):node_savings_estimation_compute,node_build_loop_write_effect,node_session_state_effect,node_pattern_lifecycle_effect,node_validation_executor,node_decision_store_query_compute,node_baseline_comparison_compute.Verification (dod_evidence)
wire_from_manifestover all node contracts: Guard B fires on zero real contracts (only on a synthetic phantom fixture).batch_validate_node_contracts.py: 111/111 passed. operation_match gate, published_events consistency, yamlfmt: green.tests/unit/runtime/auto_wiring/test_handler_routing_flat_schema_guard.py) green.pre-commit(all hooks) green on commit; ruff format/check + mypy clean.Follow-up (separate PR, out of scope here)
3 omnimarket flat-schema contracts + the omnimarket-side gate.
Closes OMN-14141
Evidence-Ticket: OMN-14141
Evidence-Source: OCC#3701