TODO §39 (docs/features/waiver-files). Closes §4's last waiver item. `vlog_linter::waiver_file`: `waive --rule=<rule> [--line=N|N-M] [--location=<pattern>]`, `#` comments, BOM tolerated; `--location` is the `--exclude` matcher (`lucisv_core::walk::is_excluded`, a new vlog_linter → lucisv_core edge), a regex-looking pattern refused by name. `lint_with(ctx, rules, external)` applies inline and external waivers as a union and reports which external directives fired; `lucisv check` reports the dead ones under `unused-waiver` at the waiver file's line after the whole run. Discovery: `[lint] waivers` (relative to the toml), `--waiver-file` (repeatable), `lucisv.lint.waivers` (first workspace root); bad lines fail the CLI run with file:line and are dropped and logged once by the server. Review rework (QA's HIGH): the server's code-action path now lints with the buffer's `LintRun` — its enabled rules and external waivers — so a quick fix is never offered, nor applied by fix-on-save, for a waived finding. Docs: Waivers sections in README and the linter guide, cli and configuration rows, topo edge, site rebuilt. Co-Authored-By: Claude Fable 5.1 <[email protected]>
139 KiB
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).
Code audit: 2026-09-04, HEAD d5abf81, after the v0.41.0 release (97aa2fe). The crate
edges below were checked against all eight manifests. Current facts codec:
17. Recent feature contracts are summarized in §1.4. HEAD
also contains parser-skips (TODO §38): implementation committed and QA
accepted, intended for v0.42.0; it is not part of the v0.41.0 release. External
waiver files (TODO §39) remain planned. See repository-analysis.md
for findings, validation, and the distinction between measured and historical results.
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
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
R[vlog_refactor] --> P
R --> S
CLI[lucisv (CLI)] --> C
CLI --> P
CLI --> F
CLI --> L
SRV[lucisv_server] --> C
SRV --> P
SRV --> S
SRV --> R
SRV --> F
SRV --> L
L -.dev-dep (fix harness).-> F
VSC[editors/vscode] -.spawn contract.-> SRV
VSC -.KEYWORDS grammar lock.-> P
NVIM[editors/nvim (docs)] -.spawn contract.-> SRV
TOOLS[tools/ release scripts] -.builds/packages.-> CLI
TOOLS -.builds/packages.-> SRV
TOOLS -.builds/packages.-> VSC
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} 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). |
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 still vlog_parser + vlog_semantic + 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_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). |
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 is pub but currently has no consumer outside the crate.) |
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). |
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). |
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), and PARSE_STACK_SIZE for the named lucisv-main thread. |
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). |
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, 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 only to choose an index-derived superset of files; the engine remains the authority. |
lucisv_server ──▶ vlog_formatter |
depends | format_source, format_range/LineRanges (range, ranges, on-type formatting), 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_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 — 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). 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 crate edges (independence you can rely on):
lucisv(CLI) does not depend onvlog_semanticorvlog_refactor— the CLI formats and lints; semantic lints reach it only throughvlog_linter, and refactoring is server-only today.vlog_refactordoes not depend onvlog_formatter— refactored output is edited source, not reformatted source (refactor README, by design).- Among
vlog_formatter,vlog_semantic,vlog_refactor,vlog_linterthere are exactly two build-time inter-crate edges —vlog_linter → vlog_semanticandvlog_refactor → vlog_semantic— plusvlog_linter → vlog_formatteras a dev-dependency only. All four depend onvlog_parser.vlog_formatteris the isolated one: nothing in this group depends on it at build time and it depends on none of them. Formatter work and semantic work are parallel-safe except where both touchvlog_parser::ast. lucisv_coredepends on nothing and nothing in it knows about Verilog — it is "which files, with what settings".vlog_parserdepends on nothing. It is also the highest-contention module in the workspace: six crates depend on it, five consume the AST (the CLI takes onlyLineIndex/TextRange), and two of those match it exhaustively —vlog_formatter/src/format/andvlog_semantic/src/bind/— withvlog_parser's owntests/spans.rsas a third exhaustive walker.vlog_linter,vlog_refactorandlucisv_serverwalk 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, tests in parser/tests/) → ast/
(mod holds Meta/Comment/spans/RawText; module, decl, stmt,
expr, class, covergroup, sva 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, 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). 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);
scan.rs (residual text-scanning for the one span the parser doesn't carry —
DataType; shrinks to zero when open handshake §2.9-2 lands);
workspace/ (mod = the tables, index = queries and build, update =
incremental update and fingerprint, record = the FileFacts read-off,
external = the overlay; 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 17);
instantiations.rs, classes.rs (the shared walks, lifted from the server
so the index census and the request handlers cannot drift).
lucisv_core — config.rs (lucisv.toml parsing + Discovery, the
upward search with its per-instance cache), 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),
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
contracts include path normalization, walk cycles, and same-target write
coordination (§2.9-1, §2.9-8, §2.9-26).
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,
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 73 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;
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), check.rs (whole-edit verification:
re-tokenize + re-resolve, refuse everything on any drift).
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; 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, reindex/widen orchestration, progress/log senders, optional timing: instrumentation |
| state | state.rs |
Workspace (roots, scope ladder, index, include graph, candidates, index cache, open Documents 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 |
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 |
| handlers | one file per capability: format.rs, diagnostics.rs, lint.rs, hover.rs, expand.rs, nav.rs, type_def.rs, type_hierarchy.rs, hierarchy.rs, design_hierarchy.rs, symbols.rs, tokens.rs, completion/ (mod, member, module, tiers, word, site; test harness in harness), signature.rs, inlay.rs, inline.rs, lens.rs, code_action.rs, rename.rs, ports.rs, folding.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 (the indexed instance hierarchy sidebar),
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).
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 ↔ 73-rule registry, 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; atomic replacement does not yet coordinate same-target writers (§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 |
Committed after v0.41.0; QA accepted, release pending; preserves the written delay position; no verifier normalization change |
| external waiver files | proposed linter waiver parser ↔ core config, CLI args, server settings/diagnostics and VS Code manifest | Planned (TODO §39); no callable API, CLI flag, or config setting yet |
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
125 features. They 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.
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. |
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 (still open — §2.9). |
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 ExternalCandidates 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. |
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 IncludeGraph::absorb publish their tables in the same drain, so “the workspace as far as scanned” cannot mean three different prefixes. |
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 |
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). |
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 localparams 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. |
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. Locations use the shared FileView. 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. |
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. |
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 |
vlog-semantic (item 2); restated by class-semantics | vlog_parser |
fence::scan_nested has no ItemKind::Class arm — formatter fences are inert inside class bodies (the --fix backstop still holds; asymmetry errs hands-off)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 | ||
lint key in lucisv.toml ([lint.<rule>] config; selected-rules list) with CLI>config precedence[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 | ||
lucisv check --rules-doc printing rules_markdown()lucisv check --rules-doc prints rules_markdown() and exits 0, takes no files, is lint-only; the example binary is gone |
lint-rules-2 | ||
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 | ||
SymbolKind::Interface (interfaces currently indexed as Module; modport/clocking names unbound)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 | ||
| 8 | Symlink-cycle detection in the shared walk (both front ends exposed; wants its own round — it changes CLI behavior) | lucisv-core-lift | lucisv_core |
InheritedCandidate through the member tables (in-file and cross-file) + hover for extendsresolve::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 | ||
Fmt::raw_text's string-crossing path emits a Doc::Text carrying newlines53f2269): 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 | ||
| 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 |
enum {A,B} x;) not declared as symbols — hover/definition gapbind_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 | ||
program node with name_span/end_label_span for linked editingparser/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 | ||
bind's target scope and connections should resolve through the workspace index (today only the instantiated module name is recorded)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 | ||
| 16 | DPI/package re-export halves as real references (export pkg::item doesn't resolve; *::* has "*" as its package name, which nothing expects) |
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 |
refactor-instantiate (gap 1; its gap 2 was delivered by ansi-first-port) | vlog_parser |
FileFactsmacro_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 | ||
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).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) | ||
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.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) | rename.rs) |
|
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 deliveredParser::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 | ||
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.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 |
constraint-bodies (dev + QA) | ||
| 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. |
comment-slots (dev, surfaced by the §2.9-20 control test) | vlog_semantic / vlog_refactor |
#( 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). |
header-recovery (QA) | vlog_parser | |
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. |
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. | 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. | 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. | repository audit, 2026-09-04 | lucisv_server |
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/) |
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; current FACTS_FORMAT 17; plus a small vlog_parser::defines touch — DefineTable::from_entries, Eq derives) |
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 |
lucisv_core |
lucisv-core-lift (config.rs, walk.rs), filelist (filelist.rs), format-cache (cache.rs) |
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) |
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+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, 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 |
editors/vscode |
editor-packaging, editor-snippets, editor-settings (manifest half), editor-scopes (rainbow half), vscode-hierarchy-sidebar (hierarchyView.js/hierarchyModel.js), editor-platform-vsix, editor-marketplace-page, index-persistence (storagePath line), verbose-timing (lucisv.verbose, spawn args and restart in extension.js) |
tools/ + CI |
corpus-check, release-prep, ci-release, editor-platform-vsix (staging), range-formatting (lucisv-changed.sh) |
3.2 The combined picture
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[M2 rename / M3 ports / M4 instantiate / references]
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
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 | 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. |
lucisv_server/src/state.rs |
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. |
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 (currently 17), 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). |
3.4 Working rules distilled for parallel agents
- 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.
- A grammar feature is a pair by default (parser + formatter arms +
minimal
bind//tests/spans.rsarms) — 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. cargo fmtper package (-p a -p b), never--all, while another agent is live — this rule already saved two concurrent rounds (directives-in-lists, dynamic-types).- 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). - Wire shapes and names are pinned by tests, so change them by test:
scopePairs JSON, the systemverilog fence tag, the seven
.vsixnames, the grammar/KEYWORDS lock, rule names, exit codes, message prefixes (§2.9-11 until structured output lands). - 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.