Files
lucisv/docs/repository-analysis.md
T
Guoliang ChenandClaude Mythos 5.2 cfa8d82707
ci / checks (push) Successful in 1m26s
ci / corpus (push) Successful in 18s
release / preflight (push) Successful in 4s
ci / linux (push) Successful in 6m7s
release / linux (push) Successful in 6m6s
release / build-and-publish (push) Successful in 6m7s
Release 0.67.0: twelve bug-fix rounds, measured against 0.66.2
Everything since 0.66.2: Rounds 1-12 (refactor and server ordering, index
lifecycle, MCP hardening, CI gates, CLI/parser/formatter fixes, formatter
alignment and overrides, linter hardening, semantic edge cases, exact
semantic-token refresh, sliced discovery walk, Windows UNC URIs, pure-move
splits) and the Take-6 performance report. This commit is the version bump,
the changelogs and the documentation sync; no source change.

- Version 0.67.0 in Cargo.toml, Cargo.lock and the extension manifests.
- CHANGELOG.md and editors/vscode/CHANGELOG.md: the 0.67.0 sections,
  including the output change, the lint delta, the Windows caveats and the
  three known regressions from Take 6.
- docs/topo.md, docs/repository-analysis.md, README.md, TODO.md and the
  site sources brought up to Rounds 1-12; topo 2.9 handshakes #67-#74 stay
  open as written.
- tools/gates.sh green on this tree: 5 820 tests, corpus 814/6 as before.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
2026-11-26 23:04:26 -08:00

22 KiB
Raw Permalink Blame History

Repository analysis

