Ranking Is Not Authority: Executable Context-Routing Contracts for Coding Agents
Abstract
Coding agents rely on context routers to choose repository evidence before generation. A learned relevance score can be used for two different decisions: ranking evidence and deleting it from the initial payload. We introduce an executable routing contract that separates those powers. Learned scores may reorder a deterministic lexical baseline, but only deterministic policy may delete it; a pre-generation digest verifies that the implementation obeys this by-construction rule. We evaluate five routing policies in 200 assignments on 50 frozen SWE-bench Verified tasks and analyze the disjoint 450-task complement. The advisory implementation retained all 1,638 admitted spans without a digest violation. Of 6,000 candidate scores, 2,840 were operationally unavailable; 91.3% of those unavailable scores ended in recorded account-credit or routing/fallback records. At threshold 6, destructive reuse would delete every admitted correct-edit span on 19 of 31 reachable tasks, with 18 of the 19 deletions caused by treating unavailable scores as removal rather than by a low numeric score. In the actual destructive arm, five of seven tasks still resolved after complete initial edit-locus deletion because repository tools allowed later recovery. We contribute the executable contract and its conformance tests, an attempt-complete evaluation ledger, and evidence that aggregate repair success cannot certify what an agent received at the initial-context boundary.