Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions config/validation/handler_dispatch_entrypoint_baseline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ known_entrypointless:
- contract: node_model_health_effect
handler: HandlerProbeHealth
module: omnibase_infra.nodes.node_model_health_effect.handlers.handler_probe_health
- contract: node_model_router_compute
handler: HandlerScoreModels
module: omnibase_infra.nodes.node_model_router_compute.handlers.handler_score_models
- contract: node_registration_storage_effect
handler: HandlerRegistrationStorageMock
module: omnibase_infra.handlers.registration_storage.handler_registration_storage_mock
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"base_ref": "a87e5057f1b930c31bbad5e1e5fa215f962629d4",
"canonical_handler_module": "omnibase_infra.nodes.node_model_router_compute.handlers.handler_score_models",
"legacy_handler_module": "omnibase_infra.nodes.node_model_router_compute.handlers.handler_score_models",
"node_id": "omnibase_infra.nodes.node_model_router_compute",
"parity": {
"selected_input_hashes": [
"sha256:1fafe196504d954c7a2ceb4189e4c9ff9e943fd9508229435d403194b03d7d4b",
"sha256:95a94c4db487c77e3b6f8dac94d2237f6ba8e28257140e02b834eaad064e7f5b",
"sha256:69d42fd7417f1162362a63da06aa892156715e4fa6e2a2f38d3e61d747d5c043",
"sha256:eda6bf7ca95e765816dc81059d90033b86049cfb89652b2f1f2f5bde5b7467a8",
"sha256:b1b7f8d27abb387363e8d0410ab19e0f3ac795bff2bf58882a0cb43f99aa29ff",
"sha256:3307bfa257f8eb127f2b1e808778c660166132767b8631ebcaf6c39638220cdd",
"sha256:80038766312f579f667536cc061c1e3817257ba52fad6fa8dfc61e5c478c5776",
"sha256:45e9ecd1e409c4929e6d0f4c843d379c12419ff4d759fdb9ea391d677209a087",
"sha256:fded21763b6bee5d0dad438ff1db32f6591743fe5edd29a57f111ffec57dccf0"
],
"status": "pass",
"test_ids": [
"tests/unit/nodes/test_model_router/test_score_models_defb_omn14825.py::TestModelRouterDefBFlip::test_handle_entrypoint_exists",
"tests/unit/nodes/test_model_router/test_score_models_defb_omn14825.py::TestModelRouterDefBFlip::test_defb_handle_reproduces_legacy_goldens",
"tests/unit/nodes/test_model_router/test_score_models_defb_omn14825.py::TestModelRouterDefBFlip::test_golden_equivalence_is_non_vacuous"
]
},
"preserved_symbols": [
"_capability_match",
"_effective_cost_per_1k",
"_passes_hard_constraints",
"_compute_score",
"ScoringContext.__init__"
],
"receipt_schema": "handflip_proof.v1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"branch_coverage_pct": 74.13,
"candidate_count": 11,
"coverage_target": 80.0,
"handler_module": "omnibase_infra.nodes.node_model_router_compute.handlers.handler_score_models",
"handler_module_sha256": "sha256:01fb59552d3a6854d3600b8f3175f7deb2ff8ce518a9b2524034935ee1c2d7af",
"meets_target": false,
"node_id": "omnibase_infra.nodes.node_model_router_compute",
"receipt_schema": "adequacy_receipt.v1",
"recorded_at": "2026-07-20T05:22:00.905592+00:00",
"recorder_schema": "adequacy_receipt.v1",
"selected_count": 9,
"selected_input_hashes": [
"sha256:1fafe196504d954c7a2ceb4189e4c9ff9e943fd9508229435d403194b03d7d4b",
"sha256:95a94c4db487c77e3b6f8dac94d2237f6ba8e28257140e02b834eaad064e7f5b",
"sha256:69d42fd7417f1162362a63da06aa892156715e4fa6e2a2f38d3e61d747d5c043",
"sha256:eda6bf7ca95e765816dc81059d90033b86049cfb89652b2f1f2f5bde5b7467a8",
"sha256:b1b7f8d27abb387363e8d0410ab19e0f3ac795bff2bf58882a0cb43f99aa29ff",
"sha256:3307bfa257f8eb127f2b1e808778c660166132767b8631ebcaf6c39638220cdd",
"sha256:80038766312f579f667536cc061c1e3817257ba52fad6fa8dfc61e5c478c5776",
"sha256:45e9ecd1e409c4929e6d0f4c843d379c12419ff4d759fdb9ea391d677209a087",
"sha256:fded21763b6bee5d0dad438ff1db32f6591743fe5edd29a57f111ffec57dccf0"
],
"uncovered_waiver": {
"reason": "OMN-14825 hand-flips node_model_router_compute to canonical def-B via a PURE RENAME score_candidates->handle (OMN-14781 path). The scoring body and every module-level scoring helper (_capability_match/_effective_cost_per_1k/_passes_hard_constraints/_compute_score/ScoringContext) are byte-identical base_ref<->HEAD, re-derived from git by the ratchet; equivalence is proven by that git-verbatim preservation plus the green legacy-vs-def-B golden parity over the selected input corpus, not by a broad branch-coverage claim.",
"uncovered_branch_count": 0
},
"volatile_mask": []
}
1 change: 0 additions & 1 deletion scripts/ci/canonical_handler_shape_baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"omnibase_infra.nodes.node_merge_sweep_workflow_orchestrator",
"omnibase_infra.nodes.node_merge_sweep_workflow_reducer",
"omnibase_infra.nodes.node_model_health_effect",
"omnibase_infra.nodes.node_model_router_compute",
"omnibase_infra.nodes.node_node_graph_reducer",
"omnibase_infra.nodes.node_onboarding_orchestrator",
"omnibase_infra.nodes.node_pattern_lifecycle_effect",
Expand Down
10 changes: 7 additions & 3 deletions src/omnibase_infra/nodes/node_model_router_compute/contract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
#
# Tickets: OMN-7267, OMN-7841
#
# Related Tickets:
# - OMN-14825: HandlerScoreModels exposes the canonical def-B handle()
# dispatch entrypoint while preserving deterministic model scoring.
#
name: "node_model_router_compute"
node_type: "COMPUTE_GENERIC"
contract_version:
major: 1
minor: 0
patch: 1
node_version: "1.0.1"
description: "Pure scoring of candidate models by quality, measured cost tier, live speed metrics, and availability."
patch: 2
node_version: "1.0.2"
description: "Pure scoring of candidate models by quality, measured cost tier, live speed metrics, and availability. Contract patch 2 records the OMN-14825 canonical def-B handler entrypoint flip while preserving deterministic model scoring."
input_model:
name: "ModelScoringInput"
module: "omnibase_infra.nodes.node_model_router_compute.models.model_scoring_input"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ def handler_type(self) -> EnumHandlerType:
def handler_category(self) -> EnumHandlerTypeCategory:
return EnumHandlerTypeCategory.COMPUTE

