Census round 1 (mcp_analysis.md, Sonnet arms on the opentitan clone): the mcp arm used more tokens than plain file tools on all three tasks (+18/+25/+20 %) and was incomplete on the rename — the `rename` tool renamed what the engine sees and warned about the macro argument, but nothing listed the old name still spelled as text (a DV force path built as the string ".state_q"), which the base arm's broad search found. Fixes (crates/lucisv_mcp/src/tools/{mentions,place,place/slot,place/verify}.rs + descriptions): `references`, `rename`, `remove_port` and `add_port` end with every whole-word spelling of the name in strings, comments, macro text, define bodies and macro-rooted paths that no engine answer accounted for, ranked edited-files-first, capped at 50, computed on the texts as written; `hierarchy` leads with "who instantiates a module", `references` routes a module name there, `instructions` say so; `tools/list` 30.2 kB → 18.0 kB with every argument still documented; `add_port` takes `after` — the engine appends, the placer moves the header element and each instance's connection to after the anchor in the neighbours' layout, refuses any list holding an unreadable element (an `(* attr *)` port the parser keeps as text would otherwise make the next port inherit the new type — QA's blocking find), and a checker compares every port's declaration text and pairs each comment with its anchoring name against the engine's result; stale `index-cache-mcp.*.tmp` files older than 10 min swept before a write. QA (Opus, two rounds): 23 qa_f1 tests. Gates through tools/guard.sh: fmt, clippy, workspace 4 918 passed.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
434 lines
26 KiB
Markdown
434 lines
26 KiB
Markdown
# mcp-feedback-1
|
||
|
||
Lane **feedback-1** of the MCP block: the changes the first token-census
|
||
round asked for (`mcp_analysis.md`, Round 1 → "Changes for round 2").
|
||
Tracked in `TODO-MCP.md` → "Feedback rounds".
|
||
|
||
## Goal
|
||
|
||
Round 1 showed that `lucisv-mcp`'s answers were correct but not complete
|
||
enough, and not discoverable enough, to beat plain file tools: a rename left
|
||
a DV force-path string and a macro-rooted probe behind without a word, the
|
||
census agent asked `references` for "who instantiates X" instead of
|
||
`hierarchy up`, `add_port` could not place a port where the task wanted it,
|
||
and the tool catalogue cost every session ~7 500 tokens before any work.
|
||
This lane makes the answers say what the engines could not see (unresolved
|
||
mentions), points the agent at the right tool (descriptions and
|
||
instructions), makes a positioned port insertion one verified call
|
||
(`add_port`'s `after`), cuts the catalogue by 40 %, and sweeps the orphaned
|
||
temporary store M6 QA found.
|
||
|
||
## Assumptions
|
||
|
||
- **What a mention is.** A whole-word spelling of the name (not glued to an
|
||
identifier character on either side, `source::word_in`) that lies in: a
|
||
comment (every token's `leading`/`trailing` trivia), a `String` token, a
|
||
macro call's text after the macro's own name (every word — arguments,
|
||
strings and comments inside them alike), a `` `define`` body after the
|
||
macro name and formal list (a define whose formals spell the name is
|
||
skipped: the formal shadows it), or an identifier ending a dotted path
|
||
whose head is a macro token (`` `X_HIER.u_a[0].name``, `` `SPI(1).u.name``).
|
||
A file that does not lex lists every spelling as `text`. Plain
|
||
identifiers elsewhere are never mentions: they belong to some declaration
|
||
the engines resolve (another module's own `state_q` is not noise here).
|
||
`` `ifdef name`` and attributes are not searched.
|
||
- **Accounted for.** A spelling inside a span the engine returned —
|
||
`references`' hits, or any edit range of the rename/`remove_port`/
|
||
`add_port` edit — is not a mention. The engines' own macro warnings
|
||
(rename's "appears in the arguments of…") still appear; the mentions list
|
||
repeats those sites, deliberately: it is the one complete list.
|
||
- **Why not `macro_spellings`.** `item/macros.rs::macro_spellings` answers
|
||
"is this identifier used here", so it skips strings inside macro text
|
||
(`` `define P ".state_q"``) — exactly the round-1 miss. The mentions
|
||
scanner word-searches the raw macro/define text instead.
|
||
- **Order and cap.** Listed nearest first: files the engine touched, then
|
||
lines spelling the declaring unit's name (catches `u_<unit>` on a macro
|
||
path), then by how many leading path components the file shares with the
|
||
declaration's file; file and line within. One mention per line. At most 50
|
||
(`mentions::CAP`), then `… and N more`; lines capped at 160 characters.
|
||
On opentitan `state_q` (entropy_src main_sm) the three round-1 sites are
|
||
lines 1, 2 and 4 of 415.
|
||
- **Cost.** No new reads: the engines already hold every indexed file's text
|
||
(`WholeSet`). Each text is `str::contains`-filtered; only a text spelling
|
||
the name is lexed. The index word censuses (`files_mentioning`,
|
||
`files_naming_in_macros`) cannot narrow further — comments and strings are
|
||
not in them — so they are not used. Measured on the eval clone
|
||
(`~/.cache/lucisv-eval/ot/hw`, 3 944 files, release builds, same session
|
||
warm, two runs each), r1 binary → this lane:
|
||
| call | r1 | feedback-1 | mentions |
|
||
|---|---|---|---|
|
||
| `references` `state_q` (entropy_src_main_sm.sv:42) | 1.98 s | 2.04–2.09 s | 415 (50 listed) |
|
||
| `references` `clk_i` (aes_core.sv:30) | 2.37–2.39 s | 2.60–2.69 s | 50 listed |
|
||
| `rename` `state_q` dry run | 2.17–2.24 s | 2.34–2.39 s | 415 (50 listed) |
|
||
i.e. +0.06–0.3 s on a 2–2.7 s whole-set call.
|
||
- **`references` paging.** The section is on the first page only
|
||
(`offset` 0); later pages repeat nothing.
|
||
- **Descriptions.** `tools/list` measured as the compact JSON of the
|
||
`result` object: **30 221 B before, 17 981 B after** (−40.5 %). Tool
|
||
descriptions 9 095 → ~2 700 B, argument descriptions 7 621 → ~2 500 B,
|
||
`annotations.title` dropped (it repeated `title`). Every argument keeps a
|
||
description. The position rules left the descriptions for `INSTRUCTIONS`
|
||
(896 characters, under qa_m6's 900 cap).
|
||
- **Temp sweep.** Before writing its store, `cache::write_own` removes
|
||
`index-cache-mcp.<digits>.tmp` files older than 10 minutes
|
||
(`STALE_TEMP`); a younger one may be a live concurrent writer's, and no
|
||
other file is touched.
|
||
|
||
### `add_port` `after` — exactly what happens
|
||
|
||
`vlog_refactor::add_port` only appends (header and connections), so it runs
|
||
first, unchanged; its verified edit is the reference. `tools/place.rs` then:
|
||
|
||
1. **Header** (MCP side). The module's ANSI port named `after` is the
|
||
anchor; its index counts **every** element of the list, as
|
||
`ListDirective::before` does. Refused, in this order: a non-ANSI/empty
|
||
list; an unknown `after` (the ports are named); an anchor inside an
|
||
`` `ifdef`` arm; a list holding an element the parser could not read
|
||
(`(* keep *) b` — its text is named; lucisv cannot see what it
|
||
inherits); a next port that would inherit from the new one — no
|
||
direction and no type (inherits both), or a type but no direction when
|
||
the new port's direction differs from the anchor's (a modport port,
|
||
`bus_if.mp bus`, has no direction to inherit and is placed after). The
|
||
engine's header edits (those inside the port list's parens) are dropped
|
||
and the new element goes into the **slot after the anchor's separator**
|
||
(`place/slot.rs`), never at the anchor's end:
|
||
- anchor followed by `,` and the next element starting a later line:
|
||
a new line at the end of the comma's line (past a comment on it, and
|
||
past a block comment that closes on a later line), `element,`;
|
||
- `,` with the next element on the same line (`a, b`, a leading-comma
|
||
list ` , input c`): ` element,` right after the comma;
|
||
- a last anchor with `)` starting a later line: `,` at the anchor's end,
|
||
a new line at the end of the anchor's line (past its comments);
|
||
- a last anchor with `)` on its line: `, element` at the anchor's end,
|
||
or — a comment between — `,` at the anchor's end and ` element`
|
||
before the `)`.
|
||
A new line takes the anchor's line ending (CRLF kept); when the anchor
|
||
is alone on its line, its indentation and column layout (direction,
|
||
type, name at the anchor's columns when they fit), else the next
|
||
element's indentation and the declaration on one line.
|
||
2. **Connections.** For each instance of the module that the engine gave a
|
||
connection edit: a positional list is refused unless `after` is the last
|
||
port (then the engine's appended connection stands); a list holding an
|
||
unreadable element is refused (its text named); a named list whose
|
||
`.after(…)` sits outside any `` `ifdef`` arm (full-list index) gets the
|
||
engine's expression (read back from its appended `.port(expr)`,
|
||
`/* TODO: connect */` included) in the same slot after `.after(…)`'s
|
||
separator, aligned (`(` and `)` at the anchor's columns when they fit)
|
||
or inline. Otherwise the engine's appended connection stands and a
|
||
warning names the instance (root-relative) and why.
|
||
3. **Verification** (`place/verify.rs`, the refusal names the failed
|
||
check): the placed edit applied must, file by file, be the engine's
|
||
result with elements moved: the same sorted multiset of tokens (kind +
|
||
text); every comment attached to the same identifier — the nearest one
|
||
before it for a comment on its token's line (a `,` is never an anchor),
|
||
the nearest one after it for a comment on lines of its own; no more
|
||
parse diagnostics; the module's port list with **every** element
|
||
(unreadable ones by text) in the engine's order with the new port moved
|
||
after `after`, each port's declaration text (blanks collapsed) the
|
||
engine's, and the port after the new one not inheriting from it; every
|
||
instance's connections the same (named: sorted `name(expr)` with blanks
|
||
squeezed; positional: in order; unreadable elements by text). Then the
|
||
one write path, `apply::run`.
|
||
|
||
## Handshakes
|
||
|
||
- **Consumed:** `vlog_parser::{tokenize, parse_source_tolerant, LineIndex}`,
|
||
AST port/instance types; `vlog_refactor::{add_port, remove_port, rename,
|
||
find_references, rename_name_at, enclosing_module, module_definition,
|
||
RefactorEdit, TextEdit}`; `apply::Plan::from_refactor` (applies and
|
||
checks edits, used as-is by `place::verify`).
|
||
- **Promised (answer shapes):** `references` text gains the section
|
||
`unresolved mentions (strings, comments, macro text — not resolved by
|
||
lucisv):` with ` file:line kind: text` lines; `rename`, `remove_port`
|
||
and `add_port` gain one `warnings:` entry — "`<lead>` as text at these
|
||
places lucisv does not resolve (strings, comments, macro text; N in all);
|
||
check whether these are references:" with the same lines indented four.
|
||
All four add `"unresolved_mentions": [{file, line, text, kind}]` to their
|
||
JSON (empty when none); `kind` ∈ `comment`, `string`, `macro`, `define`,
|
||
`path`, `text`. `add_port` takes `after`. `tools/list` no longer carries
|
||
`annotations.title`.
|
||
- **Flag for the lead (ownership):** `src/tools/place.rs` is a new file not
|
||
in the lane's list — `refactor.rs` would have gone from 291 to ~770 lines
|
||
with it. It is only used by `refactor.rs`. The rework split it into
|
||
`place.rs` (driver and refusals), `place/slot.rs` (where and how an
|
||
element is written) and `place/verify.rs` (the move-checker), all new.
|
||
- **Mentions after an edit** (QA finding 4): `finish_telling` runs the
|
||
mentions pass on the texts as written (the plan's new text for an edited
|
||
file, the read text otherwise), with the edit's ranges shifted into the
|
||
written text, so `file:line` names the file as it is after the write —
|
||
and, for a dry run, the diff's new side.
|
||
|
||
## Status / TODO
|
||
|
||
- [x] `src/tools/mentions.rs` — the scanner, ranking, rendering
|
||
- [x] `references` section + JSON; `rename`/`remove_port`/`add_port`
|
||
warning + JSON (`edit::finish_telling`)
|
||
- [x] descriptions and `INSTRUCTIONS` (hierarchy/references wording; ≤ 18 kB)
|
||
- [x] `add_port` `after` (`src/tools/place.rs`), with attack tests on its
|
||
verifier
|
||
- [x] stale temp-store sweep; `qa_an_orphaned_temp_file_is_swept_by_the_next_write`
|
||
un-ignored
|
||
- [x] wire tests (mentions on `references`/`rename`, `after` byte-exact on an
|
||
`aes_core`-shaped fixture, last-port and unknown-anchor, catalogue
|
||
size, sweep)
|
||
- [x] opentitan cost measured (above)
|
||
|
||
## Work log
|
||
|
||
**2026-09-23 (dev, Opus).**
|
||
|
||
- `mentions.rs` (212 production lines): `find` over the `WholeSet` texts,
|
||
`spellings` per file (comments, strings, macro text, define bodies,
|
||
macro-rooted paths), ranking, `Mentions::{lines, json, warning}`.
|
||
- `nav.rs`: `references` computes mentions before handing texts to
|
||
`Texts`; the section follows the hits; `unresolved_mentions` in JSON.
|
||
- `edit.rs`: `finish_telling` (accounted = the edit's ranges); `rename`
|
||
and `remove_port` (no longer through `at_cursor`) use it.
|
||
- `refactor.rs`: `add_port` takes `after`, resolves the module's file
|
||
(`module_definition` or the given file), runs `place::after`, and
|
||
finishes through `finish_telling` with the new port's name.
|
||
- `place.rs` (479 production lines): see "exactly what happens" above.
|
||
Decision: re-placing the engine's verified edit and verifying the moved
|
||
result against it, rather than asking for an engine change — no
|
||
Handshake on `vlog_refactor` needed.
|
||
- Descriptions: all 26 rewritten; `mod.rs` drops `annotations.title`.
|
||
30 221 → 17 981 B.
|
||
- `cache.rs`: `sweep_stale_temps` before each own-store write.
|
||
- Tests: unit tests in `mentions.rs` (4) and `place.rs` (6, three of them
|
||
attacks/refusals on the verifier); 7 wire tests; fixture
|
||
`tests/fixtures/feedback/`.
|
||
|
||
**2026-09-23 (dev, Opus) — rework on the QA verdict and the lead's
|
||
rulings.** All six `qa_f1` tests un-ignored; none contradicted a ruling
|
||
(5b's expects the `ifdef` refusal for an anchor inside an arm next to an
|
||
unreadable element, so the arm is checked before the unreadable-element
|
||
refusal — both refuse).
|
||
- **5 (blocking)**: `place.rs` `header` refuses a port list with an
|
||
unreadable element (named), after the `ifdef` check; `after` refuses an
|
||
affected instance whose connection list holds one; `balanced_before` is
|
||
handed full-list indices on both sides; `verify` compares the whole port
|
||
list, unreadable elements by text, each port as `name: declaration`
|
||
(blanks collapsed) against the engine's — the type-swap pair is a unit
|
||
test (`place/verify.rs`), refused.
|
||
- **1 (major)**: insertion moved to the slot after the separator
|
||
(`place/slot.rs`, unit-tested on `a /* about a */,`, a leading-comma list,
|
||
a last port with a block comment, a block comment spanning the comma's
|
||
line, CRLF); `verify` pairs each comment with its identifier (attacks: a
|
||
comment glued to the anchor's comma, a leading-comma list, the anchor
|
||
line's comment taken by the new line). Deviation from the ruling's
|
||
letter, for the reason: the ruling pairs every comment with its
|
||
*preceding* token; for a comment on lines of its own that would forbid
|
||
the placement round 1 asked for (`rst_ni,` ⏎ blank ⏎ `// Data` ⏎
|
||
`data_i` — the new port goes right after `rst_ni`, so `// Data`'s
|
||
preceding name changes although it still sits above `data_i`). Such a
|
||
comment is paired with the identifier after it instead; a same-line
|
||
comment with the one before it (never a `,`). Both catch QA's attacks.
|
||
- **2**: every file `place.rs` names goes through `Spec::show`
|
||
(`project.relative`).
|
||
- **3**: `inherits`: no direction and no type → inherits both (refused);
|
||
a type but no direction → inherits the direction, refused only when the
|
||
new port's direction differs from the anchor's; a modport type
|
||
(`x.y`) → never. Stricter than the ruling's "both absent" in one case
|
||
(`output logic a, logic [3:0] b` with a new `input`: `b` would turn
|
||
input), unit-tested.
|
||
- **4**: `edit.rs::finish_telling` scans the written texts;
|
||
`mentions::find` now takes `(path, text)` pairs; `written_ranges` shifts
|
||
the edit ranges.
|
||
|
||
## QA log
|
||
|
||
**2026-09-23 (QA, Opus) — verdict: REWORK (1 blocking, 1 major, 3 low).**
|
||
Attacks in `crates/lucisv_mcp/tests/qa_f1.rs` (real binary over scratch
|
||
trees; placements byte-exact, refusals with the tree byte-identical under
|
||
`dry_run` and for real): 11 pass, 6 `#[ignore = "QA finding N"]` pin the
|
||
findings below (each fails today, run with `--ignored`).
|
||
|
||
Verified, holds:
|
||
- `after` byte-exact on: an anchor with a `//` comment on its line (stays
|
||
there), the last port with a trailing `/* */` (comma before the comment,
|
||
the new line has none), tab indentation, CRLF (kept on the new line),
|
||
one-per-line aligned connections, two instances in one statement, an
|
||
instance in a generate block, an instance in the module's own file
|
||
(`file`+`line` selector), a positional instance with `after` = last
|
||
(appended) and elsewhere (refused, nothing written), an anchor just
|
||
before and just after an `` `ifdef`` arm (placed outside), an anchor in
|
||
an arm (refused), a parameter as `after` (refused, ports listed), a
|
||
connection anchor in an arm (engine's append kept, warning names the
|
||
instance), `.*` instances (the engine's warning; nothing placed), the
|
||
same call twice (engine refuses, nothing written). `dry_run`'s diff,
|
||
applied to the old text, is byte-for-byte what the real run writes (for
|
||
`after` = first, middle, last).
|
||
- Mentions: a hierarchical path in a comment, a string inside a macro's
|
||
arguments, a `` `define`` body listed and a `` `define`` with the name
|
||
as formal not, a macro-rooted path through `[2]`, an escaped `\name` in
|
||
a comment, `state_q_d`/`xstate_q`/a path ending in `state_q_d`/the name
|
||
as an index not listed; CRLF line numbers right and no `\r` in the
|
||
text; JSON keys exactly `file, kind, line, text`; `offset` > 0 has no
|
||
section and `[]`; the cap (60 far mentions + the edited file's: 50
|
||
listed, edited file first, "65 in all", "… and 15 more"); a renamed
|
||
file's hits excluded and its other mentions kept. opentitan (eval clone,
|
||
release, through the shim): `references clk_i` at aes_core.sv:30 —
|
||
r1 4.00 s / 4.00 s, feedback-1 4.21 s / 4.22 s (+0.21 s, within the
|
||
recorded +0.06–0.3 s); 801 mentions, 50 listed; the clone left clean.
|
||
- Catalogue: `tools/list` 17 981 B (≤ 18 000), 26 tools, every argument
|
||
described, no argument lost against HEAD (only `after` added; checked
|
||
per file by `git show HEAD:`), `title` kept at tool level and absent
|
||
from `annotations`, the three hints booleans; `instructions` 896 chars,
|
||
every `snake_case` word it names is a tool (bar `dry_run`).
|
||
- Sweep: an hour-old `index-cache-mcp.1.tmp` goes; `..tmp`, `.12a.tmp`,
|
||
`.12.tmp.bak`, `index-cache.12.tmp`, `xindex-cache-mcp.12.tmp` (all an
|
||
hour old) and an old *directory* `index-cache-mcp.77.tmp` stay; the own
|
||
store is still written (plus the dev's young-file test).
|
||
|
||
Findings:
|
||
|
||
1. **Major — a comment re-attached to the new port, forgiven by the
|
||
checker.** An anchor whose comment sits between it and its comma
|
||
(`input logic a /* about a */,`), or on its line before a leading-comma
|
||
next element (`input logic b // about b` ⏎ `, input logic c`), is not
|
||
"alone on its line", so `inline` inserts at the anchor's *end*
|
||
(place.rs:173, :256): `input logic a, input logic en /* about a */,` and
|
||
`.a (a), .en(en) /* conn a */,` — the comment now documents `en`.
|
||
`verify` compares comment texts as a sorted multiset (place.rs:529–540),
|
||
so the move passes. Repro:
|
||
`qa_a_comment_between_the_anchor_and_its_comma_stays_with_the_anchor`.
|
||
Fix: insert `, element` at the start of the token after the anchor when
|
||
it is `,` or `)` (past the trivia), else at the anchor's end; and in
|
||
`verify`, compare each comment paired with its preceding non-`,` token.
|
||
2. **Low — absolute paths.** The warnings and refusals `place.rs` writes
|
||
use `path.display()` (place.rs:84, :221):
|
||
`` `u_n` in /private/var/…/rtl/top.sv: the connection … ``; every other
|
||
answer is root-relative. Repro: `qa_place_names_files_relative_to_the_root`.
|
||
3. **Low — false refusal.** A modport port after the anchor
|
||
(`bus_if.mp bus`) has no direction and inherits none, but place.rs:155
|
||
refuses "takes its direction and type from the port before it". Repro:
|
||
`qa_a_modport_port_after_the_anchor_does_not_refuse`. (A bare
|
||
`bus_if bus` is ambiguous with a type; refusing that one is right.)
|
||
4. **Low — stale mention lines after a write.** `finish_telling`
|
||
(edit.rs, the `mentions::find` over `set.files`) lists mentions with the
|
||
*pre-edit* line numbers; after a real `add_port` (lines added),
|
||
`remove_port` (removed) or a `rename` that writes out `.*` bindings, a
|
||
mention below the edit in an edited file names the wrong line
|
||
(`rtl/m.sv:6 comment: // en gates y` — line 6 is now `);`). Repro:
|
||
`qa_mention_lines_name_the_file_as_written`. Fix: shift each mention by
|
||
the net newlines the file's edits insert before its offset, when not a
|
||
dry run.
|
||
5. **BLOCKING — an unreadable port-list element defeats the placer and the
|
||
checker (masked corruption, written to disk).** `place.rs` reads the
|
||
header through `ListElem::ok` (`ansi_ports`, place.rs:128–133) and so
|
||
does `verify` (`ports_in_order`, place.rs:542–564). An element the
|
||
parser could not read — `(* keep *) b`, legal SV, an attribute on a
|
||
port — is invisible to both:
|
||
- a) `input logic [7:0] a,` ⏎ `(* keep *) b,` with `after: "a"`:
|
||
the new `input logic en` lands between them, so `b` now inherits
|
||
`input logic` — **8 bits become 1** — and it is written (same tokens,
|
||
same parse-error count, same well-formed port order). Repro:
|
||
`qa_a_port_hidden_by_a_parse_error_does_not_change_its_inherited_type`.
|
||
- b) `balanced_before` gets the anchor's index among the *well-formed*
|
||
elements, but `ListDirective::before` counts all of them
|
||
(place.rs:161; the connection side has the same shape at :241–244).
|
||
With `(* keep *) input logic d` before an `` `ifdef X`` arm, `after: "b"`
|
||
(inside the arm) passes: the port is written **inside the arm** while
|
||
the connection is unconditional, and the engine's warning in the same
|
||
answer says it was added "outside every conditional arm". Repro:
|
||
`qa_an_unreadable_element_does_not_let_an_anchor_in_an_ifdef_arm_through`.
|
||
Fix: refuse `after` when the port list (or the anchor instance's
|
||
connection list) holds any `ListElem::Error`, or index the raw list
|
||
everywhere (the anchor's raw index for `balanced_before`, the raw next
|
||
element must be `Ok` with a direction). `verify` should re-derive the
|
||
same on the placed tree with raw indices, and compare each port's
|
||
declaration text (blanks squeezed) by name with the engine's: today a
|
||
crafted `input logic [7:0] a, input logic en` →
|
||
`input logic a, input logic [7:0] en` (a type swapped between the
|
||
anchor and the new port) has the same tokens, names in order, parse and
|
||
connections, and `verify` would accept it. These attack pairs belong in
|
||
`place.rs`'s unit tests next to `verify_refuses_a_placement_that_is_not_a_move`
|
||
(`verify` is private; QA cannot reach it from `tests/`).
|
||
|
||
Observations (no test; for the lead):
|
||
- Layout: a multi-line anchor (`input logic` ⏎ `[7:0] e,`) measures its
|
||
name column across the newline (place.rs:339), so the new line's name is
|
||
pushed far right. Cosmetic.
|
||
- Ranking ignores kind: 60 comments in one file push that file's
|
||
macro-rooted path — the round-1 miss class — past the cap. Ranking
|
||
`path`/`string`/`define`/`macro` above `comment` within a rank would keep
|
||
the valuable ones listed.
|
||
- Out of lane (engine / parser, pre-existing): `vlog_refactor::add_port`
|
||
appends a connection *inside* an `` `else`` arm when the list's tail is
|
||
conditional (`.y ()` ⏎ `` `endif``); the parser reads `(* attr *)` on an
|
||
ANSI port as an error element (`after: "d"` answers "no port `d`"); the
|
||
unified diff re-lists unchanged lines as `-`/`+` near a file end without
|
||
a final newline.
|
||
|
||
Gates (all through `tools/guard.sh`):
|
||
- `cargo fmt --all -- --check` — exit 0, no output.
|
||
- `cargo clippy --all-targets` — ``Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.96s``, no warnings.
|
||
- `cargo test -p lucisv_mcp` — 347 passed, 0 failed, 9 ignored (qa_f1: `test result: ok. 11 passed; 0 failed; 6 ignored`).
|
||
- `cargo test --workspace` — 4 903 passed, 0 failed, 56 ignored (4 892 + 11).
|
||
|
||
**2026-09-23 (QA, Opus) — re-check of the rework: PASS** (findings 1–5
|
||
closed; one new low, finding 6, left for the lead).
|
||
|
||
Re-derived by hand over stdio (the eval shim `mcp_call.sh` on the debug
|
||
binary, scratch trees): 5a `(* keep *) b` after an 8-bit `a` — refused,
|
||
"`m`'s port list holds `(* keep *) b`…; nothing written", both files
|
||
byte-identical (md5); 5b anchor `b` inside the arm behind an unreadable
|
||
`d` — refused "inside an `ifdef arm", and `after: "a"` in the same list
|
||
refused by the unreadable-element rule; 5c the type swap cannot be built
|
||
through the tool (the placer writes the declaration verbatim), so
|
||
confirmed as the unit test
|
||
`place::verify::tests::a_type_swapped_between_the_anchor_and_the_new_port_is_refused`
|
||
(passes); 1 `a /* about a */,` → the new line below it, the comment on
|
||
`a`'s line; `.a (a) /* conn a */,` likewise; `b // about b` ⏎
|
||
`, input logic c` → `, input logic en, input logic c`. The six pinned
|
||
tests (findings 1–5) pass un-ignored and unchanged.
|
||
|
||
New attacks (`qa_r_*` in `tests/qa_f1.rs`, all byte-exact or tree
|
||
byte-identical): an unreadable connection (`..q (p)`) in another module's
|
||
instance and in an untouched `.*` instance of `m` — placed, not refused;
|
||
in the instance placed into — refused, named `rtl/top.sv`; own-line
|
||
comments above the last anchor and closing the list — both stay, header
|
||
and connections; `a /* c1 */, // c2` — the new line goes below, both
|
||
comments on `a`'s line; a last anchor with `/* c */` before `)` on its
|
||
line — `y, /* c */ input logic en)`; a leading-comma list; a typed
|
||
undirected `logic [3:0] b` after the anchor — placed under `input`,
|
||
refused under `output` (nothing written); a rename writing out a `.*`
|
||
binding (one line added above the mentions) — each listed line is the
|
||
line on disk after the write (off-by-none).
|
||
|
||
6. **Low — dry-run mention lines name a file that is not on disk.** The
|
||
rework computes mentions on the texts as they would be written, under
|
||
`dry_run` too: in the `.*` rename above, the dry run lists
|
||
`rtl/top.sv:6 comment: // a feeds u_m`, and line 6 on disk is the
|
||
`$display` (the comment is at 5 until the edit is written). The text is
|
||
shown beside the line, so an agent can recover; but a dry run's diff
|
||
and lines otherwise describe the file on disk. Repro:
|
||
`qa_r_dry_run_mention_lines_name_the_file_on_disk` (ignored). Either use
|
||
the pre-edit lines under `dry_run`, or say "lines as written" in the
|
||
warning — the lead's call.
|
||
|
||
Gates (all through `tools/guard.sh`, one at a time):
|
||
- `cargo fmt --all -- --check` — exit 0, no output.
|
||
- `cargo clippy --all-targets` — ``Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.21s``, no warnings.
|
||
- `cargo test -p lucisv_mcp` — 362 passed, 0 failed, 4 ignored (unit: `test result: ok. 73 passed`; qa_f1: `test result: ok. 22 passed; 0 failed; 1 ignored`).
|
||
- `cargo test --workspace` — 4 918 passed, 0 failed, 51 ignored (4 913 + 5 new).
|
||
|
||
## Review
|
||
|
||
**Lead, 2026-09-24 (feedback-1).** The first census round's lesson was
|
||
discoverability and completeness of what the server *says*, not the
|
||
correctness of what it answers, and this lane changes exactly that: an
|
||
"unresolved mentions" section on `references` and the edit tools (the DV
|
||
string path round 1 missed is now line 4 of the list on opentitan), a
|
||
catalogue 40 % smaller, `hierarchy`/`references` descriptions that route
|
||
"who instantiates X" to the right tool, and a positioned `add_port`. The
|
||
last is the one piece of new text-moving logic, and QA's first round found
|
||
the classic hole — an unreadable port element the placer could not see, so
|
||
the next port inherited the new one's type — fixed by refusing any list
|
||
with an unreadable element, full-list positions, and a checker that
|
||
compares every port's declaration text and pairs each comment with its
|
||
anchoring name. Ruling on QA's finding 6: under `dry_run` the mention line
|
||
numbers describe the file as it would be written; the line text beside
|
||
each number is the recovery, and the wording stays. Committed; the round-2
|
||
binary is frozen from this commit.
|