Files
Guoliang ChenandClaude Mythos 5.2 3823b85667
ci / checks (push) Successful in 57s
ci / corpus (push) Successful in 14s
ci / linux (push) Successful in 4m56s
release / build-and-publish (push) Successful in 5m17s
Release 0.66.1: sticky scroll pins the module instance
A multi-line module instantiation now answers folding ranges, so VS Code's
sticky scroll pins it (TODO §72, docs/features/instance-folding): one range
from the module-type line, and one more per instance from the line its name
is on when that is a later line, so both `aes_control_fsm #(` and
`) u_aes_control_fsm (` stay pinned inside the connection list. The closing
`);` line stays visible.

- folding/instances.rs: what is an instantiation comes from
  vlog_semantic::instantiations::sites; where it closes is re-read from the
  tokens, and a statement whose tokens are not exactly that shape folds
  nothing.
- folding.rs: in_answer_order is a stable sort by start line over scopes,
  branches, instances; every earlier fold is unchanged and first on a shared
  start line (0.66.0 against this tree on 4 933 files: identical once the
  instance folds are removed).
- OpenTitan hw: 18 200 multi-line instantiations, none without its fold.
- Not folded: two-dimensional instance arrays; an instance whose head an
  `ifdef splits.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
2026-11-19 23:22:18 -08:00

963 lines
217 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# topo.md — the dependency topology of lucisv
**Purpose.** This document is the map an agent reads before touching anything:
which modules depend on which, which features consume which, and where the
two graphs meet. It exists to make parallel multi-agent development safe —
every edge below is an interface somebody can break. An absent edge is only
a candidate for independent work: confirm current imports, shared files, and
open handshakes before assigning ownership.
Sources of truth this document is derived from (and defers to on conflict):
each crate's `Cargo.toml`, each feature's `docs/features/<name>/README.md`
(the **Handshakes** section in particular), `README.md` and `CLAUDE.md`.
Drafted 2026-08-27 from the workspace at v0.10.2 (93 feature READMEs);
updated 2026-08-28 for hover-declarations, change-debounce,
port-detail-spans and interactive-latency (97 feature READMEs); updated
2026-08-29 from v0.14.0 for hover-line-index, scan-interleave, incremental
scope widening, the request-fan-out performance wave and verbose-timing
(100 feature READMEs); updated 2026-08-30 from v0.17.0 for
inline-instantiation, the two-level module-instantiation split
(106 feature READMEs — the testbench wave's five arrived in between,
their edges already tabled below; +§2.9-19); updated 2026-08-30 again
for fuzzy-completion (107 feature READMEs); updated 2026-09-01 for
null-items (108 feature READMEs); updated 2026-09-02 through v0.33.0 for the
testbench grammar/semantics wave, comment slots, bind semantics, SVA bodies,
and the four decomposition rounds (125 feature READMEs); updated 2026-11-19
through v0.65.11 for release gating, hierarchy-current-path,
comment-highlighting, ifdef-folding, format-styles, localized-reindex,
scan-ordering, linux-test-portability (Round 2, the MCP stamp fix),
viewport-highlight and fast-actions; open handshakes 44–66 from TODO §70/§71.
**Code audit refreshed 2026-09-07.** Latest release: **v0.49.0**
(`4c2dae3`); committed snapshot: **`df4e714`**, clean at review start.
Type-name spans, package re-exports and hierarchical tails shipped in v0.45.0;
the current facts codec is **19**. v0.46–0.49 added five refactorings,
`unused-import` (74 rules), DUT hierarchy sections, real `randsequence` nodes,
and opt-in UVM indentation. These are released contracts, not pending lanes.
Loop 2 is closed. TODO §55 defers `state.rs` decomposition to Loop 3;
§2.9 retains DPI-export binding (31), refactor-verifier relocation (32),
transitive inline source selection (33), and older open requests. This audit
adds the reproduced UVM-option cache omission (34). The September 4
atomic-write, lint-config and walk-cycle findings remain closed in v0.43.0.
See [repository-analysis.md](repository-analysis.md) for evidence and validation.
Feature QA logs and TODO checkboxes remain the acceptance authority; remote
artifact verification and manual editor acceptance were not repeated here.
**Edge notation, used in all three sections:**
| notation | meaning |
|---|---|
| `A ──▶ B` | **A consumes B.** This edge does not imply B is A's only dependency. A consumes B's published interface; B was not changed for A and does not know A exists. Breaking B's interface breaks A; breaking A costs B nothing. |
| `A ◀──▶ B` | **Handshake.** A negotiated, two-sided contract: B changed something *for* A (or both sides pin one wire shape / file format / naming convention), and the contract is written down in one or both READMEs. Either side moving unilaterally breaks the other. |
| `A ─▶ B` | **Not a dependency** — a one-way note whose `kind` column says what it is: `sequencing` (corpus files handed from one bucket to the next), `standing promise` (A imposes a rule on B and its successors), `open request`, or `depends (consumed by)` — the last reads **B depends on A**. |
| *(absent)* | No dependency is recorded here. Confirm source and file ownership before treating the pair as independent. |
A handshake that was **requested but not yet delivered** is an *open
handshake*; those are collected in §2.9 because they are exactly the
coordination points parallel agents must not both grab.
---
## 1. Module dependency graph
"Module" here means: the eight workspace crates, the two editor trees, and
the script layer (`tools/`, `scripts/`, CI), and the documentation site. Intra-crate structure that
matters for parallel work is in §1.3.
### 1.1 Crate-level graph
```mermaid
graph TD
subgraph foundations [foundation crates — depend on nothing]
P[vlog_parser]
C[lucisv_core]
end
F[vlog_formatter] --> P
S[vlog_semantic] --> P
L[vlog_linter] --> P
L --> S
L --> C
R[vlog_refactor] --> P
R --> S
CLI[lucisv &#40;CLI&#41;] --> C
CLI --> P
CLI --> F
CLI --> L
SRV[lucisv_server] --> C
SRV --> P
SRV --> S
SRV --> R
SRV --> F
SRV --> L
L -.dev-dep &#40;fix harness&#41;.-> F
R -.dev-dep &#40;refactor acceptance&#41;.-> F
VSC[editors/vscode] -.spawn contract.-> SRV
VSC -.KEYWORDS grammar lock.-> P
NVIM[editors/nvim &#40;docs&#41;] -.spawn contract.-> SRV
TOOLS[tools/ release scripts] -.builds/packages.-> CLI
TOOLS -.builds/packages.-> SRV
TOOLS -.builds/packages.-> VSC
MCP[lucisv_mcp] --> C
MCP --> P
MCP --> S
MCP --> R
MCP --> F
MCP --> L
VSC -.spawn contract.-> MCP
TOOLS -.builds/packages.-> MCP
CI[Gitea Actions] --> TOOLS
DOCS[docs/site] -.documents CLI and generated rule reference.-> CLI
DOCS -.documents protocol.-> SRV
CORPUS[scripts/ + tools/corpus_*] -.exit codes, msg prefixes.-> CLI
```
*(The diagram shows direction only; §1.2 is authoritative on `depends` vs
`handshake` for each edge.)*
External Rust dependencies (all exactly pinned in the workspace `Cargo.toml`):
`rayon` (CLI only, sanctioned by TODO §3), `lsp-server` + `lsp-types` +
`serde`/`serde_json` (server only, sanctioned by TODO §6). Those are the only
**direct** external dependencies; everything the workspace itself writes is
std. Resolved transitive dependencies are recorded in `Cargo.lock`; Node
dependencies for the editor and documentation site have separate manifests. `lsp-types` carries
`features = ["proposed"]` for LSP 3.18 `inlineCompletion` (inline-templates).
### 1.2 Crate edges, documented
Every edge is directional; "consumes" lists the load-bearing surface, i.e.
what a change on the pointed-to side must not silently break.
| edge | kind | contract |
|---|---|---|
| `vlog_formatter ──▶ vlog_parser` | depends | `parse(tokens, source)` / `parse_source`, the whole AST, `tokenize` (re-used by `verify.rs` to re-lex both sides of the safety net), trivia attachment (`Meta::{leading,trailing,before_sep,attrs}` — comments are never dropped), `RawText.col` (the dedent column for verbatim re-indent), spans. The formatter is the AST's primary consumer: **every new `ItemKind`/`StmtKind`/`ExprKind` variant costs an arm in `format/`** (its matches are exhaustive). |
| `vlog_semantic ──▶ vlog_parser` | depends | The AST read-only, `parse_source_tolerant`/`parse_tolerant` (never fails; `Error` nodes are opaque leaves), the **name-span contract** `src[name_span] == name` on every declaring node, `token::is_keyword`, `defines::collect_defines`/`DefineTable`, `TextRange`. `bind/`'s `ItemKind`/`ExprKind`/`DimKind` matches are exhaustive — new variants cost an arm here too. |
| `vlog_linter ──▶ vlog_parser` | depends | `ParsedSource::parse` = `tokenize` + `parse_tolerant` (one-parse bundle), `LineIndex`, `TextRange`, AST shapes walked by `visit.rs` (which ends in `_ => {}`, so new variants usually cost nothing here), token facts for text rules (a macro use is one `Ident` token; a directive is one `Directive` token). |
| `vlog_linter ──▶ vlog_semantic` | depends | `analyze`, `Semantics::{symbols, references, references_of}` and shared `imports::{import_usage, unused_imports, PackageExports}` for semantic rules, including signal usage and duplicate-declaration checks. `Semantics::duplicates()` was added by linter-expansion-1 without changing persisted facts. `LintContext::semantics()` computes analysis lazily when a rule asks for it. Justified in `vlog_linter/Cargo.toml`; adds no external code (`vlog_semantic` is `vlog_parser` + std). Also `FileFacts::from_analysis` + `IndexBuilder::{add_facts, finish}` (perf5-p3: the one-file package index built from the caller's parse; `WorkspaceIndex::build` over the text remains what the equality test pins against). |
| `vlog_linter ──▶ lucisv_core` | depends | `walk::is_excluded`, the `--exclude` matcher, reused for a waiver file's `--location` so one pattern language serves the whole tool (waiver-files, §39, 2026-09-04). `lucisv_core` still depends on nothing, so no cycle. |
| `vlog_linter ──▶ vlog_formatter` **(dev-only)** | depends (tests) | The `.lint` fix harness asserts a lint fix never produces text `format_source` refuses. **The library dependency list is `vlog_parser` + `vlog_semantic` + `lucisv_core` + std** — `cargo tree -p vlog_linter -e normal` is the pinned check. Do not promote this to a normal dep; the fence filter deliberately lives in the front ends instead (see shared-fence-filter, §2.4). |
| `vlog_refactor ──▶ vlog_formatter` **(dev-only)** | depends (tests) | expand-wildcard (§50, 2026-09-05): the acceptance tests format and converge what an expansion writes. No production edge. |
| `vlog_refactor ──▶ vlog_semantic` (organize-imports) | depends | `imports::{import_usage, import_scopes, unused_imports, PackageExports, Exports}` — the one "is this import used" judgement, shared with the linter (§52, 2026-09-05). |
| `vlog_linter ──▶ vlog_semantic` (organize-imports) | depends | the same `imports::*` judgement behind the `unused-import` rule; `MentionOracle::package_exports` is a new default method, so no implementor broke (§52). |
| `lucisv_server ──▶ vlog_semantic` (organize-imports) | depends | `WorkspaceIndex::reexported_packages`, read by `lucisv_server::imports` to close the file set over re-exports (§52). |
| `lucisv_server ◀── vlog_refactor` (extract-module) | depends | `RefactorEdit::created` — the files an edit creates, read by `lucisv_server::extract` to emit `CreateFile` document changes when `ClientAbilities::create_files` (read at `initialize`: `workspace.workspaceEdit.documentChanges` + `resourceOperations: create`) allows, else the same-file fallback (§53.1, 2026-09-06). |
| `vlog_refactor ──▶ vlog_parser` | depends | `tokenize`, `parse_source_tolerant` + diagnostics, `LineIndex`, `TextRange`, the port/instantiation/module AST shapes, `token::is_keyword` (new-name validity), `defines` via the index. Every edit span originates in a parsed node — no textual search-and-replace. |
| `vlog_refactor ──▶ vlog_semantic` | depends | `Semantics` queries (`symbol_at`, `references_of`, `reference_id_at`, …), `Resolution` variants (three of them are refusal rules), `WorkspaceIndex` + `resolve_external` + `ExternalTarget`, and the exactness promise on `name_span` (re-checked before each edit is emitted). One historical exception: refactor-rename added `Target::Declaration` + end-label uses *into* `vlog_semantic` (lead-authorized, additive — see §2.6). `FileFacts::analyzed(path, src) -> (FileFacts, Semantics)` (perf5-p2: the index build hands back the analysis it read the record off; `FileFacts::of` is its `.0`, so the two cannot drift; `Scope` feeds `IndexBuilder::add_facts` and keeps the `Semantics` of the files a rename will read — a cache, never an oracle) and `WorkspaceIndex::absorb` as the after-index of every verifier (`check/after.rs`: the before-index cloned plus the edited files' fresh records; pinned equal to a rebuild by fingerprint and query on adversarial edits). |
| `lucisv ──▶ lucisv_core` | depends | `config::{FileConfig, Discovery}` (lucisv.toml discovery — `config::parse` is reached through `Discovery`, not called directly), `walk::{collect_files, EXTENSIONS}` (the `.gitignore`/`--exclude` walk), `filelist::read` (`-f`), `cache` (the format cache), `atomic::write_atomic` (formatter and lint-fix replacement). (`walk::is_excluded` also supplies the linter’s external-waiver location matcher.) |
| `lucisv ──▶ vlog_formatter` | depends | `format_source` / `format_range` / `LineRanges` / `Config` / `FormatError`, and `fence::{protected_regions, is_protected}` (the `--fix` fence filter — the linter crate deliberately has no fence notion). |
| `lucisv ──▶ vlog_linter` | depends | The public linter API for `lucisv check` — `lint` + `LintContext`/`ParsedSource`, `apply_fixes`, `select_rules` (the CLI does not call `run` itself). Relies on: rule names stable, linting never panics/writes, findings sorted by `(span.start, span.end, rule)`. `package_exports_in(path, file, tokens, src)` (perf5-p3: the CLI census hands the linter its one `ParsedSource` for the package half as it already did for `module_interfaces`; the text form is a wrapper; an AST gate spares files that declare no package from the one-file index). |
| `lucisv ──▶ vlog_parser` | depends | `LineIndex` / `TextRange` for lint report coordinates, plus `PARSE_STACK_SIZE` for both the named `lucisv` thread and rayon workers. (The CLI otherwise reaches the parser through the formatter and linter.) |
| `lucisv ──▶ rayon` | depends | The worker pool. Pinned exactly; pool must keep `stack_size(vlog_parser::PARSE_STACK_SIZE)` (currently 16 MiB; recursion-limit handshake) or the parser's depth guarantee regresses to a stack overflow. |
| `lucisv_server ──▶ lucisv_core` | depends | Same config discovery and walk as the CLI (that sameness is the point — format-on-save must agree with `lucisv --check`), `filelist::read` (index scope rung 1, `+incdir+` for the include graph), `cache::content_hash` (re-used by the persistent index cache — one FNV-1a, not two). `walk::collect_files_with` (each walked file with the length the walk's own `metadata` call already holds; `None` for an input named rather than walked) and `walk::collect_files_below(root, input, …)` (a subtree walk that carries the ancestor `.gitignore`/`--exclude` stack down and yields nothing when an ancestor the root walk would not enter blocks it) — perf5r-first-answer, 2026-09-08; `collect_files` is unchanged and a wrapper. Amended for F1 (2026-09-09): `walk::DirectoryTracker`, `walk::DirId`, `walk::dir_id`, `walk::collect_files_tracked` and `walk::collect_files_below_tracked` preserve directory identity, precedence ordering, and cycle detection across split discovery phases and deduplicate open buffers against aliased disk paths in `overlay_buffers`. **The tracker's promise (F1, 2026-09-09):** the two walks of one scan enter each directory identity once *between* them, so no file is discovered under two spellings and their union is the set one root walk yields — a `lucisv_core` change that gave `DirectoryTracker::enter` a different answer for a second spelling would silently un-fix F1 (pinned by the nine alias fixtures in `server/tests/startup.rs`). **`has_conflict` is server-visible:** when the remaining walk reaches an identity by a path the root walk would have preferred, `state/mod.rs::land_discovery` reads it, `Scan::wants_rescan` reports it and `server/index.rs` turns it into one ordinary rescan after the scan settles, so startup and rescan converge on the canonical spelling; the CLI still calls `collect_files` and sees none of this. |
| `lucisv_server ──▶ vlog_parser` | depends | `tokenize`, `parse_source_tolerant`/`parse_tolerant`, `ParseDiagnostic`, `LineIndex`, `TextRange`, tokens + trivia, `defines`, `KEYWORDS` (completion keyword tier; also the source the hand-maintained VS Code grammar is test-locked to), `PARSE_STACK_SIZE` for the named `lucisv-main` thread, and `stats::parses()` (perf5-p1: a per-thread whole-file parse count, asserted by the code-action tests — a repeated offer on an unchanged buffer parses nothing). |
| `lucisv_server ──▶ vlog_semantic` | depends | `analyze`/`Semantics` (every navigation answer), `WorkspaceIndex` (build/incremental update, units/members/defines, `instantiations_of`/`subclasses_of` edge tables, `FileFacts` codec for the persistent cache), `resolve_external` overlay, `index_order`/`IndexBuilder` (watched builds), and `files_mentioning` as a refactoring selector rung (perf5-p2, handshake 33: `module_select::hierarchical_users` — previously the semantic lints' oracle only), and `WorkspaceIndex::table_sizes() -> IndexTableSizes` (perf5-p4: a read-only walk over the tables for the scan trace's memory line — end of scan only, never on a request path; no codec change). |
| `lucisv_server ◀──▶ vlog_semantic` | handshake | Two negotiated additions, both 2026-08-28 and both additive: **`Symbol::detail_span` / `Def::detail_span`** (where a non-ANSI port's body declaration completes the header that names it — the server's hover card and `nav::definition` both read it, and they show/jump to it in the same order), and **`Semantics::symbols_named`** (name → declarations, built in `analyze`, in declaration order — the server replaced two scan-every-symbol loops with it and the *first-match tie-break must stay declaration order* or hover's choice between two live declarations of one name changes). `docs/features/port-detail-spans/README.md`. |
| `lucisv_server ◀──▶ vlog_semantic` | handshake | Three later additive performance surfaces: **`DeclLines` / `Def::lines`** record declaration and detail lines at index time (`FACTS_FORMAT` 3 → 4); **`WorkspaceIndex::absorb`** folds a scan batch with one merge rather than one merge per file; and **`WorkspaceIndex::files_spelling`** finds external uses by spelling, resolved or not, for rename's dangling-use refusal. The first feeds hover-line-index, the second scan-interleave, and the third refactor-rename's six-rung fan-out. Changing the facts codec, reference-fact census or merge semantics breaks those consumers. |
| `lucisv_server ──▶ vlog_refactor` | depends | `prepare_rename`/`rename`, `find_references`, the port refactorings, `organize_imports`, `extract_module`, `inline_module`, `RefactorEdit::{edits,warnings,created}`, `rename_traced_with(files, known: &dyn KnownFacts, …)` (perf5r-scope-reuse, 2026-09-09: the engine may build its index from a caller's record for a file **only** when `known.facts_for(path, text)` answers for exactly these bytes — the server answers from the index cache's store entry, record and FNV-1a content hash read from one place, never from the workspace index's record; a reused file is parsed anyway if a later stage reads its `Semantics`; `rename_traced` is the door with nothing known), `rename_traced` + `RenameTrace`/`VerifyTrace`/`Stage` (perf5-p2: the rename with its stage timings and parse counts as an out parameter; `rename` is the same call with a trace nobody reads; the server logs one `timing: rename trace …` line under `--verbose` only), the parsed-input selectors `port_action_modules_in`/`imported_packages_in`/`extract_site_in`/`inline_site_in` (perf5-p1: the offer paths hand the document's own tolerant parse and diagnostics; the text forms are thin wrappers kept for standalone consumers and the every-offset parity test; a large-file buffer still takes the text form), `instantiation_plan`/`render_with`/`module_definition` (the inline instantiation ghost, signature help, inlay hints — the completion popup stopped consuming them 2026-08-30, names-only tier). Promise consumed: never a partial edit — `Ok` verified whole, `Err` is a sentence. |
| `lucisv_server ◀──▶ vlog_refactor` | handshake | Request-scope selectors added for the performance wave: `prepare_rename_here` must produce the same answer/refusal text as whole-scope `prepare_rename`; `rename_name_at` must name the target that the rename engine acts on; `port_action_modules` and `enclosing_module` must name every module the corresponding port action/command can edit. The server uses those names to choose an index-derived file set; `extract_site`, `inline_site` and `imported_packages` also name source requirements. **`rename_preflight(semantics, offset, new_name)` (perf5r-preflight, 2026-09-08)** owes whole-scope `rename` the same *refusal* text one-directionally — it may always stand aside with `Ok(())` and never invents a refusal — and deliberately reads no workspace index (unlike `prepare_rename_here`): only refusals that are a pure function of the request buffer's own text (the new-name check, no symbol here, an unresolved or inherited-candidate reference, an unspelled declaration, the same name at a non-file-scope declaration); every index-answered refusal stays on the slow road. The engine remains the authority, and every selector must supply a superset of files needed for edits and refusals (inline gap: §2.9-33). |
| `lucisv_server ──▶ vlog_formatter` | depends | `format_source`, `format_selection`/`LineRanges` (range, ranges, on-type formatting — since TODO §66.2, 2026-11-09; `format_range` is now the CLI's `--lines` and the engine's own fallback for module/package-level selections), `Config`, `fence::protected_regions` (quick-fix filter). |
| `lucisv_server ──▶ vlog_linter` | depends | `run`, `lint` + `LintContext::from_parse` (lints from the `Document`'s own parse — one-parse), `default_rules`, `apply_fixes`, `rule_by_name`. Same three promises the CLI relies on. |
| `lucisv_mcp ──▶ lucisv_core, vlog_parser, vlog_semantic, vlog_refactor, vlog_formatter, vlog_linter` | depends | The MCP block (2026-09-23, `docs/mcp/PLAN.md`, `TODO-MCP.md`): `lucisv-mcp` composes the six libraries through their public APIs only — `Discovery`/`filelist`/`walk`/`content_hash`/`write_atomic` (core); `tokenize`, `parse_tolerant`, `parse_source` (strict, the structural edits' rule 1), `LineIndex`, `defines`, the AST (`Item`/`ItemKind`, `Meta::leading`, `Connections`), `PARSE_STACK_SIZE` (parser); `analyze`, `IndexBuilder::{add_file, add_facts}`, `WorkspaceIndex::{absorb, fingerprint, units, members_of, member_in, instantiations, workspace_symbols, find_define, files_mentioning, …}`, `resolve_external`, `FileFacts::{of, decode}`, `FACTS_FORMAT` (semantic); `rename`, `add_port`, `remove_port`, `find_references`, `instantiation_plan`, `module_definition`, `enclosing_module` (refactor); `format_source`/`fence` (formatter); `LintContext::from_parse`, `lint_with`, `select_rules`, `apply_fixes`, `rules_markdown`, `MentionOracle` (linter). **Never `lucisv_server`** (bin-only) and never `lsp-types`. Feature READMEs `docs/features/mcp-*`. **M7 (2026-09-23, the lean catalogue):** nine tools; `diff::unified`, `format_range` and the cursor refactorings (`expand_wildcard`, `convert_to_ansi`, `organize_imports`, `inline_module`, `propagate_ports`, `extract_module`) are no longer called — they stay in the CLI and the server. |
| `lucisv_server ──▶ lsp-server / lsp-types` | depends | The transport (synchronous, no async runtime) and the protocol data model. Both pinned exactly. cancel-request additionally relies on `lsp-server 0.10.0`'s stdio transport being a **rendezvous channel** (its own forwarder queue exists because of it) — a version bump must re-read that crate's `stdio.rs`. |
| `editors/vscode ◀──▶ lucisv_server` | handshake | The **spawn contract**: binary named `lucisv-server`, no env, LSP over stdio, `initialize` works with no roots (single-file mode). The extension passes exactly `[]` by default or `['--verbose']` when `lucisv.verbose` is true; the server accepts only that spelling (repeats are idempotent) and refuses any other argument with exit 2. Changing that setting restarts the server because it is a process argument, not an LSP setting. Wire shapes pinned on both sides: the custom `lucisv/scopePairs` result, the other `lucisv.*` settings section (push and pull), `initializationOptions.storagePath`, the markdown fence tag `systemverilog` (server emits it, extension's grammar registers it), the `bin/` layouts of the platform `.vsix` packages. `smoke.js` still drives the default no-argument contract headlessly; `tests/e2e.rs` pins both spawns and `tests/grammar.rs` pins the grammar. |
| `editors/vscode ◀──▶ vlog_parser` | handshake | The TextMate grammar's keyword alternation is **hand-maintained and test-locked to `vlog_parser::KEYWORDS`**: `crates/lucisv_server/tests/grammar.rs` fails, naming the missing/extra words, when they diverge (there is no generator script). Adding a keyword to `token.rs`'s `keywords!` macro is therefore also a hand edit to `editors/vscode/syntaxes/systemverilog.tmLanguage.json`. |
| `editors/nvim ──▶ lucisv_server` | depends | Documentation-only module: config snippets consuming the same spawn contract and settings shape. No code. |
| `tools/ ◀──▶ crates + editors/vscode` | handshake | `release.sh` parses `lucisv --version` (field 2), runs `smoke.js` against the built server, stages `dist/lucisv[-server]-<version>-<triple>` names, packages seven `.vsix` files and asserts their `bin/` layouts. `audit_artifacts.sh` and `prune_release_assets.sh` key on those exact names. The version number lives in exactly four files (two `Cargo` files, two `package*.json`) and nowhere in Rust source. |
| `CI (Gitea Actions) ──▶ tools/` | depends | `release.yml` is (almost) all `tools/` one-liners — `gates.sh` first (the release is gated since 0.65.1: fmt, clippy, one `suite:<crate>` step per workspace member, docs, corpus — fetched first so it is not skipped —, node, cross; a red gate stops before anything is built), then `release.sh --cross`, `audit_artifacts.sh`, `prune_release_assets.sh`, `release_notes.sh`, `publish_release.sh` — so every release step runs by hand too; its only inline logic is the tag-vs-`lucisv --version` check. `ci.yml` is plain `cargo fmt`/`clippy`/`test` plus `scripts/corpus_gate.sh` (which reaches `tools/corpus_fetch.sh` on a cache miss) on the macOS runner, and since 0.65.9 a `linux` job (`runs-on: linux-x64`, the luhpe runner, as root, 4 CPU / 8 GB, rustup per job, cold build) running `cargo clippy --all-targets -- -D warnings` and `cargo test --workspace`; `tools/linux_check.sh [--user] [--dry-run]` runs a command against the working tree in the same job image without a push (§2.8). `ci.yml` runs on the branch push and the release does not wait for it: a tag publishes only after `gates.sh` is green on macOS, so releases are gated on macOS alone (§2.9-57). Both jobs run `cargo test --workspace` bare, not through `tools/guard.sh` (§2.9-65). Tag `vX.Y.Z` must equal the workspace version; release notes come from `CHANGELOG.md`'s `## <version> — <date>` headings via `release_notes.sh`. |
| `scripts/score.sh + tools/corpus_check.sh ──▶ lucisv` | depends | The frozen 0/1/2 exit-code contract, plus a **textual** dependency on the message prefixes `parse error:` / `lex error:` / `verification failed:` (a standing fragile coupling — rewording those means telling corpus-check; see §2.9). |
**Deliberately absent production edges** (also check shared file ownership):
- `lucisv` (CLI) does **not** depend on `vlog_semantic` or `vlog_refactor` —
the CLI formats and lints; semantic lints reach it only *through*
`vlog_linter`, and refactoring is server-only today.
- `vlog_refactor` has **no production dependency** on `vlog_formatter` — refactored output
is edited source, not reformatted source (refactor README, by design).
- Among `vlog_formatter`, `vlog_semantic`, `vlog_refactor`, `vlog_linter`
there are exactly two production inter-crate edges — `vlog_linter →
vlog_semantic` and `vlog_refactor → vlog_semantic` — plus `vlog_linter →
vlog_formatter` and `vlog_refactor → vlog_formatter` as **test-only
dependencies**. All four depend on
`vlog_parser`. `vlog_formatter` is the isolated one: nothing in this group
depends on it in production and it depends on none of them. Formatter and
semantic lanes still need disjoint file ownership and
a check of shared AST changes and open handshakes before parallel work.
- `lucisv_core` depends on nothing and nothing in it knows about Verilog —
it is "which files, with what settings".
- `vlog_parser` depends on nothing. It is also the **highest-contention
module in the workspace**: six crates depend on it, five consume the AST
(the CLI takes only `LineIndex`/`TextRange`), and two of those match it
exhaustively — `vlog_formatter/src/format/` and `vlog_semantic/src/bind/`
— with `vlog_parser`'s own `tests/spans.rs` as a third exhaustive walker.
`vlog_linter`, `vlog_refactor` and `lucisv_server` walk it with catch-all
arms. See §3.3.
### 1.3 Intra-crate structure (what matters for parallel work)
**`vlog_parser`** — `lexer.rs` → `token.rs` (tokens + trivia attachment);
`parser/` (recursive descent, strict + tolerant entry points over one
grammar, depth/chain budgets from recursion-limit — since the 2026-09-02
decomposition one module per grammar domain: `cursor`, `recover`,
`directive`, `split`, `verbatim`, `item`, `module`, `decl`, `tf`,
`instance`, `recover_list` (header/list-local tolerant recovery), `stmt`, `keyword_stmt`, `expr`, `primary`, `class`,
`covergroup`, `assertion`, `sva`, `randsequence`, tests in `parser/tests/`) → `ast/`
(`mod` holds `Meta`/`Comment`/spans/`RawText`; `module`, `decl`, `stmt`,
`expr`, `class`, `covergroup`, `sva`, `randsequence` hold the nodes, all re-exported as
`vlog_parser::ast::*`); `span.rs`
(`TextRange`), `line_index.rs` (offset↔line:col), `defines.rs` (the
`` `define`` table, reads the token stream, expands nothing). `tests/spans.rs`
is an exhaustive AST walker: **every new node needs an arm there** and must
keep the span-nesting invariant. `PARSE_STACK_SIZE` is part of the public
parser contract: every production thread that can reach parse or analysis must
use it; the CLI main thread, rayon pool and server main thread do so, while the
server queue and `lsp-server` I/O threads are proven not to parse.
**`vlog_formatter`** — the pipeline is `format/` (per-node rules; since
2026-09-02 `mod` + `verbatim`, `comment`, `phrase`, `list`, `item`, `module`,
`instance`, `decl`, `routine`, `class`, `cover`, `sva`, `randsequence`, `stmt`, `expr`) →
`doc.rs` (the Wadler IR) → `printer.rs` (width-aware printing);
`verify.rs` (the runtime safety net: token equivalence + convergence —
CLAUDE.md invariant #4 territory, see §3.3); `fence.rs` (format-off regions +
`protected_regions`, consumed by both front ends); `range.rs` (`--lines`);
`align.rs` (alignment inference; `align::plan` takes an `Alignment` mode,
`Infer` = the old rule); `selection/` (`format_selection`, §66.2);
`style.rs` (`Style`, the `PRESETS` table of six rows, `preset`, `names`;
every switch moves whitespace only, so `verify.rs` knows nothing of styles);
`auto.rs` (`format_auto`, `resolve_style`: format with each preset, keep the
fewest changed lines). `format_source` = parse → format → verify;
an error means emit nothing.
**`vlog_semantic`** — `bind/` (AST → scopes/symbols/references; since
2026-09-02 `mod` = the `Binder`, then `item`, `decl`, `class`, `cover`,
`stmt`, `sva`, `expr`) →
`model.rs`; `resolve.rs` (the lexical walk; misses become
`ExternalCandidate`/`InheritedCandidate` carrying candidate paths);
`workspace/` (`mod` = the tables, `index` = queries and `build`, `update` =
incremental update and `fingerprint`, `record` = the `FileFacts` read-off,
`external` = the overlay, `reexport` = cycle-guarded package member traversal;
`hierarchy` = tagged connection/hierarchical member tables; `path_units`
(§65.4); `dependents` = the readers table, which files' resolution read which
merged-table key; `references` = postings built whole or re-done for a few
files; `replace` = one record replaced, only the keys it reaches re-merged —
the last three localized-reindex's; `WorkspaceIndex`: units, members, defines, instantiation and
inheritance edge tables, incremental `update_file`/`remove_file`,
reference postings, `files_spelling`, batch `absorb`, declaration `DeclLines`,
`fingerprint`); `facts.rs` (`FileFacts` codec for the persistent cache;
`FACTS_FORMAT` is **22**, since §65.4);
`instantiations.rs`, `classes.rs` (the shared walks, lifted from the server
so the index census and the request handlers cannot drift); `imports.rs`
(`import_usage`, `import_scopes`, `unused_imports`, `Exports`, `PackageExports`)
is the shared usage judgement consumed by organize-imports and the linter.
**`lucisv_core`** — `config.rs` (`lucisv.toml` parsing + `Discovery`, the
upward search with its per-instance cache; `FileConfig::format_style`,
`STYLE_NAMES`, `parse_style`, and `NAMES`, now `pub`), `walk.rs` (`collect_files`,
`EXTENSIONS`, `.gitignore`/`--exclude` filtering), `filelist.rs` (the `.f`
reader: files, `+incdir+`, defines, warnings), `cache.rs` (the format cache +
`content_hash` — the one FNV-1a the server's index cache also reuses; an
`Entry` carries its `style`, a seven-field store line),
`atomic.rs` (shared replacement for CLI source writes and the format cache). Knows
nothing of Verilog; depends on nothing. Config stores `LintOption` entries
raw with source/line information; front ends validate them through
`vlog_linter::RuleOptions`, so core still has no linter dependency. Open
contract: path normalization (§2.9-1). Walk cycles and same-target temp
collisions are resolved (§2.9-8, §2.9-26). `collect_files` now takes a
`&mut dyn FnMut(Warning)` sink; CLI and server own presentation of recoverable
walk failures (§2.9-30). Atomic replacement uses exclusive per-operation temps;
CLI canonical-path dedup prevents symlink aliases reaching two workers.
**`vlog_linter`** — `registry.rs` (`Rule` trait, `all_rules`/`default_rules`/
`select_rules`), `rules/` (one file per rule; names are **stable API** — they
appear in users' waivers), `context.rs` (`LintContext<'a>`, `ParsedSource`,
lazy `semantics()`), `visit.rs` (the item/statement walk), `waiver.rs` (inline
waivers), `waiver_file.rs` (`ExternalWaivers`, usage tracking, unused reports),
`violation.rs` (+ `Fix`, `Applicability`), `signals.rs` (the shared signal
table for the three semantic rules), `naming.rs`, `rule_docs.rs`
(`rules_markdown()` — docs generated from the registry). There are 74 rules;
`severity.rs` classifies them, `options.rs` validates per-rule configuration,
`regex.rs` implements the bounded pattern dialect, and `vscode.rs` generates
editor rule toggles. `decls.rs`, `module_decls.rs`, `exprs.rs`, `preproc.rs`,
`literal.rs`, and `interfaces.rs` share facts and walks across the rule families.
**`vlog_refactor`** — crate-level `scope.rs` owns the shared `Scope` cache;
`rename/` (`mod` = the rename, `warnings` = the text scans, `tests` = the parity suite;
also the engine of `references.rs::find_references`; publishes the cheap
`prepare_rename_here`/`rename_name_at` selectors whose parity with the full
engine is test-pinned), `ports/` (one file per refactoring: `find`, `add`,
`remove`, `propagate`, `list`, `expand`, `ansi`, `merge`;
`port_action_modules`/`enclosing_module`, the names the server uses to bound
the input set), `instantiate.rs` (plans + rendering; the one layout both plain
and snippet spellings go through); `imports.rs` (organize-imports);
`extract/` (`mod`, `boundary`, `render`, `region`, `flow`) and `inline/`
(`mod`, `site`, `source`, `render`) plan module moves/copies. `check/`
(`mod`, `ledger`) verifies edits with re-tokenization/resolution and the exact
comment/attribute piece ledger. `RefactorEdit::created` lists new paths, each
also represented by one insertion at offset zero in `edits`; server `CreateFile`
operations must precede those edits. Same-file relocation verification and
inline source fan-out remain open in §2.9-32/33.
**`lucisv` (CLI)** — `main.rs` (args → walk → per-file worker pool;
`process_file` is the cache-aware unit of work; panic hook installed once at
startup — **keep it that way**, cli-polish → parallel-files handshake),
`args.rs`, `diff.rs`, `lint.rs` (the `check` subcommand; owns the CLI-side
fence filter).
**`lucisv_server`** — layered by responsibility (`includes.rs` is the one file that
spans two layers — the include graph *and* the `documentLink` handler;
`perf.rs` is `#[cfg(test)]`-only and is not a layer — see
`docs/perf/README.md`):
| layer | files | role |
|---|---|---|
| entry | `main.rs` | the no-argument / `--verbose`-only argument contract, capabilities advertisement, `InitializeParams` reading, wiring |
| loop | `server/` (since 2026-09-02: `mod` = the loop; `dispatch`, `client`, `index`, `notification`, `progress`, `diagnostics`, `batch`, `formatting`, `large_file`, `semantic_tokens`, `startup`; `ahead` = answering a request from its buffer ahead of whatever holds the rest — the one precondition (`answer_from_the_buffer`), `REACH`, every place a request is offered (fast-actions, 0.65.11); `viewport` = which colouring requests may go ahead, the range-guess record and the refresh (viewport-highlight; tests in `server/viewport/`); `probe` = `#[cfg(test)]` burst scripting and `went_ahead`; tests in `server/tests/`) | the message loop + queue/burst (cancel-request), dispatch, `Pending` map for server-initiated requests, stepped startup scans with mid-scan request drains, held-request ordering for rescans and for notifications (`must_hold`), the early-answer exemption, reindex/widen orchestration, progress/log senders, optional `timing:` instrumentation |
| state | `state/` (a directory since TODO §55: `mod`, `document`, `buffers`, `views`, `scope`, `scan`, `rescan`, `discover`, `sources`, `port_grace`; localized-reindex added `incremental` — `OneFile`, `update_one_file` — and `watched` — `Watched`) | `Workspace` (roots, scope ladder, index, include graph, candidates, index cache, open `Document`s with overlay, bounded closed-file `FileView` cache), `Scan` (whole or additive widen), fan-out source selectors (`module_sources`, `rename_sources`, `include_sources`), and `Document` (text, tokens, tree, semantics, diagnostics, `large` flag) |
| substrate | `convert.rs`, `uri.rs`, `locate.rs`, `pairs.rs`, `includes.rs`, `candidates.rs`, `index_cache.rs`, `watch.rs`, `settings.rs`, `templates.rs`, `sync.rs`, `caret.rs`, `auto_style.rs`, `same_file.rs` | position math, URI↔path, location building, the begin/end scope matcher, the include graph, completion word/module tables and their scan-batch forms, the persistent index store, watcher registration, `lucisv.*` settings parsing, snippet registry, incremental text sync, the byte a name-under-the-cursor request is about (`symbol_offset`), the per-document `auto` preset memory, whether a request's whole answer is its buffer's (`same_file::METHODS`, `answered_by_the_buffer`; tests in `same_file/`) |
| handlers | one file per capability: `format.rs`, `diagnostics.rs`, `lint.rs` (with `fences.rs`: the formatter's text-only fence answer memoized once per `Document` — perf5-p1; the shared-fence-filter contract is unamended; and `lint_snapshot.rs` + `lint_trace.rs` — perf5r-lint-snapshot, 2026-09-08: one `lint_with` pass per document revision shared by the diagnostics publish and quick-fix discovery, keyed by value on every input of that call — rule names, merged options, line width, tab width, oracle presence, external waiver *contents* — held in a `Slot` on the `Document` and cleared by `Document::refresh_overlay`, which every index mutation ends in; a `timing: codeaction … key=value` line under `--verbose`, parsed by `tools/perf/phases_r1.py`), `rename_trace.rs` (perf5-p2: `Rung`/`Wanted`/`SelectionTrace` — the path set the rename fan-out ladder fills, remembering which rung asked for each file; `Workspace::rename_sources_traced` is the ladder with that sink), `hover.rs`, `expand.rs`, `nav.rs`, `type_def.rs`, `type_hierarchy.rs`, `hierarchy.rs`, `design_hierarchy.rs`, `symbols.rs`, `tokens.rs` (+ `tokens/`: `instantiation.rs`, window tests, ignored sweep), `completion/` (`mod`, `member`, `module`, `tiers`, `word`, `site`, `buffer`, `connection`; `related` = the related tier, sortText `4`, outside `LIMIT` with its own `RELATED_LIMIT`; `wire` = the `itemDefaults` payload rewrite — both fast-actions; test harness in `harness`), `signature.rs`, `inlay.rs`, `inline.rs`, `lens.rs`, `code_action.rs`, `rename.rs`, `ports.rs`, `imports.rs`, `extract.rs`, `inline_module.rs`, `folding.rs` (+ `folding/directives.rs`), `selection.rs`, `linked.rs`, `on_type.rs`, `includes.rs` (links), `file_ops.rs`, `instantiate.rs`, `large.rs` | each is a mostly-pure function over `Document`/`Workspace`; protocol only, no language analysis of its own (anything that looks like analysis in here is a bug or a Handshake request — lucisv-server README) |
**`editors/vscode`** — `extension.js` (spawn + rainbow decorations + storage
path; ~everything else is `vscode-languageclient` driven off advertised
capabilities), `package.json` (languages, grammar, snippets, settings,
colour ids), `syntaxes/` (hand-maintained grammar, test-locked to
`KEYWORDS`), `snippets/` (static, server-independent), `restart.js` (the one
serialized start/restart chain, so a `lucisv.verbose` toggle cannot be lost to
an in-flight start — shipped, shared by the extension restart paths),
`hierarchyView.js`/`hierarchyModel.js`/`hierarchySections.js` (the indexed
instance hierarchy sidebar and client-only DUT sections), `hierarchyCurrent.js`
(the current-path highlight; `media/hierarchy.{js,css}` set `data-lit`),
`commentScan.js`/`commentKeywords.js` (the grammar-mirroring comment scan
and its decorations), `referencesView.js`/`referencesModel.js`, `typing.js`,
`mcp.js`, `extract.js`
(the module-name input and extract command),
`smoke.js` (headless handshake check) and `restart_test.js` (headless check of
that chain, against a scripted fake client), `README.md` (the Marketplace
Details page, owned by editor-marketplace-page).
**`tools/`** — besides the release and corpus scripts (§1.2), `gates.sh`
(every gate as a guarded step; the release runs it first) and
`linux_check.sh` (a command against the working tree in the Linux job image,
over ssh, no push).
---
**`docs/site`** — Astro/Starlight content in `src/content/docs/`, sidebar and
metadata in `astro.config.mjs`, styles in `src/styles/custom.css`, and tracked
static output/search in `dist/`. It consumes the CLI/API/LSP contracts as
documentation, not through a Rust build dependency. Its rule page is editorial;
`lucisv check --rules-doc` is registry-generated truth. Rebuild the tracked
output after content changes, and keep historical measurements dated.
### 1.4 Contracts added since the decomposition baseline
| Feature | Surfaces that must move together | Current state |
|---|---|---|
| macro-word-census | semantic `FileFacts::macro_words`, `files_naming_in_macros`, codec 17 ↔ server rename warnings; linter `rules_markdown` → CLI `--rules-doc` | Delivered; §2.9-5 and -18 closed |
| interface-dpi-arms | parser AST/formal arguments → formatter, binder, spans and argument consumers | Delivered in v0.35.0 |
| statement-fences | formatter `fence.rs` ↔ `format/stmt.rs`, routine bodies and `range.rs`; front ends keep consuming `protected_regions` | Delivered; §2.9-3 closed |
| header-recovery | parser `ListElem::{Ok,Error}`, `ExprKind::Error`, `recover_list.rs` → formatter, semantic, linter, refactor and server list walkers | Tolerant mode preserves valid siblings; strict formatting still rejects malformed input |
| linter-expansion-1 | `Severity`, `Violation::severity`, `rules_named`, `MentionOracle::module_interface`, `Semantics::duplicates` ↔ CLI reports, server diagnostics/settings, generated VS Code toggles | Delivered; duplicate facts are in-memory only |
| linter-expansion-2 | core `FileConfig::lint_options`/`LintOption` → linter `RuleOptions`; registry specs ↔ CLI validation, server option overlay and editor settings | Delivered; core records raw values and does not depend on the linter |
| linter-expansion-3 | shared scoped-item/expression/preprocessor walkers ↔ registry (73 rules at delivery, now 74), rule docs and generated editor toggles | Delivered; rule names and option keys are user-facing contracts |
| small-items-3 | parser `ItemKind::GenBlock` → every recursive item walker; `recover_list` lookahead; core `atomic::write_atomic` → CLI format/fix and format cache | Delivered in v0.40.0; per-operation temp ownership and canonical CLI dedup followed in v0.43.0 (§2.9-26) |
| lazy-code-action | refactor `sites_phrase` ↔ server `ports.rs`; `ClientAbilities::code_action_resolve` ↔ dispatch and `{uri, position, title}` action data; indexed `DeclPositions` → `locate::definition_location` | Delivered in v0.41.0; clients without resolve support retain eager port actions, lint fixes remain eager |
| parser-skips | parser `module.rs`/`split.rs` rival-header detection; `DataDecl::delay: Option<NetDelay>` → formatter `format/decl.rs` and semantic `bind/decl.rs` | **Released in v0.42.0**; preserves the written delay position; no verifier normalization change |
| waiver-files | linter `ExternalWaivers`/`WaiverUse`/`lint_with` ↔ core `[lint] waivers`, CLI `--waiver-file`, server `lucisv.lint.waivers`, quick fixes and VS Code manifest | Released in v0.42.0; inline/external union, unused external reports are CLI-only |
| atomic-write-coordination | core exclusive temp creation and permissions → CLI canonical-path dedup and every in-place writer | Released in v0.43.0; independent processes remain last-writer-wins |
| lint-config-contract | server `lint/project.rs` parses project selection/options/waivers; `ProjectLint` → lint selection, `ConfigProblems`/`ProblemLog` → diagnostics logging | Released in v0.43.0; editor lists override project lists when non-empty, separately for select and ignore |
| walk-cycles / small-items-4 | core directory identity set and warning sink ↔ CLI/server walk callers; parser delay-comment fields and `ExprKind::Type` → formatter and instance planning | Released in v0.43–0.44; warning paths continue without changing CLI status, direct missing inputs remain errors |
| didopen-cost | `undriven-net` local guards → existing `MentionOracle` predicate; diagnostics equality → server publish/request ordering | Released in v0.44.0; no new async work or index API |
| type-name-spans | parser `DataType::name_span`/`segments`, disable-target span → binder `exact_or_empty` and census | Released in v0.45.0; `scan.rs` deleted; source text remains the exact-span oracle |
| package-reexports | binder export references → `FileFacts` RX group (introduced at codec 18; the codec is 22 now) ↔ workspace `reexport.rs` and shared member queries | Released in v0.45.0; package exports add no local import; DPI-export names remain unbound |
| hierarchical-tail | `Surface` tags on declarations/references, codec 19 ↔ `workspace/hierarchy.rs`, member-tail resolution, completion and rename source selection | Released in v0.45.0; §2.9-23 closed; connection surface stays unchanged, instance tails read the hierarchical surface |
| expand-wildcard / convert-to-ansi | `ports/{expand,ansi,merge}.rs` ↔ whole-edit verifier; server `ports.rs`, commands and action titles ↔ extension manifest; refactor → formatter test-only edge | Released in v0.46.0; explicit unmatched-port warnings and conservative merge/refusal rules |
| organize-imports | semantic `imports.rs` → linter `unused-import` and refactor `imports.rs`; server `imports.rs` ↔ `source.organizeImports` / `lucisv.organizeImports` | Released in v0.47.0; 74 rules, new rule default off; package re-exports count as usage |
| extract / inline module | refactor `extract/`, `inline/`, `check/ledger.rs`, `RefactorEdit::created` ↔ server `extract.rs`, `inline_module.rs`, source selectors and client resource capabilities; extension `extract.js` ↔ name prompt | Extract v0.47.0, inline v0.49.0; file copies/moves preserve protected pieces; open §2.9-32/33 |
| dut-hierarchy | extension `hierarchySections.js` ↔ model/view, manifest commands, `lucisv.hierarchy.duts`, workspace state; consumes unchanged `lucisv/moduleHierarchy` snapshot | Delivered in v0.48.0, package corrected in v0.48.2; configured DUTs are locked, saved and configured names union |
| coverage-gaps-l | new `randsequence` AST/parser/formatter modules and six grammar additions → all AST walkers and grammar keyword lock; `Config::uvm_utils_indent` ↔ core `[format]`, CLI config merge, server setting and extension manifest | Released in v0.49.0; default-off output option; cache-key omission open in §2.9-34 |
| release-gates | `.gitea/workflows/release.yml` runs `tools/gates.sh` before `release.sh --cross`; `gates.sh` step list/limits ↔ `docs/features/release-gates`, `tools/RELEASING.md`; `cross` step ↔ the rustup toolchain `release.sh --cross` builds with | Released in v0.65.1 (gate) and v0.65.7 (`cross`); release still gated on macOS only (§2.9-57) |
| hierarchy-current-path | extension `hierarchyCurrent.js` ↔ `hierarchyView.js` ↔ `media/hierarchy.{js,css}` (`lit` row field + `{type:'lit'}` message); `hierarchySections.headerId` now exported; manifest colours `lucisv.hierarchyCurrent`/`Parent1–3`/`Ancestor`/`CurrentBar` + `lucisv.hierarchy.highlightCurrent`; consumes the unchanged schema-2 snapshot | Released in v0.65.2; extension-only, no server change; not yet seen in a running editor |
| comment-highlighting | extension `commentScan.js` mirrors the grammar's `comments`/`strings` rules (locked by `commentScan_test.js`) ↔ `commentKeywords.js` decorations ↔ manifest `lucisv.commentKeywords.{builtIn,custom,caseSensitive}` + colour `lucisv.commentKeyword`; `.vscodeignore`/`RELEASING.md` runtime-module list | Released in v0.65.3; grammar and server unchanged; bracket colour in comments is VS Code's (explained, not changed) |
| ifdef-folding | server `folding/directives.rs::branch_spans` (reads lexer `Directive` tokens) → `folding.rs` (`scope_and_comment_folds` / `branch_folds` / `in_answer_order`) ↔ sticky scroll via the extension's `foldingProviderModel` (§67) | Released in v0.65.4; existing folds byte-identical and first on a shared start line; large buffers still fold nothing |
| format-styles | formatter `style.rs` (`Style`, `PRESETS`, `preset`, `names`), `auto.rs` (`format_auto`, `resolve_style`), `align::plan(mode)`, `Config::{style, auto_style, styled, named, style_name}` ↔ core `STYLE_NAMES`/`parse_style`/`FileConfig::format_style`, cache `Entry::style` (seven-field line) ↔ CLI `--style`, MCP `format`/`diagnostics`, server `settings.rs` `lucisv.format.style`, `auto_style.rs`, `lint.rs` line-length ↔ manifest enum | Released in v0.65.5 (server lint width v0.65.6); default `lucisv` byte-identical; `verify.rs` untouched; open §2.9-44/47 |
| localized-reindex | semantic `workspace/{dependents,references,replace}.rs` (readers table, in memory, in `fingerprint`), `update_file`/`update_facts -> bool`, `symbols_named`, `FileFacts::{declares_the_same, declared_names}` ↔ server `state/incremental.rs` (`OneFile`), `state/watched.rs` (`Watched`), `watch::{scope_files, names_a_config}`, `IncludeGraph::{update_held, add_known, refresh_naming}`, `Candidates::{set_file_words, refresh_names}`, `server/index.rs` `BURST_DIVISOR` | Released in v0.65.6, published as v0.65.7 (Windows fix); no `FACTS_FORMAT` change; open §2.9-48/49/51 |
| scan-ordering | server `server/mod.rs` `must_hold`/`behind`/`hold`, `server/batch.rs::changes_state`, `opened_mid_scan` set in `notification.rs`'s `didOpen` arm and read in `index.rs::answer_what_is_waiting`; `caret.rs::symbol_offset` → `dispatch.rs` `Server::symbol_offset` (nine requests); extension `referencesView.js` opens rows at the name's start | Released in v0.65.8; amended in v0.65.11 (fast-actions: `owes_a_state_change` — the answer to a settings pull is ordered like a notification); open §2.9-50/52/53 |
| linux-test-portability (Round 2) | `lucisv_mcp` `project/files.rs` `Stamp` (`identity: Option<Identity>`, `read_mono`, `RACY` 3 s over mtime and ctime, `Change::Suspect`) ↔ every index-based MCP tool; `ci.yml` `linux` job ↔ `tools/linux_check.sh` (same image, no push) | Released in v0.65.9; test code plus the one MCP product fix; open §2.9-54–57 |
| viewport-highlight | server `server/viewport.rs` (`colours_may_go_ahead`, `coloured_ahead`, `index_unsettled`, `refresh_tokens_if_stale`, `Viewport::defers_widen`) and, since 0.65.11, `server/ahead.rs` (`answer_from_the_buffer`, `set_aside`, `open_then_widen`, `answer_ahead_mid_widen`) ↔ `must_hold`/`behind`/`held`/`dirty` (scan-ordering) ↔ `dispatch.rs::answer_flushed` ↔ `index.rs::reindex_widened`; `tokens::semantic_tokens_in_range` + `large::line_window` + `tokens/instantiation.rs::overrides_within`; `ClientAbilities::semantic_tokens_refresh` (`main.rs`) | Released in v0.65.10; non-colour answers unchanged (978 compared); the early-answer machinery moved to `ahead.rs` in v0.65.11 (pure move); open §2.9-58–60 |
| fast-actions | server `server/ahead.rs` (`answer_from_the_buffer` — the one precondition —, `REACH`/`Reach`, `Server::can_reach`, `nothing_unapplied_for`, `settings_awaited`, `answer_ahead_of`, `answer_held_ahead`) ↔ `same_file.rs` (`METHODS`, `answered_by_the_buffer`; its README table pinned to the dispatch by `same_file/tests.rs`) ↔ `server/mod.rs` (`must_hold`, `owes_a_state_change`, `settings_announced`) ↔ `server/diagnostics.rs::flush_buffer` ↔ `server/large_file.rs::reclassify_large_buffers` ↔ `viewport.rs` (`index_unsettled` also while anything is held); `completion/related.rs` (sortText `4`, `RELATED_LIMIT`, tiers renumbered `4→5`…`7→8`, `tests/e2e.rs` digits) and `completion/wire.rs` ↔ `ClientAbilities::completion_item_defaults` (`main.rs`); `includes::include_at`, `type_def::type_name`, `candidates::macro_of` now `pub(crate)` | Released in v0.65.11 (TODO §71.2) after an escalation round; no `vlog_semantic` change; scan-ordering's response exemption amended; `completionItem/resolve` measured, not built; open §2.9-61–64; not seen in a running VS Code |
The lazy action resolves against current workspace state and rejects a stale
or inapplicable action. Indexed definition locations bypass closed-file reads
only for file-scope declarations carrying `DeclPositions`; members and open
buffers retain the text-based path. Missing inlay hints can reflect a module
outside the configured index scope, rather than a hint-generation failure.
---
## 2. Feature dependency graph
Feature contracts cluster into eight lanes; edges inside a lane are listed in
that lane's table, cross-lane edges are repeated where they matter. The
mermaid graph shows the lanes and the load-bearing cross-lane edges only.
```mermaid
graph LR
subgraph FMT [formatter foundations]
direction TB
safety[safety-net] --- cmts[comment rounds] --- fences[format-fences] --- rangef[range-formatting]
end
subgraph GRAM [parser grammar / corpus]
direction TB
corpus[corpus-check] --- pspans[spans / name-spans] --- macro[macro-items] --- classes --- rest[...12 more buckets]
end
subgraph CLIL [CLI lane]
direction TB
polish[cli-polish] --- cfg[config-discovery] --- par[parallel-files] --- cache[format-cache]
end
subgraph LINT [linter lane]
direction TB
lcore[linter-core] --- lr2[lint-rules-2] --- slint[semantic-lints]
end
subgraph SEM [semantics & index]
direction TB
vsem[vlog-semantic] --- widx[workspace-index] --- incr[incremental-index] --- persist[index-persistence]
end
subgraph REF [refactor lane]
direction TB
flist[filelist M1] --- ren[refactor-rename M2] --- prt[refactor-ports M3] --- inst[refactor-instantiate M4]
end
subgraph LSP [LSP server lane]
direction TB
srv[lucisv-server] --- caps[~30 capability features]
end
subgraph PKG [packaging & release]
direction TB
epack[editor-packaging] --- pvsix[editor-platform-vsix] --- cirel[ci-release]
end
GRAM --> FMT
corpus -. measures .-> GRAM
LINT --> FMT
SEM --> GRAM
SEM --> CLIL
REF --> SEM
LSP --> SEM
LSP --> REF
LSP --> FMT
LSP --> LINT
LSP --> CLIL
CLIL --> FMT
PKG --> LSP
PKG --> CLIL
PKG --> GRAM
```
### 2.1 Formatter foundations
| edge | kind | contract |
|---|---|---|
| `case-tables ──▶ safety-net` | depends | The case harness consumes `format_source`'s post-safety-net `Err` — cases that used to produce wrong output now report `format failed:`. |
| `formatter-bug-fixes ◀──▶ safety-net` | handshake | safety-net *filed* the request (comments need positions to re-indent); formatter-bug-fixes *delivered* it: `Comment { line, col }`, `Token::trailing: Option<Comment>`, `RawText { text, col }`. |
| `formatter-bug-fixes ──▶ case-tables` | depends | Fixes the five bugs case-tables found and parked; each `#SKIP` case became a live regression case. |
| `format-fences ──▶ spans` | depends | The first consumer of byte spans: a fenced region is a source slice by span. Also added `Doc::Verbatim` (leaf; emitted only right after a line break). |
| `comments-round ◀──▶ format-fences` | handshake | fences requested a span on `Meta.trailing`; comments-round delivered `Option<Comment>`. Same-line fences remain deliberately inert (matcher unchanged) — documented on both sides. |
| `comments-round-2 ──▶ comments-round` | depends | Closes the bracket-position comment shapes round 1 parked; same machinery, four new `Vec<Comment>` slots. |
| `corpus-bugs ──▶ corpus-check` | depends | Fixes exactly the four root causes A–D the corpus check catalogued; measured back to 0 verification errors. |
| `range-formatting ──▶ format-fences` | depends | A range is "an inverted fence": reuses `Doc::Verbatim`, `fence::collect`/`region_at`, and two helpers widened to `pub(crate)` (`line_start`, `with_trailing_comments`) — the only fence.rs change. |
| `range-formatting ──▶ spans` | depends | The planner selects items by span/line. |
| `selection-formatting ──▶ range-formatting / format-fences / lucisv-server` | depends | (2026-11-09, TODO §66.2) `format_selection` lays out the smallest run of sibling items/statements a line span covers at its written indentation and splices it in; defers to `format_range` for a module/package-level target; consumes `fence::collect`/`with_trailing_comments` and `Fmt::item_seq`/`stmt_seq`; adds `Printer::print_at` and `FormatError::Selection`. `verify.rs`, `range.rs`, `fence.rs` untouched. The server's range, ranges and on-type `;` requests all go through it. |
| `completion-ux ──▶ on-type-formatting / inline-templates / completion-core / member-completion` | depends | (2026-11-17, TODO §68.1) the newline on-type answer writes an owed `end` (`on_type/auto_end.rs`, `begin_owes_an_end` shared with the `begin` ghost); keyword ghosts after the template triggers (`inline/keywords.rs`, follows `selectedCompletionInfo`); sortText tiers 2/3 are this buffer's declared names and used words (`completion/buffer.rs`); connection items keep connected ports and insert `name($1)` (`completion/connection.rs`). Extension `typing.js` sends the on-type request when `editor.formatOnType` is off. Server crate only. |
| `port-entry-grace ──▶ header-recovery / pull-diagnostics / change-debounce` | depends | (2026-11-17, TODO §68.2) tolerant-mode recovery of an unfinished named connection in `parser/recover_list.rs` (lone `.`, value left open at its line end, trailing `,` — always a diagnostic inside the entry; strict mode and valid code unchanged); `state/port_grace.rs` withholds the diagnostics of the entry the last edit touched for `PORT_ENTRY_GRACE` (1.5 s) in a named-connection list of an instance, released by the main loop's timeout, an edit elsewhere, or a save; `workspace/diagnostic/refresh` for pulling clients. A trailing `,` in a named list is now a tolerant diagnostic — read by Format Selection, the refactor check and the MCP placement check. |
| `alignment ──▶ spans` (+ name-spans) | depends | Anchor columns are derived from `name_span` byte offsets + the source text; deliberately **no** token-level representation of spacing. `doc.rs`/`printer.rs`/`verify.rs` untouched. |
| `alignment ──▶ format-fences` | depends | `fence::region_at` (via `Fmt::is_fenced`) keeps fenced items out of alignment groups. |
| `shared-fence-filter ◀──▶ linter-core / server-lint` | handshake | Closes server-lint Handshake 3: `fence::protected_regions` + `is_protected` become the **one** answer to "what may an automatic fix not touch"; CLI `--fix` and server quick fixes both call it; `vlog_linter` itself deliberately stays fence-blind. |
| `recursion-limit ◀──▶ parallel-files` | handshake | recursion-limit requires every parsing thread to use `vlog_parser::PARSE_STACK_SIZE` (currently 16 MiB); parallel-files points the rayon pool at the constant, and the later stack audit put the CLI/server main work on named threads using the same value. Tests fail if a spawn site drifts. |
| `recursion-limit ◀──▶ error-recovery` | handshake | Recovery must not reset `depth`/`links` while unwinding; error-recovery proves it with white-box + mutation tests. |
| `one-parse ◀──▶ linter-core / server-lint` | handshake | Both filed the "one parse, two tools" request; one-parse delivered `LintContext::from_parse` + `ParsedSource`, `Document` gained its `tree` field, and both front ends lint from one parse. Behavior byte-identical was the gate. |
Standing discipline for every feature in this lane (and any feature touching
the formatter): **`verify.rs` widening is guilty until proven innocent**
(CLAUDE.md #4). The only widening ever shipped is macro-items'
backtick-`Ident` arm in `normalize` — the normalization that produced
lucisv's one real corruption (2026-08-19, shipped without attack tests). Its
repair, `trim_lines_outside_strings`, is a *narrowing*, and it shipped with
the rejection tests the widening lacked. Every other round states
"`verify.rs` untouched" and adds *rejection/attack tests anyway*. Treat that
as the template.
### 2.2 Parser grammar / corpus lane
`corpus-check` is the measuring instrument for the whole lane: it defines
the buckets, and each grammar feature empties one and *advances* files into
the next — a sequencing chain, not a code dependency. The lane's members:
the sixteen bucket features (macro-items, classes, **bind**, **dynamic-types**,
**types-decls**, item-misc, directives-in-lists, directives-in-instances,
dpi-export, assertions, interfaces, expressions-2, dv-statements, mop-up-2,
directive-split, ansi-first-port) plus the parser-infrastructure features
(spans, name-spans, error-recovery, lexer-cleanup, define-table, and
recursion-limit, whose edges sit in §2.1). Code edges:
| edge | kind | contract |
|---|---|---|
| every grammar feature `──▶ corpus-check` | depends | The bucket scores and first-blocker histograms are how each round chose its target and measured its result. |
| `classes ◀──▶ vlog_parser::parse` | handshake | `parse(tokens)` became `parse(tokens, source)` — verbatim capture needs source in strict mode; every caller updated in the same change. |
| `assertions ──▶ classes` | depends | Reuses `verbatim_since`/`skip_balanced` (the constraint/covergroup capture) unchanged; adds `StmtKind::Verbatim`. |
| `directive-split ──▶ assertions / classes` | depends | Fifth producer of `ItemKind::Verbatim`; reuses the capture and `Fmt::raw_text` unchanged. |
| `item-misc ──▶ macro-items` | depends | Extends `at_macro_item` (spaced argument lists, `` `error``/`` `warning``); same verbatim contract, `RawText.col` still load-bearing. |
| `classes ─▶ macro-items` | refined in place | classes added the one-line `#(`-lookahead refinement to `at_macro_item` (the `` `uvm_component_new`` + parameterized-declaration idiom) — documented in classes' Handshakes, safety property unchanged. |
| `dynamic-types ─▶ ast::Dim` consumers | non-additive change | `Dim` became `{ kind: DimKind, span }` — the lane's **only** vector-element/shape change in history; every consumer was found by grep and updated (`Fmt::dim`, `bind_dims`, the spans walker). The precedent §3.3's "prefer additive fields" rule exists to avoid repeating. |
| `mop-up-2 ──▶ macro-items / dv-statements` | depends | Delivers the macro-followed-by-symbol fix dv-statements filed against macro-items, plus `new obj` (the expressions request from dv-statements) and base-only numbers. |
| `directives-in-instances ──▶ directives-in-lists` | depends | Reuses `ListDirective` and `take_list_directives` verbatim; same additive-fields shape chosen for the same blast-radius reason. |
| `dpi-export ─▶ dv-statements` | sequencing | Handed `csr_utils_pkg.sv` on (its next blocker was a `foreach`, a dv-statements shape). Typical of many one-way "your bucket now" notes across this lane. |
| `interfaces ─▶ expressions-2` | sequencing | Two files advanced to `->` implication and drive strengths; expressions-2 emptied that bucket. |
| `classes ◀──▶ class-semantics` | handshake | classes shipped with the honest gap "no name inside a class body is indexed"; class-semantics closed it (see §2.5). |
| `classes ─▶ format-fences` | open request | `fence::scan_nested` has no `Class` arm, so a fence inside a class body is inert **for the formatter** (the `protected_regions` line-scan backstop still protects `--fix`). Filed, not fixed — §2.9. |
| `ansi-first-port ◀──▶ type-definition` | handshake | type-definition filed the "first port with no direction doesn't parse" request; ansi-first-port delivered it (parser + one `bind_data_type` arm + one `type_span` tweak), and type-definition's tests flipped. |
| `out-of-class-constraints ──▶ classes` | depends | Reuses the verbatim constraint capture and `parse_method_name` unchanged; one line in `parse_constraint`, no new AST variant, so none of the exhaustive-arm blast radius applies (2026-08-29 testbench wave, Lane A). |
| `directive-in-statements ──▶ directive-split / directives-in-lists / assertions` | depends | The mirror-image recovery: a directive OPENING inside a statement/expression, captured verbatim through `construct_end` (Semi / endfunction+label / Unknown → refuse) and `terminated_in_arm`; `take_list_directives` additionally stops harvesting an outer region's `` `else `` as a list element. No new AST variant (2026-08-29 testbench wave, serial round). |
| `directive-in-statements ◀──▶ formatter-bug-fixes` | handshake | formatter-bug-fixes round 2 filed the `take_before_open` pending-comment drain; directive-in-statements delivered it as `Parser::take_gap` (comments kept only when `span.start >= last_end()`, `CallComments::dangling` included — the specified fix alone was insufficient). The refusal pin flipped to a formats case on the merged tree, closing the last bucket-2 file (`keymgr_scoreboard.sv`). |
| `null-items ──▶ corpus-check / safety-net` | depends | `ItemKind::Empty` (2026-09-01): a lone `;` where an item belongs — IEEE 1800-2017 A.1.4's null item — accepted in every item scope by one branch at the top of `parse_item_kind`. The variant's exhaustive-arm cost was paid in exactly the three places §3.3 predicts (`format.rs`, `bind.rs`, `tests/spans.rs`); every other walker is catch-all and a leaf needs nothing. Formatter layout is decided from `src` spans in `item_seq` (glued to the previous sibling's line when no newline separates them and the `;` carries no docs of its own; else its own line), so the AST carries no layout flag. `verify.rs` untouched, seven attack pairs added; corpus byte-identical at 813/820, measured against the pre-change binary. Ships with the `empty-item` lint (slang's `-Wempty-member`) and its safe fix — see §2.4. |
| `escaped-identifiers ──▶ safety-net / spans` | depends | (2026-09-02) An escaped identifier is terminated by whitespace (IEEE 1800 §5.6.1) and the lexer ends the token *before* it, so the formatter — which emitted every name bare or through a `format!` splice — produced `\my-signal;`, one token on re-lex, and the safety net refused the whole file. Fix: one choke point (`format::named`/`name_doc`, predicate `ends_escaped` because parser-joined composites end inside an escaped name) that fifty emission sites go through; the space is unconditional and the printer's trailing trim removes it before a break. `verify.rs` untouched, eight attack pairs; corpus neutral by construction. Ran in a worktree in parallel with member-completion (disjoint files). Open: §2.9-21. |
| `comment-slots ──▶ parser / formatter / safety-net` | depends | (2026-09-02) Hard invariant #3 made true at every inter-token gap: `Parser::bump` queues a comment and `take_meta` hands it to the *next* node, so a gap with no field printed it one node later and `verify.rs` refused the file. ~70 named slots, each printed through `Fmt::slot_comments` (a no-op when empty, which is why 860 corpus + 3 975 opentitan files are byte-identical to v0.30.0), one owner per `;` (`StmtKind::takes_semi()` + a `debug_assert!`), boxed expression slots so `Expr` stays 96 bytes. Four gap fuzzers at zero are the regression gate. `verify.rs` untouched; ten attack pairs. Also carried H5 (`nav::definition` macro branch sharing hover's `macro_name`/`narrowed_to_the_include_graph`), M11 (`bind_type_expr`: a cast's type binds as a type, `FACTS_FORMAT` 13 → 14) and §2.9-20/21. One flagged edit outside scope: `vlog_linter/src/signals.rs` pattern `..`. Closed §2.9-20/21/22; opened §2.9-23. |
| `bind-semantics ──▶ bind / macro-items / directives-in-instances / inline-instantiation / null-items / constraint-bodies / comment-slots` | depends | (2026-09-02) Three residues and a command on existing precedents. **M4** (expression-position `` `WIDTH (a + b) ``): `Fmt::spaced_macro_callee` reads the author's gap from `src` the way `glued_null_item` does — the gap is token text, not layout, so the two verify pins stand and `verify.rs` is untouched. **M5** (a conditional directive inside a connection value): `ExprKind::Verbatim(RawText)` for the balanced region (`Parser::conditional_region_end`), printed byte-exact through `raw_inline` as `Doc::Inline`, with `verbatim_value_breaks`/`holds_verbatim_value` read from `src` so the `)` after an `` `endif `` keeps its line and the list breaks — the instantiation node survives, so its edge, lens and port references do (opentitan: 2 `padring` instantiations un-opaqued, +2 edges; the directive-split `tb.sv` stays filed). **M6** and the command: §2.9-15 and §2.9-19. One visibility change outside the plan: `completion::layout_at` is `pub(crate)` again. Evidence corrected in `coverage_gaps.md`: the spaced-macro population is 33 files, all item-position and already formatting; the directive-in-connection population is 3, none in the `.name(` ⏎ `` `ifdef `` shape. |
| `sva-bodies ──▶ assertions / constraint-bodies / covergroup-bodies / comment-slots / refactor-rename / semantic-lints` | depends | (2026-09-02) The SVA half of coverage_gaps C1/M8. `property`/`sequence` declarations, concurrent `assert`/`assume`/`cover`/`restrict property`, `expect`, `cover sequence` and `default disable iff` are real nodes: `sequence_expr`/`property_expr` as one precedence-climbing extension of `parse_expr` (the README's table is IEEE 1800-2017 **Table 16-3** row by row — QA caught two rows transcribed from Table 11-2 instead: `nexttime`/`s_nexttime` sit on `not`'s row, and the whole loosest row — `always`/`eventually`/`accept_on`/`reject_on`/`sync_*`/`if`/`case` — is read position-independently with a `property_expr` operand at precedence 0; a right-associative operator at or below `iff` likewise reads its right operand at 0), typed formals, assertion variables, action blocks as the statements they are — behind a `Rewind` snapshot with a byte-exact per-construct verbatim fallback that fires on 0 of 4 792 files. Nothing reserved: operator words are text-matched in SVA position only. One layout rule: top-level `\|->`/`\|=>`/`##`/`and`/`or` break one per line at the parent's indent when the spec does not fit. SVA gap fuzzer 705/0; 46 attack pairs plus the accepted transformation; `verify.rs` untouched; `tests/census.rs::sva_lines` proves every changed line of the 49 moved files lies inside an SVA construct. Semantics: `SymbolKind::{Property, Sequence}`, `ScopeKind::PropSeq`, instances resolve in-file and cross-file (`FACTS_FORMAT` 15 → 16); rename/references/lints see inside; `Scope::sva_fallback_warnings` for what would fall back. Output moved in 13 corpus + 36 opentitan files, all inside assertion text. |
| `macro-word-census ──▶ semantic-lints-on / refactor-rename / index-persistence / lint-rules-2` | depends | (2026-09-02, TODO §29) `FileFacts::macro_words` (`words::harvest_raw`, tag `MW`, `FACTS_FORMAT` 16 → 17) and `WorkspaceIndex::files_naming_in_macros`; `lucisv_server::rename` warns about every file naming the old name inside a macro invocation that lies outside the set `rename_sources` built — the §2.9-18 ruling made real, nothing read. `vlog_refactor::Scope` promoted to the crate root (pure move). `lucisv check --rules-doc` prints `rules_markdown()` (§2.9-5). |
| `interface-dpi-arms ──▶ interfaces / dpi-export / comment-slots` | depends | (2026-09-02, TODO §30, M13) Modport method prototypes (`import task drive(int x)`) through `Parser::parse_tf_header`/`Fmt::tf_header`, the single header parse and print the function/task declarations now share; bound `Target::InScope` with the formals in a scope of their own; one prototype per `import`/`export` group (the comma list stays an error, recorded). Unnamed DPI formals behind `parse_tf_ports(allow_unnamed)`, the empty-name convention on `TfArg::name`. `const /*c*/ ref` gap owned (`TfArg::after_const`). Zero corpus population; 4 807 files byte-identical. |
| `statement-fences ──▶ format-fences / classes / shared-fence-filter / range-formatting` | depends | (2026-09-02, TODO §31, M9) Fences at statement level and inside class bodies; `protected_regions`/`is_protected` signatures untouched so `lucisv/src/lint.rs` and `lucisv_server/src/lint.rs` are byte-identical; `verify.rs` untouched. One narrowing: a fence written after code on the same line is an ordinary comment everywhere now (it already was at statement level and in the documented rule). |
| `header-recovery ──▶ error-recovery / parser / lucisv_server` | depends | (2026-09-04, TODO §32, M10) An `Error(RawText)` element in the four list element types (`ListElem<T>`) and `ExprKind::Error`; `element_or_recover` with a list-local, bracket-seeded sync set; `list_ends` ends any list whose iteration left the cursor unmoved — the structural guarantee that closes the non-advancing loop which exhausted memory on the first cut (the reason `tools/guard.sh` exists); headers keep their node so bodies bind in the right scope; recovery declines on a conditional-compilation directive so `split.rs`'s verbatim rescue keeps strict parity. Every consumer of a port/param/connection/tf-arg list reads it through `ListElem::ok`. Opened §2.9-24. |
| `linter-expansion-1 ──▶ linter-core / semantic-lints-on / editor-settings / vlog_semantic` | depends | (2026-09-03, TODO §33) `Severity` on every rule (Error / Warning / Style) carried through CLI text and JSON, editor `ERROR/WARNING/INFORMATION`, `--rules-doc`, and select/ignore by class word; VS Code `lucisv.lint.severity.*` switches and tri-state `lucisv.lint.rules.<rule>` toggles generated by `vlog_linter::vscode` with a drift test; `lint::enabled_rules` is the one ladder (defaults → select → class switches → per-rule → ignore). Nineteen Error/Warning rules; `Semantics::duplicates()` added additively (no store change). |
| `linter-expansion-2 ──▶ linter-expansion-1 / config-discovery / editor-settings` | depends | (2026-09-04, TODO §34) Per-rule options: `OptionSpec`/`RuleOptions` with one validator behind `[lint.<rule>]` tables (accepted now; `lucisv_core::config` stores them raw) and the editor's `lucisv.lint.options` (bad entries logged and dropped); precedence editor > toml > default key by key; an in-house anchored regex engine run as a Thompson-NFA simulation (linear by construction; unknown escapes refused by name). Eighteen Style rules; the four naming rules take Verible's option spellings with byte-identical defaults; `typedef-structs-unions` allows nested anonymous aggregates by default (lead ruling, opentitan measurement). |
| `linter-expansion-3 ──▶ linter-expansion-2` | depends | (2026-09-04, TODO §35) The remaining nineteen Verible rules (73 in all — every published Verible rule but `forbid-implicit-declarations`); Verible's `forbidden-symbol` is the source-file name of `invalid-system-task-function`, so it is that rule's `symbols` option; `void-cast` gains `forbidden_calls`; the lifetime rules exempt out-of-body definitions (census: 948 of 960 findings). Opened §2.9-25. |
| `constraint-bodies ──▶ classes / out-of-class-constraints / dv-statements / safety-net` | depends | (2026-09-02, round 1 of coverage_gaps C1) `ItemKind::Constraint(ConstraintDecl)` with a structured `ConstraintSet` (`Expr{soft}`, `Implication`, `If`, `Foreach`, `SolveBefore`, `Unique`, `DisableSoft`, `Directive`, `Empty`), `ExprKind::Dist`, and `WithConstraint.block` as `ConstraintBody::{Items, Verbatim}`. The parser takes a `Rewind` snapshot (cursor, **both pending-comment buckets**, depth, links, `open_conds`, diagnostics length), attempts the structured body, and on any error restores it and re-runs v0.26.0's verbatim capture character for character — so an unknown shape *is* the old behavior, not an approximation (pinned on text, slice and `col`). **No keywords reserved**: `soft`/`dist`/`solve`/`before` are matched by text like `restrict`, so `token.rs`, `pairs.rs`, the editor grammar and `tests/grammar.rs` are untouched and `logic before;` keeps working; `:=`/`:/` stay two tokens with a span-adjacency check (a `:/` token would swallow `:/* c */`). Canonical layout: one item per line, `}` at the header column, dist weights as a braced list; a `with` block keeps the source's one-line-or-not shape. `verify.rs` untouched; the constraint attack pairs re-derived plus new ones. Exhaustive arms paid in `format.rs`, `bind.rs`, `tests/spans.rs`; `visit.rs` gets an explicit no-op arm (no items/statements inside). **QA rework**: comments after the round's own text-matched words were dropped; the dev answered with an exhaustive gap fuzzer (a `/*C*/` in every inter-token gap of 15 fixtures, 358 gaps, format + idempotency demanded) and 14 named comment fields plus `ConstraintItemKind::takes_semi()` (one owner of the `;`) and `Parser::gap_before` (the closer-side twin of `take_before_open`); 96 regressions vs v0.26.0 became 40, all in shared machinery outside this lane — §2.9-22. Opentitan: 1 993 of 2 009 bodies structured (fallbacks: 10 macro-item bodies, 6 non-LRM shapes), failure set unchanged, per-file tolerant diagnostics identical, 48 DV files idempotent with comment streams byte-identical. |
| `covergroup-bodies ──▶ constraint-bodies / classes / safety-net` | depends | (2026-09-02, round 2 of coverage_gaps C1) `ItemKind::Covergroup(Box<CovergroupDecl>)` with `CoverItemKind::{Coverpoint, Cross, Option, Directive, Empty}`, `BinDecl { wildcard, kind, name, array, spec: BinSpec::{Values, Transitions, Default, DefaultSequence, Select}, with_expr, iff }`, `SelectExpr` for `binsof … intersect … && !binsof`, one `CoverageEvent` enum. Same `Rewind` fallback as constraints — v0.27.0's flat scan re-run character for character on any failure — and no keywords reserved (`coverpoint`, `bins`, `cross`, `binsof`, `intersect`, `wildcard`, `ignore_bins`, `illegal_bins`, `option`, `type_option` by text). **Two guards in shared expression machinery, the round's one risk**: `at_postfix_segment` refuses `[` followed by `*`/`->`/`=` (no index can start with those — it is what lets `1'b1[*5]` be a transition repeat), and a `no_with` flag while a bin spec operand is read (so the bin's own `with (…)` filter is not eaten as an array-method iterator argument); `(`-disambiguation is by position, the LRM's own rule. `plain_expr_list` → `plain_list` and `constraint_parens` → `guard_parens`, shared with `iff`/`with`. `verify.rs` untouched, twelve attack pairs. The gap fuzzer was built in from day one (329 gaps, 52 fail, all §2.9-22 shared machinery — *asserted* by running each shape outside a covergroup). Opentitan: 544 of 544 covergroups structured, 87/87 DV covergroup files idempotent, failure set and per-file diagnostics identical. `on_type.rs` keeps `covergroup` OPAQUE by argument. |
| `fragment-mode ──▶ error-recovery / define-table / lexer-cleanup / covergroup-bodies` | depends | (2026-09-02, coverage_gaps H4 corrected) Class-body and module-item `.svh` fragments already parsed — the file-scope item loop *is* the class-item loop; the three shapes that did not (statement lists, enum-member lists, cover-item lists) become `SourceFile::fragment: Option<Fragment>` (`items` empty iff `fragment` is `Some`). Detection is a whole-file rule, not an error-message match: the FIRST STRUCTURAL item failed (directives, macro items and null items are legal in every body and do not count; a tolerant `Ok` that recorded a diagnostic counts as failed — the `if … else` generate-vs-statement parity bug), the file does not open with a design-unit keyword, and a shape consumes the file to EOF, tried narrowest-first (cover items → enum members → statements: the wider grammars mis-read the narrower). Each shape re-lexes a fresh token stream — `Rewind` deliberately does not restore the tokens' comment buckets, right for verbatim captures and fatal here. Shared loops lifted (`parse_enum_members`, `parse_cover_items`); formatter prints a fragment at indent 0 through existing printers; binder gives statements a file `Block` scope and enum variants file scope; **no census change** (a fragment's variants are not exported — `pkg::CUSTOM_1` must not resolve to a name that does not exist), FACTS stays 12. Separately, the lexer continues a `` `define `` whose formal-argument `(` touches the name and is still open at end of line, no backslash needed until the list closes — `cip_base_vseq__tl_errors.svh`'s real blocker. Corpus 813 → 814/820; opentitan 12 → 10, exactly the two predicted files. |
| `vendor-formal-grammar ──▶ corpus-check / classes / type-hierarchy / editor-scopes` | depends | (2026-09-02, coverage_gaps M1–M3 + L1/L2/L4/L5, with the evidence corrected: every construct here has 0 declarations in the corpus and in opentitan — the analysis's "13 checker files" were UVM protocol-checker filenames — so this is a completeness round, proven output-neutral: formatted output byte-identical for all 860 corpus and all 3 975 opentitan files against a v0.29.0 build.) Five keywords reserved on a measured 0-collision census (`checker`, `endchecker`, `config`, `endconfig`, `library`) — the tmLanguage alternation hand-edited under `tests/grammar.rs`'s lock — and five deliberately NOT (`expect` has 41 real task-call sites; `tagged`, `design`, `instance`, `cell`, `use` only stand inside blocks that are opaque). One `parse_opaque_block(close)` (the covergroup-verbatim template; counts its own opener; keeps `: label`; leaves a trailing `;` as the null item `empty-item` sees) serves `specify`/`primitive`/`table`/`checker`/`config`; `parse_opaque_line` serves `library …;`; `SYNC_CLOSERS` gains the five closers. `specparam` is a real `ParamDecl` (`LocalParam` kind) with a rewind to the opaque line for `PATHPULSE$`. `alias` is `ItemKind::Alias(Vec<Expr>)`; `union tagged` a flag on `StructType`; statement `expect` is read as an assertion only when its parenthesised run holds a sequence operator, else it stays the call it always was. `interface class` routes to `parse_class` via the existing `prefix` — **no new kind, no FACTS bump** (deliberately, so it cannot collide with §24's bump) — and type-hierarchy's `bases_of` follows `implements` through the same `classes_at` hop as `extends` (the two blocking pins flipped). pairs.rs gains `table`/`checker`/`config` rows; on_type's OPAQUE gains the five openers. Filed: the reverse `implements` edge in `subtypes`, checker/UDP names as instantiable symbols, the `tagged` pattern grammar, `include …;` in library maps; `alias` loses a gap comment exactly where `defparam` does (§2.9-22 parity, pinned). |
| `formatter-bug-fixes (round 2) ──▶ safety-net` | depends | Three comment-shape bugs fixed in `format.rs` (`then_is_block` trailing-line-comment cuddle guard, `Fmt::header_parens`, `default_has_colon`); `verify.rs` untouched, four masked-corruption rejection pairs added per the standing template, plus three more for the directive capture at merge (2026-08-29 testbench wave, Lane B + lead). |
| `lexer-cleanup ──▶ error-recovery / lint-rules-2` (QA logs) | depends | Fixes three lexer gaps: `@(* )` (TODO §1) plus the BOM and non-ASCII-honesty findings those two QA rounds filed; adds `ParsedSource::lex_error()` so `lucisv check` stops silently passing unlexable files. |
| `error-recovery ─▶ lucisv-server / linter-core` | depends (downstream) | `parse_source_tolerant` is the entry point the whole LSP and the linter stand on; the strict/tolerant split (shared grammar, no second parser) is the contract. |
| `name-spans ◀──▶ vlog-semantic` | handshake | vlog-semantic filed request 1 (spans on ~15 declaring nodes); name-spans delivered it, shrinking `scan.rs` to the `DataType` case; type-name-spans (§47, 2026-09-05) delivered the `DataType` case and deleted `scan.rs`. |
| `spans ─▶ everything positional` | depends | Byte ranges + `LineIndex` are the prerequisite named by TODO §6 for the LSP effort and by fences/range formatting. |
Also uniform in this lane: each new AST variant lists its exhaustive-match
blast radius (formatter arm, `bind.rs` arm, `spans.rs` arm) — that checklist
**is** the interface cost of touching `ast.rs`, and §3.3 restates it as a
rule. `vlog_linter`'s `visit.rs` is catch-all **for compilation only**: a new
variant that *contains items or statements* still needs an arm there, or no
AST lint rule ever descends into it (dv-statements added two such arms;
classes' missing one was a filed coverage gap, closed by lint-rules-2).
### 2.3 CLI lane
A clean promise chain — each feature consumed the previous one's written
promise:
| edge | kind | contract |
|---|---|---|
| `config-discovery ──▶ cli-polish` | depends | Consumed `Options.stdin_filename` exactly as promised (discovery anchor only) and `Options.exclude` as the CLI layer config patterns append to. |
| `parallel-files ◀──▶ cli-polish` | handshake | cli-polish flagged its hook-swapping `catch_panic` as single-thread-only; parallel-files replaced it with one startup hook + thread-local flag. **Anyone editing `catch_panic` must keep it that way.** |
| `parallel-files ──▶ config-discovery` | depends | Consumed the promise that config resolution happens up front in `gather`, producing the exact `Vec<(PathBuf, Config)>` work list a `par_iter` wants. |
| `format-cache ──▶ parallel-files` | depends | Consumed the promise that `process_file` is the per-file unit of work and `Outcome` the place a `Cached` bucket goes. |
| `format-cache ──▶ config-discovery` | depends | Consumed the cache-key promise: key includes resolved per-file settings (values, not config-file identity). |
| `format-cache ─▶ every output-changing feature` | standing promise | **Any change to formatter output must bump the workspace version** or warm caches keep stale verdicts. Same discipline as ruff/black. |
| `cli-filelist ──▶ filelist` | depends | Reuses `lucisv_core::filelist::read` unchanged (M1 explicitly parked the `-f` flag for this round); drops `incdirs`/`defines` as meaningless to a non-preprocessing formatter. |
| `cli-polish / linter-core ─▶ corpus-check, CI users` | standing promise | The 0/1/2 exit-code contract is frozen; new modes map onto it, never extend it. |
| `lucisv-core-lift ◀──▶ lucisv-server` | handshake | Delivered the server's two filed requests (config discovery + ignore-aware walk) by lifting `config.rs`/`walk.rs` into `lucisv_core` unchanged; CLI behavior byte-identical. |
### 2.4 Linter lane
| edge | kind | contract |
|---|---|---|
| `linter-core ──▶ error-recovery` | depends | Lints the tolerant tree so unparseable files are still linted for what is visible. |
| `linter-core ──▶ format-fences` | depends | CLI `--fix` reads `fence` (already `pub`) to stay out of fenced regions — one answer to "what is fenced", not two (later formalized by shared-fence-filter). |
| `lint-harness ──▶ linter-core` | depends | Consumes only the public API; the `.lint` case format + "marker naming a dead rule fails the suite" is the enforcement of rule-name stability on the test side. |
| `lint-harness ──▶ safety-net` (via dev-dep) | depends | Every fix's output must be something `format_source` accepts. |
| `lint-rules-2 ◀──▶ classes` | handshake | Closes the classes handshake: `visit.rs` now walks class bodies, so the four AST rules see class members. |
| `semantic-lints ──▶ vlog-semantic` | depends | The three symbol-table rules; new (justified) crate dep `vlog_linter → vlog_semantic`; lazy analysis; the lead's pre-authorization to modify `vlog_semantic` went **unused** (recorded so it is not read as taken). |
| `semantic-lints ──▶ one-parse` | depends | Reaches the server and CLI through the existing one-parse path (`LintContext::semantics()` / `with_semantics`). |
| `server-lint ──▶ linter-core` | depends | Protocol wiring only; relies on the three written promises (stable names, no panics/writes, sorted findings). |
| `null-items ──▶ linter-core / shared-fence-filter` | depends | The `empty-item` rule (2026-09-01) walks `ItemKind::Empty` through `visit::walk_items`; its safe fix deletes the `;`, the horizontal whitespace before it, and the line only when nothing but whitespace and other null items stood on it — a final guard refuses any range holding a byte other than `;`/whitespace, so a same-line comment structurally cannot be swallowed (invariant 3). Rule name is stable API from this release on. |
| `server-lint ◀──▶ shared-fence-filter, one-parse` | handshake | Both of server-lint's filed requests were delivered by those rounds (fence-safe quick fixes; lint-from-Document). |
### 2.5 Semantics & index lane
| edge | kind | contract |
|---|---|---|
| `vlog-semantic ──▶ error-recovery, spans` | depends | Tolerant trees as input; span conventions throughout. |
| `workspace-index ──▶ vlog-semantic` | depends | Finishes `ExternalCandidate`s against what every file declares; the `paths` spelling contract is the coupling — if `bind.rs`/`resolve.rs` change a path's spelling, `workspace.rs::follow_one` changes with it. |
| `workspace-index ──▶ define-table` | depends | Each file's `` `define`` table is an index column (`find_define`). |
| `class-semantics ◀──▶ classes` | handshake | Delivers the filed gap; adds `SymbolKind::Class`, `ScopeKind::Class`, `InheritedCandidate` — with the two named compile-fix arms in `lucisv_server` (`tokens.rs`, `symbols.rs`). |
| `class-semantics ──▶ name-spans` | depends | Built on the delivered span fields; keeps `src[name_span] == name` corpus-asserted. |
| `overlay-promotion ◀──▶ type-definition` | handshake | Delivers type-definition's request 1: a **type-position** miss carries the bare name as its last candidate path (both miss spellings), so the overlay answers interfaces and package-less classes; type-definition then deleted its `indexed_type` fallback. Value-position misses unchanged — that asymmetry is the contract. |
| `type-hierarchy ──▶ overlay-promotion` | depends | The whole cross-file half is overlay-promotion being consumed at the `extends` offset. |
| `incremental-index ◀──▶ code-lens, hierarchy, type-hierarchy` | handshake | Delivers the jointly-filed edge tables: `instantiations_of` / `subclasses_of` recorded at build time; `callers_of_each` and `subtypes` became lookups (92 ms→0.26 ms, 82 ms→0.71 ms). Census policy carried over by construction: the walks (`instantiations.rs`, `classes.rs`) were **lifted into `vlog_semantic`**, not copied. |
| `incremental-index ──▶ indexing-ux` | depends | Amends the event story: a one-file update reports no events (one parse is not a scan); invariant: `update_file` yields byte-for-byte the index a full rebuild would (`fingerprint` is the witness; `update_one_checked` the test form). |
| `index-scope ◀──▶ indexing-ux` | handshake | Closes indexing-ux's QA finding by making `IndexBuilder` order-insensitive (sort/dedup in `finish`); `index_order` survives for the progress denominator. |
| `index-scope ──▶ filelist` | depends | Rung 1 (a filelist defines the scope exactly) is untouched; rungs 2/3 of the scope ladder were re-written (folder-scoped, open-file-first) — the ladder itself is the contract, documented in both READMEs. |
| `index-persistence ──▶ incremental-index` | depends | `update_one` writes its record through via `WorkspaceIndex::facts_for` (no double parse). |
| `index-persistence ──▶ format-cache` (lucisv_core) | depends | Reuses `lucisv_core::cache::content_hash` — one FNV-1a shared with the format cache, not a second copy. Also one additive `vlog_parser` touch: `DefineTable::from_entries` + `PartialEq`/`Eq` derives, so a record restores a table without re-reading a file. |
| `index-persistence ◀──▶ indexing-ux` | handshake | `IndexEvent::Cached` — a new variant, so every consumer is forced to say what it does with an unparsed file; the end message names the cached count. |
| `port-detail-spans ◀──▶ index-persistence` | handshake | A declaration record grew two numbers (the detail span, written unconditionally as `0 0` for the `None` every ordinary declaration has), so **`FACTS_FORMAT` went 2 → 3** and every store written by an earlier build is discarded whole rather than read field-shifted. The bump *is* the contract: `index_cache.rs`'s header line carries the number, and the reader's `done()` check is a backstop, not a version scheme. |
| `vscode-hierarchy-sidebar ◀──▶ index-persistence / hover-line-index / incremental-index` | handshake | **`FACTS_FORMAT` 4 → 5**, one bump for three additions: `Def::decl_span`; `InstantiationEdge::instances` (a `Vec<InstanceOccurrence>` — the statement edge stays one-per-statement, so call hierarchy and code-lens counts are unchanged and the census is still the one `instantiations::sites` walk); and client positions — `DeclLines::positions: Option<DeclPositions>` on **file-scope declarations only**, plus `Utf16Range` on every instance occurrence. Members deliberately carry none: they outnumber units by two orders of magnitude, and the `U`/`M` groups are separate, so a member costs no field at all. `FileFacts::from_analysis` grew a `src: &str` parameter (a position cannot be read off a line table). Measured store cost of the positions: +1.69 % on the 820-file corpus, +1.86 % on opentitan. |
| `vscode-hierarchy-sidebar ──▶ vlog_parser` | depends | `LineIndex::utf16_position` — byte offset to (0-based line, UTF-16 column), moved down beside the line table so the semantic index and `lucisv_server::convert::Positions` cannot answer differently. `Positions::position` is now a wrapper over it; the cross-crate equality is test-pinned. |
| `vscode-hierarchy-sidebar ◀──▶ workspace-index` | handshake | `WorkspaceIndex::units_of(kind)` — file-scope declarations of one kind, in name order, walking the unit table alone. The cheap half of `workspace_symbols("")` for a caller that never wants members; 15 ms per snapshot on opentitan. |
| `dut-hierarchy ──▶ vscode-hierarchy-sidebar` | depends | TODO §56 (2026-09-06): `hierarchySections.js` consumes the sidebar's model (`rootNode`, the reverse instance index memoised on the model) and its webview renderer's row menu; no edge to any Rust crate — the server is untouched. |
| `coverage-gaps-l` (TODO §54, 0.49.0) | lane | Touches `vlog_parser` (ast + parser + the `randsequence` keyword in the token table), `vlog_formatter` (arms, `[format] uvm-utils-indent`), `vlog_semantic` (bind arms), `vlog_linter`, `vlog_refactor` (match arms), `lucisv_core` (the config key), `lucisv_server` (settings, format) and `editors/vscode` (the setting, the regenerated grammar). New AST: `StmtKind::{EventTrigger, Let, RandSequence}`, `ExprKind::StreamWith`, `DataDecl::strength`, `ClockingSkew`; `size_pins` unmoved. |
| `hover-line-index ──▶ port-detail-spans / index-persistence` | depends + handshake | `DeclLines { name, detail }` rides each indexed `Decl`, so ordinary and split-port hover headings do not reread a file just to compute a line. The record grew again and **`FACTS_FORMAT` went 3 → 4**; the server's bounded `FileView` cache supplies the text/`LineIndex` only when a snippet or a non-indexed position still needs it. Its four invalidation points are `set_document`, `close_document`, `update_one`, and a whole rebuild. |
| `scan-interleave ◀──▶ workspace-index` | handshake | A scan is a stepped `Scan` value; staged `FileFacts` land through `WorkspaceIndex::absorb`, one whole-index merge per queue drain rather than per file. `Candidates::absorb` and (until perf5-p4, `IncludeGraph::absorb`; since 2026-09-08 the graph is rebuilt from each file's staged include list, `IncludeGraph::from_includes`, read in the file's own step) publish their tables in the same drain, so “the workspace as far as scanned” cannot mean three different prefixes. **Amended by perf5-p4 (2026-09-08):** the startup is staged behind the `workspace/configuration` answer with a 2 s bound (`server/startup.rs`), so there is one startup scan at the answered scope and no empty default-scope scan (perf5r-first-answer, 2026-09-08: plus `OPENING_FILE_WAIT`, 25 ms inside that window, spent only by a workspace session whose opening burst holds no `didOpen`; and the scan is discovered in two phases when it pays — the open buffers' raised folders walked, stepped and published first, the rest of the scope walked as a zero-file step afterwards, `state/discover.rs::first_scope` + `PendingDiscovery`; bounded to rung 2, a raised folder that is a strict descendant of a root, at most `HEAD_WALK_MAX` = 512 files, and the session's first scan — otherwise today's single walk); the scan reads each file's text in its own step (`Scan::take_text`, never the whole corpus up front) and orders the work list open buffers → their raised folders → the rest (`scan_order.rs`); `must_wait` gains `staging` and `head_owed` — a held opening request is answered inside the startup scan once the buffers' folder head is published, never off a one-file prefix; **perf5r-publication (2026-09-08):** a scan publishes at most once per `PUBLISH_EVERY` = 512 staged files (the drain with something waiting exempt, so the first useful answer never moves) — a request between publishes reads a coherent prefix at most that far behind; an empty navigation answer (definition, typeDefinition, references) computed while a scan runs is put in `Server::deferred` and asked again at the next publish and at the latest at scan end (`deferred` is not in `must_wait`, so hover is unaffected), and a `$/cancelRequest` naming a deferred request answers it cancelled where the cancel lands (`cancel_deferred`); `HEAD_WALK_MAX` pinned by test; the store is opened at the first step that needs it and not rewritten when it was loaded canonical and nothing was appended (`index_cache.rs::already_compact`); `state.rs` is now `state/mod.rs` + `state/scan.rs` (a pure move). The rescan order contract (decision 2) is unchanged. |
| `scan-interleave ──▶ hover-line-index` | depends | Delivers hover-line-index's measured startup-wait request: a startup scan above 64 files drains queued messages between files. A rescan deliberately still holds requests; what an answer sees never depends on elapsed wall time. |
| `index-scope ──▶ scan-interleave` | depends | A scope widen is the second `Scan` shape (`begin_widen`) and shares `scan_step`/`finish_scan`; it folds only newly reached folders plus open-buffer analyses, never masquerades as a whole scan, and never interleaves. Folder scope now ships at depth 2; rootless sessions do not climb an unnamed tree. |
| `index-scope ──▶ one-parse / completion-core` | depends | Whole scans and widens reuse each open `Document`'s existing `FileFacts` and completion words rather than reparse its text. `IndexEvent::Analyzed` keeps this distinct from a persistent-cache hit. |
| `class-member-access ◀──▶ workspace-index / index-persistence / vlog-semantic` | handshake | **`FACTS_FORMAT` 5 → 6** (2026-09-01): the field layout is unchanged but the reference census grew — `head.member` tails (`Target::MemberOf`, resolved head → `Symbol::type_name` → class scope → member, in-file `extends` chase) and names inside out-of-class method bodies (a stand-in `Class` scope carrying the class path as `extends`) are references now, so older stores must be discarded whole. `WorkspaceIndex::base_of` is a subclass → base map rebuilt in `merge` from the existing inheritance census (no new facts field); the cross-file chase lives in `follow_one` so hover, references and rename cannot disagree about what a tail names. `Symbol::type_name` is the declared type as written, deliberately absent on unpacked declarators (`c1 q[$]`) so `q.size()` never resolves against `c1`. `resolve` returns `Option`: a tail with nothing to say records no reference (not `NotFound`), keeping `a_hierarchical_name_resolves_only_its_head` and the unresolved count byte-stable. |
| `class-member-access (round 2) ◀──▶ workspace-index / index-persistence / refactor-rename` | handshake | **`FACTS_FORMAT` 6 → 7** (2026-09-01): `Def::type_name` / `Decl::type_name` (the same capture rule as `Symbol::type_name`, now in `fingerprint`) and `ReferenceFact::External.base` (so `this.x`/`super.x` inherited uses post cross-file). Chains `a.b.c`: `Target::MemberOf { head, mids }` carries *spellings*, so the outer tail never depends on the inner's result — in-file `member_of` hops declared type → declared type; a chain leaving the file is ONE composed path `Unit::mid::tail` that `follow_one` walks via `member_type`, refusing a hop through a type name the workspace declares twice with different kinds. Instance heads: an instance symbol's `type_name` is its module; **modules export ports and parameters only** (lead ruling on measurement: nets/vars export cost +24 % store AND made `.port(w)` connections resolve to internal nets) — so `u.port` resolves cross-file, `u.internal` in-file only. Typedef-alias chase in `type_here`, file-scope typedefs cross-file. **Rename truth flipped**: `u_sub.sig` is sub's `wire sig` and is edited (`a_hierarchical_tail_that_resolves_is_renamed_with_its_declaration`); an unresolvable tail is left alone but no longer warned about — §2.9-20. |
| `bind-semantics ◀──▶ workspace-index / index-persistence` | handshake | **`FACTS_FORMAT` 14 → 15** (2026-09-02): a bind's connections now post references and its instantiation edge is recorded, so a 0.31.0 store would answer thinner; the store rebuilds once. |
| `sva-bodies ◀──▶ workspace-index / index-persistence` | handshake | **`FACTS_FORMAT` 15 → 16** (2026-09-02): property/sequence symbols, their scopes and instance references post to the index; a 0.32.0 store would answer nothing for them and rebuilds once. |
| `macro-word-census ◀──▶ workspace-index / index-persistence` | handshake | **`FACTS_FORMAT` 16 → 17** (2026-09-02): the `MW` group; a 0.33.0 store rebuilds once. |
| `interface-semantics ◀──▶ workspace-index / index-persistence / class-member-access / editor-scopes` | handshake | **`FACTS_FORMAT` 7 → 8** (2026-09-01): three new kind names (`Interface`, `Modport`, `Clocking`), no layout change. `SymbolKind::is_instantiable()` (`Module | Interface`) is the predicate every "is this a module" filter now reads — resolve (`Target::Module`/`Port`, container/member scopes), `is_unit`, the completion module table, `nearest_definition`/`module_header`, candidates, design hierarchy, call hierarchy, refactor `locate_module`/`module_definition`/`module_names` — each pinned in place; the sidebar's schema-2 wire shape is unchanged. Export: `Interface => Net | Var | Port | Param | Typedef | Function | Task | Modport | Clocking` (a module still exports ports and params only — round-2 ruling stands). Modport and clocking-block names are symbols; the names inside them are `Target::InScope` references (scope-local, nothing on a miss — a lexical walk would land a modport port on a file-scope lure); a clocking block carries `type_name` = its enclosing unit so `vif.cb.data` hops through round-2 machinery unchanged. The modport half of `bus_if.mp` in a type position is `Target::TypeMember { unit }`, resolved through `type_here`. `IndexCounts.interfaces` is separate so `modules` still means modules. Semantic-token legend deliberately not grown (indices are wire contract): Interface/Modport highlight as `class`, Clocking as `variable`. Rename truth flipped: a modport renames from its type-position use (`renaming_the_modport_half_of_a_port_type_renames_the_modport`). |
| `struct-members ◀──▶ workspace-index / index-persistence / class-member-access / type-definition` | handshake | **`FACTS_FORMAT` 8 → 9** (2026-09-01): struct members exported (`is_exported(Typedef \| StructMember, StructMember)`), fields declared with `declare_typed` so `s.hdr.addr` hops through a member's own type, and `collect_members` recursing into package-nested struct typedefs (bare-name key, the nested-class convention — two packages with a same-named struct typedef collide by name and answer `Ambiguous`/nothing, never a guess) and into **inline nested fields under a synthesized key `owner.field` joined with `.`** carried as the field's `Def::type_name` — `.` not `::` because `member_type` runs `last_segment` on it and `::` would collapse to the bare field name; the key is unwritable as a type name and passes `units()`'s ambiguity guard for free. This is what makes opentitan's generated register packages resolve (`hw2reg.status.txfull.d` picks `txfull`'s `d`, not `rxfull`'s). `resolve::member_scope` accepts any symbol whose child scope is `ScopeKind::Struct` — typedef, anonymous declarator or inline field, one rule. `type_def.rs::alias_site` descends into `typedef struct` bodies. Corpus unresolved 1 203 → 1 162; store shrank 1.14 % (resolved anonymous-enum variants encode smaller than the external candidates they replaced). |
| `constraint-bodies ◀──▶ class-semantics / class-member-access / index-persistence / semantic-lints` | handshake | **`FACTS_FORMAT` 10 → 11** (2026-09-02): `SymbolKind::Constraint` declared in the class scope (a stand-in `Class` scope for `constraint C::c`, the out-of-body-method mechanism reused); the body opens a scope under the class so every operand binds to the class's properties — rename from a `rand` field's declaration now rewrites its constraint uses, in-file and cross-file; `foreach` vars nest; `Target::InlineConstraint` resolves a `randomize() with { … }` operand against the randomized object's class first and the writing scope second. `Constraint` exported from `Class`. `signals.rs` reads constraint operands instead of routing the body to `opaque_spans` (a constraint reads, never drives). Corpus references +1 646, 84 % answered. Filed: a rename issued *from inside* an out-of-block constraint body whose class is elsewhere is refused by `vlog_refactor` (pre-existing — the same refusal `task C::m` bodies get). |
| `covergroup-bodies ◀──▶ class-semantics / class-member-access / index-persistence / semantic-lints` | handshake | **`FACTS_FORMAT` 11 → 12** (2026-09-02): `SymbolKind::{Covergroup, Coverpoint, Cross}` and `ScopeKind::Covergroup`; the covergroup opens a scope whose labelled coverpoints and crosses are symbols (an unlabelled coverpoint declares nothing), `sample()`/`(args)` parameters are visible in the body and nowhere else, every sampled expression, bin value and `iff` binds to the enclosing class's properties. `collect_members` recurses into a covergroup so `cg_inst.cp` resolves cross-file; `member_scope` accepts a `Covergroup` symbol. `signals.rs` reads coverpoint operands (a covergroup samples, never drives). Corpus references +1 139 with 1 135 answered. |
| `semantic-lints-on ◀──▶ workspace-index / index-persistence / linter-core / semantic-lints / completion-core / editor-settings` | handshake | **`FACTS_FORMAT` 12 → 13** (2026-09-02): `FileFacts::words`, a per-file sorted dedup'd identifier census from the token stream (macro/directive words included, comments and strings excluded by construction) — the one harvest `vlog_semantic::words` provides, which the server's completion word table is now built from instead of re-lexing every file at startup (scan −28 %). No inverted index: `files_mentioning`/`mentioned_outside` are a linear walk with a binary search per file, `files_spelling`'s own shape. `vlog_linter` gains `MentionOracle` (`LintContext::with_oracle`) and `Rule::needs_workspace()` + `workspace_rules()` beside an unchanged `default_rules()`: `unused-signal` and `undriven-net` say nothing when the oracle says the name is mentioned in another indexed file (the false-negative-safe direction), `multiply-driven` shares the gate but never reads it; the three are on whenever an oracle exists — the server always, the CLI when a multi-file job set is walked (a harvest pre-pass, +36 ms on the corpus over 10 cores, zero when the rules are ignored) — and off for a single file or stdin. The off switch shipped with it (§2.9-4). Store +14 % measured on both corpora; opentitan with the rules on reports 14 findings, spot-checked true. Filed: quick fixes ignore `lucisv.lint.*` (`code_action.rs`). |
| `rename-bind-occurrences ◀──▶ workspace-index / index-persistence / bind-semantics / refactor-rename` | handshake | **`FACTS_FORMAT` 19 → 20** (2026-09-11, TODO §63.1): no new field, a different answer in the same fields. A `bind` connection's expression half is a reference on the target's **hierarchical** surface under the `target::name` path (`resolve::in_bind_target` asked the connection surface — ports and parameters — so an internal net such as `bind aes chk u (.req(entropy_masking_req))` resolved to nothing and, with no name on the path, was never warned about); a hierarchical path in a bind connection is rooted at the bind target (`Target::BindMember { target, head, mids }`, one more arm of the `use_member` funnel, walking `descend`/`member_at` shared with `member_of`), and a multi-segment target (`bind tb.u_aes …`) is spelled `tb::u_aes` so `follow_one` folds it hop by hop. So definition, hover, references and rename answer over bind files where they answered nothing; `rename_preflight` refuses strictly less (a bind tail was `NOTHING_HERE`, now an external candidate it defers). A 0.53.0 store rebuilds once. Selection (`rename_sources_traced`'s `Reference` rung, `module_select.rs`) was never the gap; §2.9-33 stands. Known remainder: `nav.rs`'s `leaves_this_file`/`indexed_def_in_file` still ask the connection surface, so cross-file `references` misses hierarchical-surface-only declarations, bind or not (TODO loop-3 list). |
| `define-table ◀──▶ macro-expansion` | handshake | What began as free-to-change became contract at M14: params stored **as written**, `NAME()` = `Some(vec![])` — `expand.rs` counts arguments against them and declines on mismatch. |
### 2.6 Refactor lane (the M-plan)
`refactor` is the umbrella plan; M1–M4 are its milestones plus two follow-ups.
| edge | kind | contract |
|---|---|---|
| `filelist (M1) ──▶ refactor` | depends | The scope story: a `.f` filelist is the project file; parser in `lucisv_core` (so the CLI later reuses it — it did, cli-filelist), scope ladder in the server. |
| `refactor-rename (M2) ──▶ vlog-semantic / workspace-index` | depends | Every edit from a resolved span; whole-edit verification; refusals from `Resolution` variants. |
| `refactor-rename ◀──▶ vlog_semantic` | handshake | The one authorized cross-module change of M2: `Target::Declaration` + `use_end_label` (end labels must rename or the output doesn't compile). Strictly additive; logged in vlog-semantic's work log. |
| `refactor-ports (M3) ──▶ refactor-rename` | depends | Reuses M2's `check`/`Scope`; the two preprocessor scans were factored to return *sites* so M3 words its own warnings without inheriting M2's text (M2's wording pinned by its 48 tests). |
| `refactor-ports ◀──▶ incremental-index / lucisv_server` | handshake | `port_action_modules` and `enclosing_module` name the engine's possible module targets; `Workspace::module_sources` expands them through module declarations, `instantiations_of`, reference postings and open buffers. Code actions and all three commands use the same builder, and parity tests assert the narrowed result equals the old whole-scope result. The instantiation census in `vlog_semantic::instantiations` and `ports::collect_instantiations` must grow together. |
| `refactor-instantiate (M4) ──▶ workspace-index, editor-scopes` | depends | Plans from the index's real definitions; the item-position gate is built on `pairs::analyze`'s published output only. |
| `apply-edit ──▶ refactor-ports` | depends | The port commands now *push* `workspace/applyEdit` (the protocol's actual mechanism) instead of answering the edit as a result no client applies. `ports::execute`'s signature and behavior unchanged — the only `ports.rs` edit was correcting a now-false doc comment, so this is consumption, not a handshake. |
| `references-nav ──▶ refactor-rename` | depends | `find_references` is `Scope::collect_occurrences` lifted out of `collect_edits` — the references list and a rename's touch-set **cannot disagree**, by construction (deliberately not moved to `vlog_semantic`; the walk needs refactor-crate concerns). |
| `refactor-rename ◀──▶ workspace-index / lucisv_server` | handshake | `prepareRename` answers from the open `Document` plus index through `prepare_rename_here`; `rename` asks `rename_name_at` for the engine's target and feeds only `Workspace::rename_sources`'s six-rung superset. The rungs cover declarations/members, resolved postings, instantiation edges, macro definitions, every open buffer, and `files_spelling` for unresolved new-name uses; if a rung cannot bound a case it falls back to all sources. Refusal sentences and whole-scope parity are pinned. Macro-invocation warnings outside the selected source set were delivered by macro-word-census (§2.9-18). |
| `file-operations ◀──▶ include-nav / lucisv_server` | handshake | `IncludeGraph::includers` exposes the files that can contain a resolving include; `Workspace::include_sources` overlays open buffers and reads only that set for `willRenameFiles`, instead of the workspace. It is sound only while the graph's held-edge census and `resolve` agree. |
### 2.7 LSP server lane
`lucisv-server` is the trunk; everything below extends it. Edges to
engine-lane features are listed above; this table is the server-internal web.
| edge | kind | contract |
|---|---|---|
| `editor-scopes ─▶ (many)` | depends (consumed by) | `pairs.rs` — one stack matcher, eight consumers today: documentHighlight, missing-closer diagnostics, `lucisv/scopePairs` rainbow, folding (references-nav), the item-position gates (completion-core / refactor-instantiate), on-type-formatting's keyword tables, inline-templates' unmatched-`begin` check, expand-selection (`selection.rs`). The `RULES` table + guard list is the shared truth; a keyword change means re-checking it. |
| `editor-scopes ◀──▶ editors/vscode` | handshake | The `lucisv/scopePairs` wire shape (pinned as literal JSON in a test) and the `lucisv.rainbow*` colour ids that must match between `package.json` and `extension.js`. |
| `completion-core ──▶ define-table, vlog-semantic, workspace-index, refactor-instantiate` | depends | Five tiers over existing facts; the parser widening (`KEYWORDS` export) is its one engine touch. Deliberate duplication recorded: `visible_symbols` vs `ports::visible_in` share an idea, not code. Since the performance wave, tier 0 reads module names from `Candidates::modules` (built once with the index); equality with `vlog_refactor::module_names` is test-pinned. Since 2026-08-30 tier 0 is names-only — no file read, no plan — and the guarded header-slice planning (`module_header`/`plan_for`) serves only `inline.rs`'s exact-match ghost (see the inline-instantiation handshake). |
| `fuzzy-completion ◀──▶ completion-core` | handshake | The matching rule (2026-08-30, owner policy = VS Code's own): below `FUZZY_MIN = 3` typed characters every tier matches by prefix, byte-for-byte the old behavior; from 3 up the scope, index-name and word tiers match by case-insensitive **subsequence**, ranked prefix-first then score (`Score`/`rank_cmp`), served top-K under the same `LIMIT`. `Candidates` carries parallel 32-bit char-mask tables (`unit_masks`/`word_masks`, written in exactly two places — `take_index_tables`, `remask_words` — so table and mask cannot desync) and `Query`/`units_fuzzy`/`words_fuzzy`. **Wire contract:** every response below the floor is `isIncomplete: true` — a complete 2-char answer would be client-filtered and the 3rd keystroke (the one that turns fuzzy on) would never reach the server; above the floor incompleteness follows truncation, sound because appending characters only shrinks a subsequence hit set. Module (substring), keyword, template and macro tiers unchanged; `inline.rs`'s `has_module` ghost probe stays exact and case-sensitive — fuzzy must never leak into it. |
| `member-completion ◀──▶ completion-core / class-member-access / interface-semantics / struct-members / signature-help` | handshake | (2026-09-02) The exclusive answer after a separator. `Word` learns `Sep::{Dot, Scope}` and a `Spine` (identifiers joined by `.`, balanced `[…]` stripped; anything unreadable → no head). A readable spine resolves through **the one walk**: `vlog_semantic` publishes `MemberSite { Scope(ScopeId) \| Unit(String) }`, `Semantics::member_site`/`unit_site`/`member_scopes`/`instantiable_scope`, `WorkspaceIndex::members_of_chain` (inherited via `base_chain`, subclass-overrides-base) and `member_unit`; the resolver's `member_of`/`unit_member`/`member_in_chain`/`link_type` are rewritten to *call* them, so completion cannot list a member hover would not resolve (pinned structurally). A headless `.` inside an instantiation's `(…)`/`#(…)` answers the module's ports/parameters through `signature::enclosing_list` (lifted `pub(crate)` — one list detector for the card and the popup) and `Semantics::instantiable_scope` (the `Target::Port` walk), already-connected ports dropped except the entry being re-typed. A `.` in no list → `None`; a resolved site or list with nothing matching → an **empty list** (so the popup revives); never keywords or words after a separator — the old whole-index dump after a dot is gone. `isIncomplete` true at 1–2 typed chars after the separator (the set widens at 3), complete otherwise unless truncated. `trigger_characters: [".", ":"]` in `main.rs` (pins updated; a lone `:` has no `Sep` and falls through). **QA rework, `FACTS_FORMAT` 9 → 10**: the `#(.` list exposed that the binder had discarded `ParamPort.kw` and bound header and body `localparam`s as `Param` (an override list offered `prim_fifo_sync`'s `DepthW`); `SymbolKind::LocalParam` is now bound from the keyword, sticky across continuation entries exactly as `instantiate::params` reads it (the popup and the ghost skeleton are pinned against each other), exported wherever `Param` is, labelled "localparam" in hover, and excluded from the override list only — a `.DepthW(1)` written in source still resolves to the declaration it names. Touched for the kind arms: `vlog_semantic/{model,bind,workspace,facts}`, `lucisv_server/{symbols,tokens,hover,completion}`, `vlog_refactor` filters. Empty member answers are always `isIncomplete` (a cold index answers empty once). Measured cheaper than the dump it replaces (6–62 µs vs 212 µs). |
| `completion-templates ──▶ completion-core, editor-scopes` | depends | Tier 3; `templates.rs` is data + one renderer; tier digits moved (only e2e's word-tier assertion cared). Also consumes `vlog_refactor::Layout` (M4's `{ base, step }`), reused rather than re-declared, so a skeleton and a template indent by one type. |
| `completion-templates ◀──▶ editor-snippets` | handshake | Nine overlapping statement/block snippets were **removed** from `editors/vscode/snippets/*.json` when the server started offering them as tier 3; both READMEs' prefix tables are the shared truth. A template added server-side must check the static set, and vice versa. |
| `inlay-hints ──▶ refactor-instantiate` | depends | Reads exactly the `module_definition` + `instantiation_plan` facts M4 published (the `PlanPort`/`PlanParam` name lists signature help reads); every plan refusal is swallowed silently — a hint has no place for a sentence. |
| `inline-templates ──▶ completion-templates, editor-scopes` | depends | Same skeletons as ghost text (LSP 3.18 `inlineCompletion`, `lsp-types` `proposed` feature); relative-indent contract — the client finishes the whitespace; round 2 dropped its `layout_at` consumption (re-privatized). |
| `inline-instantiation ◀──▶ completion-core` | handshake | The two-level split (2026-08-30, owner ruling): tier 0's items are module **names**, not skeletons — the M4 "popup inserts the whole instantiation" pin is superseded, `completion::item`/`documentation` deleted. Three surfaces made `pub(crate)` for `inline.rs`: `at_instantiation_site` (tier 0's position gate, lifted so ghost and popup answer "may an instantiation go here" identically), `plan_for` and `snippet_hole` (one planner, one tabstop spelling). `Candidates::has_module` — case-**sensitive** `O(log n)` binary search over the module table — is the ghost's per-keystroke probe; it pins the table's `str` order (inherited from `workspace_symbols`'s sort) with its own test, so a case-folded sort upstream breaks loudly. |
| `inline-instantiation ──▶ refactor-instantiate` | depends | `instantiation_plan` → `render_with` consumed unchanged for exactly one module per space-armed exact-name match, read through the `FileView` cache. Round 2 (2026-08-30): the file is chosen by `completion::nearest_definition` — most shared leading path components with the asking buffer, then shallowest candidate, then lexicographic — never refusing on multiplicity; `vlog_refactor::module_definition` is no longer on this path (unchanged for its own callers, which want its ambiguity refusal). A plan with an escaped identifier is *declined* (ghost text has no plain-text spelling to fall back to); `InstantiationPlan::render`'s plain spelling now has no server consumer at all. Signature help and inlay hints unchanged. |
| `inline-instantiation ──▶ inline-templates` | depends | `inline_completions` probes the space-armed Ident shape (`name_then_space`: exactly one space before the cursor, the `Ident` ending just before it — owner ruling, round 2) ahead of the trigger table's token-ends-at-cursor route, which is byte-for-byte unchanged; an `Ident` ending exactly at the cursor now offers nothing at all. Wire shape, empty range at the cursor and the relative-`\t` indentation contract inherited unchanged. `lucisv.inlineInstantiation` (unset = on) is its own setting, independent of `lucisv.inlineTemplates`, same non-scope-change shape. |
| `hover/define ──▶ define-table`; `macro-expansion ──▶ define-table + hover` | depends | See the §2.5 handshake; `expand.rs` is deliberately workspace-blind (two strings + a `Define`). |
| `include-nav ──▶ filelist` | depends | First consumer of `incdirs`; the include graph (build/resolve/reachable, one `scan` shared by links, definition and the graph) plus hover's reachability overlay — `find_define`'s contract explicitly unchanged. |
| `file-operations ──▶ include-nav, file-watching` | depends | `resolve_as_if` added so willRename asks the *one* resolution engine about a future filesystem; reuses `watch::watched` + `SOURCE_GLOB` as the one scope predicate. |
| `file-watching ──▶ filelist / lucisv-core-lift` | depends | `SOURCE_GLOB` pinned to `walk::EXTENSIONS` by test; watches the filelist itself; re-registers on filelist change. |
| `folders-and-config ──▶ editor-settings` | depends | Adds the pull door (`workspace/configuration`) wrapped back into the push shape so there is exactly one settings parser; `Pending` generalizes apply-edit's `applying` map. |
| `editor-settings ◀──▶ lucisv-core-lift` | handshake | The four-rung precedence ladder (lucisv.toml > `lucisv.*` settings > tab size > defaults), per key — the reason the ladder can exist is the lifted `Discovery`. `will-save-wait-until` reuses the ladder minus rung 3. |
| `incremental-sync ◀──▶ pull-diagnostics` | handshake | One `didChange` = one `set_document` = one generation bump, however many ranges — pinned by test; the generation **is** the pull model's `resultId`. `semantic-tokens-delta` promises the inverse: token requests never bump it. **Amended 2026-08-28 by change-debounce**: one *flush* is one `set_document`, one bump and one publish per dirty buffer — however many ranges *and* however many notifications it coalesced. |
| `change-debounce ◀──▶ incremental-sync, pull-diagnostics` | handshake | The amendment above. A `didChange` composes its ranges against the *pending* text when there is one (`sync::apply_changes` unchanged) and defers only the analysis; the flush happens at the next request, the next non-`didChange` notification, or a 150 ms quiet period on the `cancel-request` queue (`recv_timeout` — no thread, no timer object). Observable: intermediate diagnostics states are no longer published, pinned in `tests/e2e.rs`. |
| `port-detail-spans ──▶ hover-declarations` | depends | The second fenced section, and the comment attached to each, are built on hover-declarations' snippet machinery and its `spells_exactly` guard, both unchanged. `nav::definition` returns the detail location first so a jump and the card cannot disagree. |
| `hover-declarations ◀──▶ vlog_semantic` | handshake | `Semantics::symbols_named` (§1.2) replaced `hover::live_symbol`'s and `nav::indexed_references`' scan-every-symbol loops. Behavior-identical **because the lookup preserves declaration order** — the tie-break between two live declarations of one name is pinned on both sides. |
| `hover-line-index ──▶ hover-declarations / port-detail-spans` | depends | `Def::lines` supplies indexed hover headings (including split-port detail lines); `Workspace::file_view` supplies the guarded snippet and the few non-indexed line lookups. `locate::location` shares that view, so a references list reads a closed file once rather than once per site. |
| `cancel-request ──▶ lsp-server pin` | depends | See §1.2; queue/burst exists because the pinned transport is a rendezvous channel. |
| `scan-interleave ──▶ cancel-request / work-done-progress` | depends | The same queue is polled between startup-scan files. `publish_scan` lands the index, completion and include batches before dispatch; `must_wait` holds requests queued behind any rescan-triggering message and preserves their order/cancels. Progress still counts the whole scan even when requests are answered before the bar comes down. |
| `verbose-timing ◀──▶ editor-packaging / scan-interleave / change-debounce` | handshake | `lucisv.verbose` is an extension-owned spawn setting: false means no arguments and no timing traffic; true means `lucisv-server --verbose`, and changing it restarts the client process. The server writes `MessageType::LOG` lines prefixed `timing:` for request/notification handlers, scan and widen lifecycles, dirty-buffer flushes, one-file reindexes, and requests held behind rescans. The request line precedes its response; notification lines follow their work. Instrumentation is silent by construction when off (one branch, no clock read or formatting), and it observes rather than changes scan/queue ordering. **Amended by perf5-p2 and perf5-p4 (2026-09-07/08):** the `timing: rename trace …` line and the three `timing: scan <n> … : key=value …` lines (`stages`, `counts`, `memory`) plus `timing: configuration answered in X ms` are `key=value` formatted and **are parsed** by `tools/perf/` (`renametrace`, `scanprofile`); their format is pinned by server tests, so the old "nobody parses these lines" assumption no longer holds for those five. `Workspace::begin_scan`/`begin_widen` take `trace: bool` (every pre-existing caller passes `false`), `take_scan_trace()` hands the finished trace to the server; `Candidates::sizes()`, `IncludeGraph::sizes()`, `IndexCache::{work, entry_count, encoded_bytes}` are read-only queries for the memory line; `Server::born` and the `Instant` on `Pending::Configuration` time the config round trip. **(2026-09-12, TODO §63.2)** the `timing: codeaction` line carries a third top-level group, `rebuild{lex parse defines analyze external lines publish documents}` — `Document::new`'s six derivations and the publish inside `flush_dirty`, traced through `crate::lint_trace` — beside `flush{…}` and `action{…}`; the three groups are **siblings by contract** (`tools/perf/phases_p2.py`'s regex flattens one level, and a nested group makes the whole `flush` group vanish from every row with no error), pinned by `lint_trace::tests::the_three_top_level_groups_are_flat_never_nested`. |
| `work-done-progress ──▶ indexing-ux` | depends (then) | w-d-p put up the bar; indexing-ux made it count (`IndexEvent` stream); index-persistence added `Cached`. |
| `large-file-mode ◀──▶ semantic-tokens-delta` | handshake | The windowed lexing serves `semanticTokens/range`; on a large buffer `full`/`full/delta` must answer an ERROR (`ServerCancelled`/`ContentModified`) or the client stops asking the range provider — two sides pinning one wire behavior. `Document::large` is structurally a full `Document` (all fields valid, empty) so no handler changes — the obligation lands on **future** handlers that read `doc.text` (dispatch-table test enforces). |
| `lsp-318-extras ──▶ range-formatting` | depends | `rangesFormatting` is a thin adapter over the same n-range `LineRanges` engine `--lines` uses; hand-rolled params because `lsp-types` 0.97 lacks 3.18. |
| `on-type-formatting ──▶ range-formatting, editor-scopes` | depends | `;` goes through `format::range_formatting` unchanged; `\n` answers indent only, computed from `pairs.rs`'s own keyword tables (three items widened to `pub(crate)`) — one reader's answer for "what opens a scope". |
| `interactive-latency ──▶ change-debounce, editor-scopes, selection-range, on-type-formatting, completion-core, inline-templates` | depends | Round 2 of the perf work (`docs/perf/README.md`). It measures the flush change-debounce coalesces and the round trip it defers, and it replaces one token *sweep* with one token *binary search* in `selection.rs`, `on_type.rs`, `completion.rs` and `inline.rs`. No answer moved — each swap is pinned against the sweep it replaced at every byte — so none of those five features' contracts changed; what they now share is `state.rs`'s two search primitives and the ordering property of `tokenize`'s output they rest on. |
| `interactive-latency ◀──▶ lucisv-server` | handshake | Two free functions, `first_token_reaching` and `first_token_from`, are published from `state.rs` beside `Document::token_at`; that is where the monotonicity argument every caller depends on is written down, and `state::tests::the_token_stream_rises_and_never_overlaps` is the test that fails first if `vlog_parser` ever breaks it. `tests/e2e.rs`'s `Live::finish` now returns its publish count (existing callers ignore it), and `perf::generated_module` has a copy in `tests/e2e.rs` — a binary crate's modules are unreachable from an integration test — which must stay the same shape as the original. |
| `references-nav ──▶ workspace-index / hover-line-index` | depends | Cross-file references resolve an indexed target first and consume declaration postings directly; same-file local references stay on `Semantics`. Since §64.1 (2026-09-12) the two index questions (`leaves_this_file`, `indexed_def_in_file`) ask `member_in(…, Surface::Hierarchical)`, so a module's net/variable/instance named by a `bind` connection or a `u_x.sig` tail is answered workspace-wide; a hierarchical-only declaration in a *closed* file has no `Local` postings, so `nav::declaring_file_uses` parses exactly that file once per request. Every closed-file span and the open-buffer declaration fallback are guarded by `hover::spells_exactly` (now `pub(crate)`): a stale index may omit a location, never mislocate one. Locations for closed files are rendered from one `text_of` read per file per request (not the `FileView` cache, whose entry could differ from the same request's re-analysis). `documentHighlight` now also follows the document's external overlay for names declared elsewhere, fixing the old “references works, highlight is empty” split without widening highlights beyond the current file. |
| `selection-range / linked-editing ──▶ spans, name-spans` | depends | Pure arrangements of existing ranges; linked-editing's table documents exactly which constructs carry both spans (and which verbatim ones can't — `program`, property/sequence, covergroup). |
| `type-definition ──▶ nav / overlay-promotion / ansi-first-port` | depends + 2 delivered handshakes | Now literally `nav::definition` at the type name's offset; both of its filed requests landed (§2.2, §2.5). |
| `hierarchy ◀──▶ inlay-hints` | handshake (shared walk) | The instantiation walk was lifted out of `inlay.rs` into a shared module (now `vlog_semantic::instantiations`) rather than copied — the two answers cannot drift; inlay's 34 tests are the regression net. |
| `vscode-hierarchy-sidebar ◀──▶ editors/vscode` | handshake | Two custom wire members, both **gated on `initializationOptions.hierarchyView`** so no other LSP client sees them: the request `lucisv/moduleHierarchy` → a flat `schemaVersion: 2` snapshot (`files` table; locations as `{ file, range, selectionRange }` with each range `[startLine, startCharacter, endLine, endCharacter]`; **no** per-row id and **no** per-instance `definitions` — the client composes both in `hierarchyModel.js::validateSnapshot`), and the notification `lucisv/moduleHierarchyChanged { revision }`. `revision` rises on every completed index install; the notification rides beside the code-lens refresh point so all mutation paths are covered once. An older binary answers `-32601`, which the view renders as a compatibility message. |
| `vscode-hierarchy-sidebar ◀──▶ code-lens / hierarchy` | handshake | Both read the *same* statement-level `InstantiationEdge`; only the sidebar flattens `edge.instances`, so `sub u1 (), u2 ();` is still one call site and one lens count and two sidebar rows. No second census exists. |
| `vscode-hierarchy-sidebar ──▶ scan-interleave / cancel-request` | depends | `complete` is `Server::index_is_complete()` = `!scanning && !must_wait()`. It is false exactly during the startup scan: a request owed a rescan is *held* by `must_wait`, and `rescan_wanted` is only ever set while `scanning` is true, so no snapshot is ever answered `complete` off an index a queued message is about to rebuild. |
| `code-lens ◀──▶ hierarchy` | handshake | code-lens split `incoming` into the batch primitive `callers_of_each` so lens and hierarchy share one census; `incoming` is a one-element call into it and its behavior (empty-name guard included) is pinned unchanged. Lens and hierarchy views can never disagree; refresh rides `reindex()` after the bar comes down. |
| `server-lint / pull-diagnostics / editor-scopes ──▶ diagnostics.rs` | depends | One `diagnostics::all` composition: parse errors + missing-closer warnings + lint warnings, one publish (or one pull) per change; `send_diagnostics` is the single push gate so a pulling client is never served both models. |
| `localized-reindex ◀──▶ incremental-index / workspace-index / include-nav / file-watching / completion-core` | handshake | (2026-11-19, TODO §71.1, 0.65.6) A save costs the file plus the readers of what moved. `vlog_semantic`: `update_file`/`update_facts` return whether the index moved; `workspace/dependents.rs` records, through a thread-local `note`, which files' resolution read which merged-table key; `replace.rs` re-merges only the keys either record names and `references.rs` re-does postings only for those keys' readers. In memory, no codec change, rendered in `fingerprint` so every equality test holds it to a rebuild. Server: `update_one_file -> OneFile { NotHeld, Unchanged, Changed }` — `Unchanged` sends no `codeLens/refresh` or `moduleHierarchyChanged` but still republishes every open buffer; `Workspace::watched -> Watched { Held, Outside, Unknown }` — `Outside` re-resolves the include lines naming it (`refresh_includes_naming(&[PathBuf])`) and starts no rescan, another spelling of a held file is one-file; a `lucisv.toml` event is now a whole rescan; a burst naming more than half the index (`BURST_DIVISOR`) keeps the one rescan. The amended fast-path table lives in the feature README; the invariant (any edit sequence answers as a fresh server) is its differential suite. Cost: the readers table on every whole merge, CLI and MCP included. |
| `localized-reindex ◀──▶ format-styles` (`lint.rs`) | handshake | `line-length`'s width is `file.line_length.or(client.line_length)`, else the style's width (`file.format_style.or(client.style)` → `vlog_formatter::style::preset`), else 100 — the ladder `format::indent_width` and `lucisv check` walk; `auto` names no preset. Pinned rung by rung against the CLI's ladder. |
| `scan-ordering ◀──▶ scan-interleave / cancel-request / change-debounce` | handshake | (2026-11-19, TODO §71.7, 0.65.8) **No notification overtakes an older notification.** `Server::must_hold(message)` replaces `must_wait() && Request` in `process_batch`: a request waits on `must_wait` (unchanged); a state-changing notification (`batch::changes_state`: any but `$/cancelRequest`) waits while an older one is unapplied — in `held`, or counted by `Server::behind` (the unapplied notifications in the tail of the burst whose message started the scan now draining); a cancel waits whenever anything is held; a response is never held — **amended in 0.65.11 (fast-actions)**: the client's answer to a `workspace/configuration` pull is applied by the same `apply_settings` a push is, so it is ordered like a notification (`Server::owes_a_state_change` = `changes_state` or an unapplied settings answer replaces `changes_state` in what `behind` counts and in both state-change clauses of `must_hold`); every other response stays exempt, and staging still takes the answer out of `held` first (`take_the_answer_out_of_held`). A held request is answered against whatever is applied when it is replayed (not "no notification overtakes a request"). A `didOpen` changes scan order where it is *applied* (`head_owed` + `opened_mid_scan` in `notification.rs`, read once per batch by `answer_what_is_waiting`; `batch::opened_in` deleted), so a held batch is handed back at most once per file opened. Any new caller of `process_batch` inherits the rule; anything applying a client message around it breaks it. |
| `scan-ordering ──▶ hover / nav / references-nav / refactor-rename / hierarchy / type-hierarchy` (caret) | depends | `caret::symbol_offset(text, caret)` steps one byte left when the caret is just past a name (identifier, keyword, system task, macro, number, escaped identifier) and not at the start of another; `Server::symbol_offset` (`dispatch.rs`) applies it for hover, definition, typeDefinition, references, documentHighlight, prepareRename, rename and the two hierarchy prepares. Linked editing, signature help, completion/inline completion, on-type, selection range and code actions keep `Server::offset` on purpose; a new "name under the cursor" request should use `symbol_offset`. The feature README tables every position-taking request. Extension half: `referencesView.js` opens a row at the name's start. MCP answers by name and is unaffected. |
| `viewport-highlight ◀──▶ scan-ordering / semantic-tokens-delta / large-file-mode` | handshake | (2026-11-19, TODO §71.3, 0.65.10) The first exemption from held-request order: before `process_batch` holds a `semanticTokens/{range,full,full/delta}` request, it is answered through `answer_flushed` (dispatch minus `flush_dirty`) when its buffer's text is current. **Since 0.65.11 the decision is fast-actions' `Server::answer_from_the_buffer` in `server/ahead.rs`** (moved there from `viewport.rs` as a pure move, with `set_aside` and `open_then_widen`), so clauses (a)/(b) are shared with every early answer: the buffer open, `behind == 0`, and nothing older in `held` or in the burst `ahead` of it that `REACH`/`Server::can_reach` cannot clear (a watcher event still does not hold a colour; a settings push now does — before, a notification naming no buffer passed for harmless, QA's S1). What stays the colours' own (`viewport.rs`): `colours_may_go_ahead` (without `refreshSupport` only `range` goes), a dirty buffer waits instead of being analyzed, they go during staging, never ahead of a notification about to be applied (`answer_ahead_of` takes `same_file` requests only), and `coloured_ahead` marks a range taken off an unsettled index. Reads that one `Document`, its overlay as of the last publish, `has_large_documents`/`Document::large`/`token_server_cancel`, and the remembered tokens — never the index, another buffer, a flush or a publish. Every whole answer goes through `remember_tokens`, so a `previousResultId` always names data the client holds. Responses leave out of arrival order for these three methods and fast-actions' `same_file::METHODS` only. |
| `viewport-highlight ──▶ index-scope / scan-interleave` (widen and refresh) | depends | A `didOpen` that widens is applied through `open_then_widen`: `Viewport::defers_widen` records the widen, the burst's colouring requests are answered, then `reindex_widened` runs and `answer_ahead_mid_widen` (`server/ahead.rs`, 0.65.11; `answer_colours_mid_widen` before) drains between files (what can go ahead answered — colours and, since 0.65.11, `same_file` requests — everything else to `held`). `refresh_tokens_if_stale`, called by `run` once `held` is empty, sends at most one `workspace/semanticTokens/refresh` per `hierarchy_revision`, only if a buffer answered while `index_unsettled` (scan running/owed, `Viewport::widening`, or — since 0.65.11 — anything held) would colour differently (`early`) or was painted by a range (`guessed`). `semantic_tokens_in_range` classifies the range's lines (`large::line_window`, `overrides_within`) and still equals the full answer filtered. |
| `ifdef-folding ──▶ references-nav (folding) / editor-scopes / large-file-mode` | depends | (2026-11-19, TODO §71.4, 0.65.4) `folding/directives.rs::branch_spans` reads the lexer's `TokenKind::Directive` tokens (so comments, strings and `` `define `` bodies never fold) and yields one `region` fold per `` `ifdef ``/`` `ifndef ``/`` `elsif ``/`` `else `` branch; `folding_ranges` = `scope_and_comment_folds` (the old answer, verbatim) + `branch_folds` (dropping any `(start, end)` an existing fold has), merged by `in_answer_order` (start line, existing first on a tie). Sticky scroll pins the branch line through the extension's `foldingProviderModel` (§67). A large buffer has no tokens and still answers `[]`. The directive-word rule is a private copy (also in `parser/directive.rs` and `on_type/auto_end.rs`). |
| `instance-folding ──▶ ifdef-folding / references-nav (folding) / call-hierarchy (`instantiations::sites`) / large-file-mode` | depends | (2026-11-19, TODO §72) `folding/instances.rs::instance_spans` takes *what* is an instantiation from `vlog_semantic::instantiations::sites` (the walk the call hierarchy, inlay hints and index share; gate primitives excluded) and *where* its closers are from the token stream, folding nothing unless the tokens spell exactly the shape the tree says. One `region` fold from the module-type line to the line before `;`, one more per instance from its name line to the line before its `)`. `folding_ranges` = scopes/comments + branches + instances through `in_answer_order` (now a stable sort by start line over the sources in that order), so on a shared start line an instance fold yields to both older sources and the pre-§72 answer is an unchanged subsequence. A large buffer still answers `[]`. Not folded: 2-D instance arrays (the parser does not read them as instantiations), an instance whose head an `` `ifdef `` splits. |
| `comment-highlighting ◀──▶ editor-packaging` (grammar) | handshake | (2026-11-19, TODO §71.8, 0.65.3) Extension only: `commentScan.js` re-implements the grammar's `comments` and `strings` rules to find comment bodies; `commentScan_test.js` fails on any change to those two rules, on a reordering that moves them off the top, or on another top-level rule that could match `/` or `"` — a grammar edit updates `commentScan.js` in the same change (the `tests/grammar.rs` keyword lock is separate and untouched). `commentKeywords.js` paints visible lines ±50, honours `editor.maxTokenizationLineLength`. Server side: nothing — the three `lucisv.commentKeywords.*` keys arrive in `didChangeConfiguration` and `settings.rs` ignores them; semantic tokens were measured to colour nothing inside a comment. |
| `format-styles ◀──▶ editor-settings / format-cache / selection-formatting / on-type-formatting` | handshake | (2026-11-19, TODO §71.5, 0.65.5) One name list, three pins: `PRESETS` (`vlog_formatter/src/style.rs`) + `auto` = `lucisv_core::config::STYLE_NAMES` (`args::tests::the_core_style_names_are_the_formatter_presets`) = the manifest's `lucisv.format.style` enum and descriptions (`settings::tests::the_style_drop_down_is_the_style_names`). Ladder: explicit `indent`/`line-length` over the style's numbers; `lucisv.toml` over the editor. Server: `auto_style.rs::AutoStyles` remembers per document the preset `format_auto` chose; whole-document formats set it, range/ranges/on-type/selection reuse it (`concrete`); forgotten on open/close/rename/delete, a whole-buffer replacement, a named-style format, any settings change and a `lucisv.toml` event — three call lines in `notification.rs` (`notice`, `changed`, `forget_all`). The cache entry carries the style, so changing it invalidates verdicts. |
| `hierarchy-current-path ──▶ vscode-hierarchy-sidebar / dut-hierarchy` | depends | (2026-11-19, TODO §71.6, 0.65.2) Extension only, no server request: `hierarchyCurrent.js` (`matchingFiles`, `currentPath` — BFS up `hierarchySections.parentIndex`, nearer distance wins — `rowLevels`, `levelChanges`, `LIT_COLORS`/`litLevel`/`cssVariableFor`) reads the schema-2 snapshot's `definition.file`. `hierarchyView.js` follows `onDidChangeActiveTextEditor` and posts `{type:'lit', changes}`; a rendered row carries `lit: 0..4` only when lit, so an unlit pane's rows are byte-identical to before. `media/hierarchy.{js,css}` set `data-lit`. Matching compares the model's URIs, so a case-differing folder or a UNC path (server `uri.rs` writes `file:////srv/…`) never lights. |
| `fast-actions ◀──▶ scan-ordering / viewport-highlight / large-file-mode / cancel-request` | handshake | (2026-11-19, TODO §71.2, 0.65.11) **A request whose whole answer is its buffer's is answered from it at once, even while a scan holds everything else, and its answer is the settled answer.** The precondition is stated once, on `Server::answer_from_the_buffer` (`server/ahead.rs`), the one function that decides: for the buffer the request names (a) it is open; (b) every older client message that can change what the handler reads is applied — `nothing_unapplied_for` reads `held` and the burst `ahead` through `Server::can_reach`, and requires `behind == 0`; (c) its analysis is current — a dirty buffer is analyzed for its own request alone (`Server::flush_buffer`, `server/diagnostics.rs`), a colouring request on a dirty buffer waits; (d) no settings are awaited (`settings_awaited` = `staging` or `Server::settings_announced`, the pull an empty `didChangeConfiguration` caused); (e) the answer is the buffer's alone — `same_file::answered_by_the_buffer` (`same_file.rs`, twelve `METHODS`; completion, inlay hints, code lenses, links and every workspace-wide request always wait) or `viewport.rs`'s rule for colours. Where a request is offered: `process_batch` → `answered_ahead`, `set_aside`, `answer_ahead_of` (behind the next notification of its own burst, `same_file` requests only), `open_then_widen`, `answer_ahead_mid_widen`, `answer_held_ahead` (when the startup's settings land) — the same function at each. **`ahead::REACH`** is one row per notification `handle_notification` handles (`Reach::{Nothing, Named, Any}`); a method without a row reaches `Any`, so **a new notification arm needs a `REACH` row — the default is wait** — and `every_notification_the_server_handles_says_which_buffers_it_can_reach` fails until it has one; a handler that starts changing a buffer it does not name must move its row to `Any`; a new `Pending` kind must be classified in `can_reach` (exhaustive `match`). **With viewport-highlight:** the early-answer path moved from `viewport.rs` to `ahead.rs` and the colours share it (row above). **With scan-ordering (amended):** the client's answer to a settings pull is ordered like a notification (`owes_a_state_change`); every other response stays exempt. **With large-file-mode:** `reclassify_large_buffers` (`server/large_file.rs`, called from `apply_settings`) re-analyzes every clean open buffer a new `largeFile.threshold` classifies differently and re-requests colours — a new threshold no longer waits for each buffer's next edit (large-file-mode's prose saying so is stale, its test renamed). Responses for the early kinds go out ahead of older held requests (allowed by the spec); a burst's cancel is honoured where it goes ahead. Proof: `server/tests/fast_actions_differential.rs` (early == settled), `fast_actions_bursts.rs` (the burst differential; its oracle's weakness is §2.9-62). |
| `fast-actions (related tier, payload) ◀──▶ completion-core / fuzzy-completion / member-completion` | handshake | (2026-11-19, TODO §71.2, 0.65.11) `completion/related.rs`: a tier between the file's own (`1`–`3`) and the workspace's, sortText `4` (`TIER_RELATED`); index `4→5`, templates `5→6`, keywords `6→7`, project words `7→8` (`tests/e2e.rs`'s digits moved). Its sources: the members of every package the scope chain at the cursor imports (`WorkspaceIndex::members_of`; a wildcard all, an explicit import the one it names), the members the enclosing class inherits (`members_of_chain`), and after a backtick the `` `define``s of the headers the buffer's `` `include``s reach (`includes::reachable_from` → `WorkspaceIndex::defines`); prefix and fuzzy rules as the other tiers. **No item is taken away:** a related item does not count against `LIMIT` (`Items::related`) and a name it claims is skipped by later tiers without being counted, so every label of the 0.65.10 answer is still offered with the same edit and format; what changes for a claimed name is its icon and detail (the declaration the file is related to). Own cap `RELATED_LIMIT` (256), past which the answer is `isIncomplete`. `completion/wire.rs`: for a client listing `editRange` and `insertTextFormat` in `completionList.itemDefaults` (`ClientAbilities::completion_item_defaults`, read in `main.rs` by `completion::item_defaults_support`), `with_item_defaults` rewrites the serialized list — lossless, an item keeps its own edit or format when it differs; done on JSON because `lsp-types` 0.97 has neither field. Completion is never answered early (every path reads the index). `completionItem/resolve` is measured, not built. |
### 2.8 Packaging & release lane
| edge | kind | contract |
|---|---|---|
| `editor-packaging ◀──▶ lucisv-server` | handshake | The spawn contract (§1.2), including verbose-timing's `[]` / `['--verbose']` argument pair and restart-on-setting-change rule, plus the fence-tag contract: every markdown code block the server emits opens ```` ```systemverilog ```` — three call sites pin the string; the grammar registers the id. |
| `editor-packaging ◀──▶ vlog_parser` | handshake | The grammar↔`KEYWORDS` test lock (§1.2). |
| `editor-snippets ──▶ editor-packaging` | depends | Static `contributes.snippets` keyed to the two language ids the manifest declares; consumes nothing from the server *at runtime* (works with the server missing — deliberate). Its **content** is negotiated against the server's template tier — see the `completion-templates ◀──▶ editor-snippets` handshake in §2.7. |
| `editor-platform-vsix ──▶ editor-packaging, release-prep` | depends | Changes *which path* is spawned, never how; consumes `release.sh`'s artifact naming; promises the three `bin/` layout shapes to `extension.js` (asserted with `unzip -Z1` per package). |
| `editor-platform-vsix ◀──▶ editor-marketplace-page` | handshake | The marketplace rewrite must keep the seven-package install table and the two bundled-binary layout sentences (re-applied additively during the concurrent rounds). |
| `ci-release ──▶ release-prep / editor-platform-vsix` | depends | Workflow = one-liners over `tools/`; consumes the exact seven `.vsix` names (`prune_release_assets.sh` checks each), the `CHANGELOG.md` heading convention, tag == workspace version. |
| `release-prep ──▶ editor-packaging` | depends | `release.sh` runs `smoke.js` as its gate; closed the missing-`LICENSE` item editor-packaging filed. Version lives in exactly four files — a promise to everyone. |
| `editor-marketplace-page ──▶ lucisv-server` (docs) | depends | The Details page mirrors the shipped capability table in the server's README; drifts if that table does. |
| `editor-packaging ◀──▶ lucisv-mcp` (mcp-packaging) | handshake | The MCP spawn contract (2026-09-23): the binary `lucisv-mcp[.exe]` found by the same three-rung ladder as the server (`lucisv.mcp.path` → `bin/` → `PATH`), spawned by VS Code from `McpStdioServerDefinition(label, command, ["--root", folder, "--index-cache", storage], env, version)` — the constructor is positional — one per workspace folder; `serverInfo.name == "lucisv-mcp"`, exactly the nine lean tools in order — `hierarchy, find, outline, read, check, rename, port, edit_item, format` (`mcp_smoke.js` `TOOLS`; **amended by M7, 2026-09-23**, was ≥ 26); `mcp_smoke.js --tool-table` regenerates the Agents guide's table. Provider id `lucisv.mcp`; settings `lucisv.mcp.enabled`/`.path`; command `lucisv.mcp.copyConfig`. |
| `release-prep / editor-platform-vsix ──▶ lucisv-mcp` (mcp-packaging) | depends | `release.sh` builds `-p lucisv_mcp` for every triple and stages it as the THIRD `bin/` entry (fifteen in the `all` package); `expect_vsix_bins` and `audit_artifacts.sh` pin the name; the seven `.vsix` names are unchanged. `mcp_smoke.js` is the gate beside `smoke.js`. |
| `lucisv-mcp ──▶ lucisv-server` (index cache, M6) | depends (read-only) | MCP reads the server's `index-cache` store read-only when `--index-cache DIR` names it (header `CACHE_FORMAT`/`FACTS_FORMAT`/version must match, else ignored) and writes its own `index-cache-mcp` beside it; it never writes the server's file. A codec change on the server side costs MCP its warm start, never its correctness. |
| `editor-packaging ◀──▶ lucisv-mcp` (mcp-read-only, M8) | handshake | The read-only mode (2026-09-29, PLAN §11): setting `lucisv.mcp.mode` (`"full"` default / `"read-only"`) appends `--read-only` to the spawn args and labels the definition `lucisv read-only (<folder>)`; copy-config keys it `lucisv-ro`. The binary then lists exactly `hierarchy, find, outline, read, check` (≤ 1 800 model-visible bytes, instructions ≤ 300), answers the four edit names with `-32602` `unknown tool: NAME (the server runs --read-only)`, and writes nothing inside a root (`tests/read_only.rs`); full mode is byte-identical to 0.58.0. `mcp_smoke.js --read-only` is the second MCP gate in `release.sh`, host and embedded. |
| `release-gates ──▶ release-prep` (`cross` step) | depends | (0.65.7) `cargo check --target x86_64-pc-windows-gnu --target x86_64-unknown-linux-musl -p lucisv -p lucisv_server -p lucisv_mcp`, with the rustup toolchain `release.sh --cross` uses (`~/.rustup/toolchains/stable-aarch64-apple-darwin`). Binaries only, not `--all-targets`, so test-only platform code is not checked (§2.9-56). **Skipped with a note, not failed, when that toolchain is absent** — a gate run on a machine without it does not prove the cross build (§2.9-66). |
| `ci.yml linux job ◀──▶ tools/linux_check.sh` | handshake | (0.65.9, TODO §70) `ci.yml`'s `linux` job (`runs-on: linux-x64`, the luhpe runner, as root, 4 CPU / 8 GB, rustup per job, cold build) runs `cargo clippy --all-targets -- -D warnings` and `cargo test --workspace`. `tools/linux_check.sh [--user] [--dry-run]` runs a command against the working tree in the same job image without a push (tracked + unignored untracked files, one run at a time). The suite is root-safe: permission tests probe whether modes bind and say `skipped:` when not; growth tests bound ratios, not wall clock. Linux is tested on push, but releases are gated on macOS only (§2.9-57). |
| `lucisv-mcp ──▶ filesystem` (`project/files.rs` stamp) | depends | (0.65.9) A held file is current when size, mtime and `identity` (ctime + inode, `Option` — `None` on Windows) match its `Stamp`; any trusted timestamp within `RACY` (3 s) of `read_at`, or a wall clock that stepped back since the read (`read_mono`), makes it `Change::Suspect` and it is re-read and re-hashed (git's racily-clean rule, now over ctime too). Known blind spots, in `docs/features/mcp-transport`: on Windows a same-size rewrite restoring an mtime > 3 s old; writes through a memory map not yet reflected in timestamps; future mtimes re-read on every call (§2.9-54). The server's index cache and the `index-cache-mcp` store contract are unchanged. |
### 2.9 Open handshakes (filed, not yet delivered — claim before working)
These are the known coordination points. An agent picking one up should
update the filing README(s) and this file.
| # | request | filed by | owner it waits on |
|---|---|---|---|
| 1 | `lucisv_core::path::normalize` — one `.`/`..` folding instead of three private copies (`filelist::Reader::normalize`, `config::Discovery::absolute`, `includes::normalize`, the last now `pub`) | include-nav; restated by file-operations | lucisv_core |
| ~~2~~ | ~~A span for `DataType` (and `ExprKind::Cast::ty` tails) — the last thing keeping `vlog_semantic/src/scan.rs` alive~~ — **delivered 2026-09-05 by type-name-spans (TODO §47):** `DataType::name_span()` (a `u32` start paired with `name.len()`, so `Expr` stays inside its 96-byte pin) and `DataType::segments()` (the `::`/`.` split from the span's own text); `StmtKind::Disable` carries its target's span. `scan.rs` is deleted; `analyze`'s `src` stays as `Binder::exact_or_empty`'s verification oracle — a segment whose derived range does not read back is recorded with the empty range (counted *unplaced* by the census, never dropped). The census pin covers type-name references. | vlog-semantic (item 2); restated by class-semantics | vlog_parser |
| ~~3~~ | ~~`fence::scan_nested` has no `ItemKind::Class` arm — formatter fences are inert inside class bodies (the `--fix` backstop still holds; asymmetry errs hands-off)~~ — **delivered 2026-09-02 by statement-fences (TODO §31)**: `scan_nested` enters class bodies, functions, tasks, `always`/`initial`/`final`; statement lists (`begin…end`, `fork…join`, every compound body) are fenceable through `scan_stmt_scope`/`scan_nested_stmt` on the shared `scan_units`; `stmt_docs`/`stmt_seq` obey the two swallowed-unit rules; fence regions merge into `range.rs`'s plan (load-bearing — a fenced statement has no verbatim run behind it). A region opens only at a line start (`opens_line`), so `module m; // lucisv: off` no longer opens one — the rule the format-fences README has stated since round 1. Deferred with reasons: port lists, case-item label lists, same-line fences, `PropSeqDecl.locals`. Opentitan: 4 of its 9 fenced files now keep their fenced bytes. | classes | ~~vlog_formatter (fence.rs)~~ done |
| ~~4~~ | ~~A `lint` key in `lucisv.toml` (`[lint.<rule>]` config; selected-rules list) with CLI>config precedence~~ — **delivered 2026-09-02 by semantic-lints-on**: `[lint] select = […] / ignore = […]` in `lucisv.toml` (CLI over config, key by key; unknown rule names fail the run naming the file; `[lint.<rule>]` tables rejected by name — per-rule config was delivered later by linter-expansion-2, v0.38.0; the earlier rejection described here is historical) and `lucisv.lint.select/ignore` settings (registry-validated, republish on change). | linter-core; restated by lint-rules-2, semantic-lints, server-lint | ~~config-discovery / lucisv_core~~ done |
| ~~5~~ | ~~`lucisv check --rules-doc` printing `rules_markdown()`~~ — **delivered 2026-09-02 by macro-word-census (TODO §29.3)**: `lucisv check --rules-doc` prints `rules_markdown()` and exits 0, takes no files, is lint-only; the example binary is gone | lint-rules-2 | ~~crates/lucisv~~ done |
| ~~6~~ | ~~Workspace-wide "does any file mention this name" query — the precondition for the semantic lints defaulting on~~ — **delivered 2026-09-02 by semantic-lints-on**: `FileFacts::words` (one identifier harvest, `vlog_semantic::words`, lifted from the server's candidates) and `WorkspaceIndex::files_mentioning` / `mentioned_outside(name, own_file)`; `FACTS_FORMAT` 12 → 13. The three rules consult a `MentionOracle` and are on by default whenever one exists. | semantic-lints | ~~vlog_semantic (index)~~ done |
| ~~7~~ | ~~`SymbolKind::Interface` (interfaces currently indexed as `Module`; modport/clocking names unbound)~~ — **delivered 2026-09-01 by interface-semantics**: `SymbolKind::{Interface, Modport, Clocking}`, `is_instantiable()` threaded through every Module-exact filter, an interface export rule that treats its signals as its surface, modport/clocking-internal names bound as scope-local references, the modport half of a glued type name bound as `Target::TypeMember`. `program` still indexes as `Module`. Corpus unresolved fell 1 256 → 1 203 | interfaces | ~~vlog_semantic~~ done |
| ~~8~~ | ~~Symlink-cycle detection in the shared walk (both front ends exposed; wants its own round — it changes CLI behavior)~~ — **delivered 2026-09-05 by walk-cycles (TODO §43.1):** `Walk` keeps a `visited` set keyed on `(dev, ino)` (canonical path elsewhere); each directory entered once, a link to one already entered skipped, a link to one not yet entered followed once, a dangling directory link skipped (a dangling source-file link is still handed on so the front end's "no such file" survives). Both front ends. | lucisv-core-lift | lucisv_core |
| ~~9~~ | ~~Chasing `InheritedCandidate` through the member tables (in-file and cross-file) + hover for `extends`~~ — **delivered 2026-09-01 by class-member-access**: `resolve::member_in_chain` walks the in-file `extends` chain, `WorkspaceIndex::base_of` + `member_chain` walk it across files (inside `follow_one`, so hover and cross-file references agree), both cycle-guarded; `this.x`/`super.x` misses ride the same loop. `extends` hover/definition on the base name was already answered by overlay-promotion's type-position promotion. Residue filed in TODO §15 round 2: a `base` field on `ReferenceFact` so `this.x` misses get index postings too | class-semantics | ~~vlog_semantic~~ done |
| ~~10~~ | ~~`Fmt::raw_text`'s string-crossing path emits a `Doc::Text` carrying newlines~~ — **delivered 2026-08-26 (`53f2269`)**: both `raw_text` and the parameterized-type `#( … )` now emit `Doc::Inline`, whose printer arm resumes measuring from the text's own last line. directive-split's README (QA round 3 note) still documents it as open and should be struck there too | directive-split QA | ~~vlog_formatter~~ done |
| 11 | Corpus scripts match `parse error:` / `lex error:` / `verification failed:` textually; a structured `--output-format json` for format mode would remove it | corpus-check | crates/lucisv |
| 12 | `vlog_refactor::scope::Scope::build` re-derives sort-and-dedup by hand; could call `index_order` | indexing-ux | vlog_refactor |
| ~~13~~ | ~~Anonymous-aggregate members (`enum {A,B} x;`) not declared as symbols — hover/definition gap~~ — **delivered 2026-09-01 by struct-members**: anonymous enum variants land in the enclosing scope via the shared `bind_enum_body`; an anonymous `struct {…} s;` declarator and every inline nested struct field carry their own `Struct` child scope, and `member_scope` accepts any symbol whose child scope is a `Struct` scope. Residue filed in the struct-members README: cross-file anonymous struct *variables*, `typeDefinition` inside an anonymous aggregate written as a data declaration | types-decls | ~~vlog_semantic~~ done |
| ~~14~~ | ~~A `program` node with `name_span`/`end_label_span` for linked editing~~ — **delivered by vendor-formal-grammar (0.30.0)**: `parser/item.rs` routes `program` to `parse_module("endprogram")`; the resulting `ItemKind::Module` carries both spans and `linked.rs::module_pairs` consumes them. Confirmed in the 2026-09-04 source audit. | linked-editing | ~~vlog_parser~~ done |
| ~~15~~ | ~~Bind semantics: whether a `bind`'s target scope and connections should resolve through the workspace index (today only the instantiated module name is recorded)~~ — **delivered 2026-09-02 by bind-semantics**: `BindDirective::target` is `Vec<PathSegment { name, span, index }>`; a lone target binds as `Target::Module`, an instance path records nothing (a guess would be a wrong answer); each connection's port half is `Target::Port(inst.module)` and its expression half `Target::BindScope` — the target's own scope first (`resolve::in_bind_target`, `None` on a miss because generate blocks open scopes of their own), the workspace's one-segment member path when the target lives elsewhere, the writing scope last. `FACTS_FORMAT` 14 → 15 | bind | ~~vlog_semantic~~ done |
| ~~16~~ | ~~DPI/package re-export halves as real references (`export pkg::item` doesn't resolve; `*::*` has `"*"` as its package name, which nothing expects)~~ — **closed 2026-09-05 by package-reexports (TODO §48):** both halves of `export pkg::item` are references (`bind_export_path`, no scope import); the index records each package's re-exports (`FACTS_FORMAT` 18, the `RX` group, `*::*` expanded to the package's own imports at record time); the member walk follows them transitively with a visited set, so definition, hover, completion, references and rename read the one edge. Package half closed; the DPI-export `name` remains unbound, tracked separately as §2.9-31. | dpi-export | vlog_semantic |
| ~~17~~ | ~~Inline aggregate as a parameter-override *argument* (`m #(.T(struct packed { logic a; })) u ();`) is rejected in expression position; M4's `instantiation_plan` drops such a `parameter type` default rather than emit unparseable text~~ — **delivered 2026-09-05 by small-items-4 (TODO §45.3):** `parse_expr_or_type` routes a `struct`/`union`/`enum` head to the type grammar; the value is an `ExprKind::Type` printed by the type printer. `instantiation_plan` emits a one-line `parameter type` aggregate default; a multi-line one is still dropped by the "written across several lines" rule, not the grammar. | refactor-instantiate (gap 1; its gap 2 was delivered by ansi-first-port) | vlog_parser |
| ~~18~~ | ~~A macro-invocation census in `FileFacts`~~ — **delivered 2026-09-02**: the engine half by sva-bodies (`macro_use_warnings` pinned for a file in the source set) and the server half by macro-word-census (TODO §29.2): `FileFacts::macro_words` (`words::harvest_raw`, tag `MW`, `FACTS_FORMAT` 16 → 17, +3.1 % corpus / +1.7 % opentitan store), `WorkspaceIndex::files_naming_in_macros`, and a warning appended by `lucisv_server::rename` for every such file **outside** the set `rename_sources` built — no rung, nothing read (58 files in 186 µs on opentitan for `clk`). | refactor-rename; sva-bodies; macro-word-census | ~~vlog_semantic~~ done |
| ~~19~~ | ~~An execute-command spelling of the instantiation skeleton (plain-text `render` through the same `plan_for`), for clients without `textDocument/inlineCompletion` — since the 2026-08-30 names-only popup, such a client (Neovim's built-in LSP, today) has no path to the full skeleton at all. Filed at lead review after correcting the dev's assumption that a `lucisv/instantiate` command already existed (it never did).~~ — **delivered 2026-09-02 by bind-semantics**: `lucisv.instantiate [uri, position, module]` (`lucisv_server/src/instantiate.rs`, advertised by `main.rs::commands()`, routed through `ports::execute`) — `plan_for` → plain `render` under `completion::layout_at` → `workspace/applyEdit`; `at_instantiation_site` validates the position; escaped names go in as plain text. Pinned at the plan level: the command's plan renders to the ghost's text. `editors/nvim/README.md` documents it | inline-instantiation (lead) | ~~lucisv_server~~ done |
| ~~20~~ | ~~Rename loses its heads-up for an **unresolvable member/hierarchical tail** spelling the renamed name (`unknown_mod u_x (); … u_x.sig` when `unknown_mod` is indexed nowhere): before class-member-access the tail had no reference and `rename.rs::stray_reason` warned "a hierarchical or member tail, which lucisv does not resolve"; since round 2 it carries an `ExternalCandidate` the workspace cannot answer, which the engine neither edits (correct) nor mentions. Wanted: a warning for candidate references that spell the old name and stayed unresolved through the overlay — one message per file. Pinned as a premise by `a_hierarchical_tail_that_cannot_resolve_is_left_alone_and_named_as_such`. Same class as item 18.~~ — **delivered 2026-09-02 by comment-slots**: `Scope::unresolved_candidate_warnings` — a reference that stayed `ExternalTarget::StillUnresolved` through the overlay (or an `InheritedCandidate` that missed) is reported one line per (file, unit), run over every file that spells the name. The premise pin is inverted. Surfaced item 23 in the process | class-member-access round 2 (lead) | ~~vlog_refactor (`rename.rs`)~~ done |
| ~~21~~ | ~~`Parser::parse_scoped_name` joins a `pkg::name` chain into one `String`, erasing the segment boundary, so an escaped segment (`\my-pkg ::\state-t` as a type, an instantiated module or a `bind` target) is reprinted without its terminating space and **refused by the safety net** — an error, never a corruption. Wanted: the AST keeps the segments (as `parse_method_name` already does for `FunctionDecl::scope`). Pinned by `escaped_identifiers.cases`'s one `#SKIP` and `verification::an_escaped_name_in_a_scoped_type_is_rejected_rather_than_corrupted`, both of which must keep failing-to-format until delivered~~ — **delivered 2026-09-02 by comment-slots**: `Parser::push_scope_segment` is the one join for every `::` chain and writes the escaped segment's terminator; `parse_method_name` keeps real segments (`ScopeSeg`, one comment slot per `::`). The `#SKIP` is a live case and the verification pin is inverted, with a new pair asserting the tightened spelling is still refused | escaped-identifiers | ~~vlog_parser~~ done |
| ~~22~~ | ~~**Comment slots in shared expression/name machinery** drop the comment and the safety net refuses the file: `q[/*c*/ i]` (index expressions), `x inside {[/*c*/ 0:3]}` and `n /*c*/ inside {` (`inside` / `parse_value_range`), `pkg/*c*/ ::cls::name` (`parse_method_name` chains), `foreach (q[/*c*/ i])` (`parse_foreach_target`), `static /*c*/ constraint` / `pure /*c*/ static function` (`take_member_prefix`). Found by constraint-bodies' exhaustive gap fuzzer (358 gaps; these 40 fail identically on v0.26.0 in the same constructs outside a constraint). Inside a constraint they are regressions relative to the verbatim era — but no opentitan file hits one (sweep unchanged). Wanted: a parser-wide round giving each slot a `Meta`/comments field, then re-running the fuzzer to zero.~~ — **delivered 2026-09-02 by comment-slots**: ~70 named comment fields across `ExprKind`/`Stmt`/declarations/headers/labels (`SegmentComments`, `BinaryComments`, `CastComments`, `LabelComments`, `Stmt::before_semi` + `StmtKind::takes_semi()`), three duplicated grammars folded into `parse_postfix_segment` / `parse_value_range`, and four gap fuzzers at zero — covergroup 329, fragment 153, constraint 395 (committed at last), RTL 352 (new). Corpus (860 files) and opentitan (3 975 files) byte-identical to v0.30.0. Deliberately left: `if`/`case` in-paren comments still recovered print-side by `header_parens` (only `after_kw` got a slot) — a real slot there would change existing layout A fifth fuzzer bar 2026-09-05 (small-items-4, TODO §45.4): the **delay list** — `#(1:2:3)` on nets and continuous assignments, `#(rise, fall)` on gates — gained `MinTypMaxComments`, `ast::DelayValue`, `ContAssign::{after_hash, after_delay}`, `GateInstantiation::{before_hash, after_hash, before_semi}`, `GateInstance::before_args`; `EXPECTED_RTL_GAPS` 374 → 419 at zero. | constraint-bodies (dev + QA) | ~~vlog_parser~~ done |
| ~~23~~ | ~~A **cross-file instance-member tail does not resolve for rename**: with `module sub` in `sub.sv` and `assign w = u_x.sig;` in `top.sv`, renaming `sub`'s `wire sig` edits `sub.sv` only — the same shape in one file resolves and is edited (`a_hierarchical_tail_that_resolves_is_renamed_with_its_declaration`). Since comment-slots the rename *says so* (item 20's warning); the edit itself is the gap. Modules export ports and parameters only (the class-member-access round 2 ruling), so an internal net is exactly what the cross-file hop refuses — the fix is either an export rule for nets named through an instance or a rename-time in-file fallback resolution of the tail.~~ — **delivered 2026-09-05 by hierarchical-tail (TODO §49):** a module has two member surfaces — the *connection* surface (ports, parameters; unchanged for every existing reader) and the *hierarchical* surface (plus nets, variables, instances; a second index table, `FACTS_FORMAT` 19) read only by the tail walk behind an instance head (`Surface::Hierarchical` from `resolve.rs::head_surface`). `assign w = u_x.sig;` resolves cross-file, the rename edits both files, the §2.9-20 warning is retired for a resolved tail. A generate-block-scoped net (`u_x.gen[0].sig`) is on neither surface and is still refused honestly. 514 references newly resolve over opentitan `hw/`. | comment-slots (dev, surfaced by the §2.9-20 control test) | vlog_semantic / vlog_refactor |
| ~~24~~ | ~~A **half-typed `#(` parameter override whose value can read as a call** (`sub #(.W(` ⏎ `u0 (.a(x))`) — the greedy expression grammar swallows the next instance's name before any error fires, so the whole instantiation still degrades to an item-level `Error` node instead of getting header recovery's benefit. Found by §32's QA; the fix is a lookahead in the override grammar (an identifier followed by `(` on a later line is the next instance, not a call).~~ — **delivered 2026-09-04 by small-items-3 (TODO §36)** | header-recovery (QA) | vlog_parser |
| ~~25~~ | ~~The parser **refuses** a module-scope `begin … end` and a bare `begin` inside a `generate` region (an `ItemKind::Error`) rather than recovering them as an unnamed generate block, so `module-begin-block` and `v2001-generate-begin` (TODO §35) fire on an error leaf and the rest of the unit is lost to recovery. Wanted: tolerant-mode recovery that keeps the block's items.~~ — **delivered 2026-09-04 by small-items-3 (TODO §36)** | linter-expansion-3 (dev) | vlog_parser |
| ~~26~~ | ~~**Same-target atomic writers share a temp path.** `atomic::temp_path` uses canonical target + process ID; parallel workers following distinct symlink spellings can reach that same name, while CLI dedup is lexical. A bounded direct helper probe (100 rounds, two threads, 1 MiB each) returned 100 write errors in 200 calls; no mixed final bytes observed in that probe. Use exclusive per-operation temp creation and coordinate/deduplicate target writes. See repository-analysis.md for limits.~~ — **closed by §41 (0.43.0):** unique `O_EXCL` temps (`.{name}.{pid}.{n}.lucisv-tmp`), dedup on `fs::canonicalize`; two *processes* remain last-writer-wins by design, stated in `atomic.rs` | repository audit, 2026-09-04 | lucisv_core / lucisv |
| ~~27~~ | ~~**Net-delay comment slot**: parser-skips records a pre-existing refusal for a comment immediately before `#` in a net declaration. The regression cases mark it `#SKIP`; preserve the verifier's rejection until a parser/formatter comment slot handles it.~~ — **delivered 2026-09-05 by walk-cycles (TODO §43.2):** `NetDelay::{before_hash, after_hash}` own the gaps around `#`; the `#SKIP` is retired; the RTL gap fuzzer covers it. The gaps inside delay lists subsequently closed in small-items-4 (§45.4; see §2.9-22). | parser-skips (dev + QA) | vlog_parser / vlog_formatter |
| ~~28~~ | ~~**Project lint selection is not consumed by the server.** `enabled_rules` reads `ClientSettings`; `configured` reads project rule options and line length only. `[lint] select/ignore` currently controls CLI runs, while the editor needs `lucisv.lint.select/ignore`. Decide and test a common precedence contract before claiming project-wide parity.~~ — **closed by §42 (0.43.0):** `enabled_rules` picks the editor's list when set, else the project's, key by key (the CLI's `pick`); rejected project entries logged once with file:line | repository audit, 2026-09-04 | lucisv_server |
| ~~29~~ | ~~An unknown rule name in the **editor's** `lucisv.lint.select`/`ignore` is still dropped silently, while §42 logs the same mistake in a project file (and `lucisv.lint.options` logs its bad entries). Wants the same once-only log through `notification.rs`.~~ — **delivered 2026-09-05 by small-items-4 (TODO §45.1):** `settings::rules` records every dropped name in `ClientSettings::lint_name_warnings` as `lucisv.lint.<select|ignore>: unknown rule: <name>`; `apply_settings` logs what the previous settings value did not already say — once per (setting, name), re-armed by a changed list. | lint-config-contract (QA) | lucisv_server |
| ~~30~~ | ~~**An unreadable directory aborts the whole walk.** `Walk::dir` propagates `read_dir`'s error with `?`, so one permission-denied directory anywhere under the start — reachable now that a symlink to an outside directory is followed once (§2.9-8's ruling) — drops every file already found and fails the run. Found by walk-cycles' QA on a link to `/`. Wanted: skip the directory and say so through a warning channel the walk does not have today (the filelist-missing-file precedent), which is also where a dangling source link's warning belongs.~~ — **delivered 2026-09-05 by small-items-4 (TODO §45.2):** `walk::collect_files` takes a `&mut dyn FnMut(Warning)` sink; an unreadable directory, an unreadable `.gitignore` and a dangling source link are warned about (`warning: <path>: <message>` on the CLI's stderr before the report, exit code unchanged; logged once per scan by the server through `report_scope`) and the walk continues. | walk-cycles (QA) | lucisv_core / lucisv / lucisv_server |
| 31 | **DPI-export name binding remains open.** Package re-export resolution closed §2.9-16, but the name in a DPI export is still not a semantic reference. Keep this separate from the delivered package-member traversal. | dpi-export request (b); package-reexports | vlog_semantic |
| 32 | **The refactoring verifier does not catch a same-file relocation of a never-dropped piece written as two well-formed edits** (delete here, insert there): `verify_move` computes `after` by applying the edits, so `positions_match`'s reconstruction cannot diverge from it and equation 3 of the ledger is unreachable through any real caller. No planner produces the shape today. Wanted: an independent `after` (the client's applied text, or a second reconstruction) and a test that isolates equation 3. Found by extract-module's QA re-attack. | extract-inline-module (QA) | vlog_refactor |
| ~~33~~ | ~~**`module_sources`' fan-out has no rung for a file that reaches an instance through an intermediate module it does not itself instantiate** (a bench naming `wrap.u_S.x` where `wrap` instantiates `S`): inline-module's hierarchical-reference refusal sees only the handed files, so such a reference is missed. Wanted: a transitive-instantiators rung (§49's hierarchical surface knows the path) in `module_sources` for the refactorings that must see every hierarchical use. Found by §53.2's QA.~~ — **closed 2026-09-07 by perf5-p2 (TODO §60.2): a fifth, opt-in rung** `Workspace::module_sources_reaching(file, modules, Reach { scopes })` in `lucisv_server/src/module_select.rs` — every file whose *token census* (`WorkspaceIndex::files_mentioning`, i.e. `FileFacts::words`) writes the dissolved instance's name down. That is exactly the set `no_hierarchy` can refuse from, so the selected set answers the refusal as the whole workspace does (asserted engine-run-twice on six shapes; QA attacked seven more incl. `$root`, a macro-built `bind` path, an escaped identifier, a generate label). **The transitive-instantiator walk this row asked for was implemented and rejected:** a `bind tb.u_wrapper.u_top.u_sub …` in an SVA file that instantiates nothing in the chain has no instantiation edge for any walk to follow — structurally weaker, confirmed by QA. Only inline-module asks for the rung (extract and ports pass `Reach::none()`, unchanged in answer and cost); worst corpus cost 2 % of files on a command, +1.2 ms at the measured site. | extract-inline-module (QA) | lucisv_server / vlog_refactor |
| ~~34~~ | ~~**The format cache omits `Config::uvm_utils_indent`.** CLI `args.rs::config_with` applies the key, but `main.rs::entry_for` and core `cache::Entry` serialize/compare only content, line length and indent (plus the store version). On one UVM class: cache a clean verdict with the option false, change only the option to true, then cached `--check` exits 0 while `--no-cache --check` exits 1. Wanted: key/equality/codec coverage for the option and a regression for both toggle directions. Until fixed, use `--no-cache` or delete the format cache after toggling. See repository-analysis.md for the bounded reproduction.~~ — **fixed 2026-09-07 (TODO §59, 0.50.0):** `Entry` carries `uvm_utils_indent`, `entry_for` fills it, the store line has it as a fourth field; a well-formed five-field (0.49.0) line is dropped individually like another version's entry; the audit's probe is `changing_uvm_utils_indent_invalidates_the_entry` in `lucisv/tests/cli.rs`, both directions. | repository audit, 2026-09-07 | lucisv_core / lucisv |
| 35 | **MCP-5 → `vlog_parser`:** lift the server's `expand.rs` (one-step macro expansion) into `vlog_parser::defines` as a pure move so `lucisv-mcp`'s `defines` can offer expansion — *moot since M7: `defines` folded into `find`, which lists a macro's definitions and no expansion* | mcp-navigation | vlog_parser |
| 36 | **MCP-6 → `lucisv_server` (possible bug):** LSP `references` omits three real `aes` instantiations in the `*_pd_main.sv` tops (and their `.clk_i` connections) that `lucisv-mcp`'s whole-set answer lists; stable after a 30 s settle, not investigated | mcp-navigation | lucisv_server |
| 37 | **MCP-7 → `vlog_refactor`:** a `find_references` variant taking `&dyn KnownFacts` (like `rename_traced_with`) so whole-set callers feed cached records instead of re-parsing 3 944 files (≈2 s per opentitan call today) | mcp-navigation | vlog_refactor |
| 38 | **MCP-8 → `vlog_refactor`:** false `remove_port` refusal when the only "use" of the port is a named connection from another module in the same file (`ports/remove.rs::body_uses_in`) | mcp-edit-tools | vlog_refactor |
| 39 | **MCP-10 → `vlog_refactor`:** `extract_module` writes LF into a CRLF file (`extract/render.rs`) | mcp-edit-tools | vlog_refactor |
| 40 | **MCP-11/12 → `vlog_refactor`/`vlog_semantic`:** a batched `find_references` for several declarations; ~~`find_references` misses a hierarchical use into a generate loop (`gen_l[0].z`)~~ — **second half answered 2026-09-30 by generate-label-rename (TODO §65.1, row 43)**; the batched `find_references` stays open | mcp-structural-edits | vlog_refactor, vlog_semantic |
| 41 | **MCP-13 → `vlog_linter`:** a forced deletion of a non-ANSI body port leaves a header port with no direction and no lint reports it | mcp-structural-edits | vlog_linter |
| 42 | **Parser leniency → `vlog_parser`:** a trailing `,` in a named connection list, an empty concatenation element `{d,, d}`, and `type(x)'(y)` in a connection parse without a diagnostic (the rename verifier's position rule covers the rename; every other splice contract is exposed) | refactor-rename (M3.5) | vlog_parser |
| ~~43~~ | ~~**MCP-14 → `vlog_refactor`/`vlog_semantic`:** rename of a generate block label leaves hierarchical paths through it unrewritten and `find_references` does not report them — vlog_refactor/vlog_semantic; the MCP layer refuses the rename; the LSP still allows it~~ — **closed 2026-09-30 by generate-label-rename (TODO §65.1, 0.60.0):** the gap was resolution, not the rename — `vlog_semantic` now declares a `for` block's label in the enclosing scope (the genvar stays in the header), treats `generate … endgenerate` as no scope, gives a named block a member scope, walks an index in a path as the name it indexes, and puts blocks on a module's hierarchical surface with their members under the synthesized key `module.label` (`FACTS_FORMAT` 21; `Semantics::member_key`, which `lucisv_server/src/nav.rs` now asks with). Every segment — bare, indexed, nested, cross-file — and the closing label are ordinary references, so `find_references`, `rename` (LSP, CLI engine, MCP) and the verifier's unchanged resolution print all see them; no verifier normalization was added, eight attacks pin that (`check/qa_block_paths.rs`). `lucisv-mcp`'s `block` refusal is lifted. Also answers row 40's second half (`gen_l[0].z` is found). | mcp-lean-catalogue | vlog_refactor, vlog_semantic |
| 44 | **A comment between a generate `end` and `else`** (also a trailing `// c` after a labelled generate `end` before `else`) is a verification error, so the file is left unformatted — the safety net works, the formatter should not need it. Present in 0.65.4 (TODO §71 wave 4) | format-styles (QA) | vlog_parser / vlog_formatter |
| 45 | **`` `ifdef `` between `end` and `else` is a parse error** (TODO §71 wave 4) | format-styles (QA) | vlog_parser |
| 46 | **An attribute on an ANSI port** (`(* keep *) input a`) is a parse error (TODO §71 wave 4) | format-styles (QA) | vlog_parser |
| 47 | **Multi-instance declarations under one-per-line styles** (`p1 u8 (...), u9 (...)`) get the hanging layout instead of the style's (TODO §71 wave 4; CHANGELOG 0.65.5 known limit) | format-styles (QA) | vlog_formatter |
| 48 | **Directory-only watcher events.** VS Code coalesces deletes under a removed folder into one folder event and the client's `**/*.{v,vh,sv,svh}` filter drops it, so the server receives nothing; a folder moved in is dropped likewise. Wanted: a second registration (`**/*`, `Create \| Delete`) and a handler expanding a folder to the held files and include lines under it — changes every client's registration and traffic, the owner's call (TODO §71 waves 5–6) | localized-reindex (QA P1); scan-ordering | owner decision, then lucisv_server (`main.rs`/`watch.rs`) |
| 49 | **A buffer the scope would not take stays indexed after `didClose`** (excluded or unlisted, taken in by a scan or the one-file path), and **closing an unsaved in-scope buffer a rescan indexed leaves its text in the index** (QA-7a). One root: a close does not touch the index. A one-file remove costs ~225 ms on OpenTitan (fixed and reverted in scan-ordering); wanted: a cheap removal, e.g. a tombstone the next scan or publish folds in (TODO §71 waves 5–6) | localized-reindex (QA P2); scan-ordering (QA-1, QA-7a) | vlog_semantic (index removal) / lucisv_server (`state/`) |
| 50 | **An unheld buffer opened while a scan runs is never taken in** by that scan or afterwards; opened before the scan it is held — the same final state answers differently by timing (TODO §71 wave 6) | scan-ordering (QA-2) | lucisv_server (`state/scan.rs`, `server/index.rs`) |
| 51 | **Symlinked files are held under one spelling or both** depending on what was open at scan time (`discover.rs`'s `Aliased`); incremental and rebuild answers disagree in all six `filelink.py` variants. Rule to adopt: one file, one spelling, whatever is open — in the walk, the overlay and the one-file path together (TODO §71 waves 5–6) | localized-reindex (QA P3); scan-ordering | lucisv_server (`state/discover.rs`, `state/incremental.rs`) |
| 52 | **A request held during a scan is answered against the newest text**, so a position-based request can resolve a different symbol when an edit moved the text under it; rename edits carry no document version for the client to reject (TODO §71 wave 6) | scan-ordering (QA) | lucisv_server (`server/`, `rename.rs`) |
| 53 | **Renaming a port of a module defined twice** gives an edit or a refusal at random across fresh servers (`top_englishbreakfast/ip/ast/rtl/adc.sv:81`, `qa717/drv/dup.py`); not diagnosed (TODO §71 wave 6) | scan-ordering (QA-7c) | vlog_refactor / lucisv_server (`module_select.rs`) — undiagnosed |
| 54 | **`lucisv-mcp` re-reads a file with a future mtime on every call**, forever (67 ms against 7 ms per `find` on 4 000 files) — the racy rule never settles (TODO §70) | linux-test-portability (Round 2) | lucisv_mcp (`project/files.rs`) |
| 55 | `crates/lucisv/tests/cli.rs:2149` (`a_stdin_buffer_reads_the_rule_options_too`) asserts only an empty stdout, no exit code (TODO §70) | linux-test-portability (Round 2) | crates/lucisv (tests) |
| 56 | `crates/lucisv_mcp/tests/qa_m3.rs` uses `std::os::unix` with no `cfg`, so `cargo check --all-targets` for Windows fails (tests only; the `cross` gate checks binaries only) (TODO §70) | linux-test-portability (Round 2) | lucisv_mcp (tests) |
| 57 | **Releases are gated on macOS alone**: Linux runs the suite in `ci.yml` but the release does not wait for it, and Windows is compile-checked (`cross`), never executed (TODO §70) | linux-test-portability (Round 2) | tools/ + CI (lead) |
| 58 | **The discovery walk at the start of every scan drains nothing** (25–80 ms on OpenTitan): what is left of the first-colour wait in workspace scope (62–86 ms late open) and the rescan hold (70–159 ms). Wanted: a resumable walk in `state/discover.rs` (it holds `&mut Workspace` throughout `begin_scan`), with its own identical-result proof (TODO §71 wave 7) | viewport-highlight (Handshake request 2) | lucisv_server (`state/discover.rs`) |
| 59 | **A `range` answered during a rescan always counts as a guess** (`Viewport::guessed`) and costs one refresh at settle even when nothing changed (TODO §71 wave 7) | viewport-highlight (QA) | lucisv_server (`server/viewport.rs`) |
| 60 | **An edit in one file that changes how another open file colours sends no refresh** (a package type renamed) — as before this lane (TODO §71 wave 7) | viewport-highlight | lucisv_server (`server/viewport.rs`) |
| 61 | **Inside the startup settings wait, the client's answer to the pull is applied ahead of an older settings push held with it** (`server/startup.rs`, `take_the_answer_out_of_held`); predates fast-actions; needs a client whose push and answer disagree in one burst (TODO §71 wave 8; fast-actions QA F1) | fast-actions (QA) | lucisv_server (`server/startup.rs`) |
| 62 | **`tests/fast_actions_bursts.rs`'s oracle accepts an answer the reference gives after any later message of the round**: 2–9 % of injected stale answers pass when a later message restores the state; every mutation is still caught and the directed tests lack the weakness (TODO §71 wave 8; fast-actions QA F4) | fast-actions (QA) | lucisv_server (tests) |
| 63 | **Whether a large open buffer is in the index depends on when it was opened, saved or scanned** — a fast-path buffer contributes nothing when open at scan or save time but keeps its disk record when opened after the scan; 77–98 answers differ between a settled session and a fresh server on OpenTitan. Predates fast-actions; wanted: always keep, or always drop, the disk record of a fast-path buffer at open, save, flip and scan alike (TODO §71 wave 8; fast-actions QA S2, Handshake request 8) | fast-actions (QA) | lucisv_server (`state/`, the index lane) |
| 64 | **The 40 000-file rescan after a delete takes either 12.3 s or 14.5–15.5 s**, on 0.65.10 and 0.65.11 alike; cause not found (TODO §71 wave 8) | fast-actions | undiagnosed (lucisv_server scan) |
| 65 | **`ci.yml` runs `cargo test --workspace` bare in both jobs**, not through `tools/guard.sh` as CLAUDE.md's runaway guard asks of every `cargo test`; predates 0.65.9 for the macOS job, the Linux runner is resource-capped. Recorded, not judged (topo refresh 2026-11-19) | topo refresh (draft discrepancy 10) | CI (lead) |
| 66 | **The `cross` gate step reports `SKIPPED (no toolchain)` rather than failing** when `~/.rustup/toolchains/stable-aarch64-apple-darwin` is absent, so a green `gates.sh` on another machine does not prove the cross build (topo refresh 2026-11-19) | topo refresh (draft discrepancy 11) | tools/ (`gates.sh`, lead) |
---
## 3. Combined graph — features mapped onto modules
### 3.1 Feature → primary-home matrix
Where a feature's code chiefly lives (its README remains the authority on
exact file scope). Cross-module touches are recorded per-feature in §2 and in
each feature README's Handshakes; this matrix names only the primary home.
The newer features and their complete cross-crate touch sets are in §1.4.
Grammar-lane features (*italicized*) routinely add exhaustive-match arms in
other crates — see §3.3's `ast/` row — though not always a formatter arm:
directive-split and ansi-first-port shipped with `vlog_formatter/src`
untouched, reusing existing arms.
| module | features whose home it is |
|---|---|
| `vlog_parser` | spans, name-spans, recursion-limit, error-recovery, define-table, lexer-cleanup, decomposition-parser, and the grammar lane: *macro-items*, *classes*, *bind*, *dynamic-types*, *types-decls*, *item-misc*, *directives-in-lists*, *directives-in-instances*, *dpi-export*, *assertions*, *interfaces*, *expressions-2*, *dv-statements*, *mop-up-2*, *directive-split*, *ansi-first-port*, *null-items*, *constraint-bodies*, *covergroup-bodies*, *fragment-mode*, *vendor-formal-grammar*, *comment-slots*, *bind-semantics*, *sva-bodies* (most also add formatter arms — parser+formatter pairs by default; directive-split and ansi-first-port reused existing arms and left `vlog_formatter/src` untouched) |
| `vlog_formatter` | safety-net (`verify.rs`), case-tables, formatter-bug-fixes, corpus-bugs, comments-round, comments-round-2, alignment (`align.rs`), format-fences (`fence.rs`), range-formatting (`range.rs`), shared-fence-filter, decomposition-formatter, and the layout halves of constraint-bodies, covergroup-bodies, comment-slots, bind-semantics and sva-bodies (`format/`), format-styles (`style.rs`, `auto.rs`, `align.rs` mode) |
| `vlog_semantic` | vlog-semantic (`bind/`, `resolve.rs`, `model.rs`), workspace-index (`workspace/`), decomposition-semantic, class-semantics, interface-semantics, class-member-access, struct-members, overlay-promotion, port-detail-spans (`Symbol`/`Def::detail_span` and `Semantics::symbols_named`), hover-line-index (`DeclLines`, facts codec), vscode-hierarchy-sidebar's declaration/instance positions, scan-interleave (`WorkspaceIndex::absorb`), semantic-lints-on's word census, bind-semantics and sva-bodies, refactor-rename's performance amendment (`files_spelling`), plus the index halves of indexing-ux (`index_order`/`IndexBuilder`), index-scope (order-insensitive `finish`, facts-from-analysis), incremental-index (`update_file`, edge/reference tables, `instantiations.rs`, `classes.rs`), index-persistence (`facts.rs`; `FACTS_FORMAT` 22; plus a small `vlog_parser::defines` touch — `DefineTable::from_entries`, `Eq` derives), localized-reindex (`workspace/{dependents,references,replace}.rs`) |
| `vlog_linter` | linter-core, lint-harness, lint-rules-2, semantic-lints (`signals.rs`), semantic-lints-on (workspace oracle), one-parse (`context.rs`) |
| `vlog_refactor` | refactor (plan), refactor-rename (including `prepare_rename_here` / `rename_name_at` selector half), refactor-ports (including module-target selectors), refactor-instantiate, references-nav (whole-scope equivalence oracle), and the refactor half of decomposition-semantic; expand-wildcard and convert-to-ansi (`ports/`), organize-imports (`imports.rs`), extract-inline-module (`extract/`, `inline/`, `check/ledger.rs`) |
| `lucisv_core` | lucisv-core-lift (`config.rs`, `walk.rs`), filelist (`filelist.rs`), format-cache (`cache.rs`), format-styles (`STYLE_NAMES`, cache `style` field) |
| `lucisv` (CLI) | cli-polish, config-discovery (wiring), parallel-files, cli-filelist, linter-core (CLI half in `lint.rs`), one-parse (`lint.rs` parses once via `ParsedSource`), format-cache (wiring), release-prep (`--version` contract), format-styles (`--style`) |
| `lucisv_mcp` | the MCP block (`docs/features/mcp-*`), linux-test-portability Round 2 (`project/files.rs` stamp), format-styles (`format`/`diagnostics` take the style) |
| `lucisv_server` | lucisv-server (trunk), decomposition-server (`server/`, `completion/`), and one or two modules per capability feature: editor-scopes→`pairs.rs`, filelist→scope ladder in `state.rs`, include-nav→`includes.rs`, completion-core/fuzzy-completion/member-completion→`completion/`+`candidates.rs`, completion-templates→`templates.rs`, inline-templates→`inline.rs`, inline-instantiation→`inline.rs`+`completion/`+`candidates.rs` (+`settings.rs` key), bind-semantics→`instantiate.rs`, macro-expansion→`expand.rs`, hierarchy→`hierarchy.rs`, vscode-hierarchy-sidebar→`design_hierarchy.rs`, type-hierarchy→`type_hierarchy.rs`, type-definition→`type_def.rs`, code-lens→`lens.rs`, inlay-hints→`inlay.rs`, server-lint→`lint.rs`+`lint/project.rs`+`code_action.rs`, one-parse→`lint.rs`+`state.rs` (`Document.tree`), refactor wiring/performance fan-outs→`rename.rs`/`ports.rs`+`state.rs`, apply-edit+folders-and-config+cancel-request+work-done-progress→`server/`, editor-settings+indexing-ux+index-scope+index-persistence→`settings.rs`+`state.rs`(+`index_cache.rs`), incremental-sync→`sync.rs`, file-watching→`watch.rs`, file-operations→`file_ops.rs` (+`include_sources` in `state.rs`), pull-diagnostics→`diagnostics.rs`+`server/`, semantic-tokens-delta→`tokens.rs`+`server/semantic_tokens.rs`, on-type-formatting→`on_type.rs`, will-save-wait-until→`format.rs` (+`settings.rs`/`main.rs`), selection-range→`selection.rs`, linked-editing→`linked.rs`, references-nav (server half)→`folding.rs`+`nav.rs`, large-file-mode→`large.rs`+`server/large_file.rs`, lsp-318-extras→`format.rs` (+`main.rs` capability), hover-declarations→`hover.rs`(+`nav.rs`), port-detail-spans (server half)→`hover.rs`+`nav.rs`, hover-line-index→`hover.rs`+`locate.rs`+`state.rs`, scan-interleave/change-debounce/verbose-timing→`server/`+`state.rs`, perf5-p1→`fences.rs` (+ the `_at` helpers in `ports.rs`/`imports.rs`/`extract.rs`/`inline_module.rs`), perf5-p2→`rename_trace.rs`+`module_select.rs`, perf5-p4→`scan_trace.rs`+`scan_order.rs`+`server/startup.rs`+`state/scan.rs`, perf5r-first-answer→`state/discover.rs` (+ counters and the compaction skip in `index_cache.rs`), perf measurements→`src/perf.rs` (`docs/perf/README.md`, not a feature README), interactive-latency→`state.rs` (the two token searches) + `selection.rs`/`on_type.rs`/`completion/`/`inline.rs` (their callers) + `src/perf.rs`/`tests/e2e.rs` (its measurements), editor-packaging (grammar test)→`tests/grammar.rs`, localized-reindex→`state/incremental.rs`+`state/watched.rs`+`watch.rs`+`includes.rs`+`candidates.rs`+`server/index.rs`, scan-ordering→`server/mod.rs`+`server/batch.rs`+`caret.rs`+`server/dispatch.rs`, viewport-highlight→`server/viewport.rs`+`tokens/`+`large.rs`+`server/index.rs`, ifdef-folding→`folding/directives.rs`, format-styles (server half)→`auto_style.rs`+`server/formatting.rs`+`settings.rs`+`lint.rs`, fast-actions→`server/ahead.rs`+`same_file.rs`+`completion/related.rs`+`completion/wire.rs` (+ `flush_buffer` in `server/diagnostics.rs`, `reclassify_large_buffers` in `server/large_file.rs`, `owes_a_state_change`/`settings_announced` in `server/mod.rs`) |
| `editors/vscode` | editor-packaging, editor-snippets, editor-settings (manifest half), editor-scopes (rainbow half), vscode-hierarchy-sidebar (`hierarchyView.js`/`hierarchyModel.js`), dut-hierarchy (`hierarchySections.js`), extract-inline-module (`extract.js`), editor-platform-vsix, editor-marketplace-page, index-persistence (`storagePath` line), verbose-timing (`lucisv.verbose`, spawn args and restart in `extension.js`), hierarchy-current-path (`hierarchyCurrent.js`, `media/hierarchy.*`), comment-highlighting (`commentScan.js`, `commentKeywords.js`), format-styles (`lucisv.format.style`), scan-ordering (`referencesView.js`) |
| `tools/` + CI | corpus-check, release-prep, ci-release, editor-platform-vsix (staging), range-formatting (`lucisv-changed.sh`), release-gates (`gates.sh`, `release.yml`), linux-test-portability (`linux_check.sh`, `ci.yml` `linux` job) |
### 3.2 The combined picture
```mermaid
graph TD
subgraph parser [vlog_parser]
gram[grammar-lane features] --- pinfra[spans / name-spans / recursion-limit / error-recovery / define-table]
end
subgraph fmt [vlog_formatter]
net[safety-net verify.rs] --- fmtf[fences / range / alignment / comment rounds]
end
subgraph sem [vlog_semantic]
core[vlog-semantic] --- idx[workspace-index + incremental / persistence / scope / ux]
end
subgraph lint [vlog_linter]
lc[linter-core + rules + harness + semantic-lints]
end
subgraph refac [vlog_refactor]
ms[rename / ports / instantiate / references / imports / extract / inline]
end
subgraph corelib [lucisv_core]
cw[config + walk + filelist + cache]
end
subgraph cli [lucisv CLI]
clif[cli lane features]
end
subgraph srv [lucisv_server]
caps[capability handlers]
end
subgraph ed [editors/vscode + tools/CI]
pkg[packaging lane]
end
gram --> fmt
fmt --> parser
sem --> parser
lint --> parser
lint --> sem
lint --> corelib
lint -.test-only.-> fmt
refac -.test-only.-> fmt
refac --> parser
refac --> sem
srv --> parser
cli --> parser
cli --> corelib
cli --> fmt
cli --> lint
srv --> corelib
srv --> sem
srv --> refac
srv --> fmt
srv --> lint
pkg --> srv
pkg --> cli
```
Reading it feature-side: a grammar feature is by default a
**parser+formatter pair** (new AST + its layout, plus minimal arms in
`bind/`/`tests/spans.rs`) — though one that reuses an existing arm ships with the
formatter untouched (directive-split, ansi-first-port); an index feature is a
**vlog_semantic + lucisv_server pair** (the data structure and the
events/settings around it); a capability feature is usually **server-only
plus one manifest line** (one handler module + `main.rs` capability + often a
`settings.rs` field, which then owes an `editors/vscode/package.json`
`contributes.configuration` entry — the choke point whose mismatches are
silent); a packaging feature is **editors/tools-only, save for the two pins
it owns in Rust** (editor-packaging's `tests/grammar.rs`, release-prep's
`--version` shape). Those shapes are the default that makes the lanes
parallel-safe — not an invariant; say in your scope which arms you actually
owe.
### 3.3 Choke points — files where features meet
These are the highest-contention interfaces. When two agents' scopes both
name one of these, they are not parallel — serialize or split the file's
ownership explicitly.
| choke point | owner (feature) | consumers | the rule |
|---|---|---|---|
| `vlog_parser/src/ast/` | the grammar lane collectively | formatter, semantic, linter, refactor, server, `tests/spans.rs` | A new variant costs, at minimum: a `format/` arm, a `bind/` arm, a `spans.rs` arm. `visit.rs` is catch-all for compilation only — a variant containing items/statements still needs an arm there or AST lint rules never see inside it. Prefer **additive fields / parallel vectors** over changing vector element types — that is why `ListDirective` sits beside the lists instead of inside them (two rounds chose it independently for blast-radius reasons). |
| `vlog_formatter/src/verify.rs` | safety-net | every formatter feature; the CLI's exit-2 promise | CLAUDE.md invariant #4. Never widen a normalization without masked-corruption attack tests; the standing pattern is "untouched + rejection tests anyway". The single widening in history is macro-items' backtick-`Ident` arm in `normalize` — which produced lucisv's one real corruption; its repair, `trim_lines_outside_strings`, is a *narrowing*, and the pattern to copy: the widening shipped without attack tests, the fix shipped with them. `line_starts_inside_string` is the one definition of "which line breaks are data" — both `format/` and `verify.rs` must read it. |
| `vlog_formatter/src/fence.rs` | format-fences | range-formatting, shared-fence-filter, CLI `--fix` (`lucisv/src/lint.rs`), server quick fixes (`lucisv_server/src/lint.rs`) | `protected_regions`/`is_protected` are the **only** supported way to ask "may an automatic edit touch these bytes". One answer, **two** front ends — and `vlog_linter` is deliberately not one of them (it stays fence-blind; the filter lives in each front end). Class and statement scopes are supported by statement-fences (§2.9-3 delivered); `range::plan` must merge these protected spans with unselected runs. Port and case-label lists remain outside independent fence scopes. |
| `lucisv_server/src/pairs.rs` | editor-scopes | documentHighlight, missing-closer diagnostics, scopePairs rainbow, folding, completion gates, on-type indent, inline-templates, expand-selection (`selection.rs`) | The `RULES` table + no-closer guard list is shared truth. Any keyword added to/removed from `token.rs` requires re-checking it (a word that stops being a keyword silently stops being matched). |
| `lucisv_server/src/server/` | lucisv-server; amended by cancel-request, change-debounce, scan-interleave, index-scope, verbose-timing, scan-ordering, viewport-highlight, fast-actions | every request/notification and every rebuild trigger | One ordered loop owns all mutable server state. A startup scan may publish a prefix and answer queued work between files; a request queued behind a rescan trigger is held until that rescan lands, and its cancel travels with it. Never make the distinction time-based: machine load must not change which index a request sees. Verbose timing may observe each wrapper/lifecycle but must be entirely silent when off and must not move protocol ordering. The queue thread only forwards protocol messages and must never parse. No notification overtakes an older notification (`must_hold`; the answer to a settings pull counts as one, `owes_a_state_change`). The only requests answered out of arrival order are those `Server::answer_from_the_buffer` (`server/ahead.rs`) lets go: a text-current colouring request, or a `same_file` request whose answer is its buffer's. |
| `lucisv_server/src/server/mod.rs` (`process_batch`, `must_wait`, `must_hold`, `behind`, `hold`) | scan-interleave; amended by scan-ordering, viewport-highlight, fast-actions (`owes_a_state_change`, `settings_announced`) | every client message; the early-answer path (`server/ahead.rs`) reads `held`/`behind`/`dirty`/`staging`/`pending` | Every client message goes through `process_batch`; nothing applies one around it. `must_hold` is the one ordering rule and `behind` its count; a new exemption is taken where requests are held, reads only what the exempted handler proves it needs, and states why that is valid between two scan files. |
| `lucisv_server/src/server/index.rs` (`reindex_*`, `answer_what_is_waiting`, `BURST_DIVISOR`) | scan-interleave / index-scope; amended by localized-reindex, scan-ordering, viewport-highlight, format-styles (no lines) | saves, watcher events, widens, startup | localized-reindex owns the one-file/outside/burst decisions; scan-ordering owns hand-back (`opened_mid_scan`, once per file opened); viewport owns the widen deferral (`defers_widen`) and fast-actions the drain (`answer_ahead_mid_widen` in `server/ahead.rs`, `answer_colours_mid_widen` until 0.65.11). Two of those in one wave are not parallel. |
| `lucisv_server/src/server/notification.rs` | lucisv-server; amended by localized-reindex, scan-ordering (`didOpen` arm), format-styles (three `auto_styles` calls), viewport-highlight (reads), fast-actions (`settings_announced`, `reclassify_large_buffers` from `apply_settings`) | every notification; `ahead::REACH` (one row per arm, test-pinned) | A notification arm is where state changes are *applied*, so scan-order effects (`head_owed`, `opened_mid_scan`) and per-document memories (`auto_styles`) are set here, never read off a batch. A new arm needs a `REACH` row in `server/ahead.rs` or the precondition test fails; until it has one it reaches `Any` (early answers wait behind it). A lane needing a line here asks the owning lane (format-styles' three lines were granted). |
| `lucisv_server/src/server/dispatch.rs` (`symbol_offset`, `answer_flushed`) | lucisv-server; amended by scan-ordering, viewport-highlight, fast-actions | every request handler | A name-under-the-cursor request resolves through `symbol_offset`; a request with its own boundary rule keeps `offset` and says so in scan-ordering's table. `answer_flushed` is dispatch minus `flush_dirty` and must stay a pure split. A new request arm needs a row in fast-actions' README table (`same_file/tests.rs` reads the arms and fails otherwise) and stays out of `same_file::METHODS` unless its handler reads only the buffer. |
| `lucisv_server/src/server/ahead.rs` (`answer_from_the_buffer`, `REACH`, `can_reach`) + `same_file.rs` | fast-actions (viewport-highlight's colour exemption moved here) | `process_batch`, `set_aside`, `answer_ahead_of`, `open_then_widen`, `answer_ahead_mid_widen`, `answer_held_ahead`; `viewport.rs` (`colours_may_go_ahead`, `coloured_ahead`); every `same_file` handler (hover, nav, symbols, folding, selection, linked editing, highlights, references, prepareRename, signature help) | The precondition is stated once, on `answer_from_the_buffer`, and nowhere else; a new place that offers a request early calls it, never a copy. `REACH` lists what is **proved** harmless — a notification without a row waits, a handler that starts touching a buffer it does not name moves its row to `Any`, a new `Pending` kind is classified in `can_reach`. `same_file::answered_by_the_buffer` must change with any handler arm that starts reading the index or the overlay; `fast_actions_differential.rs` (early == settled) is the alarm. |
| `lucisv_server/src/state/` (`state.rs` until TODO §55) | lucisv-server; amended by filelist, index-scope, scan-interleave, indexing-ux, incremental-index, index-persistence, hover-line-index, large-file-mode, one-parse (`Document.tree`), editor-settings + folders-and-config (`set_client_settings`/`change_roots`), include-nav (the include graph), completion-core (candidates), file-watching, interactive-latency (`first_token_reaching`/`first_token_from`), refactor performance fan-outs | every handler | `Workspace` is immutable through request handlers except the interior-mutable four-entry/8 MiB `FileView` cache. The scope ladder (filelist > `index.scope: "workspace"` > folder-scope at shipped depth 2; a rootless session never climbs; it reads flat at depth 0 and walks descendants at positive depth (including the default 2)) and open-buffer overlay are contracts. `Scan` has whole/widen shapes but one step/finish path; index/candidate/include prefixes publish together. `module_sources`, `rename_sources`, and `include_sources` must remain supersets of what their engines can edit/refuse over; `rename_sources` falls back to `sources()` when an ambiguous posting prevents a proven bound. `update_one` and a completed scan must equal a fresh build (`fingerprint`). Handlers reading `doc.text` instead of tokens/tree must check `doc.large`. **(2026-09-12)** `Document::new`'s derivations are individually traced (`lint_trace::Rebuild`), so a stage added to or removed from that constructor wants a `Rebuild` variant beside it. |
| `lucisv_server/src/settings.rs` | editor-settings | folders-and-config, indexing-ux, index-scope, index-persistence, inline-templates, will-save-wait-until, filelist, large-file-mode | One parser for both doors (push and pull, via `from_section` re-wrapping). Every key drops garbage independently; defaults that are not "silence" (1 MiB cap, log on, persist on, 4 MiB large-file threshold) are hand-written in `Default`. `set_client_settings` returns whether a reindex is owed — new keys must decide that question explicitly. |
| `vlog_semantic/src/workspace/` (+ `facts.rs`) | workspace-index; extended by incremental-index, index-persistence, index-scope, hover-line-index, scan-interleave, member semantics, semantic-lints-on, bind-semantics, SVA bodies and refactor-rename performance | server state, hierarchy/lens/type-hierarchy, refactor, completion, semantic lints | Determinism (same inputs → same index, any order), the `paths` spelling coupling with `resolve.rs`, `FACTS_FORMAT` bumped on any codec change (current 22), edge/posting tables built by the same lifted walks the engines use. `DeclLines` must round-trip and participate in `fingerprint`; `absorb` must equal one build over the resulting record set; `files_spelling` must continue to include unresolved non-empty external/inherited paths or rename loses its dangling-use refusal; `FileFacts::words` is the shared project mention/completion census. |
| `vlog_refactor/src/rename/` | refactor-rename; shared by references-nav and the performance wave | server rename/prepareRename/references and port refactor verification | `Scope` remains the whole-scope authority and `collect_occurrences` the one rename/references walk. The fast `prepare_rename_here` answer/refusal and `rename_name_at` target are parity contracts, not alternate semantics. Any new refusal must be expressible on the fast path or force a deferral; any new occurrence shape must be reflected in the server fan-out or trigger its all-sources fallback. |
| `vlog_parser/src/token.rs` keyword table | completion-core (`KEYWORDS` export) | lexer, pairs.rs, editor grammar (test-locked), completion | Adding a keyword = lexer change + `pairs.rs` re-check + a hand edit to the grammar (`tests/grammar.rs` names the missing word) + potentially `verify.rs`-adjacent behavior. dv-statements added `randcase`/`let` to `is_keyword` and recorded it as shared with the adjacent lexer-cleanup round — the precedent for treating this file as coordinated even between back-to-back rounds. |
| `editors/vscode/package.json` | editor-packaging | editor-settings, editor-scopes (colour ids), editor-snippets, index-persistence, verbose-timing, platform-vsix, marketplace-page | Settings/colour/snippet ids referenced from `extension.js` or the server must move in lockstep; mismatches are *silent* (VS Code ignores unknown ids). `lucisv.verbose` is special: it changes a spawn argument and therefore restarts the server instead of flowing through the ordinary settings push. Version number is one of the four version files. |
| `tools/release.sh` artifact names | release-prep / editor-platform-vsix | ci-release (`prune_release_assets.sh`), `audit_artifacts.sh`, extension `bin/` layouts | Renaming a `.vsix` is a two-file change (`release.sh` + `prune_release_assets.sh`'s suffix list); renaming a per-triple binary is a two-file change (`release.sh` + `audit_artifacts.sh`, which skips `.vsix` and hard-fails on an unknown binary name). Get the wrong pair and the release fails by name. |
| The frozen CLI contract | cli-polish | corpus scripts, CI users, every new CLI mode | Exit codes 0/1/2 forever; stdout stays machine-readable (JSON mode prints exactly one array; warnings to stderr). |
| `editors/vscode/syntaxes/systemverilog.tmLanguage.json` | editor-packaging | `tests/grammar.rs` (keyword lock), `commentScan.js` (comment/string rules, `commentScan_test.js`) | Two locks: a keyword edit is checked against `KEYWORDS`; a `comments`/`strings` edit, a reorder of top-level rules, or a new top-level rule matching `/` or `"` must update `commentScan.js` in the same change. |
| style name list (`style.rs` `PRESETS` + `auto`) | format-styles | core `STYLE_NAMES`/`parse_style`, cache `Entry::style`, CLI `--style`, MCP, server `settings.rs`/`auto_style.rs`/`lint.rs`, manifest enum | A preset added or renamed moves all of these; two tests pin the chain (`args.rs`, `settings.rs`). Only the default may never move a byte (corpus + OpenTitan proof). Extends the existing `Config` → core → CLI/server → cache boundary noted under §3.3. |
The 2026-09-07 size measurement in `CLAUDE.md` put `state.rs` at 958
production lines; TODO §55 decomposed it into `state/` (2026-10-14, pure
move; `state/mod.rs` 63 lines), and localized-reindex added
`state/incremental.rs` and `state/watched.rs`.
Additional shared boundaries are `vlog_refactor/src/check/ledger.rs` (every
move/copy planner), `vlog_semantic/src/imports.rs` (linter and refactor usage
agreement), and `Config` → core config → CLI/server settings → format cache
(the newly missing cache field is §2.9-34). Changes to these require joint
contract review even when their source files are separate.
### 3.4 Working rules distilled for parallel agents
1. **Pick lanes, not files.** The eight lanes in §2 are the intended
parallelism. Two features in one lane usually share a choke point (§3.3);
check before spawning both.
2. **A grammar feature is a pair by default** (parser + formatter arms +
minimal `bind/`/`tests/spans.rs` arms) — unless it reuses an existing arm, as
the verbatim producers and ansi-first-port did. Say which arms you owe in
the feature scope up front; the compile-fix arms in other crates are
legitimate and should be listed in Handshakes, per the established
pattern.
3. **`cargo fmt` per package** (`-p a -p b`), never `--all`, while another
agent is live — this rule already saved two concurrent rounds
(directives-in-lists, dynamic-types).
4. **Cross-module wants are filed, not done.** Write the request in your
README's Handshakes, add it to §2.9 here, and stop — the lead routes it.
Delivered requests get struck through in the filing README with a pointer
(the ~~strikethrough~~ + "Delivered by X" convention is established).
5. **Wire shapes and names are pinned by tests, so change them by test**:
scopePairs JSON, the systemverilog fence tag, the seven `.vsix` names,
the grammar/KEYWORDS lock, rule names, exit codes, message prefixes
(§2.9-11 until structured output lands).
6. **Anything touching formatter output**: attack tests for any
verify-adjacent machinery, and a version bump or the format cache serves
stale verdicts (§2.3).
---
*Maintenance: this file is derived documentation. When a feature round adds,
delivers, or supersedes a handshake, update the relevant table (§2.9
especially) in the same round, the way TODO.md checkboxes are kept current.*