Files
lucioandClaude Fable 5.1 f476c31483 Cross-file instance-member tail: a module's hierarchical surface, read only behind an instance head; rename edits the tail
TODO §49 (docs/features/hierarchical-tail). Closes topo §2.9-23 and
comment-slots finding 2. The first dev was cut off by an outage with the
library half complete; a second finished the tests, README and gates.

`Surface { Connection, Hierarchical }` on `Resolution::ExternalCandidate`
and `MemberSite::Unit`, set by `resolve.rs::head_surface` for an instance
head. `workspace/hierarchy.rs`: `surface_of` (the export rule, re-ruled)
and the two surface-taking reads; the index keeps two disjoint tables —
`members` (connection: ports, parameters; byte-identical to before for
every existing reader) and `hier_members` (nets, variables, instances) —
and a hierarchical read consults the connection table first, so a port
has one record. `FACTS_FORMAT` 18 → 19. `assign w = u_x.sig;` in another
file now resolves to `sub`'s `wire sig`; rename edits both files (nested
`u_a.u_b.sig` included); the §2.9-20 warning is retired for a resolved
tail; a generate-scoped net is still refused honestly. Completion after
`u_x.` in an expression lists the hierarchical surface; a connection
list's does not.

Census: single-file numbers unmoved; 12 939 connection + 5 239
hierarchical-only members; 335 corpus references newly resolve, 514 over
opentitan `hw/` (20 sampled by QA, all genuine). 0 of 860 corpus files
differ. Also: §50/§51 planned, §55 (state.rs size) filed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-05 13:35:57 -05:00
..

comment slots

Goal

Make hard invariant #3 — comments are never dropped — true at every inter-token gap of the grammar, not just at the gaps a construct happened to have a field for. A comment written where no AST node owns it is not deleted: Parser::bump queues it and the next node's take_meta hands it to whatever comes next, so the formatter prints it one node later, verify.rs compares comments too, and the whole file is refused. Exit 2, no output — a real file with a comment in an ordinary place becomes unformattable. Three rounds had filed their leftovers here (docs/topo.md §2.9-22: 52 covergroup gaps, 41 fragment gaps, 40 constraint gaps), and the count over ordinary RTL had never been taken at all. This round adds the missing owner for every one of them, commits the constraint fuzzer that measured the problem but was never landed, adds a fourth fuzzer over plain RTL, and drives all four to zero. It also carries three small correctness items that were waiting on the same files: go-to-definition on a macro use (H5), the casting type of a cast binding as a type (M11), and the rename warning for a reference the workspace could not finish (§2.9-20) — plus §2.9-21, the escaped name inside a scoped type, which falls out of the same segment work.

Assumptions

  • A gap belongs to a construct only when the token that closes it was written. Parser::gap_before(sym) is take_gap behind that check, and take_before_open(sym) is its opener-side twin. Both were already here; every new slot uses one of them or take_gap() directly, which takes only the comments written since the last consumed token — never a comment queued from further back, which belongs to whoever owns the place it was written. This is constraint-bodies' rule, applied about seventy more times.
  • One owner per gap. StmtKind::takes_semi() is the single answer to "who writes a statement's ;", the twin of ConstraintItemKind::takes_semi(). A debug_assert! in parse_stmt_inner refuses a before_semi on a kind that wrote no ;.
  • The empty case must cost nothing. Every new field is printed through Fmt::slot_comments, which is a no-op on an empty slot, and every construct with an is_empty() short-circuit keeps its old code path verbatim. This is what the corpus byte-identity gate below actually measures: 860 corpus files and 3 975 opentitan files format to the same bytes as v0.30.0, because no comment-free construct takes a new branch.
  • Expr may not grow. It is walked recursively in debug builds and the server's whole-corpus completion test overflowed an 8 MiB stack the first time it did (96 → 144 bytes). Every expression-level slot is therefore boxed — SegmentComments, CastComments, ArgComments, and even the two bare Vec<Comment> on Unary/Postfix — and Expr is back at its pre-round 96 bytes. StmtKind grew 368 → 392 and Stmt 504 → 552, which the same test tolerates.
  • verify.rs is untouched and no normalization was widened. Ten new attack pairs ship anyway (CLAUDE.md invariant 4), each a comment moved across exactly one of the tokens a new slot is defined between.
  • A comment inside a bracket pair forces that pair open. That has always been true of a port list; it is now true of a for header's parentheses, an empty argument list and a do ... while condition too. Two comment_slots.cases entries lay out across several lines for that reason and are fixed points there.
  • The joined spelling of a scoped name keeps the whitespace an escaped segment needs. \my-pkg ::\state-t is three tokens; joined tightly it reprints as the single token \my-pkg::\state-t. Parser::push_scope_segment is the one place the join happens, and it writes the terminator. The doubled space this produces before the declarator (\state-t \st) is what a bare escaped type name already printed.

