M02: Routing core, policy, and client-requirement binding for executable targets #87
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
P1
P2
P3
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#88 M03: OpenAI-compatible gateway and execution coordinator
Creatidy/scarcity-router
#95 M10: Distribution, installation, update, and end-to-end acceptance
Creatidy/scarcity-router
#85 A0: Architecture, decisions, and contracts for the optional execution gateway
Creatidy/scarcity-router
Reference
Creatidy/scarcity-router#87
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Use the existing selector/routing logic to choose an authorized executable target — not merely a model name — as a pure, deterministic decision layer.
Module of the execution-gateway program; architecture and contracts come from A0 (#85).
User value
A client that speaks only
base_url/api_key/modelstill gets the full least-scarce-capable discipline: multidimensional requirements, execution-surface availability, authorization, spending limits, promotions and decision provenance — with no silent model substitution.Relationship to current code
scarcity_router/selector.py(balanced pipeline,CandidateEvaluation,EXCLUSION_STAGESincluding the D-039executionstage),policy.py,selection_types.py(TaskRequirement, task/evaluation profiles per D-038),scarcity.pyandselection_app.py.Scope
base_url/api_key/model, but never replace the full requirement contract; reuse the existing task/profile model — no second simplified scoring system, no mandatory LLM request classifier.selectrecommendation can be executed through the gateway without an unexpected second routing decision.Non-goals
Contracts / interfaces affected
Route-decision contract (new, A0);
/v1/selectsemantics preserved or deliberately version-migrated (never silently changed); decision provenance fields additive under machine-interface v1 rules.Dependencies
Acceptance criteria
select/simulatesemantics preserved or deliberately version-migrated.uv sync --only-dev && make check && uv run basedpyright && git diff --check).Security considerations
Authorization and spending limits are core inputs; the core parses strictly and stays safe against hostile client input. No credential or endpoint handling exists in the core.
Risks
Evidence still required
Closeout (v0.1.0 release-readiness reconciliation, 2026-09-21). M02 is implemented and its acceptance criteria are satisfied on
develop@9d6192e.scarcity_router/routing_core.py(schema_version = 1): the pureroute_requestcore layers requirement binding, authorization and execution-surface gates on the unmodified balanced selector;admit_pinned_targetperforms recommendation-to-execution admission without re-ranking, with exactPinnedTargetidentity (a no-longer-bound identity is the typedpinned_model_not_boundrejection, never substitution).tests/test_routing_core.py(56 tests):test_shared_quota_pool_is_not_independent_capacity,test_explicit_target_pin_is_honored_exactly,test_violating_target_pin_fails_explicitly_without_substitution,test_client_authorization_cannot_expand_administrator_constraints,test_only_unavailable_worker_is_an_explicit_no_solution,test_tool_calling_requirement_routes_to_a_compatible_surface,test_missing_cells_fail_closed_to_an_explicit_no_solution,test_unknown_profile_fails_explicitly. Determinism and quota-never-raises-capability remain pinned by the selector suites; frozenselect/simulatesemantics are guarded by the M08 parity/guardrail suites.make check1868 tests OK,uv run basedpyright0 findings,git diff --check,make guardrails(40 tests),make package-check— plus Forgejo CIcheckgreen ondevelop(run #25).Closing as complete;
docs/roadmap.mdnow records M02 complete.