Files
Guoliang ChenandClaude Mythos 5.2 71d13b5fbe
ci / checks (push) Successful in 1m0s
ci / corpus (push) Successful in 18s
ci / linux (push) Successful in 6m4s
release / build-and-publish (push) Successful in 5m31s
Release 0.66.2: every source file names its author
Every tracked file that can carry a comment (880 of them) now opens with
"Author: Guoliang Chen, a Senior Digital Design Engineer" and closes with
"Author: Guoliang Chen. Lucisv is made by Guoliang Chen with love,
luciochen.com", in the file's own comment syntax. No behaviour change: the
diff outside the version bump and changelogs is comment lines only.

- tools/stamp_author.py: writes the lines; idempotent, `--check` lists
  what is missing. Headers go under a shebang and under Markdown front
  matter.
- Left alone: test fixtures, cases and snapshots (byte-exact inputs), JSON
  and JSONL, logs, images, lockfiles, docs/site/dist (regenerated) and the
  LICENSE files (already carry the copyright line).
- tools/linux_check.sh: --help reads its header from line 3, now that the
  author line sits under the shebang.
- tools/gates.sh green on this tree: 5 545 tests, corpus 814/6 as before.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
2026-11-24 12:11:09 -08:00
..

type-hierarchy

TODO.md §9c: the class extends tree, both directions, over LSP typeHierarchy.

Goal

"What does this class extend?" and "who extends it?" are the two questions a verification engineer asks about a UVM testbench they did not write, and until now lucisv could answer neither without a grep. LSP has had the shape for both since 3.17: its type hierarchy is a graph of supertypes and subtypes, and SystemVerilog's extends is exactly that graph — the classes are the nodes and class d extends b is the edge. So textDocument/prepareTypeHierarchy picks a class out of the text under the cursor, typeHierarchy/supertypes answers "what does X extend" and typeHierarchy/subtypes answers "who extends X", and every LSP client draws the tree with its own hierarchy view — no editor code at all.

Each request answers one hop. The client drives the expansion, so a cycle needs no handling here beyond not crashing: class a extends a; simply appears again one level down, and an a → b → a pair unrolls as far as the user keeps clicking.

Scope decision, made by the lead before the round: classes only. The module hierarchy stays on callHierarchy, where it shipped and is tested (docs/features/hierarchy/README.md). Mapping modules onto typeHierarchy as well was considered and rejected: an instantiation is a containment edge and extends is an inheritance edge, and serving both from one request would put two unrelated relations behind one node kind with no way for a client — or a reader — to tell them apart. One item kind, done well.

