Commit 88f9c6f
authored
docs(vnext): accept parser-independent relation completion (#182)
## Summary
- accept ADR 0005 for parser-independent relation completion
- keep the first completion slice independent of parser acceptance and
parser-worker startup
- define a bounded partial-`SELECT` query-site recognizer and narrow CTE
visibility model
- define one provider-owned catalog boundary, canonical suffix
rendering, epochs, cache identity, deadlines, cancellation, and
deterministic composition
- define atomic text/context/embedded-region transactions and
service-originated revision notifications
- define CodeMirror ownership, rich-info decoration, loading refresh
intent, and marimo 1/10/50-view acceptance evidence
- keep provider/completion declarations provisional until the vertical
slice, two provider shapes, packed marimo integration, and hostile
lifecycle suites pass
## Key decisions
- incomplete relation completion does not depend on `node-sql-parser`
- catalog matching/addressability belongs to the provider and scope;
dialect runtime owns SQL decoding and role-aware rendering
- catalog edits replace the authenticated whole typed path with a
provider-proven canonical suffix
- arbitrary embedded regions are grammar barriers; recovered sites
remain explicitly heuristic and incomplete
- one atomic shared-work owner set covers request consumers and refresh
observers
- hard safety deadlines are separate from the 40 ms default interactive
catalog response budget
- terminal and soft loading results carry bounded one-shot
completion-intent leases
- higher epochs discovered by responses or invalidations preserve
active/menu/no-menu completion intent exactly once
- completion search misses never prove unknown-object diagnostics;
authoritative resolution is separate
## Validation
- patch rebased onto merged executor checkpoint `873c926`
- all TypeScript configurations pass
- oxlint passes with zero findings
- test integrity passes
- 1,248 Node tests pass plus 1 expected negative
- three specialist adversarial review loops covered SQL/API correctness,
marimo ergonomics, and concurrency/performance
- final exact-head approvals are recorded for `d66ea25`
## Follow-up
The first implementation change is the runtime-free marimo-shaped type
fixture. No production completion slice starts until that fixture
compiles.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Accepts ADR 0005 to provide parser‑independent relation completion with
clear catalog/provider contracts, CTE visibility, and deterministic
lifecycle. Completion now works for incomplete FROM/JOIN without waiting
for `node-sql-parser` or worker startup, and keeps `CodeMirror`
integration separate.
- New Features
- Decoupled relation completion from parser/worker; added bounded
partial-SELECT site and CTE-visibility recognizers.
- Defined catalog provider boundary: scope/search paths in; canonical
paths with `completionPathStart`, epochs, and coverage out.
- Added atomic text/context/embedded-region transactions and
`onDidChange` session notifications for service-originated revisions.
- Clarified dialect-owned identifier decoding/quoting and role-aware
rendering; no generic folding/dedup in the service.
- Specified deterministic ranking, latest-wins cancellation, deadlines
(queue/exec), cache identity, and one-shot refresh intent.
- Documented `CodeMirror` adapter boundary, safe coalesced refresh on
`catalog-availability`, and no worker construction for this slice.
- Migration
- Pass a complete embedded-region set on open/update; regions, text, and
context update atomically.
- Implement the new catalog provider contract (or use
`createInMemoryRelationCatalog`); do not emit SQL text—return decoded
paths and roles.
- Do not gate completion on parser readiness; keep the parser worker and
scoped semantics for future slices.
- Subscribe to `session.onDidChange` and coalesce refresh on
`catalog-availability`; respect the provided completion-intent lease.
<sup>Written for commit d66ea25.
Summary will update on new commits.</sup>
<a
href="https://cubic.dev/pr/marimo-team/codemirror-sql/pull/182?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. -->1 parent 873c926 commit 88f9c6f
5 files changed
Lines changed: 862 additions & 52 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| |||
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
107 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
112 | 125 | | |
113 | 126 | | |
114 | 127 | | |
| |||
130 | 143 | | |
131 | 144 | | |
132 | 145 | | |
133 | | - | |
| 146 | + | |
134 | 147 | | |
135 | 148 | | |
136 | 149 | | |
137 | | - | |
138 | 150 | | |
139 | 151 | | |
140 | 152 | | |
141 | 153 | | |
142 | 154 | | |
143 | 155 | | |
| 156 | + | |
144 | 157 | | |
145 | 158 | | |
146 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
147 | 168 | | |
148 | 169 | | |
149 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
150 | 174 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
155 | 178 | | |
156 | 179 | | |
157 | 180 | | |
| |||
311 | 334 | | |
312 | 335 | | |
313 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
314 | 347 | | |
315 | 348 | | |
316 | 349 | | |
317 | 350 | | |
318 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
319 | 357 | | |
320 | 358 | | |
321 | 359 | | |
| |||
325 | 363 | | |
326 | 364 | | |
327 | 365 | | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
335 | 373 | | |
336 | 374 | | |
337 | 375 | | |
| |||
353 | 391 | | |
354 | 392 | | |
355 | 393 | | |
356 | | - | |
| 394 | + | |
| 395 | + | |
357 | 396 | | |
358 | 397 | | |
359 | 398 | | |
| |||
363 | 402 | | |
364 | 403 | | |
365 | 404 | | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
375 | 411 | | |
376 | 412 | | |
377 | 413 | | |
| |||
387 | 423 | | |
388 | 424 | | |
389 | 425 | | |
390 | | - | |
391 | | - | |
392 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
393 | 430 | | |
394 | 431 | | |
395 | 432 | | |
| |||
421 | 458 | | |
422 | 459 | | |
423 | 460 | | |
424 | | - | |
425 | | - | |
426 | | - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
427 | 465 | | |
428 | 466 | | |
429 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
191 | 196 | | |
192 | 197 | | |
193 | 198 | | |
| |||
220 | 225 | | |
221 | 226 | | |
222 | 227 | | |
223 | | - | |
| 228 | + | |
224 | 229 | | |
225 | 230 | | |
226 | 231 | | |
| |||
290 | 295 | | |
291 | 296 | | |
292 | 297 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
297 | 303 | | |
298 | 304 | | |
299 | 305 | | |
| |||
0 commit comments