feat(selection): execution-eligibility contract and pre-routing provider exclusion (D-039, issue #82) #83
No reviewers
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Creatidy/scarcity-router!83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/openai-subscription-eligibility"
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?
Implements BioMedical-IT/scarcity-router#82 (M4.1, decision D-039).
What
ExecutionEligibilitycontract (ownschema_version: 1, closed state + reason-code vocabularies, strict exact-shape serialization) — deliberately separate from the frozen capacity v3 contract and never collapsed with it.account/rateLimits/readresult as the capacity parser:hasCreditsmust be explicitly false (true→policy_blocked),ordinaryUsageAllowedmust be explicitly true (false/null/legacy-absent → blocked/fail-closed),spendControlReachedexplicitly false, plus reached-type / exhausted individual limit / upsell / 100%-main-window blockers. Unknown == unsafe.OpenAICodexObservation); operational failures pair safe failure snapshots with fail-closedunknownreports.executionexclusion stage (first inEXCLUSION_STAGES) with per-state primary reason codes;select_model(..., eligibility_reports=...)(≤1 per provider); excluded candidates carry the paired report. Absence of a report = stage never applies (never "eligible")./v1/status+scarcity_statusgain an additive optionaleligibilityenvelope field (machine-interface v1 additive-domain rule; CLI--jsonbyte-shape unchanged). Selection decisions carry the same data viaexecution_eligibility.binary_path(SCARCITY_ROUTER_CODEX_BINenv hook) for the production pinned standalone Codex install; VS Code extension discovery stays default.Why
M4.1 owner policy: subscription allowance allowed, purchased credits forbidden, API PAYG forbidden. Today a
hasCredits=trueaccount still yieldsstatus="ok"capacity — the router would select a forbidden billing state and the caller would have to reject after selection. Unsafe OpenAI is now excluded BEFORE routing so the selector picks the next safe candidate (e.g. Z.ai); no caller-side fallback exists.Verification
make check(unittest + basedpyright recommended, 0 errors/0 warnings) andgit diff --checkclean.Links