Files
lucisv/docs/features/docs-sync-r4/README.md
T

127 lines
21 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- Author: Guoliang Chen, a Senior Digital Design Engineer -->
# docs-sync-r4 — Documentation, Feature Status, and Site Sync
## Goal
Synchronize repository-wide documentation, backlog status, QA checklists, feature records, and Starlight documentation sources (`docs/site/src/`) to the live repository state after Round 3 (`69383ea`, v0.66.2), resolving drifted counts, closing `TODO.md §65.8` (`tb.` completion) as WON'T FIX per Owner Decision #3, reconciling Round 1–3 fixes (`refactor-correctness-r1`, `server-ordering-r1`, `index-lifecycle-r2`, `mcp-hardening-r3`) and v0.60–v0.66.2 releases across project docs, while preserving untouched `docs/site/dist/` when no local Astro toolchain is available and maintaining strict Round 4B file ownership.
## Assumptions
- Baseline commit is `69383ea` (`Round 3: MCP hardening...`); cargo workspace version is `0.66.2` (`CHANGELOG.md` 2026-11-24; `docs/site/package.json` `0.9.0`).
- Strict Lane 4B file ownership applies: only `README.md`, `CLAUDE.md`, `TODO.md`, `docs/repository-analysis.md`, `docs/topo.md`, `docs/manual-acceptance.md`, `docs/features/instantiation-highlighting/README.md`, `docs/features/localized-reindex/README.md`, `docs/site/src/`, and `docs/features/docs-sync-r4/README.md` are modified. No code under `crates/`, `tools/`, `scripts/`, `editors/`, `Cargo.toml`, or `.gitea/` is altered.
- Handshakes `#57`, `#65`, `#66` and open Rounds 5–12 items in `docs/topo.md §2.9` stay open until Lane 4A lands and Lead closes them.
- Core policies, invariants, and workflow sections in `CLAUDE.md` remain unaltered; only factual size measurements are refreshed.
- `docs/site/node_modules` and global `astro` are absent locally and network `npm install` is forbidden, so `docs/site/dist/` remains untouched and must be rebuilt in an environment with `@astrojs/starlight`.
## Handshakes
- **Owner Decision #3 (`TODO.md §65.8`):** `tb.` hierarchical completion decision resolved as **"no"** (`2026-11-26`); kept "an unknown head answers nothing" behavior and closed `§65.8` as WON'T FIX.
- **`docs/topo.md` (`#35`, `#36`, Round 1–3):** Verified `#35` marked moot (`M7`); closed `#36` (`scope-relative by design` ruling closed in `TODO §65.2` / v0.62.0); updated §1–§3 crate counts (9), `serde`/`serde_json` dependency ownership (`lucisv_server` + `lucisv_mcp`), `FACTS_FORMAT = 22`, §1.4 contract rows (`instance-folding`, `stamp-author`, `refactor-correctness-r1`, `server-ordering-r1`, `index-lifecycle-r2`, `mcp-hardening-r3`), §2.8 RO/full MCP byte budgets (`2,000/330` & `3,800/440`), and §3.1–§3.3 maps while leaving `#57`, `#65`, `#66` open for Lane 4A + Lead.
- **`docs/site/dist/` rebuild required:** `docs/site/src/content/docs/` pages (`index.mdx`, `start/quick-start.md`, `start/configuration.md`, `guides/{agents,editors,formatter,linter,syntax}.md`, `reference/{cli,language-tools,architecture,rust-api}.md`) were updated, while prebuilt `docs/site/dist/` was intentionally left untouched because `docs/site/node_modules` and `astro` (`@astrojs/starlight`) are not installed locally. Rebuild `docs/site/dist/` cleanly with `cd docs/site && npm ci && ASTRO_TELEMETRY_DISABLED=1 npm run build` before deployment.
## Status / TODO
- [x] Verify live repository metrics (`crates/`, `registry.rs`, `facts.rs`, `Cargo.toml`, line counts, `editors/vscode/package.json`, and `./tools/gates.sh --only suites,docs,node`) on `69383ea`
- [x] Close `TODO.md §65.8` as WON'T FIX (2026-11-26, Owner Decision #3: "no")
- [x] Sync `docs/topo.md` (§1–§3, `#36`, `FACTS_FORMAT=22`, 9 crates, Round 1–3 contracts, preserving `#57`, `#65`, `#66` open)
- [x] Sync `docs/repository-analysis.md` to v0.66.2 (`69383ea`)
- [x] Sync `README.md` and `CLAUDE.md` (preserving all core `CLAUDE.md` policies/invariants)
- [x] Sync `docs/manual-acceptance.md`, `docs/features/instantiation-highlighting/README.md`, and `docs/features/localized-reindex/README.md`
- [x] Sync `docs/site/src/` sources (leaving `docs/site/dist/` untouched and documenting rebuild requirement)
- [x] Run final verification (`python3 tools/stamp_author.py --check`, doc link/sanity checks, `git status --short`, `git diff --stat`)
## Work log
- **2026-11-26 — Initial metric verification on `69383ea`:**
- Verified 9 workspace crates (`vlog_parser`, `vlog_semantic`, `vlog_refactor`, `vlog_formatter`, `vlog_linter`, `lucisv_core`, `lucisv`, `lucisv_server`, `lucisv_mcp`), version `0.66.2` (`Cargo.toml`, `editors/vscode/package.json`, `CHANGELOG.md` 2026-11-24; `docs/site/package.json` `0.9.0`), `FACTS_FORMAT = 22`.
- Verified linter rule breakdown in `crates/vlog_linter/src/registry.rs` & `rules/*.rs`: **74** rules (**7** Error, **24** Warning, **43** Style; **51** always on, **6** `needs_workspace` project-default, **17** opt-in; **10** Safe fixes + **1** Unsafe fix `always-comb`).
- Verified VS Code manifest (`editors/vscode/package.json`): **8** commands, **37** non-rule settings + **74** `lucisv.lint.rules.<rule>` toggles.
- Verified production line counts (`crates/*/src/**/*.rs` non-blank non-comment before `#[cfg(test)]`/`mod tests`, excl. `*/tests/`): only test-only `lucisv_server/src/perf.rs` (`907`, `#[cfg(test)]` in `main.rs`) exceeds `600`; all non-test production files are `<= 587` (`resolve.rs` `587`, `parser/item.rs` `582`, `parser/instance.rs` `569`, `parser/module.rs` `560`, `format/stmt.rs` `556`, `parser/sva.rs` `542`, `lexer.rs` `540`, `extract/flow.rs` `535`, `server/dispatch.rs` `522`, `parser/class.rs` `518`, `parser/covergroup.rs` `517`, `state/discover.rs` `510`).
- Executed `./tools/gates.sh --only suites,docs,node` on `69383ea`: **PASS** across all 11 steps — 9 Rust crates **5,637 passed, 0 failed, 68 ignored** (`vlog_parser` 521/0 [2 ign], `vlog_semantic` 438/0 [4 ign], `vlog_refactor` 769/0 [6 ign], `vlog_formatter` 376/0 [0 ign], `vlog_linter` 672/0 [0 ign], `lucisv_core` 119/0 [0 ign], `lucisv` 151/0 [0 ign], `lucisv_server` 2,192/0 [52 ign], `lucisv_mcp` 399/0 [4 ign]), `docs` **1/0**, `node` **37/0**.
- **2026-11-26 — Docs & site synchronization:**
- `TODO.md`: Closed `§65.8` (`tb.` completion) as WON'T FIX (2026-11-26, Owner Decision #3: "no"); preserved all unrelated history.
- `docs/topo.md`: Updated header snapshot (`2026-11-26`, `69383ea`, `v0.66.2`, `FACTS_FORMAT = 22`), module count (`nine workspace crates`), `serde`/`serde_json` deps (`lucisv_server` + `lucisv_mcp`), §1.2 dependency edges, §1.4 contract rows (`instance-folding`, `stamp-author`, `refactor-correctness-r1`, `server-ordering-r1`, `index-lifecycle-r2`, `mcp-hardening-r3`), §2.8 budgets (`2,000/330` RO, `3,800/440` full) and `#54` stamp note, closed `#36` (`TODO §65.2` scope-relative ruling), kept `#35` moot and `#57`/`#65`/`#66` open, updated §3.1/§3.2 (`lucisv_mcp` added to Mermaid graph)/§3.3 choke points and file sizes.
- `docs/repository-analysis.md`: Refreshed from `v0.60.0` (`58520e5`, `2026-10-14`) to `v0.66.2` (`69383ea`, `2026-11-26`), covering `0.61`–`0.66.2`, Rounds 1–3, closed issues (`#33–#34`, `#36`, `#37–#40`, `#48–#54`, `#56`, `#61–#63`, `§55`, `§65.1–§65.4`, `§65.8`, `oct_review.md` L-9), current `FACTS_FORMAT = 22`, and live gate results.
- `CLAUDE.md` & `README.md`: Appended `2026-11-26` (`0.66.2` / `69383ea`) file-size measurement in `CLAUDE.md` while keeping all policies, invariants, and workflow rules intact; fixed `README.md` binary lists (`{lucisv,lucisv-server,lucisv-mcp}`), closed handshake #33 note, and outdated `dry_run` / `lucisv.mcp.mode` MCP summary.
- `docs/manual-acceptance.md`, `docs/features/instantiation-highlighting/README.md`, `docs/features/localized-reindex/README.md`: Added manual QA steps `28–34` (`v0.61`–`v0.66.2` & Round 3 `check` dir/glob); reconciled `instantiation-highlighting` historical Windows-host note with `v0.65.0` delivery + trunk gates; reconciled `localized-reindex` F6 (`v0.65.8`), P1 (`#48` WON'T FIX), and P2/P3 (`#49`/`#51` Round 2).
- `docs/site/src/content/docs/`: Updated `index.mdx` (`74` rules, `3` binaries), `start/quick-start.md`, `start/configuration.md` (`[format].style`, 37-setting coverage incl. `mcp.*`, `commentKeywords.*`, `references.fullLineView`, `hierarchy.highlightCurrent`, `inlineKeywords`, `autoEnd`, updated cache key), `guides/formatter.md` (`## Named styles`, fixed cache note), `guides/linter.md` (all 6 workspace-default rules), `guides/editors.md`, `guides/agents.md` (`check` path/dir/glob description), `guides/syntax.md` (generate-block/top-rooted path resolution), `reference/cli.md` (`--style`), `reference/language-tools.md` (ranges formatting, `autoEnd`, `ifdef`/instance folding, closed handshake #33, buffer-first `same_file` actions, cursor-at-end), `reference/architecture.md` (`lucisv_mcp`, codec 22, v0.66.2 & Rounds 1–3, 3-binary `.vsix`), and `reference/rust-api.md` (`v0.66.2` / `69383ea`, `FACTS_FORMAT = 22`, `Style`/`format_selection`/`format_auto`, `WorkspaceIndex`/`FileFacts` methods, `vlog_refactor` Rounds 1/3 exports, `lucisv_core` `diff`/`STYLE_NAMES`/`walk` tracked variants).
- Checked `docs/site/`: `node_modules` and global `astro` are absent (`which astro` -> not found), so `docs/site/dist/` was left strictly untouched.
- **2026-11-26 — QA Fix Pass (Findings 1–5):**
1. `README.md:91-92`: Added `style` to the format cache key tuple matching `crates/lucisv_core/src/cache.rs:32-46, 118-120` (`content`, `line-length`, `indent`, `uvm-utils-indent`, `style`, lucisv version).
2. `docs/manual-acceptance.md:39` (Step 28): Corrected `aes_control_fsm_n.sv` instantiation span to lines `382-486` (fold ending line `485`, leaving `);` on line `486` outside the fold), moved the `` `ifdef `` fold check to real OpenTitan file `hw/ip/aes/rtl/aes_cipher_core.sv:793-930` (`` `ifdef INC_ASSERT `` ... `` `endif ``), and clarified collapsible vs sticky-scroll behavior.
3. `docs/manual-acceptance.md:42` (Step 31): Aligned expected behavior with `docs/features/comment-highlighting/README.md:21-29, 65-72, 353-358`: lucisv highlights comment keywords and `begin`/`end`/`fork`/`join` rainbow delimiters, while VS Code's own `bracketPairColorization` handles `()`/`[]` and stops coloring brackets in comments once background tokenization finishes (or settles after a `/*` edit).
4. `docs/site/src/content/docs/reference/architecture.md:13-17`: Added `MCP server` (`lucisv_mcp` / `lucisv-mcp`) to `Primary consumers` for `vlog_formatter`, `vlog_linter`, `vlog_semantic`, `vlog_refactor`, and `lucisv_core`.
5. `README.md:1008`: Updated comment to `# target/release/{lucisv,lucisv-server,lucisv-mcp}` consistently listing all three release binaries.
## QA log
### 2026-11-26 — Round 4 Lane 4B QA
**Verdict: FAIL** (3 concrete factual errors in `README.md` and `docs/manual-acceptance.md`, plus 2 minor consistency gaps; all counts, `TODO.md §65.8`, `docs/topo.md`, `CLAUDE.md`, `docs/repository-analysis.md`, `docs/site/src/` links, `stamp_author.py --check`, and `gates.sh` checks otherwise verified accurate).
#### Findings
1. **Stale format cache key in `README.md:91-92` (BLOCKING — code vs. doc contradiction):**
- `README.md:91-92` (`### Cache`) still states: ``An entry is keyed on **(content hash, `line-length`, `indent`, `uvm-utils-indent`, lucisv version)** per file``.
- `crates/lucisv_core/src/cache.rs:32-46,118-120` includes **`style`** (added in `v0.65.5`) as a 5th field in `Entry` (7-field store line: `content`, `line_length`, `indent`, `uvm_utils_indent`, `style`, `VERSION`, `path`). While `docs/site/src/content/docs/start/configuration.md:132` and `docs/repository-analysis.md:317` were updated to list `style`, `README.md:91-92` was left stale.
2. **Inaccurate example file/lines and missing `` `ifdef `` blocks in `docs/manual-acceptance.md:39` Step 28 (BLOCKING — verified against OpenTitan):**
- Step 28 instructs: ``Open a long module with multi-line instantiations and `` `ifdef `` blocks (e.g. `hw/ip/aes/rtl/aes_control_fsm_n.sv:382-594`). Scroll into an instantiation's port list and into an `` `ifdef `` branch.``
- Verified directly against `/Users/lucio/repo/opentitan/hw/ip/aes/rtl/aes_control_fsm_n.sv`:
- The file contains **zero** `` `ifdef `` / `` `else `` / `` `endif `` directives (`grep '`if'` returns no matches), so a tester cannot scroll into an `` `ifdef `` branch in that file.
- The `aes_control_fsm #(` instantiation spans lines **382–486** (ending at `);` on line 486, not `594`; line 596 is a separate `prim_buf #(` instantiation, as already noted in `docs/features/instance-folding/README.md:30-33`).
- Also clarify `"stay pinned with the closing ); visible"` — while scrolled inside a long port list, `);` is below the viewport; the contract is that the fold ends on line `485` so collapsing or reaching the end leaves `);` visible.
3. **Inaccurate `comment-highlighting` Part 1 claim in `docs/manual-acceptance.md:42` Step 31 (BLOCKING — contradicts `docs/topo.md:389`, `TODO.md:7350`, and `docs/features/comment-highlighting/README.md`):**
- Step 31 expects: ``parentheses/brackets inside comments and strings receive no rainbow bracket colouring.``
- Per `docs/features/comment-highlighting/README.md:25-29,65-72,353-358`, `docs/topo.md:389` (`"bracket colour in comments is VS Code's (explained, not changed)"`), and `TODO.md:7350`, lucisv's own rainbow (`editors/vscode/extension.js`) only colors `begin`/`end`/`fork`/`join`, while bracket-pair coloring on `()`/`[]` comes from VS Code (`editor.bracketPairColorization`) and *still* transiently colors brackets inside comments on newly opened large files until background tokenization finishes (and briefly across `/*` edits). Step 31 should match `comment-highlighting/README.md:353-358` (verifying steady-state comments/large `.sv` files lose transient bracket colors once tokenization finishes) rather than asserting unconditional suppression.
4. **Minor consistency gaps (non-blocking / clean up during fix pass):**
- `docs/site/src/content/docs/reference/architecture.md:13-17`: `Primary consumers` in the crate table still omits `lucisv-mcp` / `lucisv_mcp` for `vlog_formatter`, `vlog_linter`, `vlog_semantic`, `vlog_refactor`, and `lucisv_core`, despite adding `lucisv_mcp` on line 20 and stating on lines 66-67 that `lucisv_mcp` composes all six libraries.
- `README.md:1008`: `# target/release/lucisv-server (and target/release/lucisv)` was left with 2 binaries while `README.md:1097` was updated to `{lucisv,lucisv-server,lucisv-mcp}`.
#### Verification Summary
- **Ownership & diff scope (`git -C <worktree> status --short`, `git diff --stat`):**
- Strictly confined to `CLAUDE.md`, `README.md`, `TODO.md`, `docs/topo.md`, `docs/repository-analysis.md`, `docs/manual-acceptance.md`, `docs/features/instantiation-highlighting/README.md`, `docs/features/localized-reindex/README.md`, `docs/site/src/content/docs/`, and untracked `docs/features/docs-sync-r4/README.md`.
- **Zero** changes in `Cargo.toml`, `crates/`, `tools/`, `scripts/`, `.gitea/`, `editors/`, or `docs/site/dist/` (and `docs/site/dist/` rebuild requirement is documented in `docs/features/docs-sync-r4/README.md`).
- **Adversarial code fact-checks (all verified directly in `<worktree>`):**
- Workspace crates (`9`), version (`0.66.2` across `Cargo.toml`, `crates/*/Cargo.toml` via `workspace = true`, `editors/vscode/package.json`, `CHANGELOG.md`; `docs/site/package.json` `0.9.0`), `FACTS_FORMAT = 22` (`crates/vlog_semantic/src/facts.rs:177`): **PASS**.
- Linter registry (`crates/vlog_linter/src/registry.rs`, `rules/*.rs`): **74** rules (**7** Error, **24** Warning, **43** Style; **51** always on, **6** `needs_workspace` project-default, **17** opt-in; **10** Safe fixes incl. `suggest-parentheses` + **1** Unsafe fix `always-comb`), and `docs/site/src/content/docs/reference/rules.md` table matches all 74 rules: **PASS**.
- VS Code manifest (`editors/vscode/package.json`): **8** commands, **37** non-rule settings + **74** `lucisv.lint.rules.<rule>` toggles (all 37 non-rule settings documented with matching defaults in `docs/site/src/content/docs/start/configuration.md`): **PASS**.
- Production line counts (`crates/*/src/**/*.rs`, non-blank non-comment lines before `#[cfg(test)]`/`mod tests`, excl. `*/tests/`): only `#[cfg(test)]` `crates/lucisv_server/src/perf.rs` (`907`) exceeds `600`; all non-test production files are `<= 587` (`resolve.rs` 587, `parser/item.rs` 582, `parser/instance.rs` 569, `parser/module.rs` 560, `format/stmt.rs` 556, `parser/sva.rs` 542, `lexer.rs` 540, `extract/flow.rs` 535, `server/dispatch.rs` 522, `parser/class.rs` 518, `parser/covergroup.rs` 517, `state/discover.rs` 510): **PASS**.
- `TODO.md §65.8`: only line 7131 modified (closed WON'T FIX `2026-11-26`, Owner Decision #3: `"no"`), unrelated history untouched: **PASS**.
- `CLAUDE.md`: only lines 104–114 appended with the `2026-11-26` size re-measurement; all hard invariants, standards, and workflow rules untouched: **PASS**.
- `docs/topo.md`: `#35` marked moot (`M7`), `#36` closed (`2026-10-19`, `TODO §65.2`, `v0.62.0`, `14`/`12` verified in `crates/lucisv_server/tests/opentitan_references.rs`), `#57`, `#65`, `#66` and remaining open handshakes (`#1`, `#11–12`, `#31–32`, `#41–42`, `#44–47`, `#55`, `#58–60`, `#64`) preserved open; Round 1–3 (`8f5a4fb`, `4d384ec`, `69383ea`) contracts, Mermaid graphs, and MCP byte budgets (`2,000/330 B` RO, `3,800/440 B` full; measured `1,826/297 B` & `3,469/398 B`) verified against code: **PASS**.
- `docs/site/src/content/docs/reference/rust-api.md` public symbols/methods & internal links: all cited symbols verified in `crates/{vlog_parser,vlog_formatter,vlog_linter,vlog_semantic,vlog_refactor,lucisv_core}/src/`; **107** relative/site markdown links across **22** modified + site files and all HTML `href`s in `index.mdx` verified valid: **PASS**.
- **Executed gates inside `<worktree>`:**
- `./tools/gates.sh --only suites,docs,node`: **PASS** (`5,637` passed, `0` failed, `68` ignored across 9 crates — `vlog_parser` 521/0 [2 ign], `vlog_semantic` 438/0 [4 ign], `vlog_refactor` 769/0 [6 ign], `vlog_formatter` 376/0 [0 ign], `vlog_linter` 672/0 [0 ign], `lucisv_core` 119/0 [0 ign], `lucisv` 151/0 [0 ign], `lucisv_server` 2,192/0 [52 ign], `lucisv_mcp` 399/0 [4 ign]; `docs` `1/0`; `node` `37/0`).
- `python3 tools/stamp_author.py --check`: **PASS** (`would stamp 0 files; left 249 untouched`).
### 2026-11-26 — Round 4 Lane 4B QA Re-Verification
**Verdict: PASS** (all 3 blocking findings and both minor consistency items verified fixed against code, OpenTitan RTL, and feature records; ownership and gates clean).
#### Re-Verification Checks
1. **`README.md:91-92,1008` — PASS:**
- `README.md:91-92` now lists `(content hash, line-length, indent, uvm-utils-indent, style, lucisv version)`, matching `crates/lucisv_core/src/cache.rs:32-46,118-120`.
- `README.md:1008` now lists `# target/release/{lucisv,lucisv-server,lucisv-mcp}` consistently with `README.md:1097`.
2. **`docs/manual-acceptance.md:39,42` (Steps 28 & 31) — PASS:**
- Step 28 (`line 39`): Verified `hw/ip/aes/rtl/aes_control_fsm_n.sv:382-486` (`382`: `aes_control_fsm #(`, `385`: `) u_aes_control_fsm (`, `486`: `);`, fold ending `485`) and `hw/ip/aes/rtl/aes_cipher_core.sv:793-930` (`793`: `` `ifdef INC_ASSERT ``, `930`: `` `endif `` outside the fold) against `/Users/lucio/repo/opentitan` and `docs/features/instance-folding/README.md:30-33` / `docs/features/ifdef-folding/README.md:48-52`.
- Step 31 (`line 42`): Aligned with `docs/features/comment-highlighting/README.md:21-29,65-72,353-358`, distinguishing `commentKeywords` / `begin`-`end` rainbow delimiters from VS Code's `bracketPairColorization` settling after background tokenization (or `/*` edits).
3. **`docs/site/src/content/docs/reference/architecture.md:13-17` — PASS:**
- `Primary consumers` for `vlog_formatter`, `vlog_linter`, `vlog_semantic`, `vlog_refactor`, and `lucisv_core` now include `MCP server` alongside CLI/language server.
4. **Containment & Final Gates (inside `<worktree>`):**
- `git status --short` / `git diff --stat`: strictly the 20 owned docs/site files plus `docs/features/docs-sync-r4/README.md`; zero changes in `Cargo.toml`, `crates/`, `tools/`, `scripts/`, `.gitea/`, `editors/`, or `docs/site/dist/`.
- `python3 tools/stamp_author.py --check`: **PASS** (`would stamp 0 files; left 249 untouched`, re-verified after this QA log edit).
- `./tools/gates.sh --only docs,node`: **PASS** (`docs` `1/0`, `node` `37/0`; no Rust/JS code modified since the earlier full `suites,docs,node` pass of `5,637` Rust + `1` doc + `37` node).
## Review
**Lead Self-Inspect (2026-11-26): APPROVED for trunk commit.**
- Merged Lane 4B cleanly onto trunk after QA Re-Verification PASS across `README.md`, `CLAUDE.md`, `TODO.md` (`§65.8` WON'T FIX), `docs/topo.md`, `docs/repository-analysis.md`, `docs/manual-acceptance.md`, feature READMEs, and `docs/site/src/` (`docs/site/dist/` untouched pending Astro toolchain).
<!-- Author: Guoliang Chen. Lucisv is made by Guoliang Chen with love, luciochen.com -->