Handshakes

Consumed. Parser::{bump, take_meta, take_gap, gap_before, take_before_open, take_around, take_dangling} unchanged — every new slot is built out of them. Fmt::{inline_comments, inline_comments_spaced, paren_comments, delimited_dangling} likewise. vlog_semantic::bind_data_type is the type resolver M11 mirrors.

Promised / changed, in AST order. Everything here is additive except where marked; no existing field changed meaning.

node new note
ExprKind::{Member, Scope, Index, Range} comments: Box<SegmentComments> one struct, five slots, one shared parse
ExprKind::ValueRange comments: Box<SegmentComments> the same [a:b] grammar
ExprKind::{Inside, InsideMacro} comments: Box<BinaryComments> inside is an operator like any other
ExprKind::Cast comments: Box<CastComments> ty /*a*/ ' /*b*/ ( /*c*/ e /*d*/ )
ExprKind::Unary / Postfix comments: Box<Vec<Comment>> the gap beside the operator
ExprKind::NamedArg comments: Box<ArgComments> replaces close_comments
Dim comments: Box<SegmentComments> packed, unpacked, [] and [*]
Stmt before_semi + StmtKind::takes_semi() widest slot of the round
StmtKind::{If, Case} after_kw in-paren comments still via header_parens
StmtKind::{For, DoWhile} comments: Box<ForComments> / Box<HeaderComments> do ... while has no body to recover from
StmtKind::Foreach comments, var_comments, vars: Vec<ForeachVar> Name → ForeachVar
StmtKind::{Block, ForkJoin} label_comments, end_label_comments
StmtKind::Return tuple → { after_kw, expr }
CaseItem / GenCaseItem before_colon the optional : of default
TimingControl::Delay tuple → { after_hash, expr }
SensList::{List, Bare} after_at; tuple → struct for Bare Star already had its two
SensItem after_edge @(posedge /*c*/ clk)
Module, ItemKind::Package, ClassDecl before_name, before_semi, end_label_comments, param_after_hash
FunctionDecl, TaskDecl after_kw, before_name, before_args, args_dangling, before_semi, end_label_comments; prefix/qualifiers: Vec<String> → Vec<Qualifier>; scope: Option<String> → Vec<ScopeSeg>
ConstraintDecl, CovergroupDecl qualifiers: Vec<Qualifier>, end_label_comments; ConstraintDecl::scope: Vec<ScopeSeg>
DataDecl, StructMember qualifiers: Vec<Qualifier>
ParamDecl after_kw
Declarator, TfArg, AnsiPort, ParamPort, EnumMember eq_comments, plus after_dir/after_kw/before_name where the shape has one
Connection after_dot, before_open, after_open
Instantiation after_hash, before_semi
Typedef after_kw, before_name, before_semi
StructType header_comments: Box<StructHeaderComments> four keyword gaps
EnumType after_kw, before_open
GenBlock before_kw, before_colon, after_colon, end_label_comments
GenFor after_genvar, comments; ItemKind::GenFor(Box<GenFor>) boxed on clippy's advice
ClockingDecl end_label_comments
vlog_semantic::FACTS_FORMAT 13 → 14 M11 records references a cached store would not have

