vlog_semantic: type-position misses reach the workspace overlay

Delivers the Handshake docs/features/type-definition/README.md filed:
an unqualified lexical miss written where a TYPE goes — bus_if bus;,
my_cls h;, a cross-file typedef — now carries its bare name to the
workspace overlay (last, so imports still win), in both spellings:
ExternalCandidate, and InheritedCandidate inside extending classes,
whose base and count (7,841, bit-identical) are untouched. The
mechanism is a new Target::Type emitted only by bind_data_type's
unqualified arm; value-position identifiers, disable labels and
redeclarations keep their pre-round Target::Lexical behavior — NotFound
stays NotFound, and rename keeps refusing them.

That value/type split is the round's story: QA rejected the first cut
with a kept repro proving a value-position typo could rename an
unrelated same-named module cross-file (write-by-coincidence,
pre-round refused), and disproved the work log's exposure claim
against the pre-round source. The fix is a four-line behavior delta;
QA re-killed the regression from three angles and reproduced every
corpus figure to the digit. Result over the 860-file corpus: NotFound
1,418 -> 1,256, 418 clean-file references gained a jump target, none
lost one, 141 coincidence-answers deliberately given back.

The server's stopgap is deleted whole: type_def.rs::indexed_type,
qualifier guard included — all 45 type-definition tests green
unchanged, and cross-file interface rename from a type window is newly
possible and pinned. Corpus formatter results byte-identical (813/820
both trees). New docs/features/overlay-promotion/README.md; the
vlog-semantic and workspace-index tables re-measured (the committed
baselines had gone stale several rounds ago; both READMEs now carry
the three-state table).

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5 committed 2026-08-26 19:56:55 -07:00
1 parent 3bc61f9eab
commit 0e740d77ec
15 files changed
+1686 -182

No files matched your search

