[verified] fix: preserve tracker precision eligibility
This commit is contained in:
27
.scratch/routing-compatibility-regression/PRD.md
Normal file
27
.scratch/routing-compatibility-regression/PRD.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# PRD: Legacy routing compatibility regression
|
||||
|
||||
## Overview
|
||||
|
||||
The tracker’s new request-precision gate rejects legacy node registrations that omit `quantization`. This conflicts with the explicit `capability_policy=compat` rollout: an older node without a capability report remains routable, but an older node without a quantization field is silently excluded from proxy, pinned-route, benchmark, billing, and latency paths.
|
||||
|
||||
## Goal
|
||||
|
||||
Restore backward-compatible routing for legacy registrations while preserving fail-closed behavior for explicitly declared invalid/unsupported quantization values.
|
||||
|
||||
## Quality gates
|
||||
|
||||
- Run targeted routing, billing, benchmark, pricing, validation, and latency tests.
|
||||
- Run `python -m pytest -q` before completion and record any unrelated failures exactly.
|
||||
- Preserve the admission-policy invariant: invalid capability reports remain non-routable; absent reports route only under `compat`.
|
||||
|
||||
## User story
|
||||
|
||||
### RCR-001: Legacy registration precision fallback
|
||||
|
||||
As an operator upgrading a mixed fleet, I need nodes that predate the `quantization` registration field to serve default-precision requests under `compat`, so the tracker rollout does not make otherwise healthy legacy nodes dark.
|
||||
|
||||
## Non-goals
|
||||
|
||||
- Do not weaken `enforce` capability policy.
|
||||
- Do not treat explicitly malformed or unsupported quantization values as valid.
|
||||
- Do not change requested-precision semantics for nodes that declare a supported precision.
|
||||
@@ -0,0 +1,38 @@
|
||||
# RCR-001 — Legacy registration precision fallback
|
||||
|
||||
Status: ready-for-agent
|
||||
Priority: Critical
|
||||
|
||||
## Problem
|
||||
|
||||
The tracker now filters proxy and pinned-route candidates through `_quantization_satisfies(node.quantization, requested_quantization)`. A registration produced before the protocol added singular `quantization` is normalized to `quantizations=["bfloat16"]`, but leaves `node.quantization is None`; routing then fails every request, including the default `bfloat16` request.
|
||||
|
||||
The defect is therefore at protocol normalization: registration correctly records an available plural capability but never chooses a compatible active precision for the legacy entry.
|
||||
|
||||
This is inconsistent with the explicit capability admission rollout policy: an absent capability report is routable under `compat`. Logs show `capability=absent routable=True`, while `/v1/chat/completions` returns 503 or a pinned route returns 409 because the separate precision gate excludes the same legacy node.
|
||||
|
||||
## Evidence
|
||||
|
||||
Representative tight repros fail on current `master`:
|
||||
|
||||
- `tests/test_billing_ledger.py::test_proxy_chat_bills_credited_client_and_credits_node` → HTTP 503
|
||||
- `tests/test_tracker_routing.py::test_tracker_proxy_accepts_hf_model_alias_from_quickstart` → HTTP 503
|
||||
- `tests/test_manual_route_benchmark.py::test_pinned_route_uses_named_node` → HTTP 409
|
||||
- `tests/test_model_speed_latency.py::test_tracker_records_increasing_hop_latency_for_model_and_hardware` → HTTP 409 for every parameter
|
||||
|
||||
Each fixture registers a complete, healthy legacy node without `quantization`; tracker registration logs show it as routable under `compat`.
|
||||
|
||||
## Acceptance criteria
|
||||
|
||||
- [ ] Legacy nodes omitting the `quantization` field are treated as the historical default precision for compatibility purposes.
|
||||
- [ ] Explicit `null`, invalid, or unsupported declared precision never receives that fallback and remains excluded from routing, assignment, and coverage calculations, including after managed shard assignment/rebalancing.
|
||||
- [ ] Raft replication preserves singular `quantization` and plural `quantizations`; follower routing has identical precision eligibility to the leader.
|
||||
- [ ] `capability_policy=enforce` still excludes absent capability reports regardless of precision fallback.
|
||||
- [ ] Automatic proxy routing, pinned routes, benchmark routes, and route-stat sampling use the same compatibility rule.
|
||||
- [ ] Add behavior-level tracker HTTP tests for legacy omission and explicit invalid declaration.
|
||||
- [ ] Targeted billing, routing, benchmark, model-speed, pricing, forfeiture, and TOPLOC dispatch tests pass.
|
||||
- [ ] Run the full suite and document any failures not caused by this issue.
|
||||
|
||||
## Implementation notes
|
||||
|
||||
Keep the compatibility decision at the protocol-normalization boundary, not scattered into individual route paths. A normalized legacy default can preserve existing `_quantization_satisfies` semantics while differentiating an omitted field from an explicitly invalid value.
|
||||
29
.scratch/routing-compatibility-regression/prd.json
Normal file
29
.scratch/routing-compatibility-regression/prd.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "Legacy routing compatibility regression",
|
||||
"description": "Restore compat-policy routing for legacy node registrations that omit quantization without weakening validation for invalid declared values.",
|
||||
"branchName": "ralph/routing-compatibility-regression",
|
||||
"userStories": [
|
||||
{
|
||||
"id": "RCR-001",
|
||||
"title": "Legacy registration precision fallback",
|
||||
"description": "As an operator upgrading a mixed fleet, I need nodes that predate the quantization registration field to serve default-precision requests under compat, so otherwise healthy legacy nodes do not become dark.",
|
||||
"acceptanceCriteria": [
|
||||
"A legacy registration without quantization is eligible for a bfloat16 request when capability policy is compat.",
|
||||
"The same registration is excluded under capability policy enforce because its capability report is absent.",
|
||||
"A node that explicitly declares null, an invalid, or an unsupported quantization remains excluded from routing, assignment, and coverage calculations, including after managed shard assignment/rebalancing.",
|
||||
"Raft-applied registrations preserve both singular quantization and plural quantizations so follower routing matches leader routing.",
|
||||
"Automatic proxy routing, pinned routes, manual benchmarks, billing proxy paths, and route-latency sampling retain their existing behavior for legacy registrations.",
|
||||
"Tests cover the legacy/no-field case and explicit-invalid-field case at the tracker HTTP seam.",
|
||||
"Targeted routing, billing, benchmark, pricing, validation, and latency tests pass.",
|
||||
"python -m pytest -q is run and unrelated failures are recorded exactly."
|
||||
],
|
||||
"priority": 1,
|
||||
"passes": true,
|
||||
"dependsOn": [],
|
||||
"completionNotes": "Completed by agent"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"updatedAt": "2026-07-13T07:25:08.460Z"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user