MCP M6: read-only reuse of the editor's index cache, an own store, the forced-delete ruling, first instructions; the block's closing docs
ci / checks (push) Successful in 1m25s
ci / corpus (push) Successful in 31s

crates/lucisv_mcp/src/cache.rs: at startup `--index-cache DIR/index-cache` (the language server's store) is read READ-ONLY — header CACHE_FORMAT/FACTS_FORMAT/version must match this build or the store is ignored with one stderr line; each record line's checksum verified, decoded, keyed by (record path, content hash) and used only for a discovered file whose bytes hash to it, through IndexBuilder::add_facts instead of a parse; the server never writes that file. Its own `index-cache-mcp` is written once at exit, atomically, in the same codec (a test pins the restated framing against index_cache.rs's source). opentitan: cold 1.9 s → warm 0.8 s (walk 210 ms + merge 204 ms are the floor). delete_item with force may remove an item holding `define/`undef, warning which macros went (M4's ruling); INSTRUCTIONS names the read tools, the edit tools, dry_run and diagnostics. Closing docs: docs/topo.md gains the lucisv_mcp node and its six edges, the mcp-packaging spawn/packaging rows, the read-only cache row and §2.9 rows 35–42 (MCP-5/6/7/8/10/11/12/13 and the parser leniency the M3.5 verifier exposed); repository-analysis map row and nine-crate count; README architecture row; CLAUDE.md measurement for the new crate.

QA (Opus; interrupted by the owner moving the machine, verdict pass so far): swapped/stale/foreign/deleted/off-by-one-header/CRLF stores skipped, the editor's store byte-identical through a session, SIGKILL mid-write harmless, a 231 MB store linear, fingerprint parity over the whole checkout; two low items open — the README threat model reworded, and an orphaned `.tmp` after a kill between write and rename to be swept in the census round. Gates: fmt, clippy clean; lucisv_mcp 318 passed; the dev's workspace run 4 858 passed on the same code.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5.1 committed 2026-09-23 17:14:43 -07:00
1 parent d4ec571958
commit 0f4830afa5
20 files changed
+2163 -60

No files matched your search

+21
View File
@@ -1423,3 +1423,24 @@ count and within noise in time (`aes` 14 locations / 9 files, `.clk_i`
before it is rendered — one slice compare per location, unmeasurable —
so a stale index can omit a location but never point at a wrong line
(QA findings 1–4). `docs/features/references-hierarchical-surface/README.md`.
### 2026-09-23 — MCP: `lucisv-mcp` startup and the per-call sweep (TODO-MCP M6)
`lucisv-mcp` builds its index at the first tool call and can start it from
the language server's `index-cache` (read only) or its own
`index-cache-mcp` beside it (`docs/features/mcp-cache-and-census/README.md`).
Release build, the whole opentitan checkout (3 944 files), two runs of
`tests/opentitan.rs::opentitan_startup_cold_and_warm_and_the_stat_sweep`:
| what | wall | the language server's nearest row |
|---|---|---|
| cold start, no store | 1 854–1 887 ms | — |
| warm, own store (3 944 hits) | 837–847 ms | warm quiet workspace start 985–997 ms (§61), workspace scope |
| warm, the editor's store (3 944 hits) | 821–832 ms | — |
| exit, writing the own store (46.3 MB) | 251–272 ms | compaction skipped when unchanged (§P4b) |
| freshness sweep per call (median, 21 calls) | 5.6–6.1 ms (floor `tools/list` 0.38 ms) | — |
| `rename` dry run, whole set (`op_i` in `aes_cipher_core.sv`) | 2 227–2 276 ms | — (MCP-7) |
A warm build is walk 210 ms + store read 87 ms + read/hash/decode 318 ms +
merge 204 ms; a cold one parses instead (1 387 ms). The rows are not
like-for-like with the server's (it scans in stages and answers during the
scan); they sit side by side so a regression in either shows.