MCP feedback-3: the instantiation template and hierarchy overrides are opt-in; census round 3 and the verdict written; 0.57.0 notes drafted
ci / checks (push) Successful in 1m28s
ci / corpus (push) Successful in 32s

Round 3 of the census (mcp_analysis.md): with feedback-1/2 the whole-design question is one call and 15 % cheaper than plain file tools (47/47 in 9 calls); the small edits stay 4–19 % dearer; the cross-file rename is complete every time; a 71-instance hierarchy question costs a third of the tool calls but the same tokens because every unit_interface answer carried a 30-line template. Verdict: helpful, not a toy — no wrong answer in 20 runs, one-call whole-design answers, completeness on cross-file edits, verified writes — with a fixed catalogue tax and verbose answers as the cost. Feedback-3 (crates/lucisv_mcp/src/tools/{interface,hierarchy}.rs): `unit_interface` renders the template only with `template: true` (−40 % bytes), `hierarchy` renders `#(…)` only with `overrides: true` (−55…66 %), `ports (N):`/`parameters (N):` headers; QA proved the opt-in output byte-identical to the previous binary over every fixture and the opentitan clone. Docs: the Agents guide's tool table regenerated from the binary and the site rebuilt; CHANGELOG 0.57.0 section and the extension notes drafted for the closing release; TODO-MCP's M6 items closed; docs/mcp/census-runs.txt holds the raw run log. Gates through tools/guard.sh: fmt, clippy, workspace 4 953 passed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5.1 committed 2026-09-23 22:53:18 -07:00
1 parent c2e42b8840
commit 2954ae8a84
29 files changed
+1128 -113

No files matched your search