Requests filed.

  1. crates/vlog_linter/src/signals.rs:629 was edited — one .. added to ExprKind::Postfix { expr, op } and ExprKind::Unary { expr, op } in increment_target, forced by the two new comments fields. That file belonged to the §24 lane when this round started (it has since merged), so the change is flagged rather than made silently. It is a mechanical pattern update with a comment saying so, and nothing else in vlog_linter was touched.
  2. A cross-file instance-member tail does not resolve for rename. The new §2.9-20 warning surfaced it: with module sub in sub.sv and assign w = u_x.sig; in top.sv, renaming sub's wire sig edits sub.sv only and now says so. In one file the same shape resolves and is edited (a_hierarchical_tail_that_resolves_is_renamed_with_its_declaration is the pin). Not this round's to fix — the warning is exactly the heads-up §2.9-20 asked for — but it is a real gap worth a row of its own. Closed 2026-09-05 by TODO §49 / docs/features/hierarchical-tail: a module's hierarchical surface makes the cross-file tail resolve, so the edit lands in both files and the warning is retired for a tail that resolved.
  3. docs/topo.md rows 20, 21 and 22 are closed and want striking by the lead (this round does not edit topo.md).

Status / TODO

  • G1 shared postfix segments — one parse_postfix_segment replaces the three-branch loop in parse_postfix_inner, parse_foreach_target_inner and parse_bare_event_name
  • G2 one [a:b] grammar — parse_value_range is now the only copy; the inside set calls it and parse_dims shares SegmentComments
  • G3 header keyword gaps — statement if/case/for/foreach/ do ... while, @ event control, # delay
  • G4 Stmt::before_semi + StmtKind::takes_semi()
  • G5 segment-preserving scoped names — ScopeSeg, and push_scope_segment for the joined spellings (closes §2.9-21)
  • G6 per-construct slots: qualifier runs, parse_tf_ports, labels, module/package/class/function/task/typedef/enum/struct headers, declarators, ports, connections, instantiations, casts, unary/postfix
  • Four gap fuzzers at zero: covergroup 329, fragment 153, constraint 395, RTL 352 — EXPECTED_FAILING_* and both analogue tests deleted, the constraint fuzzer committed, an RTL fuzzer added
  • cases/comment_slots.cases — 37 cases, one per slot family
  • 10 attack pairs; verify.rs untouched
  • Premise pins inverted: a_comment_in_a_for_foreach_or_do_while_header_is_kept, an_escaped_name_in_a_scoped_type_now_keeps_its_terminating_space, a_hierarchical_tail_that_cannot_resolve_is_left_alone_and_named_as_such
  • H5 nav::definition gains the macro branch, sharing hover's macro_name and narrowed_to_the_include_graph
  • M11 bind_type_expr — a cast's casting type binds as a type; FACTS_FORMAT 13 → 14
  • §2.9-20 Scope::unresolved_candidate_warnings, run over every file that spells the name
  • Gates: fmt / clippy / cargo test --workspace / corpus gate + byte identity / opentitan sweep / vsix smoke

Work log

2026-09-02 — dev.

The mechanism, restated, because it is what the whole round turns on. A comment is never dropped by a missing slot. bump moves a consumed token's leading comments into pending_leading and its trailing into pending_trailing; take_meta — the only universal harvest, and it runs at a node's start — drains both into the next node's Meta::leading. So a gap with no owner prints its comment one node later, and verify.rs refuses the file for a reordered comment. The fix is never "stop losing it"; it is always "give this gap a field, and print the field between the same two tokens".

