Owner-requested round. WorkspaceIndex::update_file/remove_file replace one file's contribution without reading or parsing anything else; Server::reindex_one takes the fast path for a didSave of one held file or a one-file watcher event (33 ms vs 1.5 s on the corpus, 45x), with everything else — settings, scope, filelist, multi-file events — keeping the full rebuild, pinned by a trigger-table test. FileIds stay sorted positions by deliberate deviation: renumbering through the one merge both finish and update_file end in makes build(W) byte-identical to build(W minus F).update_file(F) — fingerprint equality, attacked by QA across long interleaved sequences, disambiguation flips, define shadowing and the ghost hunt (the affected-keys union reads old and new records both). The per-file FileFacts the index retains are the documented memory cost (~1.4 MB on the corpus). The two oldest filed Handshakes land: instantiation and inheritance edge tables, built by the byte-for-byte moved census walks, turn codeLens counts (92 ms to 0.26 ms), incomingCalls and typeHierarchy subtypes into lookups — census policies pinned unchanged at both the consumers and now the source. Counts are as of the index, not of unsaved keystrokes: the freshness delta is documented and pinned from both sides. Saves no longer raise a progress bar; generation and lens refresh still ride. Round 18's three inherited scope obligations are pinned permanent. 36 tests added (dev 27 + QA 9). Left open, filed: wholesale republish, Candidates re-derivation cost, incremental removal vs include re-resolution. docs/features/incremental-index/README.md Co-Authored-By: Claude Fable 5 <[email protected]>
code-lens
Goal
textDocument/codeLens puts one line of true, computed information above
every module and interface declaration in the open buffer: "N
instantiations" — how many times the whole workspace instantiates that
module — with "1 instantiation" and "no instantiations" spelled the way a
person would. It is the single most Verilog-shaped thing a lens can say: a
module's fan-in is the number an RTL engineer actually wants when they open a
file, and until now it took opening the call hierarchy to learn it. Clicking a
lens answers with every instantiation site, and — for a client that advertised
window/showDocument — jumps to the first of them. The count is not a second
census: it is computed by the very walk callHierarchy/incomingCalls is
computed by, so the lens and the hierarchy view can never disagree (TODO.md
§9c).
Assumptions
- The population is
incomingCalls's population, and nothing else. N is the number of instantiation sites — the sum of everyfromRangesentrycallHierarchy/incomingCallswould list for that module, not the number of instantiating modules. A module instantiated twice inside onetopreads "2 instantiations", because that is what a user counting instances means.the_count_is_exactly_what_incoming_calls_would_listasserts the equality directly rather than restating the arithmetic. - An instantiation at file scope is not counted, because it has no
enclosing module to be a caller. That is inherited, not decided here: it is
the rule
hierarchy::callers_inalready applied, and the whole point of reusing the census is that this feature does not get to have its own opinion. Such a file is illegal SystemVerilog anyway and only reachable through the tolerant parser. - The census is by name. Two modules named
fifoin one workspace get the same count on both their lenses, and clicking either shows every site of either. Same limitationcallHierarchy/incomingCallshas, for the same reason: an instantiation names a module, and nothing in the source says which of two same-named declarations it meant. - The lens's range is the declaration's own name span. Clients draw a lens
on the line above
range.start, so the name span puts it directly over the header and nowhere else. A declaration whose name span is empty — what the tolerant parser produces formodule ;— gets no lens: there is no line to sit on, and an invented one would decorate the wrong code. - An interface is a module declaration.
interface bus; ... endinterfaceparses to the sameast::Modulenode withkw == "interface", so it is reached byinstantiations::declarationsand instantiated through the sameItemKind::Instantiation. No branch was written for it; a test pins that it works. resolveProvider: false, and every lens is complete. Title, command and arguments are all computed up front, matching what completion, inlay hints and document links do in this server. The count is the expensive part and it is exactly what a resolve would have to compute, so a two-stage protocol would buy nothing.- A module with no instantiations gets a display-only lens — a
Commandwhosecommandis the empty string, which is what rust-analyzer ships for the same case and what clients render as plain text. There is nothing to open; a click that led to an empty list would be worse than no click. It also carries noarguments. window/showDocumentshows only the first site. LSP has no server-initiated "peek these seven places" — that is VS Code'seditor.action.showReferences, a client-side command, and this repo's extension declares none (and this round did not toucheditors/). The honest portable behaviour is: the command's result is the full list ofLocations, for any caller that wants it, and the push opens the first one for a client that can be pushed to. A client without the capability still gets the list.workspace/codeLens/refreshis sent fromreindex()only. Not at startup: no buffer is open there, so there are no stale lenses to invalidate. Not on a keystroke either — adidChangecannot change any count, since the census is over instantiations in other files and a client re-requests lenses for the buffer it just edited anyway.The count is computed againstSuperseded (incremental-index, 2026-08-27) — see the assumption above.Workspace::sources(), which reads every in-scope file from disk with open buffers overriding it. So an unsaved instantiation typed into another open buffer is counted, and a file changed on disk that no watcher reported is counted as of this request.The cost is one workspace walk per request, not one per module.Superseded (incremental-index, 2026-08-27): the cost is a lookup. The count comes from the index's instantiation-edge table, and the only I/O left is reading the handful of files that really do instantiate one of the names, to turn recorded byte spans into ranges — 0.26 ms for the same three-module file over the same corpus. The batch stays the primitive for the same reason at a smaller scale: one file instantiating three of the names is read once.hierarchy::callers_of_eachtakes a batch precisely becausesources()re-reads the whole file set: measured over the 860-file corpus, a three-module file costs 133 ms against 93 ms for a single name (debug build) — amortized, not tripled. The absolute number is the honest cost of having no instantiation-edge table in the index; see Status / TODO.- The count is as of the index, which is as of its last build or update
(incremental-index, 2026-08-27) — superseding the assumption below that the
count is computed against
Workspace::sources()per request. A save, or any other rescan trigger, folds every open buffer in and makes an edit count; a keystroke alone no longer does. The trade and the alternatives considered are indocs/features/incremental-index/README.md.
Handshakes
Request to vlog_semantic — an instantiation-edge table in the index
Delivered (incremental-index, 2026-08-27). WorkspaceIndex::instantiations_of
exists with the shape proposed below — plus the owning declaration's name and
full extent, which is what stopped callers_of_each re-parsing the file to
find them — and hierarchy::callers_of_each is a lookup with its walk-and-parse
body deleted. The census policies carried over by construction: the table is
built by the same instantiations::sites walk the handler used to run, which
was lifted into vlog_semantic for exactly that reason, and every one of this
feature's QA tests passes unchanged. Measured 92 ms → 0.26 ms for a
three-module file over the corpus. The original request, kept legible:
~~Filed by the lead (2026-08-26) on QA's recommendation, since two shipped
features now pay the same cost: every textDocument/codeLens request and
every callHierarchy/incomingCalls walks Workspace::sources() — a re-read
and tolerant re-parse of every in-scope file — because WorkspaceIndex
records what a file declares and never what it instantiates. The ask: at
index build time (the same rebuild reindex() already pays for), record the
instantiation edges, e.g.
/// Every instantiation of `name` across the indexed files:
/// (file, instantiating-module name span, instance site span).
pub fn instantiations_of(&self, name: &str) -> &[InstantiationEdge]
so hierarchy::callers_of_each becomes a lookup and its whole
walk-and-parse body is deleted. The census policies (multi-instance
statements = one site, textual not elaborated, both ifdef arms) must carry
over unchanged — lens.rs's QA tests pin the numbers that must not move.~~
lucisv_server::hierarchy — changed, deliberately
incoming was split so the census has exactly one implementation:
- New public
hierarchy::callers_of_each(ws, names: &[&str]) -> Vec<Vec<CallHierarchyIncomingCall>>— the same walk, asked about a batch of names, answering one list per name in the order asked. It is now the primitive. hierarchy::incoming(ws, item)is a one-line call into it with a one-element batch. Its behaviour is unchanged, empty-name guard included: the guard moved into the batch's per-name filter, where an empty name matches no file rather than every file.- The private
callers_innow takes an already-parsed file (&Uri,&Positions,&[Site]) instead of a path and text, so one file is parsed once for a whole batch rather than once per name. ThePositionsfor a file is now built whenever any name matches, rather than only when a caller was found — aLineIndex::newper candidate file, which the batch more than pays back.
Nothing else in hierarchy.rs moved, and its own tests are untouched and
green.
lucisv_server::server
ClientAbilitiesgains two fields, both filled inmain.rs:code_lens_refresh(fromworkspace.codeLens.refreshSupport) andshow_document(fromwindow.showDocument.support). Every existing test that buildsClientAbilities { ..Default::default() }is unaffected.request()gains aCodeLensRequestarm, and itsExecuteCommandarm now routeslucisv.showInstantiationstolens::executebefore falling through toports::execute.- New private
show_instantiations(Vec<Location>) -> Result<Value, Failure>(the answer, plus the optional push) andrefresh_code_lenses()(the gated server-initiated request). reindex()callsrefresh_code_lenses()immediately afterend_indexing(bar)and before the generation bump, the scope warnings and the republishes. Pinned bythe_refresh_rides_after_the_indexing_bar_comes_down.response()'s doc comment now names four ignorable answers rather than two. Its code is unchanged: the refresh's and the showDocument's ids are never inapplying, so they fall through the existing lookup.
lucisv_server::main
capabilities()gainscode_lens_provider: Some(CodeLensOptions { resolve_provider: Some(false) }).execute_command_provider.commandsis now a new localcommands()—ports::commands()pluslens::commands()— rather thanports::commands()alone. A lens whose command is not advertised is a lens no client will run, soevery_advertised_command_is_one_the_server_runsnow checks both halves.
state::Workspace, vlog_parser, vlog_semantic, vlog_refactor
Untouched. No signature moved and nothing was plumbed. The declarations
come from instantiations::declarations, which already existed for the
hierarchy, and the counts from Workspace::sources(), which already existed
for it too.
editors/vscode
No extension change, and none was made. vscode-languageclient requests
code lenses and renders them with no help from extension.js; it advertises
workspace.codeLens.refreshSupport and window.showDocument itself.
smoke.js sends capabilities: {}, so it takes the no-refresh,
no-showDocument path — verified by running it.
Status / TODO
codeLensProvideradvertised withresolveProvider: falsetextDocument/codeLensdispatched; one lens per module/interface declaration, on the name span, in source order- Count reuses the
incomingCallscensus (hierarchy::callers_of_each), with an equality test againsthierarchy::incoming - Pluralization: "no instantiations" / "1 instantiation" / "N instantiations"
lucisv.showInstantiationsadvertised and dispatched; answers every site as aLocation; declines arguments it cannot read asRequestFailedwindow/showDocumentpushed for the first site, gated on the client capabilityworkspace/codeLens/refreshfromreindex(), gated onworkspace.codeLens.refreshSupport, after the progress bar comes down- Unopened buffer →
null; unnamed declaration → no lens; a buffer that parses to nothing → empty list - Tests: 33 (19 in
lens.rs, 9 inserver.rs, 3 inmain.rs, 2 e2e) - TODO.md §9c checkbox,
docs/features/lucisv-server/README.mdcapability table - Not done, deliberately: no second lens kind. A "top module" indicator, a parameter count, a "run this testbench" action are all plausible and none was asked for; one lens kind done well beats three guessed at.
- Not done, deliberately: no
codeLens/resolve. Everything a resolve could defer is the one expensive thing the lens is. - Not done, deliberately: no peek-references behaviour. It needs a
client-side command declared in
editors/vscode/package.json, which is out of this round's scope;window/showDocumentis the portable substitute and reaches Neovim as well. - Open, filed here: the request costs one full
Workspace::sources()read — 133 ms over the 860-file corpus in a debug build. That is the same costcallHierarchy/incomingCallshas always had, but a lens request arrives far more often than a hierarchy question. The real fix is an instantiation-edge table inWorkspaceIndex, built once per rescan, which would make both this andincomingCallsa lookup. That is avlog_semanticchange and belongs in its own round; request recorded here, not made. — done, incremental-index, 2026-08-27.
Work log
2026-08-26 — dev agent, §9c
- The click-behaviour decision, and why. The brief left this open with a
fallback to display-only. I built the real jump, because reading
hierarchy::incomingshowed the locations were already there — everyfromRangesentry is a site, paired with its file's URI — solucisv.showInstantiationsis a flatten and nothing more. The chain the brief worried might be heavy is about fifteen lines:lens::executereturnsVec<Location>,Server::show_instantiationspushes awindow/showDocumentfor the first when the client advertised it, and the answer is the list either way. Display-only survives as the honest answer for the zero case only, where there is nothing to open — which is exactly where rust-analyzer uses the same empty-command trick. So: real behaviour everywhere it can mean something, display-only where it cannot. - The arguments are
[module-name], not[uri, name]. The brief suggested the URI first, in the style of the port commands. I dropped it after establishing that the census is purely by name —hierarchy::incomingreads onlyitem.nameand nothing else off its item — so a URI would be an argument the handler receives and ignores, and this repo does not ship those. One argument, all of it used. - A name the workspace does not declare is not an error. The brief asked
for one. I did not build it, and the reason is a real failure mode rather
than taste: the only index-backed way to ask "is this a module?" is
WorkspaceIndex::units, and the index is rebuilt on save, so a module just typed into an open buffer is genuinely absent from it. Gating on that would make the command refuse the very lens that is on screen. Malformed arguments (missing, non-string, empty) are still declined asRequestFailed, perports.rs; a well-formed name with no sites answers[], which is the truth. - The census was extracted rather than duplicated, and the batch is why.
Naively,
code_lenseswould callhierarchy::incomingonce per module in the buffer — butWorkspace::sources()re-reads every in-scope file from disk on each call, so a three-module file would read the workspace three times. Soincoming's body becamecallers_of_each(ws, names), which reads the file set once and parses each candidate file once for the whole batch;incomingis now that function with a one-element batch. Measured over the 860-file corpus: three names 133 ms, one name 93 ms — amortized, and pinned bycode_lenses_for_a_whole_file_cost_about_one_workspace_walk, which fails if the ratio ever goes linear. - The empty-name guard moved and got stricter. It used to be an early
return in
incoming; it is now a per-name filter inside the batch, so one empty name in a batch of five costs nothing and cannot make the prefilter match every file. Same behaviour forincoming, which is still the only caller that could ever be handed one. - The lens sits on the name span, not the header line. Clients draw the
lens on the line above
range.start; the name span and the header line have the same start line, but the name span is the one that stays right when a declaration is written with attributes or a leading comment on the same line. - Refresh placement. Straight after
end_indexing(bar)inreindex(), following the progress round's own precedent that the bar names the scan and everything after it is work on the scan's result. Order pinned by a test (create, begin, end, refresh) so it cannot drift silently. Nothing is sent at startup — there is no open buffer holding lenses there. - A buffer with no named declarations returns before the workspace walk. Otherwise opening a package or a header file would read every file in the project to produce an empty list.
- Files touched:
crates/lucisv_server/src/lens.rs(new),crates/lucisv_server/src/hierarchy.rs,crates/lucisv_server/src/server.rs,crates/lucisv_server/src/main.rs,crates/lucisv_server/tests/e2e.rs,TODO.md,docs/features/lucisv-server/README.md, this README. No engine crate, noeditors/, no new dependency, no version bump.
Verification. cargo fmt --all -- --check: clean. cargo clippy --all-targets: zero warnings. cargo test --workspace: 1943 passed, 0
failed (1910 on HEAD 34938fb, measured — 33 new). cargo build && node editors/vscode/smoke.js target/debug/lucisv-server: smoke: OK, exit 0. No
commits.
The 33 tests, and what each group is for:
| tests | pin |
|---|---|
lens.rs — a_lens_counts_every_instantiation_in_the_workspace, the_title_counts_in_the_users_own_arithmetic |
the cross-file count, and 0/1/N pluralization including "not 1 instantiations" |
lens.rs — the_count_is_exactly_what_incoming_calls_would_list |
the agreement with hierarchy::incoming, asserted against its live answer rather than against a number |
lens.rs — an_instantiation_at_file_scope_is_not_counted_because_no_one_calls_it |
the inherited caller rule, stated so a future change to it is visible here |
lens.rs — the_lens_sits_on_the_declarations_own_name, every_module_in_a_file_gets_its_own_lens_in_source_order |
the range is the name span; one lens per declaration, source order |
lens.rs — an_interface_is_a_module_declaration_and_gets_its_own_lens |
interfaces, which needed no branch |
lens.rs — a_module_nothing_instantiates_gets_a_lens_that_does_not_click, a_clickable_lens_carries_the_module_name_as_its_only_argument, no_lens_is_ever_left_for_a_resolve_to_fill_in |
the two command shapes, and that nothing is left unresolved |
lens.rs — a_buffer_this_server_was_never_shown_has_no_lenses_at_all, a_buffer_that_declares_no_module_gets_an_empty_list, a_buffer_that_is_not_verilog_at_all_gets_no_lenses_and_does_not_panic, a_declaration_the_parser_could_not_name_gets_no_lens |
the four refusals: null, empty, total on junk, no lens without a name span |
lens.rs — the_command_answers_one_location_per_site, ..._nothing_for_a_module_nothing_instantiates, ..._declines_arguments_it_cannot_read, the_command_list_is_what_the_server_advertises |
the command: one location per site in file-then-position order, the empty answers, the refusals |
lens.rs — code_lenses_for_a_whole_file_cost_about_one_workspace_walk |
the batch really is one walk (corpus, skipped when absent) |
server.rs — a_code_lens_request_counts_the_workspaces_instantiations, ..._for_an_unopened_buffer_answers_null |
dispatch, and the null |
server.rs — the_show_instantiations_command_answers_every_site, ..._pushes_a_show_document_when_it_can, a_module_with_no_instantiations_pushes_nothing_and_shows_nothing, ..._declines_arguments_it_cannot_read |
the command over the dispatch, both showDocument gate states, and the RequestFailed code |
server.rs — a_rescan_asks_a_capable_client_to_refresh_its_code_lenses, a_client_that_cannot_refresh_code_lenses_is_never_asked_to, the_refresh_rides_after_the_indexing_bar_comes_down |
both polarities of the refresh gate, all three rescan paths, no refresh at startup, and the order against the progress bar |
main.rs — code_lenses_resolve_nothing_because_every_lens_is_complete, code_lens_refresh_support_..., show_document_support_... |
the advertised option, and both capability readers at absent/false/true |
e2e.rs — code_lenses_and_their_command_round_trip_over_the_wire |
the capability's JSON shape, the lens JSON (title, command, arguments, range, no data), the command's locations, the null, and that the lens's command is in executeCommandProvider.commands |
e2e.rs — a_save_asks_a_capable_client_to_refresh_its_code_lenses_over_the_wire |
the refresh on the wire, both gate states, against the real binary |
QA log
-
2026-08-26 (QA) — read this README,
hierarchy/README.md(its QA log especially — theifdefand generate-replication findings there turned out to answer several questions this round would otherwise have raised fresh),instantiations.rs,hierarchy.rsend to end (diffed function-by-function against34938fb),lens.rs, and theserver.rs/main.rsdiffs, before touching anything.Gates, independently re-run.
cargo fmt --all -- --check: clean.cargo clippy --all-targets --workspace: zero warnings.cargo test --workspace: 1943 passed, 0 failed before any QA change, matching the dev's number exactly; 1952 passed, 0 failed after adding 9 QA tests (6 inlens.rs, 3 inserver.rs— see below).cargo build && node editors/vscode/smoke.js target/debug/lucisv-server:smoke: OK, exit 0, run twice (before and after the QA tests).1. The
hierarchy.rsrefactor. Diffedgit show 34938fb:crates/lucisv_server/src/hierarchy.rsagainst the working tree function by function.incomingis nowcallers_of_each(ws, &[item.name.as_str()]).pop().unwrap_or_default()— a one-element batch. Confirmed by construction thatcallers_of_each's per-file loop is unchanged in substance: sameparse_source_tolerant(not the strict parser — a mode change would have silently changed counts on broken files, and it did not happen), samesite.inst.module != namefilter insidecallers_in, same final sort. The only real change is where the prefilter and the parse happen: once per name before (callers_intookpath: &Path, text: &str), once per file now, with the parsedsitesreused across every name the batch is asking about.- Empty name in a batch. Traced by hand:
wantedfilters out any index whose name is empty or absent from the file's text, so an empty name never reachescallers_inand its slot inanswersstaysVec::new(). Byte-identical to the old early-return inincoming. No new test needed — the dev's own doc comment states this and it holds. - Duplicate names in one batch,
["m", "m"]. New testqa_two_declarations_of_the_same_name_in_one_file_each_get_their_own_lens_same_count(lens.rs) — a file with twomodule mdeclarations (reachable through the tolerant parser) instantiated once, opened as a buffer. Both indices are processed independently (the loop does not deduplicatewanted), so neither aliases nor corrupts the other — both lenses read "1 instantiation". Redundant work (the same file is walked twice for the same name), not a correctness bug. - A name that is a package, not a module. Not a distinct code path:
callers_of_eachmatches purely onsite.inst.module, a string, with no knowledge of what kind of thing owns that name. Nothing to test beyond whathierarchy.rs's ownqa_instantiation_in_a_package_does_not_crashalready covers. - Verdict: behavior-preserving.
incoming's own 25 tests are untouched and green, which is necessary but — per the brief — not sufficient; the above traces the edge cases a black-box test-pass rerun cannot see, and none of them diverge.
2. Count honesty. The Assumptions section already states the load-bearing facts: the population is
incomingCalls's, by name, and oneInstantiationis one site "however many instances it declares" — that last part ishierarchy.rs's own documented policy (2026-08-25 QA round), inherited rather than decided here. Checked whether the fixture agreement test would actually catch a divergence: it cannot, structurally —lens.rsandhierarchy::incomingboth bottom out in the literal samehierarchy::callers_of_eachcall, so "agreement" is guaranteed by construction, not by the fixture's shape. What the fixture's shape does affect is whether this feature's own test suite would notice if that shared implementation's semantics ever changed under it — e.g. ifcallers_of_eachstarted counting instances instead of AST nodes, no existinglens.rstest usingTOP(two separate statements) would catch it, because two separate statements give the same answer either way. Added 6 tests tolens.rspinning the number itself over shapes the fixture never exercises, each with expected output derived independently (by readinginstantiations.rs'swalk, not by running the code first):qa_a_multi_instance_statement_is_one_site_not_two—sub u1 (), u2 ();is oneInstantiationnode with twoInstanceentries, and reads "1 instantiation", oneLocation. Matcheshierarchy/README.md's stated policy exactly (it names this exact source shape). Not a finding — a confirmed, disclosed design decision — but it was untested at the code-lens layer, where a user is more likely to notice the number than in a hierarchy view.qa_a_module_that_instantiates_itself_counts_its_own_instantiation— self-recursion reads "1 instantiation", one site, no hang. Consistent withhierarchy.rs's own self-instantiation and cycle handling (each request answers one hop).qa_two_files_declaring_the_same_module_name_get_the_same_count_on_both— two files each declaringmodule m, one real instantiation ofmelsewhere: opening either declaration reads "1 instantiation" — the workspace-wide total, not zero and not partitioned. Matches the documented "census is by name" Assumption; confirms it holds in both directions (the fixture I found only tried one file, not the other).qa_two_declarations_of_the_same_name_in_one_file_each_get_their_own_lens_same_count— described above under the hierarchy refactor; also a code-lens-level consequence of the same policy: two lenses, same count on both, in one buffer.qa_a_generate_replicated_instantiation_counts_the_written_statement_once— agenerate forloop wrapping one instantiation reads "1 instantiation" regardless of the genvar's range (textual, not elaborated), matchinghierarchy.rs's own precedent for the identical shape.qa_an_ifdef_guarded_instantiation_counts_both_arms—`ifdef/`elseboth arms read "2 instantiations". This ishierarchy.rs's disclosedifdefpolicy (2026-08-25 finding, fixed by documentation then) surfacing on a second, more visible feature. Not re-litigated here since the underlying behavior was already reviewed and accepted by the lead; pinned so a change to it is visible fromlens.rstoo, not onlyhierarchy.rs.
None of the six disagreed with
hierarchy::incoming(they structurally cannot), and none exposed a new corruption or miscount — every number above is the intentional, already-documented arithmetic. The value added is regression coverage at the layer users actually read the number from.3. Cost / request amplification. Traced
code_lensesinlens.rs: one call tohierarchy::callers_of_each(ws, &names)with the whole buffer's declared names, which itself callsws.sources()exactly once inside its singlefor (path, text) in ws.sources()loop — confirmed by reading the loop body, not by profiling. No per-lens or per-modulesources()call exists anywhere in the path fromCodeLensRequestto the answer. The index-table follow-up: filed in Status/TODO ("an instantiation-edge table inWorkspaceIndex... request recorded here, not made"), in the same style ashierarchy/README.md's own equivalent backlog bullet from the prior round — consistent with house precedent, but neither one is written as a concrete Handshake (a proposedvlog_semanticfunction signature and contract) the way CLAUDE.md's Handshakes section is meant to capture a cross-module request. Minor, LOW severity, not fixed: recommend the lead decide whether a backlog TODO bullet is sufficient here (matching existing house style) or whether, now that two features would benefit from the same index change, it is worth promoting to an actual Handshakes-section proposal with a named function shape. Not fixed unilaterally — this is a documentation-structure judgment call, not a typo.4.
showDocumentpush. Readshow_instantiationsanddeliverside by side:deliveris the only function that inserts intoself.applying;show_instantiationscallssend_request(ShowDocument::METHOD, ...)directly and never touchesapplying, so its response id always falls throughresponse()'slet Some(command) = self.applying.remove(...) else { return }— exactly the mechanism the doc comment claims. Confirmed via the dev's own tests that the gate (self.abilities.show_document) is checked before the push, that a client without it still gets the full location list, and that the pushed request's shape (uriof the first site,takeFocus: true,selection= that site's range) is correct. New testqa_a_showdocument_push_and_an_applyedit_push_stay_independent_when_both_are_outstanding(server.rs) — onePROPAGATE_PORTScommand outstanding (anapplyEditpush, tracked inapplying) and oneSHOW_INSTANTIATIONScommand outstanding (ashowDocumentpush, not tracked) at the same time, answered in reverse send order. The showDocument answer produces no message (correctly ignored even though it carries noappliedfield at all, which would be a type-mismatch panic risk ifresponse()ever tried to interpret it as anApplyWorkspaceEditResponse); the applyEdit answer is still routed to its own command correctly afterward. This was asked for explicitly in the brief and had no existing test — ids are allocated by a strictly increasing counter (send_request), so collision was never actually possible, but the mechanism is now pinned rather than just argued. Also confirmed by reading theExecuteCommanddispatch arm:lucisv.showInstantiationsreturns from inside theifbeforeports::execute'sOk((edit, warnings)) => self.deliver(...)branch is ever reached, sodeliver()cannot fire for it — no test needed beyond the existingthe_show_instantiations_command_answers_every_siteassertingsession.requests().is_empty()for a client withoutapply_editeither.5. Refresh discipline. Verified independently:
refresh_code_lensesgates only onself.abilities.code_lens_refresh, never onwork_done_progress— the dev's owna_rescan_asks_a_capable_client_to_refresh_its_code_lensesalready usesClientAbilities { code_lens_refresh: true, ..Default::default() }(sowork_done_progressisfalse) and gets three refreshes, which is the independent-gates case the brief asked about, already covered. Never at startup (reindexis not called there). New testqa_a_rescan_with_several_open_buffers_still_sends_exactly_one_refresh(server.rs) — two open buffers, one save: exactly oneworkspace/codeLens/refresh, confirming the call sits before the per-buffer republish loop inreindex()rather than inside it (the dev's existing test only ever opened one buffer, so this distinction was argued from reading the code, not from a test, before now). Order-pinned by the dev's ownthe_refresh_rides_after_the_indexing_bar_comes_down; re-verified by hand againstreindex()'s body. Response ignored: sameapplying-lookup mechanism asshowDocument, covered by the new interleaving test's reasoning (refresh never inserts intoapplyingeither).6. Command surface.
execute_command_provider.commandsiscommands()=ports::commands()++lens::commands();main.rs's ownevery_advertised_command_is_one_the_server_runsnow checks both halves are contained, not just equality with the concatenation (equality alone would not have caught one list silently dropping an entry the other didn't add back).git diff --stat -- crates/lucisv_server/src/ports.rsconfirms it is untouched. Confirmed by reading theExecuteCommandarm (see point 4) thatlucisv.showInstantiationsnever reachesdeliver().7. CLAUDE.md compliance.
grepforunwrap()/expect(/panic!inlens.rsandhierarchy.rsoutside#[cfg(test)]: none. Same check against the added lines inserver.rs/main.rs: every hit is insidemod tests. No#[allow(...)], nounsafe, anywhere in the diff. Every public item inlens.rscarries a one-line doc comment.TODO.md's §9c item text is untouched — only the checkbox flipped to[x], with a "→ delivered" paragraph appended below it, matching the rule ("leave the item text intact"). This README's seven sections are each present exactly once.C. Corpus, machine-checked. New test
qa_corpus_counts_agree_with_grep_derived_ground_truth(lens.rs), againstcorpus/common_cells/src/cdc_fifo_gray.sv(three module declarations, same file the dev's own perf test already uses). Ground truth built by hand withgrep -rnE '\bNAME\b' corpus --include='*.sv' --include='*.svh', read line by line to exclude the declaration itself and doc-comment mentions (cdc_fifo_gray_clearable.svhas several, e.g. "In contrast to the cdc_fifo_gray version..." — a real risk if the walk ever matched comment text, whichinstantiations::sitesstructurally cannot):module grep-derived instantiation sites lens read cdc_fifo_gray1 ( common_cells/test/cdc_fifo_tb.sv:49,i_dut)"1 instantiation" cdc_fifo_gray_src1 ( cdc_fifo_gray.sv:130, insidecdc_fifo_grayitself)"1 instantiation" cdc_fifo_gray_dst1 ( cdc_fifo_gray.sv:145, insidecdc_fifo_grayitself)"1 instantiation" All three agree. Run in release (`cargo test -p lucisv_server --release qa_corpus_counts_agree_with_grep_derived_ground_truth -- --nocapture`); skips cleanly when corpus/is not checked out, matching the dev's owncorpus test's pattern. Everything else tried to break, and did not:
- A workspace root fixture helper (
Tree::writeinlens.rs's tests) did not create parent directories, so a nested relative path ("a/m.sv") failed withNotFoundthe first time this round's cross-file-collision test tried to use one. Fixed directly (fs::create_dir_allon the parent beforefs::write) — an unambiguous test-infrastructure gap, not a behavior change, and it was blocking test C's fixture from being written at all. - Malformed
executeCommandarguments (missing, non-string, empty string) forlucisv.showInstantiations: all three still answerRequestFailedwith a message naming "module name" — re-verified against the dev's ownthe_command_declines_arguments_it_cannot_readandthe_show_instantiations_command_declines_arguments_it_cannot_read. - A name the workspace does not declare (
"never-heard-of-it"):[], not an error, as documented and tested by the dev. resolveProvider: falseand every lens carrying a completeCommandwith nodata: re-verified againstno_lens_is_ever_left_for_a_resolve_to_fill_in.
Verdict: committable as-is. No corruption, no idempotency risk (this feature touches no formatter output), no dropped comments — none of those invariants are in this feature's blast radius at all, since it only reads and answers LSP requests. The one open item (point 3, the index-table request's concreteness) is a documentation-polish question for the lead, not a defect, and does not block shipping. 9 new tests added, all green; gates re-run clean before and after. No commits made.
- Empty name in a batch. Traced by hand:
Review
2026-08-26 — lead
Reviewed the diff, the work log and the QA log; re-ran all gates myself,
clean. The round's two judgment calls were both right. Building the real
jump instead of the display-only fallback cost ~15 lines because the
locations already existed — exactly the "check what the code makes clean"
outcome the brief asked for — and the zero-count lens staying display-only
matches rust-analyzer's precedent. The hierarchy.rs refactor is the
correct shape: one census with the batch as the primitive, incoming as a
one-element batch, and the corpus ratio test making the amortization a
tested property instead of a hope. I read the refactor diff myself and
concur with QA's function-by-function verdict — same parse mode, same
filters, the empty-name guard equivalent in its new position.
QA's count-honesty tests were the right instinct: the agreement test alone cannot catch semantic drift when both paths share one function, so pinning the absolute policies (multi-instance = one site, textual recursion, both ifdef arms) at the lens layer is what actually holds the numbers still. On QA's LOW finding, I agreed and promoted the index-table request to a concrete Handshakes entry with a named shape — two features now pay the sources() walk, which is exactly when a backlog bullet stops being enough. Accepted as shipped.