AI Code Completion Service · View 14 of 21 · Runtime
The ordering decision
- The prompt's leading segment must be stable across consecutive keystrokes or the prefix cache is invalidated on every one of them — a volatile segment placed early costs ~180 ms per keystroke.
- Priority truncation drops the lowest-priority source first and records which sources were dropped, so a quality change is attributable rather than mysterious.
- Repository permission is checked at request time against the requesting principal, not cached from index build (see view 21).
Assumptions
- Prompt budget ≤ 8,000 tokens; up to 20 open tabs considered; recent-edit window 10 minutes.
- Ranking is lexical plus symbol proximity, computed without a round trip the budget cannot afford.
Risks
- The degradation to open-tabs-only context is invisible to the developer and visible in acceptance rate a day later. It needs its own counter or it becomes a silent quality regression.