Order of work. The fuzzers drove everything. A scratch harness ran all four fixture sets after each change and printed the failing sources, so no slot was guessed at: covergroup 52 → 30 → 8 → 4 → 0, fragment 41 → 14 → 3 → 1 → 0, constraint 92 → 49 → 19 → 7 → 2 → 0, RTL 178 → 120 → 91 → 62 → 39 → 24 → 11 → 7 → 0. (The constraint set is re-derived from the README's table rather than the original fifteen fixtures byte for byte, which is why it is 395 gaps and not 358.)

Three duplicates became one. parse_postfix_inner, parse_foreach_target_inner and parse_bare_event_name each wrote the ./::/[ loop out by hand, and each lost the same comments in it. parse_postfix_segment is now the only copy; the two callers keep only their own break conditions (a foreach target stops at the bracket group the ) follows; a bare event name needs an identifier after its .). The [a:b] grammar was written three times the same way — parse_value_range, an inlined copy in the inside set, and parse_dims — and parse_value_range is now the only one, with parse_dims sharing its SegmentComments shape.

Two decisions worth arguing with.

  1. header_parens was left standing for if and case. It is a print-side recovery: it reads the body statement's leading comments, partitions them by span around the condition, and prints them back inside the parentheses. Giving if real after_open/before_close slots would have taken those comments away from the body's meta, made header_parens a no-op, and changed the layout of every corpus file that has a comment there. So if and case got only after_kw — the one gap header_parens structurally cannot reach, because it sits outside the parentheses. for, foreach and do ... while have no body-after-parens to recover from and got the full slot set. This is why the corpus is byte-identical.
  2. The ; is still printed per statement kind. takes_semi() is the single owner of the gap, as the brief asked, but the ; itself is emitted by each stmt_kind arm through Fmt::semi(before_semi) rather than centrally by stmt. Moving it out would have moved it outside the group(...) that several arms wrap, changing what fits on a line. The ownership question — who may hold before_semi — is answered once, by takes_semi() and a debug_assert!; the emission is threaded.

Labels. parse_label gained parse_label_with, which returns Box<LabelComments> alongside the name, and ten nodes gained an end_label_comments (plus label_comments on Block/ForkJoin, and three fields on GenBlock for for (…) /*c*/ begin /*c*/ : /*c*/ g). Fmt::closing is untouched for the empty case; closing_labeled delegates to it when the slots are empty, which is every existing corpus file.

Qualifier runs. take_member_prefix returned Vec<String>, which cannot say which gap of pure /*c*/ static a comment was written in — and the two spellings are different token streams. It returns Vec<Qualifier> now, one after per keyword; Fmt::qualifier_run prints the run and the separator after each word. The same change covers DataDecl::qualifiers and StructMember::qualifiers (rand /*c*/ bit x;, a QA finding filed by constraint-bodies round 2).

The size regression, and the fix. Adding the slots inline took Expr from 96 to 144 bytes and Stmt from 504 to 696, and completion::tests::a_member_request_over_the_whole_corpus_stays_in_budget overflowed its stack in a debug build. Boxing the four expression comment structs (NamedArg alone carried 72 bytes of Vec) put Expr back to exactly 96. ItemKind::GenFor was boxed on clippy's advice for the same reason. Worth writing down: an AST field is not free just because it is usually empty.

§2.9-21 without restructuring DataType. The escaped-name gap needed the scoped-name join to keep whitespace, not DataType::name to become segments. Parser::push_scope_segment is that join — used by parse_scoped_name, both type-name loops and parse_instantiation — and parse_method_name keeps real segments (ScopeSeg) because it also needed a comment slot per ::. The escaped_identifiers.cases #SKIP is now a live case and the verification pin is inverted, with a new pair asserting that tightening the space back up is still refused.

H5. nav::definition had no macro branch at all: a macro use is one token with no Reference, so both layers below answered None. It now runs the same two-step lookup hover does — doc.defines.latest(name) first, then narrowed_to_the_include_graph(ws, doc, ws.index().find_define(name)) — and returns every surviving candidate. macro_name and the narrowing became pub(crate) rather than being copied. Five unit tests and one e2e session (in-file, cross-file, include-narrowed, a define inside a fragment file, and `uvm_info with no UVM in the index → nothing).

M11. bind_expr's Cast arm dropped ty behind a stale comment claiming type names are not resolved; bind_data_type has resolved them since overlay-promotion. bind_type_expr mirrors its three shapes: a bare name is a Target::Type (a type keyword names nothing, exactly as bind_data_type treats one), pkg::t is Target::Unit + Target::UnitMember, and a size, a parenthesized width or a $bits(...) call is an expression whose operands bind as ordinary uses. type_def.rs's doc comment has claimed since it was written that case 2 "is what reaches a cast (state_t'(0))"; it is true now, and pinned. FACTS_FORMAT is bumped because a store written by 0.30.0 records no reference for a typedef named only inside a cast, and find-all-references would answer from it.

§2.9-20. unaccounted_warnings builds covered from every reference's name_span regardless of resolution, so a candidate that stayed ExternalTarget::StillUnresolved through the overlay was silently skipped — the tail's own reference is what silenced the stray scan that used to warn about it. unresolved_candidate_warnings asks the Resolution first (an InheritedCandidate that missed stores nothing in the overlay, so get answers None for it and for a plain local miss alike), then checks for StillUnresolved, and groups one line per (file, unit). It runs over every file that spells the name, with the text.contains prefilter macro_use_warnings uses — and because collect_occurrences has already analysed every such file, it costs nothing extra. Writing the control test is what turned up request 2 above.

Gate numbers. cargo test --workspace: 46 binaries, 3 159 passed, 0 failed. cargo test -p vlog_formatter: 910 cases (37 new), 194 verification tests, all green. Corpus gate 814/820, unchanged, and the formatted output of all 860 corpus files is byte-identical to a v0.30.0 build — zero files moved, because no comment-free construct takes a new branch. Opentitan read-only sweep over 3 975 files: zero output differences, zero new failures, the same 10 pre-existing ones, and zero files that newly format (nothing in opentitan had a comment in a re-attaching slot). cargo fmt clean per crate, cargo clippy --all-targets --workspace clean, vsix smoke OK.

QA log

2026-09-02 — QA.

Scope confirmed: git status --porcelain at the start of this pass showed the 25 modified files + crates/vlog_formatter/tests/cases/comment_slots.cases + docs/features/comment-slots/ the brief named. Partway through the pass docs/topo.md also appeared modified — rows 20/21/22 struck and a new row 23 filed for the cross-instance-member-tail gap the dev's Handshakes section flagged. That is the lead's stated follow-up (CLAUDE.md: "this round does not edit topo.md"), not the dev's, and its content matches everything verified below, so it is noted here rather than treated as scope creep.

1. Gates, run directly. git diff --stat -- crates/vlog_formatter/src/verify.rs is empty — invariant 4 holds, the safety net is untouched. cargo fmt --check clean on all six touched crates. cargo clippy --all-targets --workspace: 0 warnings; grepped the full diff for allow( on every added line — none. cargo test --workspace --no-fail-fast: 46 binaries, 3159 passed, 0 failed (34 + 2 + 1 + 1 ignored, all pre-existing, not this round's), reproduced twice identically. cargo test -p vlog_formatter: 194 verification tests + 910 cases (37 new to comment_slots.cases), 0 failed. tools/corpus_check.sh: 814/820 (11 ok-unchanged + 803 would-reformat + 6 parse-error), 0 verification-error, 0 crash — matches the dev's number exactly, and confirms it is a live, reproducible gate rather than a one-time measurement.

2. Output neutrality, independently. Built v0.30.0 in .claude/worktrees/qa-base and the working tree's release binary, then compared --stdout output byte-for-byte over every corpus file and a large opentitan sample:

  • Corpus (860 files): 854 identical, 0 differing, 6 both-fail (the known parse-error set both builds share). Matches "byte-identical … zero files moved."
  • Opentitan (3947 files found under the current checkout, vs the dev's 3975 — the checkout has drifted slightly since the round's own sweep; not a regression, see below): 3936 identical, 0 differing, 11 both-fail (dev reported 10; the +1 is consistent with the same checkout drift, not a new failure — no file differs in output, which is the invariant that matters). git -C /Users/guoliangchen/repo/opentitan status --porcelain after the sweep showed only the owner's three pre-existing files (hw/ip/aes/dv/tb/tb.sv, hw/top_darjeeling/ip/ast/rtl/ast.sv, hw/top_earlgrey/ip/ast/rtl/ast.sv) — untouched, nothing else. Worktree removed after (git worktree remove --force .claude/worktrees/qa-base).

3. Comment slots — tried to break them. Read every Fmt::slot_comments call site and the SegmentComments/BinaryComments/LabelComments/ ScopeSeg/before_semi fields in ast.rs, then wrote 35 targeted .sv probes (not the dev's own fixtures) covering essentially every row of the Handshakes table: module/class/package headers and end-labels, typedef + struct/enum headers, Dim arithmetic, instantiation + named connection, clocking end-label, genvar for, foreach with a bracketed var, inside, casts, unary/postfix, named args, qualifier runs, case default:, #/@ delay and edge-keyword gaps, block/fork-join labels, return, do…while, generate blocks (labelled and not), constraint/ covergroup qualifiers+scope+end-label, rand/qualifier runs on DataDecl/StructMember, ANSI ports, param ports, enum-member =, declarator =, TfArg default =. For each: formatted once, re-formatted the output, and diffed comment counts. 35/35 format successfully, are idempotent, and keep every comment exactly where it was written — no drift to the next node. Cross-checked all 35 against the v0.30.0 baseline: 33 of 35 were refused by 0.30.0 (the round's whole point) and now format; the other 2 (a plain module end-label, a bare clocking end-label) happened to already pass on 0.30.0 too. One out-of-scope gap found and confirmed pre-existing, not a regression: a comment inside a plain (non-escaped) scoped type name used as an ordinary declaration type (pkg /*c*/ ::item x;) is still rejected identically on both v0.30.0 and the working build — ScopeSeg/comment slots were only ever promised for FunctionDecl/ TaskDecl/ConstraintDecl::scope and parse_method_name chains, never for DataType::name's plain-string join, so this is correctly out of the round's stated scope. Filed here for visibility, not as a blocking finding.

4. The four fuzzers. Found in crates/vlog_formatter/tests/verification.rs (gaps/failing_gaps/assert_no_failing_gaps, lines ~1988–2043, shared by all four). Each fixture set's total gap count is asserted alongside the zero-failures count (assert_eq!((counted, failed.len()), (total, 0), …)), so a shrunken fixture can't pass by asking less — confirmed the constants (329/153/395/352) match the dev's numbers exactly. No allowlist, #SKIP, or filter anywhere in the fuzzer machinery (grep -rn "#SKIP" crates/vlog_formatter/tests/cases/*.cases returns nothing at all — the escaped-identifiers #SKIP this round closed was the last one in the repo). Confirmed the two old "expected failing" analogue tests (EXPECTED_FAILING_GAPS/EXPECTED_FAILING_FRAGMENT_GAPS, 52/41) are gone from the diff as pure deletions, not renames. Ran all four fuzzer tests individually: green.

5. G4 single-ownership debug_assert!. Found at crates/vlog_parser/src/parser.rs:6174, inside parse_stmt_inner, gated by the ordinary self.enter()?/depth machinery that already runs under debug assertions in every cargo test (release-mode debug_assert stripping is not in play here — this is the default dev/test profile). Traced the single-writer property by hand: self.semi_comments is cleared at the top of every parse_stmt_inner call and taken (mem::take, which resets it) right before that same call returns; the only writers, expect_stmt_semi/eat_stmt_semi, are called exclusively from the branches of parse_stmt_kind that correspond 1:1 to takes_semi()'s true arms (verified Assign/ExprStmt at parser.rs:6790–6807 and the Timing/Wait/ Assert/DoWhile branch-selecting eat_stmt_semi call sites at 6261/6270/6524/6532). A statement kind that recurses into a nested parse_stmt() (an if, a block, do…while's body) always does so before its own optional expect_stmt_semi call, and the nested call's own clear/take pair fully resets self.semi_comments on the way back out, so there is no path by which a child's semicolon comments could leak into a parent's before_semi or vice versa. Exercised by all 3159 workspace tests and the 910-case suite with zero assertion failures. Reachable and correct; no double-ownership path found.

6. H5 (macro go-to-definition). Ran the dev's e2e test (go_to_definition_on_a_macro_use_lands_on_its_define) and all 5 named unit tests in crates/lucisv_server/src/nav.rs individually: all green, in-file/cross-file/include-narrowed/fragment-file/unknown-macro as described. Confirmed hover::macro_name and hover::narrowed_to_the_include_graph were widened from private to pub(crate) rather than duplicated (the diff shows only the visibility change). Did not additionally run the real server against an opentitan DV file — the e2e session already covers in-file, cross-file and include-narrowing against real workspace machinery, and opentitan's own `uvm_* macros are exactly the "not in the index" case the a_macro_nothing_defines_has_no_definition unit test already pins.

7. M11 (casts). Ran the dev's 3 type_def.rs unit tests and 4 vlog_semantic tests: green. Read bind_type_expr (bind.rs:1981) and confirmed it mirrors bind_data_type's three shapes exactly as claimed. Added temporary throwaway tests (removed after, see incident note below) for pkg::t'(x) cross-package, signed'(x) and logic'(y): all three answer silently (empty location list) rather than a wrong target, which is within the task's own bar ("go to the right declaration or be silent, never a wrong target"). This is a real, but pre-existing and never-promised, limitation of type_def.rs::type_use_at — it only ever consulted an in-file resolved Reference (reference.resolved()), never the workspace overlay, for the "cursor on a use" case (case 2); the plain declaration case (case 1, pkg::t s;) has always worked cross-file because it hands off to nav::definition instead. M11's own promise — and its only tested claim — is that the casting type's reference is now recorded at all (confirmed at the semantic layer by a_scoped_casts_type_binds_both_halves, which pins the ExternalCandidate resolution pkg::t feeds to rename/find-references), not that textDocument/typeDefinition gained cross-file reach for a cast specifically. The type-definition/README.md amendment is scoped the same way (case 2, in-file), so there is no doc/reality mismatch — noting this as context, not a finding that forces rework.

Incident, disclosed in full. While building the cross-package-cast probe above I first added a throwaway e2e test to crates/lucisv_server/tests/e2e.rs and, to remove it again, ran a Python script keyed on a start/end text marker; the end marker's str.rindex matched much further down the file than intended and the removal deleted roughly 3100 lines of pre-existing, unrelated test code (everything after the typedef cross-file test to EOF) — none of it the dev's own work, but real code all the same. Caught immediately via git diff --stat (expected 68 insertions(+), 0 deletions, saw 3122 deletions). Recovered fully and losslessly: confirmed the deleted range was byte-identical between HEAD and the dev's working copy (the dev's diff for this file is a single contiguous 68-line insertion earlier in the file, confirmed by line-number offset arithmetic and a direct byte comparison of the boundary lines), then reconstructed the missing tail from git show HEAD:crates/lucisv_server/tests/e2e.rs and appended it back. Re-diffed against the dev's original hunk: identical, 68 insertions(+), 0 deletions(-). Full cargo test -p lucisv_server re-run clean afterward (1429 + 83 + 3 = 1515 passed, 0 failed). The type_def.rs scratch tests were removed with the Edit tool (exact string match) rather than the same script, and its diff was independently confirmed to match the dev's original 43-line insertion exactly. Final git status --porcelain matches the session's opening snapshot file-for-file (plus the lead's docs/topo.md update noted above). No dev work was lost; flagging this so the lead knows a large bulk-text-removal script touched the tree mid-session and was verified, not merely trusted.