Assumptions

  • extends and implements are both edges. (Amended 2026-09-02 by vendor-formal-grammar; the original assumption is kept below because it explains the shape of the code.) vlog_parser now models interface class ic; ... endclass as an ordinary ClassDecl carrying the word interface in its prefix, so an implements target is a class declaration this server holds, and bases_of follows it through the same classes_at hop extends takes — base first, then the interfaces, in source order. Pinned by an_implements_clause_names_a_supertype, an_interface_class_is_a_node and extends_and_implements_are_both_edges_of_the_same_answer.

    Superseded: until 2026-09-02, implements contributed no supertype, because interface class was rejected as an unsupported construct and matching an implements target by name would have claimed an unrelated ordinary class of that name. The two tests that pinned that answer were named so this round would be forced past them, and it was.

  • Every item is still SymbolKind::CLASS. An interface class declares a SymbolKind::Class like any other — deliberately, and argued in docs/features/vendor-formal-grammar/README.md: a distinct kind would have to round-trip through the on-disk index (a FACTS_FORMAT bump) and nothing downstream asks the question. ClassDecl::is_interface_class() is there for the first consumer that ever does.

  • A class has exactly one base, which is what the AST gives (ClassDecl::extends is an Option<ClassExtends>) and what the LRM says for ordinary classes. supertypes is therefore a list of at most one — except under the workspace's documented duplicate policy, below.

  • The base is resolved by the same two layers textDocument/definition uses, and by nothing of this feature's own: the file's symbol table first, then the workspace overlay. vlog_semantic already records extends Base as a reference (docs/features/class-semantics/README.md rule 5), and the overlay-promotion round made a bare cross-file class name reachable through that same reference, so a base in another file needs no lookup here. The one thing this feature computes is which offset to ask about: the last byte of the extends clause's name_span. For a bare base that is that one reference; for pkg::base it is inside the tail's reference, which is the one that names a class (the head names the package), and it is the right byte whatever spacing the source used around the ::.

  • A parameterized base needs no unwrapping. The parser keeps #( ... ) on its own field, so extends base #(8) stores base in ClassExtends::name and its name_span covers base alone. This is the class-semantics policy already, verified by reading parse_class_extends, and pinned by a_parameterized_base_resolves_by_its_bare_name.

  • An unresolvable base yields no item, never a guess. extends uvm_object in a workspace that does not index UVM has nowhere honest to point: an item carries a uri and a range, and a wrong one sends the user to the wrong file with no way to tell. So the chain simply stops. This is not rare — it is the normal top of every UVM chain in the corpus — and it is what the corpus test asserts at core_ibex_base_test extends uvm_test.

  • subtypes matches the base name exactly as written, which is the hierarchy feature's own "the walk is by name" assumption applied to extends. Two consequences, both deliberate:

    • A qualified base is not matched: class d extends other_pkg::base; is not offered as a subtype of a file-scope base, because matching on the trailing segment would silently claim it. Measured: 0 of the 270 extends clauses in the checked-in 860-file corpus are qualified, so this costs nothing observable here. It does make the two directions asymmetric — supertypes does follow pkg::base, through the package — which is stated rather than hidden, and pinned by a_qualified_base_is_not_claimed_by_the_bare_name_it_ends_with.
    • Two classes of the same name in different files get the same subtype list. subtypes reads the item's name, not its uri — exactly as callHierarchy/incomingCalls does for a module name — because the text extends base says which name was extended and nothing more.
  • Ambiguity is answered the same way in both directions, and differently from outgoingCalls. A base name two files declare gives two supertype items. This is a deliberate departure from hierarchy::outgoing, which skips an ambiguous target: an outgoing call carries fromRanges, so two items would double one edge, whereas a supertype is a bare item in a flat list — the same list shape prepare returns, where showing both is how the user is told the ambiguity exists. It also comes for free from the shared overlay, whose documented policy is to offer every declaration (docs/features/workspace-index/README.md).

  • A cursor immediately after the last character of a name is on that name. TextRange::contains excludes the end, which is right for a span of text and wrong for a caret — that is where a double-click and an end-of-word motion leave it. Same convention hierarchy.rs states.

  • The scope ladder decides which files are searched. subtypes reads Workspace::sources(), so a file a filelist or an exclude keeps out of the index extends nothing, exactly as it references nothing. Open buffers beat disk, so an extends just typed and not yet saved is already a subtype.

  • Classes are found wherever they can be written: at file scope, inside a package (the dominant UVM shape), inside a module, and nested inside another class. A generate block is not descended into. QA traced the parser and corrected the original justification: classes inside generate blocks DO parse into real ClassDecl nodes — the walk simply does not recurse there. Zero such classes exist in the 860-file corpus, so the gap is theoretical today; the pinning test (a_class_declared_inside_a_generate_block_is_not_found_by_this_walk) makes a future round close it on purpose.