def score_candidates(
self, scoring_input: ModelScoringInput
) -> ModelRoutingDecision:
def handle(self, scoring_input: ModelScoringInput) -> ModelRoutingDecision:
health_map: dict[str, ModelEndpointHealth] = {
e.model_key: e for e in scoring_input.health
}
Expand Down
2 changes: 1 addition & 1 deletion src/omnibase_infra/services/routing_api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async def route_request(body: ModelRouteRequestBody) -> ModelRoutingDecision:
)

handler = HandlerScoreModels()
decision = handler.score_candidates(scoring_input)
decision = handler.handle(scoring_input)

if not decision.success:
raise HTTPException(
Expand Down
17 changes: 17 additions & 0 deletions src/omnibase_infra/validation/validation_exemptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,23 @@ pattern_exemptions:
- CLAUDE.md (ONEX Architecture - canonical def-B handler entrypoint, OMN-14355)
ticket: OMN-14805
# ==========================================================================
# Canonical def-B handler dispatch entrypoint (OMN-14355 / OMN-14825)
# ==========================================================================
# `handle` is the ProtocolMessageHandler dispatch entrypoint that auto-wiring's
# _make_dispatch_callback binds (definition B, operator-locked OMN-14355). It is a
# protocol-defined name, not a candidate for domain-specific renaming. The generic-
# pattern checker only misses the equivalent `handle` on other canonical handlers
# because it visits ast.FunctionDef but not ast.AsyncFunctionDef; a SYNCHRONOUS def-B
# handle is equally canonical and equally mandated.
- file_pattern: 'node_model_router_compute/handlers/handler_score_models\.py'
violation_pattern: "Function name 'handle' is too generic"
reason: >
OMN-14825 hand-flip to canonical def-B: handle(scoring_input: ModelScoringInput) -> ModelRoutingDecision is the architecturally-mandated dispatch entrypoint that auto-wiring binds (definition B, OMN-14355). The name is protocol-defined; renaming it would break the canonical shape this flip establishes.

documentation:
- CLAUDE.md (ONEX Architecture - canonical def-B handler entrypoint, OMN-14355)
ticket: OMN-14825
# ==========================================================================
# RuntimeHostProcess Exemptions (OMN-756)
# ==========================================================================
# Central coordinator class that legitimately requires multiple methods for:
Expand Down
Loading
Loading