feat(vnext): add dialect-aware statement index#174
Merged
Conversation
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
Adds an internal vNext “statement index” that partitions analysisText into dialect-aware, half-open statement slots (with explicit terminator/trivia ownership) and supports fast cursor-to-slot lookup via binary search, without introducing any new public vNext exports.
Changes:
- Introduces a bounded, parser-free SQL statement partitioner with per-dialect lexical profiles (PostgreSQL, DuckDB, BigQuery, Dremio) plus opaque fail-closed suffix behavior.
- Adds comprehensive Vitest coverage for partition semantics, cursor affinity, dialect-specific quoting/comment rules, resource caps, and deterministic properties.
- Documents slot semantics, cursor-affinity behavior, dialect profile intent, and source-coordinate rationale in vNext docs/ADR.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/vnext/statement-index.ts | New internal statement index builder + cursor lookup with dialect-aware lexical scanning and bounded opaque fallback. |
| src/vnext/tests/statement-index.test.ts | New focused tests covering partition correctness, affinity rules, dialect behaviors, and resource limits. |
| docs/vnext/statement-index.md | New documentation describing slot model, affinity semantics, profiles, and complexity guarantees. |
| docs/vnext/source-coordinates.md | Adds a brief cross-reference noting statement index scans analysisText offsets. |
| docs/adr/0001-language-service-and-session.md | Updates ADR with the statement-index oracle design and constraints for vNext sequencing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Light2Dark
force-pushed
the
codex/vnext-statement-index
branch
from
July 24, 2026 14:55
56b57ea to
2ca3c25
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Safety and performance
Evidence
Public API
No vNext public exports or generated root declarations are added. The full scanner remains the correctness oracle for a later independently reviewed incremental slice.
Summary by cubic
Adds an internal, dialect-aware SQL statement index for vNext. It partitions
analysisTextinto exact half-open slots with binary-search cursor lookup and bounded resources, with no public API changes.analysisTextso UTF-16 offsets match the original text under the current masking transform; dialect behavior is keyed by internal profile identity, not a caller-controlled ID.Written for commit 2ca3c25. Summary will update on new commits.