Refreshed 2026-11-26 for the v0.67.0 release: committed snapshot the 0.67.0 release commit (Rounds 1–12, 8f5a4fb–aa2259b, plus the Take-6 performance report, f2d9ff0/2e9da20). Previous tagged release: v0.66.2 (71d13b5, released 2026-11-24). This refresh reconciles CHANGELOG.md, the feature READMEs (docs/features/*), TODO.md, docs/topo.md, oct_review.md, and live Rust/Node inspection, with the gate counts recorded on the release tree by Round 12's QA (docs/features/hygiene-splits-r12/README.md) and the before/after measurements of performance_take6.md.

Assessment and current status

lucisv is a nine-crate toolchain (six reusable Rust libraries plus lucisv, lucisv-server, and lucisv-mcp), VS Code / Neovim integrations, release/corpus tooling, and an Astro/Starlight docs site. Syntax, formatting, semantics, linting, refactoring, and project inputs stay cleanly separated. Releases v0.50.0–v0.66.2 retired performance bottlenecks, delivered the MCP server (--read-only), completed top-rooted path resolution (codec 22), range/selection formatting, sticky scroll (ifdef branches + instantiations), the eight-item overnight queue (TODO §71) and instance-folding (TODO §72). v0.67.0 releases Rounds 1–12: refactor correctness and server ordering (1), index lifecycle (2), MCP hardening with hash-cached references and dir/glob check (3), CI/release gates and a docs sync (4), CLI paths/JSON/stdin and parser/formatter fixes with a parse-once --style auto (5), formatter alignment, lowrisc fidelity and selective [format] overrides (6), linter hardening with missing-port-direction (7), semantic and refactor edge cases at FACTS_FORMAT = 23 (8), exact semantic-token refresh (9), a resumable discovery walk (10), Windows UNC URIs and editor polish (11), and pure-move splits (12).

Change Status at this refresh Implementation and contract
External waiver files & conditional headers Released in v0.42.0 ExternalWaivers, WaiverUse, and lint_with; CLI, project config, and editor waivers union cleanly; split units verbatim, net delays keep written position
Atomic-write coordination & cycle-aware walks Released in v0.43.0–v0.44.0 Exclusive per-operation temp files; directory identity dedup + recoverable walk warnings; undriven-net checks mention oracle after local guards
Type-name spans, re-exports, hierarchical tails Released in v0.45.0 DataType::name_span() / segments(); package re-export RX graph; Surface::{Connection, Hierarchical}
Wildcards, ANSI, imports, extract, DUT tree Released in v0.46.0–v0.48.2 ports/{expand,ansi,merge}.rs, vlog_semantic::imports (74 lint rules incl. unused-import), extract/, client-side DUT hierarchy sections
Inline module, coverage gaps, UVM indent Released in v0.49.0 Separate-file body substitution with collision renaming; real randsequence nodes; opt-in uvm-utils-indent
Format cache key; performance round 5 Released in v0.50.0–v0.53.0 uvm-utils-indent in cache key (§2.9-34 closed); module_sources_reaching (§2.9-33 closed); buffer-only rename preflight; symlink-aliased discovery dedup
bind, hierarchical refs, MCP (--read-only) Released in v0.54.0–v0.59.0 bind target surfaces (codec 20); cross-file hierarchical refs; .name/.* expansion under rename; lucisv-mcp 9 tools (--read-only offers 5)
Generate-block labels; scoped rename warnings Released in v0.60.0 Block path segments resolve & rename all-or-nothing (module.label, codec 21); module/interface rename warnings scoped to home set
Call hierarchy & References full-line view Released in v0.61.0 prepareCallHierarchy / incomingCalls / outgoingCalls; VS Code Lucisv References tree view shows trimmed lines (lucisv.references.fullLineView)
Top-rooted paths & release gate script Released in v0.62.0 Unknown path heads root at unique top modules (tb.dut.sig), codec 22; TODO §65.2 (#36) ruled scope-relative by design; tools/gates.sh added (§65.3)
Range/selection formatting & sticky scroll Released in v0.63.0–v0.63.1 format_selection (textDocument/rangeFormatting + rangesFormatting); nested begin/case/block folding + 10-layer sticky scroll
Completion UX (autoEnd) & port-entry grace Released in v0.64.0 Keyword ghosts (lucisv.inlineKeywords) & begin→end auto-insert (lucisv.autoEnd); relaxed empty-list completion/hover tolerance while typing port connections
Instantiation highlighting Released in v0.65.0 Syntactic+semantic token classes for module types, #/params, instance names, and .port names (tokens/instantiation.rs, unchanged 14-type legend)
Release gates (cross), Linux CI & MCP stamp Released in v0.65.1, v0.65.7, v0.65.9 tools/gates.sh cross check; Linux ci.yml + tools/linux_check.sh; Stamp racy window (3 s) covers mtime+ctime and clock step-backs
Overnight queue (TODO §71): UX, styles, reindex, fast actions Released in v0.65.2–v0.65.8, v0.65.10–v0.66.0 Hierarchy current path (0.65.2), comment keywords (0.65.3), ifdef folding (0.65.4), 6 named styles + auto (0.65.5), localized reindex (0.65.6/0.65.7), ordered notifications & cursor-after-name (0.65.8), viewport highlight (0.65.10), buffer-first same_file fast actions + related completion tier (0.65.11/0.66.0)
Sticky scroll instance folding & author stamps Released in v0.66.1–v0.66.2 folding/instances.rs pins multi-line #( and ) u_name ( headers; tools/stamp_author.py stamps tracked files (no runtime change)
Round 1: Refactor correctness & server ordering Released in v0.67.0 (8f5a4fb) UTF-8 skip_string, deterministic carry.rs, duplicate-unit enclosing_unit guard (#53 + F2b same_file::renamed_here), ports/remove.rs item.span (#38), extract CRLF (#39), Document::version + DocumentChanges::Edits (#52), after_scan whole-scan hold (#53), startup push drain (#61), exact applied_changes oracle (#62)
Round 2: Index lifecycle & tombstones Released in v0.67.0 (4d384ec) Tombstoned WorkspaceIndex::remove_file + live_files() + didClose reconciliation (#49), mid-scan buffer absorption (ScanAbsorbed, #50), (dev, ino) canonical symlink spelling across discovery/overlays/widen/handlers (#51), disk record preserved for doc.large (#63); #48 ruled won't-fix by owner
Round 3: MCP hardening & references cache Released in v0.67.0 (69383ea) find_references_{with,batch,batch_with} + Project KnownFacts (#37/#40), Stamp::first_mono future-mtime settlement (#54), Windows --all-targets qa_m3.rs fix (#56), L-9 after_dot + home_set_for/home_sets_for parity, qualified find, check dir/glob support, "prompts": {} removed, RO 2,000/330 B & full 3,800/440 B budgets
Round 4: CI/release gates & docs sync Released in v0.67.0 (6d1c689) authors.workspace = true in all nine crates; guarded cargo test in both ci.yml jobs; stamp gate step; cross fails without its toolchain unless --allow-skip-cross; release.yml preflight → linux → build-and-publish; corpus_gate.sh jq guard (#57, #65, #66); docs/site sources re-synced, TODO §65.8 WON'T FIX
Round 5: CLI path/JSON/stdin & parser/formatter Released in v0.67.0 (4cf50a0) lucisv_core::path::{normalize, normalize_under} (#1); format-mode --output-format json (#11); stdin [lint] select/ignore + #55; comments and `ifdef between end/else (#44, #45), ANSI port attributes (#46), stricter empty list elements (#42), one-per-line multi-instance layout (#47); parse-once --style auto (5 564 → 2 806 ms median on OpenTitan hw, Take 6)
Round 6: Alignment, lowrisc fidelity, [format] overrides Released in v0.67.0 (9437966) #(…) param-port and override alignment; Style::connection_align_min (lowrisc 0); StyleOverrides over presets and auto from lucisv.toml, CLI, MCP, server and lucisv.format.*; 14-field format cache Entry; OpenTitan hw output differs from 0.66.2 in 413 / 576 / 972 files (default / auto / lowrisc, Take 6)
Round 7: Linter hardening Released in v0.67.0 (e229ff9) missing-port-direction (Error, default on, #41; 75 rules); suspicious-semicolon while (<call>); exemption; nested incomplete-assignment; mismatched-labels Unsafe fix; quote-aware option lists; regex nesting cap 64; uvm-macro-semicolon autofix and instance-shadowing exemption withdrawn; OpenTitan check hw 1 182 → 1 178
Round 8: Semantic & refactor edge cases Released in v0.67.0 (532a645) index_order generic in the path (#12), DPI-export names bound (#31), per-edit move verification (#32), interface generate blocks on the connection surface (L-5), bare-instance bind targets (L-6), nested struct member_key (L-10), escaped identifiers in FileFacts::words; FACTS_FORMAT 22 → 23
Round 9: Semantic-token refresh Released in v0.67.0 (dc54b23) A rescan-time range answer refreshes only when the settled answer differs (#59); an edit that recolours another open file refreshes it (#60); lucisv_server only
Round 10: Resumable discovery walk & rescans Released in v0.67.0 (36733e2) lucisv_core::walk::ResumableWalk, 512-entry slices drained between (#58); store kept across rescans, streaming compaction, pre-sized candidates; #64 closed not reproducible; OpenTitan hw settings rescan 703 → 642 ms median, documentSymbol during it 133 → 2.8 ms (Take 6)
Round 11: Windows UNC URIs & editor polish Released in v0.67.0 (a479faf) uri.rs Flavor (Windows shapes as string code in uri/windows.rs): UNC, verbatim and query/fragment handled; Windows compile- and link-checked only; Windows index cache key changes once; mcp.js, hierarchyView.js, VS Code and Neovim README fixes
Round 12: Pure-move splits & hygiene Released in v0.67.0 (aa2259b) resolve.rs, parser/item.rs, parser/instance.rs, format/stmt.rs, lexer.rs split; 23 lucisv_server test modules moved out; reasons on all 12 bare #[ignore]; outputs byte-identical to Round 11
Take 6: performance report Released with v0.67.0 (f2d9ff0, 2e9da20) 0.66.2 against Rounds 1–12 on OpenTitan hw; three regressions bisected and left unfixed: multi-threaded formatter peak RSS +86–100 MiB (Round 5, cause confirmed), didOpen of a file over index.maxFileSize +~14 ms and workspace/symbol +~2 ms (Round 2)

The current source of truth for feature acceptance is each feature's QA/review log and TODO.md. The topology records the interfaces that future changes must preserve.

Repository map

Location Responsibility and starting point
crates/vlog_parser Lexer/trivia, strict and tolerant recursive descent, AST/spans; src/lib.rs, parser/, ast/
crates/vlog_formatter AST → document IR → printer, presets/auto styles (style.rs, auto.rs), alignment, fences/selection ranges, equivalence & convergence; format/mod.rs, verify.rs
crates/vlog_semantic File binding/resolution, workspace facts (FACTS_FORMAT = 23) and member lookup; bind/, resolve.rs, workspace/{mod,index,update,reexport,hierarchy,path_units}.rs, facts.rs, imports.rs
crates/vlog_linter 75-rule registry (registry.rs::all_rules: 8 Error, 24 Warning, 43 Style; 52 always on, 6 workspace-default, 17 opt-in; 10 Safe + 2 Unsafe fixes), lazy semantics, options, inline/external waivers; lib.rs, context.rs, registry.rs, waiver_file.rs
crates/vlog_refactor Rename/references (find_references_{with,batch,batch_with}, after_dot, home_set_for/home_sets_for, enclosing_unit, deterministic carry.rs), ports, imports, extract/inline module (extract/ CRLF-aware), instantiation plans, whole-edit verification; scope.rs, rename/, ports/, imports.rs, extract/, inline/, check/
crates/lucisv_core Config (STYLE_NAMES, FileConfig incl. the [format] override keys), lexical path::{normalize, normalize_under}, filelists, cycle-aware tracked and resumable (walk::ResumableWalk) walks and warning channel, format cache (14-field Entry: every effective formatting knob), unified diffs, atomic replacement; no language-engine dependency
crates/lucisv CLI argument handling, input discovery/dedup, worker pool (rayon), text and JSON reports (--output-format json in format and check mode), --rules-doc, and source writes
crates/lucisv_server Ordered LSP loop (after_scan, answer_from_the_buffer fast actions in ahead.rs/same_file.rs, versioned DocumentChanges), overlays & tombstoned incremental reindex (state/{discover,rescan,reconcile,incremental,watched}.rs), folding (directives.rs, instances.rs), semantic/instantiation tokens with exact refresh, sliced discovery walk (state/walking.rs), RFC 8089 file: URIs incl. Windows UNC (uri.rs, uri/windows.rs); composes all six libraries
crates/lucisv_mcp Model Context Protocol server for coding agents over stdio: project/ (KnownFacts cache, Stamp::first_mono), tools/ (9 tools in full mode — hierarchy, find, outline, read, check w/ dir/glob, rename, port, edit_item, format; --read-only offers the first five), rpc.rs (no "prompts": {}), apply.rs; composes the six libraries, never lucisv_server (docs/mcp/PLAN.md)
editors/ VS Code client (extension.js), TextMate grammar, commentKeywords.js, hierarchyCurrent.js, hierarchySections.js, referencesView.js, 8 commands + 44 non-rule & 75 per-rule settings (119 in all); Neovim config docs
tools/, scripts/, .gitea/workflows/ Guard (guard.sh), release gates (gates.sh), Linux helper (linux_check.sh), author stamp checker (stamp_author.py), corpus & release automation
docs/features/ Implementation contracts, dated measurements, QA and acceptance records
docs/site/ User-facing Starlight static documentation sources (src/) and tracked build artifacts (dist/)

Dependency architecture remains strict: vlog_parser and lucisv_core depend on no workspace crates; vlog_formatter and vlog_semantic depend on vlog_parser; vlog_linter and vlog_refactor depend on vlog_parser and vlog_semantic (plus lucisv_core for linter waivers, and vlog_formatter in tests only). lucisv composes core/parser/formatter/linter; lucisv_server and lucisv_mcp each compose all six libraries independently. External Rust dependencies stay pinned in Cargo.toml (rayon for CLI; lsp-server + lsp-types for lucisv_server; serde + serde_json for lucisv_server and lucisv_mcp).

Runtime contracts worth preserving

Formatting: strict parse, layout (Config incl. style, auto_style, uvm_utils_indent), normalized token comparison (including comments), then a second parse/format and convergence check. Failure returns an error, never a candidate output. format_selection expands ranges cleanly around statement/item boundaries and fences protect statement and class scopes; verification still covers the whole output. Cache entries key on content hash, line-length, indent, uvm-utils-indent, style, every [format] override knob (begin, else, else-after-label, port-lists, list-indent, alignment, connection-align-min), and lucisv version. --style auto lexes and parses the input once for all presets and verifies only the winner.

Linting: one prepared tokenization/tolerant parse (ParsedSource) feeds all 75 rules and lazy semantics. Six semantic rules (multiply-driven, undeclared-identifier, undriven-net, unknown-parameter, unknown-port, unused-signal) run automatically when a project/workspace oracle is present and stay off for single files or stdin unless explicitly selected. apply_fixes stays fence-blind; front ends (lucisv and lucisv_server) filter edits through vlog_formatter::fence::protected_regions.

Editor, index lifecycle & refactors: one ordered loop owns workspace mutation; server/ahead.rs permits read-only same_file and viewport token answers ahead of settled indexes only when buffer/settings preconditions hold, while workspace mutators (rename, codeAction/resolve, executeCommand, willRenameFiles) wait in after_scan across active scans (self.scanning). rename.rs and ports.rs emit versioned DocumentChanges::Edits when advertised. WorkspaceIndex::remove_file tombstones closed out-of-scope buffers in-place while keeping slot IDs stable until merge/absorb (callers iterate live_files()), symlinked files resolve deterministically by (dev, ino) / canonical path without basename gating, and open doc.large buffers retain their on-disk index record (subject to maxFileSize). FACTS_FORMAT is 23 (20 bind connections, 21 generate blocks, 22 top-rooted paths, 23 Round 8's escaped words, DPI-export references and interface generate blocks).

MCP & refactor parity: lucisv-mcp checks disk stamps (including first_mono settlement for future mtimes) before serving answers, implements KnownFacts on Project keyed by FNV-1a content_hash, shares after_dot and bind-aware home_set_for/home_sets_for with vlog_refactor, accepts files/directories/globs in both check and format, and enforces protocol byte budgets (3,800 B / 440 B in full mode, 2,000 B / 330 B in --read-only mode; actual Round 3 measurements: 3,469 B / 398 B full, 1,826 B / 297 B read-only).

Codebase size, resolved issues, and open work

  • Production file sizes (re-measured 2026-11-26 after Round 12, CLAUDE.md): counting non-blank, non-comment lines before #[cfg(test)] / mod tests (excluding */tests/), no production file exceeds 600 lines; only test-only crates/lucisv_server/src/perf.rs (907 lines, #[cfg(test)] module in main.rs) and test modules moved out of their files are above it. Top production files: lucisv/src/main.rs 574, vlog_parser/src/parser/module.rs 568, parser/split.rs 554, parser/sva.rs 542, vlog_refactor/src/extract/flow.rs 535, parser/class.rs 518, parser/covergroup.rs 517, lucisv_server/src/server/dispatch.rs 515, state/discover.rs 515. (The earlier lexer.rs 540 was a counting artifact; it was 771 and Round 12 split it.)
  • Closed since the 2026-10-14 (58520e5) refresh:
    • TODO §55 (decomposition-state, 2026-10-14), TODO §65.1–§65.4, and TODO §65.8 (tb. completion — closed WON'T FIX 2026-11-26 per Owner Decision #3: "no").
    • docs/topo.md §2.9 handshakes #33 (v0.51.0), #34 (v0.50.0), #36 (v0.62.0 scope-relative ruling), #37–#40, #48 (won't-fix by owner ruling), #49–#54, #56, and #61–#63 (plus #35 moot since M7); in Rounds 4–12 #1, #11, #12, #31, #32, #41, #42, #44–#47, #55, #57–#60, #64 (not reproducible), #65, #66.
    • oct_review.md: L-1–L-4, L-12, L-13 fixed 2026-10-14; L-9 (MCP/engine dotted-spelling & K2 bind home-set parity) closed in Round 3 (69383ea); L-5, L-6, L-10 closed in Round 8 (532a645).
  • Remaining open work (tracked in topo.md §2.9, TODO.md, and oct_review.md):
    • Open handshakes in docs/topo.md §2.9: #67 (lucisv_core::config::parse_array splits lucisv.toml arrays at quoted commas; Round 7), #68–#70 (three ignored OpenTitan tests that fail when run, instances in interface blocks listed while direct ones are not, \\foo vs foo across files; Round 8) and #71–#74 (absorb a third of a 40k rescan, memory growth across rescans, stale completion words after a mid-scan edit, three walks still one-call; Round 10).
    • Known regressions measured by Take 6 and left as is in v0.67.0 (performance_take6.md, "Regression causes"): formatter peak RSS with all workers +86 MiB median (default 568 → 654 MiB; Round 5, cause confirmed); didOpen of a file over index.maxFileSize ~14 ms slower and workspace/symbol ~2 ms slower (Round 2; one partly confirmed, one a candidate).
    • Open TODO.md: §65.6 (`include-fragment standalone analysis), §71 unclosed follow-ups; oct_review.md: L-7, L-8, L-11.
    • Known runtime constraint: cross-file macro expansion / full compiler elaboration remain intentional non-goals (99.3% — 814/820 — on the frozen corpus).
    • Manual VS Code extension-host acceptance (manual-acceptance.md): 0.65.x overnight features (§71) and Round 1–12 fixes remain pending a human VS Code walkthrough (only 0.66.1 instance folding was spot-checked by the owner in running VS Code).

Validation of this refresh

Documentation-only refresh for v0.67.0 (no .rs, .js, tools/, scripts/ or Cargo inputs changed by it). Gate figures are those recorded on the release tree:

  • Rust suites (cargo test -p <crate> --all-targets, guarded; Round 12 QA, equal to the Round 11 gate logs): vlog_parser 527/0 [2 ign]; vlog_semantic 453/0 [4 ign]; vlog_refactor 793/0 [5 ign]; vlog_formatter 383/0 [0 ign]; vlog_linter 710/0 [0 ign]; lucisv_core 129/0 [0 ign]; lucisv 162/0 [0 ign]; lucisv_server 2,263/0 [53 ign]; lucisv_mcp 400/0 [3 ign].
  • Doc tests: 1 passed. VS Code Node tests: 37 passed. Corpus: 814/6, unchanged.
  • OpenTitan hw: 4,039 of 4,046 files format cleanly in every style, 0 verification failures; lucisv check hw 1,178 findings (Take 6).
  • This refresh itself ran ./tools/gates.sh --only docs,stamp and python3 tools/stamp_author.py --check; the full gate run on the release tree is the lead's.
  • docs/site/dist/ is regenerated from docs/site/src/ and was not rebuilt here.