TODO §70, closed. - lucisv_mcp/src/project/files.rs: Stamp's racy rule (re-check by content a stamp taken too close to a timestamp it trusts) covered the mtime alone. On Linux, where ctime moves in 1 ms ticks, a same-size rewrite that restored the old mtime inside the tick of the server's read matched in every field and index-based answers came from the old text indefinitely. The rule now covers every trusted timestamp (mtime, and ctime where there is one), the window is 3 s, and a wall clock stepped back since the read distrusts the stamp. The decision is a pure compare(Seen, Clocks) with deterministic unit tests. - Test-only: two stdin helpers tolerate BrokenPipe on the write to a child that exits before reading (lucisv cli.rs, lucisv_mcp qa_m8.rs); the didOpen latency test's budget is six parses of the same buffer, not 200 ms (lucisv_server e2e.rs); qa_m3's server is spawned before its checker thread, which removes a hang on a pipe inherited across threads on macOS. - .gitea/workflows/ci.yml: a linux job on the luhpe-linux-x64 runner — clippy and cargo test --workspace on Linux x86-64. - docs/features/mcp-transport describes the new rule and what it cannot see (Windows has no ctime; writable mmaps). Linux: whole suite green 10/10 as root and 10/10 as a user (dev), 6/6 and 6/6 (QA). QA reproduced the stale read on 0.65.8 (65/65, 87/87 when the stat was identical) and got 0 here. Dev, QA and lead review: docs/features/linux-test-portability/README.md, Round 2. Version bump (Cargo.toml, Cargo.lock, editors/vscode/package.json and both package-lock.json spots); notes in CHANGELOG.md (## 0.65.9) and editors/vscode/CHANGELOG.md. Gates: tools/gates.sh PASS on this tree including cross; lucisv_mcp 388/0. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
29 KiB
mcp-transport
TODO-MCP.md M1 (first half) — the lucisv-mcp binary, its argument
contract, the stdio JSON-RPC transport, the MCP handshake and the
Project behind every tool. Design: docs/mcp/PLAN.md §4.1, §4.2, §4.4.
The read tools that sit on this transport are docs/features/mcp-read-tools.
Goal
Give coding agents (Claude Code, Cursor, VS Code's agent mode) lucisv's
project understanding over the Model Context Protocol, as a third binary
that shares no code path with lucisv-server or the lucisv CLI. This
feature is the plumbing every MCP tool stands on: a process an agent host
can spawn, a handshake it recognises, a tool-call envelope, and a
Project — roots, config, file set, workspace index, per-file analyses —
that never answers from a file older than the disk was when the call
arrived.
Assumptions
- No
rmcp, no tokio, no new dependency. MCP's stdio transport is one JSON-RPC message per line;serde_json(already pinned by the workspace) reads and writes it, and the envelope is a fewserdestructs inrpc.rs. The official Rust SDK brings an async runtime and a large transitive tree to what is one synchronous loop — the same reasoning that pickedlsp-serverovertower-lspfor the LSP.serdeis used with itsderivefeature, which the lock already carried (no new crate inCargo.lockbeyondlucisv_mcpitself). - Synchronous, one request at a time. A request is answered before the
next line is read, so pipelined requests are answered strictly in order.
notifications/cancelledis accepted and ignored: a call cannot be interrupted, and the longest one is the first call's index build (1.6 s for all of opentitan, below). - Protocol revisions pinned:
2025-11-25(newest),2025-06-18. Verified against modelcontextprotocol.io on 2026-09-23: the current revision is2026-07-28, and it is a different era — it removes theinitializehandshake and carries the protocol version in every request's_meta(withserver/discoverand error-32022). The spec names everything up to2025-11-25"legacy" and says a legacy server answers the modern probe with any non-modern error, after which a dual-era client falls back toinitialize. So this server is a legacy-era server by design: it echoes a client'sprotocolVersionwhen it is one of the two above and otherwise offers2025-11-25, and aserver/discoverprobe (or any request beforeinitialize) gets-32002"server not initialized", which is exactly the fallback signal. Serving the modern era is a separate piece of work (see Handshakes, MCP-4). - Answers are from disk. No unsaved editor buffer is ever seen. Every
tools/callstarts with a freshness sweep: onestatper indexed file (size + mtime); a file whose stamp moved is re-read and re-hashed, and only a changed hash re-indexes it; a missing file is removed and triggers a re-walk; the roots are re-walked when the last walk is older than 5 s and on everyproject_overview, so new files appear. All changes go into the index with oneabsorb(one merge). A file any of whose trusted timestamps — its mtime, and on Unix its ctime — is within 3 s of the moment it was read is re-read on every sweep until it settles — git's "racy clean" rule, applied to every timestamp the stamp trusts since 0.65.9 (it covered the mtime alone before, and a same-tick rewrite on Linux was served stale) — so an edit that keeps a file's size inside one timestamp tick is still seen. On Unix the stamp also holds the file's ctime and inode (the samestat), so a same-size rewrite that puts the old mtime back (cp -p,rsync -t,touch -r) is seen too. Elsewhere (Windows) there is no ctime or inode: size, mtime and the racy rule are all there is, so a same-size rewrite that restores the old mtime more than 3 s after a read is NOT seen. Not seen anywhere: a store through a writable mmap that the kernel has not yet reflected in the file's timestamps (docs/features/linux-test-portability, Round 2). A by-name lookup that finds nothing (unit_interface,list_unitswith aglob,search_symbols) walks once more before it answers, unless this call already walked (Project::ensure_walked_for_miss) — so a file the agent wrote a moment ago is found by name without waiting for the 5 s walk. - The file set is the editor's ladder minus the editor:
--filelist, else the first root's configuredfilelist, else a walk of every root with.gitignorehonoured, each root'sexcludepatterns, and a 1 MiB per-file cap. A filelist that does not read falls back to the walk with a warning. Every path is canonicalized (symlinks resolved) and deduplicated. A walked file whose canonical path lies outside every root (a symlink leading out) is dropped with one warning naming it — the same containment rule a path argument meets inProject::resolve; a--filelistentry is the user's own choice and stays. A file that is not UTF-8 is skipped, as the language server skips it, and named (root-relative) inproject_overview's warnings; that list is recomputed by every walk, so a file fixed later drops out of it and one broken later enters it. - Roots are canonicalized and deduplicated (the same directory given twice is one root, in first-given order); nested roots stay two roots.
- Columns: every column the server prints or accepts is a 1-based
byte column — what
LineIndex::line_coland the parser's diagnostics give. There is no second unit:search_symbolsprints no column rather than the index's UTF-16 one, and M2'sfile,line,colselectors take byte columns too. - Paths: a path argument is absolute or relative to the first root that
holds it; after canonicalization it must be a file inside some root, else
the tool refuses naming the argument. Answers print paths relative to the
first root holding them,
/-separated. - The index is built lazily — on the first
tools/call, not atinitialize— so a host's startup handshake is instant however large the tree. The build line (lucisv-mcp: indexed N files in M ms) is always written to stderr;--verboseadds one timing line per request and the freshness report per call. --index-cache DIRnames the directory holding the language server'sindex-cachestore, read read-only at startup (M6, 2026-09-23:docs/features/mcp-cache-and-census), beside which this server writes its ownindex-cache-mcponce at exit. A missing directory is a cold start.- Argument validation is a tool error, not a protocol error. A call whose
argumentsdo not fit the tool's schema (unknown argument, wrong type, missing required one) is answeredisError: truewith a sentence naming the argument.2025-11-25states this explicitly (SEP-1303: "input validation errors should be returned as Tool Execution Errors rather than Protocol Errors to enable model self-correction") — a host shows the model a tool error, but often not a protocol one. Only an envelopetools/callcannot read at all (params not an object, no stringname,argumentsnot an object) or an unknown tool is-32602. This deviates from the brief's "invalid params → -32602"; see the work log. resources/list,resources/templates/listandprompts/listanswer empty lists (the capabilities are advertised, per PLAN §4.2, so hosts will ask);resources/readis-32002"resource not found" andprompts/get-32602until M2/M6 fill them.structuredContentbeside a compact text. The spec says a tool with structured output SHOULD also serialize that JSON into a text block; this server deliberately sends its own compact rendering as the text instead (PLAN §4.5 — the token budget is the product). Whether a given host feeds the model the text or the JSON is not something this server controls; the M6 token census is where that shows.
Handshakes
Consumed (public APIs only; no library crate was modified):
| crate | items |
|---|---|
lucisv_core |
config::{Discovery::{new, for_dir}, FileConfig}, walk::collect_files_with, filelist::read, cache::content_hash |
vlog_parser |
PARSE_STACK_SIZE, tokenize, parse_tolerant, parse_source_tolerant, LineIndex::{new, line_col}, ParseDiagnostic, ast::{SourceFile, Item, ItemKind, GenBlock, GenElse, GenIf}, span::TextRange |
vlog_semantic |
analyze, Semantics::{symbols, symbol, symbols_named, document_symbols}, Symbol, SymbolKind, ScopeId, DocumentSymbol, IndexBuilder::{new, add_file, finish}, FileFacts::of, WorkspaceIndex::{absorb, fingerprint, files, path, units, units_of, instantiable_units, member, members_of, base_of, instantiations_of, workspace_symbols, build}, Def, DeclLines |
vlog_refactor |
instantiation_plan, InstantiationPlan::render, Layout |
vlog_formatter, vlog_linter |
declared dependencies (PLAN §4.1); nothing called in M1 |
Promised to later lanes and to M5 (packaging): the binary name
lucisv-mcp; the arguments --root DIR (repeatable, default cwd; a root
that is not a directory is a usage error), --filelist FILE,
--index-cache DIR, --verbose; anything else → error: … + usage: … on
stderr, exit 2; stdout carries protocol lines only; EOF on stdin exits 0.
tools::Tool (name, title, description, params, rewalk, handler) is the
registry entry shape M2–M4 add to; tools::read_item::select is the item
slicer M4's structural edits are specified to share.
Requests:
- MCP-4 (new, to the lead): the modern MCP era (
2026-07-28: per-request_metaversion,server/discover, noinitialize). Not needed for any host this block targets today, but a dual-era server is the spec's recommended shape; a later lane, not M1.
Status / TODO
- crate skeleton, argument contract,
PARSE_STACK_SIZEthread, ordered loop transport.rs: newline-delimited JSON-RPC;-32700for non-JSON and non-UTF-8 lines; EOF ends cleanlyrpc.rs:initializenegotiation,notifications/initialized,ping,tools/list,tools/call,-32002beforeinitialize,-32601,-32602,-32600for a malformed envelope (null id, wrongjsonrpc, a batch array)project.rs: roots, config, filelist-or-walk, 1 MiB cap, index build, lazy per-file analyses keyed by content hash, per-call freshness sweep, path refusal outside the roots- fingerprint-equals-rebuild after update / add / remove / recreate
(
project/tests.rs) - wire tests over the real binary (
tests/wire.rs) - gates through
tools/guard.sh
Work log
2026-09-23 (dev, M1).
Built crates/lucisv_mcp (binary lucisv-mcp), added to the workspace
members. Modules: main.rs (arguments, root canonicalization, the
stack-sized thread), transport.rs, rpc.rs, project/{mod,files,analysis}.rs
(+ project/tests.rs), render.rs, tools/{mod,read,interface,read_item}.rs.
The plan's single tools/read.rs was split three ways before it reached
600 lines (interface.rs = unit_interface, read_item.rs = the item
slicer, which M4 will share), and project.rs became a directory for the
same reason (files.rs = discovery + stamps, analysis.rs = the
per-file analysis cache).
Decisions and deviations:
- Protocol revisions. The brief said pin
2025-06-18plus the newest revision if verifiable. The newest (2026-07-28) was verified and is not an initialize-based protocol, so pinning it ininitializewould have been a lie; the newest handshake-based revision,2025-11-25, is pinned instead, first. Filed MCP-4 for the modern era. - Invalid arguments are
isError: true, not-32602(Assumptions: SEP-1303 in2025-11-25). Unknown tool and unreadable envelopes stay-32602, and the message names the offending field or tool. - Lazy index build on the first
tools/call, soinitializeis instant; not in the plan, which said "at startup". - The per-file analysis omits the
`definetable and theresolve_externaloverlay of the server'sDocument::newsequence — nothing in M1 reads them, and the overlay depends on the index (it would need invalidating on every refresh). M2 adds both wheredefinesanddefinitionneed them. - Racy-stamp rule (Assumptions) — added beyond the plan's size+mtime, because a same-size rewrite within one mtime tick is exactly QA's "rename-then-recreate within one second" attack.
-32002forresources/readis MCP's "resource not found"; the same number LSP uses for "server not initialized". Both meanings are the spec's.tools/listignorescursorand never sendsnextCursor.
Measured (release build, --verbose, read-only on opentitan; the checkout's
git status was the same before and after — three files already modified
by the owner, untouched here):
| root | files | index build (stderr line) | wall, 4 messages | RSS |
|---|---|---|---|---|
hw/ip/aes |
124 | 64 ms | 1.07 s (incl. guard startup) | — |
hw/ |
3 944 | 1 813 ms | 2.15 s | 332 MB |
| whole checkout | 3 944 (3 over 1 MiB skipped) | 1 556–1 601 ms | 2.12 s | 331 MB |
Per-call cost on the whole checkout after the build: 7–12 ms for a call
whose sweep changed nothing (3 944 stats + the tool), 222 ms for a call
that re-walked the tree (project_overview).
Gates (all through tools/guard.sh): cargo fmt -p lucisv_mcp -- --check
clean; cargo clippy -p lucisv_mcp --all-targets clean, no #[allow];
cargo test -p lucisv_mcp 27 unit + 11 wire tests green; cargo test --workspace 4 497 passed, 0 failed, 46 ignored (4 459 before + 38 new).
Guard finding: the first cargo test --workspace run was killed at the
default 1 800 s wall clock, sitting in vlog_semantic/tests/semantics.rs
(4 341 tests had passed, none failed). That binary takes 0.00 s on its own
and in the re-run; the identical command re-run immediately afterwards
finished green in 3 min 08 s. Most likely cause: a second cargo test -p lucisv_mcp the dev started during the first run, contending for the build
directory lock. Not reproduced; recorded rather than explained away.
Production lines (non-blank, non-comment, before #[cfg(test)]): main.rs
67, transport.rs 38, rpc.rs 222, render.rs 97, project/mod.rs 212,
project/files.rs 130, project/analysis.rs 52, tools/mod.rs 129,
tools/read.rs 397, tools/interface.rs 285, tools/read_item.rs 199;
tests project/tests.rs 91, tests/wire.rs 390. None over 600; no function
over 50 lines.
2026-09-23 (dev, M1 rework after QA). The lead's rulings on the QA
findings, transport and Project half (the read-tools half — findings 1,
3's tool hooks, 4, 5 — is in docs/features/mcp-read-tools's work log).
Every ruled qa_* test in crates/lucisv_mcp/tests/qa_m1.rs is
un-ignored and green; nothing in that file was renamed.
- 2 — fixed.
project/files.rs::walk_rootnow takes every root and drops a canonical path thatstarts_withnone of them, with a warning<path>: outside every root (reached through a symlink); not indexed.resolveunchanged.qa_the_walk_does_not_index_files_outside_the_roots_through_symlinks. - 3 — fixed.
Project::ensure_walked_for_miss+ awalked_in_callflag (set byopen, cleared at the top ofrefresh, set by any walk); called on a miss by the three by-name tools (read-tools log).qa_a_unit_written_just_now_is_found_by_name_without_a_walk_first. - 7 — fixed.
rpc.rs::classifyanswers an invalid message with its id whenever the id is readable (a string or an integer) — the missing or non-stringmethodbranch as well as the wrong-jsonrpcone;nullonly when the id itself is unreadable.qa_an_invalid_request_with_a_readable_id_keeps_that_id. - 8 — fixed. The not-UTF-8 warnings are rendered with the new free
function
relative_to(whatProject::relativenow calls) and rebuilt by everyrewalkfrom the files it could not read.qa_an_unreadable_file_warning_is_root_relative_and_current. - 9 — fixed.
canonical_rootskeeps each canonical directory once.qa_a_root_given_twice_is_one_root. - 10 — fixed.
Stamp::identity= (ctime s, ctime ns, inode) undercfg(unix)viastd::os::unix::fs::MetadataExt,(0, 0, 0)elsewhere;Stamp::checkis suspect when it moves.qa_a_same_size_rewrite_that_restores_an_old_mtime_is_seen.
Gates after the rework (all through tools/guard.sh, one cargo at a
time): fmt --check exit 0; clippy --all-targets exit 0, no warnings;
cargo test -p lucisv_mcp unit 28 passed, qa_m1 40 passed / 0 ignored,
wire 11 passed; cargo test --workspace exit 0 in 3 min 51 s, 4 538
passed, 0 failed, 46 ignored. Production lines now: main.rs 67,
transport.rs 38, rpc.rs 225, render.rs 128, project/mod.rs 237,
project/files.rs 149, project/analysis.rs 52, tools/mod.rs 129,
tools/read.rs 405, tools/interface.rs 322, tools/read_item.rs 204.
QA log
2026-09-23 (QA, M1 — transport, protocol, Project). Verdict:
rework needed — for read-tools finding 1 (a wrong answer; see
docs/features/mcp-read-tools QA log). Nothing in this half blocks.
How: read PLAN.md §4, both READMEs and every file under
crates/lucisv_mcp/src; drove the debug and release binaries by hand
(Python over stdin/stdout, scratch trees only); then pinned every attack as
a qa_* test in crates/lucisv_mcp/tests/qa_m1.rs (40 tests: 30 pass
and pin correct behaviour, 10 assert the correct behaviour of a finding and
are #[ignore = "QA finding N"] — each confirmed failing today with
cargo test -p lucisv_mcp --test qa_m1 -- --ignored, for the stated
reason). Findings are numbered across both READMEs; 1, 4, 5 and 6 are the
read tools' and are logged there.
Verified correct (pinned by passing qa_* tests):
- Protocol: a string id (non-ASCII) echoed verbatim;
null, fractional and object ids →-32600with idnull, server goes on; a notification method sent with an id is answered as a request (-32601, that id) and a real notification is never answered; a 10 MiB valid line (asearch_symbolsquery) is answered and a 10 MiB non-JSON line is-32700, and the nextpingis answered (0.16 s for both); every method butinitialize/pingbefore the handshake →-32002(server/discoverincluded, the dev's modern-era fallback signal); an unsupportedprotocolVersion(a string, a number,null) →2025-11-25; missing / extra / wrong-type / fractional / out-of-enum arguments areisError: trueand every sentence names the argument (the SEP-1303 deviation holds as documented);argumentsnot an object →-32602; a_metabeside the call is accepted; an unknown tool →-32602naming it; two messages on one line → one-32700, no second answer, no crash; empty, whitespace-only and bare\rlines ignored; EOF after a complete message without its newline answers it and exits 0; EOF mid-message →-32700then exit 0; under--verbose, stdout of a 16-message session (including a lex-error file and a non-UTF-8 file) parses line by line as JSON-RPC while the log goes to stderr. - Freshness: rename a file away and recreate it with different content and
the old mtime (a 1-second-mtime filesystem's view) — the next call
answers the new content (the racy rule,
files.rs:157); a same-size rewrite with the mtime put back inside the racy window is caught; a file in a new two-level subdirectory appears afterproject_overview's walk (and, by hand, after the 5 s re-walk with no overview); a file growing past 1 MiB drops out at the next call and is counted inskipped_large; a.gitignoreadded after startup drops its files at the next walk. - Roots:
link.svandlinkdir/secret.sv(symlinks leaving the root), a../sibling/…path and an absolute outside path are all refused "outside every root";--root A --root A/subindexes each file once andb.svresolves against the inner root; a relative--rootresolves against the working directory. rpc.rs,transport.rs,project/*: nounwrap/expect/panic!outside#[cfg(test)]; no#[allow]; nounsafe; noprintln!in any library crate the binary calls (stdout is held by one lock for the loop).
Findings (this half):
- 2 — non-blocking (medium): the walk is not contained, the arguments
are.
project/files.rs:98canonicalizes each walked path and keeps it wherever it lands, so a symlink inside a root to a file (or directory) outside it indexes the outside file:list_unitsprints its absolute path andunit_interface secret_modanswers its ports, whileoutlineon the same file is refused "outside every root" (Project::resolve). Repro:qa_the_walk_does_not_index_files_outside_the_roots_through_symlinks. Suggested fix: inwalk_root, drop (and count in a warning) a canonical path thatstarts_withno root; a--filelistentry stays allowed as the README says. Alternatively the lead rules that indexed files are readable andresolveaccepts them — either way one posture. - 3 — non-blocking (medium; plan-conformant): a file written in the last
5 s is invisible to every name lookup.
project/mod.rs:131walks only when a file went, onproject_overview, or afterREWALK_AFTER(5 s). The common agent flow — writenew_mod.sv, thenunit_interface new_mod— is refused with "search_symbols finds near names" (tools/interface.rs:84), which cannot find it either. Repro:qa_a_unit_written_just_now_is_found_by_name_without_a_walk_first. Suggested fix: when a by-name lookup (unit_interface,list_unitswith a glob,search_symbols) finds nothing and the last walk is more than, say, 100 ms old, walk once and retry (opentitan walk: 157 ms release). PLAN §4.4 permits today's behaviour; this is for the lead. - 7 — non-blocking (low): an invalid request loses a readable id.
rpc.rs:107answers{"jsonrpc":"2.0","id":15}and{"jsonrpc":"2.0","id":15,"method":5}with idnull; JSON-RPC 2.0 §5 wantsnullonly when the id could not be detected. Repro:qa_an_invalid_request_with_a_readable_id_keeps_that_id. Fix: in that branch useidwhenvalid_id(two lines). - 8 — non-blocking (low): the unreadable-file warning is absolute and
never refreshed.
project/mod.rs:88recordspath.display()(PLAN §4.5: root-relative), only atopen;rewalk(project/mod.rs:173) skips an unreadable file silently, so a file fixed later is indexed yet still warned about, and one broken later is never warned about. Repro:qa_an_unreadable_file_warning_is_root_relative_and_current. Fix: keep the unreadable set inFileSet/the rewalk, rendered withProject::relative. - 9 — non-blocking (cosmetic): a root given twice is listed twice in
project_overview(project/mod.rs:56does not dedup; files are not duplicated). Repro:qa_a_root_given_twice_is_one_root. Fix: dedup the canonical roots keeping first order. - 10 — non-blocking (low): a same-size rewrite that restores an old mtime
is never seen.
Stamp::check(project/files.rs:145-157) compares size + mtime only;cp -p,rsync -t,touch -rand archive extraction restore mtimes. Repro:qa_a_same_size_rewrite_that_restores_an_old_mtime_is_seen(mtime set an hour back before startup, rewritten, set back). Fix: addctimeandino(std::os::unix::fs::MetadataExt, samestat) toStamp— git's own answer to the same problem.
Notes (no action asked): stdin lines have no length cap — a host that
never sends a newline grows one buffer without bound (10 MiB costs
nothing; the process is the host's child). initialize twice is
accepted and re-negotiates. No catch_unwind around a tool call — the LSP
has none either, and no panic was found.
Opentitan (read-only, checkout 0098135; git status --porcelain
byte-identical before and after — the owner's three modified files, untouched):
| root | build (stderr line) | first tools/call (build + call) |
later calls | project_overview (re-walk) |
|---|---|---|---|---|
hw/ip/aes (debug binary) |
— | 329 ms (unit_interface aes_core) |
0–1 ms | — |
hw/ (release) |
3 944 files in 1 584 ms | 1 791 ms (list_units) |
5–11 ms | 157 ms |
initialize answered in 0 ms (129 ms wall including process start).
Gates (all through tools/guard.sh): see the read-tools QA log entry of
the same date (one run for the crate).
2026-09-23 (QA, M1 re-check after the rework). Verdict: pass — every ruled finding is fixed; one new non-blocking finding (11, read tools).
Re-derived by hand (scratch trees, debug and release binaries), not only by the tests:
- 2 — a root holding
vendor -> ../out(a directory outside, two files),rtl/loop -> ..,alias.sv -> rtl/in.sv, andout/back -> root: the walk ends, indexes one file, andproject_overviewcarries two warnings<outside path>: outside every root (reached through a symlink); not indexed;unit_interface secret2refuses (after its miss walk),outline vendor/s1.svrefuses. Note only: the warning names the resolved outside file, not the link inside the root that led there. - 3 — written just before each call:
unit_interface fresh1(root),list_units glob=fresh2,search_symbols fresh3(a new two-level subdirectory) andunit_interface fp::fcall answer. Walk count, timed on opentitanhw/(release;git statusidentical before and after): hits 6–10 ms;unit_interface no_such_mod,list_units glob=no_such*andsearch_symbols zzqqxxeach 140–150 ms, three times running — one walk per miss call (two would be ~290 ms, since one walk is ~145 ms); hits right after the misses 5–8 ms, so a legitimate miss does not make later calls walk. By design (the ruling) every repeated miss re-walks: ~145 ms each on 3 944 files.list_unitswith akindand noglobnever walks on a miss. The miss walk is not in the--verboserefresh line (ensure_walked_for_misscallsrefreshwithout logging) — note only. - 10 —
cp -pof a same-size file with a 2020 mtime over the indexed one (also 2020): the next call answers the new module;mvof a prepared same-size, old-mtime file over it: likewise;read_itemslices the new bytes. - 7, 8, 9 by their tests (un-ignored, unchanged, green), plus
qa_rework_a_file_that_stops_being_utf8_is_warned_and_leaves_the_indexfor the half of 8 the first test did not reach.
Checked that the dev's edit to qa_m1.rs is what the ruling says: the ten
#[ignore] attributes are gone, and in
qa_columns_are_counted_in_one_unit_across_tools only the last assertion
changed (col == 17 → line == 1 and no col key, with a two-line
comment citing the ruling); the parse-error assertion (1:28, bytes) and
every other test body read as written (the ten formerly ignored ones
compared line by line; key assertions of the other thirty spot-checked).
New tests this round (qa_rework_* in crates/lucisv_mcp/tests/qa_m1.rs,
11: 10 pass, 1 ignored for finding 11) — see the read-tools QA log for the
list. Sizes after the rework (production lines, measured by QA): main.rs
67, transport.rs 38, rpc.rs 225, render.rs 128, project/mod.rs
237, project/files.rs 149, project/analysis.rs 52, tools/mod.rs
129, tools/read.rs 405, tools/interface.rs 322, tools/read_item.rs
204 — the dev's numbers; no function over 45 lines; no unwrap/expect/
panic! outside tests, no #[allow], no unsafe.
Gates (verbatim, all through tools/guard.sh, one cargo invocation at a
time): cargo fmt -p lucisv_mcp -- --check exit 0; cargo clippy -p lucisv_mcp --all-targets Finished, no warnings; cargo test -p lucisv_mcp unit 28 passed; 0 failed, qa_m1 50 passed; 0 failed; 1 ignored, wire 11 passed; 0 failed; cargo test --workspace (default
guard) exit 0 in 242 s, 4 548 passed, 0 failed, 47 ignored (the dev's
4 538 / 46 plus this round's 10 / 1). No guard kill.
Review
Lead, 2026-09-23. Read every source file. The block is what PLAN §4 asked
for and nothing more: no library crate touched, no new dependency, one
synchronous loop, PARSE_STACK_SIZE on the parsing thread, no unwrap on a
library path. Rulings recorded here so nobody re-litigates them: invalid
tool arguments are tool errors (isError), not protocol errors — the
2025-11-25 spec's own guidance and the better shape for an agent that has
to correct itself; the server is a legacy-era (initialize) server by
design, MCP-4 filed for the modern era; columns are 1-based bytes
everywhere, and search_symbols reports no column rather than a second
unit; a by-name miss walks once per call. The guard kill the dev saw was
two concurrent cargo invocations and did not reproduce under either QA
run. QA finding 11 (an escaped identifier ending in @digits cannot be
selected bare) is carried into M2 as a small item. Committed as M1.