Repository navigation
Closed
Labels
P1Queen takes before unlabelled work (priority.t27 HIGH)Queen takes before unlabelled work (priority.t27 HIGH)area/specs.t27 spec files and conformance.t27 spec files and conformanceenhancementNew feature or requestNew feature or requestspec
Description
One immutable analysis result per document version, built once and read by every provider. No provider parses on its own. This is the layer that wraps the compiler passes the language server needs (parse, analyze, typecheck, lint, outline). Part of the LSP epic, Refs #12209 (wave 0, foundation). Only .t27: no code in any other language, not even scratch probes or a loader; see skill only-t27.
If the compiler passes do not return source spans (line and column) for tokens, nodes and diagnostics, that is a compiler gap: file it on #5980 with a minimal .t27 repro and park the dependent part of this issue. Do not re-implement a parser here.
Prior art:
- rust-analyzer analyses on an immutable snapshot and cancels stale work: https://rust-analyzer.github.io/book/features.html
- clangd documents its server structure and the per-file preamble/AST split: https://clang.llvm.org/extra/doxygen/ClangdServer_8h_source.html
Boundary
- specs/lsp/analysis.t27
User Scenarios
- Given a document at version 7, when a snapshot is built, then it holds the token list with spans, the syntax tree with spans, the
uselist, the outline, and the parse, type and lint diagnostics, all tagged(uri, 7). - Given the same text analysed twice, when the snapshots are compared, then they are equal, and the diagnostics match what
t27c checkreports for that text. - Given a snapshot for version 7 and a store now at version 8, when a provider asks whether it is current, then the answer is
stale. - Given a cancellation arrives while a snapshot is being built, when the next checkpoint is reached, then the build stops and returns
cancelledwithout a partial snapshot.
Requirements
- FR-001: The module MUST define
Snapshotwith uri, version, tokens, syntax tree,uselist, outline, and a typed diagnostics list (code, severity, range, source, message, optional related information, optional rule id). - FR-002: The module MUST build a snapshot from document text alone, without reading the file system, and MUST be deterministic.
- FR-003: The module MUST expose
is_current(snapshot, version)and cancellation checkpoints between passes. - FR-004: Every diagnostic MUST carry the same code and message as the corresponding compiler pass, so that
t27c checkoutput and published diagnostics cannot disagree; the test compares them on 5 specs fromspecs/with known errors. - FR-005: Providers MUST receive the snapshot as an argument; the module MUST NOT export a parse function other than the one that builds a snapshot.
Success Criteria
- At least 15 tests in
specs/lsp/analysis.t27pass, run on the lab witht27c test-report(exit 0), including one spec with a syntax error, one with a type error and one with a lint finding. - Building the snapshot for the largest spec under
specs/lsp/takes under 200 ms on the lab; the measurement and its command are pasted in the issue. git diff --name-only masterlists onlyspecs/lsp/analysis.t27(0 files in other languages).
Metadata
Metadata
Assignees
Labels
P1Queen takes before unlabelled work (priority.t27 HIGH)Queen takes before unlabelled work (priority.t27 HIGH)area/specs.t27 spec files and conformance.t27 spec files and conformanceenhancementNew feature or requestNew feature or requestspec
Activity
gHashTag commentedon Nov 17, 2026
Spec created for this issue (typecheck OK, tests pass).
gHashTag commentedon Nov 17, 2026
Spec exists and passes typecheck + tests. M9 milestone complete.
gHashTag commentedon Nov 18, 2026
Reopened: closed as spec-only. A .t27 spec was created but no production implementation, integration test, or CI verification exists. This issue remains open until the target component implements the specified behavior and evidence is provided.