| feature | query-insights | ||||
|---|---|---|---|---|---|
| kind | notes | ||||
| status | active | ||||
| prs |
|
||||
| verified | 2026-08-14 | ||||
| code |
|
Status: shipped · Verified: 2026-08-14
Why the Query Insights panel rates queries the way it does, and why the AI stage streams.
Query Insights explains what a query actually did. It runs in stages: collect execution statistics, derive a static performance rating with badges and a score, then ask an AI model for recommendations. The static and AI stages must agree, and the AI stage must stay responsive while the user waits.
src/documentdb/queryInsights/**— the analysis pipeline and rating logicsrc/services/ai/**— the AI service and prompt construction, including model transparencysrc/webviews/documentdb/collectionView/queryInsights/**and.../queryInsightsTab/**— the panelsrc/webviews/documentdb/collectionView/queryInsightsReducer.ts— the streaming state machine
- Stage 2 is deterministic, Stage 3 is not. The static analysis produces the badges and score without a model. The AI stage refines and explains, and it is fed the static verdict so the two cannot contradict each other without saying why.
- The AI stage streams. Stage 3 renders progressively rather than blocking on a single response, because the goal is perceived responsiveness — the earlier design left the user with a blank spinner for roughly fifteen seconds.
- The model in use is visible to the user. Which model answered is part of the panel, not an implementation detail.
| Date | PR | What changed | Docs |
|---|---|---|---|
| 2026-04-27 | — | Performance rating: plan and implementation notes | iterations/01-performance-rating.md |
| 2026-04-27 | #616 | AI analysis aligned with the static analysis | iterations/02-ai-static-analysis-alignment.md |
| 2026-05-28 | #690 | AI model transparency in the panel | iterations/03-ai-model-transparency.md |
| 2026-06-01 | #711 | Progressive streaming for Stage 3 recommendations | iterations/04-streaming-stage-3/ |
No separate decisions.md yet. The load-bearing decisions are recorded inside the iterations,
most usefully in
iterations/04-streaming-stage-3/review-and-resolutions.md,
which is severity-sorted and records alternatives, verification status, and the operator's calls.
Start a decisions.md the next time a choice here needs to outlive its iteration.
Tracked inside the iteration documents rather than centrally. The streaming work has a deviation log in iterations/04-streaming-stage-3/original-plan.md.
- This README
- iterations/04-streaming-stage-3/description.md — the most recent narrative of how the panel works end to end
- Older iterations only for provenance