You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
- update the dialect-aware statement index incrementally from trusted
analysis-coordinate edits while preserving the full scan as the oracle
- add a private lazy per-session index cache with atomic
invalidation/reuse rules
- replace structural dialect definitions with opaque built-in factory
handles, keeping lexical profiles and indexes out of the public API
## Correctness and safety
- conservative restart at the old slot at or left of the earliest edit
- convergence only at an exact terminated boundary after the final edit
- exact full-oracle fallback for inconsistent metadata or absent
convergence
- global 10,000-slot and opaque-suffix behavior preserved
- monotonic convergence cursor keeps resource-cap recovery linear
- no source text or history retained by the cache
## Validation
- 833 unit tests passed; 1 governed expected failure
- 33 incremental tests with deterministic differential sequences across
all four profiles
- 80,000 additional adversarial differential edits matched the full
oracle
- changed coverage: 98.78% statements, 97.00% branches, 100% functions,
98.77% lines
- typecheck, oxlint, integrity, browser, demo, and packed-package smoke
passed
- 1 MiB benchmark: full scan about 2.2-2.5 ms, middle edit about 0.028
ms, prefix shift about 0.11 ms
- resource-cap recovery about 1.35-1.46 ms after fixing the reviewed
quadratic path
## Review
Two independent exact-SHA reviewers approve
2e83d17 with no unresolved blocker,
high, or medium findings.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds incremental statement indexing with a lazy, per-session cache so
edits update indexes in microseconds, while a full scan remains the
correctness fallback. Replaces caller-defined dialect objects with
built-in opaque dialect handles that bind lexical behavior internally.
- New Features
- Incremental updates from trusted analysis-coordinate edits; reuse
unchanged prefix and reuse/shift suffix at exact terminated boundaries,
with full-oracle fallback.
- Private per-session statement-index cache: reused on context-only
updates (same profile) and same-text replacements; incrementally updated
on trusted identity-source changes; cleared on profile change or changed
replacements; no source text or history retained.
- Built-in dialect factories return frozen opaque singletons:
`duckdbDialect()`, `postgresDialect()`, `bigQueryDialect()`,
`dremioDialect()`; handles are validated, local to the package instance,
and don’t cross workers/processes.
- Bench and tests: `pnpm run bench:statement-index`; extensive unit,
randomized differential, and session cache tests.
- Migration
- Replace `defineSqlDialect(...)` and `SqlDialectDefinition` with
built-in handles and `SqlDialect`.
- Before: `createSqlLanguageService({ dialects: [defineSqlDialect({ id:
"duckdb", displayName: "DuckDB" })] })`
- After: `createSqlLanguageService({ dialects: [duckdbDialect()] })`
- Keep using the handle’s `.id` string in document context: `{ dialect:
dialect.id }`.
- Do not copy/serialize/fabricate dialects; pass authentic handles from
the same `@marimo-team/codemirror-sql/vnext` instance (handles don’t
cross workers/processes).
<sup>Written for commit ce94176.
Summary will update on new commits.</sup>
<a
href="https://cubic.dev/pr/marimo-team/codemirror-sql/pull/175?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
0 commit comments