A path segment naming a block (bare, indexed, nested, cross-file) is now a reference to its label: vlog_semantic declares a `for` block's label in the enclosing scope, makes `generate … endgenerate` no scope, gives a block a member scope, walks an index in a path, and files blocks on a module's hierarchical surface under `module.label` (FACTS_FORMAT 21). The LSP, CLI and MCP rename/references get it through the engine; lucisv-mcp's `block` refusal is lifted. No verifier normalization (attacks in check/qa_block_paths.rs, qa_block_attacks.rs). Reworks after QA: unresolved path segments warned in every file of the set; sibling-arm members warned; a label beside a net is a duplicate-declaration; function-local block keys never collide; file names path-qualified when base names collide; rename warnings and lucisv-mcp mentions scoped to the declaration's home set (rename/home.rs, scoped.rs), falling back to unscoped on any doubt. TODO §65.4 and §65.6 filed. docs/features/generate-label-rename. Workspace lib/bins/tests: 79 suites, 5 064 passed, 0 failed, 51 ignored (guard exit 0). Co-Authored-By: Claude Opus 5.5 <[email protected]>
mcp-lean-catalogue
Lane M7 of the MCP block (TODO-MCP.md, docs/mcp/PLAN.md §10).
Goal
The census (mcp_analysis.md) found lucisv-mcp right on every run and
dearer than plain file reads on every small task: a 5 400-token catalogue
read each session, answers carrying more than the question asked, and
agents dry-running what they were told to trust. The owner's ruling is
accuracy over breadth: keep what only this server can do — the design's
hierarchy as file:line, where a name is declared and used, and the bulk
edits a file write cannot make safely — as nine tools (hierarchy,
find, outline, read, check, rename, port, edit_item,
format), a model-visible catalogue under 3 500 bytes, instructions under
400, short answers with fixed caps, no dry_run and no paging. The engines,
the write path, the M4 verifier and its attack suite, freshness, roots and
the cache are reused unchanged in substance.
Assumptions
Decisions where PLAN §10 is silent (the simplest thing, recorded):
Wire
- Annotations keep all four hints (
readOnlyHint,destructiveHint: false,idempotentHint,openWorldHint: false); hosts read them, the budget counts onlyname+description+inputSchema(compact JSON array of the nine objects,serde_json::to_string).idempotentHintistruefor the five read tools andformat,falseforrename,portandedit_item. - A range argument (
depth) is{"type": "integer"}in the schema (§10.1:typealone); the range is still enforced by validation and named in the description (1-20). requiredis always present,[]when nothing is required.- A result is
{content: [{type: text, text}], isError}— nothing else.
Rendering
- A line range is
first–last(en dash), a one-line range the single number, everywhere (outline,read,edit_item). - Counts are pluralised (
1 file,2 files), so the §10.1 forms readrenamed 1 site in 1 file,… 1 instantiation in 1 file. - Engine sentences (refusals of
vlog_refactor::{rename, add_port, remove_port, find_references},place::after, and the engine warnings a rename or port edit carries) name files by base name; the MCP layer rewrites a base name to the root-relative path when exactly one file it handed the engine has that base name (WholeSet::rooted). When two files share it the sentence is left as the engine wrote it. - Engine and write-path warnings are facts, not hints: each is one
warning: …line after the answer's first line (the skipped-file linewarning: not indexed, so not searched or edited: …, the rename engine's macro warnings,port's TODO-connection lines). - The
unresolved:block is the label, then one file per line (file:12,40), at most 50 mentions then… and N more— the kinds (string, comment, macro, define, path) and the line text are gone, per "the same way" in §10.1.
hierarchy
- Without
rootit walks the roots first (the successor ofproject_overview, which always walked), thenN files, M modules, K top;McountsModule-kind units (programs included),Kand the list are every module nothing instantiates, one line per declaration (a module declared in two files is two tops at their two lines). - Down: the root line
module file:line(its declaration) is kept at indent 0, instances at two spaces per level. Each instance'sfile:lineis the line of the instance name (the old tool's site line). A module declared twice is still two root lines. - Up: no root line; level 1 at indent 0, deeper levels two spaces each;
walked once by name (a root declared twice is not repeated). An
uninstantiated root answers
nothing instantiates X. - The notes stay as suffixes:
(recursive),(not indexed),(declared N times). peeklines are the statement from the start of the line naming the module to the end of the line holding its;, the common indentation removed, indented four spaces past the node's line, at most 12 lines then…. Nothing is shown when the file no longer spells the module there.- The cap is 300 nodes (instance lines, a root line included) without
peekand 100 nodes with it, down and up alike;peeklines never count toward it, and a peek block is never split.… and N morecounts the nodes not shown. (Was a 300-line cap until 2026-09-29, which withpeekshowed as few as 23 instances.) The 50 000-node walk cap stays, so on a cut walkNis a lower bound. - Unknown root: up to 10 module/interface names containing it, any case.
find
- Declarations are the index's units, exported members and module
internals (
hierarchical_declarations), each checked against the bytes on disk, sorted by file and line; then`defines (macro NAME file:line,`undefomitted). Aprogramsaysprogram. unit.name/pkg::name(not in §10.1, which givesfindno way to pick one of many declarations): the member of that unit only (member_in(..., Surface::Hierarchical)); an escaped identifier is never split.renameaccepts it too. Found necessary on opentitan, wherestate_qhas hundreds of declarations.refswalks the roots once first (the whole set must be complete), then runsfind_references(declaration excluded) per declaration — at most 5 declarations (REFS_CAP): each is a whole-set engine run (≈ 2 s on opentitan), so a name declared more often gets a closing lineuses listed for 5 of N declarations. Macros have no uses listed (no engine follows them). An engine refusal isuses not listed: …, reworded so it never speaks of renaming.- Besides the index, every declaration the files' own symbol tables hold
is found (
declared.rs): the files whose word census holds the name are read from disk and analysed, and each symbol of that name is a declaration (typedefs, enum values, functions, tasks, genvars, generate blocks and what they declare, procedural locals).unit.namekeeps those whose innermost enclosing module, interface, package or class isunit. An escaped identifier is not in the word census (it holds plain identifiers only), so an escaped local name the index does not record — a function's\loc.v, say — is not found by name (QA re-check R2, accepted;outlineandreadwithfilestill reach it). - No declaration:
no declaration named X; similar: …— up to 20 names containing it, any case, from the same table (declared.rswith a part of a name, plusworkspace_symbolsfor escaped names) and the define tables. A short part reads most files (≈ 1–2 s on opentitan, refusal path only).
outline, read, check
outline unit:first line is the unit'sfile:linealone; thenparam NAME = DEFAULT(param NAMEwithout one), portsdir type [range] name [unpacked]with empty parts left out,modport …lines, and for packages and classesextends BASEandkind name LINE. A unit declared twice is refused listing both (the file outline is the way to pick one); via thelucisv://unit/resource the sentence points at the file outline resource instead.outline file:parse errors areerror LINE: message(the column is incheck).readwithoutfilelooks the name up among the index's declarations, counts matching declarations (kind and@LINEhonoured) in each file, and needs exactly one;always@LINEand friends needfile.checksorts stably by severity (error, warning, rest), so a file's parse errors lead and each file keeps its order within a severity; the message is collapsed to one line;rules,severityandinare gone.
Edits
rename:namemay bename@LINE(withfile, picks one of two declarations in one file) orunit.name. A name already equal tonew_nameanswersrenamed 0 sites in 0 files.N sitesis the engine's edit count,M filesthe files written.renamerefuses everyblock-kind declaration (the symbol table's kind for a generate block label, and for a namedbegin : labeltoo): no engine rewrites or reports a hierarchical path through a block. 2026-09-30 (TODO §65.1): lifted. The engine now treats a path segment naming a block as a reference to its label (g_lane[0].lane_q,u_x.g_lane[1].sig, the closingend : g_lane), sorenameof ablockdeclaration is complete and is performed like any other;qa_m7.rsasserts it (docs/features/generate-label-rename).port: the module is found bymodule_definition(exactly one declaring file).removefinds the port by name in the module's own scope in that file.N instantiations in K filesis the index's census of the module's instances before the edit (every instance the engine visits), not the files written.edit_item:itemis the anchor for inserts.replacerefuses a text declaring other names (norenameflag) and points atrename; the no-op answersunchanged CLASS NAMES file:lines.deletehas noforce: a used item, a nested`define, a fence stay refusals. The answer's lines are the new item's (replace/insert) or the removed lines (delete).rewalk: true(a delete needs the complete set).format:filesis a path (resolved as every path argument), else a directory or glob matched against every indexed file's root-relative path (glob.rs, the oldinmatcher).formatted N files (M unchanged):Ncounts every file that passed the safety net,Mthose already formatted. A refused file is onenot formatted: FILE (why)line and the rest are still written (all-or-nothing among them); when every file is refused the call is a refusal.fixruns the safe fixes (the CLI's--fixfilter, fences honoured, parse-error guard), then formats.- There is no dry run anywhere:
apply::runchecks roots and freshness, then writes, and returns which files it wrote.
The verifier
Expect::Nothing { force }becameExpect::Nothingand the forced path (droppedmacros) was removed fromtools/item/verify.rs: dead onceforceleft the wire, and it was a relaxation — removing it can only refuse more (CLAUDE.md invariant 4 is about widening). Every other rule is byte-identical;tests/attacks.rspasses with its cases as written (a call translator maps them; the three forced cases became refusals).
Handshakes
Consumed (unchanged): vlog_refactor::{rename, add_port, remove_port, find_references, instantiation_plan, module_definition, enclosing_module},
vlog_semantic::WorkspaceIndex (units, member_in, members_of,
workspace_symbols, hierarchical_declarations, find_define, defines,
instantiations, instantiations_of, instantiable_units, units_of),
the linter and formatter entry points diagnostics.rs/format.rs used
before. No longer consumed: lucisv_core::diff::unified,
vlog_formatter::format_range, the six cursor refactorings.
Promised: the spawn contract with the extension is amended — tools/list
is exactly the nine names in order (editors/vscode/mcp_smoke.js
TOOLS, was MIN_TOOLS = 26); docs/topo.md §2.8 updated.
Requests (not edits):
- MCP-11 →
vlog_refactor:find_referencesover several declarations in oneScope(one index build), sofind refsneed not cap at 5 declarations. Today each declaration is a full build. - MCP-14 →
vlog_refactor/vlog_semantic(topo §2.9 row 43): a rename of a generate block label leaves hierarchical paths through it (g_lane[0].lane_q) unrewritten, andfind_referencesdoes not report them; the MCP layer refuses the rename (anyblock-kind declaration); the LSP still allows it. Closed 2026-09-30 by TODO §65.1 (docs/features/generate-label-rename); the MCP refusal is removed fromtools/edit.rs. - MCP-13 → release/docs owners (outside this lane's files):
tools/release.sh(comments at lines 134 and 257),tools/RELEASING.md:129("at least 26 tools, oneproject_overview") anddocs/manual-acceptance.mdrows 19 and 24 ("call lucisv's project_overview") name the old catalogue; the smoke gate itself (mcp_smoke.js) is updated. They should say nine tools andhierarchy. - MCP-12 → lead: PLAN §10.3's instruction text is 444 bytes against its own 400-byte budget; the shipped text (398 bytes) is a tightening of it (below). Rule on the wording.
Status / TODO
- registry: nine tools in order, no
title/structuredContent, no per-argument descriptions;wire.rspins names, order, budgets and the absence ofdry_run,limit,offset,in,template,overrides,force hierarchy(no root, down, up, peek, cap, near matches); opentitan instance set identical to 0.57.0 (tests/opentitan.rs)find(declarations, macros,refs,unresolved:, near matches)outline(filexorunit),read(design-wide),check(ok; 0.57.0 line set on every fixture)rename,port,edit_item,format- instructions ≤ 400 bytes; resources render through
hierarchyandoutline - tests ported or deleted (below); invariants kept
- docs: this README, Agents guide table + promises, extension
README/CHANGELOG,
CHANGELOG.md0.58.0, topo §2.8, PLAN §4.3/§4.5 marked superseded - QA (2026-09-24: PASS with findings — QA log)
- census round 4 (lead), release 0.58.0
Work log
2026-09-23 — dev (M7)
Byte figures (release binary, tools/list over the design fixture):
model-visible catalogue 3 440 bytes (was 17 900 for tools/list);
instructions 398 bytes. Per tool (compact name+description+schema):
hierarchy 433, find 362, outline 345, read 357, check 294,
rename 395, port 404, edit_item 482, format 358.
Instructions shipped (§10.3's text is 444 bytes; tightened, same facts): "lucisv-mcp reads the SystemVerilog on disk (save first). Use it before reading files: hierarchy for instance trees and top modules, find for a name's declarations and uses, outline for a file or unit's ports, read for one item, check after edits. Edits (rename, port, edit_item, format) are verified, all-or-nothing writes: trust them as file writes, no dry run. Paths root-relative, lines 1-based."
Code. tools/mod.rs holds the nine; Answer is {text}; Param has
no description; Ty::Int gone. New: find.rs, names.rs (declarations
by name, near matches, unit.name), outline.rs, port.rs, glob.rs
(moved from read.rs). Rewritten: hierarchy.rs, read.rs (the read
tool; the slicer stays read_item.rs), interface.rs (outline's unit
half), diagnostics.rs (check), edit.rs (rename + the shared
whole-set/write/mentions step), item.rs (edit_item), format.rs,
apply.rs (no dry run, no diff, returns Written), render.rs (caps,
by_file, counts), mentions.rs (the unresolved: block), source.rs.
Deleted: defines.rs (macros are find declarations), select.rs
(position selectors; name-based now), nav.rs (→ find.rs/names.rs),
refactor.rs (add_port → port.rs; extract_module, instantiate
dropped). Dead project/analysis helpers removed. All files under 460 lines.
Differential. Built v0.57.0 (git archive into scratch) and
compared: check line sets identical on all six fixtures and on five
opentitan files; hierarchy top_earlgrey identical at depth 1 (2) and 2
(49 instances), depth 3 identical over the 299 lines shown (464 in all);
hierarchy prim_fifo_sync up identical (77). The r4 eval binary reports
0.56.0 and agrees too. The depth-2 set is pinned in tests/opentitan.rs.
Opentitan timings (release): startup 2.1 s cold / 0.9 s warm; find aes.entropy_masking_req refs 2.1 s; find aes refs (5 declarations)
9.4 s; hierarchy top_earlgrey depth 2 0.4 s; the checkout's git status
unchanged by every run.
Tests (347 pass, 3 ignored opentitan pass with --ignored):
| suite | before → after | what happened |
|---|---|---|
unit (src) |
77 → 72 | paging/table/in/check-line/overrides/defines unit tests deleted with their code; glob tests moved; qualified, count, by_file, instructions-budget tests added |
attacks.rs |
23 → 23 | unchanged cases through a lean call translator; rename: true variant dropped (the refusal was the same); the three force controls are now asserted refusals |
wire.rs |
57 → 40 | rewritten per tool; budgets, names/order, bare schemas, text-only results pinned |
qa_m1.rs |
51 → 48 | list_units freshness checks → find hits / hierarchy walks; deleted: list_units glob ? (covered by glob.rs), outline depth/limit/offset, search_symbols empty query |
qa_m2.rs |
43 → 35 | references/definition → find refs; deleted: position-selector attacks (whitespace/keyword/column/byte-column/macro-argument positions, findings 2, 3, 8, 9-by-position), paging, rules/severity filters, defines table shape, overrides JSON |
qa_m3.rs |
33 → 31 | edit tools → rename/port/edit_item/format; deleted: cursor refactorings, extract_module paths and CRLF (finding 3), instantiate (finding 5), lines ranges, dry_run diff checks; the references-vs-warning sweep now sweeps find |
qa_m4.rs |
45 → 45 | unchanged cases through a translator; forced deletes are refusals; dry-run diffs → real writes |
qa_m6.rs |
17 → 17 | probes and instructions ported; forced-delete pair → refusal + plain delete |
qa_f1.rs |
23 → 21 | add_port → port; mentions read from the unresolved: block; deleted: the dry-run-diff-equals-write test and QA finding 6 (dry-run mention lines) |
qa_f2.rs |
14 → 6 | paging, count lines, in on every tool and the check line deleted; kept the hierarchy walk over the tree and the path glob (now format's) |
qa_f3.rs |
7 → deleted | template and overrides are gone; the flag-type refusals are covered in wire.rs/qa_m3.rs |
cache.rs |
4 → 4 | tool names |
opentitan.rs |
2 → 3 | find/hierarchy/check; the whole-set timing is find refs (read-only; the old dry-run rename would now write); new 0.57.0 instance-set test |
Kept invariants, with their tests: verifier attacks (attacks.rs,
qa_m4.rs), all-or-nothing writes (apply.rs unit tests, qa_m3.rs
commit tests, the racing-writer test), roots (wire.rs, qa_m1.rs,
qa_m3.rs::qa_rewritten_paths_never_leave_the_root), freshness (qa_m1.rs
freshness section, wire.rs::answers_follow_the_disk_between_calls), cache
read-only (cache.rs, qa_m6.rs), unresolved mentions on rename/find/
port (wire.rs, qa_f1.rs), rename over .name/.* (qa_m3.rs
finding 1, qa_f1.rs star binding).
Deviations from §10. Instructions text tightened to fit 400 bytes
(MCP-12). find/rename accept unit.name. find refs caps at 5
declarations. format answers not formatted: FILE (why) lines and is a
refusal only when every file is refused. The hierarchy root line is kept
for down. verify.rs lost its dead forced path.
2026-09-24 — dev (M7 rework after QA)
- Finding 1 (every declaration by name). New
tools/declared.rs: the files whose word census holds the name are read and analysed, and every symbol of that name in their own tables is a declaration, merged (by file and offset) with the index's.find,readwithoutfileandrenamenow reach typedefs, enum values, functions, tasks, genvars, generate blocks and their contents, and procedural locals;unit.namefilters by the enclosing unit.renamehands the declaration's file and offset tovlog_refactor::renameexactly as before (no new rename). Repro fixed:rename {"name":"StIdle","new_name":"StRest","file":"rtl/fsm.sv"}→renamed 2 sites in 1 file. Opentitan:find clk_i+find StIdle+ a miss, with the index build, 3.1 s; census timings unchanged (find aes refs8.4 s,aes.entropy_masking_req1.9 s). - Finding 2 (near matches).
similarreads the same table with a part of a name (Wanted::Containing).qa_m2near-match expectation updated (similar: sig, sig2—sig2is a module internalfindlists). - Finding 4 (peek blank line). A blank line of a peeked statement is an empty line — no indent; every other line exact. QA's pinned test asserted no empty line at all, which contradicts the ruling; its assertion now forbids whitespace-only lines and checks the empty one (the test name already said "whitespace-only").
- Finding 3 (root-relative files).
WholeSet::rootedrewrites a base file name in an engine sentence to the root-relative path when exactly one file of the set has it; applied torename,port(engine andplace::afterrefusals), the engine warnings of both, andfind'suses not listed. Testwire.rs::engine_sentences_name_files_root_relative(and a unit test of the whole-word replacement). The MCP-built lines were root-relative already. - Findings 5 and 6: no change (lead's ruling).
- Catalogue unchanged: 3 440 bytes; instructions 398.
2026-09-24 — dev (M7 rework 2)
- R1:
renameof ablock-kind declaration is refused with the lead's sentence before any engine runs; QA's pinned test un-ignored, its assertion now requires the refusal and an untouched source. Topo §2.9 row 43 (MCP-14) and a Handshakes line added. - R2: accepted; the Assumptions sentence on escaped local names made exact; the pinned test stays ignored with its reason. R3: no change.
- Catalogue 3 440 bytes, instructions 398 (unchanged).
2026-09-29 — dev (M8 rework 2: the hierarchy cap counts instances)
- Census round 5 found
hierarchy {"root":"prim_fifo_sync","up":true, "peek":true}on the OpenTitan clone cut to 20 of 77 instantiations by the 300-line cap. Lead ruling: the cap counts nodes, never peek lines.hierarchy.rsrender_nodesnow stops at the 300th node; withoutpeekthe answer is byte-identical (one line per node).qa_m7.rs's caps test updated (root + 400 with peek: 599 lines shown,… and 101 more); newtests/hierarchy_cap.rs(30 fourteen-line instantiations, up + peek: all 30; 350 instantiations with peek: 300 shown,… and 50 moreup,… and 51 moredown). Descriptions and byte budgets unchanged. PLAN §10.1's row amended.
2026-09-29 — dev (M8 rework 3: 100 instances with peek)
- QA finding 6 (M8): with the node cap alone a peeked answer reached
150 kB (
top_earlgreydepth 3, 3 759 lines). Lead ruling: 300 nodes withoutpeek, 100 with it (CAP,PEEK_CAPinhierarchy.rs); everything else from rework 2 stands. Tests:hierarchy_cap.rs(350 instantiations with peek: 100 shown,… and 250 moreup,… and 251 moredown; without peek 300 and 50/51),qa_m7.rscaps test (root + 400 with peek: 199 lines, then… and 301 more), QA'sqa_m8.rsboundary test renamedqa_the_node_cap_is_exact_at_300_and_301_plain_and_100_and_101_with_peekwith 100/101-node fixtures added. PLAN §10.1's row amended again.
QA log
2026-09-24 — QA (M7)
Verdict: PASS with findings. Every attack in the TODO M7 QA box held; no corruption, no partial write, no invariant broken. Finding 1 is a capability regression against 0.57.0 the lead should rule on before the 0.58.0 release.
Gates. cargo fmt --all clean; cargo clippy --all-targets -p lucisv_mcp clean; tools/guard.sh -t 1500 -- cargo test -p lucisv_mcp
356 passed, 6 ignored (3 opentitan, 3 QA findings pinned below) —
the dev's 347 + 9 new in tests/qa_m7.rs.
What was verified, and how.
- Byte budget.
wire.rs::tools_list_is_the_nine_tools_in_order_within_the_byte_budgetmeasuresserde_json::to_stringof{name, description, inputSchema}for all nine; an external measure (Python, compact, UTF-8) gives the same 3 440. Mutation:format's description +57 bytes (3 497) passes, +76 (3 516) fails atwire.rs:211"the model-visible catalogue is 3516 bytes"; reverted,cmpidentical. Instructions 398 bytes, also pinned inrpc.rs::the_instructions_stay_under_400_bytes. - Caps (400 instances, 350 ports + 320 nets, 320 declarations of
sig):hierarchydown (… and 101 more), up (100), down+peek (whole blocks, 251), no root (23),find(20),outline unit(51) andfile(371),check(200 lines, 120 more) — each exactly one cut line, counts right, every line before it whole. On the eval clonehierarchy prim_fifo_sync up depth 20says… and 22588 more= the old tool's 22 888 − 300. - Ambiguity:
read/renameof a name in two files refuse listing bothfile:lineand what picks one;unit.namepicks withoutfile; unknownfind/hierarchy rootlist contains-matches (but see finding 2). - peek: a statement with
#(…)over two lines,//and/* */comments holding;, a tab-indented.*line, a two-instance statement and a 16-line statement: exact text (common indent removed), the 12-line cut ends…, exactly 12 lines is not cut. - port:
aftera non-existent port, both / neither of add/remove,afterwithremove,removeof a port the body uses, an unknown module — all refused, tree byte-identical.addon a module instantiated 3× in 2 files (named,.nameshorthand,.*) connected each (.*gets its warning); with a positional instantiation in a third file the whole edit is refused and nothing is written. - edit_item: delete of a used signal and a called function refused with
file:line:colsites;replacethat changes the name refused pointing atrename;insert_after end@nlands beforeendmoduleofn;end@noperefused.tests/attacks.rsdiffed against HEAD: 23 tests, 62 → 63refused((the three forced deletes became refusals), 24 → 22accepted((the two forced ones); theleantranslator only renames tools/arguments; the one dropped case isrename: true(argument gone).verify.rsdiff only removes the forced relaxation.qa_m4.rs: 45 tests kept, the removed assertions are dry-run diffs and forced deletes. - format: a glob matching nothing refused (
nothing written); one unparsable file among four: the other three written, onenot formatted: rtl/bad.sv (…)line, the bad file untouched; the refused file alone is a refusal. A non-UTF-8 file is not indexed, so a glob skips it. - Differential against the r4 binary on the eval clone:
hierarchy top_earlgrey depth 2— 49 instances, same tree (the old one had no sites; all 49 newfile:linechecked to spell the instance);hierarchy prim_fifo_sync up— first 300 identical, same total;checkvsdiagnosticsonearlgrey_pd_main.sv(10 findings),uart.sv,prim_fifo_sync.sv,i2c_fifos.sv,uart_core.sv,aes_core.sv,cheriot_tag_filter.sv— identical line sets; whole design 2 101 both;find prim_fifo_sync refsvsreferences— 78 uses = the old 79 hits minus the declaration itself,unresolved:29 sites = the old 29. The clone'sgit statuswas clean after every run. - Answer shape: every read tool over the six fixtures plus the attack trees — no absolute path, no hint line, no trailing whitespace, no blank line except finding 4; refusals are one sentence.
- Invariants: freshness (
qa_m1,wire), roots (wire,qa_m1,qa_m3), cache read-only (cache,qa_m6), all-or-nothing (apply.rsunits,qa_m3) all pass. Manual:rename subover three files withrtl/p2.svchmod 444 →`rtl/p2.sv` is read-only; nothing written.andp1.sv(written first in path order) untouched; pinned asqa_a_rename_whose_later_file_is_read_only_writes_nothing.
Findings (pinned ones are #[ignore = "QA finding N"] in
tests/qa_m7.rs, asserting the correct behaviour):
- Medium — name lookup cannot reach module-local declarations other
than ports, parameters, nets, variables and top-level instances.
names.rs:88defs_namedreads units, exported members andhierarchical_declarations; a module'stypedef, enum values, functions, tasks, genvars, generate blocks and everything inside them, and procedural locals are in none.outlinelists them andreadwithfileslices them, butfind,readwithoutfileandrenameanswerno declaration named X— withfiletoo. 0.57.0 renamed them by position (checked: the r4 binary renamesStIdleviafile/line/col), so an FSM state rename is no longer possible through MCP. Repro:rtl/fsm.sv=module fsm; typedef enum logic [1:0] {StIdle, StBusy} state_e; …thenrename {"name":"StIdle", "new_name":"StRest","file":"rtl/fsm.sv"}→ refused. Pinned:qa_find_and_rename_reach_every_declaration_outline_lists. A likely remedy: withfile, fall back to the file's own semantics (asread's slicer does) for the offset handed tovlog_refactor::rename. - Low — near matches omit module internals.
names.rs:165similarreadsworkspace_symbols(units and exported members) and the define tables, not the module internalsfindlists. Repro:logic mid;in a module,find {"name":"mi"}→no declaration namedmi.with nosimilar; on the eval clonefind rx_fifo_rvalisuggests onlyrx_fifo_rvalid_oalthoughfind rx_fifo_rvalidlists 3 declarations. Pinned:qa_find_near_matches_include_the_module_internals_find_lists. - Low — engine sentences name files by basename, not root-relative
(§10.2).
portrefusalswould not leave p3.sv with the signature…,still used insidesubat sub.sv:6;portwarningsatu_s(p1.sv:2);renamerefusal`u_b` at top.sv:16 connects with `.*`. The sentences come fromvlog_refactorunchanged (so 0.57.0 said the same); ambiguous when two directories share a basename. Not pinned. - Low —
peekanswers a whitespace-only line for a blank line inside an instantiation statement (hierarchy.rs:284indents every source line,statementathierarchy.rs:328keeps blank ones):" "in the answer, against §10.2 "no blank lines". Exactness vs the rule is the lead's call. Pinned:qa_peek_never_answers_a_whitespace_only_line. - Cosmetic — four descriptions are two sentences (
hierarchy,read,rename,format) where §10.1 says "the one-sentence tool description". Not pinned; merging them costs no bytes. - Info —
port addthenport removeof the same port is refused when the add left/* TODO: connect */(comments are never dropped), so the pair is not an undo. Safe; engine behaviour, noted for the agent guide.
Fixed directly: nothing in production code.
Tests added (crates/lucisv_mcp/tests/qa_m7.rs, 9 + 3 ignored):
caps with counts, peek exactness and the 12-line cut, ambiguity and
unknown-name refusals, port shapes and all-or-nothing across files,
edit_item delete/replace/end@UNIT, format partial and empty glob,
read-only all-or-nothing, answer shape, find refs five-declaration line.
2026-09-24 — QA re-check (M7 rework)
Verdict: PASS with findings. Findings 1–4 are fixed and their pinned
tests pass un-ignored. The rework opens a gap that was already in the
engine but is now reachable by name with no dry run (R1). Gates: fmt and
clippy clean; tools/guard.sh -t 1500 -- cargo test -p lucisv_mcp
365 passed, 5 ignored (3 opentitan, R1, R2).
- (a) Declarations local to a module — typedef, enum value, function,
function-local, task, genvar, generate block, generate-local and
procedural local:
findandfind unit.nameanswer each;renameby name, withfileand withfsm.namerewrites every use and leaves no old name behind, except for the generate label (R1).read hl/read tmp/read gireturn only the name's bytes — 0.57.0'sread_itemdid the same (the slicer never changed), so this is noted, not a finding. - (b)
rtl/x/p1.svandrtl/y/p1.svboth declaredup:renamewithoutfilelists both root-relative paths, and withfilerenames only the right file. Engine sentences keep the barep1.sv(two files have that name) and rewritep1b.svtortl/z/p1b.sv:3. No sub-string damage. - (c) A package enum value used in
casearms in two files, plain andpkg:::find refslistsrtl/a.sv:7,11andrtl/b.sv:6;renameanswersrenamed 4 sites in 3 filesand lists the comment and string mentions asunresolved:. - (d) A name that appears only in a comment or string gets
no declaration namedwith no similar names;StRusuggestsStRun. - (e) The escaped net
\my.sigis still found, with its uses and renamed across a hierarchical reference. See R2 for escaped locals. - (f) The eval clone has no
StIdleinentropy_src_main_sm(its state isIdle, from a package).find StIdlelists 35 enum values (1.96 s).rename StIdle file ip/hmac/rtl/hmac_core.svgivesrenamed 7 sites in 1 file; all 7 spellings changed, no other file was touched, and it took 13.8 s. The 20 warnings about macro arguments belong to other modules'StIdleand match what 0.57.0 printed for a position-based rename. Restored withgit checkout; the clone's status is clean. - (g) The only
tests/files changed since the first QA run areqa_m7.rs,qa_m2.rsandwire.rs.qa_m7.rs: every assertion is intact except the three un-ignores and the finding-4 assertion (the ruling's reading).qa_m2.rs: thesimilar: sig, sig2.expectation.wire.rs: one new test,engine_sentences_name_files_root_relative(test count 40 → 41). - (h) Timing on the eval clone (release build;
hierarchy {}takes 2.03 s, which is the startup):find clk_i(a hit) 2.62 s; missesclk_x1.84 s,rst_2.87 s (about 2 131 files hold a word containing it, andsimilarindeclared.rsparses them all),zzzz1.86 s,q_2.93 s (about 1 693 files); a hit on the commondattakes 1.83 s. Every miss is well under 10 s, so there is no finding here.
Findings.
- R1 — Medium (code-breaking rename, no warning). Renaming a
generate block label leaves a hierarchical path through the block
unchanged.
rename {"name":"g_lane","new_name":"g_ln"}onfor (…) begin : g_lane … endplusbusy = tmp | g_lane[0].lane_q;answersrenamed 1 site in 1 file. Line 19 still saysg_lane[0], which is now undeclared. The answer has no warning and nounresolved:line, andfind g_lane refslists no uses. Yetedit_item delete g_lanerefuses, citingrtl/fsm.sv:19:18. The engine (vlog_refactor::rename) did the same by position in 0.57.0, butdeclared.rsnow makes generate labels reachable by name, and the instructions say to trust edits. Remedy for the lead to rule on: refuse ablock-kind rename, or have the engine warn the way it does forlane_q's tail. Pinned:qa_rework_renaming_a_generate_label_never_leaves_a_path_through_it_behind. - R2 — Low. Escaped local names are not found.
declared.rs:35(in_census) checks the word census, which holds identifier-shaped words only, so a file is never opened for\loc.v(a function-local) or an escaped enum value. The dev records this as an assumption (under find: escaped names are found "through the index only"), so it is known, butoutlinelists them, butfind,renameandreadwithoutfileanswerno declaration. Pinned:qa_rework_an_escaped_local_outline_lists_is_found. - R3 — Cosmetic.
find e.\my.sigis refused becausequalified(names.rs:44) splits on the.inside the escaped member.find mydoes not suggest\my.sig. Not pinned.
Tests added (tests/qa_m7.rs, 4 + 2 ignored):
qa_rework_every_local_kind_is_found_and_renamed_by_name_file_and_unit,
qa_rework_a_shared_base_name_is_named_by_path_or_left_alone,
qa_rework_an_enum_value_in_case_arms_is_renamed_across_files_with_its_mentions,
qa_rework_an_escaped_net_is_still_found_through_the_index; R1 and R2
pinned.
Review
2026-09-24 (lead). Examined the diff (51 files, +2 649/−7 620), the
registry, declared.rs/names.rs, the QA logs and the live answers on
the fixture design and the eval clone. Accepted. The catalogue is
3 440 bytes for nine tools (was 17.9 kB for 26), instructions 398 bytes,
answers one line per fact with fixed caps. Rulings: MCP-12 — the shipped
398-byte instructions stand, PLAN §10.3 is amended to them; finding 4 — a
blank line inside a peeked statement is an empty line; R1 — rename of a
block-kind declaration is refused in the MCP layer and the engine gap is
filed as topo §2.9 row 43 (MCP-14) for the LSP/CLI; R2 accepted as an
assumption; MCP-13 fixed by the lead (release script comments,
RELEASING.md, manual-acceptance rows 19/24). Deviations from §10 accepted:
qualified unit.name/pkg::name, the 5-declaration cap on find refs
(MCP-11 filed), per-file format refusals, the root line on hierarchy
down. Gates at commit: lucisv_mcp 366 passed / 4 ignored, workspace 4 922
passed / 0 failed. Census round 4 follows on this binary.