Handshakes

  • Consumes vlog_parser — parse_source_tolerant, ast::ClassDecl / ClassExtends (read-only, for name, name_span and extends), Item::span, LineIndex. Nothing new is asked of the crate.
  • Consumes vlog_semantic — ExternalResolutions::definition_of and Definition, Semantics::reference_at, SymbolKind::Class, WorkspaceIndex::path. Nothing was changed in the crate. The whole cross-file half of this feature is the overlay-promotion round's work being consumed: extends Base was already a reference carrying the bare name as its last candidate path, so the workspace already had the answer and this feature only had to ask for it at the right offset.
  • Consumes crate::state::{Workspace, Document} — document, index, text_of, sources, and Document::new for the one case an item names a file no editor has open (see the work log). Nothing in state.rs was changed; the workspace stays immutable through all three handlers, and no cache was added.
  • Promises lucisv_server — type_hierarchy::{prepare, supertypes, subtypes} never panic, never return an item whose selectionRange is outside its range, and never return an item for a class the workspace does not really declare.
  • Requested of vlog_semantic — delivered (incremental-index, 2026-08-27). WorkspaceIndex::subclasses_of is the table, keyed by base name and built by the same class walk this module used to run per request — lifted into vlog_semantic::classes, so the census and the declaration a hierarchy item shows cannot drift apart. subtypes is a map lookup and the sources() walk is gone: 82 ms → 0.71 ms over the corpus for core_ibex_base_test. It landed with the instantiation table, as filed. The request, kept legible: an inheritance edge table in WorkspaceIndex. This is the same Handshake docs/features/hierarchy filed for instantiation edges and docs/features/code-lens rode past — the index records what a file declares and not what it uses, so "who extends X" has to be a workspace walk. One table keyed by base name, built with the index, would make subtypes a map lookup at the cost of one extra field per class at index time. Filed together with the instantiation table rather than separately: the two want the same shape and should land as one round when something finally justifies widening the index's contract. Today one request in 55 ms does not.
  • The answer is as of the index (incremental-index, 2026-08-27), which is as of its last build or update — both of which fold every open buffer in. A keystroke in another buffer no longer moves the subtype list before a save does; the trade is argued in docs/features/incremental-index/README.md.
  • editors/vscode needs no change. vscode-languageclient 9.0.1 ships the type-hierarchy feature and enables it off the advertised capability; the extension sets no initializationOptions that would suppress it, and Vim/Neovim clients drive it through their own commands. editors/vscode/smoke.js checks a fixed capability list and was deliberately left untouched (it is editor-packaging's file) — it still passes.

The one thing lsp-types could not spell

lsp-types 0.97 models type hierarchy on the client side only: TypeHierarchyClientCapabilities exists, the three request types and TypeHierarchyItem exist, and ServerCapabilities has no type_hierarchy_provider field. A capability a client cannot see is a feature that is never requested, however well it is implemented — so initialize_value in main.rs serializes the InitializeResult and inserts "typeHierarchyProvider": true into the capabilities object, which is the same JSON a field would have produced. experimental was not used: it is a different key and no client reads it for this. Pinned twice — in main.rs (the JSON carries the key, and the insertion disturbs nothing else) and over the wire in tests/e2e.rs.

What it looks like

type_mid.sv:

class type_mid extends type_base;
  int y;
endclass

Cursor on type_mid anywhere — its own declaration, its extends in another class, or a type_mid handle; — and the hierarchy view shows:

supertypes (what type_mid extends)      subtypes (who extends type_mid)
  type_base   type_base.sv:1              type_leaf   type_leaf.sv:1

Cost

Release build, this machine, the checked-in 860-file corpus, worst of three (printed by the_corpus_uvm_classes_answer_all_three_requests):

request measured
subtypes for core_ibex_base_test (10 subclasses across the corpus) 55 ms
— of which reading the 860 files (Workspace::sources()) 53 ms
— of which the substring prefilter over all of them 0.28 ms
— of which parsing + walking the 3 files that mention the name ~2 ms
supertypes for core_ibex_debug_intr_basic_test 0.69 ms
the same subtypes in a debug build 101 ms

Superseded (incremental-index, 2026-08-27): subtypes is 0.71 ms. The table above is what the walk cost; the edge table named as "the place a future win lives" is where it went. The rest of the paragraph, kept legible: The shape is the same one callHierarchy/incomingCalls measured (56 ms), and for the same reason: what is left after the prefilter is almost entirely file I/O, because sources() reads every in-scope file whether it will be parsed or not. That is the shared cost of every cross-file answer in this server and the place a future win lives (the edge table above, or a cheaper sources()); nothing in this feature can shave it alone. The prefilter itself is not a heuristic — extends base has to write base — and here it skips 857 of 860 files.

supertypes never walks the workspace at all: it parses one file (the item's own) and, at most, re-reads the one file that declares the base. The same worst-case caveat hierarchy records applies to subtypes in principle — a class name that is a substring of nearly every file defeats the prefilter — but UVM class names are long and specific, and no such name exists in the corpus.

Status / TODO

  • crates/lucisv_server/src/type_hierarchy.rs: the class walk, prepare, supertypes, subtypes
  • typeHierarchyProvider in main.rs (inserted into the serialized capabilities, because lsp-types 0.97 has no field for it); three dispatch arms in server.rs
  • prepare on a declaration / on a use (extends base, a property's type, a method local's type) / on anything else (null), including a property name, a module, a wire and the class keyword
  • Ambiguity: every declaration from prepare and from supertypes, with the departure from outgoingCalls argued
  • Bases in-file, cross-file through the overlay, package-qualified, parameterized, and unresolvable (no item)
  • subtypes in-file, cross-file, sorted deterministically and stable across two calls; scope ladder and unsaved-buffer overlay honoured
  • Self-extends and a two-class cycle: one hop each, no duplicate, no hang
  • Classes in a package, in a module and nested in a class
  • UTF-16 positions, an untitled buffer, an unopened document, a file that has since moved, a nameless item, a buffer that does not parse
  • selectionRange inside range asserted for every item the feature can hand out, in three tests including the corpus one
  • Unit tests (31 in type_hierarchy.rs, 1 capability test in main.rs) and one e2e stdio round trip: prepare → supertypes → subtypes across three files
  • Corpus smoke: 30 classes of core_ibex_test_lib.sv through all three requests, plus the real core_ibex_debug_intr_basic_test → core_ibex_base_test → (uvm_test, unindexed) chain
  • Cost measured over the 860-file corpus, with the I/O split out
  • cargo fmt --all -- --check, cargo clippy --all-targets --workspace, cargo test --workspace, editors/vscode/smoke.js
  • docs/features/lucisv-server/README.md capability table + work log; TODO.md §9c
  • Not done, backlog: the inheritance edge table in WorkspaceIndex, filed with the instantiation-edge table it should ship beside (Handshakes above).
  • Interface classes — unblocked and done 2026-09-02 by vendor-formal-grammar: the parser models them, classes::declarations collects them unchanged, and implements joined supertypes. No new kind and no walk arm were needed; see the amended assumption above.
  • Not done, filed: subtypes does not answer the reverse implements edge. The forward hop reads the parse tree, but the reverse one is WorkspaceIndex::subclasses_of, whose edge table records extends only. "Who implements this interface class?" therefore returns nothing. Filed against the index rather than worked around here, because a name match would be exactly the wrong answer the original assumption warned about.
  • Not done, deliberately: chasing a chain server-side (the client drives it), a whole-tree "show me every class" view, and typedef/struct hierarchies — SystemVerilog has no inheritance for them.
  • Extended (call-hierarchy-everywhere, 2026-10-14): prepare inside a class body (a property, a method body, a keyword, this) answers the innermost enclosing class, and on super its base. The "anything else is null" contract above holds now only outside every class; classes-only scope is kept — modules stay off this view. See docs/features/call-hierarchy-everywhere/README.md.

Work log

  • 2026-08-26 (dev) — read CLAUDE.md, then lucisv-server, hierarchy, class-semantics and overlay-promotion READMEs, then hierarchy.rs, instantiations.rs, type_def.rs, nav.rs, state.rs, vlog_semantic's workspace.rs and vlog_parser's parse_class before writing anything.

    What the class model gave, and what it did not. It gave everything the cross-file half needs and it gave it already resolved: ClassDecl carries a parser name_span, ClassExtends carries the base name with its :: chain and its own span, extends is recorded as a reference by vlog_semantic, and since the overlay-promotion round that reference reaches the workspace unit table carrying the bare name. So supertypes is not a lookup this feature wrote — it is definition_of asked at one computed offset. What the model did not give is interface classes: interface class does not parse at all, so implements is a dead end and SymbolKind::INTERFACE is unreachable. Checked rather than assumed, and recorded in Assumptions with the parser's own test as the citation.

    Design decision 1 — resolve the base through the semantic reference, not through the index. The alternative was WorkspaceIndex::units(base_name), which is what hierarchy::outgoing does for an instantiated module. It would have been wrong here for two reasons: it cannot see a base declared in the same file (a very common shape — a base and its children in one _lib.sv, which is exactly what the corpus test file is), and it cannot follow pkg::base (the unit table holds no package-scoped class). definition_of handles both, in the documented order, and is the same answer F12 gives on the same token — so the two can never disagree about what extends base names. That is also what made the round small: the only new idea is which offset.

    Design decision 2 — the offset is the last byte of the extends name span. For pkg::base the clause records two references (head and tail); the head names the package and the tail names the class, so the answer has to come from the tail. Taking name_span.end - 1 lands inside the tail under every spelling, including the pkg :: base one that class-semantics warns can glue its ::. Taking name_span.start would have answered the package for every qualified base — a wrong file, silently.

    Design decision 3 — subtypes is a name walk, like callers_of_each. The brief asked for the census to be modelled on it and it is: one sources() pass, a substring prefilter before any parse, and a deterministic sort at the end. The precision question it raises — should other_pkg::base count as extending base? — was settled by measurement rather than taste: 0 of 270 extends clauses in the corpus are qualified (count per QA's reproducible grep — the work log's original 309 did not reproduce), so the precise version (resolve every candidate's base semantically and compare identities) would have bought nothing measurable for a large multiple of the cost and a second resolution path to keep honest. The asymmetry it leaves with supertypes is documented and pinned rather than papered over.

    Design decision 4 — ambiguity is shown, not skipped. hierarchy::outgoing skips an ambiguous target and says why: a call carries fromRanges, so two items for one edge would double the edge. A supertype has no such payload — it is one item in a flat list, the same shape prepare returns — so listing both candidate declarations tells the user the ambiguity exists instead of hiding it behind silence. Argued in Assumptions so the inconsistency with the neighbouring feature is on the record.

    The capability had to be hand-written. ServerCapabilities in lsp-types 0.97 has no type_hierarchy_provider field (grepped the crate: the only type_hierarchy in lib.rs is the client capability at line 1453). Rather than fork the crate or abuse experimental, initialize_value inserts the key into the serialized object. It is three lines, it returns Result rather than unwrapping, and it is pinned at both layers. Recorded here because it is the one place this feature is not simply "call the crate".

    Document::new for a closed file. Items carry no data payload — they are re-derived per request, like the call hierarchy's — so a client is free to send back an item naming a file no editor has open, which is exactly what happens the moment a user expands a subtype and then asks it for its base. hierarchy::outgoing needs only a parse there and re-parses; supertypes needs a resolution, so it builds a full Document (parse + analyze + overlay) for that one file. Pinned by supertypes_answer_for_a_file_no_editor_has_open, which walks base → subtype → base across an unopened file.

    Three one-line helpers restated rather than shared (touches, span, key). Each is a statement of a convention this handler makes — a caret at the end of a name is on it; a range sorts by line then character — and the two handlers share no logic a common helper would keep honest. Said out loud in the source so the duplication reads as a choice.

    Files touched. New: crates/lucisv_server/src/type_hierarchy.rs, this README. Edited: crates/lucisv_server/src/main.rs (one module declaration, initialize_value, one test), crates/lucisv_server/src/server.rs (three dispatch arms and their imports), crates/lucisv_server/tests/e2e.rs (one new test), docs/features/lucisv-server/README.md (capability table and work log), TODO.md (§9c).

    Not touched, deliberately: hierarchy.rs and instantiations.rs (the module hierarchy is untouched by the scope decision), vlog_semantic, vlog_parser, vlog_refactor, editors/, docs/site/. No version bump, no new dependency, no commits.

    Gates. cargo fmt --all -- --check clean; cargo clippy --all-targets --workspace zero warnings; cargo test --workspace green at 2 060 passed, 4 ignored, 0 failed (2 027 before; +33 = 31 in type_hierarchy.rs, 1 in main.rs, 1 e2e round trip). cargo build --release -p lucisv_server && node editors/vscode/smoke.js target/release/lucisv-server: smoke: OK.

QA log

  • 2026-08-26 (QA) — re-ran every gate, then attacked the seven surfaces the lead named plus three of my own. Verdict: committable as-is. Two findings filed, both non-blocking (documentation/completeness, not correctness or corruption); everything else verified clean. +12 tests added (11 in type_hierarchy.rs, 1 in main.rs); all green alongside the dev's +33. Full workspace total after this round: 2 072 passed, 4 ignored, 0 failed (2 060 before QA, +12 from this pass; confirmed on two full runs).

    Gates.

    • cargo fmt --all -- --check: clean (after cargo fmt --all reformatted two lines in the tests I added — reflowing, not a substantive change; re-checked clean).
    • cargo clippy --all-targets --workspace: zero warnings, before and after my additions.
    • cargo test --workspace: 2 072 passed, 4 ignored, 0 failed, both before and after my +12 tests landed (2 060 → 2 072), 0 failed throughout.
    • cargo build && node editors/vscode/smoke.js target/debug/lucisv-server: smoke: OK. Confirmed smoke.js checks a fixed capability list (documentFormattingProvider, definitionProvider, hoverProvider, semanticTokensProvider, documentHighlightProvider, inlineCompletionProvider — editors/vscode/smoke.js:140-145) that does not include typeHierarchyProvider, matching the README's claim that this file was deliberately left untouched.

    1. initialize_value() JSON injection — verified clean, one test added. git diff 24e8eab -- crates/lucisv_server/src/main.rs shows capabilities() and initialize_result() are byte-for-byte unchanged; the only new code is initialize_value() itself, which calls the same serde_json::to_value(initialize_result()) as before and then does exactly one caps.insert(...). Since ServerCapabilities has no type_hierarchy_provider field (confirmed by grep — the crate's only type_hierarchy hit is the client-side capability), the inserted key cannot collide with or overwrite an existing one — structurally, not just by test luck. Added the_json_insertion_disturbs_nothing_else_in_the_initialize_result (main.rs), which strips the one inserted key back out of initialize_value()'s output and asserts the remainder equals serde_json::to_value(initialize_result()) exactly — every key, every value, not just the two the dev's existing test spot-checked. Passes. to_value failing: propagated via ? all the way out of main() (Result<(), Box<dyn Error + Sync + Send>>), no unwrap/expect — the process exits with an error rather than sending a malformed or partial initialize response. serverInfo and other siblings: covered by the new test's full-object comparison. The e2e test decodes capabilities["typeHierarchyProvider"] == true off the real stdio wire (tests/e2e.rs, the_class_hierarchy_round_trips_over_the_wire_in_both_directions) — confirmed by reading it and by re-running it standalone.

    2. Last-byte offset — verified clean, 5 tests added. Read parse_class_extends/parse_scoped_name in vlog_parser: extends is called with ? from parse_class, so every one of "empty target" (extends ;), "EOF right after the base name", and "pkg:: with nothing after the ::" fails the entire class item's parse (it becomes ItemKind::Error) rather than producing a ClassExtends with an empty or truncated name_span — the defensive if extends.name_span.is_empty() guard at type_hierarchy.rs:156-158 is therefore not reachable through any input the parser can produce today, but it costs nothing and is the right thing to keep given that guarantee lives in a different crate. Added an_extends_clause_with_no_base_name_never_panics, an_extends_clause_at_eof_never_panics, a_qualified_base_with_nothing_after_the_double_colon_never_panics, a_single_character_base_name_resolves, and multibyte_text_immediately_after_the_extends_name_does_not_shift_the_offset (the last puts a 🎉 日本語 block comment starting at the very next byte after the base name, since name_span is measured in bytes independent of what follows). All pass, none panic. TextRange::contains excludes end (vlog_parser/src/span.rs), which is exactly why .end - 1 rather than .end is needed to land on the tail reference of pkg::base — confirmed by reading use_scoped_unit in vlog_semantic/src/bind.rs, where the tail reference's span ends exactly at ext.name_span.end and the head reference's ends earlier.

    3. The supertypes/subtypes asymmetry — pinned correctly, one gap in coverage found and closed. a_qualified_base_is_not_claimed_by_the_bare_name_it_ends_with exercises exactly the shape asked for: pkg::base written by a real class, a file-scope base, subtypes(base) empty. The README's "two consequences" prose also claims same-named classes in different files get the same subtype list (name-only match), but this was not previously pinned by a test — added subtypes_of_two_same_named_classes_in_different_files_share_one_list, which declares base in a.sv and b.sv, has sub extend the bare name, and asserts both base items' subtypes() include sub. Passes, confirms the documented (not hidden) imprecision and gives it a regression test it didn't have.

    4. Ambiguous-base = two items — verified clean. a_class_two_files_declare_prepares_both_rather_than_guessing already distinguishes the two items by file name, which is uri under the hood — no additional test needed for identity (uri+range differ, per spec equality).

    5. Census correctness — verified clean, two tests added, one real gap found.

    • Substring prefilter vs. match step: added a_file_containing_the_name_as_a_substring_but_no_matching_extends_is_not_a_false_positive — a file with class database; and class d extends database; alongside class base;; subtypes(base) is empty. Passes: the match step (extends_name(decl.class) != Some(item.name.as_str())) is a full string compare, so the prefilter's looseness never leaks through.
    • Self-extends / cycle: re-read the existing a_self_extending_class_answers_one_hop_in_both_directions_without_duplicating and a_two_class_cycle_terminates_in_both_directions — both correctly assert one item per hop, not a duplicate or a hang. Fine as written.
    • Finding (informational, non-blocking): generate-block classes are invisible to this feature, and the README's given reason is not quite right. The Assumptions section says "A generate block is not descended into — no class lives there." Traced the parser: parse_gen_block dispatches through the same item_or_recover/parse_keyword_item path ordinary module items use, so class Foo; ... endclass written inside generate/if-generate/for-generate does parse into a real ItemKind::Class(ClassDecl) node — it is just nested one level inside ItemKind::GenerateRegion/GenIf/GenFor/GenCase, which type_hierarchy::collect() (lines ~262-274) does not recurse into. Confirmed empirically: added a_class_declared_inside_a_generate_block_is_not_found_by_this_walk, which parses a module with generate if (1) begin class Foo; endclass end endgenerate and asserts prepare on Foo answers None today. This does not corrupt anything and does not violate a hard invariant — it is a completeness gap for a construct that is legal per IEEE 1800 (package_or_generate_item_declaration includes class_declaration) but vanishingly rare in real UVM code (0 occurrences in the 860-file corpus). Recommend the dev correct the README's wording from "no class lives there" to something like "the walk does not descend into GenerateRegion/GenIf/GenFor/GenCase, so a class declared inside one is not found — legal per the LRM, not observed in the corpus" — a one-line wording fix, not a redesign, so left for the dev/lead rather than changed here.

    6. Corpus test honesty — mostly confirmed, one citation could not be reproduced. Ran the_corpus_uvm_classes_answer_all_three_requests twice: stable both times (860 files, 30 classes in core_ibex_test_lib.sv, 30 with an indexed base, core_ibex_base_test has 10 subtypes; subtypes 99.7 ms / 100.9 ms on the two runs, supertypes 3.3 ms both — both inside the stated debug-build budget, and roughly matching the dev's own "101 ms" debug figure). The 860-file count reproduces exactly via an independent find corpus -name '*.sv' -o -name '*.svh' -o -name '*.v' -o -name '*.vh'. The "0 of 309 extends clauses are qualified" claim: the "0 qualified" half reproduces — a plain grep -c '::' over every extends occurrence in the corpus returns 0, confirming the safety-relevant part of the claim. The 309 denominator did not: an independent grep -ohE '\bextends\b' count over the same file set returns 270, not 309 (checked for multi-line extends clauses and backtick-macro bases as possible explanations for undercounting — found zero of either, so that gap is not explained). No script computing "309" is checked into tools/. This does not change any correctness verdict (the load-bearing claim, zero qualified, holds under both my recount and the existing a_qualified_base_is_not_claimed_by_the_bare_name_it_ends_with unit test), but the specific number in two README passages (docs/features/type-hierarchy/README.md:80,298 and docs/features/lucisv-server/README.md:49) is currently uncited and unreproducible — flagging for the dev to either recheck the corpus snapshot they measured against or drop the precise figure in favor of "a small double-digit number, all unqualified."

    7. CLAUDE.md compliance — verified clean. grep -n "unwrap()\|expect(\|panic!" crates/lucisv_server/src/type_hierarchy.rs shows every hit inside #[cfg(test)] mod tests (line ≥ 326 in the post-QA file); none in prepare/supertypes/subtypes or their helpers. Same check on main.rs's initialize_value — clean, uses ?. Public items (prepare, supertypes, subtypes) all carry doc comments. README sections (Goal, Assumptions, Handshakes, Status / TODO, Work log, QA log, Review) each appear exactly once. TODO.md's §9c item text is intact — checkbox flipped [ ] → [x], original sentence unchanged, a → delivered … paragraph appended after it rather than replacing anything.

    Beyond the list.

    • Deep chain: added a_ten_deep_chain_answers_each_hop_without_recursing (c0 extends c1 extends … extends c9, 10 files) — walks all nine hops of supertypes, one call at a time, asserting each answers exactly the next link and the chain terminates. No recursion in the implementation (each call is O(1) hops by construction), and the test's own structure never recurses either. Passes.
    • prepare on the extends keyword itself: added prepare_on_the_extends_keyword_itself_prepares_nothing — offset inside the literal word extends (not the name after it) answers None. Passes, because the keyword is outside every reference span definition_of/reference_at would match.
    • Class name shadowed by a local variable: added a_class_name_shadowed_by_a_local_variable_prepares_the_variable_use_as_nothing — a class base, a method-local int base;, and a use base = base + 1;; prepare at that use answers None because definition_of resolves it to the local variable's Symbol (kind Var, not Class), and classes_at checks symbol.kind != SemanticKind::Class before ever looking at the name. Passes — confirms the feature keys off semantic kind, not name matching, exactly as claimed.

    Files touched (QA only). crates/lucisv_server/src/type_hierarchy.rs (+11 tests), crates/lucisv_server/src/main.rs (+1 test). No production code changed — every finding above is either a passing defensive check, a documentation wording gap, or an unreproducible citation, none of which rose to "small unambiguous fix" territory in the sense of a code change; the README wording fix is left for the dev per the workflow (don't touch files outside the stated scope of a fix that isn't mine to make).

Review

2026-08-26 — lead

Reviewed the diff, the work log and the QA log; re-ran all gates myself (2072 workspace tests, 0 failed), clean. The round's hard problem was handled the right way twice over. First, the lsp-types gap: injecting the one missing key into the serialized initialize result is the honest minimal answer, and QA's strip-and-compare test — remove the inserted key, assert full object equality with the plain serialization — turns "disturbs nothing else" from a claim into a property. Second, the last-byte offset for qualified bases: the design reasoning was good and QA's parser trace showed the degenerate spans it guards against cannot even be constructed, which is the best kind of defensive code.

The supertypes/subtypes asymmetry is accepted as designed and now pinned from both directions, including the same-name/different-file consequence QA added a regression test for. Both QA findings were accepted and fixed by the lead before commit: the extends-clause denominator corrected to QA's reproducible 270 (in both READMEs), and the generate-block justification rewritten to what the parser actually does — the walk not recursing is a scoped choice with a pinning test, not a fact about where classes can live. The inheritance-edge-table want is filed beside the instantiation-edge request, correctly, as one future index round. Interface classes stay blocked on the parser and are pinned. Accepted as shipped.