+298
View File
@@ -0,0 +1,298 @@
# mcp-feedback-3
Lane **feedback-3** of the MCP block, the last census lane: the changes the
third token-census round asked for (`mcp_analysis.md`, Round 3 →
Observations and "Still to do"). Tracked in `TODO-MCP.md` → "Feedback
rounds".
## Goal
Round 3's task d (the `entropy_src` instance tree with 20 port counts) came
out at +4 % tokens with a third of the tool calls. Most of the server's
overhead there was twenty `unit_interface` answers, each carrying a
30-line instantiation template the task never used. `hierarchy` lines had
the same problem: every line carried the instance's `#( … )` overrides,
which a census rarely reads. This lane makes both **opt-in**:
`unit_interface` gains `template` and `hierarchy` gains `overrides`, both
default false. The JSON of `hierarchy` keeps `overrides` on every node,
because it costs little there. `unit_interface`'s section headers now carry
their counts (`parameters (6):`, `ports (12):`), so a port count can be
read without counting lines.
## Assumptions
- **`unit_interface` without `template`** (or with `template: false`):
the text is the head line, `parameters (N):` (if any), `ports (N):` (if
any), `modports:` (if any), then the `warning:` lines. There is no
`template:` section. The JSON has no `template` key at all (not `null`).
**With `template: true`** the text ends with `template:` and the
rendered plan, and the JSON has `template` as before. Otherwise the
JSON is identical key for key (pinned by a wire test). The plan is
still built either way: ports and parameters come from it. Only the
`render` step is skipped.
- **Packages and classes** take the `template` flag and ignore it: they
have no template. The member answer is unchanged, and its `members:`
header gets no count, because the brief named only ports and
parameters.
- **`modports:`** keeps its header without a count, for the same reason.
- **`hierarchy` without `overrides`**: each line is exactly the old line
without the ` #( … )` segment: `instance : module` (`down`),
`parent.instance file:line` (`up`), and root lines as before. A note
(`(recursive)`, `(not indexed)`, `(declared N times)`) still ends the
line. **With `overrides: true`** the line is byte-identical to the old
default, capped at `OVERRIDES_CAP` (200) as before. The JSON is the same
with or without the flag: `overrides` is on every node (`null` where the
site has none).
- The brief wrote the `up` line as "`instance : module file:line`". The
line has been `parent.instance file:line` since M2, and the brief also
says "exactly as today minus the overrides". I kept today's shape.
- **Census task a** asks for "both params on every row", so it now needs
`overrides: true`. The `hierarchy` parameter description and
`INSTRUCTIONS` both say so. A re-run of task a should be read with this
in mind.
## Handshakes
- **Consumed:** unchanged: `instantiation_plan` and `InstantiationPlan::render`
(`vlog_refactor`), `Args::flag` (`tools/mod.rs`).
- **Promised, changed (answer shapes):**
- `unit_interface`'s default text no longer ends with `template:`, and
its default JSON has no `template` key. Its headers read
`parameters (N):` / `ports (N):`. A new optional boolean argument,
`template`.
- `hierarchy`'s default text lines drop the `#( … )` segment. There is a
new optional boolean argument, `overrides`. The JSON is unchanged.
- The resources (`lucisv://…`) do not call either tool; nothing else in
the crate consumes these texts.
- **Out-of-ownership edit (flagged for the lead's ruling):**
`crates/lucisv_mcp/src/tools/edit.rs:30`. The shared `DRY_RUN`
parameter description changed from "Return the diff only." to "Diff
only.". The two new parameters took `tools/list` to 18 273 B. Trimming
every description in this lane's files as far as it would go, without
losing meaning, got it to 18 074 B, still over the 18 000 B pinned by
`the_tool_catalogue_stays_under_18_kb` and
`qa_the_catalogue_is_small_fully_described_and_spec_shaped`. `dry_run`
appears 14 times, so this one edit saves 154 B. The catalogue is now
**17 943 B**. The brief allowed "trim a description if needed" and did
not say whose. To revert: restore the string and trim ~75 B elsewhere.
- **Request (not done, outside ownership):** the Agents guide
`docs/site/src/content/docs/guides/agents.md:102` still promises "a
ready-to-paste instantiation" by default. Line 109 still shows
`instance : module #(overrides)` lines. Both need "on `template: true`" /
"on `overrides: true`". `docs/mcp/PLAN.md:146,263` describe the
original design and can stay as history.
## Status / TODO
- [x] `unit_interface`: `template` (Bool, default false); text and JSON
without the template by default; `parameters (N):` / `ports (N):`;
description names `template: true`
- [x] `hierarchy`: `overrides` (Bool, default false) on the text line;
JSON unchanged; description updated
- [x] `INSTRUCTIONS`: the hierarchy clause names `overrides: true` (896
characters, unchanged length). `template: true` does not fit (940
with both); the `unit_interface` description carries it
- [x] wire tests: both defaults and both opt-ins, text and JSON; existing
pins moved to the opt-in (listed in the work log); catalogue
≤ 18 000 B
- [x] measured on the eval clone (below)
- [x] QA — PASS 2026-09-23 (see QA log)
## Work log
**2026-09-23 (dev, Opus).**
- `src/tools/interface.rs`: `UNIT_INTERFACE` gains the `template` param
(l.36–41). The description is "A unit's parameters, ports (direction,
type, range), modports or members; `template: true` adds an
instantiation." The brief's "paste-ready" wording was trimmed for the
catalogue budget. The handler reads `args.flag("template", false)`
(l.67). `instantiable` takes `with_template` and renders the plan only
then (l.144). `template` is added to the JSON only when present
(l.156–157). `interface_text` takes `Option<&str>` and writes the counted
headers (l.183, l.189) and the template section only on request
(l.205). The module doc says the template is on request.
- `src/tools/hierarchy.rs`: `HIERARCHY` gains the `overrides` param
(l.81–86, "Add each `#(…)` to the text lines.").
The description no longer lists overrides: "Who instantiates a module
(`up`, with file:line) or what it instantiates (`down`, default).
Textual." `render` reads the flag (l.341) and passes it to `Line::text`,
which shows the overrides only then (l.394–400). The JSON's
`Line::json` is untouched. Trimmed for the budget: `depth` → "Default
3." (the schema's `maximum: 20` says the rest), `in` → "Path glob on
the instantiating file (`up`) or the module's (`down`), e.g.
`ip/**/rtl/*.sv`.".
- `src/rpc.rs` `INSTRUCTIONS`: "Who instantiates module X (instances,
overrides): hierarchy with direction up, not references." → "Who
instantiates module X: hierarchy direction up (overrides: true adds
#(…)), not references." (896 → 896 characters). The old clause promised
overrides in the default answer, which is no longer true. Adding
`template: true` as well measured 940 characters, so it was left out.
- `src/tools/mod.rs`: no change needed (`Ty::Bool` and `Args::flag`
already existed).
- `src/tools/edit.rs:30`: `DRY_RUN` description "Diff only." (see
Handshakes: an out-of-ownership edit, flagged).
- Tests (`tests/wire.rs`):
- New: `unit_interface_template_is_opt_in`. It checks that the default
text ends at the last port, the JSON has no `template` key, and
`template: false` equals the default. With `template: true` the
template section comes after the ports and the JSON equals the default
plus `template`. It also covers an interface's template after its
modports, the refusal of `"template": "yes"`, and a package ignoring
the flag.
- New: `hierarchy_overrides_are_opt_in_on_the_text_and_always_in_the_json`.
It checks that `up` with `overrides: true` is byte-identical to the old
default, the JSON is equal with and without the flag, `false` equals
the default, and `down` and a recursive line work with the flag. It
also covers the refusal of `"overrides": 1`.
- Existing assertions changed (they pinned the old default output):
- `wire.rs`:
- `unit_interface_answers_ports_parameters_modports_and_members`: the
header prefix now reads `parameters (2):` … `ports (4):`, and the
template assertion now asserts that `template:` is absent.
- `hierarchy_walks_down_and_up_and_terminates_on_recursion`: the
three literals (tops, `tree`, `core` up) lose their overrides. The
JSON node assertion still has `"overrides": "#( .W (8) )"`.
- `qa_m1.rs`:
- `qa_an_escaped_identifier_unit_is_listed_described_and_instantiable`
now passes `template: true`.
- `qa_a_typed_parameter_keeps_its_default_and_a_localparam_is_not_offered`
now passes `template: true` (it reads `structuredContent.template`).
- `qa_m2.rs`:
- `qa_hierarchy_terminates_on_self_and_mutual_recursion`: the `selfm`
call now passes `overrides: true`.
- `qa_finding_4_every_instance_of_one_statement_shows_only_the_overrides`:
the text `up` call now passes `overrides: true`.
- `qa_recheck_overrides_split_across_lines_and_comments_between_instances`:
both calls now pass `overrides: true`.
- `opentitan.rs` (ignored without the checkout): the `top_earlgrey`
call that asserts `u_aes : aes #(` now passes `overrides: true`.
- **Measured** on the eval clone, read-only (`target/release/lucisv-mcp
--root ~/.cache/lucisv-eval/ot/hw`, no `--index-cache`, so nothing is
written; `git status --porcelain` in the clone was empty before and
after). Bytes of `content[0].text` and of the compact
`structuredContent`:
| call | text B (lines) | JSON B |
|---|---|---|
| `unit_interface prim_fifo_sync` | **596** (21) | 1 284 |
| … `template: true` | 999 (43) | 1 710 |
| `hierarchy up prim_fifo_sync in ip/**/rtl/*.sv` (default depth 3) | **22 163** (349) | 102 939 |
| … `overrides: true` | 64 783 (349) | 102 939 |
| same, `depth: 1` (task a's 47 rows) | **3 238** (49) | — |
| … `overrides: true` | 7 230 (49) | — |
So `unit_interface` is −40 % by default (403 B saved per call; round 3's
task d made 20 such calls; the saving grows with the port count), and the
`hierarchy up` text is −66 % at depth 3 and −55 % at depth 1. The JSON
of `hierarchy` does not change. `tools/list` is 17 943 B, down from
18 273 B with the two new parameters before the trims. Catalogue at
c2e42b8: 17 993 B, per mcp-feedback-2.
- Gates (through `tools/guard.sh`, one at a time): `cargo fmt --all`
clean; `cargo clippy --all-targets` `Finished`, no warnings; `cargo
test -p lucisv_mcp` 390 passed, 0 failed, 4 ignored (wire 55 → 57);
`cargo test --workspace` **4 946 passed, 0 failed, 51 ignored**.
- Production lines (non-blank, non-comment, before `mod tests`):
`interface.rs` 334, `hierarchy.rs` 364, `mod.rs` 181, `rpc.rs` 265,
`edit.rs` 288.
## QA log
**2026-09-23 (QA) — verdict: PASS, no findings against the lane.**
Read `CLAUDE.md`, this README, `git diff` of `src/tools/{interface,hierarchy,edit}.rs`,
`src/rpc.rs` and `tests/{wire,qa_m1,qa_m2,opentitan}.rs`.
- **Baseline binary, not a re-derivation.** HEAD (c2e42b8) was exported
with `git archive HEAD` into the scratchpad (no worktree, repo untouched)
and built there (`--target-dir` in the scratchpad), so "`template: true`
/ `overrides: true` equals the old default" was checked against the old
binary's own bytes. `vlog_parser`, `vlog_refactor`, `vlog_formatter` and
`vlog_semantic` have no diff since v0.56.0, so the template renderer is
the 0.56.0 one; the 0.56.0 vsix `lucisv-mcp` agreed on every
`unit_interface` too (its `hierarchy` predates feedback-2's count line,
so only HEAD's is a valid hierarchy baseline).
- **Differential, all six fixture trees** (`tests/fixtures/*`, every unit
from `list_units`; every module `down` and `up` at depth 20): 50/50
`unit_interface` — `template: true` text = old text with only
`parameters:`/`ports:` → `(N)`; JSON = old JSON key for key; default
text = that text cut at `template:\n`; default JSON = old minus the
`template` key (absent, not `null`); counts = rows = JSON array lengths;
packages/classes identical with and without the flag. 78/78
`hierarchy` — `overrides: true` text byte-identical to the old text
(refusals too), JSON identical across old/flag/default, no default line
holds `#(`, every node has an `overrides` key.
- **Same differential on the eval clone** (`~/.cache/lucisv-eval/ot/hw`,
read-only, no `--index-cache`; `git status --porcelain` empty before and
after): 12 units (`prim_fifo_sync`, `aes`, `entropy_src`,
`top_earlgrey`, `uart`, `tl_if`, …, two declared-twice refusals
identical) and 5 hierarchy calls (`top_earlgrey` depth 2,
`prim_fifo_sync` up with `in`/depth 1, `aes` up, `entropy_src` depth 3):
all equal. Default text (characters) is 17–45 % smaller for
`unit_interface` (`tl_if` least, few ports) and 48–83 % for `hierarchy`.
- **`tests/qa_f3.rs`** (new, 7 tests, all pass), pinned against literals
the c2e42b8 binary produced on the same tree:
1. `template: true` byte-identical for an interface with modports, a
module with `ifdef`'d lists (warnings, then the template), an empty
module, multi-declarator/unpacked ports; JSON `template` = the old
section; default ends before `template:` with no `template` key.
2. a `program` is instantiable (template on request); a package's answer
is identical with `template: true`.
3. counts: `parameters (N):`/`ports (N):` = indented rows = JSON length
for 5 shapes. **Zero parameters or zero ports: the header is absent,
not `(0)`** — the pre-lane rule (an empty section is left out), and
sensible: the JSON still has `[]`, and a `(0)` header would cost
tokens to say nothing. `modports:` keeps no count; rows complete.
4. `hierarchy` `up` and `down` over an instance whose overrides exceed
the 200-char cap, one without, one with a comment inside `#(…)`:
`overrides: true` = old text (cap and `…` kept); default = each old
line minus exactly ` <capped overrides>` of that node; JSON equal
with/without flag, full uncapped overrides present.
5. default vs `overrides: true` under `limit`/`offset`, `in`, `depth: 1`
and the no-root listing: same count line, same line count, same JSON,
no `#(` in the default.
6. `"true"`, `1`, `[true]`, `{}` refused for both flags naming the field
and "true or false"; `null` is taken as the default (as for every
`Ty::Bool` flag — `Args::flag` uses `as_bool`); each flag is refused
on the other tool as an unknown argument.
7. catalogue ≤ 18 000 B (measured **17 943 B**, 57 B headroom), both
flags `boolean` and not required; `unit_interface`'s description
names `` `template: true` ``, `hierarchy`'s no longer promises `#(`;
`INSTRUCTIONS` **896 chars**, says `overrides: true`, dropped
"(instances, overrides)", names only existing tools.
- **Changed existing assertions** — every hunk read: `wire.rs` (header
prefix gains the counts and `ports (4):`, the template assertion becomes
its absence; three `hierarchy` literals lose exactly their `#(…)`
segments, the JSON node assertion is unchanged), `qa_m1.rs` (2 calls add
`template: true`), `qa_m2.rs` (4 calls add `overrides: true`, literals
unchanged), `opentitan.rs` (1 call adds `overrides: true`). Each is a
flag addition or a literal minus the overrides/template; nothing
weakened. `opentitan_navigation_matches_the_language_server` run
(`--ignored`, read-only over /Users/guoliangchen/repo/opentitan): ok,
83 s; checkout status unchanged.
- **Out-of-ownership `edit.rs:30`** (`DRY_RUN` → "Diff only."): no test or
consumer depends on the old string; meaning survives next to
`dry_run: true shows the diff first` in `INSTRUCTIONS`. Left for the
lead's ruling as flagged.
- **Size/style:** production lines `interface.rs` 334, `hierarchy.rs` 364,
`edit.rs` 288, `rpc.rs` 265; the changed functions (`instantiable`,
`interface_text`, `render`, `Line::text`) are all under 50 lines. No
`unwrap`/`expect` added to library code.
- **Gates** (through `tools/guard.sh`, one at a time): `cargo fmt --all
--check` clean; `cargo clippy --all-targets` `Finished`, no warnings;
`cargo test -p lucisv_mcp` **397 passed, 0 failed, 4 ignored** (390 +
7); `cargo test --workspace` **4 953 passed, 0 failed, 51 ignored**
(4 946 + 7).
- **Not done here (lead's list):** the Agents guide request in
Handshakes; the census re-measure of tasks a/d.
## Review
**Lead, 2026-09-23 (feedback-3).** The last census lesson was answer
weight: twenty `unit_interface` answers each carrying a template the task
never used. Both the template and the hierarchy overrides are now opt-in,
the ports and parameters headers carry their counts, and QA proved the
opt-in text byte-identical to the old output over every fixture and the
opentitan clone. The `dry_run` wording trim in `edit.rs` is accepted. The
Agents guide's tool table was regenerated from the binary by the lead.
Committed; the release binary is this one.
+2
View File
@@ -435,6 +435,8 @@ passed, 0 failed, 47 ignored**.
**2026-09-23 (dev, feedback-1).** `references` now ends with an `unresolved mentions` section and carries `unresolved_mentions` in its JSON (handshake change: a new trailing section and a new JSON key; hits unchanged); `references`/`definition`/`hierarchy` descriptions trimmed, `hierarchy` leads with "who instantiates a module" — `docs/features/mcp-feedback-1`.
**2026-09-23 (dev, feedback-3).** `hierarchy`'s text lines show the `#( … )` overrides only on `overrides: true` (handshake change: the default line drops them; the JSON keeps `overrides` on every node) — `docs/features/mcp-feedback-3`.
## QA log
**2026-09-23 (QA, M2). Verdict: rework needed** — four blocking findings
+2
View File
@@ -190,6 +190,8 @@ findings, as applied to the read tools (the transport half is in
is what makes both it and the lead's `\a@b@1` work.
- **6 — no action** (a library limit; QA's note stands).
**2026-09-23 (dev, feedback-3).** `unit_interface`'s instantiation template is opt-in (`template: true`); without it the text ends after ports/modports/warnings and the JSON has no `template` key; the headers read `parameters (N):` / `ports (N):` (handshake change: answer shape and a new argument) — `docs/features/mcp-feedback-3`.
## QA log
**2026-09-23 (QA, M1 — the six read tools).** Verdict: **rework needed**
+17
View File
@@ -0,0 +1,17 @@
r1 a base: tokens=91094 tool_calls=10 wall_s=114 outcome=correct (47/47 rows, both params on every row; line numbers cite the module line)
r1 a mcp: tokens=107605 tool_calls=14 wall_s=335 outcome=correct (47/47) — used references on the module (whole-set, ~4 s per shim call) instead of hierarchy up; read files for overrides
r1 b base: tokens=59922 tool_calls=11 wall_s=25 outcome=correct (2 files, 3 lines, style matched, diagnostics clean)
r1 b mcp: tokens=74720 tool_calls=17 wall_s=78 outcome=correct (identical diff to base; used diagnostics to check; edited by hand rather than add_port)
r1 c base: tokens=87546 tool_calls=34 wall_s=172 outcome=correct (8/8 sites incl. the DV string path; nothing else touched; diagnostics clean)
r1 c mcp: tokens=104837 tool_calls=35 wall_s=171 outcome=INCOMPLETE 7/8 (missed the DV string path in entropy_src_path_if.sv); rename warned about the macro arg, agent fixed it; found chip_if by grep
r2 a mcp: tokens=106938 tool_calls=7 wall_s=105 outcome=INCOMPLETE 35/47 — used hierarchy up (good) but paged with a small limit and missed the trailing "… and N more"; feedback: total+range up front
r2 b mcp: tokens=70136 tool_calls=18 wall_s=86 outcome=correct (identical diff)
r2 c mcp: tokens=98636 tool_calls=35 wall_s=206 outcome=correct 8/8 (the unresolved-mentions list surfaced the DV string path; rename + manual fixes)
r2 c base rerun: tokens=92625 tool_calls=30 wall_s=131 outcome=correct 8/8 (variance vs r1 base 87546: +5.8%)
r3 a mcp: tokens=77708 tool_calls=9 wall_s=72 outcome=correct 47/47 (hierarchy up + in filter; -15% tokens vs base)
r3 b mcp: tokens=70030 tool_calls=17 wall_s=79 outcome=correct (identical diff)
r3 c mcp: tokens=109650 tool_calls=40 wall_s=218 outcome=correct 8/8
r3 d base: tokens=102579 tool_calls=33 wall_s=235 outcome=correct (71 instances, 20 modules, all 20 port counts right)
r3 d mcp: tokens=106942 tool_calls=12 wall_s=305 outcome=correct (71/20, all counts); unit_interface templates x20 wasted tokens
r3 c base OPUS: tokens=61092 tool_calls=7 wall_s=44 outcome=correct 8/8
r3 c mcp OPUS: tokens=69849 tool_calls=8 wall_s=62 outcome=correct 8/8
+27 -27
View File
@@ -149,132 +149,132 @@ description. The agent sees the full description and input schema.</p>
<tr>
<td><code dir="auto">project_overview</code></td>
<td></td>
<td>Summarise the Verilog/SystemVerilog project under the roots: file count, units by kind, top-level modules (nothing instantiates them) and the largest files.</td>
<td>Files, units by kind, top modules, largest files.</td>
</tr>
<tr>
<td><code dir="auto">list_units</code></td>
<td></td>
<td>List the modules, interfaces, packages, classes and programs declared in the project with their file:line, optionally filtered by kind and a name glob (<code dir="auto">*</code>, <code dir="auto">?</code>).</td>
<td>Units (modules, interfaces, packages, classes, programs) with file:line.</td>
</tr>
<tr>
<td><code dir="auto">unit_interface</code></td>
<td></td>
<td>The interface of one unit by name: a module’s or interface’s parameters with defaults, ports in declaration order (direction, type, range) and a ready-to-paste instantiation; an interface’s modports; a package’s or class’s members.</td>
<td>A unit’s parameters, ports (direction, type, range), modports or members; <code dir="auto">template: true</code> adds an instantiation.</td>
</tr>
<tr>
<td><code dir="auto">outline</code></td>
<td></td>
<td>The declarations in one file as a tree with 1-based line ranges (units, ports, parameters, signals, functions, instances, blocks), plus its parse errors.</td>
<td>A file’s declarations as a tree with line ranges, and its parse errors.</td>
</tr>
<tr>
<td><code dir="auto">read_item</code></td>
<td></td>
<td>The exact source text and 1-based line range of one item in a file: <code dir="auto">name</code>, <code dir="auto">kind:name</code> (e.g. <code dir="auto">function:crc</code>), <code dir="auto">name@LINE</code> when a name is declared twice, or <code dir="auto">always@LINE</code> / <code dir="auto">initial@LINE</code> / <code dir="auto">final@LINE</code> / <code dir="auto">assign@LINE</code> for the unlabelled block or assignment covering that line (<code dir="auto">@LINE</code> is the last <code dir="auto">@</code> followed only by digits, so <code dir="auto">\a@b@1</code> is <code dir="auto">\a@b</code> on line 1).</td>
<td>One item’s exact source and lines.</td>
</tr>
<tr>
<td><code dir="auto">search_symbols</code></td>
<td></td>
<td>Find declarations whose name contains <code dir="auto">query</code> (case-insensitive) across the project: units, and the ports, parameters and package/class members other files can name.</td>
<td>Declarations whose name contains <code dir="auto">query</code> (any case), members included.</td>
</tr>
<tr>
<td><code dir="auto">defines</code></td>
<td></td>
<td>The `define table: name, parameters, body (on one line) and file:line — of one <code dir="auto">file</code>, of one macro <code dir="auto">name</code> across the project (every definition; which one a use sees depends on include order, so none is picked), or of the whole project.</td>
<td>The `define table (name, parameters, body, file:line) of a <code dir="auto">file</code>, a macro <code dir="auto">name</code>, or all.</td>
</tr>
<tr>
<td><code dir="auto">definition</code></td>
<td></td>
<td>Where a name is declared: every declaration site as file:line:col, its kind and the declaration’s own source line (a name declared in several places lists them all, never a guess).</td>
<td>Where a name or macro is declared: file:line:col, kind, line.</td>
</tr>
<tr>
<td><code dir="auto">references</code></td>
<td></td>
<td>Every use of one declaration across the project, grouped by file as line:col and the line’s text — the same occurrences a rename would edit.</td>
<td>Uses of one declaration, then its unresolved mentions (strings, comments, macro text).</td>
</tr>
<tr>
<td><code dir="auto">hierarchy</code></td>
<td></td>
<td>The instance tree as indented <code dir="auto">instance : module #(overrides)</code> lines, down from <code dir="auto">root</code> (default: every top-level module), or with <code dir="auto">direction: up</code> every <code dir="auto">parent.instance</code> that instantiates <code dir="auto">root</code>, with file:line.</td>
<td>Who instantiates a module (<code dir="auto">up</code>, with file:line) or what it instantiates (<code dir="auto">down</code>, default).</td>
</tr>
<tr>
<td><code dir="auto">diagnostics</code></td>
<td></td>
<td>Parse errors and lint findings for one <code dir="auto">file</code>, or for every indexed file, grouped by file as <code dir="auto">line:col severity message [rule]</code> — what <code dir="auto">lucisv check</code> over the whole tree reports (cross-file rules on), under the project’s lucisv.toml [lint] settings and waivers.</td>
<td>Parse errors and lint findings (<code dir="auto">line:col severity message [rule]</code>) of <code dir="auto">file</code> or all.</td>
</tr>
<tr>
<td><code dir="auto">format</code></td>
<td>yes</td>
<td>Format <code dir="auto">file</code> (or the comma-separated <code dir="auto">files</code>) as <code dir="auto">lucisv format</code> does, under each file’s lucisv.toml; <code dir="auto">lines</code> (<code dir="auto">12-40,55</code>, one file only) formats just the constructs meeting those lines.</td>
<td>Format <code dir="auto">file</code>/<code dir="auto">files</code> as <code dir="auto">lucisv format</code>; <code dir="auto">lines</code> limits it.</td>
</tr>
<tr>
<td><code dir="auto">fix_lint</code></td>
<td>yes</td>
<td>Apply the safe automatic fixes of the lint findings in <code dir="auto">file</code> (or the comma-separated <code dir="auto">files</code>), as <code dir="auto">lucisv check --fix</code> does: the project’s [lint] config and waivers, never inside a <code dir="auto">// lucisv: off</code> fence, never an unsafe fix.</td>
<td>Apply the safe lint fixes to <code dir="auto">file</code>/<code dir="auto">files</code>; says what remains.</td>
</tr>
<tr>
<td><code dir="auto">rename</code></td>
<td>yes</td>
<td>Rename one declaration and every reference to it across the project, verified before anything is written.</td>
<td>Rename a declaration and its uses; select as <code dir="auto">definition</code>.</td>
</tr>
<tr>
<td><code dir="auto">expand_wildcard</code></td>
<td>yes</td>
<td>Replace one instantiation’s <code dir="auto">.*</code> with the named connections it binds, verified before anything is written.</td>
<td>Replace one instance’s <code dir="auto">.*</code> with the named connections it binds.</td>
</tr>
<tr>
<td><code dir="auto">convert_ports</code></td>
<td>yes</td>
<td>Rewrite a module’s non-ANSI header (<code dir="auto">module m(a, b); input a; …</code>) as an ANSI port list, verified before anything is written.</td>
<td>Rewrite a module’s non-ANSI header as an ANSI port list.</td>
</tr>
<tr>
<td><code dir="auto">organize_imports</code></td>
<td>yes</td>
<td>Remove the unused <code dir="auto">import</code> items of the scope at a position and sort the rest, verified before anything is written.</td>
<td>Remove unused <code dir="auto">import</code>s in the scope at a position; sort the rest.</td>
</tr>
<tr>
<td><code dir="auto">inline_module</code></td>
<td>yes</td>
<td>Replace one instantiation with the body of the module it instantiates, its connections substituted, verified before anything is written.</td>
<td>Replace one instance with its module’s body, connections substituted.</td>
</tr>
<tr>
<td><code dir="auto">propagate_ports</code></td>
<td>yes</td>
<td>Add a named connection for every port one instantiation leaves unconnected, verified before anything is written.</td>
<td>Connect by name every port one instance leaves unconnected.</td>
</tr>
<tr>
<td><code dir="auto">remove_port</code></td>
<td>yes</td>
<td>Delete one module port and its connection from every instantiation in the project, verified before anything is written.</td>
<td>Delete a port and its connection in every instantiation; refused while the body uses it.</td>
</tr>
<tr>
<td><code dir="auto">add_port</code></td>
<td>yes</td>
<td>Add one ANSI port to a module and a connection for it to every instantiation in the project, verified before anything is written.</td>
<td>Add an ANSI port to a module, connected in every instantiation; <code dir="auto">after</code> positions it.</td>
</tr>
<tr>
<td><code dir="auto">extract_module</code></td>
<td>yes</td>
<td>Move the whole items on lines <code dir="auto">start_line</code>..<code dir="auto">end_line</code> of a module into a new module <code dir="auto">new_name</code>, whose ports come from the dataflow across the selection, and instantiate it in their place; verified before anything is written.</td>
<td>Move whole items in lines <code dir="auto">start_line</code>..<code dir="auto">end_line</code> to a new module instantiated in their place.</td>
</tr>
<tr>
<td><code dir="auto">replace_item</code></td>
<td>yes</td>
<td>Replace one item (read_item’s selector) with <code dir="auto">text</code>, verified before anything is written: the file must still parse; <code dir="auto">text</code> must be ONE item of the same kind (a module stays a module) declaring the same names unless <code dir="auto">rename: true</code> (references are then NOT updated; <code dir="auto">rename</code> does that).</td>
<td>Replace one item with <code dir="auto">text</code>: one item, same kind and names (unless <code dir="auto">rename</code>; references untouched).</td>
</tr>
<tr>
<td><code dir="auto">insert_item</code></td>
<td>yes</td>
<td>Insert <code dir="auto">text</code> (one item or more) before or after the item <code dir="auto">anchor</code> names (read_item’s selector), or with <code dir="auto">anchor: "end"</code> as the last items of the file’s last module, package or class (<code dir="auto">end@NAME</code> for that unit), verified before anything is written: the file must still parse and <code dir="auto">text</code> must be complete items the scope may hold.</td>
<td>Insert items <code dir="auto">text</code> before or after item <code dir="auto">anchor</code>, or at <code dir="auto">end</code> (<code dir="auto">end@NAME</code>) of the last unit (unit NAME).</td>
</tr>
<tr>
<td><code dir="auto">delete_item</code></td>
<td>yes</td>
<td>Delete one item (read_item’s selector) and its own leading comments (up to a blank line), verified before anything is written.</td>
<td>Delete one item and its leading comments; refused while its names are used (sites listed) or it holds a `define, unless <code dir="auto">force</code>.</td>
</tr>
<tr>
<td><code dir="auto">instantiate</code></td>
<td></td>
<td>The text of an instantiation of module <code dir="auto">name</code> for the agent to place — parameters with their defaults, the instance name, and each port connected to a same-named signal (<code dir="auto">named</code>) or as <code dir="auto">.*</code> (<code dir="auto">wildcard</code>).</td>
<td>Instantiation text for module <code dir="auto">name</code>: parameters, instance name, named or <code dir="auto">.*</code> ports.</td>
</tr>
</tbody>
</table>
@@ -297,4 +297,4 @@ the directory the extension gives <code dir="auto">lucisv-server</code>; <code d
today and will read that store (read-only) for a warm start in a later
release — never write it, so there are never two writers.</li>
</ul>
</div><footer class="sl-flex astro-xhxjzfa7"><div class="meta sl-flex astro-xhxjzfa7"><a href="https://git.luci.ooo/lucio/verilogrustformatter/src/branch/master/docs/site/src/content/docs/guides/agents.md" class="sl-flex print:hidden astro-xk5gmzsg"><svg aria-hidden="true" class="astro-xk5gmzsg astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.2em;"><path d="M22 7.24a1 1 0 0 0-.29-.71l-4.24-4.24a1 1 0 0 0-1.1-.22 1 1 0 0 0-.32.22l-2.83 2.83L2.29 16.05a1 1 0 0 0-.29.71V21a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .76-.29l10.87-10.93L21.71 8c.1-.1.17-.2.22-.33a1 1 0 0 0 0-.24v-.14l.07-.05ZM6.83 20H4v-2.83l9.93-9.93 2.83 2.83L6.83 20ZM18.17 8.66l-2.83-2.83 1.42-1.41 2.82 2.82-1.41 1.42Z"/></svg>Edit page</a></div><div class="pagination-links print:hidden astro-jgq3vlii" dir="ltr"><a href="/guides/editors/" rel="prev" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17 11H9.41l3.3-3.29a1.004 1.004 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33 1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l5 5a1.002 1.002 0 0 0 1.639-.325 1 1 0 0 0-.219-1.095L9.41 13H17a1 1 0 0 0 0-2Z"/></svg><span class="astro-jgq3vlii">Previous<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Editors &amp; LSP</span></span></a><a href="/guides/syntax/" rel="next" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z"/></svg><span class="astro-jgq3vlii">Next<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Supported syntax</span></span></a></div></footer></div></div></main></div></div></div></div></body></html>
</div><footer class="sl-flex astro-xhxjzfa7"><div class="meta sl-flex astro-xhxjzfa7"><a href="https://git.luci.ooo/lucio/verilogrustformatter/src/branch/master/docs/site/src/content/docs/guides/agents.md" class="sl-flex print:hidden astro-xk5gmzsg"><svg aria-hidden="true" class="astro-xk5gmzsg astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.2em;"><path d="M22 7.24a1 1 0 0 0-.29-.71l-4.24-4.24a1 1 0 0 0-1.1-.22 1 1 0 0 0-.32.22l-2.83 2.83L2.29 16.05a1 1 0 0 0-.29.71V21a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .76-.29l10.87-10.93L21.71 8c.1-.1.17-.2.22-.33a1 1 0 0 0 0-.24v-.14l.07-.05ZM6.83 20H4v-2.83l9.93-9.93 2.83 2.83L6.83 20ZM18.17 8.66l-2.83-2.83 1.42-1.41 2.82 2.82-1.41 1.42Z"/></svg>Edit page</a><p>Last updated: <time datetime="2026-09-23T22:59:07.000Z">Sep 23, 2026</time></p></div><div class="pagination-links print:hidden astro-jgq3vlii" dir="ltr"><a href="/guides/editors/" rel="prev" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17 11H9.41l3.3-3.29a1.004 1.004 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33 1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l5 5a1.002 1.002 0 0 0 1.639-.325 1 1 0 0 0-.219-1.095L9.41 13H17a1 1 0 0 0 0-2Z"/></svg><span class="astro-jgq3vlii">Previous<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Editors &amp; LSP</span></span></a><a href="/guides/syntax/" rel="next" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z"/></svg><span class="astro-jgq3vlii">Next<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Supported syntax</span></span></a></div></footer></div></div></main></div></div></div></div></body></html>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
{"version":"1.5.2","languages":{"en":{"hash":"en_946efe7afb","wasm":"en","page_count":13}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
{"version":"1.5.2","languages":{"en":{"hash":"en_51647babd6","wasm":"en","page_count":13}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
Binary file not shown.
Binary file not shown.
+26 -26
View File
@@ -97,32 +97,32 @@ description. The agent sees the full description and input schema.
| tool | writes | what it answers |
|---|---|---|
| `project_overview` | | Summarise the Verilog/SystemVerilog project under the roots: file count, units by kind, top-level modules (nothing instantiates them) and the largest files. |
| `list_units` | | List the modules, interfaces, packages, classes and programs declared in the project with their file:line, optionally filtered by kind and a name glob (`*`, `?`). |
| `unit_interface` | | The interface of one unit by name: a module's or interface's parameters with defaults, ports in declaration order (direction, type, range) and a ready-to-paste instantiation; an interface's modports; a package's or class's members. |
| `outline` | | The declarations in one file as a tree with 1-based line ranges (units, ports, parameters, signals, functions, instances, blocks), plus its parse errors. |
| `read_item` | | The exact source text and 1-based line range of one item in a file: `name`, `kind:name` (e.g. `function:crc`), `name@LINE` when a name is declared twice, or `always@LINE` / `initial@LINE` / `final@LINE` / `assign@LINE` for the unlabelled block or assignment covering that line (`@LINE` is the last `@` followed only by digits, so `\a@b@1` is `\a@b` on line 1). |
| `search_symbols` | | Find declarations whose name contains `query` (case-insensitive) across the project: units, and the ports, parameters and package/class members other files can name. |
| `defines` | | The \`define table: name, parameters, body (on one line) and file:line — of one `file`, of one macro `name` across the project (every definition; which one a use sees depends on include order, so none is picked), or of the whole project. |
| `definition` | | Where a name is declared: every declaration site as file:line:col, its kind and the declaration's own source line (a name declared in several places lists them all, never a guess). |
| `references` | | Every use of one declaration across the project, grouped by file as line:col and the line's text — the same occurrences a rename would edit. |
| `hierarchy` | | The instance tree as indented `instance : module #(overrides)` lines, down from `root` (default: every top-level module), or with `direction: up` every `parent.instance` that instantiates `root`, with file:line. |
| `diagnostics` | | Parse errors and lint findings for one `file`, or for every indexed file, grouped by file as `line:col severity message [rule]` — what `lucisv check` over the whole tree reports (cross-file rules on), under the project's lucisv.toml [lint] settings and waivers. |
| `format` | yes | Format `file` (or the comma-separated `files`) as `lucisv format` does, under each file's lucisv.toml; `lines` (`12-40,55`, one file only) formats just the constructs meeting those lines. |
| `fix_lint` | yes | Apply the safe automatic fixes of the lint findings in `file` (or the comma-separated `files`), as `lucisv check --fix` does: the project's [lint] config and waivers, never inside a `// lucisv: off` fence, never an unsafe fix. |
| `rename` | yes | Rename one declaration and every reference to it across the project, verified before anything is written. |
| `expand_wildcard` | yes | Replace one instantiation's `.*` with the named connections it binds, verified before anything is written. |
| `convert_ports` | yes | Rewrite a module's non-ANSI header (`module m(a, b); input a; …`) as an ANSI port list, verified before anything is written. |
| `organize_imports` | yes | Remove the unused `import` items of the scope at a position and sort the rest, verified before anything is written. |
| `inline_module` | yes | Replace one instantiation with the body of the module it instantiates, its connections substituted, verified before anything is written. |
| `propagate_ports` | yes | Add a named connection for every port one instantiation leaves unconnected, verified before anything is written. |
| `remove_port` | yes | Delete one module port and its connection from every instantiation in the project, verified before anything is written. |
| `add_port` | yes | Add one ANSI port to a module and a connection for it to every instantiation in the project, verified before anything is written. |
| `extract_module` | yes | Move the whole items on lines `start_line`..`end_line` of a module into a new module `new_name`, whose ports come from the dataflow across the selection, and instantiate it in their place; verified before anything is written. |
| `replace_item` | yes | Replace one item (read_item's selector) with `text`, verified before anything is written: the file must still parse; `text` must be ONE item of the same kind (a module stays a module) declaring the same names unless `rename: true` (references are then NOT updated; `rename` does that). |
| `insert_item` | yes | Insert `text` (one item or more) before or after the item `anchor` names (read_item's selector), or with `anchor: "end"` as the last items of the file's last module, package or class (`end@NAME` for that unit), verified before anything is written: the file must still parse and `text` must be complete items the scope may hold. |
| `delete_item` | yes | Delete one item (read_item's selector) and its own leading comments (up to a blank line), verified before anything is written. |
| `instantiate` | | The text of an instantiation of module `name` for the agent to place — parameters with their defaults, the instance name, and each port connected to a same-named signal (`named`) or as `.*` (`wildcard`). |
| `project_overview` | | Files, units by kind, top modules, largest files. |
| `list_units` | | Units (modules, interfaces, packages, classes, programs) with file:line. |
| `unit_interface` | | A unit's parameters, ports (direction, type, range), modports or members; `template: true` adds an instantiation. |
| `outline` | | A file's declarations as a tree with line ranges, and its parse errors. |
| `read_item` | | One item's exact source and lines. |
| `search_symbols` | | Declarations whose name contains `query` (any case), members included. |
| `defines` | | The \`define table (name, parameters, body, file:line) of a `file`, a macro `name`, or all. |
| `definition` | | Where a name or macro is declared: file:line:col, kind, line. |
| `references` | | Uses of one declaration, then its unresolved mentions (strings, comments, macro text). |
| `hierarchy` | | Who instantiates a module (`up`, with file:line) or what it instantiates (`down`, default). |
| `diagnostics` | | Parse errors and lint findings (`line:col severity message [rule]`) of `file` or all. |
| `format` | yes | Format `file`/`files` as `lucisv format`; `lines` limits it. |
| `fix_lint` | yes | Apply the safe lint fixes to `file`/`files`; says what remains. |
| `rename` | yes | Rename a declaration and its uses; select as `definition`. |
| `expand_wildcard` | yes | Replace one instance's `.*` with the named connections it binds. |
| `convert_ports` | yes | Rewrite a module's non-ANSI header as an ANSI port list. |
| `organize_imports` | yes | Remove unused `import`s in the scope at a position; sort the rest. |
| `inline_module` | yes | Replace one instance with its module's body, connections substituted. |
| `propagate_ports` | yes | Connect by name every port one instance leaves unconnected. |
| `remove_port` | yes | Delete a port and its connection in every instantiation; refused while the body uses it. |
| `add_port` | yes | Add an ANSI port to a module, connected in every instantiation; `after` positions it. |
| `extract_module` | yes | Move whole items in lines `start_line`..`end_line` to a new module instantiated in their place. |
| `replace_item` | yes | Replace one item with `text`: one item, same kind and names (unless `rename`; references untouched). |
| `insert_item` | yes | Insert items `text` before or after item `anchor`, or at `end` (`end@NAME`) of the last unit (unit NAME). |
| `delete_item` | yes | Delete one item and its leading comments; refused while its names are used (sites listed) or it holds a \`define, unless `force`. |
| `instantiate` | | Instantiation text for module `name`: parameters, instance name, named or `.*` ports. |
## What it promises