Semantic lints on by default: the index knows who mentions what, and the linter finally asks

TODO section 24, coverage_gaps M7 via topo 2.9-6 and 2.9-4.
unused-signal, undriven-net and multiply-driven shipped off because a
per-file analysis cannot see a signal read or driven from another
file's hierarchy. The index now carries a per-file identifier census -
FileFacts::words, FACTS_FORMAT 12 -> 13, one harvest lifted from the
server's completion candidates and now feeding them back from the store
instead of re-lexing every file at startup (scan -28 percent) - and the
linter gains a MentionOracle: unused-signal and undriven-net say nothing
when the name is mentioned in any other indexed file, the
false-negative-safe direction; multiply-driven shares the gate but never
reads it. The three are on wherever an oracle exists (the editor always,
the CLI when it walks a project) and off for a single file or stdin.
With them, the missing off switch: [lint] select/ignore in lucisv.toml
with CLI flags winning key by key, and lucisv.lint.select/ignore in the
editor.

QA's finding, reworked: the census dropped macro invocations whole, so a
signal named only inside `uvm_info(..., dut.sig) was not silenced; the
harvest now splits macro, directive and attribute words, skipping
double-quoted runs so a "%d" cannot silence a signal named d
project-wide, with workspace-defined macro names filtered out of the
completion table at the reader. Store +16.9 percent corpus / +15.0
percent opentitan, measured.

Corpus unused-signal 52 -> 44 and undriven-net 3 -> 0 with every
silencing hand-checked, nothing added; opentitan - lint-clean under its
own tools - 14 findings, all classified true against the whole repo.
Also: the docs-site rules page gains the empty-item row it lacked.

docs/features/semantic-lints-on/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5 committed 2026-09-02 09:06:08 -07:00
1 parent 29096cbbac
commit 5051bbdf15
36 files changed
+3064 -216

No files matched your search

+20 -4
View File
@@ -226,7 +226,14 @@ output port, assigned nowhere).
RTL, which is the strongest quietness evidence available and the same score
`always-comb-blocking` posts.
**Ruling: all three ship `default_on() == false`.** Not because the corpus
**Ruling: all three ship `default_on() == false`.** *(Superseded 2026-09-02
by `semantic-lints-on`, which delivered the precondition this ruling names as
its own escape route. The rules now default **on** in a run that can see the
other files of the project — `lucisv check <dir>`, or the language server —
and stay off for a single file or a stdin buffer, where the cross-file
question cannot be asked. The reasoning below is why they shipped off, and it
is why the flip is conditional rather than unconditional; the measurements
that justified the flip are in that round's README.)* Not because the corpus
was noisy — it was not, 0 wrong answers out of 55 — but because of what the
corpus *findings* are. The largest single cluster (32 of 52 `unused-signal`
hits) is picorv32's debug taps: signals declared precisely so that something
@@ -299,8 +306,14 @@ disappears into the worker pool.
- [x] Corpus measurement, per-finding judgement, and the on/off ruling above.
- [x] `rules_markdown` golden test pins the three new rows;
`linter-core`'s rule table updated.
- [ ] Cross-file use through the workspace index — the handshake above, and
the precondition for defaulting any of these on.
- [x] Cross-file use through the workspace index — the handshake above, and
the precondition for defaulting any of these on. **Delivered 2026-09-02
by `semantic-lints-on`**: `FileFacts` carries a per-file identifier
census (`FACTS_FORMAT` 13), `WorkspaceIndex::files_mentioning` answers
"does any file write this word down", `LintContext` gained a
`MentionOracle`, and the three rules default **on** wherever a run can
see the project. See `docs/features/semantic-lints-on/README.md` — the
ruling below is superseded there, with its own measurements.
- [ ] Block-local variables (`logic tmp;` inside an `always` block) and
interfaces as `unused-signal` subjects.
- [ ] Direction-aware instance connections: when the instantiated module is
@@ -309,7 +322,10 @@ disappears into the worker pool.
unknown. Deliberately not done — it is a second resolution mechanism
and wants the workspace index behind it anyway.
- [ ] Per-rule configuration of the intentionally-unused convention — needs
the `lucisv.toml` `lint` key.
a `[lint.<rule>]` table. The `[lint]` table itself landed 2026-09-02
(`select`/`ignore`, plus `lucisv.lint.*` settings); the per-rule half is
still open and is now named in the config parser's error rather than
ignored.
## Work log