G04: Fix exact model-variant narrowing in route_request without changing gateway pin admission #178
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
#174 G04: Prove the executable recommendation, admission and exact-pin contract with Kernel
Creatidy/scarcity-router
Reference
Creatidy/scarcity-router#178
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
Product owner: Scarcity Router; G04/G10. Source: Creatidy architecture v1.0 (2026-10-04), sections 1-5, 7-13, 14-18 via #173. Correct the existing pure routing core's exact target-pin behavior; preserve correctly exact gateway admission and all authorization/quality gates.
Why and Reproduced Evidence
Current integrated develop
8d9d4b04bcb23fe19ff702b6209fbcb1537cdf1b,routing_core.py:2615-2667: when RequestBinding.pinned_target exists, routable_keys contains every identity bound to that resource, not only pin.model. The selector can prefer another variant. Existingtest_routing_core.PinTests.test_explicit_target_pin_is_honored_exactlyasserts resource/channel but not variant.A safe local probe using ONLY existing synthetic tests reproduced: requested
openai-worker/openai/gpt-5.6-luna/max;route_requestselected variantmedium;admit_pinned_target(..., pinned_target=pin)admittedmax. No inference/network/credentials. This is a proven library-core defect, not evidence the public gateway substitutes pins: its pin path uses admit_pinned_target (gateway_coordinator.py:1476-1498).Scope
Small correction to exact pin candidate narrowing/failure reasons in
route_requestplus deterministic regression tests/docs. Inspect interaction with explicit_model/explicit_variant and requirement/profile gates rather than guessing precedence. No API redesign, no all-client behavioral expansion, no new Kernel code or public endpoint. Pin identifies resource + exact provider/model/opaque variant; configured effort remains separate.Acceptance Criteria
admit_pinned_targetbehavior, publicsr-pin:ingress, logical-model competitive routing and frozen recommendation v1 remain unchanged. Pins remain neither credentials nor quota reservations/availability guarantees.Dependencies, Priority, Reuse and Authority
First-priority correctness blocker before public consumer G04 acceptance (#174). No dependency on MI or live inference; resolve before consumer tests can trust the shared core. Reuse existing
_identity_key,_narrowed_catalog, exact admission validation and fixture world, smallest correct change; no upstream replacement needed unless it demonstrably improves semantics. Mandatory reuse audit records retained local mechanism and rejected broader rewrites. No config/data migration expected; prove existing pins now honor already documented semantics. If a breaking interpretation is found, explicit decision before change.No credentials/endpoint changes, prompt capture, provider calls or real task execution. Normal independent technical+UX review required; future synthetic acceptance needs no inference/effect authority. Refs #173, #174, #87, D-042.
Implemented in PR #191: exact provider/model/variant narrowing on the pinned resource, with refusal/drift/intersection regressions and existing contract docs updated. Reproduced max -> medium failure before fix; 61 core tests PASS. Full make check PASS (2690 tests, 15 skips), uv sync --only-dev, explicit basedpyright and whitespace gates PASS. Base
6c337a400b; HEAD61b96247e7. Native independent whole-PR review pending; no live provider/harness integration claimed.Loop invocation 2026-10-05T12:38:32Z stopped BLOCKED at independent review ordinal 1/10 for PR #191. Fresh native whole-PR review returned COMMENT with empty findings at HEAD
61b96247e7/ base6c337a400b: no established code/UX blocker, but independent behavioral validation incomplete. Focused test invocation was denied by reviewer permissions; the allowed full suite includes environment-dependent operations the read-only reviewer cannot safely run. Independent basedpyright/whitespace passed; parent full gate passed (2690 tests, 15 skips). No exact APPROVE, so no merge or issue closure. Final checkout clean and PR open/unmerged at the frozen SHAs. Counter preserved in excluded delivery ledger; fixing reviewer validation availability is outside #178 scope.Completed in the SAME /loop invocation 2026-10-05T12:38:32Z. PR #191 merged via supported Forgejo merge operation as
46cb9ab695. Fetched canonical develop contains that exact merge commit with parents approved base4e1d5974f2and approved HEADf78cb9d24c; both ancestors verified, integrated tree equals approved tree.Acceptance verified: non-ranking-winner pin retains exact resource/provider/model/variant and no alternatives; missing/unbound/calibration/registration drift, stale/offline/unauthorized, conflicting explicit pins, quality/profile and unsupported-tool cases refuse without substitution; pinned compatibility regression asserts exact stage/reason/details. Existing exact admission/public gateway/logical routing/recommendation contracts unchanged, covered by full gate and whole-PR source review. Existing identity-key/narrowed-catalog/selector mechanisms reused, no broader redesign or #179 work.
Reviews preserved: 1 COMMENT (old HEAD infrastructure); 2 REQUEST_CHANGES (test coverage gap); remediation
f78cb9d; 3 COMMENT (artifact gap); 4 APPROVE with empty findings and technical/security/UX assessment at exact current HEAD/base. Recovery used immutable original focused-source export and system-recorded sanitized full-gate artifact, without permission weakening. Full exact-HEAD gate2693 PASS/17 skips, basedpyright0 diagnostics, whitespace clean; independent61 original core tests PASS. No live provider/harness/product readiness claim. Closing only this satisfied library-core issue.