8. §2.9-20 (rename warnings). Ran a_hierarchical_tail_that_cannot_resolve_is_left_alone_and_named_as_such, a_tail_the_workspace_can_finish_earns_no_such_warning, and an_unresolved_tail_in_a_file_the_rename_never_edits_is_still_named individually: all green. Confirmed the two-file case (resolvable in one file, unresolvable in another) edits the resolvable file, leaves the other untouched, and warns naming both the file and the unit (other.sv/unknown_mod), and that the warning text includes the line number and "left unchanged." Confirmed the premise pin really did invert (old name ..._is_left_alone_and_named_as_such now documents the warned behavior, per the diff and the topo.md row-20 strike-through).

9. §2.9-21 (escaped scoped segments). Ran an_escaped_name_in_a_scoped_type_now_keeps_its_terminating_space and a_space_dropped_inside_a_scoped_escaped_type_is_rejected: green. grep -rn "#SKIP" crates/vlog_formatter/tests/cases/*.cases is empty — the former #SKIP case is confirmed live. Manually probed three shapes the dev's own tests don't cover: \pkg ::\x \v ; (fully escaped, single segment), pkg::\weird.name \v ; (mixed plain+escaped), and a three-level chain \my-pkg ::\a-b ::\c-d \v ; — all three format, keep the double-space terminator before the declarator, and are idempotent on a second pass.

10. Size pins. No size_of::<Expr>()/size_of::<Stmt>()/ size_of::<StmtKind>() assertion exists anywhere in the tree (grep -rln size_of crates/ returns nothing) — not even a printed-but-unasserted one. The only regression signal for the round's central size invariant ("Expr may not grow") is the indirect symptom the dev's own work log describes: a debug-build stack overflow in lucisv_server::completion::tests::a_member_request_over_the_whole_corpus_stays_in_budget, which additionally no-ops silently when corpus/ is not checked out (if !corpus.is_dir() { …; return; }). That means a future change that grew Expr back past 96 bytes would have no fast, direct, always-on test failure — only a slow, corpus-dependent, debug-only crash in an unrelated server test, or none at all in an environment without the corpus checked out. MEDIUM finding, not blocking (nothing is wrong today; the pin the round's own Assumptions section relies on doesn't exist as code) — recommend a const _: () = assert!(std::mem::size_of::<Expr>() <= 96);-style static assertion in vlog_parser::ast for Expr, Stmt and StmtKind, filed here rather than fixed directly since it's outside this pass's small-fix allowance and belongs in the feature's own file scope.

11. Docs. docs/features/comment-slots/README.md has all seven required sections. Status/TODO checklist matches what's actually landed (verified G1–G6, the fuzzers, H5, M11, §2.9-20 items above; the one unchecked line — "QA: fuzz 5 fresh fixtures…" — is this pass's own item, now done). TODO.md §25 checkboxes match: G1–G6, fuzzers, H5, M11, §2.9-20 ticked; only the QA line remains open pending this log. Spot-checked three of the other seven edited feature READMEs against the actual diffs: escaped-identifiers, refactor-rename and overlay-promotion/type-definition (four, since two were quick) — all accurately describe the mechanism, cite the right function/test names, and match the code read in items 6, 7, 8 and 9 above.

Verdict: PASS. No wrong answer found anywhere the brief asked to check. One MEDIUM finding (item 10, missing size pins — recommend, don't block) and one informational out-of-scope note (item 3's plain-scoped-name gap, item 7's cross-file cast-typeDefinition limit) that are both pre-existing, correctly out of this round's stated scope, and consistent with the docs. The mid-pass file-recovery incident (see item 7) is disclosed in full above and was fully and verifiably resolved before this verdict was written.

Review

2026-09-02 — lead. Accepted. The dev's own framing is the right one: a missing slot never deleted a comment, it re-attached it one node later and the safety net refused the file — so the fix is an owner per gap, and the proof is four exhaustive fuzzers at zero plus byte-identity of every comment-free file against v0.30.0 (860 corpus, 3 975 opentitan; QA reproduced both from an independent baseline build: 0 differing). The two deviations are correct calls: a real in-paren slot for if/case would have moved comments out of header_parens' reach and changed shipped layout for no gain, and the ; staying inside each arm's group(...) is what keeps line fitting unchanged. bind_type_expr's keyword check is redundant with use_name's, which is fine. The rename warning asks the Resolution before the overlay for exactly the reason it states.

Acted on at review: QA's one MEDIUM — no static size pin existed, only an indirect debug-only stack overflow that needs the corpus on disk — is closed by ast::size_pins (Expr ≤ 96, StmtKind ≤ 392, Stmt ≤ 552 on 64-bit). QA's e2e.rs accident was verified recovered: the working diff against HEAD is 68 added lines and zero removed, the one new H5 test, and the lucisv_server suite is green. Handshake 1 (signals.rs pattern ..) accepted as flagged; handshake 2 filed as docs/topo.md §2.9-23; rows 20/21/22 struck. QA's pre-existing gap — a comment inside a plain pkg::item type name — is the push_scope_segment join and belongs to the next comment round; noted here, not filed separately. Ships in 0.31.0.