+76 -19
View File
@@ -48,16 +48,17 @@ feature adds is *which offset to ask about*.
anything to do with inheritance — so in a type window it means only "a base
class *might* declare this type". `vlog_semantic` never chases a base chain
(in this file or out of it: `lexical` walks `scope.parent`, which is lexical
nesting, and `miss` records the base's *name* and stops; `resolve_external`
only finishes an `ExternalCandidate`), so no layer can turn that into a
location, and the workspace's file-scope type of that name is the best
honest answer available. This is assumed, not enforced: a base class that
genuinely declares a nested type of the same name would be the better answer,
and nothing here can produce it — but nothing displaces it either, because
the fallback is consulted only after `nav::definition` came back empty. The
day `vlog_semantic` does chase a base, such a reference becomes
`Resolution::Resolved`, `definition` answers it, and the fallback is never
reached. Pinned by
nesting, and `miss` records the base's *name* and stops), so no layer can
turn that into a location, and the workspace's file-scope type of that name
is the best honest answer available. **Since 2026-08-26 that answer comes
from the overlay itself**, which tries the paths such a miss now carries
(`docs/features/overlay-promotion/README.md`) — the reasoning is unchanged,
only the layer that acts on it. This is assumed, not enforced: a base class
that genuinely declares a nested type of the same name would be the better
answer, and nothing here can produce it — but nothing displaces it either,
because a resolved name never reaches the sweep. The day `vlog_semantic` does
chase a base, such a reference becomes `Resolution::Resolved` and
`definition` answers it directly. Pinned by
`an_in_file_bases_nested_typedef_does_not_beat_the_workspace_type_because_nothing_finds_it`.
## Handshakes
@@ -68,9 +69,11 @@ Instantiation, GenIf, GenElse, GenBlock, Stmt, StmtKind}` and `TextRange`.
Read-only; nothing was changed.
**Consumed from `vlog_semantic`:** `Semantics::{references, reference_at,
symbol}`, `Reference::{name, name_span, resolved}`, `Resolution::NotFound`,
`SymbolKind`, and `WorkspaceIndex::{units, path}` for the one fallback below.
Read-only; nothing was changed.
symbol}`, `Reference::{name, name_span, resolved}` and `SymbolKind`.
Read-only; nothing was changed. (Until 2026-08-26 this also read
`Resolution::{NotFound, InheritedCandidate}` and `WorkspaceIndex::{units,
path}` for the `indexed_type` fallback; request 1 below landed and the
fallback is gone.)
**Consumed from this crate:** `nav::definition` (the whole answer),
`nav::symbol_at` — widened from private to `pub(crate)` so the two handlers
@@ -82,11 +85,23 @@ serving `server.rs`'s `GotoTypeDefinition` arm. Same answer shape as
to, every candidate where the workspace declares the name twice, and an empty
array (not `null`) for a buffer the server was never sent.
**Requested of other modules** — neither blocked this round, and neither was
done here:
**Requested of other modules** — neither blocked the original round, and
neither was done there:
1. **`vlog_semantic`: report an unresolved *unqualified* name as an external
candidate, not as a bare lexical miss.** `resolve.rs`'s `lexical` miss ends
1. ~~**`vlog_semantic`: report an unresolved *unqualified* name as an external
candidate, not as a bare lexical miss.**~~ **Delivered 2026-08-26 by
`overlay-promotion`** (`docs/features/overlay-promotion/README.md`): a miss
on a name written in a **type** position — which is every name this feature
ever asks about — carries the bare name as its last candidate path in both
miss spellings, so the workspace overlay answers them. (A miss in a *value*
position does not, which is what keeps a bare expression identifier from
matching a unit on name alone.) `indexed_type` — its qualifier guard and
its kind filter with it — is deleted. `type_definition` is now literally
`nav::definition` of the type name's offset and nothing else. One test
changed behavior with it: a `package` of the type's name is now answered
exactly as `definition` answers it, because the shared overlay does not
filter by kind and the private fallback did (argued in that feature's
Assumptions). The original request read: `resolve.rs`'s `lexical` miss ends
in `Resolution::NotFound` whenever the file collected no import paths on the
way out — or, inside a class with an `extends`, in
`Resolution::InheritedCandidate` — and neither reaches `resolve_external`,
@@ -105,7 +120,8 @@ done here:
**file-scope** declaration, and only for the kinds that can be a type
(`Module`, `Class`, `Typedef` — a `package` of that name is not one). When
the request above lands, that function is deleted and nothing else in this
module changes.
module changes. *(It landed; the function is gone and nothing else in this
module changed.)*
2. **`vlog_parser`: an ANSI header whose *first* port carries no direction does
not parse.** `module m (bus_if bus, input logic clk);` becomes an `Error`
item, while `module m (input logic clk, bus_if bus);` parses fine — the
@@ -119,7 +135,7 @@ done here:
## Status / TODO
- [x] `crates/lucisv_server/src/type_def.rs`: the offset redirection, the
declaration walk, and the index fallback.
declaration walk, and (until 2026-08-26) the index fallback.
- [x] `type_definition_provider` advertised (`TypeDefinitionProviderCapability::Simple(true)`).
- [x] `GotoTypeDefinition` dispatched in `server.rs`, on `GotoDefinition`'s
conventions exactly.
@@ -136,6 +152,13 @@ done here:
finding below (a cross-file type used as a member of any `extends`-ing
class — nearly every UVM class — answered nothing). 4 tests added, QA's
regression test flipped, corpus spot-check assertions flipped positive.
- [x] **Fallback deleted (2026-08-26, `overlay-promotion`):** Handshake request
1 landed in `vlog_semantic`, so `indexed_type` — fence, qualifier guard
and all — is gone and `type_definition` is `nav::definition` of the type
name's offset, nothing more. Every test in the suite still passes; two
were renamed and one changed behavior (a `package` of the type's name is
now answered as `definition` answers it), each argued in that feature's
work log.
- [x] One e2e round trip: the capability in the real handshake, a cross-file
package typedef, and a built-in answered with an empty array.
- [x] TODO.md §9c checkbox; `docs/features/lucisv-server/README.md` capability
@@ -300,6 +323,40 @@ done here:
node editors/vscode/smoke.js target/debug/lucisv-server`: `smoke: OK`. No
`git commit`, no `git push`.
### 2026-08-26 — overlay-promotion dev agent (the Handshake landing)
- **`indexed_type` deleted whole**, its qualifier guard and its kind filter
with it, and `type_definition` is now three lines: find the type name's
offset, ask `nav::definition`, return. `Resolution` and
`crate::locate::location` are no longer imported by this module at all — the
handler builds no `Location` of its own, which is the delegation-honesty
property QA checked by reading, now true by absence.
- **The whole suite is the acceptance suite and it still passes** — 45 tests,
none added, none removed. 41 are untouched; one had an expectation updated
(below). Three were renamed because they named the deleted function or a
fence that moved, and one of those three —
`a_package_of_the_same_name_is_not_a_type` — also changed behavior; it is now
`a_package_of_the_same_name_answers_exactly_as_definition_answers_it`,
asserting literal equality with `nav::definition` at the same offset. The
reason it changed: the shared overlay does not filter the unit table by kind,
and the private fallback did. Keeping the old answer would mean rebuilding
the fourth resolution layer this round exists to delete, and the input it
concerns (`thing t;` where the workspace's only `thing` is a package) does
not compile either way.
- `a_plain_expression_use_of_a_workspace_module_name_is_never_a_type_site` kept
its name and got stronger, though not the way the round first wrote it. The
first cut had it assert that `nav::definition` *does* answer that offset
while `type_definition` does not; QA showed the same promotion made `rename`
rewrite an unrelated file on the same coincidence, so the promotion was
narrowed to type positions and the read side went back with the write side.
The test now asserts the reference is `NotFound` and that **neither**
handler answers it — pinning two independent fences (the model never offers
the coincidence; no `Site` is built for an expression statement) instead of
one.
- Everything else about this feature — the offset redirection, `site_at`, the
one-hop rule, the conventions — is unchanged. Full rationale, consumer audit
and corpus measurement: `docs/features/overlay-promotion/README.md`.
## QA log
### 2026-08-26 — QA agent (continuation of an interrupted run)