Rename the tool to lucisv (Language Utility for Coding In SystemVerilog)
This commit is contained in:
1 parent
a284e33110
commit
eeaffafd56
188 files changed
+2825
-2802
No files matched your search
@@ -8,7 +8,7 @@ lines is meant to be **aligned** (padded to a common column) or **flush-left**
|
||||
most-loved formatter feature and the reason RTL teams tolerate a formatter at
|
||||
all: hand-aligned port lists, connection lists and parameter tables are how
|
||||
Verilog is read, and a formatter that flattens them is a formatter nobody
|
||||
runs. vfmt's rule is Verible's, minus the configuration surface: four or more
|
||||
runs. lucisv's rule is Verible's, minus the configuration surface: four or more
|
||||
excess spaces before a column's token means "align this", a group already
|
||||
sitting at one column stays there, and everything else formats exactly the way
|
||||
it did before this feature existed. The two layouts are fixed points of each
|
||||
@@ -22,7 +22,7 @@ than by luck.
|
||||
write in that position, not against zero: one space before a declaration's
|
||||
name, none before a connection's `(`. So `localparam int A = 1;` (five
|
||||
spaces) is a hint and `localparam int A = 1;` (four) is not.
|
||||
- **A tab counts as one space.** vfmt's `no-tabs` lint wants them gone anyway,
|
||||
- **A tab counts as one space.** lucisv's `no-tabs` lint wants them gone anyway,
|
||||
and guessing a tab stop would make the verdict depend on a setting the
|
||||
formatter does not have.
|
||||
- **A group is a run of *adjacent* rows of one construct.** Alignment never
|
||||
@@ -200,7 +200,7 @@ can agree.
|
||||
build time.
|
||||
|
||||
**Requested of nobody.** No other crate changed; `vlog_semantic`,
|
||||
`vlog_linter` and `vfmt_server` compile and pass unmodified.
|
||||
`vlog_linter` and `lucisv_server` compile and pass unmodified.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
@@ -228,12 +228,12 @@ can agree.
|
||||
Same shape as a named connection; the same argument applies.
|
||||
- [ ] **Parked:** the direction/type column of a port list (`input ` vs
|
||||
`output`) and the type column of a declaration. Verible aligns these as
|
||||
separate columns; vfmt collapses `input wire` to `input wire`. Adding
|
||||
separate columns; lucisv collapses `input wire` to `input wire`. Adding
|
||||
them means a row's *first* cell splits too, and the hint rule then has
|
||||
to decide what a group means when one column is hinted and another is
|
||||
not.
|
||||
- [ ] **Parked:** the trailing-comment column. Verible aligns `// ...` after a
|
||||
port list; vfmt writes one space. This is the most visible remaining
|
||||
port list; lucisv writes one space. This is the most visible remaining
|
||||
gap on real RTL.
|
||||
- [ ] **Parked:** `wire`/`logic` data declarations and `struct` members. Both
|
||||
are ordinary declaration rows; neither has the same cultural pull as the
|
||||
@@ -353,7 +353,7 @@ Verified claims 1-5. Result: **PASS, no blocking findings.**
|
||||
nothing the dev's own 2312-run sweep didn't already cover, but reproduces
|
||||
cleanly.
|
||||
- **`ibex_core.sv` regression (claim 2, design-bug story).** Reproduced at
|
||||
`--line-length 60`: the current code converges (`vfmt --check` clean after
|
||||
`--line-length 60`: the current code converges (`lucisv --check` clean after
|
||||
one pass, and `twice()`-style double-format is byte-identical). The
|
||||
regression test `a_group_that_alignment_gives_up_on_still_converges` in
|
||||
`tests/verification.rs` exercises the same shape
|
||||
@@ -493,5 +493,5 @@ Points reviewed and accepted:
|
||||
|
||||
The author-intent rule shipped matches Verible's culture: ≥4 excess
|
||||
spaces or existing consistent columns opts in; single-space code stays
|
||||
exactly as vfmt always wrote it — no existing user's output moves
|
||||
exactly as lucisv always wrote it — no existing user's output moves
|
||||
unless they asked.
|
||||
@@ -9,7 +9,7 @@ of this round — stops being a parse error. The lead's decision, taken before
|
||||
any code was written, is that all of it is **verbatim pass-through**, exactly
|
||||
like `constraint { ... }` and `covergroup ... endgroup` already are: the
|
||||
property/sequence expression grammar (`|->`, `|=>`, `##[1:3]`, `[*2]`,
|
||||
`throughout`, `disable iff`, `$rose`, `$past`) is a second language that vfmt
|
||||
`throughout`, `disable iff`, `$rose`, `$past`) is a second language that lucisv
|
||||
models nowhere else, and there is no layout convention worth inventing for it.
|
||||
The payoff of a hand-rolled property grammar would be zero; the risk — a new
|
||||
place to drop a token — would be real.
|
||||
@@ -202,7 +202,7 @@ blocker, it passes.
|
||||
Key decisions and how they were reached:
|
||||
|
||||
1. **Reused `ItemKind::Verbatim` rather than adding an assertion variant.**
|
||||
The classes round already documents that leaf as "a block vfmt
|
||||
The classes round already documents that leaf as "a block lucisv
|
||||
deliberately does not model, kept byte-for-byte", and every consumer
|
||||
already treats it as opaque. A new item variant would have bought nothing
|
||||
and cost exhaustive-match arms in four crates. Only the *statement* side
|
||||
@@ -235,7 +235,7 @@ Key decisions and how they were reached:
|
||||
consequence — an action block that stays at column 1 under an assertion
|
||||
indented to column 3 — is the correct trade: those bytes are string *data*.
|
||||
5. **`verify.rs` untouched.** All 13 corpus files pass through the runtime
|
||||
safety net (`scripts/score.sh` runs `vfmt --check`, which verifies), so no
|
||||
safety net (`scripts/score.sh` runs `lucisv --check`, which verifies), so no
|
||||
forgiveness needed widening. The 12 attack pairs were written anyway and
|
||||
each one is refused: a changed `|->` → `|=>`, a changed `##[1:3]` range, a
|
||||
dropped `disable iff` clause, a dropped action block, a dropped label, a
|
||||
@@ -265,7 +265,7 @@ already are; `vlog_linter/src/visit.rs`'s `walk_stmts` ends in `_ => {}` so it
|
||||
needed no arm at all. The text-driven rules still work over these lines —
|
||||
checked by hand on a file with a tab-indented and trailing-whitespaced
|
||||
assertion, which reported `no-tabs` and `no-trailing-whitespace` at the right
|
||||
columns. `vfmt check` runs clean (exit 0/1) on all 13 new files; that is part
|
||||
columns. `lucisv check` runs clean (exit 0/1) on all 13 new files; that is part
|
||||
of what `scripts/score.sh` counts as a pass.
|
||||
|
||||
Files changed:
|
||||
|
||||
@@ -280,7 +280,7 @@ Targeted attacks:
|
||||
refuses to let that reach the file. **NON-BLOCKING** per the hard
|
||||
invariants (no corruption occurred; input is left untouched on disk), but
|
||||
worth a follow-up: comments in that position currently make the file
|
||||
unformattable via vfmt rather than being preserved and formatted. Same
|
||||
unformattable via lucisv rather than being preserved and formatted. Same
|
||||
class of gap reproduces for a comment right after the module name / before
|
||||
the instance name of the `bind`'s instantiation tail — not otherwise
|
||||
explored in depth.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Goal
|
||||
|
||||
Give vfmt the backbone Verible's formatter has: a large table of small
|
||||
Give lucisv the backbone Verible's formatter has: a large table of small
|
||||
text-in/text-out `{input, expected}` pairs, organized by construct, that runs
|
||||
on every `cargo test`. Verible's `formatter_test.cc` is thousands of such
|
||||
pairs and is where years of edge cases live; the existing snapshot suite in
|
||||
@@ -244,7 +244,7 @@ form as the wanted output.
|
||||
between committing a red test and losing the finding; with it, the wanted
|
||||
output is committed and the case flips green when the bug is fixed.
|
||||
- Derived every expected output by piping the input through
|
||||
`target/debug/vfmt -`, then reviewed each one by hand against the "Style"
|
||||
`target/debug/lucisv -`, then reviewed each one by hand against the "Style"
|
||||
section of the top-level `README.md`. Four outputs failed that review and
|
||||
became the `#SKIP` cases; six more are recorded above as style observations
|
||||
where the output is defensible but debatable.
|
||||
@@ -287,7 +287,7 @@ then restoring them byte-for-byte (`diff` confirmed clean).
|
||||
documented failures, with error text matching the README's bug write-ups
|
||||
verbatim (idempotency divergence at line 3, token-stream divergence at
|
||||
index 9/12, and the un-indented multi-instance continuation). Also
|
||||
reproduced each bug independently via `target/debug/vfmt -` on a minimal
|
||||
reproduced each bug independently via `target/debug/lucisv -` on a minimal
|
||||
repro; error messages match character-for-character.
|
||||
|
||||
**Findings**
|
||||
@@ -322,7 +322,7 @@ then restoring them byte-for-byte (`diff` confirmed clean).
|
||||
supported), and no case exercises a bare module-level `case` without a
|
||||
`generate` wrapper (module-level `if`/`for` both have non-generate cases
|
||||
in `generate.cases`, `case` doesn't). Confirmed both parse and format
|
||||
correctly via `target/debug/vfmt -` — the formatter isn't wrong, the
|
||||
correctly via `target/debug/lucisv -` — the formatter isn't wrong, the
|
||||
table just doesn't pin either down. Minor others: `always` with a
|
||||
comma-separated (not `or`-separated) sensitivity list, multiple `import`
|
||||
statements in one module. None of these are blocking; they're the kind
|
||||
@@ -331,7 +331,7 @@ then restoring them byte-for-byte (`diff` confirmed clean).
|
||||
4. **The "defensible style observations" list has no case backing the
|
||||
`initial fork` claim.** The README's style-observations section states
|
||||
"`initial begin` cuddles, but `initial fork` does not." I confirmed this
|
||||
is true (`target/debug/vfmt -` on `initial fork ... join` puts `initial`
|
||||
is true (`target/debug/lucisv -` on `initial fork ... join` puts `initial`
|
||||
and `fork` on separate lines), but no `.cases` file actually contains an
|
||||
`initial fork` (only `fork` nested inside `initial begin`, in
|
||||
`statements.cases`). The other five observations are backed by real
|
||||
|
||||
@@ -38,7 +38,7 @@ the deviations are stated where they happen.
|
||||
chain: method scope → class scope → enclosing (package/module/file),
|
||||
imports consulted per scope as everywhere else. *Deliberate LRM
|
||||
inexactness:* the LRM puts inherited members ahead of enclosing scopes;
|
||||
vfmt cannot see into a base class it does not model, so the full lexical
|
||||
lucisv cannot see into a base class it does not model, so the full lexical
|
||||
chain is searched first and inheritance is the fallback. An in-file name
|
||||
therefore always wins over a hypothetical inherited one.
|
||||
4. **Inheritance is never chased — not even in-file.** `extends Base` itself
|
||||
@@ -161,7 +161,7 @@ back to the stored name exactly (`exact_or_empty`), preserving the
|
||||
|
||||
- **Class scopes are ordinary lexical scopes for bare names.** The LRM
|
||||
restricts a nested class's access to its outer class's instance members;
|
||||
vfmt does not distinguish static from instance access and lets the chain
|
||||
lucisv does not distinguish static from instance access and lets the chain
|
||||
through. More permissive, never corrupting, same argument as forward
|
||||
references everywhere.
|
||||
- **The nearest enclosing extends-carrying class supplies `base` for an
|
||||
@@ -204,9 +204,9 @@ keeping `scan.rs` alive (with the deliberate `Disable` exception).
|
||||
precedent** (`SymbolKind` is matched exhaustively downstream, so the new
|
||||
variant does not compile without them; each is one arm, no logic):
|
||||
|
||||
- `crates/vfmt_server/src/tokens.rs` — `SymbolKind::Class =>
|
||||
- `crates/lucisv_server/src/tokens.rs` — `SymbolKind::Class =>
|
||||
Highlight::Class` in `symbol_type`.
|
||||
- `crates/vfmt_server/src/symbols.rs` — `SymbolKind::Class => "class"` in
|
||||
- `crates/lucisv_server/src/symbols.rs` — `SymbolKind::Class => "class"` in
|
||||
`kind_label`, `SymbolKind::Class => LspKind::CLASS` in `lsp_kind`.
|
||||
|
||||
**Requested of a future round (not done here):** chasing
|
||||
@@ -392,19 +392,19 @@ acceptance tables above updated to the post-fix numbers.
|
||||
**2026-08-20 — QA agent.** Read CLAUDE.md, this README, the vlog-semantic
|
||||
README (rule 6, the pinned package-tail-miss rule) and the full diff of
|
||||
`model.rs` / `resolve.rs` / `bind.rs` / `lib.rs` / `workspace.rs` /
|
||||
`tests/{classes,corpus,workspace}.rs` and the three `vfmt_server` arms.
|
||||
`tests/{classes,corpus,workspace}.rs` and the three `lucisv_server` arms.
|
||||
Attacks ran as a 29-test scratch suite (`tests/qa_probe.rs`, deleted after
|
||||
the run) plus a baseline `git worktree` at `da1448e` used to re-measure the
|
||||
"before" rows independently. Scope was held to `-p vlog_semantic
|
||||
-p vfmt_server`; nothing outside this feature was touched.
|
||||
-p lucisv_server`; nothing outside this feature was touched.
|
||||
|
||||
**Gates re-run on the current tree.** `cargo test -p vlog_semantic`: **69
|
||||
passed, 0 failed** (6 lib + 23 classes + 1 corpus + 19 semantics + 20
|
||||
workspace) — the claimed split is exact. `cargo test -p vfmt_server`: 122
|
||||
workspace) — the claimed split is exact. `cargo test -p lucisv_server`: 122
|
||||
passed (116 unit + 6 e2e), no test file modified. `cargo clippy
|
||||
-p vlog_semantic -p vfmt_server --all-targets`: **0 warnings**; the crates
|
||||
-p vlog_semantic -p lucisv_server --all-targets`: **0 warnings**; the crates
|
||||
carry exactly one new `#[allow]` (`bind.rs:694`, `too_many_arguments`) and
|
||||
it is commented. `cargo fmt -p vlog_semantic -p vfmt_server -- --check`:
|
||||
it is commented. `cargo fmt -p vlog_semantic -p lucisv_server -- --check`:
|
||||
clean. `cargo test --workspace`: **825 passed, 0 failed** (summed over 28
|
||||
`test result:` lines), reproducing the work log's number.
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class without a line of per-site code.
|
||||
|
||||
| construct | why | corpus evidence |
|
||||
|---|---|---|
|
||||
| `constraint c { ... }` | the constraint language is its own grammar — `dist { 0 :/ 5, [1:20] :/ 20 }`, `->` implication, `solve x before y`, `inside`, `foreach`, `if`/`else`. None of it appears anywhere else in vfmt, and there is no layout convention worth inventing for it. | `ibex_icache_core_req_item.sv:28-62` (five blocks, all four of those forms) |
|
||||
| `constraint c { ... }` | the constraint language is its own grammar — `dist { 0 :/ 5, [1:20] :/ 20 }`, `->` implication, `solve x before y`, `inside`, `foreach`, `if`/`else`. None of it appears anywhere else in lucisv, and there is no layout convention worth inventing for it. | `ibex_icache_core_req_item.sv:28-62` (five blocks, all four of those forms) |
|
||||
| `covergroup ... endgroup[: label]` | same argument: `coverpoint`, `cross`, `bins`/`ignore_bins`/`illegal_bins`, `binsof ... intersect`, `with function sample`. | `ibex_icache_core_agent_cov.sv:17-46`, `uart_env_cov.sv:8-55` |
|
||||
| the `#( ... )` of a parameterized **type** reference | its arguments are types as often as expressions (`#(virtual ibex_icache_core_if)`, `#(push_pull_item #(A, B))`), so `parse_expr` cannot represent them. | `push_pull_driver_lib.sv:20-24`, `ibex_icache_core_driver.sv:15` |
|
||||
|
||||
@@ -71,11 +71,11 @@ slice `source[span]`, drop the trivia copies the skip made. This is why
|
||||
## Assumptions
|
||||
|
||||
- **The class body is an item list, not a member list.** SystemVerilog's
|
||||
`class_item` production overlaps almost exactly with what vfmt already
|
||||
`class_item` production overlaps almost exactly with what lucisv already
|
||||
accepts at module scope, so the alternative — a separate `ClassItem` enum —
|
||||
would have duplicated a dozen variants to gain nothing. The cost is that a
|
||||
construct only legal at module scope (`always_ff`, an instantiation) parses
|
||||
inside a class instead of being rejected. vfmt is a formatter, not a
|
||||
inside a class instead of being rejected. lucisv is a formatter, not a
|
||||
compiler; it does not check legality anywhere else either.
|
||||
- **A verbatim block's *relative* layout is what survives, not its absolute
|
||||
layout.** `raw_lines` dedents continuation lines by `col - 1` and the
|
||||
@@ -204,7 +204,7 @@ verbatim. The fix is one arm —
|
||||
rather than done. Nothing is corrupted by the gap; the fence is simply
|
||||
inactive. *(Lead note, per lint-rules-2 QA: inactive for the FORMATTER
|
||||
only. `fence::protected_regions`' line-based scan backstop still sees the
|
||||
fence, so `vfmt check --fix` and the server's quick fixes DO decline to
|
||||
fence, so `lucisv check --fix` and the server's quick fixes DO decline to
|
||||
edit inside it — the asymmetry errs toward hands-off, which is the
|
||||
harmless direction, but readers should not conclude the fence does
|
||||
nothing in a class body.)*
|
||||
@@ -345,7 +345,7 @@ non-zero verification-error count.
|
||||
|
||||
`./tools/corpus_check.sh corpus` over the same pinned 820-file corpus. All four
|
||||
repos verified unmodified afterwards (`git status --porcelain` clean apart from
|
||||
the pre-existing untracked `.vfmt-corpus-rev` stamps).
|
||||
the pre-existing untracked `.lucisv-corpus-rev` stamps).
|
||||
|
||||
| metric | before | after |
|
||||
|---|---|---|
|
||||
@@ -435,7 +435,7 @@ direction. Gained files by tree: `ibex/dv` 55, `ibex/vendor` 34,
|
||||
corpus leans on parameterized *type references* (`uvm_analysis_port #(...)`)
|
||||
as heavily as on `extends`, which is why the `#` blocker at 40 files was
|
||||
really part of this feature; (c) constraints and covergroups are big, common,
|
||||
and completely disjoint from every grammar vfmt already has.
|
||||
and completely disjoint from every grammar lucisv already has.
|
||||
- **Chose verbatim for constraints and covergroups before writing a line of
|
||||
parser.** The deciding argument is not effort but risk symmetry: a verbatim
|
||||
block is re-lexed as ordinary tokens by the safety net, so a wrong byte is
|
||||
@@ -554,10 +554,10 @@ Python (not just by count).
|
||||
7, others 8 (one each) — exact match, including the "34 of 70 are
|
||||
queues/dynamic arrays" arithmetic (25+9).
|
||||
- Round-tripped **all 578** formattable files (not sampled): copied each to a
|
||||
scratch dir, `vfmt <file>` then `vfmt --check <file>`. **0 failures, 0
|
||||
scratch dir, `lucisv <file>` then `lucisv --check <file>`. **0 failures, 0
|
||||
non-fixed-points.**
|
||||
- Corpus repos confirmed unmodified: `git -C <repo> status --porcelain` clean
|
||||
in all four (only the pre-existing untracked `.vfmt-corpus-rev` stamps),
|
||||
in all four (only the pre-existing untracked `.lucisv-corpus-rev` stamps),
|
||||
before and after the round-trip.
|
||||
- **Claim 1: PASS**, every number independently reproduced, not just
|
||||
eyeballed against the README.
|
||||
@@ -610,7 +610,7 @@ reverted:
|
||||
real binary on all 3 passes. **PASS.**
|
||||
|
||||
**Handshakes (claim 6).**
|
||||
- Fence inactive inside a class body: `// vfmt: off` around a member inside
|
||||
- Fence inactive inside a class body: `// lucisv: off` around a member inside
|
||||
`class c; ... endclass` is ignored (`int a = 1;` gets reformatted to
|
||||
`int a = 1;`); the identical shape inside `module m; ... endmodule` is left
|
||||
byte-for-byte alone. Also checked the *complementary* case not mentioned in
|
||||
@@ -656,7 +656,7 @@ class c;
|
||||
endclass
|
||||
```
|
||||
|
||||
`vfmt check` on this file reports `no-tabs` (line 2) but **not**
|
||||
`lucisv check` on this file reports `no-tabs` (line 2) but **not**
|
||||
`case-missing-default` for the `case` inside the method — exactly the
|
||||
asymmetry the broad wording obscures. Suggest tightening the sentence to name
|
||||
which rules are affected (the 4 AST-walk ones), so a reader doesn't conclude
|
||||
@@ -682,7 +682,7 @@ with `` `uvm_field_* `` macro items between them as class items; `` `ifdef``/
|
||||
`` `else``/`` `endif`` directives between ordinary class members; `endclass :
|
||||
d` where the label doesn't match the class name `c` — **parses and is
|
||||
preserved verbatim, not rejected and not "corrected"** (consistent with the
|
||||
Assumptions section: vfmt does not check semantic legality); an empty class;
|
||||
Assumptions section: lucisv does not check semantic legality); an empty class;
|
||||
a 5-deep `extends` chain (`c5 extends c4 extends c3 extends c2 extends c1`);
|
||||
and a combined case exercising `typedef class` forward declaration, class
|
||||
parameters referenced in an `extends #(.W(W))` override, multiple
|
||||
@@ -753,7 +753,7 @@ Points reviewed and accepted:
|
||||
signature change made mandatory-not-optional for exactly the right
|
||||
reason: an empty verbatim slice would be a corruption bug.
|
||||
|
||||
With this, vfmt formats the majority of real-world DV code as well as
|
||||
With this, lucisv formats the majority of real-world DV code as well as
|
||||
RTL. Next per the owner's directive: alignment inference, content-hash
|
||||
cache, range formatting, remaining lint rules — and the corpus says
|
||||
queues/dynamic arrays after that.
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
## Goal
|
||||
|
||||
Give the `vfmt` CLI the same front door the server got in M1: `vfmt -f
|
||||
Give the `lucisv` CLI the same front door the server got in M1: `lucisv -f
|
||||
project.f` formats or lints exactly the files an EDA filelist names, reusing
|
||||
`vfmt_core::filelist::read` unchanged. M1 deliberately stopped at the config
|
||||
key and the language server — "a `vfmt -f` flag is its own change with its own
|
||||
`lucisv_core::filelist::read` unchanged. M1 deliberately stopped at the config
|
||||
key and the language server — "a `lucisv -f` flag is its own change with its own
|
||||
exit-code questions" (`docs/features/filelist/README.md`, Status). This is that
|
||||
change: the flag, the answers to those questions, and nothing else. No new
|
||||
parsing, no new dependency, no version bump.
|
||||
@@ -14,7 +14,7 @@ parsing, no new dependency, no version bump.
|
||||
|
||||
- **A filelist is an *input*, not a *mode*.** `-f` adds files to whatever the
|
||||
command line already names; it does not replace, filter or reorder them. So
|
||||
`vfmt -f a.f`, `vfmt rtl/` and `vfmt -f a.f rtl/ tb/top.sv` are all ordinary
|
||||
`lucisv -f a.f`, `lucisv rtl/` and `lucisv -f a.f rtl/ tb/top.sv` are all ordinary
|
||||
runs, and having neither positional inputs nor `-f` is still the usage error
|
||||
it always was.
|
||||
- **Listed paths are named paths.** `--exclude` and `.gitignore` filter
|
||||
@@ -25,7 +25,7 @@ parsing, no new dependency, no version bump.
|
||||
choice would mean a `.gitignore` in a generated-RTL directory could silently
|
||||
shrink the build's own file set.
|
||||
- **Warnings are warnings.** Everything M1's parser reports as a warning — a
|
||||
listed file that no longer exists, an option vfmt has no table for, an unset
|
||||
listed file that no longer exists, an option lucisv has no table for, an unset
|
||||
`$VAR`, a repeated filelist, a `-f` chain past `MAX_NESTING_DEPTH` — goes to
|
||||
stderr as `warning: <filelist>:<line>: <what>` and leaves the exit code
|
||||
alone. This matches the server, which shows the same strings and keeps
|
||||
@@ -40,19 +40,19 @@ parsing, no new dependency, no version bump.
|
||||
- **Two names for one file are one file.** Dedup is by lexical absolute path
|
||||
(`.`/`..` folded, symlinks deliberately not resolved — the same rule
|
||||
`filelist::Reader::normalize` and `config::Discovery::absolute` already
|
||||
use), and the *first* spelling seen is the one vfmt reports, so
|
||||
`vfmt -f p.f rtl/a.sv` still says `rtl/a.sv` and not the absolute path the
|
||||
use), and the *first* spelling seen is the one lucisv reports, so
|
||||
`lucisv -f p.f rtl/a.sv` still says `rtl/a.sv` and not the absolute path the
|
||||
filelist produced. This also dedups repeats that have nothing to do with
|
||||
filelists (`vfmt rtl/ rtl/a.sv`), which previously formatted the file twice
|
||||
filelists (`lucisv rtl/ rtl/a.sv`), which previously formatted the file twice
|
||||
— see the Work log.
|
||||
- **The `filelist` key in `vfmt.toml` stays server-only.** Auto-consuming it
|
||||
would make `vfmt rtl/` process files that are not under `rtl/`, and
|
||||
`vfmt --check .` in CI change its file set because someone added a key for
|
||||
- **The `filelist` key in `lucisv.toml` stays server-only.** Auto-consuming it
|
||||
would make `lucisv rtl/` process files that are not under `rtl/`, and
|
||||
`lucisv --check .` in CI change its file set because someone added a key for
|
||||
the editor's benefit. A CLI filelist is named on the command line, where it
|
||||
is visible in the CI log. `--help` says so in the CONFIGURATION section.
|
||||
- **An empty result is the existing empty-input error.** A filelist naming
|
||||
nothing that exists produces its warnings and then `no Verilog files found`,
|
||||
exit 2 — the same answer `vfmt empty-dir/` has always given.
|
||||
exit 2 — the same answer `lucisv empty-dir/` has always given.
|
||||
- **`-f` is not `-F`.** vcs's `-F` (paths relative to the *invoking*
|
||||
directory rather than to the filelist) is not supported, exactly as M1 left
|
||||
it. Nobody has asked.
|
||||
@@ -61,15 +61,15 @@ parsing, no new dependency, no version bump.
|
||||
|
||||
### Consumed
|
||||
|
||||
- `vfmt_core::filelist::read(&Path) -> Result<Filelist, String>` — unchanged,
|
||||
- `lucisv_core::filelist::read(&Path) -> Result<Filelist, String>` — unchanged,
|
||||
used exactly as the server uses it. Only `files` and `warnings` are read:
|
||||
`incdirs` and `defines` are meaningless to a formatter that does not
|
||||
preprocess, and are dropped.
|
||||
- `vfmt_core::walk::collect_files` / `config::Discovery` — unchanged. Filelist
|
||||
- `lucisv_core::walk::collect_files` / `config::Discovery` — unchanged. Filelist
|
||||
files skip `collect_files` entirely (they are exact paths, and running them
|
||||
through it would only re-`is_file()` them), but they go through
|
||||
`Discovery::for_file` in the same loop as every other file, so a listed file
|
||||
is formatted with its *own* directory's `vfmt.toml`.
|
||||
is formatted with its *own* directory's `lucisv.toml`.
|
||||
|
||||
### Promised
|
||||
|
||||
@@ -79,19 +79,19 @@ parsing, no new dependency, no version bump.
|
||||
usage errors (an unreadable filelist, `-f` with no value, `-` or `--lines`
|
||||
with `-f`).
|
||||
- **stdout stays machine-readable.** Every warning goes to stderr, so
|
||||
`vfmt check --output-format json -f p.f` still prints exactly one JSON array
|
||||
`lucisv check --output-format json -f p.f` still prints exactly one JSON array
|
||||
on stdout. Pinned by a test.
|
||||
- **`Options` gains `filelists: Vec<String>`** (`crates/vfmt/src/args.rs`).
|
||||
- **`Options` gains `filelists: Vec<String>`** (`crates/lucisv/src/args.rs`).
|
||||
Anything constructing an `Options` literal needs the field; nothing outside
|
||||
`crates/vfmt` does.
|
||||
`crates/lucisv` does.
|
||||
|
||||
### Rejected combinations (all exit 2, all decided at parse time)
|
||||
|
||||
| Command line | Why |
|
||||
|---|---|
|
||||
| `vfmt -f p.f -` | stdin is one anonymous buffer; a filelist is a set of paths on disk. Reading both would mean ignoring one. |
|
||||
| `vfmt --lines 3-9 -f p.f` | Same reason `--lines` rejects a directory: line numbers name lines of *a file*, and a filelist is a file set. |
|
||||
| `vfmt -f` | Missing flag value, like every other flag. |
|
||||
| `lucisv -f p.f -` | stdin is one anonymous buffer; a filelist is a set of paths on disk. Reading both would mean ignoring one. |
|
||||
| `lucisv --lines 3-9 -f p.f` | Same reason `--lines` rejects a directory: line numbers name lines of *a file*, and a filelist is a file set. |
|
||||
| `lucisv -f` | Missing flag value, like every other flag. |
|
||||
|
||||
Everything else about a run is unchanged by `-f`: the cache, `--threads`,
|
||||
`--stdout`, `--diff`, `--fix`, config discovery and the summary line all
|
||||
@@ -99,8 +99,8 @@ behave exactly as they do for a file named as an argument.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `-f <FILELIST>` on `vfmt`, `vfmt format`, `vfmt --check/--diff` and
|
||||
`vfmt check`; repeatable; combines with positional inputs
|
||||
- [x] `-f <FILELIST>` on `lucisv`, `lucisv format`, `lucisv --check/--diff` and
|
||||
`lucisv check`; repeatable; combines with positional inputs
|
||||
- [x] Warnings to stderr as `warning: ...`, exit code unaffected; unreadable
|
||||
filelist is exit 2 with nothing processed
|
||||
- [x] Listed paths bypass `--exclude` and `.gitignore`, like named files
|
||||
@@ -112,9 +112,9 @@ behave exactly as they do for a file named as an argument.
|
||||
server-only
|
||||
- [x] `README.md`: `-f` in the CLI examples and in the configuration section
|
||||
- [x] Tests: 3 unit (2 `args.rs`, 1 `main.rs`) + 10 e2e
|
||||
(`crates/vfmt/tests/cli.rs`);
|
||||
(`crates/lucisv/tests/cli.rs`);
|
||||
`cargo fmt`, `cargo clippy --all-targets`, `cargo test --workspace`
|
||||
- [ ] Not done, deliberately: the `vfmt.toml` `filelist` key is still not read
|
||||
- [ ] Not done, deliberately: the `lucisv.toml` `filelist` key is still not read
|
||||
by the CLI (Assumptions), and `+incdir+`/`+define+` still feed nothing
|
||||
on this side — the formatter and the linter do not preprocess.
|
||||
- [ ] Not done, deliberately: no `-F`, and no quoting for paths containing
|
||||
@@ -124,13 +124,13 @@ behave exactly as they do for a file named as an argument.
|
||||
|
||||
### 2026-08-25 — dev agent, M13
|
||||
|
||||
Three files of code, all in `crates/vfmt`.
|
||||
Three files of code, all in `crates/lucisv`.
|
||||
|
||||
- **`src/args.rs`** — `Options::filelists`, the `-f` arm (placed before the
|
||||
`s if s.starts_with('-')` catch-all so it is a flag, not an unknown option),
|
||||
the emptiness check widened to "no inputs *and* no filelists", and the two
|
||||
rejected combinations. Both rejections live in `parse_from` rather than in
|
||||
`gather`, so they are cheap unit tests and so `vfmt -f p.f -` cannot reach
|
||||
`gather`, so they are cheap unit tests and so `lucisv -f p.f -` cannot reach
|
||||
the stdin path at all: `is_stdin()` is checked before `gather` in `main`,
|
||||
and a run that read stdin while ignoring `-f` would be the silent-wrong
|
||||
answer this feature exists to avoid.
|
||||
@@ -151,7 +151,7 @@ Decisions worth recording:
|
||||
every warning is on stderr before the first file is touched.
|
||||
- **Dedup is global, not filelist-vs-command-line.** It was tempting to dedup
|
||||
only across the two sources, but the same `HashSet` costs nothing and fixes
|
||||
a pre-existing sharp edge: `vfmt rtl/ rtl/a.sv` used to format `a.sv` twice
|
||||
a pre-existing sharp edge: `lucisv rtl/ rtl/a.sv` used to format `a.sv` twice
|
||||
and count it twice, and with `--threads > 1` two workers could hold the same
|
||||
path. **This is a behavior change beyond the flag** — a run naming one file
|
||||
twice now reports `1 file`, not `2` — and it is the only one. No existing
|
||||
@@ -160,12 +160,12 @@ Decisions worth recording:
|
||||
`absolute` in `main.rs` is the same twelve lines as
|
||||
`filelist::Reader::normalize` and `config::Discovery::absolute`, which QA
|
||||
already examined once and accepted as deliberate duplication (filelist QA
|
||||
log, Finding 3). The alternative was widening `vfmt_core`'s public API with
|
||||
log, Finding 3). The alternative was widening `lucisv_core`'s public API with
|
||||
a `pub fn normalize(path, cwd)` for a single caller, which CLAUDE.md's
|
||||
"don't build the abstraction for a second user that doesn't exist" rule and
|
||||
the "don't touch files outside your feature's scope" rule both argue
|
||||
against. Recorded here so a future third caller knows to extract it.
|
||||
Unlike the other two, this copy is *only* a dedup key: the path vfmt reads,
|
||||
Unlike the other two, this copy is *only* a dedup key: the path lucisv reads,
|
||||
writes and reports is always the one it was given.
|
||||
- **`--lines` with `-f` is a new error, not a new behavior.** Today
|
||||
`--lines` only rejects a *directory*; a filelist would have been accepted
|
||||
@@ -176,11 +176,11 @@ Decisions worth recording:
|
||||
simply has no use for them. Saying "ignoring +incdir+" on every run of every
|
||||
real filelist would be noise.
|
||||
|
||||
**Files touched outside `crates/vfmt`**: two, both documentation this change
|
||||
**Files touched outside `crates/lucisv`**: two, both documentation this change
|
||||
makes untrue and both edited in the style each file already uses.
|
||||
`README.md` — the CLI example block and the configuration section's "the CLI
|
||||
does not consume it yet". `docs/features/filelist/README.md` — its Status item
|
||||
"the CLI does not consume `filelist` yet ... a `vfmt -f` flag is its own
|
||||
"the CLI does not consume `filelist` yet ... a `lucisv -f` flag is its own
|
||||
change", struck through and answered the same way that README already resolved
|
||||
its `+incdir+` item after M10. `TODO.md` and the umbrella checklist were left
|
||||
for the lead, per the brief — M13's box is still unchecked.
|
||||
@@ -188,13 +188,13 @@ for the lead, per the brief — M13's box is still unchecked.
|
||||
**Verification.** `cargo fmt --all -- --check` clean; `cargo clippy
|
||||
--all-targets` silent; `cargo test --workspace` green — 1556 tests, 13 of them
|
||||
new (2 unit in `args.rs`, 1 in `main.rs` pinning the dedup key, 10 e2e in
|
||||
`tests/cli.rs`: `crates/vfmt`'s two suites went 30 → 33 and 71 → 81). The e2e
|
||||
`tests/cli.rs`: `crates/lucisv`'s two suites went 30 → 33 and 71 → 81). The e2e
|
||||
set covers: `-f`
|
||||
alone with a nested `-f` and relative resolution; `-f` plus positional files
|
||||
and a directory with triple dedup; two `-f` flags; a missing listed file
|
||||
(warning on stderr, others formatted, exit 0) and an unknown option; an
|
||||
unreadable filelist (exit 2, nothing written); `--check` with `-f` (exit 1,
|
||||
then exit 0 once formatted); `vfmt check -f` in text and JSON form (stdout is
|
||||
then exit 0 once formatted); `lucisv check -f` in text and JSON form (stdout is
|
||||
one array, warnings on stderr); a filelist named from an unrelated working
|
||||
directory; a listed file that both `--exclude` and `.gitignore` name; and the
|
||||
four usage errors. Also hand-driven against the built binary from two
|
||||
@@ -209,7 +209,7 @@ different working directories before the tests were written.
|
||||
matching the Work log's count exactly (0 failed, 4 pre-existing `#[ignore]`
|
||||
elsewhere, unrelated to this feature).
|
||||
|
||||
**Exit-code contract audit.** Built `target/release/vfmt` and drove the
|
||||
**Exit-code contract audit.** Built `target/release/lucisv` and drove the
|
||||
matrix by hand: clean file via `-f` → 0; would-reformat via `-f --check` →
|
||||
1; lint violation via `check -f` → 1; a filelist naming only a missing file
|
||||
→ warning + `no Verilog files found` → **2** (empty-after-skip, matching
|
||||
@@ -226,11 +226,11 @@ exit code outside {0,1,2}.
|
||||
**Claims verified directly, all pass:**
|
||||
- `-f` repeatable, combines with positional inputs, `-f` alone is a valid
|
||||
complete command line (`args.rs:378`, tested live).
|
||||
- Dedup: `vfmt --check rtl/ rtl/a.sv` reports `a.sv` exactly once and the
|
||||
- Dedup: `lucisv --check rtl/ rtl/a.sv` reports `a.sv` exactly once and the
|
||||
summary reads `2 files would be reformatted` for a 2-file tree, not 3 —
|
||||
confirmed the behavior change is real and works as claimed.
|
||||
- First-spelling-wins is honored across sources, not just within one:
|
||||
`vfmt --check -f p.f rtl/a.sv` (filelist lists `rtl/a.sv`, positional arg
|
||||
`lucisv --check -f p.f rtl/a.sv` (filelist lists `rtl/a.sv`, positional arg
|
||||
also names it) reports `rtl/a.sv`, never the filelist's absolute
|
||||
resolution — matches the Assumptions' worked example verbatim.
|
||||
- Warnings go to stderr only, never touch the exit code: missing listed
|
||||
@@ -239,11 +239,11 @@ exit code outside {0,1,2}.
|
||||
- `check -f --output-format json`: stdout is exactly one parseable JSON
|
||||
array (piped through `python3 -m json.load`, 2 entries) with the missing-
|
||||
file warning only on stderr. Text-mode `check -f` likewise.
|
||||
- `vfmt.toml`'s `filelist` key: `--help`'s CONFIGURATION section says
|
||||
"read by vfmt-server only" as claimed; the CLI never opens the key
|
||||
- `lucisv.toml`'s `filelist` key: `--help`'s CONFIGURATION section says
|
||||
"read by lucisv-server only" as claimed; the CLI never opens the key
|
||||
(unchanged from before this feature — not separately re-verified beyond
|
||||
reading the help text and the diff, since the CLI simply never reads
|
||||
`FileConfig::filelist` anywhere in `crates/vfmt`).
|
||||
`FileConfig::filelist` anywhere in `crates/lucisv`).
|
||||
- `-f` + `-`, `--lines` + `-f`, bare `-f`: all three rejected at parse time,
|
||||
exit 2, with the exact messages the README's Rejected-combinations table
|
||||
promises.
|
||||
@@ -255,12 +255,12 @@ exit code outside {0,1,2}.
|
||||
- CRLF filelist: works with no special-casing needed, `str::lines()`
|
||||
already strips `\r` (same as M1's own QA finding).
|
||||
- `$VAR` expansion to an absolute path: works (first attempt was a shell
|
||||
quoting mistake on my end, not a vfmt bug — corrected and re-run).
|
||||
quoting mistake on my end, not a lucisv bug — corrected and re-run).
|
||||
- A filelist that `-f`s itself: one warning, no infinite loop, its own file
|
||||
still processed once.
|
||||
- Usage errors: `-f` with no value → `error: -f requires a value`, exit 2.
|
||||
Repeated identical `-f list.f -f list.f` → deduped, one file reported, not
|
||||
two. `vfmt -- -f` → `error: unknown option: --`, exit 2 — vfmt has no `--`
|
||||
two. `lucisv -- -f` → `error: unknown option: --`, exit 2 — lucisv has no `--`
|
||||
end-of-options handling anywhere (pre-existing, not part of this
|
||||
feature's scope; noting only because the brief asked).
|
||||
|
||||
@@ -276,7 +276,7 @@ two different spellings (`rtl/a.sv` positional + `alias.sv` via `-f`,
|
||||
formatted independently:
|
||||
|
||||
```
|
||||
$ vfmt --check rtl/a.sv -f list.f # list.f names alias.sv, a symlink to rtl/a.sv
|
||||
$ lucisv --check rtl/a.sv -f list.f # list.f names alias.sv, a symlink to rtl/a.sv
|
||||
would reformat: rtl/a.sv
|
||||
would reformat: /.../alias.sv
|
||||
2 files would be reformatted
|
||||
@@ -288,7 +288,7 @@ open-truncate-write, **not** tempfile+rename. `cache.rs:91` sits right next
|
||||
to this code and *does* the atomic tempfile+rename dance, with a doc comment
|
||||
explicitly saying "Writes the cache back, atomically" — so the codebase
|
||||
already has the pattern, just not applied to the file the user actually
|
||||
asked vfmt to rewrite.
|
||||
asked lucisv to rewrite.
|
||||
|
||||
Put together: two workers (`--threads > 1`) that land on the same inode
|
||||
through two spellings — a symlink pair being the realistic case, since
|
||||
@@ -300,13 +300,13 @@ corrupt code... no partial output"), not a hypothetical.
|
||||
|
||||
**Severity assessment, honestly:** this is **not new in M13** and **not
|
||||
worsened by it**. Before this milestone there was no dedup at all, so
|
||||
`vfmt a.sv a.sv` (no symlink needed) already put two workers on one path
|
||||
`lucisv a.sv a.sv` (no symlink needed) already put two workers on one path
|
||||
under `--threads > 1`, and a symlinked pair had exactly the same exposure
|
||||
`collect_files` never resolves symlinks either (`walk.rs`, confirmed by
|
||||
reading it — no `canonicalize`/`read_link` anywhere in `vfmt_core`). M13's
|
||||
reading it — no `canonicalize`/`read_link` anywhere in `lucisv_core`). M13's
|
||||
dedup is a strict improvement: it closes the common, likely case (the same
|
||||
literal path named twice) that used to double-process on every run of
|
||||
`vfmt rtl/ rtl/a.sv`; it was never advertised as closing the symlink case,
|
||||
`lucisv rtl/ rtl/a.sv`; it was never advertised as closing the symlink case,
|
||||
and the README's own Assumptions section says so precisely ("symlinks
|
||||
deliberately not resolved"). What I'd push back on is only the Work log's
|
||||
framing — "fixes a pre-existing sharp edge... two workers could hold the
|
||||
@@ -347,14 +347,14 @@ if and when a fourth caller appears, as the Work log itself already says.
|
||||
**+incdir+/+define+ silent drop: agree, reasoning holds for `check` too.**
|
||||
Verified by reading `filelist_files` (`main.rs:328-338`): only `list.files`
|
||||
and `list.warnings` are ever read; `list.incdirs`/`list.defines` are
|
||||
untouched anywhere in `crates/vfmt`. Checked whether any M12 lint rule
|
||||
untouched anywhere in `crates/lucisv`. Checked whether any M12 lint rule
|
||||
(`crates/vlog_linter/src/rules/`) consults an include graph or any
|
||||
cross-file state — grepped the whole crate for `incdir`/`include_graph`/
|
||||
`cross-file`/`workspace`: zero hits. Every existing linter rule operates on
|
||||
one file's own parse tree (confirmed by `context.rs`/`visit.rs` taking a
|
||||
single source and no include resolver). `` `include`` resolution using
|
||||
`incdirs` is M10's, and lives entirely in `vfmt_server` — the CLI has never
|
||||
resolved includes at all, filelist-fed or not. So the reasoning "vfmt
|
||||
`incdirs` is M10's, and lives entirely in `lucisv_server` — the CLI has never
|
||||
resolved includes at all, filelist-fed or not. So the reasoning "lucisv
|
||||
doesn't preprocess, so incdirs genuinely don't matter" holds for the linter
|
||||
exactly as it does for the formatter; nothing in M12 would have consulted
|
||||
them even if they were threaded through.
|
||||
@@ -378,7 +378,7 @@ worsened by this milestone, and fixing it belongs to a change that touches
|
||||
independently (1556 tests, 0 failures). The semantics decisions are the
|
||||
right ones, each argued in place — listed paths bypassing exclude rules
|
||||
matches the positional-arg precedent exactly, the `--lines` + `-f`
|
||||
rejection prevents a silent 400-file surprise, and keeping the vfmt.toml
|
||||
rejection prevents a silent 400-file surprise, and keeping the lucisv.toml
|
||||
key server-only respects the CLI user who never asked for it. QA's
|
||||
exit-code matrix confirms the frozen contract untouched, including both
|
||||
ambiguous cells. QA's medium find — lexical-only dedup plus non-atomic
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Goal
|
||||
|
||||
The small ruff-inspired CLI items from `TODO.md` §1–§3 that make `vfmt`
|
||||
The small ruff-inspired CLI items from `TODO.md` §1–§3 that make `lucisv`
|
||||
usable in CI and in editors: `--diff` (print a unified diff instead of
|
||||
rewriting), `--stdin-filename` (name the buffer an editor piped in),
|
||||
`--exclude` (skip generated files during directory walks), a frozen and
|
||||
@@ -63,7 +63,7 @@ hand-rolled argument parsing style of `main.rs` is kept.
|
||||
directory inputs), identically on both header lines. Files that would
|
||||
not change print nothing.
|
||||
- The end-of-run summary (`N files would be reformatted, …`) goes to
|
||||
**stderr**, as with `--check`, so `vfmt --diff … > patch.txt` captures
|
||||
**stderr**, as with `--check`, so `lucisv --diff … > patch.txt` captures
|
||||
only diff text.
|
||||
- Exit code: `1` if any file would change, `0` if none would, `2` if any
|
||||
file errored (error wins over "would change").
|
||||
@@ -118,7 +118,7 @@ Each per-file (and stdin) call into `format_source` runs inside
|
||||
`std::panic::catch_unwind`. The default panic hook is swapped for a
|
||||
no-op around that call (`take_hook`/`set_hook`, restored immediately
|
||||
after) so the contained panic prints no backtrace noise; the payload
|
||||
message is re-reported in vfmt's own error style:
|
||||
message is re-reported in lucisv's own error style:
|
||||
|
||||
```
|
||||
error: rtl/bad.sv: panicked while formatting: <payload>
|
||||
@@ -164,7 +164,7 @@ summary, and the run continues and exits 2. A panic that aborts (e.g.
|
||||
- [x] `main.rs` split into `args.rs` / `walk.rs` / `diff.rs` + driver
|
||||
(it would otherwise have passed ~400 lines).
|
||||
- [x] Unit tests for the glob matcher, the diff renderer and
|
||||
`catch_panic`; integration tests in `crates/vfmt/tests/cli.rs`.
|
||||
`catch_panic`; integration tests in `crates/lucisv/tests/cli.rs`.
|
||||
- [x] `cargo test --workspace`, `cargo clippy --all-targets`,
|
||||
`cargo fmt --check` clean.
|
||||
- [x] TODO.md: §1 panic containment, §2 `--diff` and `--stdin-filename`,
|
||||
@@ -181,7 +181,7 @@ summary, and the run continues and exits 2. A panic that aborts (e.g.
|
||||
`cargo clippy --all-targets` has 5 pre-existing warnings, all in
|
||||
`vlog_parser`/`vlog_formatter` (2× `if_same_then_else`,
|
||||
`manual_repeat_n`, `dead_code` on `ListItem.blank_before`) and none in
|
||||
`vfmt`.
|
||||
`lucisv`.
|
||||
- Split `main.rs` (was 220 lines; the five items would have taken it
|
||||
past 400) into `args.rs` (option struct, parsing, help), `walk.rs`
|
||||
(file collection + the exclude matcher), `diff.rs` (unified diff) and
|
||||
@@ -218,8 +218,8 @@ summary, and the run continues and exits 2. A panic that aborts (e.g.
|
||||
- Top-level `README.md`: added the new flags to the usage block and an
|
||||
exit-code table, per TODO.md §3's "document it in README and freeze
|
||||
it".
|
||||
- Tests: `crates/vfmt/tests/cli.rs` drives the real binary via
|
||||
`env!("CARGO_BIN_EXE_vfmt")`, with a hand-rolled tempdir under
|
||||
- Tests: `crates/lucisv/tests/cli.rs` drives the real binary via
|
||||
`env!("CARGO_BIN_EXE_lucisv")`, with a hand-rolled tempdir under
|
||||
`std::env::temp_dir()` (unique name from pid + a counter, removed by a
|
||||
`Drop` guard) so no `tempfile` dependency is needed. All fixtures use
|
||||
trivial Verilog (`module m;endmodule` → `module m;\nendmodule\n`) so
|
||||
@@ -245,14 +245,14 @@ summary, and the run continues and exits 2. A panic that aborts (e.g.
|
||||
|
||||
**Results** (workspace root, final):
|
||||
|
||||
- `cargo test --workspace`: **69 passed, 0 failed** — 18 `vfmt` unit
|
||||
(args 4, walk 4, diff 6, panic/format 4), 12 `vfmt` CLI integration,
|
||||
- `cargo test --workspace`: **69 passed, 0 failed** — 18 `lucisv` unit
|
||||
(args 4, walk 4, diff 6, panic/format 4), 12 `lucisv` CLI integration,
|
||||
3 + 1 + 2 `vlog_formatter`, 19 `vlog_formatter` verification, 14
|
||||
`vlog_parser`.
|
||||
- `cargo clippy --all-targets`: no warnings from `vfmt`. The 5
|
||||
- `cargo clippy --all-targets`: no warnings from `lucisv`. The 5
|
||||
pre-existing warnings in `vlog_parser`/`vlog_formatter` are unchanged
|
||||
from the baseline taken before this work.
|
||||
- `cargo fmt --check`: clean (ran `cargo fmt -p vfmt` only, so no file
|
||||
- `cargo fmt --check`: clean (ran `cargo fmt -p lucisv` only, so no file
|
||||
owned by the other agent was reformatted).
|
||||
- Sizes: `main.rs` 231, `args.rs` 156, `diff.rs` 199, `walk.rs` 129,
|
||||
`tests/cli.rs` 261 lines. No `Cargo.toml` change was needed.
|
||||
@@ -261,18 +261,18 @@ summary, and the run continues and exits 2. A panic that aborts (e.g.
|
||||
|
||||
### 2026-08-18 — QA agent
|
||||
|
||||
Scope: `crates/vfmt/**` and this README only. Nothing in `vlog_parser` /
|
||||
Scope: `crates/lucisv/**` and this README only. Nothing in `vlog_parser` /
|
||||
`vlog_formatter` was touched in the repo (a concurrent dev agent was
|
||||
active there; the workspace failed to build on the first attempt with
|
||||
errors in `vlog_formatter::format.rs` unrelated to `vfmt` — waited and
|
||||
errors in `vlog_formatter::format.rs` unrelated to `lucisv` — waited and
|
||||
retried, second attempt built clean, confirming the failure was transient
|
||||
and outside this feature's scope).
|
||||
|
||||
**Build / lint / test — all green:**
|
||||
- `cargo test -p vfmt`: **30 passed, 0 failed** — 18 unit (main 4, args 4,
|
||||
- `cargo test -p lucisv`: **30 passed, 0 failed** — 18 unit (main 4, args 4,
|
||||
walk 4, diff 6) + 12 CLI integration (`tests/cli.rs`). Matches the
|
||||
claimed counts exactly.
|
||||
- `cargo clippy -p vfmt --all-targets`: zero warnings from `vfmt`. Full
|
||||
- `cargo clippy -p lucisv --all-targets`: zero warnings from `lucisv`. Full
|
||||
`cargo clippy --all-targets` still shows exactly 4 warnings, all in
|
||||
`vlog_parser`/`vlog_formatter` (2× `if_same_then_else` in
|
||||
`vlog_parser/src/parser.rs:573,715`, `manual_repeat_n` in
|
||||
@@ -280,7 +280,7 @@ and outside this feature's scope).
|
||||
in `vlog_formatter/src/format.rs:94`) — **note:** the Work log above
|
||||
says "5 pre-existing warnings" but lists only 4; today's run confirms 4.
|
||||
Nit, not fixed (not my log entry to edit).
|
||||
- `cargo fmt -p vfmt --check`: clean, exit 0.
|
||||
- `cargo fmt -p lucisv --check`: clean, exit 0.
|
||||
- Module sizes, no-unwrap-outside-tests/main, doc comments: all comply
|
||||
with CLAUDE.md as of this read. `main.rs` 231, `args.rs` 156, `diff.rs`
|
||||
199, `walk.rs` 129, `tests/cli.rs` 261 lines.
|
||||
@@ -293,8 +293,8 @@ and outside this feature's scope).
|
||||
|
||||
**Diff correctness (patch round-trip), verified in scratchpad:**
|
||||
- Nontrivial multi-construct file (module + always block + assign):
|
||||
`vfmt --diff` output applied cleanly with `patch -p0` and byte-matched
|
||||
`vfmt --stdout` output.
|
||||
`lucisv --diff` output applied cleanly with `patch -p0` and byte-matched
|
||||
`lucisv --stdout` output.
|
||||
- >200-line gap between two independent single-line changes (256-line
|
||||
file, 250 filler lines between them): 2 separate hunks emitted, both
|
||||
applied cleanly via `patch -p0`, round-tripped correctly. Bounded
|
||||
@@ -310,7 +310,7 @@ and outside this feature's scope).
|
||||
- Already-formatted file: `--diff` correctly prints nothing, exit 0.
|
||||
|
||||
**FINDING (should-fix) — `\ No newline at end of file` breaks `patch`
|
||||
applicability.** `crates/vfmt/src/diff.rs:40-46` (`split_lines`) pushes
|
||||
applicability.** `crates/lucisv/src/diff.rs:40-46` (`split_lines`) pushes
|
||||
the `NO_NEWLINE` pseudo-line into the same line stream as ordinary
|
||||
content, so `render_one_hunk` (`diff.rs:129-144`) tags it with a regular
|
||||
`-`/`+` sign like any other line. Real unified diff / GNU `patch` expect
|
||||
@@ -318,7 +318,7 @@ this marker as a **bare, unprefixed** line immediately following its
|
||||
associated content line. Repro:
|
||||
```
|
||||
printf 'module m;endmodule' > old.sv # no trailing newline
|
||||
vfmt --diff old.sv
|
||||
lucisv --diff old.sv
|
||||
```
|
||||
produces:
|
||||
```
|
||||
@@ -339,10 +339,10 @@ but it directly undercuts the dev work log's "bonus" observation that
|
||||
evidently didn't include a missing-final-newline case. Worth a follow-up
|
||||
fix: don't tag `NO_NEWLINE` rows with a sign in `render_one_hunk`.
|
||||
|
||||
**FINDING (should-fix, likely out of vfmt's scope) — stack overflow
|
||||
**FINDING (should-fix, likely out of lucisv's scope) — stack overflow
|
||||
aborts the whole batch, not just one file.** A syntactically valid but
|
||||
deeply nested input (150 levels of `if (clk) begin ... end`, 454 lines,
|
||||
built in scratchpad — not committed anywhere) crashes the whole `vfmt`
|
||||
built in scratchpad — not committed anywhere) crashes the whole `lucisv`
|
||||
process with `thread 'main' has overflowed its stack` / SIGABRT (exit
|
||||
134), reproduced with plain format, `--check`, and `--diff` alike (i.e.
|
||||
not a `--diff`-specific bug — it's in the parser/formatter's recursive
|
||||
@@ -413,14 +413,14 @@ feature's and this QA pass's scope.
|
||||
the error. Not documented explicitly either way, but seems like the
|
||||
right behavior and is not a finding.
|
||||
- `--` (bare double dash) is **not** treated as an end-of-options
|
||||
marker — `vfmt -- file.sv` errors with `unknown option: --` (exit 2),
|
||||
marker — `lucisv -- file.sv` errors with `unknown option: --` (exit 2),
|
||||
since `args.rs:110` rejects any unrecognized token starting with `-`.
|
||||
Not a regression from this feature (pre-existing hand-rolled parser
|
||||
behavior, `args.rs` review confirms this pattern predates the diff/
|
||||
exclude/stdin-filename additions) and not claimed anywhere in the
|
||||
feature contract, so not filed as a finding against this feature —
|
||||
noting only because it means a file whose name starts with `-` can
|
||||
never be passed to `vfmt`. Nit, out of this feature's scope.
|
||||
never be passed to `lucisv`. Nit, out of this feature's scope.
|
||||
- Unknown flag (`--bogus-flag`): clear `error: unknown option:
|
||||
--bogus-flag`, exit 2.
|
||||
|
||||
@@ -430,7 +430,7 @@ ways:**
|
||||
fully contained within one function call and the process is single-
|
||||
threaded (confirmed: `run_files`/`run_stdin` call `format_contained`
|
||||
in a plain sequential `for` loop, no threads spawned anywhere in
|
||||
`crates/vfmt`), so there is no possible interleaving between two
|
||||
`crates/lucisv`), so there is no possible interleaving between two
|
||||
calls — each call's take_hook always sees the hook the previous call
|
||||
restored. The existing `catch_panic_is_reusable` unit test
|
||||
(`main.rs:218-224`) covers this directly.
|
||||
@@ -497,7 +497,7 @@ including the doc comment, close enough).
|
||||
6. Test counts — **PASS**, 12 CLI integration + 18 unit tests, all
|
||||
green, exact match to the claim.
|
||||
|
||||
No fixes were made directly to `crates/vfmt/**` — nothing rose to the
|
||||
No fixes were made directly to `crates/lucisv/**` — nothing rose to the
|
||||
"typo / missing assertion" bar for a QA-agent-authored fix; both
|
||||
findings above are implementation decisions (diff renderer sign
|
||||
handling; documenting an uncontainable-panic edge case) that belong to
|
||||
|
||||
@@ -10,8 +10,8 @@ formattable corpus file refused **14 files**, in exactly two shapes: a comment
|
||||
between a module/instantiation head and the `#(` or `(` that follows it
|
||||
(10 files), and a comment written next to an `(* attribute *)`, which came out
|
||||
on the wrong side of it (4 files). Both are refusals, not corruption — the
|
||||
safety net was right both times — but a file `vfmt` cannot format is a file
|
||||
`vfmt` cannot format. Measuring the fix turned up a third, quieter bug in the
|
||||
safety net was right both times — but a file `lucisv` cannot format is a file
|
||||
`lucisv` cannot format. Measuring the fix turned up a third, quieter bug in the
|
||||
same family: `instantiation`'s single-instance branch never read the instance's
|
||||
`Meta`, so a comment before a lone instance's name was parsed and then dropped
|
||||
(hard invariant #3, visible only because the net refused the file). **Result:
|
||||
@@ -100,7 +100,7 @@ fields could regress into (hard invariant #3).
|
||||
|
||||
**Format fences (`docs/features/format-fences/README.md`): unchanged, and
|
||||
verified so.** `fence::scan_scope` walks item-level leading comments only, so a
|
||||
`// vfmt: off` written in one of the four new bracket positions opens no region
|
||||
`// lucisv: off` written in one of the four new bracket positions opens no region
|
||||
— exactly as it opened none when the same comment used to land in the first
|
||||
parameter port's `meta.leading`. The difference is that such a file is now
|
||||
formatted (fence inert, output verified) instead of refused. `fence.rs`,
|
||||
@@ -113,9 +113,9 @@ nothing nests, root-to-leaf depth is unchanged.
|
||||
**`line_starts_inside_string` is still the one in-string-break definition** —
|
||||
untouched; nothing here parses comment or string text.
|
||||
|
||||
**Not touched, by scope:** `crates/vfmt`, `crates/vfmt_core`,
|
||||
`crates/vfmt_server`, `crates/vlog_linter`, `crates/vlog_semantic`, `editors/`,
|
||||
`tools/`, `corpus/`, `verify.rs`. `vfmt_server`'s tests consume `format_source`
|
||||
**Not touched, by scope:** `crates/lucisv`, `crates/lucisv_core`,
|
||||
`crates/lucisv_server`, `crates/vlog_linter`, `crates/vlog_semantic`, `editors/`,
|
||||
`tools/`, `corpus/`, `verify.rs`. `lucisv_server`'s tests consume `format_source`
|
||||
and stayed green. `cargo fmt --all` rewrote exactly one file, this round's own
|
||||
`tests/verification.rs` (confirmed against `cargo fmt --all --check` beforehand,
|
||||
which listed only that file).
|
||||
@@ -166,7 +166,7 @@ which listed only that file).
|
||||
**The lead's sweep, reproduced and re-run.** One `// marker` line inserted so
|
||||
that it becomes line len/3 (and, separately, line len/2) of every corpus file
|
||||
that formats cleanly unmodified; formatted through
|
||||
`vfmt --stdin-filename <path> -`. A trial is discarded when the insertion breaks
|
||||
`lucisv --stdin-filename <path> -`. A trial is discarded when the insertion breaks
|
||||
the *parse* — a comment dropped into a backslash-continued macro body genuinely
|
||||
changes what the file says, and that is the harness's doing, not the
|
||||
formatter's. Script in the session scratchpad (`sweep.py`); not checked in, as
|
||||
@@ -293,7 +293,7 @@ all.
|
||||
- **Checked the fence question the new bucket-1 fields raise**, since they hold
|
||||
comments the fence scanner never sees. It never saw them before either —
|
||||
`scan_scope` walks item-level `meta.leading` only, and the comment used to
|
||||
live in a *parameter port's* meta. So a `// vfmt: off` in bracket position is
|
||||
live in a *parameter port's* meta. So a `// lucisv: off` in bracket position is
|
||||
inert now and was inert before; the change is that the file formats instead
|
||||
of refusing. Written up in Handshakes rather than left as a surprise.
|
||||
- **Every fixed shape is 3-pass stable**, checked outside `cargo test` on all
|
||||
@@ -312,7 +312,7 @@ all.
|
||||
does. A comment parsed and never printed is hard invariant #3; it only ever
|
||||
showed up as a refusal. Fixed through the same `bracket_comments` helper, and
|
||||
pinned by its own rejection test. Six more corpus positions, zero test churn.
|
||||
- **Did not touch** `verify.rs` (`git diff --quiet` exits 0), `crates/vfmt*`,
|
||||
- **Did not touch** `verify.rs` (`git diff --quiet` exits 0), `crates/lucisv*`,
|
||||
`crates/vlog_linter`, `crates/vlog_semantic`, `editors/`, `tools/` or
|
||||
`corpus/`. Did not run `git commit`/`git push`.
|
||||
|
||||
@@ -443,7 +443,7 @@ output and exit code on every one.
|
||||
`crates/vlog_formatter/tests/cases/comments.cases`,
|
||||
`crates/vlog_formatter/tests/verification.rs`,
|
||||
`crates/vlog_parser/src/{ast,parser}.rs`, plus this README). `crates/
|
||||
vfmt_server/` and `crates/vlog_linter/` show as untracked in `git status`
|
||||
lucisv_server/` and `crates/vlog_linter/` show as untracked in `git status`
|
||||
but predate this feature (present in the session's initial git-status
|
||||
snapshot) — not touched by this diff. README has all seven required
|
||||
sections; Review is empty, left alone. `TODO.md` §2 note read honest: it
|
||||
|
||||
@@ -237,7 +237,7 @@ baseline was reproduced exactly from the `HEAD` worktree binary first
|
||||
(`3fab114f...`, bit for bit), so the whole delta is attributable, and it is six
|
||||
lines of the TSV. The corpus repos are unmodified afterwards
|
||||
(`git status --porcelain` clean apart from the pre-existing untracked
|
||||
`.vfmt-corpus-rev` stamps).
|
||||
`.lucisv-corpus-rev` stamps).
|
||||
|
||||
## Work log
|
||||
|
||||
@@ -320,7 +320,7 @@ lines of the TSV. The corpus repos are unmodified afterwards
|
||||
it; the net was right every time. Added seven rejection tests anyway, each
|
||||
crafted as "what this fix would look like if it had been done in the safety
|
||||
net instead", so a future shortcut fails loudly.
|
||||
- Did not touch `tools/`, `corpus/`, `crates/vfmt/`, `verify.rs`, or the
|
||||
- Did not touch `tools/`, `corpus/`, `crates/lucisv/`, `verify.rs`, or the
|
||||
concurrent define-table round's files (`crates/vlog_parser/src/defines.rs`,
|
||||
its tests, its `lib.rs` line, its `TODO.md` §6 entry). Did not run
|
||||
`git commit`/`git push`.
|
||||
@@ -354,7 +354,7 @@ blocking findings, no should-fix findings. Two informational notes below.
|
||||
|
||||
**Tooling (exact results).**
|
||||
`cargo test --workspace`: **229 passed, 0 failed** (summed per-binary:
|
||||
vfmt 40+21, vlog_formatter 8+1+4+6+2+39, vlog_parser 53+24+19+12 = 229).
|
||||
lucisv 40+21, vlog_formatter 8+1+4+6+2+39, vlog_parser 53+24+19+12 = 229).
|
||||
`cargo clippy --workspace --all-targets`: silent. `cargo fmt --all --check`:
|
||||
exit 0. `git diff --quiet -- crates/vlog_formatter/src/verify.rs`: exit 0
|
||||
(byte-identical to HEAD). Case-table count: 299 exactly (`grep -c '^# '`
|
||||
@@ -364,7 +364,7 @@ delta matches exactly).
|
||||
|
||||
**Claim 1 (Meta.trailing migration) — PASS.** Multi-line block comment as
|
||||
trailing (`wire w; /* a\n b */`) re-indents and is stable across 3 passes.
|
||||
Same construct inside a `// vfmt: off` fence stays byte-exact (diffed the
|
||||
Same construct inside a `// lucisv: off` fence stays byte-exact (diffed the
|
||||
fenced lines directly against input) and still 3-pass stable — fences
|
||||
correctly override the new re-indent behavior. Trailing runs
|
||||
(block+block, block+line, block+block+line) reproduce the parser's
|
||||
@@ -440,7 +440,7 @@ it's a several-point absolute deviation; not blocking.
|
||||
**Claim 7 (suite hygiene) — PASS**, see Tooling above.
|
||||
`crates/vlog_formatter/tests/fences.rs`: 6/6.
|
||||
`git diff --stat -- fence.rs tests/fences.rs tests/cases/fences.cases`:
|
||||
empty (untouched). Two fence probes: a same-line `// vfmt: off` trailing
|
||||
empty (untouched). Two fence probes: a same-line `// lucisv: off` trailing
|
||||
marker is still ignored (the interior line still gets its extra spaces
|
||||
collapsed — no accidental activation despite `Meta.trailing` now carrying a
|
||||
span); an own-line fence immediately after a line with an unrelated
|
||||
@@ -465,7 +465,7 @@ confirmed).**
|
||||
clippy silent, fmt clean).
|
||||
|
||||
**Corpus (exact results).** `./tools/corpus_check.sh corpus -b
|
||||
target/release/vfmt`: 8 ok-unchanged (1.0%), 460 would-reformat (56.1%),
|
||||
target/release/lucisv`: 8 ok-unchanged (1.0%), 460 would-reformat (56.1%),
|
||||
352 parse-error (42.9%), 0 verification-error, 0 crash — TSV md5
|
||||
**`aa982463f68c1a3568c02a0fc5e0c455`**, exact match. Built a `git worktree`
|
||||
at `0ba29d4` (release), re-ran the same script: TSV md5
|
||||
@@ -477,7 +477,7 @@ else changed. The two files that were already `ok-unchanged` on both
|
||||
binaries (`.../isa/custom/rv64x_instr.sv`, `.../isa/rv32fc_instr.sv`) are
|
||||
byte-identical between the HEAD and current binaries, as required. Corpus
|
||||
working trees clean afterwards (only the pre-existing untracked
|
||||
`.vfmt-corpus-rev` stamps) in all four vendored repos.
|
||||
`.lucisv-corpus-rev` stamps) in all four vendored repos.
|
||||
|
||||
**Findings.**
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ workspace index, from the same file list, and are replaced with it.
|
||||
- **The index's freshness is the tables' freshness.** The index rebuilds on
|
||||
`initialize` and on `didSave`, so the project-wide tables do too. An unsaved
|
||||
edit in *another* buffer is therefore not in the word table until it is
|
||||
saved — exactly the rule the index has always had (`vfmt-server`'s
|
||||
saved — exactly the rule the index has always had (`lucisv-server`'s
|
||||
invalidation notes). The buffer being typed in is the exception, and needs no
|
||||
rebuild: its own token stream is already computed on every change, so its
|
||||
words are harvested per request and an unsaved name is a candidate
|
||||
@@ -65,7 +65,7 @@ workspace index, from the same file list, and are replaced with it.
|
||||
|
||||
## Handshakes
|
||||
|
||||
- **Widened in `vlog_parser`** — the only change outside `vfmt_server`.
|
||||
- **Widened in `vlog_parser`** — the only change outside `lucisv_server`.
|
||||
`token.rs`'s keyword table became a `keywords![...]` macro invocation that
|
||||
generates both `pub const KEYWORDS: &[&str]` and `pub fn is_keyword`;
|
||||
`lib.rs` re-exports `KEYWORDS`. `is_keyword` is still a `matches!` over
|
||||
@@ -90,7 +90,7 @@ workspace index, from the same file list, and are replaced with it.
|
||||
innermost-scope idea and nothing else, and lifting one to fit both would have
|
||||
meant widening another crate's API for a second caller that wants a different
|
||||
answer. Recorded so the lead can overrule it cheaply.
|
||||
- **Promises `vfmt_server`'s own callers**: `completions` never panics, always
|
||||
- **Promises `lucisv_server`'s own callers**: `completions` never panics, always
|
||||
returns items whose `textEdit` replaces exactly the typed word (plus the
|
||||
backtick, in the macro case), and never returns a module item whose text
|
||||
differs from what M4 returned — the M4 tests assert the skeleton byte for
|
||||
@@ -146,7 +146,7 @@ cursor is, so the rule is stated rather than implied:
|
||||
a backtick: `` `ifdef NAME ``, `` `ifndef NAME ``, `` `undef NAME ``,
|
||||
`` `define NAME ``.
|
||||
|
||||
Both spellings are tested. `` `undef`` entries are not offered: vfmt does not
|
||||
Both spellings are tested. `` `undef`` entries are not offered: lucisv does not
|
||||
preprocess and cannot say where a name stopped being defined, so a table that
|
||||
listed them would be pretending to know.
|
||||
|
||||
@@ -232,23 +232,23 @@ examples it does not:
|
||||
- [x] `editors/vscode/package.json` `"version"`
|
||||
- [x] `editors/vscode/package-lock.json` `"version"` in **both** places (top
|
||||
level and `packages[""]`)
|
||||
- [x] `README.md` — the `code --install-extension dist/vfmt-0.3.0.vsix` example
|
||||
- [x] `README.md` — the `code --install-extension dist/lucisv-0.3.0.vsix` example
|
||||
- [x] `editors/vscode/README.md` — both install examples
|
||||
- [x] `tools/RELEASING.md` — the `dist/` listing, the install commands, the
|
||||
`git tag v0.3.0` example and the appendix's publish commands
|
||||
- [x] `CHANGELOG.md` — a `0.3.0 — 2026-08-24` section in the existing voice:
|
||||
one paragraph per area (filelists, rename, ports, module hinting,
|
||||
completion, editors), each linking to its feature README
|
||||
- [x] Verified: `target/debug/vfmt --version` → `vfmt 0.3.0`. Nothing
|
||||
hard-codes a version string in Rust; `vfmt --version` and the server's
|
||||
- [x] Verified: `target/debug/lucisv --version` → `lucisv 0.3.0`. Nothing
|
||||
hard-codes a version string in Rust; `lucisv --version` and the server's
|
||||
`serverInfo.version` both read `env!("CARGO_PKG_VERSION")`.
|
||||
- [x] Verified: `node editors/vscode/smoke.js target/debug/vfmt-server` →
|
||||
- [x] Verified: `node editors/vscode/smoke.js target/debug/lucisv-server` →
|
||||
`smoke: OK`
|
||||
|
||||
Deliberately **not** touched: the `0.2.0` section of `CHANGELOG.md`,
|
||||
`docs/features/release-prep/README.md` and `TODO.md`'s release entry — those
|
||||
record what happened at 0.2.0 and are not install instructions. The literal
|
||||
`0.2.0` strings in `vfmt_core/src/cache.rs`'s and `vfmt/tests/cli.rs`'s
|
||||
`0.2.0` strings in `lucisv_core/src/cache.rs`'s and `lucisv/tests/cli.rs`'s
|
||||
corrupt-cache fixtures are deliberately malformed lines whose version field is
|
||||
incidental; they exercise the parser, not the version.
|
||||
|
||||
@@ -283,7 +283,7 @@ incidental; they exercise the parser, not the version.
|
||||
tests added in `token.rs`; the parser suite (185 → 187 lib tests, all four
|
||||
targets) is green.
|
||||
|
||||
**Tables (`crates/vfmt_server/src/candidates.rs`, new).** `Candidates` holds
|
||||
**Tables (`crates/lucisv_server/src/candidates.rs`, new).** `Candidates` holds
|
||||
three sorted vectors — index names, macro names, project words — built in
|
||||
`Workspace::rebuild_index` from the same `collect_sources()` list the index
|
||||
gets. That is what makes the scope ladder and the open-buffer-beats-disk rule
|
||||
@@ -330,7 +330,7 @@ incidental; they exercise the parser, not the version.
|
||||
|
||||
**Suite**: 1 232 → 1 262 workspace tests, all green; `cargo fmt --all --
|
||||
--check` and `cargo clippy --all-targets` clean; `node
|
||||
editors/vscode/smoke.js target/debug/vfmt-server` → `smoke: OK`.
|
||||
editors/vscode/smoke.js target/debug/lucisv-server` → `smoke: OK`.
|
||||
|
||||
## QA log
|
||||
|
||||
@@ -343,8 +343,8 @@ incidental; they exercise the parser, not the version.
|
||||
- `cargo test --workspace` — green, **1262** tests (summed the per-crate
|
||||
`test result` lines myself rather than trusting the printed total) —
|
||||
matches the Work log's `1232 → 1262` claim exactly.
|
||||
- `node editors/vscode/smoke.js target/debug/vfmt-server` — `smoke: OK`.
|
||||
- `cargo build -p vfmt` then `target/debug/vfmt --version` → `vfmt 0.3.0`.
|
||||
- `node editors/vscode/smoke.js target/debug/lucisv-server` — `smoke: OK`.
|
||||
- `cargo build -p lucisv` then `target/debug/lucisv --version` → `lucisv 0.3.0`.
|
||||
|
||||
All gates: **pass, claims confirmed.**
|
||||
|
||||
@@ -378,7 +378,7 @@ total**, matching the claim exactly once both files are counted together.
|
||||
Diffed the gate itself: `at_module_item`, `enclosing_scopes`,
|
||||
`is_procedural`, `balanced`, and the `ITEM_SCOPES`/`NOT_ITEM_SCOPES`/
|
||||
`PROCEDURAL`/`STATEMENT_END` constants are **byte-identical** between
|
||||
`git show HEAD:crates/vfmt_server/src/completion.rs` and the working tree —
|
||||
`git show HEAD:crates/lucisv_server/src/completion.rs` and the working tree —
|
||||
only a doc comment above `completions` changed (`"module completions"` →
|
||||
`"completions"`). The gate that decides *where* a skeleton may appear was
|
||||
not touched.
|
||||
@@ -536,13 +536,13 @@ not against this milestone's own code, since nothing in `completion.rs` or
|
||||
is one the dev's README lists as deliberately untouched — `CHANGELOG.md`'s
|
||||
`0.2.0` history section, `TODO.md`'s release-prep line,
|
||||
`docs/features/release-prep/README.md`'s own history, and the
|
||||
malformed-cache-line fixtures in `vfmt_core/src/cache.rs` and
|
||||
`vfmt/tests/cli.rs`. No stray `0.2.0` anywhere else.
|
||||
malformed-cache-line fixtures in `lucisv_core/src/cache.rs` and
|
||||
`lucisv/tests/cli.rs`. No stray `0.2.0` anywhere else.
|
||||
- `cargo metadata` — all eight workspace crates report `0.3.0`.
|
||||
`editors/vscode/package.json` and **both** places in
|
||||
`package-lock.json` (top level and `packages[""]`) — `0.3.0`.
|
||||
`Cargo.toml`'s `[workspace.package] version` — `0.3.0`.
|
||||
`target/debug/vfmt --version` → `vfmt 0.3.0`.
|
||||
`target/debug/lucisv --version` → `lucisv 0.3.0`.
|
||||
- `CHANGELOG.md`'s `0.3.0` section: read against what actually shipped
|
||||
(filelists, rename, ports, module hinting, completion, editors) —
|
||||
accurate, no overclaiming; the completion paragraph's "860 real-world
|
||||
@@ -569,8 +569,8 @@ loaded machine) and the file/word/index counts match exactly (860 / 16 750
|
||||
|
||||
### e2e — real server binary over stdio
|
||||
|
||||
Ran the dev's own `crates/vfmt_server/tests/e2e.rs` tests as part of the
|
||||
full-suite gate (both pass). Independently drove `target/debug/vfmt-server`
|
||||
Ran the dev's own `crates/lucisv_server/tests/e2e.rs` tests as part of the
|
||||
full-suite gate (both pass). Independently drove `target/debug/lucisv-server`
|
||||
over stdio by hand (a small Python LSP client, not committed anywhere) for
|
||||
the one case the dev's own e2e test doesn't explicitly assert on:
|
||||
|
||||
@@ -583,7 +583,7 @@ the one case the dev's own e2e test doesn't explicitly assert on:
|
||||
- Project-word completion from another file, and inside-comment decline:
|
||||
already covered by the dev's own
|
||||
`keyword_and_project_completion_round_trip_over_the_wire`, which I
|
||||
re-ran in isolation (`cargo test -p vfmt_server --test e2e
|
||||
re-ran in isolation (`cargo test -p lucisv_server --test e2e
|
||||
keyword_and_project_completion -- --nocapture`) — passes standalone.
|
||||
|
||||
**LOW, informational — the Status/TODO line "e2e stdio round trip for the
|
||||
@@ -603,7 +603,7 @@ unambiguous fix).
|
||||
### Cleanup
|
||||
|
||||
All probing was done with temporary `qa_probe_*` `#[test]` functions added
|
||||
to `crates/vfmt_server/src/completion.rs`'s existing `tests` module, run
|
||||
to `crates/lucisv_server/src/completion.rs`'s existing `tests` module, run
|
||||
with `--nocapture`, then fully reverted. Verified clean:
|
||||
`grep -rn qa_probe crates/` — zero hits; `git diff --stat` for this file
|
||||
matches the pre-QA baseline exactly (898 changed lines, same as
|
||||
|
||||
@@ -23,7 +23,7 @@ ranked between what the code declares and the bare keywords, and gated by two
|
||||
questions the server can already answer from the token stream — *may a
|
||||
statement be written here?* and *may a module item?* Nothing is offered that
|
||||
the buffer's own dialect would reject, and every template's untouched expansion
|
||||
is fed to vfmt's own parser by the test suite, because a template that hands
|
||||
is fed to lucisv's own parser by the test suite, because a template that hands
|
||||
the user a red squiggle from our own server is worse than no template.
|
||||
|
||||
Because this lives in the server, Vim gets it too — which is the reason it is
|
||||
@@ -56,9 +56,9 @@ templates used to live. Those are gone; see *Reconciliation* below.
|
||||
invisibly. No system task appears in any body today, and
|
||||
`every_hole_is_a_tabstop_the_snippet_grammar_reads` fails the build if one is
|
||||
added without an escape.
|
||||
- **`vfmt.indent` (default 2) is the indent step**, and the line's own leading
|
||||
- **`lucisv.indent` (default 2) is the indent step**, and the line's own leading
|
||||
whitespace is the base — the same `Layout` M4's skeletons use, resolved the
|
||||
same way and with the same deviation from `vfmt.toml` recorded there. Because
|
||||
same way and with the same deviation from `lucisv.toml` recorded there. Because
|
||||
the base is baked in, the item must tell the client not to indent it again:
|
||||
see *The indentation contract* below.
|
||||
- **A template is offered on prefix, not on fuzzy match.** The server filters
|
||||
@@ -69,13 +69,13 @@ templates used to live. Those are gone; see *Reconciliation* below.
|
||||
|
||||
## Handshakes
|
||||
|
||||
- **New module `crates/vfmt_server/src/templates.rs`** — the registry, the
|
||||
- **New module `crates/lucisv_server/src/templates.rs`** — the registry, the
|
||||
dialect rule and the renderer. It is data plus one function; nothing in it
|
||||
knows about LSP. `completion.rs` owns the tier, the gates and the items.
|
||||
- **Consumes `vlog_refactor::Layout`** — M4's `{ base, step }`, reused rather
|
||||
than re-declared, so a skeleton and a template are indented by the same type.
|
||||
Nothing in `vlog_refactor` was touched.
|
||||
- **Consumes `vfmt_server::pairs`** through `completion::enclosing_scopes`,
|
||||
- **Consumes `lucisv_server::pairs`** through `completion::enclosing_scopes`,
|
||||
exactly as M4 does. No change to `pairs.rs`.
|
||||
- **Changed inside `completion.rs`, for other tiers to know about:**
|
||||
- **The tier digits moved.** Templates are tier `3`; keywords are now `4`
|
||||
@@ -140,7 +140,7 @@ every block template.
|
||||
Sixteen templates in a `.sv` file, eighteen in a `.v` one.
|
||||
|
||||
Two deliberate details in that table. **The parameter templates name a type**
|
||||
(`int` / `integer`) because vfmt's own `explicit-parameter-storage-type` rule
|
||||
(`int` / `integer`) because lucisv's own `explicit-parameter-storage-type` rule
|
||||
flags `localparam NAME = 0;` — a template that trips our own linter on insert
|
||||
is not a template worth shipping, and it was the untouched-expansion check that
|
||||
surfaced it. **`casez` but not `casex`**: `casez` costs one registry entry and
|
||||
@@ -332,13 +332,13 @@ Every place `tools/RELEASING.md` names, plus the install examples it does not:
|
||||
- [x] `Cargo.lock` regenerated by `cargo check --workspace` — eight entries
|
||||
- [x] `editors/vscode/package.json` `"version"`
|
||||
- [x] `editors/vscode/package-lock.json` `"version"` in **both** places
|
||||
- [x] `README.md` — the `dist/vfmt-0.4.0.vsix` install example
|
||||
- [x] `README.md` — the `dist/lucisv-0.4.0.vsix` install example
|
||||
- [x] `editors/vscode/README.md` — both install examples
|
||||
- [x] `tools/RELEASING.md` — the `dist/` listing, the install commands, the
|
||||
`git tag v0.4.0` example and the appendix's publish commands
|
||||
- [x] `CHANGELOG.md` — a `0.4.0 — 2026-08-24` section in the existing voice
|
||||
- [x] Verified: `target/debug/vfmt --version` → `vfmt 0.4.0`
|
||||
- [x] Verified: `node editors/vscode/smoke.js target/debug/vfmt-server` →
|
||||
- [x] Verified: `target/debug/lucisv --version` → `lucisv 0.4.0`
|
||||
- [x] Verified: `node editors/vscode/smoke.js target/debug/lucisv-server` →
|
||||
`smoke: OK`
|
||||
|
||||
Deliberately not touched: the historical `0.3.x` mentions in `CHANGELOG.md` and
|
||||
@@ -377,7 +377,7 @@ in the feature READMEs that record what happened at those versions.
|
||||
|
||||
- **2026-08-24 (dev)** — implemented.
|
||||
|
||||
**Registry (`crates/vfmt_server/src/templates.rs`, new).** A `Template` is
|
||||
**Registry (`crates/lucisv_server/src/templates.rs`, new).** A `Template` is
|
||||
five fields: label, prefix, gate, detail, and a body written as
|
||||
`(indent level, text)` lines. `for_dialect` chains the eight shared templates
|
||||
onto the dialect's own, so the statement set cannot drift between `.sv` and
|
||||
@@ -413,9 +413,9 @@ in the feature READMEs that record what happened at those versions.
|
||||
completes. Three strings, an explicit list, and the test that pins it also
|
||||
pins that `x = if` is not one.
|
||||
4. **The parameter templates name a type** (`int`/`integer`) so that the
|
||||
untouched expansion does not trip vfmt's own
|
||||
untouched expansion does not trip lucisv's own
|
||||
`explicit-parameter-storage-type` rule. Found by running the expansions
|
||||
through `vfmt check` while choosing the bodies.
|
||||
through `lucisv check` while choosing the bodies.
|
||||
5. **`alwayscomb` was removed from `verilog.json`** although its prefix does
|
||||
not collide with anything the server offers. It is a subsequence match on
|
||||
`always` with a body identical to the server's `always @(*)`, so it would
|
||||
@@ -432,7 +432,7 @@ in the feature READMEs that record what happened at those versions.
|
||||
**Suite**: 1 268 → 1 292 workspace tests (24 new: 9 in `templates.rs`, 14 in
|
||||
`completion.rs`, 1 e2e), all green. `cargo fmt --all -- --check` and
|
||||
`cargo clippy --all-targets` clean; `node --check` on `extension.js` and
|
||||
`smoke.js`; `node editors/vscode/smoke.js target/debug/vfmt-server` →
|
||||
`smoke.js`; `node editors/vscode/smoke.js target/debug/lucisv-server` →
|
||||
`smoke: OK`; `npx --no-install @vscode/vsce ls` still lists both snippet
|
||||
files. No new dependency.
|
||||
|
||||
@@ -467,15 +467,15 @@ in the feature READMEs that record what happened at those versions.
|
||||
rather than trusting the total: **1292**, matching the Work log's
|
||||
`1268 → 1292` claim exactly.
|
||||
- `node --check` on `extension.js` and `smoke.js` — clean.
|
||||
- `node editors/vscode/smoke.js target/debug/vfmt-server` — `smoke: OK`.
|
||||
- `node editors/vscode/smoke.js target/debug/lucisv-server` — `smoke: OK`.
|
||||
- `cd editors/vscode && npx --no-install @vscode/vsce ls` — accepts the
|
||||
manifest; filtering the `node_modules/**` noise out of the listing (as the
|
||||
M1 QA pass for editor-snippets also did — `.vscodeignore` does not touch
|
||||
`node_modules`, so `vsce ls` prints it regardless) leaves exactly
|
||||
`package.json`, `extension.js`, `README.md`, `LICENSE`,
|
||||
`snippets/verilog.json`, `snippets/systemverilog.json`.
|
||||
- `cargo build -p vfmt` → `target/debug/vfmt --version` → `vfmt 0.4.0`.
|
||||
- `cargo test --release -p vfmt_server a_keystroke_over_the_whole_corpus_stays_in_budget -- --nocapture`
|
||||
- `cargo build -p lucisv` → `target/debug/lucisv --version` → `lucisv 0.4.0`.
|
||||
- `cargo test --release -p lucisv_server a_keystroke_over_the_whole_corpus_stays_in_budget -- --nocapture`
|
||||
— `worst request 225.875µs typed / 182.792µs empty` against the claimed
|
||||
284µs/242µs; faster, inside run-to-run noise. Budget test passes.
|
||||
|
||||
@@ -484,8 +484,8 @@ All gates: **pass, claims confirmed.**
|
||||
### Priority — the real UX, driven live over stdio
|
||||
|
||||
Not trusting the e2e test alone: wrote a standalone Python LSP-stdio client
|
||||
(`/tmp/vfmt_qa/driver.py`, `ux_check.py`, `edge_check.py`, `untitled_check.py`
|
||||
— scratch, not committed) and drove `target/debug/vfmt-server` directly,
|
||||
(`/tmp/lucisv_qa/driver.py`, `ux_check.py`, `edge_check.py`, `untitled_check.py`
|
||||
— scratch, not committed) and drove `target/debug/lucisv-server` directly,
|
||||
independent of the test suite.
|
||||
|
||||
- `.sv` buffer, `if` typed inside an `always_comb` body: `if begin/end`
|
||||
@@ -554,8 +554,8 @@ text with a standalone regex parser (not importing or calling
|
||||
`Defaults::substitute`), wrote a **second, independent** tabstop-stripping
|
||||
implementation in Python, planted each stripped body in the same probe shapes
|
||||
the registry's own test uses, and fed every probe to a throwaway Rust binary
|
||||
(`/tmp/vfmt_qa/probe_checker`, a 10-line `main.rs` depending on `vlog_parser`
|
||||
by path) that calls `vlog_parser::parse_source_tolerant` directly — no vfmt
|
||||
(`/tmp/lucisv_qa/probe_checker`, a 10-line `main.rs` depending on `vlog_parser`
|
||||
by path) that calls `vlog_parser::parse_source_tolerant` directly — no lucisv
|
||||
code from this feature involved in the check at all.
|
||||
|
||||
Result: **26/26 parse clean**, independently. Count matches the claim (8
|
||||
@@ -569,9 +569,9 @@ dialects; dialect-specific rejection (e.g. `always_ff` being illegal in a
|
||||
`.v` file) is enforced only by *this feature's own gate* (`templates::
|
||||
dialect`), never by the parser. So the registry test is exactly as strong as
|
||||
it can be — there is no stricter parsing mode to test `.v` templates against
|
||||
anywhere in vfmt today. Worth recording, not a finding: a reader could
|
||||
anywhere in lucisv today. Worth recording, not a finding: a reader could
|
||||
otherwise assume "parses" implies "parses under Verilog-2001 rules
|
||||
specifically", which nothing in vfmt currently checks for *any* file.
|
||||
specifically", which nothing in lucisv currently checks for *any* file.
|
||||
|
||||
`$`-escaping: grepped the body text for `$` followed by a letter
|
||||
(`grep -oE '"\$[a-zA-Z_]+' templates.rs`) — zero hits; every `$NAME`/`$n` in
|
||||
@@ -667,28 +667,28 @@ needs dev rework.
|
||||
This feature's only change in round 2 is the four-line diff in
|
||||
*The indentation contract* above (`completion.rs`): `insert_text_mode:
|
||||
Some(KEEP_MY_INDENTATION)` on `Items::template`
|
||||
(`crates/vfmt_server/src/completion.rs:459`) and on `item`, the
|
||||
(`crates/lucisv_server/src/completion.rs:459`) and on `item`, the
|
||||
module-instantiation skeleton (`:612`); `layout_at`
|
||||
(`crates/vfmt_server/src/completion.rs:326-329`) re-privatized because
|
||||
(`crates/lucisv_server/src/completion.rs:326-329`) re-privatized because
|
||||
`inline.rs` no longer names it. `templates.rs` is untouched, confirmed by
|
||||
`git diff --stat` (absent from the diff entirely). Full attack and gate
|
||||
detail — the trigger-table work is this round's real surface — is in
|
||||
`docs/features/inline-templates/README.md`'s 2026-08-25 round-2 QA entry;
|
||||
this entry covers only what round 2 touched here.
|
||||
|
||||
- **The wire value.** `crates/vfmt_server/src/completion.rs:156` in
|
||||
- **The wire value.** `crates/lucisv_server/src/completion.rs:156` in
|
||||
`lsp-types` 0.97.0 (registry source, read directly):
|
||||
`pub const AS_IS: InsertTextMode = InsertTextMode(1)`;
|
||||
`ADJUST_INDENTATION = InsertTextMode(2)`. So `KEEP_MY_INDENTATION` is `1`,
|
||||
matching LSP 3.17's `InsertTextMode` enum (`asIs = 1`). Both pins in
|
||||
`tests/e2e.rs` assert `insertTextMode == 1` — the template item at
|
||||
`crates/vfmt_server/tests/e2e.rs:1258` and the module skeleton at
|
||||
`crates/lucisv_server/tests/e2e.rs:1258` and the module skeleton at
|
||||
`:1625` — and both are correct. (The QA brief itself floated "`asIs` (2)"
|
||||
as a parenthetical; that would have been `AdjustIndentation`, not `AsIs`
|
||||
— checked against the source rather than trusted, and the shipped code is
|
||||
right.)
|
||||
- **No leak onto single-line items.** `grep -n "insert_text_mode"
|
||||
crates/vfmt_server/src/completion.rs` returns exactly the two call sites
|
||||
crates/lucisv_server/src/completion.rs` returns exactly the two call sites
|
||||
above. `Items::simple` (`completion.rs:412-430`, the keyword/word/index
|
||||
tiers' single-line items) builds its `CompletionItem` with
|
||||
`..Default::default()`, which leaves `insert_text_mode: None` — confirmed
|
||||
@@ -708,7 +708,7 @@ this entry covers only what round 2 touched here.
|
||||
`cargo clippy --all-targets --workspace` zero warnings; `cargo test
|
||||
--workspace` 1644 passed / 0 failed / 4 ignored (up from the round-2 dev's
|
||||
1633 — 11 new tests, all in `inline.rs`, none in this feature's own
|
||||
files); `node editors/vscode/smoke.js target/debug/vfmt-server` →
|
||||
files); `node editors/vscode/smoke.js target/debug/lucisv-server` →
|
||||
`smoke: OK`; `node --check` on `smoke.js` and a `JSON.parse` of
|
||||
`package.json` both clean.
|
||||
|
||||
@@ -738,5 +738,5 @@ root cause as inline-templates round 2, different fix because the
|
||||
completion protocol has the opt-out the inline one lacks:
|
||||
`insertTextMode: asIs` (verified = 1 on the wire against lsp-types
|
||||
source, by QA) on the two multi-line tiers only. `templates.rs` and the
|
||||
plain-text fallback untouched, `vfmt.indent` still meaningful here.
|
||||
plain-text fallback untouched, `lucisv.indent` still meaningful here.
|
||||
Approved; ships as 0.7.0.
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
## Goal
|
||||
|
||||
`vfmt.toml` / `.vfmt.toml` discovery in the style of ruff's `ruff.toml`:
|
||||
`lucisv.toml` / `.lucisv.toml` discovery in the style of ruff's `ruff.toml`:
|
||||
for every input file, search upward from its directory for a config file
|
||||
and take `line-length`, `indent` and `exclude` from the first one found.
|
||||
CLI flags still win. This is what makes vfmt usable in a repo where the
|
||||
CLI flags still win. This is what makes lucisv usable in a repo where the
|
||||
style is a property of the tree rather than of the command line — an
|
||||
editor's format-on-save (which goes through stdin) picks up the same
|
||||
settings as CI's `vfmt --check`, with no per-editor configuration. Kept
|
||||
settings as CI's `lucisv --check`, with no per-editor configuration. Kept
|
||||
deliberately tiny per TODO.md §3: three keys, no tables, no option
|
||||
explosion, no new dependency.
|
||||
|
||||
@@ -24,8 +24,8 @@ explosion, no new dependency.
|
||||
of transitive code to read three scalars and a string array out of a
|
||||
file that is, in practice, four lines long. The hand-rolled subset
|
||||
parser is ~100 lines, has no unsafe, no build-time cost, and its
|
||||
failure mode ("unsupported in vfmt.toml") is a better error than a
|
||||
full parser silently accepting syntax vfmt would then ignore. If the
|
||||
failure mode ("unsupported in lucisv.toml") is a better error than a
|
||||
full parser silently accepting syntax lucisv would then ignore. If the
|
||||
key set ever grows past ~10 keys or needs tables, revisit.
|
||||
- **The supported grammar is a subset, and says so.** Anything valid in
|
||||
real TOML but outside the subset (tables, multi-line arrays, dotted
|
||||
@@ -59,8 +59,8 @@ explosion, no new dependency.
|
||||
|
||||
For a directory `D`, in this exact order:
|
||||
|
||||
1. If `D/vfmt.toml` exists → use it. Stop.
|
||||
2. Else if `D/.vfmt.toml` exists → use it. Stop.
|
||||
1. If `D/lucisv.toml` exists → use it. Stop.
|
||||
2. Else if `D/.lucisv.toml` exists → use it. Stop.
|
||||
3. Else if `D/.git` exists (file *or* directory) → stop with **no**
|
||||
config. The `.git` check happens **after** steps 1–2, so a config
|
||||
file sitting next to `.git` in the repo root *is* found.
|
||||
@@ -75,7 +75,7 @@ The starting directory `D` is:
|
||||
current working directory.
|
||||
|
||||
Relative paths are resolved against the current directory before the
|
||||
walk, so `vfmt a.sv` searches the cwd and its ancestors.
|
||||
walk, so `lucisv a.sv` searches the cwd and its ancestors.
|
||||
|
||||
Exactly one config file is ever used per file — there is no merging of a
|
||||
parent config into a child config (ruff's `extend` is not implemented).
|
||||
@@ -106,8 +106,8 @@ array := '[' ws* (string (ws* ',' ws* string)* (ws* ',')?)? ws* ']'
|
||||
```
|
||||
|
||||
Everything is one entry per line; whitespace around every token is
|
||||
optional. Rejected with an explicit "unsupported in vfmt.toml" error:
|
||||
tables/sections (`[tool.vfmt]`), multi-line arrays, string escapes,
|
||||
optional. Rejected with an explicit "unsupported in lucisv.toml" error:
|
||||
tables/sections (`[tool.lucisv]`), multi-line arrays, string escapes,
|
||||
booleans/floats/datetimes, and any line that is not a comment, blank, or
|
||||
`key = value`.
|
||||
|
||||
@@ -150,7 +150,7 @@ respects the frozen exit-code contract (2 = error, files untouched).
|
||||
- **Consumes `vlog_formatter::Config`** (`max_width`, `indent_width`)
|
||||
unchanged. Nothing in `crates/vlog_formatter` or `crates/vlog_parser`
|
||||
was touched; the two fields sufficed, so no change request was needed.
|
||||
- **Changes `args::Options`** (internal to `crates/vfmt`): the eager
|
||||
- **Changes `args::Options`** (internal to `crates/lucisv`): the eager
|
||||
`config: Config` field is replaced by `line_length: Option<usize>` and
|
||||
`indent: Option<usize>` — "was the flag given?" has to survive to the
|
||||
point where the file config is known. `Options::config_with(&FileConfig)`
|
||||
@@ -158,7 +158,7 @@ respects the frozen exit-code contract (2 = error, files untouched).
|
||||
`--no-config`.
|
||||
- **Promises to TODO.md §3's content-hash cache:** the cache key must
|
||||
include the resolved per-file settings (or a hash of the config file
|
||||
that produced them), not just file content + vfmt version — two files
|
||||
that produced them), not just file content + lucisv version — two files
|
||||
with identical content under different config files must not share a
|
||||
cache entry. `config::FileConfig` derives `PartialEq` and is cheap to
|
||||
hash-by-debug if that is all the cache needs.
|
||||
@@ -176,7 +176,7 @@ respects the frozen exit-code contract (2 = error, files untouched).
|
||||
|
||||
- [x] `src/config.rs`: TOML-subset parser (`parse`) + upward discovery
|
||||
with a per-directory `HashMap` cache (`Discovery`).
|
||||
- [x] Discovery rule: `vfmt.toml` before `.vfmt.toml`, `.git` stops the
|
||||
- [x] Discovery rule: `lucisv.toml` before `.lucisv.toml`, `.git` stops the
|
||||
walk *after* the current directory is checked, filesystem root
|
||||
stops it.
|
||||
- [x] Keys `line-length` (40..=400), `indent` (1..=8), `exclude`
|
||||
@@ -188,7 +188,7 @@ respects the frozen exit-code contract (2 = error, files untouched).
|
||||
- [x] stdin anchors on `--stdin-filename`'s directory, else cwd.
|
||||
- [x] Config errors are fatal, exit 2, before anything is written.
|
||||
- [x] Unit tests for the parser and for discovery; CLI integration
|
||||
tests in `crates/vfmt/tests/cli.rs`.
|
||||
tests in `crates/lucisv/tests/cli.rs`.
|
||||
- [x] `README.md`: Configuration section. `TODO.md` §3 config item
|
||||
checked off.
|
||||
|
||||
@@ -197,19 +197,19 @@ respects the frozen exit-code contract (2 = error, files untouched).
|
||||
### 2026-08-19 — dev agent
|
||||
|
||||
- Read CLAUDE.md, TODO.md §3, README.md, `docs/features/cli-polish/README.md`
|
||||
and all of `crates/vfmt/src` before writing anything. cli-polish's
|
||||
and all of `crates/lucisv/src` before writing anything. cli-polish's
|
||||
Handshakes section already promised `stdin_filename` as the discovery
|
||||
anchor and `exclude` as the CLI layer; both are honored literally.
|
||||
- **No TOML dependency.** Justification (CLAUDE.md requires one in
|
||||
writing): three keys, one array, no tables — `toml`+`serde` would be
|
||||
three transitive crates and a proc-macro build step to read four lines
|
||||
of text. The subset parser is 95 lines including error messages, and
|
||||
it *rejects* what it does not support rather than accepting TOML vfmt
|
||||
it *rejects* what it does not support rather than accepting TOML lucisv
|
||||
would then ignore, which is the better failure mode here. Revisit if
|
||||
the key set passes ~10 or ever needs tables.
|
||||
- **Discovery walks up, `.git` stops it after the directory is
|
||||
checked.** The alternative (check `.git` first) would make the common
|
||||
layout — `vfmt.toml` next to `.git` in the repo root — silently not
|
||||
layout — `lucisv.toml` next to `.git` in the repo root — silently not
|
||||
work, which is exactly the ruff layout people expect. Both halves of
|
||||
the rule have tests (`git_stops_the_walk_but_only_after_its_own_directory`
|
||||
in `config.rs`, `the_search_stops_at_a_git_directory_after_checking_it`
|
||||
@@ -223,15 +223,15 @@ respects the frozen exit-code contract (2 = error, files untouched).
|
||||
(`chain`) over the naive version and needs no extra data structure.
|
||||
- **Config errors are fatal, and resolved before any write.** `gather`
|
||||
now returns `Vec<(PathBuf, Config)>` — every config file in the run is
|
||||
read while building that list, so a broken `vfmt.toml` in a deep
|
||||
read while building that list, so a broken `lucisv.toml` in a deep
|
||||
subdirectory aborts with exit 2 and *nothing* written, rather than
|
||||
half the tree formatted. It also keeps the error from being repeated
|
||||
once per file in the offending directory.
|
||||
- **`Options` changed shape** (internal to `crates/vfmt`): `config:
|
||||
- **`Options` changed shape** (internal to `crates/lucisv`): `config:
|
||||
Config` became `line_length: Option<usize>` / `indent: Option<usize>`,
|
||||
because "was the flag given?" has to survive until the file config is
|
||||
known. `Options::config_with` / `exclude_with` apply precedence in one
|
||||
place each. Nothing outside `crates/vfmt` was touched;
|
||||
place each. Nothing outside `crates/lucisv` was touched;
|
||||
`vlog_formatter::Config`'s two fields sufficed exactly.
|
||||
- **Range checks (`line-length` 40..=400, `indent` 1..=8) apply to the
|
||||
file only**, not to `--line-length`/`--indent`. Tightening the flags
|
||||
@@ -249,29 +249,29 @@ respects the frozen exit-code contract (2 = error, files untouched).
|
||||
people actually type.
|
||||
- The workspace was uncompilable for part of this run — the concurrent
|
||||
agent's span work in `vlog_parser`/`vlog_formatter` was mid-landing
|
||||
(56-60 compile errors in `vlog_parser`, none in `vfmt`). Waited it out
|
||||
(56-60 compile errors in `vlog_parser`, none in `lucisv`). Waited it out
|
||||
rather than touching their crates; final gates re-run on the merged
|
||||
tree, see Results.
|
||||
- Sanity-checked the real binary outside the test suite (scratchpad, then
|
||||
deleted): a tree with `indent = 4` + `exclude = ["gen"] # generated`
|
||||
formatted `rtl/a.sv` to 4 spaces, left `gen/g.sv` untouched, exit 0;
|
||||
changing the key to `line_length` produced
|
||||
`error: …/vfmt.toml:2: unknown key \`line_length\` (known keys:
|
||||
`error: …/lucisv.toml:2: unknown key \`line_length\` (known keys:
|
||||
line-length, indent, exclude)` and exit 2 with nothing written.
|
||||
|
||||
**Results** (workspace root, final):
|
||||
|
||||
- `cargo test -p vfmt`: **59 passed, 0 failed** — 38 unit (config 18:
|
||||
- `cargo test -p lucisv`: **59 passed, 0 failed** — 38 unit (config 18:
|
||||
8 parser + 10 discovery; args 6; walk 4; diff 6; main 4 — the 6 args
|
||||
tests include the two new precedence tests) and 21 CLI integration
|
||||
(8 new: upward search, per-directory configs, CLI override,
|
||||
`--no-config`, broken-config-exits-2 (5 malformed files), config
|
||||
excludes, stdin discovery + stdin config error, `.git` stop).
|
||||
- `cargo test --workspace`: **148 passed, 0 failed** (`vfmt` 59,
|
||||
- `cargo test --workspace`: **148 passed, 0 failed** (`lucisv` 59,
|
||||
`vlog_formatter` 42, `vlog_parser` 47) on the tree as merged with the
|
||||
concurrent span work.
|
||||
- `cargo clippy -p vfmt --all-targets`: zero warnings.
|
||||
- `cargo fmt -p vfmt --check`: clean. Only `crates/vfmt` was formatted,
|
||||
- `cargo clippy -p lucisv --all-targets`: zero warnings.
|
||||
- `cargo fmt -p lucisv --check`: clean. Only `crates/lucisv` was formatted,
|
||||
so no file owned by the other agent was touched.
|
||||
- Sizes: `config.rs` 476 lines (203 of code + doc comments, 273 of
|
||||
tests; the parser half is 95 lines), `args.rs` 220, `main.rs` 261,
|
||||
@@ -281,20 +281,20 @@ respects the frozen exit-code contract (2 = error, files untouched).
|
||||
|
||||
### 2026-08-19 — QA agent
|
||||
|
||||
Scope: `crates/vfmt/**` only (a concurrent dev agent was landing the spans
|
||||
Scope: `crates/lucisv/**` only (a concurrent dev agent was landing the spans
|
||||
feature in `vlog_parser`/`vlog_formatter`; the workspace was compilable by
|
||||
the time these checks ran, so both scoped and full-workspace runs were
|
||||
possible).
|
||||
|
||||
**Gates** — all clean:
|
||||
- `cargo test -p vfmt`: 59 passed, 0 failed (38 unit + 21 integration, exact
|
||||
- `cargo test -p lucisv`: 59 passed, 0 failed (38 unit + 21 integration, exact
|
||||
match to the claim). `cargo test --workspace`: 158 passed, 0 failed
|
||||
(`vfmt` 59, `vlog_formatter` 42, `vlog_parser` 57) — higher than the
|
||||
(`lucisv` 59, `vlog_formatter` 42, `vlog_parser` 57) — higher than the
|
||||
work log's "148 at the time of dev's run" because the concurrent span
|
||||
work (10 new `tests/spans.rs` cases) landed afterward; not a
|
||||
config-discovery regression.
|
||||
- `cargo clippy -p vfmt --all-targets`: zero warnings.
|
||||
- `cargo fmt -p vfmt --check`: clean.
|
||||
- `cargo clippy -p lucisv --all-targets`: zero warnings.
|
||||
- `cargo fmt -p lucisv --check`: clean.
|
||||
- No `Cargo.toml` / `Cargo.lock` diff anywhere in the repo — the
|
||||
no-new-dependency claim holds.
|
||||
- `unwrap()`/`expect()`/`panic!` audit of `config.rs`, `args.rs`, `main.rs`:
|
||||
@@ -322,7 +322,7 @@ and falls through to defaults, exit 0, no crash.
|
||||
|
||||
**Pre-write fatality (the contract claim most worth breaking) — held.**
|
||||
Built the adversarial case directly: `a_good/x.sv` (alphabetically first,
|
||||
its directory has no config problem) plus `b_bad/vfmt.toml` with an unknown
|
||||
its directory has no config problem) plus `b_bad/lucisv.toml` with an unknown
|
||||
key governing `b_bad/y.sv` (alphabetically later, so it's walked and
|
||||
formatted *after* `a_good/x.sv` in `walk_dir`'s sorted order). Ran the real
|
||||
binary: exit 2, and **both** files came back byte-identical to their
|
||||
@@ -335,7 +335,7 @@ parser hole that accepts a wrong value; every malformed input tried failed
|
||||
closed at exit 2 with nothing written):
|
||||
|
||||
1. **[Low] BOM breaks key matching with a confusing message.** A
|
||||
`vfmt.toml` starting with a UTF-8 BOM (`EF BB BF`) fails every key on
|
||||
`lucisv.toml` starting with a UTF-8 BOM (`EF BB BF`) fails every key on
|
||||
its first line: `read_to_string` doesn't strip it and `str::trim()`
|
||||
doesn't treat U+FEFF as whitespace, so `indent = 4` becomes the "key"
|
||||
`\u{FEFF}indent`, reported as `unknown key` with an invisible character
|
||||
|
||||
@@ -6,7 +6,7 @@ Fix the four formatter bugs the 820-file corpus check exposed, catalogued as
|
||||
root causes A–D in `docs/features/corpus-check/README.md` and re-measured at 46
|
||||
affected files after `macro-items` raised the parse rate to 468/820. Every one
|
||||
of them made the runtime safety net refuse output (exit 2), so each was a file
|
||||
`vfmt` could not format at all: an event list's `,` rewritten as `or`, comments
|
||||
`lucisv` could not format at all: an event list's `,` rewritten as `or`, comments
|
||||
moved out of port/parameter lists and out of expressions, two module-header
|
||||
`import` statements folded into one, and a hand-written empty `#()` dropped.
|
||||
Three of the four are token rewrites the net is right to reject; the fourth is
|
||||
@@ -139,7 +139,7 @@ again.
|
||||
|
||||
`./tools/corpus_check.sh corpus` against the same pinned 820-file corpus,
|
||||
release build, corpus verified unmodified afterwards (`git status --porcelain`
|
||||
clean in all four repos apart from the untracked `.vfmt-corpus-rev` stamps).
|
||||
clean in all four repos apart from the untracked `.lucisv-corpus-rev` stamps).
|
||||
|
||||
| metric | after macro-items | after corpus-bugs |
|
||||
|---|---|---|
|
||||
@@ -353,7 +353,7 @@ verified in a throwaway worktree). Boxing both comment groups fixes it and
|
||||
leaves those variants *smaller* than before this feature. Also dropped an
|
||||
unused `BinaryComments::is_empty` rather than keep a method with no caller.
|
||||
|
||||
Did not touch `tools/`, `corpus/` contents, `crates/vfmt/`, `CLAUDE.md`,
|
||||
Did not touch `tools/`, `corpus/` contents, `crates/lucisv/`, `CLAUDE.md`,
|
||||
`README.md` or `TODO.md` (no matching checkbox exists — these bugs were never
|
||||
backlog items). Did not run `git commit`/`git push`.
|
||||
|
||||
@@ -409,7 +409,7 @@ committed numbers:
|
||||
- Re-ran the working-tree binary a second time: output TSV byte-identical to
|
||||
the first (deterministic).
|
||||
- All four corpus repos `git status --porcelain` clean after both runs
|
||||
(only the untracked `.vfmt-corpus-rev` stamps, as documented).
|
||||
(only the untracked `.lucisv-corpus-rev` stamps, as documented).
|
||||
- Cleaned up the worktree (`git worktree remove --force`) after use; the main
|
||||
working tree's `git status` is unchanged from before this session.
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
## Goal
|
||||
|
||||
Run `vfmt` against real open-source RTL and report how much of it we can
|
||||
Run `lucisv` against real open-source RTL and report how much of it we can
|
||||
parse, how much is already format-clean, and what is blocking the rest —
|
||||
vfmt's version of ruff's "ecosystem check" (TODO.md §5). Two scripts:
|
||||
lucisv's version of ruff's "ecosystem check" (TODO.md §5). Two scripts:
|
||||
`tools/corpus_fetch.sh` clones pinned revisions of permissively-licensed
|
||||
Verilog/SystemVerilog projects into a gitignored `corpus/`, and
|
||||
`tools/corpus_check.sh` runs the release binary over every `.v`/`.sv`
|
||||
@@ -47,7 +47,7 @@ bug finder.
|
||||
|
||||
## Handshakes
|
||||
|
||||
**Consumed from `crates/vfmt` (CLI):**
|
||||
**Consumed from `crates/lucisv` (CLI):**
|
||||
|
||||
- The exit-code contract (0/1/2) documented in `README.md`. Frozen; if it
|
||||
ever changes, `check_one()` in `tools/corpus_check.sh` must change with
|
||||
@@ -81,7 +81,7 @@ This feature is scripts + docs only.
|
||||
`tools/corpus_fetch.sh` pins every repo to an exact commit and fetches it
|
||||
shallow (`--depth 1` at that SHA). Nothing tracks a branch, so the
|
||||
numbers below are reproducible. Re-running the script is a no-op when the
|
||||
recorded SHA in `<repo>/.vfmt-corpus-rev` already matches.
|
||||
recorded SHA in `<repo>/.lucisv-corpus-rev` already matches.
|
||||
|
||||
| Project | License | Pinned commit | Why |
|
||||
|---|---|---|---|
|
||||
@@ -95,7 +95,7 @@ picorv32 41.
|
||||
|
||||
## Baseline (2026-08-19)
|
||||
|
||||
- vfmt built from commit **`9f1a6cf1d2926358e2a804b33fb4de55bb9f04e7`**
|
||||
- lucisv built from commit **`9f1a6cf1d2926358e2a804b33fb4de55bb9f04e7`**
|
||||
(`cargo build --release`), working tree otherwise clean apart from this
|
||||
feature's own files. Numbers will move once the recursion-limit and
|
||||
`@(* )` lexer fixes in TODO.md §1 land — re-run and update this section
|
||||
@@ -143,7 +143,7 @@ Two rates, since they differ and both matter:
|
||||
265/820 (**32.3%**). The 24-file gap is the bug list below.
|
||||
- **format-clean** = 1/820 (0.1%), i.e. 0.4% of what is formattable.
|
||||
|
||||
**The 0.1% "already clean" figure is expected, not alarming.** vfmt is an
|
||||
**The 0.1% "already clean" figure is expected, not alarming.** lucisv is an
|
||||
opinionated reformatter and none of these projects were formatted with
|
||||
it; "would-reformat" is the correct outcome for essentially all
|
||||
third-party code. The number worth tracking over time is
|
||||
@@ -197,7 +197,7 @@ category-1 count is a floor, not a ceiling).
|
||||
the obvious addition before drawing a conclusion — see Status/TODO.
|
||||
3. **Classes — roadmap #2 — rank second (182 files) but are almost
|
||||
entirely testbench/DV code** (`ibex/dv/uvm`, `vendor/google_riscv-dv`).
|
||||
If vfmt's target is synthesizable RTL, this is much lower value than
|
||||
If lucisv's target is synthesizable RTL, this is much lower value than
|
||||
its rank implies (34 RTL files); if the target includes UVM
|
||||
testbenches, it is the top item after macros.
|
||||
4. **Three constructs missing from the roadmap outrank three that are on
|
||||
@@ -306,17 +306,17 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1:
|
||||
`name|url|commit|sparse-paths` drives a `git init` + `git fetch --depth 1
|
||||
origin <sha>` + `checkout FETCH_HEAD` per repo. Pinning by SHA rather
|
||||
than tag means `--depth 1` still works (GitHub allows fetching a
|
||||
reachable SHA) while nothing can drift. A `.vfmt-corpus-rev` stamp file
|
||||
reachable SHA) while nothing can drift. A `.lucisv-corpus-rev` stamp file
|
||||
makes re-runs a no-op. Only opentitan uses the sparse path — blobless
|
||||
partial clone plus cone-mode sparse checkout — because it is the only
|
||||
repo where a full shallow clone would be unreasonable.
|
||||
- **`corpus_check.sh`** (138 lines): one `vfmt --check <file>` per file
|
||||
- **`corpus_check.sh`** (138 lines): one `lucisv --check <file>` per file
|
||||
(820 processes; the whole run is a few seconds, so batching was not
|
||||
worth the loss of per-file attribution). Per-file classification lives
|
||||
in one `check_one()` function; everything after it is reporting driven
|
||||
by `awk`/`sort`/`uniq` over the TSV, so the report can be recomputed
|
||||
from a saved TSV without re-running vfmt.
|
||||
- **Why per-file rather than one `vfmt --check corpus/`**: a single
|
||||
from a saved TSV without re-running lucisv.
|
||||
- **Why per-file rather than one `lucisv --check corpus/`**: a single
|
||||
invocation cannot attribute a crash to a file, and its exit code
|
||||
collapses "would reformat" and "error" into 2. Per-file also means one
|
||||
pathological file cannot take the run with it.
|
||||
@@ -327,7 +327,7 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1:
|
||||
is what names the unsupported construct. Backtick-quoted keywords are
|
||||
never normalized in either.
|
||||
- **Read-only by construction**: `--check` is the only mode invoked, and
|
||||
no other vfmt flag is passed.
|
||||
no other lucisv flag is passed.
|
||||
- **Exit status is meaningful**: 0 = no verification errors and no
|
||||
crashes; 1 = at least one of either (formatter bug); 2 = usage/setup
|
||||
error (missing binary, missing corpus, no files found).
|
||||
@@ -348,7 +348,7 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1:
|
||||
- [x] `tools/corpus_check.sh` — per-file outcome classification, summary
|
||||
table, message histogram, blocking-token histogram, explicit
|
||||
per-file listing of verification errors and crashes
|
||||
- [x] Baseline recorded above at vfmt `9f1a6cf`
|
||||
- [x] Baseline recorded above at lucisv `9f1a6cf`
|
||||
- [x] Top-10 unsupported constructs mapped against `README.md`'s roadmap,
|
||||
with an explicit verdict on the priority order
|
||||
- [x] Every verification-error file listed individually, grouped by root
|
||||
@@ -395,7 +395,7 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1:
|
||||
common_cells got its real `v1.40.0` tag SHA. OpenTitan was *not*
|
||||
skipped — a blobless partial clone with a cone sparse checkout of
|
||||
`hw/ip/uart` and `hw/ip/gpio` makes it cheap (35 files).
|
||||
- Built vfmt at `9f1a6cf1d2926358e2a804b33fb4de55bb9f04e7` and ran the
|
||||
- Built lucisv at `9f1a6cf1d2926358e2a804b33fb4de55bb9f04e7` and ran the
|
||||
check over all 820 files. Verified afterwards that all four corpus
|
||||
working trees are clean.
|
||||
- **Key decision — two histograms.** The first run's message histogram
|
||||
@@ -425,7 +425,7 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1:
|
||||
is where the four groups (A comma→`or`, B dropped comments, C merged
|
||||
header imports, D dropped empty `#()`) come from.
|
||||
- Fixed a real bug in `check_one()` while testing: `status` was a global
|
||||
that persisted across files when vfmt exited 0 (`|| status=$?` simply
|
||||
that persisted across files when lucisv exited 0 (`|| status=$?` simply
|
||||
does not fire), so a clean file following an error would have inherited
|
||||
the previous status. Now reset to 0 per call.
|
||||
- Deviation from the task brief: none material. `shellcheck` is not
|
||||
@@ -441,7 +441,7 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1:
|
||||
Scope: `tools/corpus_fetch.sh`, `tools/corpus_check.sh`, this README. Did
|
||||
not touch `crates/` (a concurrent agent has in-flight recursion-limit
|
||||
changes there — `crates/vlog_parser/src/parser.rs`,
|
||||
`crates/vfmt/tests/cli.rs`, new `crates/vlog_formatter/tests/deep_nesting.rs`;
|
||||
`crates/lucisv/tests/cli.rs`, new `crates/vlog_formatter/tests/deep_nesting.rs`;
|
||||
left alone, `cargo build --release` only). No commit/push.
|
||||
|
||||
**Pins and corpus (claim 1) — PASS.** `git -C corpus/<repo> rev-parse
|
||||
@@ -457,7 +457,7 @@ skipping", 0.1s wall, no network hit, corpus untouched — the no-op/
|
||||
re-runnable claim holds.
|
||||
|
||||
**Re-run vs. baseline (claim 3) — PASS, zero delta.** Built
|
||||
`target/release/vfmt` from the current tree (recursion-limit changes
|
||||
`target/release/lucisv` from the current tree (recursion-limit changes
|
||||
in flight but not yet affecting this corpus) and re-ran
|
||||
`tools/corpus_check.sh corpus`. Result is byte-identical to the
|
||||
recorded baseline and to the pre-existing `corpus-check-results.tsv`
|
||||
@@ -469,7 +469,7 @@ doesn't hit deep expression nesting (README's own caveat under
|
||||
"Findings: crashes").
|
||||
|
||||
**Root-cause buckets A–D (claim 4) — PASS, confirmed refusal not
|
||||
corruption.** Ran `vfmt --check` directly on one file per bucket:
|
||||
corruption.** Ran `lucisv --check` directly on one file per bucket:
|
||||
`corpus/common_cells/src/sync.sv` (A, comma→`or`),
|
||||
`corpus/ibex/rtl/ibex_alu.sv` (B, `// Comparator OPs` dropped),
|
||||
`corpus/ibex/vendor/lowrisc_ip/ip/prim/fpv/tb/prim_alert_rxtx_tb.sv`
|
||||
@@ -512,7 +512,7 @@ macro call) over the TSV + corpus source:
|
||||
cross-call persistence the work log describes. Confirmed correct.
|
||||
- Exit-code bucketing (claim 2): would-reformat (exit 1) is correctly
|
||||
folded into `formatted = ok + reformat` and reported as "parsed &
|
||||
formattable", matching vfmt's own frozen 0/1/2 contract in the root
|
||||
formattable", matching lucisv's own frozen 0/1/2 contract in the root
|
||||
`README.md`. Confirmed by direct tests: missing binary → 2, missing
|
||||
corpus dir → 2, empty corpus (0 files found) → 2, verification-error
|
||||
present → script exit 1, crash present → script exit 1.
|
||||
@@ -522,7 +522,7 @@ macro call) over the TSV + corpus source:
|
||||
script's own exit code goes to 1. Confirmed.
|
||||
- **Gap (not a bug, a documented-but-worth-flagging design choice):**
|
||||
`other-error` does **not** contribute to the script's own exit
|
||||
code. Reproduced with a chmod-000 file: vfmt exits 2 with
|
||||
code. Reproduced with a chmod-000 file: lucisv exits 2 with
|
||||
`Permission denied (os error 13)` on stderr (no `parse error:`/`lex
|
||||
error:`/`verification failed` marker), `check_one()` correctly
|
||||
buckets it `other-error`, but `tools/corpus_check.sh`'s own exit
|
||||
|
||||
@@ -17,7 +17,7 @@ defs.svh:12".
|
||||
> "defined as 8 in defs.svh:12" shipped with the server's hover card and was
|
||||
> narrowed to the include graph in M10 (`docs/features/include-nav/README.md`).
|
||||
> The **single-step expansion display** shipped in M14, 2026-08-25:
|
||||
> `crates/vfmt_server/src/expand.rs` substitutes a call site's arguments into
|
||||
> `crates/lucisv_server/src/expand.rs` substitutes a call site's arguments into
|
||||
> `Define::body` using `Define::params` exactly as recorded — defaults and all
|
||||
> — and adds an "expands to" section to the card. `defines.rs` is byte-identical
|
||||
> across that round: `params` "as written" and the LRM-literal body
|
||||
@@ -140,7 +140,7 @@ Design notes:
|
||||
- **Conditional compilation is not evaluated.** A `` `define`` inside an
|
||||
`` `ifdef``/`` `else`` is recorded exactly like any other, so both arms of a
|
||||
conditional pair appear in the table. Evaluating conditions needs a
|
||||
preprocessor and a set of active defines, which vfmt deliberately does not
|
||||
preprocessor and a set of active defines, which lucisv deliberately does not
|
||||
have; the ordered list plus the `` `undef`` events is the raw material a
|
||||
future position-aware resolver would need.
|
||||
- **One file.** No `` `include`` following, no cross-file merge. That is the
|
||||
@@ -194,12 +194,12 @@ changed, so they are stated here rather than left implicit:
|
||||
"the trimmed line ends in `\`". `defines.rs::continuation_len` mirrors it,
|
||||
trailing-whitespace tolerance included.
|
||||
|
||||
**Promised to future consumers (`vfmt_server`, `vlog_semantic`):** the API
|
||||
**Promised to future consumers (`lucisv_server`, `vlog_semantic`):** the API
|
||||
above. Nothing depends on it yet, so it is free to change; the two things
|
||||
worth not changing casually are the body normalization rule (a hover string is
|
||||
user-visible) and "all definitions are kept".
|
||||
|
||||
> **No longer free to change (M14, 2026-08-25).** `vfmt_server`'s
|
||||
> **No longer free to change (M14, 2026-08-25).** `lucisv_server`'s
|
||||
> `expand.rs` now reads `body` *and* `params` structurally: it splits a
|
||||
> parameter on its first `=` to get the name and the default, and it counts
|
||||
> `params` against the arguments at a call site, declining to expand on a
|
||||
@@ -537,4 +537,4 @@ respectively.
|
||||
|
||||
With this, TODO §6's data foundations are complete: spans,
|
||||
error-tolerant parsing, define table. Next: `vlog_semantic` + the
|
||||
workspace index, then `vfmt_server`.
|
||||
workspace index, then `lucisv_server`.
|
||||
@@ -21,7 +21,7 @@ read that README's Assumptions first. The ones specific to this round:
|
||||
lexer reads from `` `ifdef`` to end of line as one token. No corpus file
|
||||
writes it.
|
||||
- **Both arms contribute.** `` `ifdef``/`` `else`` arms are both ordinary
|
||||
entries of the one list, in source order. vfmt does not evaluate conditions.
|
||||
entries of the one list, in source order. lucisv does not evaluate conditions.
|
||||
- **A *comment* may share a directive's line, but a comma may not.** The
|
||||
lexer's directive capture stops before a `//` or `/*`
|
||||
(`crates/vlog_parser/src/lexer.rs:182`), so `` `endif // why`` round-trips as
|
||||
@@ -110,8 +110,8 @@ inside the enclosing item's span. `crates/vlog_parser/tests/spans.rs` now walks
|
||||
`inst.param_directives` and each `instance.conn_directives`, and two sources
|
||||
holding them were added to `SOURCES`.
|
||||
|
||||
**Not touched, by scope:** `crates/vfmt`, `crates/vfmt_core`,
|
||||
`crates/vfmt_server`, `crates/vlog_linter`, `crates/vlog_semantic`,
|
||||
**Not touched, by scope:** `crates/lucisv`, `crates/lucisv_core`,
|
||||
`crates/lucisv_server`, `crates/vlog_linter`, `crates/vlog_semantic`,
|
||||
`crates/vlog_formatter/src/verify.rs`, `crates/vlog_formatter/src/fence.rs`,
|
||||
`editors/`, `tools/`, `corpus/`. `cargo fmt` was run per-package
|
||||
(`-p vlog_parser -p vlog_formatter`), never `--all`, so it could not rewrite the
|
||||
@@ -236,7 +236,7 @@ loop only continues past a comma — which is why no pre-existing case moved.
|
||||
Three runs, TSVs byte-identical (md5 `0a3dad76ad648af8494dca637dbba52b` each
|
||||
time).
|
||||
Corpus repos verified unmodified afterwards (`git status --porcelain` clean in
|
||||
all four except the untracked `.vfmt-corpus-rev` stamp).
|
||||
all four except the untracked `.lucisv-corpus-rev` stamp).
|
||||
|
||||
The "before" column is **not** the previous round's published table: a second
|
||||
agent's work (`shared-fence-filter`, `server-lint`) landed in this working tree
|
||||
@@ -269,7 +269,7 @@ error.** The six are exactly the six named targets:
|
||||
| `corpus/picorv32/testbench_wb.v` | `parse-error` 110:1 `` `ifndef SYNTH_TEST`` | **would-reformat** |
|
||||
| `corpus/picorv32/scripts/torture/testbench.v` | `parse-error` 41:1 `` `include "config.vh"`` | **would-reformat** |
|
||||
|
||||
All six were re-run through `vfmt -` for three passes; every pass exited 0
|
||||
All six were re-run through `lucisv -` for three passes; every pass exited 0
|
||||
(which already means `format_source`'s internal `verify_equivalence` +
|
||||
`verify_convergence` accepted it) and pass1 == pass2 == pass3 byte-for-byte.
|
||||
|
||||
@@ -315,8 +315,8 @@ bucket. The payoff of this round is six files that format, not a bigger index.
|
||||
README.** `cargo test --workspace` was 568 (not the 563 the brief quotes —
|
||||
a second agent's `server-lint` tests had already landed), and the corpus TSV
|
||||
was md5 `31ffdb18c96d4e79057178f7de269756`, matching the previous round's
|
||||
published "after". One `vfmt_server` e2e test
|
||||
(`fix_all_edits_exactly_what_vfmt_check_fix_edits_inside_a_fence`) was
|
||||
published "after". One `lucisv_server` e2e test
|
||||
(`fix_all_edits_exactly_what_lucisv_check_fix_edits_inside_a_fence`) was
|
||||
failing mid-session; **verified it fails identically with this feature's
|
||||
three files stashed out**, so it was the other agent's in-flight
|
||||
`shared-fence-filter` work, not mine. It is green again in the final run.
|
||||
@@ -379,7 +379,7 @@ bucket. The payoff of this round is six files that format, not a bigger index.
|
||||
the previous round's — so every one of the 6 gains is attributable here. Ran
|
||||
the final corpus twice; identical md5. All four corpus repos confirmed
|
||||
unmodified.
|
||||
- **Did not touch** `crates/vfmt`, `crates/vfmt_core`, `crates/vfmt_server`,
|
||||
- **Did not touch** `crates/lucisv`, `crates/lucisv_core`, `crates/lucisv_server`,
|
||||
`crates/vlog_linter`, `crates/vlog_semantic`, `verify.rs`, `fence.rs`,
|
||||
`tools/`, `corpus/`. Ran `cargo fmt -p vlog_parser -p vlog_formatter`, never
|
||||
`--all`, so the concurrent agent's files could not be rewritten. Re-read
|
||||
@@ -434,7 +434,7 @@ both directions, connection-list-is-only-a-directive
|
||||
`.*` beside a directive, directive + trailing `//` comment, directive +
|
||||
comment before the closing `)` (the fixed bug's exact shape), multi-instance
|
||||
with a directive in one instance's list. All 18 in-scope shapes: pass1 == pass2
|
||||
== pass3 byte-for-byte, exit 0/0/0 (three separate `vfmt -` invocations via the
|
||||
== pass3 byte-for-byte, exit 0/0/0 (three separate `lucisv -` invocations via the
|
||||
debug binary, not just one `--check`). The two out-of-scope shapes (gate
|
||||
instance with a directive between arguments; a directive between two instances
|
||||
of one declaration) both give a clean parse error and never emit output —
|
||||
@@ -447,7 +447,7 @@ directive lines survive formatting *by line number*: read each target at its
|
||||
originally-cited line (`ibex_lockstep.sv:518`, `ibex_top.sv:456`,
|
||||
`spec_instance.sv:65`, `testbench.v:164`, `testbench_wb.v:110`,
|
||||
`torture/testbench.v:41`) and grepped the same directive text in
|
||||
`vfmt --stdout` output — present verbatim (only re-indented) in all six.
|
||||
`lucisv --stdout` output — present verbatim (only re-indented) in all six.
|
||||
|
||||
**Corpus (3).** `tools/corpus_check.sh corpus` release build, run twice:
|
||||
byte-identical TSVs, md5 `0a3dad76ad648af8494dca637dbba52b` both times —
|
||||
|
||||
@@ -7,7 +7,7 @@ Accept `` `ifdef``/`` `ifndef``/`` `else``/`` `elsif``/`` `endif``,
|
||||
*between the elements* of a module header's port list, its parameter port
|
||||
list, and an enum member list. They were already accepted wherever a module
|
||||
item or a statement belongs (`macro-items`); a port list was the one place
|
||||
real RTL writes them that vfmt refused. This is README roadmap item 6, and
|
||||
real RTL writes them that lucisv refused. This is README roadmap item 6, and
|
||||
its named payoff is the workspace index: `picorv32`, `picorv32_axi` and
|
||||
`picorv32_wb` were the index's biggest named gaps (570 external references)
|
||||
because their headers hold an `` `ifdef`` inside the port list, which swallowed
|
||||
@@ -20,7 +20,7 @@ and `verify.rs` is byte-identical to `HEAD`.**
|
||||
|
||||
## Assumptions
|
||||
|
||||
- **vfmt does not evaluate the condition, and this feature does not change
|
||||
- **lucisv does not evaluate the condition, and this feature does not change
|
||||
that.** Both arms of an `` `ifdef``/`` `else`` contribute their elements to
|
||||
the one list, in source order, exactly as an `` `ifdef`` at item position
|
||||
already contributes both arms' items. The formatter is a text tool; a
|
||||
@@ -124,7 +124,7 @@ of which line breaks are data.
|
||||
|
||||
**Format fences (`docs/features/format-fences/README.md`): unchanged.**
|
||||
`fence::scan_scope` walks item-level leading comments only, so a
|
||||
`// vfmt: off` written before a list directive opens no region — exactly as it
|
||||
`// lucisv: off` written before a list directive opens no region — exactly as it
|
||||
opened none when the same comment landed in the first port's `meta.leading`.
|
||||
`fence.rs`, `tests/fences.rs` and `fences.cases` are untouched and green.
|
||||
|
||||
@@ -142,10 +142,10 @@ directives were added to its `SOURCES` table so
|
||||
`every_node_span_nests_inside_its_parent` and the token-coverage tests cover
|
||||
them.
|
||||
|
||||
**Not touched, by scope:** `crates/vfmt`, `crates/vfmt_core`,
|
||||
`crates/vfmt_server`, `crates/vlog_linter`, `crates/vlog_semantic`,
|
||||
**Not touched, by scope:** `crates/lucisv`, `crates/lucisv_core`,
|
||||
`crates/lucisv_server`, `crates/vlog_linter`, `crates/vlog_semantic`,
|
||||
`crates/vlog_formatter/src/verify.rs`, `editors/`, `tools/`, `corpus/`. A
|
||||
second agent was working in `vfmt_server` and `vlog_linter` concurrently; both
|
||||
second agent was working in `lucisv_server` and `vlog_linter` concurrently; both
|
||||
crates compile and their tests pass against this diff unmodified. `cargo fmt`
|
||||
was run per-package (`-p vlog_parser -p vlog_formatter`) rather than `--all`,
|
||||
so it could not rewrite the other agent's files.
|
||||
@@ -164,7 +164,7 @@ directions:
|
||||
| `` `ifdef X`` ⏎ `input a` ⏎ `` `else`` ⏎ `input b` ⏎ `` `endif`` | `input a,` ⏎ `` `else`` ⏎ `input b` | a comma invented that the source never wrote |
|
||||
|
||||
Both are token-stream changes, so both would be *refused* rather than
|
||||
corrupting — but a file vfmt refuses is a file vfmt cannot format, and the
|
||||
corrupting — but a file lucisv refuses is a file lucisv cannot format, and the
|
||||
second shape is ordinary RTL. A derivation rule that consults the gap's
|
||||
directives handles the first case and still fails the second, so it was
|
||||
rejected as clever-and-wrong.
|
||||
@@ -278,7 +278,7 @@ group open, and a flat `(a, `ifdef X, b)` would fuse three tokens into one.
|
||||
|
||||
`./tools/corpus_check.sh corpus`, release build, script exit status **0**.
|
||||
Corpus verified unmodified afterwards (`git status --porcelain` clean in all
|
||||
four repos except the untracked `.vfmt-corpus-rev` stamp). Two runs, TSVs
|
||||
four repos except the untracked `.lucisv-corpus-rev` stamp). Two runs, TSVs
|
||||
byte-identical (deterministic).
|
||||
|
||||
| outcome | before (`3a503e1`, the tree this work started from) | after |
|
||||
@@ -435,8 +435,8 @@ correction, not a loss.
|
||||
format, because of `restrict property`. The brief's stated payoff (the
|
||||
index) is delivered; the formatting half is blocked behind roadmap item 7
|
||||
and saying otherwise would be a lie the numbers would catch.
|
||||
- Did not touch `crates/vfmt_server`, `crates/vlog_linter`,
|
||||
`crates/vlog_semantic`, `crates/vfmt*`, `tools/` or `corpus/`. Ran
|
||||
- Did not touch `crates/lucisv_server`, `crates/vlog_linter`,
|
||||
`crates/vlog_semantic`, `crates/lucisv*`, `tools/` or `corpus/`. Ran
|
||||
`cargo fmt -p vlog_parser -p vlog_formatter` rather than `--all` so the
|
||||
concurrent agent's files could not be rewritten. Did not run
|
||||
`git commit`/`git push`.
|
||||
@@ -468,8 +468,8 @@ clean. `git diff --quiet -- crates/vlog_formatter/src/verify.rs`: exit 0
|
||||
`fences.cases`: all diff-clean.
|
||||
|
||||
**Cross-crate untouched claim.** `git diff --stat crates/vlog_semantic
|
||||
crates/vlog_linter crates/vfmt crates/vfmt_core crates/vfmt_server` is empty.
|
||||
`crates/vfmt_server/` and `crates/vlog_linter/` are untracked (concurrent
|
||||
crates/vlog_linter crates/lucisv crates/lucisv_core crates/lucisv_server` is empty.
|
||||
`crates/lucisv_server/` and `crates/vlog_linter/` are untracked (concurrent
|
||||
agent's work per the README) so nothing to diff there either; both compiled
|
||||
and their tests passed as part of the 563.
|
||||
|
||||
@@ -478,7 +478,7 @@ byte-identical TSVs, md5 `31ffdb18c96d4e79057178f7de269756` both times,
|
||||
exit 0 both times. Table matches exactly: 8 ok-unchanged, 462
|
||||
would-reformat, 350 parse-error, 0 verification-error, 0 crash, 470/820
|
||||
formattable. Corpus repos confirmed clean afterwards (`git status
|
||||
--porcelain` in each of the four, only the untracked `.vfmt-corpus-rev`
|
||||
--porcelain` in each of the four, only the untracked `.lucisv-corpus-rev`
|
||||
stamp). Spot-checked every by-path claim directly against the TSV and the
|
||||
source files:
|
||||
- `ibex_core.sv` → `would-reformat` ✓; `csmith/testbench.v` → `would-reformat` ✓.
|
||||
@@ -525,7 +525,7 @@ adjacent directives (`` `ifdef``+`` `define``); a `` `define`` with a `\`
|
||||
continuation inside a parameter list; an arm element carrying a trailing
|
||||
comment; an enum with `` `include`` + a macro invocation between members;
|
||||
a non-ANSI header with directives). Ran each through the debug binary via
|
||||
`vfmt -` for 3 passes (`vfmt(vfmt(vfmt(x)))`); every pass exited 0 (which
|
||||
`lucisv -` for 3 passes (`lucisv(lucisv(lucisv(x)))`); every pass exited 0 (which
|
||||
already means `format_source`'s internal `verify_equivalence` +
|
||||
`verify_convergence` accepted it — no corruption, no dropped comment/token
|
||||
possible on a 0 exit) and pass2==pass3 byte-for-byte on all 20. Eyeballed 6
|
||||
@@ -560,7 +560,7 @@ survived, `` `define`` continuation stayed properly dedented/reindented,
|
||||
byte-identical to `run1.tsv`, same md5, corpus repos still clean.
|
||||
|
||||
**`module m (a, );` still a parse error** — confirmed directly:
|
||||
`./target/release/vfmt --check` on that exact input exits 2 with
|
||||
`./target/release/lucisv --check` on that exact input exits 2 with
|
||||
`expected identifier (found ")")`.
|
||||
|
||||
**Findings (both non-blocking, documentation only):**
|
||||
|
||||
@@ -164,7 +164,7 @@ of the existing function/task header (`Fmt::dpi_import_prefix`), so a DPI
|
||||
import lays out exactly like the prototype it is: header on one line, argument
|
||||
list a breakable group that goes one-per-line when it does not fit. The
|
||||
multi-line `import "DPI-C"` / `function ...` spelling the ibex DV files use
|
||||
collapses onto one line, which is what every other multi-line header in vfmt
|
||||
collapses onto one line, which is what every other multi-line header in lucisv
|
||||
does. Exports print flat.
|
||||
|
||||
**Safety net.** `verify.rs` was not touched and did not need to be: every one
|
||||
@@ -199,7 +199,7 @@ Targeted attacks:
|
||||
|
||||
- **`export *::*` → `ImportPath` with package `"*"`.** `package p; export
|
||||
*::*; endpackage` formats unchanged and is idempotent
|
||||
(`target/release/vfmt --stdout` twice, `cmp` clean).
|
||||
(`target/release/lucisv --stdout` twice, `cmp` clean).
|
||||
|
||||
- **`is_prototype` doubling as "DPI import".** No case found where this
|
||||
conflation produces a wrong-but-plausible read; every DPI import/export
|
||||
|
||||
@@ -52,13 +52,13 @@ its input bytes exactly is trivially token-equivalent.
|
||||
instead of formatting — the same trade every other reserved word makes.
|
||||
- **`with` is a postfix segment only when a `(` or `{` follows it.** That is
|
||||
what tells the two `with` grammars apart, and it is what keeps the stream
|
||||
expression's `with [range]` — which vfmt does not model — failing exactly
|
||||
expression's `with [range]` — which lucisv does not model — failing exactly
|
||||
where it always did.
|
||||
- **A `foreach`'s loop variables are the last bracket group**, the one the
|
||||
`)` follows; every earlier bracket is an ordinary select on the array. The
|
||||
LRM spells the multi-dimensional form `foreach (a[i, j])`, and the
|
||||
`foreach (a[i][j])` spelling real code writes is read as "loop over `j`
|
||||
with `a[i]` as the array". vfmt only prints the header back, so the two
|
||||
with `a[i]` as the array". lucisv only prints the header back, so the two
|
||||
readings emit the same tokens either way.
|
||||
- **Empty loop-variable slots (`foreach (a[, j])`) are not supported.** No
|
||||
corpus file writes one; it stays the parse error it was.
|
||||
@@ -68,7 +68,7 @@ its input bytes exactly is trivially token-equivalent.
|
||||
- **An omitted list element is recognized wherever a list element is
|
||||
parsed**, not only in call argument lists — the same call
|
||||
`parse_expr_item` already makes for named arguments and `[lo:hi]` value
|
||||
ranges, for the reason its comment gives: vfmt checks legality nowhere
|
||||
ranges, for the reason its comment gives: lucisv checks legality nowhere
|
||||
else either, and a wrong guess emits the same tokens.
|
||||
- **An omitted argument in a list that breaks gets a line with nothing but
|
||||
its `,` on it.** `create("x", , y)` when the list fits is one line, which
|
||||
@@ -423,7 +423,7 @@ if (a.randomize() with {
|
||||
z = 1;
|
||||
end
|
||||
```
|
||||
`target/release/vfmt --stdout --line-length 40 with5.sv` keeps the whole
|
||||
`target/release/lucisv --stdout --line-length 40 with5.sv` keeps the whole
|
||||
` } && some_really_quite_long_flag_name_that_would_overflow_the_line_length_for_sure) begin`
|
||||
tail on one line (99 characters, well past the 40-column limit requested),
|
||||
where the *same* `if` condition without the `with`-block correctly wraps the
|
||||
|
||||
@@ -45,14 +45,14 @@ calls (`q.push_back(x)`, `q.size()`) are ordinary member calls.
|
||||
|
||||
- **`$` is an ordinary primary expression, not a keyword.** In real code a
|
||||
bare `$` stands only where a queue bound belongs (`q[$]`, `[$:N]`,
|
||||
`q[$-1]`), but vfmt does not check legality anywhere else either, and one
|
||||
`q[$-1]`), but lucisv does not check legality anywhere else either, and one
|
||||
`ExprKind::Ident("$")` leaf makes every position — dims, indexes, ranges,
|
||||
arithmetic — work through the existing expression grammar. This follows the
|
||||
`new`/`this`/`super` precedent from the classes round. The lexer already
|
||||
emits a lone `$` as a one-char Symbol token; nothing lexes differently.
|
||||
- **`{}` is accepted as an empty concatenation** (`ExprKind::Concat(vec![])`)
|
||||
because SystemVerilog's empty queue literal is spelled that way
|
||||
(`mem_states[$] = {};`). Plain Verilog forbids `{}`; vfmt is a formatter,
|
||||
(`mem_states[$] = {};`). Plain Verilog forbids `{}`; lucisv is a formatter,
|
||||
not a compiler, and refusing it would keep a real corpus file blocked.
|
||||
- **A named call argument is recognized by `.` + identifier at an expression
|
||||
*element* start.** `parse_expr_item` is shared by call arguments, concats,
|
||||
@@ -63,7 +63,7 @@ calls (`q.push_back(x)`, `q.size()`) are ordinary member calls.
|
||||
labels need and no expression could previously start with.
|
||||
- **`case (x) inside` is the same statement with one extra token.** The
|
||||
`inside` flag is stored on `StmtKind::Case` and printed back; item labels
|
||||
are the ordinary label list plus `[lo:hi]` ranges. vfmt does not restrict
|
||||
are the ordinary label list plus `[lo:hi]` ranges. lucisv does not restrict
|
||||
range labels to inside-mode cases — a plain `case` with a `[1:2]:` label is
|
||||
not legal SV but parses; same tokens out, no corruption possible.
|
||||
- **A bare `@name;` (no parens) is printed back without parens.** Before this
|
||||
@@ -163,10 +163,10 @@ loop and label loop were already flat.
|
||||
`ValueRange`/`Bare` reuse existing walker arms; two dynamic-type sources were
|
||||
added to `SOURCES`.
|
||||
|
||||
**Not touched, by scope:** `crates/vfmt`, `crates/vfmt_core`,
|
||||
`crates/vfmt_server`, `crates/vlog_linter`, `verify.rs`, `fence.rs`,
|
||||
**Not touched, by scope:** `crates/lucisv`, `crates/lucisv_core`,
|
||||
`crates/lucisv_server`, `crates/vlog_linter`, `verify.rs`, `fence.rs`,
|
||||
`editors/`, `tools/`, `corpus/`. A concurrent agent owns `vlog_linter` /
|
||||
`vfmt` / `vfmt_server` this round; `cargo fmt` was run per-package
|
||||
`lucisv` / `lucisv_server` this round; `cargo fmt` was run per-package
|
||||
(`-p vlog_parser -p vlog_formatter -p vlog_semantic`), never `--all`.
|
||||
|
||||
## Status / TODO
|
||||
@@ -241,7 +241,7 @@ added to `SOURCES`.
|
||||
build, exit 0. Three runs (two mid-round, one after the final `cargo fmt`):
|
||||
byte-identical TSVs, md5 `e6f12eb7964e22e452655cf517cae766`. All four corpus
|
||||
repos verified unmodified afterwards (`git status --porcelain` clean apart
|
||||
from the pre-existing untracked `.vfmt-corpus-rev` stamps).
|
||||
from the pre-existing untracked `.lucisv-corpus-rev` stamps).
|
||||
|
||||
| metric | before | after |
|
||||
|---|---|---|
|
||||
@@ -371,12 +371,12 @@ assignment-operator fix exposed the named-arg-paren drop in the same file.
|
||||
corpus repos confirmed clean. The `` `else`` 13 and `with` 7 next-blockers
|
||||
were read at their sites and filed under Status/TODO with the evidence.
|
||||
- **Scope discipline:** did not touch `verify.rs`, `fence.rs`,
|
||||
`crates/vfmt*`, `crates/vlog_linter` (its `visit.rs` needed no arm — it
|
||||
`crates/lucisv*`, `crates/vlog_linter` (its `visit.rs` needed no arm — it
|
||||
has no expression walk and its `Case` matches use `..`), `tools/`,
|
||||
`corpus/`. The concurrent one-parse-two-tools agent's files churned in the
|
||||
same tree throughout; `cargo fmt` was run per-package
|
||||
(`-p vlog_parser -p vlog_formatter -p vlog_semantic`), never `--all`, and
|
||||
the one transient `vfmt_server` test failure observed mid-round was
|
||||
the one transient `lucisv_server` test failure observed mid-round was
|
||||
re-run and confirmed to be their in-flight edit, not this diff. Did not
|
||||
run `git commit` / `git push`.
|
||||
- **Session note:** the session was interrupted by a usage limit mid-way
|
||||
@@ -440,10 +440,10 @@ is uncommitted here too; its files were attributed, not flagged — see
|
||||
`scratchpad/head-wt`, provenance re-verified — `git rev-parse HEAD` =
|
||||
`e9008b680c2df86c7bea6d29095250958c132306`, `git status --porcelain` empty,
|
||||
`cargo build --release` a no-op (binary genuinely fresh at `e9008b6`, md5
|
||||
`feaa240d`). "New" binary: this tree's `target/release/vfmt` (md5 `957e2ad6`),
|
||||
`feaa240d`). "New" binary: this tree's `target/release/lucisv` (md5 `957e2ad6`),
|
||||
also confirmed up to date. `corpus/` never written to; all four corpus repos
|
||||
`git status --porcelain` clean afterwards apart from the pre-existing
|
||||
untracked `.vfmt-corpus-rev` stamps.
|
||||
untracked `.lucisv-corpus-rev` stamps.
|
||||
|
||||
**Claim-by-claim.**
|
||||
|
||||
@@ -474,7 +474,7 @@ untracked `.vfmt-corpus-rev` stamps.
|
||||
`` `uvm_field_int`` 11, `'` 7, `with` 7, `"DPI-C"` 7, `$error` 6,
|
||||
`virtual` 4, `export` 4.
|
||||
- **Round-trip of all 636**, not sampled: copied to a scratch directory,
|
||||
`vfmt format` in place (0 failures), then `vfmt --check` (0 failures) —
|
||||
`lucisv format` in place (0 failures), then `lucisv --check` (0 failures) —
|
||||
every one a verified fixed point.
|
||||
- **Stronger than asked: all 578 previously-formattable files were
|
||||
compared byte-for-byte old-vs-new**, not a 20-file sample.
|
||||
@@ -499,9 +499,9 @@ untracked `.vfmt-corpus-rev` stamps.
|
||||
correct, they hold no expressions), and
|
||||
`ExprKind::NamedArg { value, .. }`. Nothing else in the crate changed.
|
||||
**Attribution:** `crates/vlog_linter/{src/context.rs,src/lib.rs,tests/rules.rs}`,
|
||||
`crates/vfmt/src/lint.rs`, `crates/vfmt_server/{lint,state}.rs` are the
|
||||
`crates/lucisv/src/lint.rs`, `crates/lucisv_server/{lint,state}.rs` are the
|
||||
one-parse round's own file list (its README §Handshakes / §Work log), and
|
||||
`crates/vfmt_server/src/diagnostics.rs` is the lead's QA-1 fix recorded in
|
||||
`crates/lucisv_server/src/diagnostics.rs` is the lead's QA-1 fix recorded in
|
||||
that round's Review §4. `git diff crates/vlog_linter/` contains **no**
|
||||
dynamic-types symbol (`DimKind`/`NamedArg`/`SensList`/`inside`/
|
||||
`op_comments`) — this feature really did not touch it.
|
||||
@@ -524,7 +524,7 @@ succeeded, re-parsed by the net's own equivalence + convergence check).**
|
||||
are idempotent. **Illegal positions are accepted and round-trip losslessly**:
|
||||
`assign x = $;`, `x = $ + 1;`, `x = $$;`, `f($, $)`, `logic [$:0] w;` all
|
||||
emit the same tokens back. That is consistent with the documented
|
||||
Assumption ("vfmt does not check legality anywhere else either") and cannot
|
||||
Assumption ("lucisv does not check legality anywhere else either") and cannot
|
||||
corrupt. **No identifier collision:** `int $;` is a parse error
|
||||
(`expected identifier (found "$")`), so `$` cannot be declared.
|
||||
`$display`/`$bits(int)`/`$error`/`$time`/`$finish` are byte-unaffected.
|
||||
@@ -538,8 +538,8 @@ succeeded, re-parsed by the net's own equivalence + convergence check).**
|
||||
- *`NamedArg`.* `f(.a(x), .b())`, `.a()` empty, named-in-`$display`
|
||||
(`$display(.fmt("%d"), .v(x))`), scoped callees, and **mixed positional +
|
||||
named in both orders** (`g(x, .b(y))`, `h(.a(x), y)`) all parse — SV forbids
|
||||
the mix, vfmt accepts it and emits the same tokens, matching the documented
|
||||
"vfmt is not a legality checker" stance. A nested `k(.a(.b(x)))` is a parse
|
||||
the mix, lucisv accepts it and emits the same tokens, matching the documented
|
||||
"lucisv is not a legality checker" stance. A nested `k(.a(.b(x)))` is a parse
|
||||
error (refusal, safe). **Disambiguation holds:** `sub #(.W(8), .D()) u0
|
||||
(.clk(clk), .d(), .q(q));`, `sub u1 (.*);` and `sub u2 (.a(1), .b);` are
|
||||
byte-identical old-vs-new — instantiation connections still take the
|
||||
@@ -583,9 +583,9 @@ succeeded, re-parsed by the net's own equivalence + convergence check).**
|
||||
`case … inside`, both bare event controls, the macro-then-`cov.` shape, and
|
||||
an `` `ifndef``/`` `endif`` wrapper: **format(format(format(x))) == format(x)**,
|
||||
and all six embedded comments present in the output.
|
||||
- *Lint path over the new syntax.* `vfmt check` over the probe files runs
|
||||
- *Lint path over the new syntax.* `lucisv check` over the probe files runs
|
||||
clean and `case-missing-default` correctly fires on `case … inside`. See
|
||||
QA-7 for the corpus-wide `vfmt check` delta.
|
||||
QA-7 for the corpus-wide `lucisv check` delta.
|
||||
|
||||
**Sabotage (each applied, caught, reverted, and the revert proven by `cmp`
|
||||
against a pre-sabotage byte copy).**
|
||||
@@ -681,7 +681,7 @@ failed**.
|
||||
Handshakes promises — including its pre-existing limitation. The shapes that
|
||||
*do* work in a connection also work in a named argument (`.a(x /* post */)`,
|
||||
`.a(/* only */)`, `.a(x // line` ⏎ `)`).
|
||||
- **QA-7 (INFORMATIONAL — cross-round note for the lead).** `vfmt check
|
||||
- **QA-7 (INFORMATIONAL — cross-round note for the lead).** `lucisv check
|
||||
corpus` differs from the HEAD binary by **10 lines, net +6 findings** (7921
|
||||
→ 7927), entirely as a consequence of files that now parse: 7 new, correct
|
||||
`case-missing-default` findings on `case … inside` statements, and at
|
||||
@@ -692,7 +692,7 @@ failed**.
|
||||
Handshakes' "Required of `vlog_linter`: nothing" is correct *at the
|
||||
compilation level*. Flagged only because the concurrent one-parse round
|
||||
proved its lint output byte-identical against a tree that did not contain
|
||||
this round: in the merged tree `vfmt check` output is no longer identical to
|
||||
this round: in the merged tree `lucisv check` output is no longer identical to
|
||||
`e9008b6`'s, and those 10 lines are why.
|
||||
- **QA-8 (INFORMATIONAL).** A `[lo:hi]` value range is accepted at every
|
||||
expression-element position **except the first call argument**:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Goal
|
||||
|
||||
`vfmt-server` has been a running binary since round 11, but a binary nobody can
|
||||
`lucisv-server` has been a running binary since round 11, but a binary nobody can
|
||||
launch from an editor is a demo. This round closes TODO.md §6's last
|
||||
non-deferred item: a **minimal VS Code extension** that registers the
|
||||
Verilog/SystemVerilog file types and starts the server, and **documented
|
||||
@@ -39,7 +39,7 @@ static snippet templates, which LSP has no channel for — see
|
||||
`editors/vscode/README.md` covers the collision.
|
||||
- **The user builds the binary.** No download, no bundled executable, no
|
||||
version check between extension and server. `cargo build --release` and a
|
||||
`PATH` entry, or an absolute `vfmt.serverPath`. A version handshake would be
|
||||
`PATH` entry, or an absolute `lucisv.serverPath`. A version handshake would be
|
||||
worth adding the day a released extension can meet an older server; today
|
||||
they come out of the same working tree.
|
||||
- **Marketplace publishing is out of scope**, as is CI packaging. `publisher`
|
||||
@@ -55,11 +55,11 @@ the same way:
|
||||
|
||||
| Not shipped | Why |
|
||||
|---|---|
|
||||
| ~~TextMate grammar~~ — **ships since 0.4.1** | The original reasoning (below) was right about the *buffer* and wrong about *markdown*, which semantic tokens cannot reach at all. See "The TextMate grammar" below. Struck through rather than deleted, because the reason it was cut is still the reason it is deliberately small. *(Original: "The server ships `semanticTokens` (14 types, `docs/features/vfmt-server/README.md`). A grammar would be a second, worse highlighter to keep in sync.")* |
|
||||
| ~~TextMate grammar~~ — **ships since 0.4.1** | The original reasoning (below) was right about the *buffer* and wrong about *markdown*, which semantic tokens cannot reach at all. See "The TextMate grammar" below. Struck through rather than deleted, because the reason it was cut is still the reason it is deliberately small. *(Original: "The server ships `semanticTokens` (14 types, `docs/features/lucisv-server/README.md`). A grammar would be a second, worse highlighter to keep in sync.")* |
|
||||
| `language-configuration.json` | Comment/bracket rules are the smallest useful thing here, and still a judgement call about Verilog syntax living in the editor layer. The brief says "declare the language only"; if `Ctrl+/` proves painful, this is the first thing to add back — 12 lines, no dependency. |
|
||||
| Commands (restart server, show logs) | The language client already contributes a restart command and an output channel. |
|
||||
| Status bar item | State the user can already see in the Output panel. |
|
||||
| Settings beyond `serverPath` | Formatter options belong in `vfmt.toml`, one source of truth for the CLI and the editor. (The caveat that once lived here — "the server does not read it yet" — was closed by vfmt-core-lift; lead trued up all three doc locations at review.) |
|
||||
| Settings beyond `serverPath` | Formatter options belong in `lucisv.toml`, one source of truth for the CLI and the editor. (The caveat that once lived here — "the server does not read it yet" — was closed by lucisv-core-lift; lead trued up all three doc locations at review.) |
|
||||
| Bundling (esbuild/webpack) | `vsce` warns about the 166 JavaScript files in the dependency; bundling would add a build step to a repo whose extension has none. 460 KB is not a problem worth a toolchain. |
|
||||
| A Neovim plugin | The configuration *is* the integration. A plugin would only wrap `vim.lsp.config`. |
|
||||
|
||||
@@ -69,9 +69,9 @@ the same way:
|
||||
|
||||
Semantic tokens colour *buffers*. The server's richest output is not a buffer:
|
||||
it is **markdown** — hover cards carrying a declaration snippet or a
|
||||
`` `define`` expansion (`crates/vfmt_server/src/hover.rs:89,131`) and a
|
||||
`` `define`` expansion (`crates/lucisv_server/src/hover.rs:89,131`) and a
|
||||
completion template's documentation panel
|
||||
(`crates/vfmt_server/src/completion.rs:423`). All three have always been fenced
|
||||
(`crates/lucisv_server/src/completion.rs:423`). All three have always been fenced
|
||||
```` ```systemverilog ````, which was correct and did nothing: VS Code colours a
|
||||
fenced block by looking the fence's info string up in the **language registry**
|
||||
and tokenizing with the TextMate grammar registered for that language id.
|
||||
@@ -93,7 +93,7 @@ attached (diffs, git blame, walkthrough panes).
|
||||
`editors/vscode/syntaxes/systemverilog.tmLanguage.json` is registered **twice**
|
||||
in `contributes.grammars`, once for `verilog` and once for `systemverilog`,
|
||||
with the same `scopeName` (`source.systemverilog`) and the same `path`. That is
|
||||
the boring option, and it is honest: vfmt's own lexer has a single `KEYWORDS`
|
||||
the boring option, and it is honest: lucisv's own lexer has a single `KEYWORDS`
|
||||
list serving both dialects, so a second grammar would be a copy that can only
|
||||
drift.
|
||||
|
||||
@@ -109,7 +109,7 @@ against VS Code's own shipped code rather than assumed. In
|
||||
registration for a scope warns **only when the two locations differ**:
|
||||
`isEqual(old.location, new.location) || console.warn('Overwriting grammar scope
|
||||
name to file mapping…')`. Same file, no warning; the language-to-scope map
|
||||
takes both ids. `crates/vfmt_server/tests/grammar.rs` asserts both entries keep
|
||||
takes both ids. `crates/lucisv_server/tests/grammar.rs` asserts both entries keep
|
||||
naming the same path, so that stays true.
|
||||
|
||||
### Pattern inventory
|
||||
@@ -167,7 +167,7 @@ taxonomy here.
|
||||
|
||||
### The drift test, and why there is no regex-compile test
|
||||
|
||||
`crates/vfmt_server/tests/grammar.rs`, three tests:
|
||||
`crates/lucisv_server/tests/grammar.rs`, three tests:
|
||||
|
||||
1. `the_grammars_keywords_are_exactly_the_lexers` parses the JSON, strips the
|
||||
`\b(` … `)\b` around `repository.keywords.match`, and asserts the
|
||||
@@ -198,7 +198,7 @@ taxonomy here.
|
||||
|
||||
| package | version | why not std, why not hand-rolled |
|
||||
|---|---|---|
|
||||
| `vscode-languageclient` | `9.0.1` (exact, no `^`) | Microsoft's own client library, maintained alongside the protocol spec and used by essentially every language extension including ruff's. It is the exact analog of `lsp-server`/`lsp-types` on the Rust side, and the reasoning is the same one `docs/features/vfmt-server/README.md` records for those: the alternative is hand-writing the wire format. Requires VS Code `^1.82.0`, which is `package.json`'s `engines.vscode`. |
|
||||
| `vscode-languageclient` | `9.0.1` (exact, no `^`) | Microsoft's own client library, maintained alongside the protocol spec and used by essentially every language extension including ruff's. It is the exact analog of `lsp-server`/`lsp-types` on the Rust side, and the reasoning is the same one `docs/features/lucisv-server/README.md` records for those: the alternative is hand-writing the wire format. Requires VS Code `^1.82.0`, which is `package.json`'s `engines.vscode`. |
|
||||
|
||||
Transitive cost, measured on this machine (`npm ls --all`): **8 packages
|
||||
total** — `vscode-languageclient` plus `vscode-languageserver-protocol`,
|
||||
@@ -225,12 +225,12 @@ stdout, and asserts: the process exits 0, `initialize` returned capabilities,
|
||||
four named capabilities are present, diagnostics were pushed for the opened
|
||||
document, and `shutdown` was acknowledged without an error.
|
||||
|
||||
Three deliberate choices, all inherited from `crates/vfmt_server/tests/e2e.rs`:
|
||||
Three deliberate choices, all inherited from `crates/lucisv_server/tests/e2e.rs`:
|
||||
|
||||
- **The framing is hand-rolled.** A check that reused `vscode-jsonrpc` could
|
||||
not catch a framing bug, and could not run before `npm install`.
|
||||
- **The whole session is written before a byte is read.** The rationale is the
|
||||
one in `tests/e2e.rs`'s own header, reinforced by the vfmt-server QA log's
|
||||
one in `tests/e2e.rs`'s own header, reinforced by the lucisv-server QA log's
|
||||
hang investigation: interleaving reads and writes against a subprocess is how
|
||||
a smoke test becomes an intermittent hang. The session is under 4 KB, well
|
||||
inside a pipe buffer, and the server closes stdout on `exit`, so the read
|
||||
@@ -246,11 +246,11 @@ sequence, and is the thing to run when a user reports "nothing happens".
|
||||
|
||||
## Handshakes
|
||||
|
||||
**Consumed from `vfmt_server`** — and this is the whole interface, exactly as
|
||||
**Consumed from `lucisv_server`** — and this is the whole interface, exactly as
|
||||
that feature's README promised ("the editor packaging round will consume the
|
||||
binary's name and its stdio contract, nothing else"):
|
||||
|
||||
1. Binary name `vfmt-server`, resolved on `PATH` by default.
|
||||
1. Binary name `lucisv-server`, resolved on `PATH` by default.
|
||||
2. No command-line arguments, no required environment.
|
||||
3. LSP over stdin/stdout, `Content-Length` framing.
|
||||
4. `initialize` succeeds with neither `workspaceFolders` nor `rootUri`
|
||||
@@ -273,20 +273,20 @@ binary's name and its stdio contract, nothing else"):
|
||||
`tests/grammar.rs` pins the registration.
|
||||
|
||||
**Consumed from `vlog_parser`:** `KEYWORDS` — the grammar's keyword alternation
|
||||
is generated from it and `crates/vfmt_server/tests/grammar.rs` fails if the two
|
||||
is generated from it and `crates/lucisv_server/tests/grammar.rs` fails if the two
|
||||
diverge. Adding a keyword to `token.rs`'s `keywords!` macro is now also an edit
|
||||
to `editors/vscode/syntaxes/systemverilog.tmLanguage.json`; the test names the
|
||||
missing word.
|
||||
|
||||
**Promised to `vfmt_server`:** the spawn contract above. If the server ever
|
||||
**Promised to `lucisv_server`:** the spawn contract above. If the server ever
|
||||
grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and
|
||||
`smoke.js` change in the same round.
|
||||
|
||||
**Requested of other modules** — none blocking, none done here:
|
||||
|
||||
1. **`crates/vfmt`: lift `config.rs` into a library** (already filed by
|
||||
`docs/features/vfmt-server/README.md`). Restated because it is now
|
||||
*user-visible*: formatting from an editor ignores `vfmt.toml`, so a project
|
||||
1. **`crates/lucisv`: lift `config.rs` into a library** (already filed by
|
||||
`docs/features/lucisv-server/README.md`). Restated because it is now
|
||||
*user-visible*: formatting from an editor ignores `lucisv.toml`, so a project
|
||||
that sets `line-length = 120` gets 100-column formatting on save and
|
||||
120-column formatting from the CLI — the two disagreeing on the same file.
|
||||
Both editor guides state this caveat out loud rather than hide it, but the
|
||||
@@ -300,7 +300,7 @@ grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and
|
||||
## Status / TODO
|
||||
|
||||
- [x] `editors/vscode/package.json` — language declarations, activation,
|
||||
`vfmt.serverPath`, pinned `vscode-languageclient`.
|
||||
`lucisv.serverPath`, pinned `vscode-languageclient`.
|
||||
- [x] `editors/vscode/extension.js` — 41 lines, plain JS, no build step.
|
||||
- [x] `editors/vscode/smoke.js` — zero-dependency spawn-contract check.
|
||||
- [x] `editors/vscode/README.md` — build, smoke, package, install,
|
||||
@@ -315,7 +315,7 @@ grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and
|
||||
- [x] `npm install` and `vsce package` run green on this machine.
|
||||
- [x] **0.4.1** — `editors/vscode/syntaxes/systemverilog.tmLanguage.json`,
|
||||
registered for both language ids in `contributes.grammars`.
|
||||
- [x] **0.4.1** — `crates/vfmt_server/tests/grammar.rs`: keyword drift,
|
||||
- [x] **0.4.1** — `crates/lucisv_server/tests/grammar.rs`: keyword drift,
|
||||
pattern validity, registration.
|
||||
- [x] **0.4.1** — fence audit of every markdown surface the server emits;
|
||||
the three code-carrying ones pin their fence tag in unit tests.
|
||||
@@ -338,10 +338,10 @@ grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and
|
||||
assumptions they rest on were verified independently; see the Work log.
|
||||
- [ ] **Not done, out of scope:** CI packaging, Marketplace publishing, a
|
||||
version handshake between extension and server, bundling.
|
||||
- [ ] **Follow-up, blocked on a concurrent round:** a `crates/vfmt_core` lift
|
||||
(config + walk out of the `vfmt` binary) landed in the tree *while this
|
||||
round was being written*, and `crates/vfmt_server` already depends on it.
|
||||
If that closes the "the server does not read `vfmt.toml`" gap, the caveat
|
||||
- [ ] **Follow-up, blocked on a concurrent round:** a `crates/lucisv_core` lift
|
||||
(config + walk out of the `lucisv` binary) landed in the tree *while this
|
||||
round was being written*, and `crates/lucisv_server` already depends on it.
|
||||
If that closes the "the server does not read `lucisv.toml`" gap, the caveat
|
||||
must be deleted from **three** places: `README.md`'s Editor setup
|
||||
section, `editors/vscode/README.md` (Settings), and
|
||||
`editors/nvim/README.md` ("What you get"). Left in place here because it
|
||||
@@ -418,7 +418,7 @@ grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and
|
||||
`README.md` and `editors/vscode/README.md`, and the eleven version strings in
|
||||
`tools/RELEASING.md`; `CHANGELOG.md` gains a `0.4.1 — 2026-08-24` section.
|
||||
`editors/vscode/README.md:159`'s "since 0.4.0" is history and was left alone.
|
||||
`target/debug/vfmt --version` → `vfmt 0.4.1`.
|
||||
`target/debug/lucisv --version` → `lucisv 0.4.1`.
|
||||
- **`RELEASING.md` grew one line**, because a `.vscodeignore` that swallowed
|
||||
`syntaxes/` would ship an extension whose hovers are grey again with nothing
|
||||
failing: the packaging step now checks the grammar is *in* the `.vsix`, next
|
||||
@@ -432,14 +432,14 @@ grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and
|
||||
|---|---|
|
||||
| `cargo fmt --all --check` | clean |
|
||||
| `cargo clippy --all-targets` | clean, no new warnings, no `#[allow]` added |
|
||||
| `cargo test --workspace` | **34 test binaries, all green** (`vfmt_server`: 308 unit + 17 e2e + **3 new** grammar) |
|
||||
| `cargo test --workspace` | **34 test binaries, all green** (`lucisv_server`: 308 unit + 17 e2e + **3 new** grammar) |
|
||||
| Negative control: keyword removed from the alternation | drift test fails, names `genvar` |
|
||||
| Negative control: `"//.*"` → `"//(.*"` | validity test fails, names the pattern and the file path |
|
||||
| `node --check extension.js` / `smoke.js` | both parse |
|
||||
| `package.json`, `package-lock.json`, the grammar as JSON | all three load |
|
||||
| `npx @vscode/vsce ls` | accepts the manifest — 324 files; `syntaxes/systemverilog.tmLanguage.json` listed, `smoke.js` still excluded |
|
||||
| `node smoke.js ../../target/debug/vfmt-server` | `smoke: OK`, 8 messages, exit 0 |
|
||||
| `target/debug/vfmt --version` | `vfmt 0.4.1` |
|
||||
| `node smoke.js ../../target/debug/lucisv-server` | `smoke: OK`, 8 messages, exit 0 |
|
||||
| `target/debug/lucisv --version` | `lucisv 0.4.1` |
|
||||
| Grammar patterns under Python `re` on a sample buffer | 13/13 compile; tokenization as listed above |
|
||||
|
||||
**Not run, and why:** no tokenization through `vscode-textmate` (not in
|
||||
@@ -453,15 +453,15 @@ file **and** a `.v` file, and the Developer Tools console for the absence of an
|
||||
### 2026-08-19 — dev agent
|
||||
|
||||
- Read `CLAUDE.md`, `README.md`, TODO.md §6 and
|
||||
`docs/features/vfmt-server/README.md` (all of it, including the QA log) before
|
||||
`docs/features/lucisv-server/README.md` (all of it, including the QA log) before
|
||||
writing anything. Two things from that reading changed the work: the server's
|
||||
**staleness model** and its **`vfmt.toml` blindness** are user-visible
|
||||
**staleness model** and its **`lucisv.toml` blindness** are user-visible
|
||||
behaviors, so both editor guides state them plainly instead of letting a user
|
||||
discover them as bugs; and the QA log's hang investigation settled `smoke.js`'s
|
||||
I/O shape before I wrote a line of it.
|
||||
- **Did not touch `crates/`.** The one thing this feature wanted from another
|
||||
module — config discovery — was already an open Handshake from the
|
||||
vfmt-server round, so it is restated here with its now-visible user
|
||||
lucisv-server round, so it is restated here with its now-visible user
|
||||
consequence rather than fixed.
|
||||
- **`vscode-languageclient` was taken, and the reasoning is written down.** The
|
||||
brief floated a zero-dependency client; VS Code has no built-in generic LSP
|
||||
@@ -502,11 +502,11 @@ file **and** a `.v` file, and the Developer Tools console for the absence of an
|
||||
someone's editor is a change to their environment, not a validation step I
|
||||
was asked for. The `.vsix` was built, inspected and deleted; the install
|
||||
command is documented, unrun.
|
||||
- **Concurrency note.** Midway through this round another agent's `vfmt_core`
|
||||
round landed in the same tree — `crates/vfmt/src/{config,walk}.rs` moved to a
|
||||
new `crates/vfmt_core`, and `crates/vfmt_server/Cargo.toml` gained a
|
||||
dependency on it. That is exactly the Handshake `docs/features/vfmt-server`
|
||||
filed and this feature restated, so the `vfmt.toml` caveat in the three
|
||||
- **Concurrency note.** Midway through this round another agent's `lucisv_core`
|
||||
round landed in the same tree — `crates/lucisv/src/{config,walk}.rs` moved to a
|
||||
new `crates/lucisv_core`, and `crates/lucisv_server/Cargo.toml` gained a
|
||||
dependency on it. That is exactly the Handshake `docs/features/lucisv-server`
|
||||
filed and this feature restated, so the `lucisv.toml` caveat in the three
|
||||
editor docs is likely to become false very soon. I left it as written: it was
|
||||
true of the binary I built and smoke-tested, and the follow-up is recorded in
|
||||
Status/TODO with the exact three places to edit. Nothing under `crates/` was
|
||||
@@ -518,8 +518,8 @@ file **and** a `.v` file, and the Developer Tools console for the absence of an
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| `cargo build --release -p vfmt_server` | exit 0, `target/release/vfmt-server` |
|
||||
| `node smoke.js target/release/vfmt-server` | **`smoke: OK` — 3 messages, exit 0** |
|
||||
| `cargo build --release -p lucisv_server` | exit 0, `target/release/lucisv-server` |
|
||||
| `node smoke.js target/release/lucisv-server` | **`smoke: OK` — 3 messages, exit 0** |
|
||||
| `smoke.js` negative control: missing binary | FAIL, exit 1 (as designed) |
|
||||
| `smoke.js` negative control: `/bin/cat` | FAIL on capabilities, exit 1 (as designed) |
|
||||
| `package.json` parses as JSON | yes (`JSON.parse`) |
|
||||
@@ -538,7 +538,7 @@ file **and** a `.v` file, and the Developer Tools console for the absence of an
|
||||
binary.
|
||||
- **Every Vim/Neovim snippet.** No `nvim` on this machine (`command -v nvim`:
|
||||
nothing; `vim` 9.1 exists, without `vim-lsp`). Expected behavior on a machine
|
||||
that has it: `:checkhealth vim.lsp` shows one client `vfmt` attached to the
|
||||
that has it: `:checkhealth vim.lsp` shows one client `lucisv` attached to the
|
||||
buffer with `documentFormattingProvider`, `hoverProvider`,
|
||||
`definitionProvider`, `referencesProvider`, `documentSymbolProvider`,
|
||||
`workspaceSymbolProvider` and `semanticTokensProvider` set and
|
||||
@@ -553,7 +553,7 @@ file **and** a `.v` file, and the Developer Tools console for the absence of an
|
||||
|
||||
Owner report: `#200 $finish;` (clkdivider_tb.v:24) showed an RGB colour
|
||||
swatch. Diagnosis, verified on the owner's machine: no installed extension
|
||||
provides document colours, `vfmt-server` advertises no colour capability,
|
||||
provides document colours, `lucisv-server` advertises no colour capability,
|
||||
and the owner's settings carry no override — the swatch is VS Code's
|
||||
built-in default colour provider (`editor.defaultColorDecorators`,
|
||||
default `auto` since 1.78, owner runs 1.134), which pattern-matches
|
||||
@@ -583,7 +583,7 @@ entry is the only lasting write.
|
||||
| `cargo fmt --all --check` | clean |
|
||||
| `cargo clippy --all-targets` | clean, 0 warnings |
|
||||
| `cargo test --workspace` | all green |
|
||||
| `cargo test -p vfmt_server` | **308 unit + 17 e2e + 3 grammar**, all passing — matches the claim exactly |
|
||||
| `cargo test -p lucisv_server` | **308 unit + 17 e2e + 3 grammar**, all passing — matches the claim exactly |
|
||||
| `node --check extension.js` / `smoke.js` | both parse |
|
||||
| `npx @vscode/vsce ls` | **324 files**, `syntaxes/systemverilog.tmLanguage.json` listed (line 7), `smoke.js` absent — matches the claimed count exactly |
|
||||
| `cargo metadata` | all 8 workspace crates report `0.4.1` |
|
||||
@@ -720,23 +720,23 @@ session checked.
|
||||
|
||||
**Build tested:** `HEAD` at `c8b936a7` plus the working tree exactly as it
|
||||
stood (20 changed/untracked paths, `git status --short`), rebuilt twice
|
||||
(`cargo build --release -p vfmt_server`, both times "Finished ... in 0.02s" —
|
||||
(`cargo build --release -p lucisv_server`, both times "Finished ... in 0.02s" —
|
||||
already up to date, so one stable binary throughout this pass:
|
||||
`target/release/vfmt-server`, 1,996,608 bytes, md5 `ed84f61d8c414e34d840571`
|
||||
`target/release/lucisv-server`, 1,996,608 bytes, md5 `ed84f61d8c414e34d840571`
|
||||
`f8696191e`, mtime 09:26). This build **includes the concurrent
|
||||
`vfmt_core` config/walk lift** (`crates/vfmt_core/src/{config,walk}.rs`,
|
||||
`crates/vfmt_server` depends on it) — see the Finding below. Did not touch
|
||||
`lucisv_core` config/walk lift** (`crates/lucisv_core/src/{config,walk}.rs`,
|
||||
`crates/lucisv_server` depends on it) — see the Finding below. Did not touch
|
||||
anything under `crates/`; rebuilt only to confirm the binary was settled
|
||||
before each spawn-based check, per the lead's note that the vfmt_core-lift
|
||||
before each spawn-based check, per the lead's note that the lucisv_core-lift
|
||||
agent was doing its own final gate runs concurrently.
|
||||
|
||||
**Validation matrix — all green, re-run to completion:**
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| `cargo build --release -p vfmt_server` (x2, bracketing the session) | exit 0 both times, binary unchanged between runs |
|
||||
| `node smoke.js ../../target/release/vfmt-server` | `smoke: OK` — 3 messages, exit 0 (re-run at session end too) |
|
||||
| Negative control: `node smoke.js /nonexistent/vfmt-server` | `FAIL — could not spawn ... ENOENT`, exit 1 |
|
||||
| `cargo build --release -p lucisv_server` (x2, bracketing the session) | exit 0 both times, binary unchanged between runs |
|
||||
| `node smoke.js ../../target/release/lucisv-server` | `smoke: OK` — 3 messages, exit 0 (re-run at session end too) |
|
||||
| Negative control: `node smoke.js /nonexistent/lucisv-server` | `FAIL — could not spawn ... ENOENT`, exit 1 |
|
||||
| Negative control: `node smoke.js /bin/cat` | `FAIL — initialize response carries no capabilities`, exit 1 |
|
||||
| `node --check extension.js` / `smoke.js` | both parse clean |
|
||||
| `python3 -c json.load` on `package.json` | valid JSON |
|
||||
@@ -746,25 +746,25 @@ agent was doing its own final gate runs concurrently.
|
||||
| `.vsix` contents (`unzip -l`) | 320 files, 462.22 KB (dev's numbers exact); `smoke.js`, `.gitignore`, `.vscodeignore` all absent, `extension.js`/`package.json`/`readme.md`/`node_modules/*` present |
|
||||
|
||||
**Finding 1 (confirmed, significant, not blocking function) — the
|
||||
`vfmt.toml`-blindness caveat is now false against the tested binary.**
|
||||
The `vfmt_core` lift landed in the working tree (uncommitted) and
|
||||
`crates/vfmt_server` already consumes it: `cargo test -p vfmt_server --release
|
||||
`lucisv.toml`-blindness caveat is now false against the tested binary.**
|
||||
The `lucisv_core` lift landed in the working tree (uncommitted) and
|
||||
`crates/lucisv_server` already consumes it: `cargo test -p lucisv_server --release
|
||||
format::` passes `a_config_file_beats_the_editors_tab_size` and
|
||||
`a_vfmt_toml_governs_the_buffer_it_sits_above`, both asserting `vfmt.toml`
|
||||
`a_lucisv_toml_governs_the_buffer_it_sits_above`, both asserting `lucisv.toml`
|
||||
wins over the client's tab size. I additionally drove a live LSP round-trip
|
||||
against the built binary (scratch dir with `vfmt.toml` containing
|
||||
against the built binary (scratch dir with `lucisv.toml` containing
|
||||
`indent = 4`, `.git` marker, `rootUri` pointing at it) and requested
|
||||
`textDocument/formatting` with `tabSize: 2`: the response's `newText` used
|
||||
4-space indent, i.e. the config file won over the client, over the wire, on
|
||||
this exact binary. This means the caveat "the server does **not** read
|
||||
`vfmt.toml` yet" is no longer true of the binary these docs describe. It
|
||||
`lucisv.toml` yet" is no longer true of the binary these docs describe. It
|
||||
appears verbatim in all three places `docs/features/editor-packaging/README.md`'s
|
||||
own Status/TODO already flagged: top-level `README.md` (Editor setup
|
||||
section), `editors/vscode/README.md` (Settings section), and
|
||||
`editors/nvim/README.md` ("What you get, and what you don't" section) — plus
|
||||
it's echoed in this feature's own Assumptions/Handshakes/Status-TODO/Work-log
|
||||
prose. Per the lead's instruction this cleanup belongs to the lead / the
|
||||
vfmt-server docs owner, not to this QA pass, so I have not edited any of
|
||||
lucisv-server docs owner, not to this QA pass, so I have not edited any of
|
||||
those five locations — reporting precisely instead, as asked. Locations,
|
||||
for the fix: `README.md` (top-level, "Editor setup"), `editors/vscode/README.md`
|
||||
(Settings), `editors/nvim/README.md` ("What you get"), plus (not previously
|
||||
@@ -804,7 +804,7 @@ packaging regression if they hit this same scratchpad-path issue later.
|
||||
`["onLanguage:verilog", "onLanguage:systemverilog"]`, matching the
|
||||
language ids character-for-character (no typo — this was checked
|
||||
specifically, since a mismatch here is the "silently never activates"
|
||||
failure mode); one setting `vfmt.serverPath` default `"vfmt-server"`;
|
||||
failure mode); one setting `lucisv.serverPath` default `"lucisv-server"`;
|
||||
`vscode-languageclient` pinned `"9.0.1"` (no `^`), confirmed both in
|
||||
`package.json` and resolved exactly in `package-lock.json`
|
||||
(`lockfileVersion: 3`) and in a fresh `npm ci`; `engines.vscode` is
|
||||
@@ -813,13 +813,13 @@ packaging regression if they hit this same scratchpad-path issue later.
|
||||
`smoke.js` (plus `.vscode/**`, `.gitignore`) — confirmed absent from the
|
||||
built `.vsix`.
|
||||
2. **`extension.js`** — read every line, 41 total (`wc -l` exact). Spawns
|
||||
`serverPath` read from `vfmt.getConfiguration('vfmt').get('serverPath')`
|
||||
with fallback `'vfmt-server'`; `serverOptions = {command, args: [],
|
||||
`serverPath` read from `lucisv.getConfiguration('lucisv').get('serverPath')`
|
||||
with fallback `'lucisv-server'`; `serverOptions = {command, args: [],
|
||||
transport: TransportKind.stdio}` matches `vscode-languageclient@9.0.1`'s
|
||||
`Executable` interface (`lib/node/main.d.ts`: `command`, `transport?`,
|
||||
`args?`, `options?`) exactly; `documentSelector: [{language: 'verilog'},
|
||||
{language: 'systemverilog'}]` matches the contributed language ids
|
||||
exactly; `new LanguageClient('vfmt', 'vfmt', serverOptions,
|
||||
exactly; `new LanguageClient('lucisv', 'lucisv', serverOptions,
|
||||
clientOptions)` matches the 4-arg `(id, name, serverOptions,
|
||||
clientOptions, forceDebug?)` overload in `main.d.ts`; `deactivate()`
|
||||
returns `client.stop()` so VS Code awaits shutdown. No other features
|
||||
@@ -828,11 +828,11 @@ packaging regression if they hit this same scratchpad-path issue later.
|
||||
yields no pid, `handleChildProcessStartError` rejects, the client's own
|
||||
`createConnection` catch calls `this.error(..., 'force')`, which *always*
|
||||
shows a `window.showErrorMessage` popup (with a "Go to output" button)
|
||||
and appends to the `vfmt` output channel regardless of
|
||||
and appends to the `lucisv` output channel regardless of
|
||||
`revealOutputChannelOn` — `extension.js` itself doesn't need a `.catch()`
|
||||
on `client.start()` because the library never lets a spawn failure go
|
||||
unsurfaced. This matches the README's troubleshooting text ("See what the
|
||||
server is saying... View → Output → the vfmt channel"); the README could
|
||||
server is saying... View → Output → the lucisv channel"); the README could
|
||||
additionally mention the error popup explicitly but doesn't claim silence,
|
||||
so nothing here is inaccurate, just slightly less complete than it could be.
|
||||
3. **`smoke.js`** — zero-dep (`require('child_process')` only), 93 lines
|
||||
@@ -841,7 +841,7 @@ packaging regression if they hit this same scratchpad-path issue later.
|
||||
4. **`editors/nvim/README.md`** — all four client variants present
|
||||
(`vim.lsp.config` 0.11+, `nvim-lspconfig` 0.9/0.10, Vim 9 `vim-lsp`
|
||||
one-liner, coc.nvim `coc-settings.json`); root markers
|
||||
`vfmt.toml`/`.vfmt.toml`/`.git` consistent across all four; the
|
||||
`lucisv.toml`/`.lucisv.toml`/`.git` consistent across all four; the
|
||||
`vim.filetype.add` line's load-bearing claim was checked directly against
|
||||
`/usr/share/vim/vim91/filetype.vim` on this machine (vim 9.1, matches
|
||||
what the dev cited): `*.sv,*.svh` map straight to `systemverilog`
|
||||
@@ -866,7 +866,7 @@ packaging regression if they hit this same scratchpad-path issue later.
|
||||
required feature-README sections (Goal, Assumptions, Handshakes,
|
||||
Status/TODO, Work log, QA log, Review) are present in this file.
|
||||
|
||||
**Overall: PASS**, with Finding 1 (stale `vfmt.toml` caveat, now confirmed
|
||||
**Overall: PASS**, with Finding 1 (stale `lucisv.toml` caveat, now confirmed
|
||||
false, not this feature's docs to fix) as the one substantive issue,
|
||||
recorded for the lead. No language-id/activation mismatch, no smoke
|
||||
failure against the current binary — the two conditions the brief called
|
||||
@@ -900,10 +900,10 @@ Points reviewed and accepted:
|
||||
line is load-bearing — is exactly the kind of verified-against-
|
||||
runtime fact these READMEs exist to hold; QA confirmed it
|
||||
byte-for-byte against this machine's filetype.vim.
|
||||
4. QA's Finding 1 (the "server doesn't read vfmt.toml" caveat went
|
||||
stale mid-round when vfmt-core-lift landed under it) was the lead's
|
||||
4. QA's Finding 1 (the "server doesn't read lucisv.toml" caveat went
|
||||
stale mid-round when lucisv-core-lift landed under it) was the lead's
|
||||
to fix and is now fixed in all flagged locations, including the
|
||||
vfmt-server README's superseded Assumptions. Finding 2 (vsce's path
|
||||
lucisv-server README's superseded Assumptions. Finding 2 (vsce's path
|
||||
resolution breaking inside the session scratchpad) is an
|
||||
environment artifact, correctly diagnosed by reproducing it on an
|
||||
unrelated minimal extension.
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
Three of the owner's five editor requests are the same question asked three
|
||||
ways — *which `end` belongs to this `begin`?* — so they get one answer:
|
||||
`crates/vfmt_server/src/pairs.rs`, a stack matcher over the token stream the
|
||||
`crates/lucisv_server/src/pairs.rs`, a stack matcher over the token stream the
|
||||
document already caches. On top of it sit three consumers:
|
||||
`textDocument/documentHighlight`, so the cursor on a `begin`
|
||||
highlights its own `end` (real matching, not a text search for the word), and a
|
||||
**missing-closer warning** that points at the `begin` which lost its `end`
|
||||
instead of leaving the user with one parse error at the bottom of the file. The
|
||||
third consumer is the extension's rainbow: `vfmt/scopePairs` hands the client
|
||||
third consumer is the extension's rainbow: `lucisv/scopePairs` hands the client
|
||||
every `begin`/`end` and `fork`/`join*` pair with its nesting depth — plus every
|
||||
block delimiter still waiting for its partner — and `extension.js` paints each
|
||||
depth in one of six colours the extension contributes itself, and each lonely
|
||||
@@ -69,13 +69,13 @@ keyword in an error red.
|
||||
colour bright red for error in syntax, but don't just hide them."* That rules
|
||||
out borrowing a theme colour whose default is `#00000000`, which is what
|
||||
0.3.1 fixed, and it is why an unmatched keyword is painted rather than left
|
||||
alone. A user or a theme may still override a `vfmt.rainbow*` id with
|
||||
alone. A user or a theme may still override a `lucisv.rainbow*` id with
|
||||
anything they like — including transparent — and that is their decision, not
|
||||
a default of ours.
|
||||
- **Analysis is cheap enough to redo per request, and that now rests on
|
||||
`analyze` being linear rather than on real files being shallow.** `analyze`
|
||||
is one pass over the token vector with a small stack, so nothing is cached
|
||||
and no invalidation rule can go stale. Measured, because `vfmt/scopePairs`
|
||||
and no invalidation rule can go stale. Measured, because `lucisv/scopePairs`
|
||||
arrives on a debounce timer rather than on a user gesture: sweeping the
|
||||
corpus, the worst single `scope_pairs` call is **2.1 ms** (`picorv32.v`, the
|
||||
largest file), against a 250 ms debounce. Until 2026-08-25 the *shape* of the
|
||||
@@ -125,7 +125,7 @@ JSON `null` — deliberately not an empty array, because an empty array tells th
|
||||
editor there are no occurrences anywhere and suppresses its own word
|
||||
highlighting.
|
||||
|
||||
**Promised to `extension.js` — the `vfmt/scopePairs` wire shape.** This is the
|
||||
**Promised to `extension.js` — the `lucisv/scopePairs` wire shape.** This is the
|
||||
contract; `the_scope_pairs_wire_shape_is_what_the_extension_reads` pins it as
|
||||
literal JSON so it cannot drift silently.
|
||||
|
||||
@@ -133,7 +133,7 @@ Request — a custom method, so nothing advertises it and a client that does not
|
||||
know it simply never asks:
|
||||
|
||||
```json
|
||||
{ "method": "vfmt/scopePairs", "params": { "textDocument": { "uri": "file:///…" } } }
|
||||
{ "method": "lucisv/scopePairs", "params": { "textDocument": { "uri": "file:///…" } } }
|
||||
```
|
||||
|
||||
Result:
|
||||
@@ -179,7 +179,7 @@ Result:
|
||||
Ordering is by opener position, though the extension does not depend on it.
|
||||
|
||||
**Promised to `package.json` — the colour ids.** The extension contributes
|
||||
`vfmt.rainbow1` … `vfmt.rainbow6` and `vfmt.rainbowUnmatched` under
|
||||
`lucisv.rainbow1` … `lucisv.rainbow6` and `lucisv.rainbowUnmatched` under
|
||||
`contributes.colors`, and `extension.js` builds one `TextEditorDecorationType`
|
||||
per id. Renaming an id in either file without the other silently paints
|
||||
nothing: an unknown `ThemeColor` is not an error, it is simply no colour. See
|
||||
@@ -207,7 +207,7 @@ a construct with no closer:
|
||||
| `covergroup cg with function sample(...);` | the covergroup's sample method; `endgroup` closes the lot |
|
||||
|
||||
**Request to the lead (outside this feature's scope):**
|
||||
`docs/features/vfmt-server/README.md` carries the server's capability list and
|
||||
`docs/features/lucisv-server/README.md` carries the server's capability list and
|
||||
`TODO.md` §6 carries the shipped/not-shipped list; both now understate the
|
||||
server by one capability (`textDocument/documentHighlight`) and one diagnostic
|
||||
source. Neither file belongs to this feature, so neither was touched.
|
||||
@@ -263,20 +263,20 @@ design: it is not an error, it is just no paint.
|
||||
|
||||
So the extension contributes its own ids with `contributes.colors`, each with a
|
||||
default for `dark`, `light`, `highContrast` and `highContrastLight`. A theme
|
||||
that knows nothing about vfmt gets our default; a theme or a
|
||||
`workbench.colorCustomizations` entry that names `vfmt.rainbowN` still wins,
|
||||
that knows nothing about lucisv gets our default; a theme or a
|
||||
`workbench.colorCustomizations` entry that names `lucisv.rainbowN` still wins,
|
||||
which is the override story the borrowed ids gave us and the only thing worth
|
||||
keeping about them.
|
||||
|
||||
| Id | Dark | Light | Why |
|
||||
|---|---|---|---|
|
||||
| `vfmt.rainbow1` | `#FFD700` gold | `#0431FA` blue | VS Code's own level-1 bracket colours, both themes |
|
||||
| `vfmt.rainbow2` | `#DA70D6` orchid | `#319331` green | VS Code's own level 2 |
|
||||
| `vfmt.rainbow3` | `#179FFF` blue (`#87CEFA` on HC dark) | `#7B3814` brown | VS Code's own level 3, HC variant included |
|
||||
| `vfmt.rainbow4` | `#87D96B` green | `#0E7490` teal | first free hue in each theme; ~11:1 on `#1E1E1E`, ~5.2:1 on white |
|
||||
| `vfmt.rainbow5` | `#FF8C69` salmon | `#6D28D9` violet | warm against the dark greens/golds, cool against the light greens/browns |
|
||||
| `vfmt.rainbow6` | `#4FD6D6` cyan | `#BE185D` magenta | closes the wheel without repeating 1–3 in either theme |
|
||||
| `vfmt.rainbowUnmatched` | `#FF1212` red | `#B30000` dark red (`#A80000` HC light) | the error state, and the one colour that must read as *wrong* |
|
||||
| `lucisv.rainbow1` | `#FFD700` gold | `#0431FA` blue | VS Code's own level-1 bracket colours, both themes |
|
||||
| `lucisv.rainbow2` | `#DA70D6` orchid | `#319331` green | VS Code's own level 2 |
|
||||
| `lucisv.rainbow3` | `#179FFF` blue (`#87CEFA` on HC dark) | `#7B3814` brown | VS Code's own level 3, HC variant included |
|
||||
| `lucisv.rainbow4` | `#87D96B` green | `#0E7490` teal | first free hue in each theme; ~11:1 on `#1E1E1E`, ~5.2:1 on white |
|
||||
| `lucisv.rainbow5` | `#FF8C69` salmon | `#6D28D9` violet | warm against the dark greens/golds, cool against the light greens/browns |
|
||||
| `lucisv.rainbow6` | `#4FD6D6` cyan | `#BE185D` magenta | closes the wheel without repeating 1–3 in either theme |
|
||||
| `lucisv.rainbowUnmatched` | `#FF1212` red | `#B30000` dark red (`#A80000` HC light) | the error state, and the one colour that must read as *wrong* |
|
||||
|
||||
Two things about that table are decisions rather than transcription:
|
||||
|
||||
@@ -311,21 +311,21 @@ saturated pure red, and only ever on screen while a block is half-typed.
|
||||
failed, capped at 20.
|
||||
- [x] e2e coverage over the wire (`tests/e2e.rs`).
|
||||
- [x] Corpus sweep for false positives (found one class; fixed).
|
||||
- [x] `vfmt/scopePairs` in `server.rs` + `pairs::scope_pairs`, wire shape
|
||||
- [x] `lucisv/scopePairs` in `server.rs` + `pairs::scope_pairs`, wire shape
|
||||
pinned by a literal-JSON test.
|
||||
- [x] The rainbow in `extension.js`: six theme decoration types, `depth % 6`,
|
||||
repaint on active-editor / visible-editors / document change (250 ms
|
||||
debounce), stale-answer guard.
|
||||
- [x] `vfmt.rainbowBeginEnd` (default true), honoured live by a
|
||||
- [x] `lucisv.rainbowBeginEnd` (default true), honoured live by a
|
||||
configuration-change listener.
|
||||
- [x] `smoke.js` drives `vfmt/scopePairs` against a nested-begin + fork
|
||||
- [x] `smoke.js` drives `lucisv/scopePairs` against a nested-begin + fork
|
||||
fixture and asserts the depths.
|
||||
- [x] **M5:** wire `depth` counts only enclosing rainbow pairs, so a scope the
|
||||
rainbow hides cannot shift the colour of one it shows.
|
||||
- [x] **0.3.1:** the rainbow's colours are the extension's own
|
||||
(`vfmt.rainbow1..6`), opaque in every theme kind — `foreground4..6`
|
||||
(`lucisv.rainbow1..6`), opaque in every theme kind — `foreground4..6`
|
||||
default to transparent and were painting depths 3–5 invisible.
|
||||
- [x] **0.3.1:** `unmatched` on the wire, painted `vfmt.rainbowUnmatched`, so a
|
||||
- [x] **0.3.1:** `unmatched` on the wire, painted `lucisv.rainbowUnmatched`, so a
|
||||
half-typed `begin` is bright red rather than uncoloured.
|
||||
- [x] **2026-08-25:** `analyze` is linear in nesting depth. Both quadratic
|
||||
scans — the depth scan at every push and the whole-stack search for a
|
||||
@@ -423,14 +423,14 @@ reading the LRM would not have caught it, running the corpus did. One guard
|
||||
declared, capability test extended. `server.rs`: one arm in the request match.
|
||||
`diagnostics.rs`: one line in `all()`, between the parse errors and the lint
|
||||
warnings, with the reason in the doc comment. Nothing else in the crate moved,
|
||||
and no file outside `crates/vfmt_server/` was touched.
|
||||
and no file outside `crates/lucisv_server/` was touched.
|
||||
|
||||
**Tests.** `cargo test -p vfmt_server`: 162 unit (was 130) + 7 e2e (was 6), all
|
||||
**Tests.** `cargo test -p lucisv_server`: 162 unit (was 130) + 7 e2e (was 6), all
|
||||
green. Full workspace: 937 passed, 0 failed. `cargo fmt --all` clean,
|
||||
`cargo clippy --all-targets` clean. The one `#[allow]` in the new code is on
|
||||
`Pair::depth`, with a comment naming the milestone that removes it.
|
||||
|
||||
### 2026-08-24 — M3: `vfmt/scopePairs` and the extension's rainbow
|
||||
### 2026-08-24 — M3: `lucisv/scopePairs` and the extension's rainbow
|
||||
|
||||
**Server.** `Pair` gained a `keyword` field (the opener as written) so a
|
||||
consumer can take a subset without the engine having to know about subsets;
|
||||
@@ -466,7 +466,7 @@ through an `lsp_types::request` type because the method is ours.
|
||||
whatever the user's theme already uses for brackets — no colours invented here,
|
||||
nothing to clash. Repaint on active-editor change, visible-editors change
|
||||
(splits, tab drags) and document change on a 250 ms debounce. Turning
|
||||
`vfmt.rainbowBeginEnd` off repaints with empty range lists, which is how a
|
||||
`lucisv.rainbowBeginEnd` off repaints with empty range lists, which is how a
|
||||
decoration type is removed — so "off" takes effect immediately in both
|
||||
directions rather than "after a reload". Closing an editor needs no handler:
|
||||
VS Code disposes its decorations with it, and the types themselves are in
|
||||
@@ -489,7 +489,7 @@ Otherwise the milestone is as specified.
|
||||
|
||||
**Verification.** `cargo fmt --all` clean, `cargo clippy --all-targets` clean
|
||||
(0 diagnostics), `cargo test --workspace` **944 passed, 0 failed** (168 unit in
|
||||
this crate, up from 162; 7 e2e). `node smoke.js ../../target/debug/vfmt-server`
|
||||
this crate, up from 162; 7 e2e). `node smoke.js ../../target/debug/lucisv-server`
|
||||
against a freshly built binary: OK. The smoke assertion was mutation-checked —
|
||||
changing the expected depths to `[9,9,9]` fails with
|
||||
`got [1,2,1]`, so it is live rather than vacuous. `npx @vscode/vsce ls` still
|
||||
@@ -580,7 +580,7 @@ not rescan. Mutation-checked (expecting 4 fails with `left: 3`).
|
||||
|
||||
**Verification.** `cargo fmt --all` clean, `cargo clippy --all-targets` clean,
|
||||
`cargo test --workspace` green, `node smoke.js` against a freshly built
|
||||
`target/debug/vfmt-server` OK.
|
||||
`target/debug/lucisv-server` OK.
|
||||
|
||||
### 2026-08-24 — 0.3.1: the rainbow was painting with transparent colours
|
||||
|
||||
@@ -590,7 +590,7 @@ and pressing Enter at line 34 made *both* that `begin` and the `end` below it
|
||||
colours.
|
||||
|
||||
**Root cause, confirmed against the running server.** The server was right: its
|
||||
`vfmt/scopePairs` answer put the new pair at depth 3, with correct ranges. The
|
||||
`lucisv/scopePairs` answer put the new pair at depth 3, with correct ranges. The
|
||||
extension was wrong. It painted depth `d` with
|
||||
`ThemeColor('editorBracketHighlight.foreground' + (d % 6 + 1))`, and VS Code's
|
||||
colour registry gives visible defaults to only `foreground1..3`; `4`, `5` and
|
||||
@@ -607,7 +607,7 @@ downward, which moved a lot of real code from the safe 0–2 band into 3–5.
|
||||
**The fix, three parts.**
|
||||
|
||||
1. **Our own colours.** `contributes.colors` in `package.json` declares
|
||||
`vfmt.rainbow1..6` and `vfmt.rainbowUnmatched`, each with a default for
|
||||
`lucisv.rainbow1..6` and `lucisv.rainbowUnmatched`, each with a default for
|
||||
`dark`, `light`, `highContrast` and `highContrastLight`, and none of them
|
||||
transparent. `extension.js` builds its decoration types from those ids. The
|
||||
values and the reasoning are in *The palette* above; the short version is
|
||||
@@ -617,7 +617,7 @@ downward, which moved a lot of real code from the safe 0–2 band into 3–5.
|
||||
2. **`unmatched` on the wire.** `ScopePairs` gained
|
||||
`unmatched: Vec<Range>` — the block delimiters `analyze` already knew were
|
||||
partnerless, filtered by the same `RAINBOW_KEYWORDS` as `pairs` and sorted
|
||||
by position — and `extension.js` paints them `vfmt.rainbowUnmatched`. This
|
||||
by position — and `extension.js` paints them `lucisv.rainbowUnmatched`. This
|
||||
is the owner's rule applied to the state that started it all: a `begin` you
|
||||
have just typed has no `end` yet, so it has no depth and no rainbow colour,
|
||||
and *"you can make their colour bright red for error in syntax, but don't
|
||||
@@ -635,8 +635,8 @@ interaction directly: in three nested `begin`s missing one `end`, the two that
|
||||
do close still report depths `[1, 2]`, because an unmatched frame is still an
|
||||
enclosing scope while it sits on the stack.
|
||||
|
||||
**Tests.** `vfmt_server`: **285 unit** (was 279; six new, all in the
|
||||
`vfmt/scopePairs` section) and **16 e2e**. New unit tests: an opener that never
|
||||
**Tests.** `lucisv_server`: **285 unit** (was 279; six new, all in the
|
||||
`lucisv/scopePairs` section) and **16 e2e**. New unit tests: an opener that never
|
||||
closes is reported; a closer that opens nothing is reported; a balanced file
|
||||
reports nothing; a keyword is never both paired and unmatched (three pairs, one
|
||||
stray `end`, one unclosed `fork`, no range on both lists); `unmatched` carries
|
||||
@@ -670,7 +670,7 @@ reverted, md5 identical (`0ff5e46f51b9c7f2079d899104776ddb`).
|
||||
not mention: without it a high-contrast *light* theme falls back to the
|
||||
ordinary light value, which happens to be fine here, but stating all four is
|
||||
one line each and leaves nothing to inference.
|
||||
- `vfmt.rainbowBeginEnd`'s description in `package.json` and the "Rainbow
|
||||
- `lucisv.rainbowBeginEnd`'s description in `package.json` and the "Rainbow
|
||||
begin/end" section of `editors/vscode/README.md` both said the colours come
|
||||
from the theme's bracket palette. Both are now accurate and document the
|
||||
override recipe; they are this feature's own user-facing text, so they were
|
||||
@@ -680,13 +680,13 @@ reverted, md5 identical (`0ff5e46f51b9c7f2079d899104776ddb`).
|
||||
`cargo check --workspace`), `editors/vscode/package.json`,
|
||||
`editors/vscode/package-lock.json` (both places), plus the illustrative
|
||||
version strings in `tools/RELEASING.md` and `README.md`'s install example — the
|
||||
same set M5 touched for 0.3.0. `target/debug/vfmt --version` → `vfmt 0.3.1`.
|
||||
same set M5 touched for 0.3.0. `target/debug/lucisv --version` → `lucisv 0.3.1`.
|
||||
`CHANGELOG.md` has a `0.3.1 — 2026-08-24` section in the changelog's voice.
|
||||
|
||||
**Verification.** `cargo fmt --all -- --check` clean; `cargo clippy --workspace
|
||||
--all-targets` **0 warnings**; `cargo test --workspace` **1268 passed, 0
|
||||
failed**; `node --check` on `extension.js` and `smoke.js` clean; `node smoke.js
|
||||
../../target/debug/vfmt-server` **OK** against a freshly built binary;
|
||||
../../target/debug/lucisv-server` **OK** against a freshly built binary;
|
||||
`npx @vscode/vsce ls` still accepts the manifest with the new
|
||||
`contributes.colors` block. No new dependencies, no `unwrap`/`expect`/`panic!`
|
||||
outside `#[cfg(test)]`, no `#[allow]` added, and `TODO.md` and
|
||||
@@ -793,7 +793,7 @@ version of each.
|
||||
two did not cover a leaked `per_rule` count.
|
||||
|
||||
**Mutation check** — five deliberate breakages, each run against the full
|
||||
`vfmt_server` suite and then reverted (`pairs.rs` restored from a copy and
|
||||
`lucisv_server` suite and then reverted (`pairs.rs` restored from a copy and
|
||||
`diff`-verified byte-identical after each):
|
||||
|
||||
| mutation | caught by |
|
||||
@@ -807,7 +807,7 @@ version of each.
|
||||
The first row is the point of test 1, and the third row is why test 2 grew a
|
||||
third shape rather than staying at two.
|
||||
|
||||
**Scope.** Only `crates/vfmt_server/src/pairs.rs` and this README were touched;
|
||||
**Scope.** Only `crates/lucisv_server/src/pairs.rs` and this README were touched;
|
||||
`inline.rs` and `docs/features/inline-templates/` were not. No new
|
||||
dependencies, no `unsafe`, no `unwrap`/`expect`/`panic!` outside `#[cfg(test)]`,
|
||||
no `#[allow]` added. `TODO.md` was not touched — this fixes a defect inside an
|
||||
@@ -816,7 +816,7 @@ went in this feature's own Status/TODO instead.
|
||||
|
||||
**Verification.** `cargo fmt --all -- --check` clean; `cargo clippy
|
||||
--all-targets --workspace` **0 warnings**; `cargo test --workspace` **1616
|
||||
passed, 0 failed, 4 ignored** (was 1614 — the two new tests). `vfmt_server`
|
||||
passed, 0 failed, 4 ignored** (was 1614 — the two new tests). `lucisv_server`
|
||||
alone: 533 unit + 29 e2e + 3 grammar, all green.
|
||||
|
||||
## QA log
|
||||
@@ -830,7 +830,7 @@ scope this round). Verdict: **PASS**, no blocking findings.
|
||||
the guard table in *Handshakes* above; ran the dev's own 162 unit + 7 e2e
|
||||
tests; then attacked with two throwaway additions to `pairs.rs`'s own
|
||||
`#[cfg(test)] mod tests` (same crate access as the real code, since
|
||||
`vfmt_server` is bin-only and has no lib target for an external test to link
|
||||
`lucisv_server` is bin-only and has no lib target for an external test to link
|
||||
against) — run, read, and **removed before this log was written**; nothing
|
||||
below is in the committed tree.
|
||||
|
||||
@@ -871,7 +871,7 @@ produce a wrong warning. Filed as an FYI for whoever next touches
|
||||
the one of the two the dev's guard table doesn't already list — worth a line
|
||||
if the table is touched again, not worth blocking on.)
|
||||
|
||||
**4. `crates/vfmt_server/src/server.rs:109-121`** (`DocumentHighlightRequest`
|
||||
**4. `crates/lucisv_server/src/server.rs:109-121`** (`DocumentHighlightRequest`
|
||||
handler): `self.offset(&uri, position)` internally calls
|
||||
`self.workspace.document(&uri)`, and the closure passed to `.and_then` calls
|
||||
`self.workspace.document(&uri)` a second time. Harmless — `Document::new`
|
||||
@@ -882,13 +882,13 @@ Non-blocking style nit, left as-is per "you verify, you don't redesign."
|
||||
|
||||
**5. Invariants.**
|
||||
- `cargo test --workspace`: every crate green, 0 failures (162 unit + 7 e2e in
|
||||
`vfmt_server` alone, matching the Work log's count exactly).
|
||||
`lucisv_server` alone, matching the Work log's count exactly).
|
||||
- `cargo fmt --all -- --check`: clean.
|
||||
- `cargo clippy --all-targets --workspace`: clean, no warnings.
|
||||
- `git diff --stat` (working tree vs `HEAD`): only
|
||||
`crates/vfmt_server/{diagnostics,main,server}.rs` and
|
||||
`crates/vfmt_server/tests/e2e.rs`, plus the untracked new
|
||||
`crates/vfmt_server/src/pairs.rs` and `docs/features/editor-scopes/`. No
|
||||
`crates/lucisv_server/{diagnostics,main,server}.rs` and
|
||||
`crates/lucisv_server/tests/e2e.rs`, plus the untracked new
|
||||
`crates/lucisv_server/src/pairs.rs` and `docs/features/editor-scopes/`. No
|
||||
formatter, `verify.rs`, or `vlog_parser` files touched, confirmed by listing
|
||||
(`git status`) as well as the stat diff.
|
||||
- No `unwrap()`/`expect()`/`panic!` in `pairs.rs`, `server.rs`, or
|
||||
@@ -902,7 +902,7 @@ recorded above (a pre-existing `vlog_parser` grammar gap unrelated to this
|
||||
feature, and a redundant-but-harmless double document lookup in
|
||||
`server.rs`).
|
||||
|
||||
### 2026-08-24 — QA round 2 (M3): `vfmt/scopePairs` and the extension rainbow
|
||||
### 2026-08-24 — QA round 2 (M3): `lucisv/scopePairs` and the extension rainbow
|
||||
|
||||
Charter items 1, 4, 5 (repeat, unregressed) and 6 from `editor_features_plan.md`
|
||||
for this dispatch: the wire shape, `scope_pairs` correctness, `extension.js`
|
||||
@@ -911,9 +911,9 @@ review, `smoke.js`, invariants, and an M1/M2 unregression spot-check. Item 2
|
||||
re-audited except where M3 touched shared code (it did not — `Pair::keyword`
|
||||
is additive). Verdict: **PASS**, no blocking findings.
|
||||
|
||||
**1. Wire shape.** Ran `cargo test -p vfmt_server`: 168 unit + 7 e2e, all
|
||||
**1. Wire shape.** Ran `cargo test -p lucisv_server`: 168 unit + 7 e2e, all
|
||||
green. Read `the_scope_pairs_wire_shape_is_what_the_extension_reads`
|
||||
(`crates/vfmt_server/src/pairs.rs:915`) — it pins the full response as literal
|
||||
(`crates/lucisv_server/src/pairs.rs:915`) — it pins the full response as literal
|
||||
JSON (`open`/`close` LSP `Range`s over the keyword, `depth`), matching the
|
||||
Handshakes section word for word. Confirmed each documented property against
|
||||
its own test, not just the pinned one:
|
||||
@@ -935,8 +935,8 @@ its own test, not just the pinned one:
|
||||
- Unopened doc → `null`: no dedicated unit test exists for this specific
|
||||
handler (matches the pattern for every sibling handler in `server.rs` —
|
||||
none of them have one either, so this is not an M3-specific gap). Verified
|
||||
directly against the built binary instead: spawned `vfmt-server`, sent
|
||||
`vfmt/scopePairs` for a URI never opened via `didOpen`, got back
|
||||
directly against the built binary instead: spawned `lucisv-server`, sent
|
||||
`lucisv/scopePairs` for a URI never opened via `didOpen`, got back
|
||||
`{"jsonrpc":"2.0","id":2,"result":null}` with no error. Matches
|
||||
`server.rs:165-170`.
|
||||
|
||||
@@ -986,8 +986,8 @@ against the round-2 charter's specific worry list:
|
||||
|
||||
No defects found in `extension.js`.
|
||||
|
||||
**4. `smoke.js`.** Built `target/debug/vfmt-server` fresh (`cargo build -p
|
||||
vfmt_server`), ran `node smoke.js ../../target/debug/vfmt-server` from
|
||||
**4. `smoke.js`.** Built `target/debug/lucisv-server` fresh (`cargo build -p
|
||||
lucisv_server`), ran `node smoke.js ../../target/debug/lucisv-server` from
|
||||
`editors/vscode/`: **OK**. Mutation check: changed the expected depths
|
||||
assertion from `[1, 2, 1]` to `[9, 9, 9]`, reran — failed as expected
|
||||
(`expected depths [1,2,1] ..., got [1,2,1]`, exit code 1), then reverted;
|
||||
@@ -997,15 +997,15 @@ was. `node --check` on both `extension.js` and `smoke.js`: clean.
|
||||
|
||||
**5. Invariants.**
|
||||
- `cargo test --workspace`: 944 passed, 0 failed (168 unit + 7 e2e in
|
||||
`vfmt_server`, matching the Work Log's count).
|
||||
`lucisv_server`, matching the Work Log's count).
|
||||
- `cargo fmt --all -- --check`: clean.
|
||||
- `cargo clippy --all-targets`: clean, no warnings.
|
||||
- `git diff --stat` vs `HEAD`: `crates/vfmt_server/{pairs,server}.rs`,
|
||||
`crates/vfmt_server/tests/e2e.rs`, `docs/features/editor-scopes/README.md`,
|
||||
- `git diff --stat` vs `HEAD`: `crates/lucisv_server/{pairs,server}.rs`,
|
||||
`crates/lucisv_server/tests/e2e.rs`, `docs/features/editor-scopes/README.md`,
|
||||
`editors/vscode/{README.md,extension.js,package.json,smoke.js}`. No
|
||||
`vlog_formatter`/`vlog_parser`/`verify.rs` paths touched.
|
||||
- `node -e "JSON.parse(...)"` on `editors/vscode/package.json`: valid; the new
|
||||
`vfmt.rainbowBeginEnd` setting and the M1 `contributes.snippets` block are
|
||||
`lucisv.rainbowBeginEnd` setting and the M1 `contributes.snippets` block are
|
||||
both present and unchanged in shape. `npx @vscode/vsce ls` accepts the
|
||||
manifest and lists `package.json`, `extension.js`, `README.md`,
|
||||
`snippets/verilog.json`, `snippets/systemverilog.json` — no error.
|
||||
@@ -1014,13 +1014,13 @@ was. `node --check` on both `extension.js` and `smoke.js`: clean.
|
||||
`pairs.rs` — the dev's removal of the `Pair::depth` `#[allow(dead_code)]`
|
||||
is confirmed; nothing new was added in its place.
|
||||
|
||||
**6. M1/M2 unregression spot-check.** `cargo test -p vfmt_server` (168 unit)
|
||||
**6. M1/M2 unregression spot-check.** `cargo test -p lucisv_server` (168 unit)
|
||||
includes the full M1 snippet-adjacent and M2 `pairs.rs`/`documentHighlight`/
|
||||
missing-end suites from round 1, all still passing; `package.json`'s
|
||||
`contributes.snippets` block is byte-identical to what round 1 saw (verified
|
||||
by reading it directly, not diffed against round 1 since M1 was committed
|
||||
before this dispatch). No M2 test was touched by this diff except the two
|
||||
lines the e2e test needed to add a `vfmt/scopePairs` frame after the existing
|
||||
lines the e2e test needed to add a `lucisv/scopePairs` frame after the existing
|
||||
`documentHighlight` assertions.
|
||||
|
||||
**Verdict: PASS.** No blocking findings, no non-blocking findings either —
|
||||
@@ -1034,7 +1034,7 @@ a gap specific to this work.
|
||||
Charter: `editor_features_plan.md`'s M5 section (the user-reported "invisible
|
||||
begin/end" bug fix) plus the M4 exclude-republish gap the lead accepted last
|
||||
round. Scope: uncommitted working tree only, diff vs `9a3a92c` —
|
||||
`crates/vfmt_server/src/pairs.rs`, `crates/vfmt_server/tests/e2e.rs`,
|
||||
`crates/lucisv_server/src/pairs.rs`, `crates/lucisv_server/tests/e2e.rs`,
|
||||
`editors/vscode/smoke.js`, `docs/features/editor-scopes/README.md`. Verdict:
|
||||
**PASS**, one non-blocking finding (item 2 below).
|
||||
|
||||
@@ -1059,7 +1059,7 @@ the reported-bug fixture. Added four throwaway tests, all passed:
|
||||
(`docs/features/editor-scopes/README.md:415`, the `no_hidden_scope_...`
|
||||
case list) — the dev's own `generate` case is an *if*-generate with a
|
||||
single anonymous `begin` (`no_hidden_scope_counts_toward_the_depth`,
|
||||
`crates/vfmt_server/src/pairs.rs:944`), which never exercises a *second*
|
||||
`crates/lucisv_server/src/pairs.rs:944`), which never exercises a *second*
|
||||
begin nested inside a named generate-for block. No inconsistency between
|
||||
the dev's tests and the README, though: the depth logic is opener-keyword-
|
||||
based, not context-based, so a generate-for's named begin behaves
|
||||
@@ -1079,7 +1079,7 @@ times).
|
||||
claims. Non-blocking, filed as a finding rather than fixed directly** (it
|
||||
would mean rewriting the test's structure, past "small unambiguous fix").
|
||||
`the_depth_counter_and_the_wire_filter_read_the_same_list`
|
||||
(`crates/vfmt_server/src/pairs.rs:978-994`) has two parts: a loop over `RULES`
|
||||
(`crates/lucisv_server/src/pairs.rs:978-994`) has two parts: a loop over `RULES`
|
||||
comparing `is_rainbow(rule.open)` against `RAINBOW_KEYWORDS.contains(&rule.open)`
|
||||
— which is **tautological**, since `is_rainbow` is defined as exactly that
|
||||
`.contains` call (`pairs.rs:74-76`); the loop can never fail regardless of
|
||||
@@ -1130,7 +1130,7 @@ that has ever caught anything.
|
||||
|
||||
**3. Mutation-check the core depth line.** Reverted
|
||||
`stack.iter().filter(|f| is_rainbow(f.rule.open)).count()` (`pairs.rs:157`)
|
||||
to `stack.len() as u32`. `cargo test -p vfmt_server` (unit): **exactly six**
|
||||
to `stack.len() as u32`. `cargo test -p lucisv_server` (unit): **exactly six**
|
||||
failures, all depth assertions, names matching the dev's Work Log list
|
||||
exactly (`a_module_with_nested_begins_matches_every_pair`,
|
||||
`a_scope_the_rainbow_hides_does_not_shift_the_colour_of_one_it_shows`,
|
||||
@@ -1150,7 +1150,7 @@ that line. Reverted; `pairs.rs` `md5` confirmed unchanged.
|
||||
|
||||
**4. M4 gap closure — the republish assertion.**
|
||||
`a_pushed_exclude_rebuilds_the_index_mid_session`
|
||||
(`crates/vfmt_server/tests/e2e.rs`) passes as committed. Mutation-checked the
|
||||
(`crates/lucisv_server/tests/e2e.rs`) passes as committed. Mutation-checked the
|
||||
new count: changed `assert_eq!(publishes, 3, ...)` to `4`
|
||||
(`tests/e2e.rs:766`) — failed as expected (`left: 3, right: 4`); reverted,
|
||||
`md5` confirmed unchanged (`ce62cbe2d094214d0e132cda9c252507` before and
|
||||
@@ -1168,8 +1168,8 @@ log. `pairs.rs` `md5` confirmed `975e8a4a80530309841415bd403cc71d` after
|
||||
removal, matching its state before the sweep test was added.
|
||||
|
||||
**6. `smoke.js` and invariants.**
|
||||
- Built `target/debug/vfmt-server` fresh (`cargo build -p vfmt_server`), ran
|
||||
`node smoke.js ../../target/debug/vfmt-server`: **OK**. Mutation check:
|
||||
- Built `target/debug/lucisv-server` fresh (`cargo build -p lucisv_server`), ran
|
||||
`node smoke.js ../../target/debug/lucisv-server`: **OK**. Mutation check:
|
||||
changed the expected-depths literal from `[0, 1, 0]` to `[9, 9, 9]`, reran —
|
||||
failed as expected (`smoke: FAIL — expected depths [0,1,0] ..., got
|
||||
[0,1,0]`, exit code 1 confirmed separately from the pipeline's own exit
|
||||
@@ -1177,14 +1177,14 @@ removal, matching its state before the sweep test was added.
|
||||
(`2092dbb2331bd040932f3ccb76246398`).
|
||||
- `node --check` on both `smoke.js` and `extension.js`: clean.
|
||||
- `cargo test --workspace`: every crate green (194 unit + 9 e2e in
|
||||
`vfmt_server`, matching the Work Log's count), 0 failures, both before any
|
||||
`lucisv_server`, matching the Work Log's count), 0 failures, both before any
|
||||
mutation and again after every mutation was reverted.
|
||||
- `cargo fmt --all -- --check`: clean. `cargo clippy --workspace
|
||||
--all-targets`: clean, no warnings (re-checked after touching the two Rust
|
||||
files to defeat incremental-build caching).
|
||||
- `git diff --stat` vs `HEAD` (`9a3a92c`): exactly the four files in the
|
||||
charter, same shape as at dispatch — `crates/vfmt_server/src/pairs.rs`,
|
||||
`crates/vfmt_server/tests/e2e.rs`, `docs/features/editor-scopes/README.md`,
|
||||
charter, same shape as at dispatch — `crates/lucisv_server/src/pairs.rs`,
|
||||
`crates/lucisv_server/tests/e2e.rs`, `docs/features/editor-scopes/README.md`,
|
||||
`editors/vscode/smoke.js`. No `vlog_formatter`/`vlog_parser`/`verify.rs`
|
||||
path touched.
|
||||
- No `unwrap()`/`expect()`/`panic!` added outside `#[cfg(test)]` in the diff
|
||||
@@ -1204,7 +1204,7 @@ Charter: the owner-confirmed root cause (transparent `foreground4..6`
|
||||
defaults) and its fix — the extension's own opaque colour ids, `unmatched` on
|
||||
the wire, and the defensive reads in `paint`. Scope: uncommitted working tree,
|
||||
diff vs `HEAD` (`d8e3708`) — `CHANGELOG.md`, `Cargo.toml`, `Cargo.lock`,
|
||||
`README.md`, `crates/vfmt_server/src/pairs.rs`, `crates/vfmt_server/tests/e2e.rs`,
|
||||
`README.md`, `crates/lucisv_server/src/pairs.rs`, `crates/lucisv_server/tests/e2e.rs`,
|
||||
`docs/features/editor-scopes/README.md`, `editors/vscode/{README.md,
|
||||
extension.js, package-lock.json, package.json, smoke.js}`, `tools/RELEASING.md`.
|
||||
Verdict: **ship-after-fixes** — one fix applied directly (below), one
|
||||
@@ -1220,10 +1220,10 @@ describes.
|
||||
**1. Gates.** `cargo fmt --all -- --check`: clean. `cargo clippy --workspace
|
||||
--all-targets`: clean, 0 warnings. `cargo test --workspace`: **1268 passed, 0
|
||||
failed** — summed the per-crate `test result:` lines independently rather than
|
||||
trusting the dev's total; `vfmt_server` alone is **285 unit + 16 e2e**, an
|
||||
trusting the dev's total; `lucisv_server` alone is **285 unit + 16 e2e**, an
|
||||
exact match to the Work Log. `node --check` on `extension.js` and `smoke.js`:
|
||||
both clean. `node smoke.js ../../target/debug/vfmt-server` against a freshly
|
||||
built (`cargo build -p vfmt_server`) binary: **OK**.
|
||||
both clean. `node smoke.js ../../target/debug/lucisv-server` against a freshly
|
||||
built (`cargo build -p lucisv_server`) binary: **OK**.
|
||||
|
||||
**2. The real user scenario, end to end.** Drove the built debug server over
|
||||
stdio (a hand-rolled probe mirroring `smoke.js`'s framing, since the crate
|
||||
@@ -1255,9 +1255,9 @@ Findings, both exactly as claimed:
|
||||
that is genuinely alone rather than the one a naive "most recently typed"
|
||||
guess would name.
|
||||
|
||||
**3. Colour-id audit, programmatic.** Extracted every `vfmt.rainbow*` id
|
||||
`extension.js` references (`vfmt.rainbow${index + 1}` for `index` 0–5, plus
|
||||
the literal `vfmt.rainbowUnmatched`) and diffed against `package.json`'s
|
||||
**3. Colour-id audit, programmatic.** Extracted every `lucisv.rainbow*` id
|
||||
`extension.js` references (`lucisv.rainbow${index + 1}` for `index` 0–5, plus
|
||||
the literal `lucisv.rainbowUnmatched`) and diffed against `package.json`'s
|
||||
`contributes.colors` array. All 7 declared, all 7 referenced, no orphans
|
||||
either direction. For each, checked all four `defaults` keys
|
||||
(`dark`/`light`/`highContrast`/`highContrastLight`) are present and parsed
|
||||
@@ -1283,7 +1283,7 @@ No probe found a false positive, a false negative, a panic, or a misattributed
|
||||
range.
|
||||
|
||||
**5. `78eeef6`'s pinned depth tests, independently diffed rather than taken on
|
||||
faith.** `git diff 78eeef6 -- crates/vfmt_server/src/pairs.rs`, checked for
|
||||
faith.** `git diff 78eeef6 -- crates/lucisv_server/src/pairs.rs`, checked for
|
||||
each of the six tests the Work Log names as unedited:
|
||||
`a_module_with_nested_begins_matches_every_pair`,
|
||||
`a_scope_the_rainbow_hides_does_not_shift_the_colour_of_one_it_shows`,
|
||||
@@ -1350,19 +1350,19 @@ depths and the missing-`end` warnings are unchanged" — verified true by
|
||||
finding 5 above.
|
||||
|
||||
One gap: `editors/vscode/README.md:49` and `:56` still read
|
||||
`vfmt-0.3.0.vsix` in the install-example commands, while the parallel example
|
||||
in the repo-root `README.md:584` correctly reads `vfmt-0.3.1.vsix`. This file
|
||||
`lucisv-0.3.0.vsix` in the install-example commands, while the parallel example
|
||||
in the repo-root `README.md:584` correctly reads `lucisv-0.3.1.vsix`. This file
|
||||
is not pristine — this very diff touches it for the rainbow-palette
|
||||
documentation (`git diff HEAD -- editors/vscode/README.md`, the
|
||||
`workbench.colorCustomizations` snippet and the "seven colours" rewrite) —
|
||||
but the two version strings were already stale at `0.3.0` before this diff
|
||||
(`git show HEAD:editors/vscode/README.md` shows the same `vfmt-0.3.0.vsix`
|
||||
(`git show HEAD:editors/vscode/README.md` shows the same `lucisv-0.3.0.vsix`
|
||||
text, so this is not a regression this diff introduced), and the Work Log's
|
||||
own version-bump list names only `tools/RELEASING.md` and (root) `README.md`
|
||||
as the "illustrative version strings" set, omitting this file even though it
|
||||
carries the same kind of string. A one-line-each, unambiguous doc fix per
|
||||
this role's charter — **fixed directly**, both occurrences now read
|
||||
`vfmt-0.3.1.vsix`, no code or test changes involved.
|
||||
`lucisv-0.3.1.vsix`, no code or test changes involved.
|
||||
|
||||
**8. Invariants.** No `unwrap()`/`expect()`/`panic!()`/`#[allow]` added
|
||||
anywhere in the `pairs.rs` diff (grepped every added line of `git diff HEAD --
|
||||
@@ -1387,8 +1387,8 @@ either be corrected or the code tightened next time this file is touched.
|
||||
Charter: the dev's claim that replacing the bare `Vec<Frame>` stack with the
|
||||
counting `Stack` type makes `analyze` linear without changing any observable
|
||||
answer — bit-identical corpus fingerprint, 1616 tests green, two new tests.
|
||||
Scope: uncommitted working tree, diff vs `HEAD` — `crates/vfmt_server/src/pairs.rs`
|
||||
and this README only. `crates/vfmt_server/src/inline.rs` and
|
||||
Scope: uncommitted working tree, diff vs `HEAD` — `crates/lucisv_server/src/pairs.rs`
|
||||
and this README only. `crates/lucisv_server/src/inline.rs` and
|
||||
`docs/features/inline-templates/` were read for context (the motivating QA
|
||||
find lives there) but not touched, per charter. Verdict: **PASS**, no
|
||||
blocking findings, one non-blocking cross-feature finding (item 8).
|
||||
@@ -1407,7 +1407,7 @@ the usual add-run-remove-and-md5-verify pattern.
|
||||
defeat incremental caching, both before and after adding QA's own test).
|
||||
`cargo test --workspace`: **1617 passed, 0 failed** (summed every crate's
|
||||
`test result:` line independently — 1616 + the one new differential test);
|
||||
`vfmt_server` alone: 530 unit + 4 ignored + 29 e2e + 3 grammar, matching the
|
||||
`lucisv_server` alone: 530 unit + 4 ignored + 29 e2e + 3 grammar, matching the
|
||||
Work Log's 533 unit count plus QA's addition.
|
||||
|
||||
Timed the dev's own scaling test in isolation:
|
||||
@@ -1422,7 +1422,7 @@ jitter a loaded CI runner typically adds. Judgment: **safe as written**.
|
||||
|
||||
**2. Independent differential check — not just trusting the corpus
|
||||
fingerprint.** Added a full-fidelity oracle to `pairs.rs`'s test module,
|
||||
transcribed verbatim from `git show HEAD:crates/vfmt_server/src/pairs.rs`
|
||||
transcribed verbatim from `git show HEAD:crates/lucisv_server/src/pairs.rs`
|
||||
(the exact pre-`Stack` `analyze`/`close`, copied as `old_analyze`/`old_close`
|
||||
over a local `OldFrame` stack) — a second, independently-typed
|
||||
implementation of the algorithm being replaced, not a rederivation from
|
||||
@@ -1492,7 +1492,7 @@ the diff, not assumed — and reads `p.depth` straight off `analyze`'s output,
|
||||
so the field-for-field differential above (which includes `depth` in its
|
||||
`pairs` fingerprint) is a direct proof the wire value is unchanged.
|
||||
`editors/vscode/extension.js` is not in `git diff --stat` at all. Ran the
|
||||
full `vfmt_server` suite's scope-pairs and depth tests
|
||||
full `lucisv_server` suite's scope-pairs and depth tests
|
||||
(`scope_pairs_depths_nest_and_forks_are_included`,
|
||||
`only_begins_and_forks_stack_up_the_colours`,
|
||||
`no_hidden_scope_counts_toward_the_depth`,
|
||||
@@ -1517,7 +1517,7 @@ ballpark as the dev's own debug-build numbers (629.1 ms / 2.3 ms at n =
|
||||
8000), close enough that the two runs are clearly measuring the same thing on
|
||||
similar hardware.
|
||||
|
||||
**6. Scope.** `git diff --stat` vs `HEAD`: `crates/vfmt_server/src/pairs.rs`
|
||||
**6. Scope.** `git diff --stat` vs `HEAD`: `crates/lucisv_server/src/pairs.rs`
|
||||
and `docs/features/editor-scopes/README.md` only (plus this entry). Grepped
|
||||
every added line for `unwrap(`, `expect(`, `panic!`, `unsafe` — all six hits
|
||||
are inside `#[cfg(test)] mod tests` (five `tokenize(...).expect(...)` calls
|
||||
@@ -1536,7 +1536,7 @@ green tree — not this feature's `pairs::analyze`. The dev's claim that
|
||||
nothing in the backlog covers this fix holds.
|
||||
|
||||
**8. Non-blocking, cross-feature finding — not fixed, `inline.rs` is out of
|
||||
scope for this dispatch.** `crates/vfmt_server/src/inline.rs:514-519`, the
|
||||
scope for this dispatch.** `crates/lucisv_server/src/inline.rs:514-519`, the
|
||||
doc comment on
|
||||
`a_deeply_nested_file_neither_crashes_nor_misses_the_trigger`, still reads:
|
||||
*"those flat loops are not all linear, though — `pairs::analyze` is
|
||||
@@ -1622,8 +1622,8 @@ Root cause was mine to confirm before the dev brief: the server's answers
|
||||
were correct, and the invisibility came from painting depth 3–5 with
|
||||
`editorBracketHighlight.foreground4..6`, whose VS Code defaults are
|
||||
transparent. The fix is the right shape — extension-contributed
|
||||
`vfmt.rainbow1..6` colors that are never transparent in any theme variant,
|
||||
plus `vfmt.rainbowUnmatched` bright red for genuinely unmatched tokens,
|
||||
`lucisv.rainbow1..6` colors that are never transparent in any theme variant,
|
||||
plus `lucisv.rainbowUnmatched` bright red for genuinely unmatched tokens,
|
||||
exactly the owner's never-hide/red-for-errors ruling. Dev's deviation
|
||||
(VS Code's real light-palette for 1–3 instead of gold-on-white) is
|
||||
approved: it avoids re-shipping the same bug in light themes. QA verified
|
||||
|
||||
@@ -2,21 +2,21 @@
|
||||
|
||||
## Goal
|
||||
|
||||
Expose the three keys `vfmt.toml` supports — `line-length`, `indent`,
|
||||
`exclude` — as VS Code settings (`vfmt.lineLength`, `vfmt.indent`,
|
||||
`vfmt.exclude`), for the users who asked for them: people with no config file
|
||||
Expose the three keys `lucisv.toml` supports — `line-length`, `indent`,
|
||||
`exclude` — as VS Code settings (`lucisv.lineLength`, `lucisv.indent`,
|
||||
`lucisv.exclude`), for the users who asked for them: people with no config file
|
||||
checked into the tree, who until now could set the indent only by accident
|
||||
(VS Code's `tabSize` leaked in through `FormattingOptions`) and could not set
|
||||
a line length **at all**, because LSP carries no line-length option. The
|
||||
settings are transported by `workspace/didChangeConfiguration`, validated at
|
||||
the server, and folded in one rung below a `vfmt.toml` — which stays
|
||||
the server, and folded in one rung below a `lucisv.toml` — which stays
|
||||
authoritative, so a project that checks one in keeps exactly one source of
|
||||
truth and format-on-save cannot drift from CI's `vfmt --check`.
|
||||
truth and format-on-save cannot drift from CI's `lucisv --check`.
|
||||
|
||||
## Assumptions
|
||||
|
||||
- **`vfmt.toml` has exactly three keys, and that is the whole surface.**
|
||||
`vfmt_core::config::parse_entry` accepts `line-length`, `indent` and
|
||||
- **`lucisv.toml` has exactly three keys, and that is the whole surface.**
|
||||
`lucisv_core::config::parse_entry` accepts `line-length`, `indent` and
|
||||
`exclude` and rejects everything else by name. Rule selection
|
||||
(`--select`/`--ignore`) has no config key yet, so there is nothing to expose
|
||||
for the linter; when it grows one, it grows a setting here in the same shape.
|
||||
@@ -31,13 +31,13 @@ truth and format-on-save cannot drift from CI's `vfmt --check`.
|
||||
all dropped, leaving that rung silent. Same philosophy as the existing
|
||||
`tabSize` guard: honouring half of a nonsensical request is worse than
|
||||
ignoring it.
|
||||
- **The accepted ranges must match `vfmt.toml`'s.** A value has to be exactly
|
||||
- **The accepted ranges must match `lucisv.toml`'s.** A value has to be exactly
|
||||
as acceptable from the settings UI as it is in a config file, or the two
|
||||
front ends would disagree about what is valid. `vfmt_core` exports no
|
||||
front ends would disagree about what is valid. `lucisv_core` exports no
|
||||
constant for its bounds, so `settings.rs` copies them **and**
|
||||
`the_accepted_ranges_are_the_ones_vfmt_toml_accepts` checks the copy against
|
||||
the real parser (`vfmt_core::config::parse`) rather than against another
|
||||
hard-coded number. If a range ever widens in `vfmt_core`, that test fails.
|
||||
`the_accepted_ranges_are_the_ones_lucisv_toml_accepts` checks the copy against
|
||||
the real parser (`lucisv_core::config::parse`) rather than against another
|
||||
hard-coded number. If a range ever widens in `lucisv_core`, that test fails.
|
||||
- **Only `exclude` can invalidate anything.** `lineLength` and `indent` are
|
||||
read afresh by every formatting request, so a change to them needs no cache
|
||||
work at all. `exclude` changes which files exist as far as the workspace
|
||||
@@ -45,9 +45,9 @@ truth and format-on-save cannot drift from CI's `vfmt --check`.
|
||||
- **A non-integral number cannot arrive from VS Code.** JavaScript serializes
|
||||
`4.0` as `4`, so `serde_json`'s `as_u64` rejecting fractions costs nothing
|
||||
real; there is no "close enough" case worth forgiving.
|
||||
- **The `vfmt.exclude` patterns are matched by the same engine as the
|
||||
- **The `lucisv.exclude` patterns are matched by the same engine as the
|
||||
config's.** They are appended to the same `Vec<String>` that reaches
|
||||
`vfmt_core::walk::collect_files`, so the glob syntax, the trailing-component
|
||||
`lucisv_core::walk::collect_files`, so the glob syntax, the trailing-component
|
||||
matching and the `.gitignore` interaction are whatever the CLI already does.
|
||||
An empty-string pattern is harmless (`walk::matches` returns false for one),
|
||||
so it is not filtered out.
|
||||
@@ -57,13 +57,13 @@ truth and format-on-save cannot drift from CI's `vfmt --check`.
|
||||
### The precedence ladder (the contract this feature is)
|
||||
|
||||
Highest first. Each rung applies only where every rung above it is silent, and
|
||||
**each key climbs independently** — a `vfmt.toml` naming only `indent` leaves
|
||||
`vfmt.lineLength` in charge of the width.
|
||||
**each key climbs independently** — a `lucisv.toml` naming only `indent` leaves
|
||||
`lucisv.lineLength` in charge of the width.
|
||||
|
||||
| # | Source | Why here |
|
||||
|---|---|---|
|
||||
| 1 | `vfmt.toml` | The project speaking. Must stay authoritative or format-on-save disagrees with `vfmt --check` in CI — the divergence that lifting the config into `vfmt_core` exists to remove. |
|
||||
| 2 | `vfmt.lineLength` / `vfmt.indent` | Typed on purpose into a settings UI, so more deliberate than a tab size — but it is one user's editor, and the repository outranks it. |
|
||||
| 1 | `lucisv.toml` | The project speaking. Must stay authoritative or format-on-save disagrees with `lucisv --check` in CI — the divergence that lifting the config into `lucisv_core` exists to remove. |
|
||||
| 2 | `lucisv.lineLength` / `lucisv.indent` | Typed on purpose into a settings UI, so more deliberate than a tab size — but it is one user's editor, and the repository outranks it. |
|
||||
| 3 | `FormattingOptions::tab_size` | Sent on every request whether or not the user ever chose it (it is the editor's default, or its guess from the file). The weakest thing that is still a signal. |
|
||||
| 4 | Built-in defaults | indent 2, width 100. |
|
||||
|
||||
@@ -75,7 +75,7 @@ Two paths use a shortened ladder, and both are unchanged in spirit:
|
||||
discover a config from. Such a buffer therefore honours rung 2 now, where
|
||||
before it had only the tab size.
|
||||
|
||||
A **broken** `vfmt.toml` contributes nothing at all (as before), so rung 2 is
|
||||
A **broken** `lucisv.toml` contributes nothing at all (as before), so rung 2 is
|
||||
what answers under it — the user still gets the warning, and still gets their
|
||||
settings.
|
||||
|
||||
@@ -84,10 +84,10 @@ settings.
|
||||
Consumed: `workspace/didChangeConfiguration`, whose `settings` field carries
|
||||
|
||||
```json
|
||||
{ "settings": { "vfmt": { "lineLength": 120, "indent": 4, "exclude": ["vendor"] } } }
|
||||
{ "settings": { "lucisv": { "lineLength": 120, "indent": 4, "exclude": ["vendor"] } } }
|
||||
```
|
||||
|
||||
`settings.rs::from_payload` reads `settings.vfmt` and nothing else. A payload
|
||||
`settings.rs::from_payload` reads `settings.lucisv` and nothing else. A payload
|
||||
without that section — including the `{"settings": null}` form — means "no
|
||||
opinion about anything" and resets every key. Keys may be absent, `null`, or
|
||||
garbage; each is dropped independently.
|
||||
@@ -101,18 +101,18 @@ with an unconditional `this.onDidChangeConfiguration(section, undefined)` —
|
||||
with `event === undefined` the `affectsConfiguration` filter is skipped, so
|
||||
**the notification is sent immediately at startup** as well as on every later
|
||||
change. No `initializationOptions` fallback is needed, and none was added.
|
||||
`extractSettingsInformation(['vfmt'])` calls
|
||||
`workspace.getConfiguration(undefined).get('vfmt')`, which returns the whole
|
||||
`extractSettingsInformation(['lucisv'])` calls
|
||||
`workspace.getConfiguration(undefined).get('lucisv')`, which returns the whole
|
||||
section with every key at its effective value — so the server sees
|
||||
`serverPath` and `rainbowBeginEnd` in the payload too, and ignores them.
|
||||
|
||||
Other editors: anything that can send `workspace/didChangeConfiguration` with
|
||||
that `settings` shape works. Neovim's `vim.lsp.config` sends its `settings`
|
||||
table verbatim, so `settings = { vfmt = { indent = 4 } }` is the whole setup.
|
||||
table verbatim, so `settings = { lucisv = { indent = 4 } }` is the whole setup.
|
||||
|
||||
### Within the server
|
||||
|
||||
- **Consumed from `vfmt_core`:** `config::parse` (in a test, to pin the
|
||||
- **Consumed from `lucisv_core`:** `config::parse` (in a test, to pin the
|
||||
ranges), `config::FileConfig`, `walk::collect_files`'s `exclude` parameter.
|
||||
- **Promised to `state.rs`:** `Workspace::client_settings()` and
|
||||
`set_client_settings()`, the latter returning `true` exactly when the caller
|
||||
@@ -125,12 +125,12 @@ table verbatim, so `settings = { vfmt = { indent = 4 } }` is the whole setup.
|
||||
`format::config_from(file, client, options)`.
|
||||
|
||||
**Request to the lead (outside this feature's scope, unchanged from M2/M3):**
|
||||
`docs/features/vfmt-server/README.md` and `TODO.md` §6 still understate the
|
||||
server (`documentHighlight`, the missing-closer diagnostics, `vfmt/scopePairs`,
|
||||
`docs/features/lucisv-server/README.md` and `TODO.md` §6 still understate the
|
||||
server (`documentHighlight`, the missing-closer diagnostics, `lucisv/scopePairs`,
|
||||
and now these settings). Separately,
|
||||
`docs/features/editor-packaging/README.md`'s *What was deliberately left out*
|
||||
table has a row reading "Settings beyond `serverPath` — formatter options
|
||||
belong in `vfmt.toml`, one source of truth", which this feature supersedes: the
|
||||
belong in `lucisv.toml`, one source of truth", which this feature supersedes: the
|
||||
one-source-of-truth rule is now enforced by *precedence* rather than by absence.
|
||||
`editors/vscode/README.md` said the same thing and was updated here, because
|
||||
this feature owns that file's settings table.
|
||||
@@ -143,7 +143,7 @@ this feature owns that file's settings table.
|
||||
- [x] Folded into `settings_for` / `config_from` / `indent_width`.
|
||||
- [x] `exclude` appended to the workspace scan's excludes; a change rebuilds
|
||||
the index and republishes.
|
||||
- [x] `extension.js` `synchronize.configurationSection: 'vfmt'`; initial-push
|
||||
- [x] `extension.js` `synchronize.configurationSection: 'lucisv'`; initial-push
|
||||
behaviour verified against the library source.
|
||||
- [x] Three settings in `package.json` with schema bounds.
|
||||
- [x] `editors/vscode/README.md` settings table and precedence ladder.
|
||||
@@ -151,18 +151,18 @@ this feature owns that file's settings table.
|
||||
change (e2e), untitled buffers, `smoke.js`.
|
||||
- [ ] Not done, deliberately: no per-language or per-folder override
|
||||
(`[verilog]`-scoped settings). VS Code resolves those per resource, and
|
||||
the server holds one workspace-wide `ClientSettings`; a `vfmt.toml` is
|
||||
the server holds one workspace-wide `ClientSettings`; a `lucisv.toml` is
|
||||
the per-directory mechanism and it already works.
|
||||
- [ ] Not done, deliberately: no `workspace/configuration` *pull*. The push
|
||||
arrives at startup and on every change, which is all that is needed;
|
||||
pulling would add a request per document to answer the same question.
|
||||
- [ ] Not done, deliberately: no setting for lint rule selection — there is no
|
||||
`vfmt.toml` key for it yet, and inventing one here would put the editor
|
||||
`lucisv.toml` key for it yet, and inventing one here would put the editor
|
||||
ahead of the CLI.
|
||||
|
||||
## Work log
|
||||
|
||||
### 2026-08-24 — M4: `vfmt.toml`'s three keys as VS Code settings
|
||||
### 2026-08-24 — M4: `lucisv.toml`'s three keys as VS Code settings
|
||||
|
||||
**The thing that had to be checked first.** The plan said to verify, not
|
||||
assume, whether `[email protected]`'s `synchronize` emits an initial
|
||||
@@ -189,18 +189,18 @@ left to rot.
|
||||
|
||||
**Two decisions worth recording.**
|
||||
|
||||
1. *Settings sit below `vfmt.toml`, not above.* This is the opposite of the
|
||||
1. *Settings sit below `lucisv.toml`, not above.* This is the opposite of the
|
||||
CLI's flag-beats-config order, and it is the same call `settings_for`
|
||||
already made for `tabSize`, for the same reason: a CLI flag is typed for one
|
||||
run, while an editor setting persists silently and belongs to one machine.
|
||||
If a `vfmt.lineLength` of 80 could override a project's `line-length = 120`,
|
||||
If a `lucisv.lineLength` of 80 could override a project's `line-length = 120`,
|
||||
every save would reflow files that CI then rejects. Pinned by
|
||||
`rung_1_a_config_file_beats_a_pushed_setting`.
|
||||
2. *Ranges are checked against the real config parser.* Copying `40..=400` and
|
||||
`1..=8` into `settings.rs` is a duplication hazard —`vfmt_core` exports no
|
||||
`1..=8` into `settings.rs` is a duplication hazard —`lucisv_core` exports no
|
||||
constant, and CLAUDE.md says not to reach into another module for this
|
||||
feature's convenience. Rather than leave the copy unguarded, the test asks
|
||||
`vfmt_core::config::parse` whether each edge is accepted. That is strictly
|
||||
`lucisv_core::config::parse` whether each edge is accepted. That is strictly
|
||||
better than a shared constant would have been: it tests the behaviour, not
|
||||
the number.
|
||||
|
||||
@@ -213,7 +213,7 @@ left to rot.
|
||||
asserts the text actually reflows, not just that a number was stored.
|
||||
- `settings.rs` — the exact VS Code payload shape at its defaults (must be "no
|
||||
opinion"), out-of-range numbers, wrong types, a non-array `exclude`, a mixed
|
||||
array, a payload with no `vfmt` section, `settings: null`, and the range
|
||||
array, a payload with no `lucisv` section, `settings: null`, and the range
|
||||
cross-check above.
|
||||
- `state.rs` — a pushed `exclude` hiding a file from the index; **appended, not
|
||||
substituted**, so a user's setting cannot put the project's vendored code
|
||||
@@ -242,7 +242,7 @@ it was conditioned on came back negative-for-need (the library does push).
|
||||
|
||||
**Verification.** `cargo fmt --all` clean, `cargo clippy --all-targets` clean,
|
||||
`cargo test --workspace` green, `node smoke.js` against a freshly built
|
||||
`target/debug/vfmt-server` OK, `npx @vscode/vsce ls` still accepts the
|
||||
`target/debug/lucisv-server` OK, `npx @vscode/vsce ls` still accepts the
|
||||
manifest, `node --check` on both JS files.
|
||||
|
||||
## QA log
|
||||
@@ -261,16 +261,16 @@ everything through `aa26e5e` already QA'd). Verified `settings.rs`,
|
||||
named is present and passes: toml-names-indent-only + settings-names-lineLength-
|
||||
only (`each_key_climbs_the_ladder_independently`); settings-indent vs. differing
|
||||
tabSize (`rung_2_a_pushed_setting_beats_the_editors_tab_size`); a broken
|
||||
`vfmt.toml` falls through to the pushed settings (rung 2), not straight to
|
||||
`lucisv.toml` falls through to the pushed settings (rung 2), not straight to
|
||||
default — pinned by `format.rs:499` and **documented**, not just tested: the
|
||||
Handshakes section states it explicitly ("A broken `vfmt.toml` contributes
|
||||
Handshakes section states it explicitly ("A broken `lucisv.toml` contributes
|
||||
nothing at all... so rung 2 is what answers under it"). No undocumented hole
|
||||
found.
|
||||
|
||||
**2. Validation hostility.** Every value the charter listed (indent 0, 9, -1,
|
||||
400.5-equivalent via 4.5, "4" string; lineLength 39, 401, 39.9-equivalent;
|
||||
exclude as a string, exclude with non-string entries; `settings: null`; missing
|
||||
`vfmt` section; extra unknown keys) is covered in `settings.rs`'s unit tests.
|
||||
`lucisv` section; extra unknown keys) is covered in `settings.rs`'s unit tests.
|
||||
Went further and hand-drove the **built binary** (not just unit tests) with a
|
||||
script sending all of the above plus `indent: 400.5`, `lineLength: 39.9`,
|
||||
`exclude: [1,2,3]`, a `params` with no `settings` key at all, and a payload
|
||||
@@ -287,7 +287,7 @@ not just `from_payload`).
|
||||
and the "only exclude triggers rescan" contract.
|
||||
|
||||
**Finding (non-blocking, test-coverage gap):**
|
||||
`crates/vfmt_server/tests/e2e.rs:690-746`
|
||||
`crates/lucisv_server/tests/e2e.rs:690-746`
|
||||
(`a_pushed_exclude_rebuilds_the_index_mid_session`) opens **no document** — it
|
||||
only drives `workspace/symbol` queries before/after the exclude push. That
|
||||
proves the *scan* half of `reindex()` (`server.rs:319-324`) ran, but nothing in
|
||||
@@ -327,17 +327,17 @@ languageclient/package.json`). `SyncConfigurationFeature.initialize()` (line
|
||||
`this.onDidChangeConfiguration(data.registerOptions.section, undefined)` —
|
||||
the `event === undefined` case skips the `affectsConfiguration` filter, so the
|
||||
notification is sent immediately. Confirmed: the dev's claim is accurate, and
|
||||
so is the wire shape claim — `extractSettingsInformation(['vfmt'])`
|
||||
(line 174-207) calls `workspace.getConfiguration(undefined).get('vfmt')` and
|
||||
wraps it under `result.vfmt`, i.e. exactly `{settings: {vfmt: {...every
|
||||
so is the wire shape claim — `extractSettingsInformation(['lucisv'])`
|
||||
(line 174-207) calls `workspace.getConfiguration(undefined).get('lucisv')` and
|
||||
wraps it under `result.lucisv`, i.e. exactly `{settings: {lucisv: {...every
|
||||
declared key at its effective value...}}}`, matching `settings.rs`'s
|
||||
`vscode_payload()` test helper and the README's documented shape.
|
||||
`extension.js`'s `synchronize: { configurationSection: 'vfmt' }` and
|
||||
`package.json`'s three new properties are all spelled `vfmt.lineLength` /
|
||||
`vfmt.indent` / `vfmt.exclude` — the prefix matches. No mismatch found.
|
||||
`extension.js`'s `synchronize: { configurationSection: 'lucisv' }` and
|
||||
`package.json`'s three new properties are all spelled `lucisv.lineLength` /
|
||||
`lucisv.indent` / `lucisv.exclude` — the prefix matches. No mismatch found.
|
||||
|
||||
**5. smoke.js.** Built fresh with `cargo build -p vfmt_server`, ran
|
||||
`node smoke.js ../../target/debug/vfmt-server` — OK. Mutation-checked the
|
||||
**5. smoke.js.** Built fresh with `cargo build -p lucisv_server`, ran
|
||||
`node smoke.js ../../target/debug/lucisv-server` — OK. Mutation-checked the
|
||||
pushed-indent assertion: changed `indent: 4` to `indent: 2` in the
|
||||
`didChangeConfiguration` push, reran — got a clean `FAIL` reporting the
|
||||
2-space (tabSize) output instead of 4-space, confirming the assertion is live;
|
||||
@@ -345,11 +345,11 @@ restored the edit and reran — `OK` again, and `md5sum` before/after the
|
||||
round-trip matched byte-for-byte (`a33792c93538b89b8d64debe117f2ab1`).
|
||||
|
||||
**6. Untitled buffers.** `format.rs`'s
|
||||
`an_untitled_buffer_honours_pushed_settings` pins both `vfmt.indent` and
|
||||
`vfmt.lineLength` applying with no path and no toml. Confirmed.
|
||||
`an_untitled_buffer_honours_pushed_settings` pins both `lucisv.indent` and
|
||||
`lucisv.lineLength` applying with no path and no toml. Confirmed.
|
||||
|
||||
**7. Invariants.**
|
||||
- `cargo test --workspace`: all green, including `vfmt_server`'s 190 unit + 9
|
||||
- `cargo test --workspace`: all green, including `lucisv_server`'s 190 unit + 9
|
||||
e2e (matches the work log's claimed counts).
|
||||
- `cargo fmt --all -- --check`: clean.
|
||||
- `cargo clippy --all-targets`: clean (touched `settings.rs` to force a
|
||||
@@ -363,10 +363,10 @@ round-trip matched byte-for-byte (`a33792c93538b89b8d64debe117f2ab1`).
|
||||
`#[cfg(test)]` marker).
|
||||
- package.json schema bounds (`minimum`/`maximum` 40/400 and 1/8) cross-checked
|
||||
against `settings.rs`'s `LINE_LENGTH_RANGE`/`INDENT_RANGE` and against
|
||||
`vfmt_core::config::parse_entry` (`crates/vfmt_core/src/config.rs:56-57`,
|
||||
`lucisv_core::config::parse_entry` (`crates/lucisv_core/src/config.rs:56-57`,
|
||||
which is the real source of truth) — all three agree.
|
||||
- Cross-checked the "exclude append mirrors the CLI" claim in Assumptions
|
||||
against `crates/vfmt/src/args.rs:103-107` (`exclude_with`) — the CLI does
|
||||
against `crates/lucisv/src/args.rs:103-107` (`exclude_with`) — the CLI does
|
||||
extend its own `--exclude` with the config's, same append-not-replace
|
||||
pattern. Accurate.
|
||||
|
||||
@@ -383,14 +383,14 @@ to close a documented required test, not a functional defect.
|
||||
Read `settings.rs` in full plus the `format.rs`, `server.rs`, `state.rs`
|
||||
and `extension.js` diffs. Approved and committed. Notes:
|
||||
|
||||
- Settings-below-`vfmt.toml` is the right call and the rewritten
|
||||
- Settings-below-`lucisv.toml` is the right call and the rewritten
|
||||
`settings_for` ladder doc states it well; the
|
||||
`the_accepted_ranges_are_the_ones_vfmt_toml_accepts` test (asking the
|
||||
`the_accepted_ranges_are_the_ones_lucisv_toml_accepts` test (asking the
|
||||
real parser about the copied bounds) is a pattern worth reusing.
|
||||
- QA's non-blocking finding stands: the exclude e2e proves the rescan but
|
||||
not the republish half of `reindex()`. Functionally moot today (nothing
|
||||
in `diagnostics::all` reads the index), so accepted as-is; the next
|
||||
round touching `e2e.rs` should close it per QA's suggested fix.
|
||||
- `extractSettingsInformation` sending the whole `vfmt` section (so the
|
||||
- `extractSettingsInformation` sending the whole `lucisv` section (so the
|
||||
server sees and ignores `serverPath`/`rainbowBeginEnd`) is correctly
|
||||
mirrored in the tests' payload shape rather than an idealized one.
|
||||
@@ -10,7 +10,7 @@ of the five editor features the owner asked for, and the only one that needs no
|
||||
server work at all: VS Code's `contributes.snippets` is a static JSON
|
||||
contribution the editor reads from `package.json` without ever activating the
|
||||
extension, so the feature costs two data files, ten lines of manifest, and no
|
||||
new code path in `extension.js` or `vfmt-server`. Two files, one per language
|
||||
new code path in `extension.js` or `lucisv-server`. Two files, one per language
|
||||
id, because the same prefix wants a different body per dialect: `module` gives
|
||||
`input wire` in Verilog and `input logic` in SystemVerilog, `function` gives a
|
||||
`begin`/`end` return-assignment in Verilog and `automatic` + `return` in
|
||||
@@ -35,11 +35,11 @@ SystemVerilog.
|
||||
- **Placeholder *text* may be prose (`value`, `statement`, `antecedent`) even
|
||||
where prose is not an expression.** Those are selected on insert and typed
|
||||
over; they are labels, not code. The line above is about the code the user
|
||||
keeps, not about placeholder labels — and in practice vfmt's parser accepts
|
||||
keeps, not about placeholder labels — and in practice lucisv's parser accepts
|
||||
the two we ship (`value: statement;`) as an identifier statement anyway.
|
||||
- **Two-space indent matches the formatter.** `vlog_formatter::Config::default`
|
||||
is `indent_width: 2` (`crates/vlog_formatter/src/format.rs:27`), so a
|
||||
snippet body inserted into a file with no `vfmt.toml` is not immediately
|
||||
snippet body inserted into a file with no `lucisv.toml` is not immediately
|
||||
re-indented on the next format-on-save.
|
||||
- **Prefixes are unique within a language and are not reserved.** VS Code
|
||||
offers a snippet whose prefix matches the typed word alongside ordinary
|
||||
@@ -56,9 +56,9 @@ SystemVerilog.
|
||||
|
||||
## Handshakes
|
||||
|
||||
- **Consumes** nothing from `vfmt-server`. This is deliberate: snippets are a
|
||||
- **Consumes** nothing from `lucisv-server`. This is deliberate: snippets are a
|
||||
static manifest contribution, so they work before the server starts, if the
|
||||
server is missing, and if `vfmt.serverPath` is wrong. Nothing in
|
||||
server is missing, and if `lucisv.serverPath` is wrong. Nothing in
|
||||
`extension.js` reads or registers them.
|
||||
- **Consumes** the two language ids declared in
|
||||
`editors/vscode/package.json` → `contributes.languages` (`verilog`,
|
||||
@@ -123,11 +123,11 @@ committed — they check data files, and nothing in the repo runs `node` in CI):
|
||||
Result after the fixes below: **ALL OK**, 30 snippets, no failures. The
|
||||
rendered `assertp` contains a literal `else $error("…")`, the two `tb`
|
||||
snippets a literal `$finish;`, the Verilog `tb` a literal `$display("done")`.
|
||||
2. The rendered text of all 30 was then fed through **vfmt's own parser**
|
||||
(`target/debug/vfmt --check`), wrapping statement-level snippets in
|
||||
2. The rendered text of all 30 was then fed through **lucisv's own parser**
|
||||
(`target/debug/lucisv --check`), wrapping statement-level snippets in
|
||||
`module wrapper_m; … endmodule` and expression-level ones additionally in
|
||||
`initial begin … end`. Result: **30/30 parse.** Every "would be reformatted"
|
||||
diff among them is the empty `$0` line or vfmt collapsing a two-port module
|
||||
diff among them is the empty `$0` line or lucisv collapsing a two-port module
|
||||
onto one line, never an indentation mismatch.
|
||||
|
||||
**Three fixes, all found by check 2 or by the dialect review:**
|
||||
|
||||
@@ -284,7 +284,7 @@ signatures.
|
||||
then every byte prefix of every fixture) before writing any assertions, so
|
||||
the tests encode measured behavior rather than hoped-for behavior. The
|
||||
example was deleted; it is not part of the diff.
|
||||
- Did not touch `verify.rs`, `tools/`, `corpus/`, or `crates/vfmt`. Did not
|
||||
- Did not touch `verify.rs`, `tools/`, `corpus/`, or `crates/lucisv`. Did not
|
||||
run `git commit`/`git push`.
|
||||
- **Concurrency note:** another agent's format-off-fence work
|
||||
(`crates/vlog_formatter/src/fence.rs`, `doc.rs`, `format.rs`, `printer.rs`,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## Goal
|
||||
|
||||
Empty the corpus's `expressions` bucket — 21 files, every one of them blocked
|
||||
on a piece of expression grammar vfmt did not have — plus the one `other` file
|
||||
on a piece of expression grammar lucisv did not have — plus the one `other` file
|
||||
blocked on a `const ref` argument. Eight independent shapes, each taken from a
|
||||
real corpus file and cited below. All eight are **structural**: real AST nodes
|
||||
with a canonical layout, no new verbatim pass-through and no new normalization,
|
||||
@@ -73,12 +73,12 @@ sub u (
|
||||
- **The `with [range]` form of a stream expression is not supported.** No
|
||||
corpus file writes it; a file that does keeps its old
|
||||
`expected expression` error rather than getting a half-modelled node.
|
||||
- **A `` `MACRO`` on the right of `inside` is passed through verbatim.** vfmt
|
||||
- **A `` `MACRO`` on the right of `inside` is passed through verbatim.** lucisv
|
||||
does not expand macros, so it cannot know the set the macro produces; the
|
||||
invocation is one token and is printed back as that token.
|
||||
- **A comment written immediately before a replication count is not kept.**
|
||||
`'{ /* c */ N{0}}` (and, unchanged from before this round,
|
||||
`{ /* c */ N{0}}`) makes the safety net reject the output and vfmt reports a
|
||||
`{ /* c */ N{0}}`) makes the safety net reject the output and lucisv reports a
|
||||
clean error — never a dropped comment in a written file. The count has no
|
||||
comment slot in either AST node; adding one is the same fix for both and is
|
||||
left for whoever needs it.
|
||||
@@ -117,7 +117,7 @@ sub u (
|
||||
— a macro invocation followed by an operand in expression position. The
|
||||
score script now classifies it as **macro-items**, not `expressions`. Left
|
||||
for that feature: reading `` `MACRO expr`` as anything other than two
|
||||
adjacent primaries needs the macro's definition, which vfmt does not have.
|
||||
adjacent primaries needs the macro's definition, which lucisv does not have.
|
||||
- `corpus/picorv32/scripts/smtbmc/mulcmp.v` (`other`) is a trailing comma in
|
||||
a connection list — invalid Verilog. Left alone, as briefed.
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ per notification.
|
||||
Neovim's built-in client both do; `editors/vscode/smoke.js` deliberately
|
||||
sends `capabilities: {}`) keeps exactly the save-only model it had before.
|
||||
That is the honest remaining staleness window, and it is stated in
|
||||
`docs/features/vfmt-server/README.md` as well as here.
|
||||
`docs/features/lucisv-server/README.md` as well as here.
|
||||
- **The registration is sent from `Server::new`, not from an `initialized`
|
||||
handler.** `lsp-server`'s `initialize_finish` *consumes* the client's
|
||||
`initialized` notification before returning, so the request loop never sees
|
||||
@@ -39,20 +39,20 @@ per notification.
|
||||
carries a *list*, and a branch checkout fills it. The handler asks one
|
||||
question of the whole list and rebuilds at most once. There is **no
|
||||
time-based debouncing**: that needs a timer, the server is single-threaded
|
||||
and synchronous by design (`docs/features/vfmt-server/README.md`), and
|
||||
and synchronous by design (`docs/features/lucisv-server/README.md`), and
|
||||
adding a thread to save part of a 0.7 s corpus rebuild is not a trade worth
|
||||
making. A burst of several notifications therefore costs several rebuilds;
|
||||
in practice VS Code and Neovim both coalesce a checkout into very few.
|
||||
- **Events are filtered by extension, cheaply.** The registered globs already
|
||||
filter client-side, but a client is free to forward more than it was asked
|
||||
for, so `touches_scope` drops a notification whose every path is neither a
|
||||
source extension (`vfmt_core::walk::EXTENSIONS`) nor the configured
|
||||
source extension (`lucisv_core::walk::EXTENSIONS`) nor the configured
|
||||
filelist. It does **not** try to decide whether a source file is *in* the
|
||||
current scope: the scope ladder re-applies during the rebuild anyway, and
|
||||
one rebuild for a stray in-tree `.sv` is much cheaper than duplicating the
|
||||
ladder's logic per event and getting it subtly wrong.
|
||||
- **Only the root filelist is watched, not its nested `-f` targets.**
|
||||
`vfmt_core::filelist::Filelist` reports the files a filelist names but not
|
||||
`lucisv_core::filelist::Filelist` reports the files a filelist names but not
|
||||
the filelists it *read*, and adding that field is a change to another
|
||||
module for one caller. So editing a nested `.f` outside the editor is still
|
||||
invisible until the next save or root-filelist touch. Saving a nested
|
||||
@@ -63,13 +63,13 @@ per notification.
|
||||
enough for every name would also fire on every unrelated `.f` in the tree.
|
||||
A path that is not valid UTF-8 cannot be written as a glob and is simply not
|
||||
watched — the same restriction `uri.rs` already lives under.
|
||||
- **`vfmt.toml` itself is not watched.** Its `exclude` and `filelist` keys do
|
||||
- **`lucisv.toml` itself is not watched.** Its `exclude` and `filelist` keys do
|
||||
change the index's scope, so editing one outside the editor is still
|
||||
invisible until the next save — but it is read afresh on every rebuild, so
|
||||
the very next rebuild from any cause picks it up, and saving it from inside
|
||||
the editor already rebuilds. Watching it would mean a third watcher and a
|
||||
second re-registration trigger for a file people edit once a quarter.
|
||||
- **A changed `vfmt.filelist` re-registers.** The watched path is *inside* the
|
||||
- **A changed `lucisv.filelist` re-registers.** The watched path is *inside* the
|
||||
registration, so a new path needs a new registration: the old one is
|
||||
unregistered by id and a fresh one sent. The alternative — a static watcher
|
||||
wide enough that no re-registration is ever needed — would mean watching
|
||||
@@ -85,7 +85,7 @@ per notification.
|
||||
|
||||
## Handshakes
|
||||
|
||||
### `vfmt_server::watch` (new module)
|
||||
### `lucisv_server::watch` (new module)
|
||||
|
||||
```rust
|
||||
pub const SOURCE_GLOB: &str = "**/*.{v,vh,sv,svh}";
|
||||
@@ -96,11 +96,11 @@ pub fn unregistration(id: String) -> Unregistration;
|
||||
pub fn touches_scope(changes: &[FileEvent], filelist: Option<&Path>) -> bool;
|
||||
```
|
||||
|
||||
`SOURCE_GLOB` is pinned to `vfmt_core::walk::EXTENSIONS` by a test: a file the
|
||||
`SOURCE_GLOB` is pinned to `lucisv_core::walk::EXTENSIONS` by a test: a file the
|
||||
walk indexes but the glob does not name is a file whose external changes are
|
||||
invisible, and the reverse is wasted rebuilds.
|
||||
|
||||
### `vfmt_server::server`
|
||||
### `lucisv_server::server`
|
||||
|
||||
- `Server::new` now takes a `ClientAbilities { snippets, file_watching }`
|
||||
instead of a bare `snippets: bool` — two adjacent bools at a call site is a
|
||||
@@ -114,10 +114,10 @@ invisible, and the reverse is wasted rebuilds.
|
||||
reporting.
|
||||
- `workspace/didChangeConfiguration` re-registers the watchers when the
|
||||
resolved filelist path changed.
|
||||
- Outgoing request ids are `vfmt-<n>`; registration ids are
|
||||
`vfmt-watched-files-<n>`. Responses to them are ignored in `run`.
|
||||
- Outgoing request ids are `lucisv-<n>`; registration ids are
|
||||
`lucisv-watched-files-<n>`. Responses to them are ignored in `run`.
|
||||
|
||||
### `vfmt_server::state`
|
||||
### `lucisv_server::state`
|
||||
|
||||
`Workspace::filelist_path()` is now **public** (it was private). It is what
|
||||
the watcher registration names and what `touches_scope` compares against; the
|
||||
@@ -134,14 +134,14 @@ no new setting.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `crates/vfmt_server/src/watch.rs`: capability probe, registration and
|
||||
- [x] `crates/lucisv_server/src/watch.rs`: capability probe, registration and
|
||||
unregistration builders, per-notification event filter
|
||||
- [x] `client/registerCapability` sent after the handshake, guarded on the
|
||||
client capability
|
||||
- [x] `workspace/didChangeWatchedFiles` handled: one `reindex()` per
|
||||
notification, warnings surfaced exactly as on save
|
||||
- [x] Filelist watched by path when one is configured; re-registered when
|
||||
`vfmt.filelist` resolves somewhere else
|
||||
`lucisv.filelist` resolves somewhere else
|
||||
- [x] `Workspace::filelist_path` made public for the two callers above
|
||||
- [x] Unit tests (11 in `watch.rs`, 13 in `server.rs` driving a real `Server`
|
||||
over `Connection::memory()`), 2 new e2e stdio sessions
|
||||
@@ -150,7 +150,7 @@ no new setting.
|
||||
- [ ] Not done, deliberately: no time-based debouncing (needs a timer and a
|
||||
thread; per-notification coalescing only — see Assumptions).
|
||||
- [ ] Not done, deliberately: nested `-f` filelists are not watched (needs a
|
||||
new field on `vfmt_core::filelist::Filelist` — see Assumptions).
|
||||
new field on `lucisv_core::filelist::Filelist` — see Assumptions).
|
||||
- [ ] Not done, deliberately: no `workspace/didChangeWorkspaceFolders`. Adding
|
||||
or removing a folder mid-session still needs a restart; that is its own
|
||||
change, with its own question about re-registering the watchers.
|
||||
@@ -193,11 +193,11 @@ wiring, then the tests, then the docs. Decisions worth recording:
|
||||
|
||||
**Files touched outside this feature's module**, all minimal:
|
||||
|
||||
- `crates/vfmt_server/src/state.rs` — `filelist_path` private → public, with
|
||||
- `crates/lucisv_server/src/state.rs` — `filelist_path` private → public, with
|
||||
a doc comment saying why. No logic change.
|
||||
- `crates/vfmt_server/src/main.rs` — `mod watch;`, and `ClientAbilities` at
|
||||
- `crates/lucisv_server/src/main.rs` — `mod watch;`, and `ClientAbilities` at
|
||||
the `Server::new` call site.
|
||||
- `crates/vfmt_server/tests/e2e.rs` — the `Live` harness and the
|
||||
- `crates/lucisv_server/tests/e2e.rs` — the `Live` harness and the
|
||||
`unframe`/`read_message` split, plus the two new sessions.
|
||||
|
||||
**Not touched, per the brief**: `TODO.md` §8's M9 checkbox and the umbrella
|
||||
@@ -209,20 +209,20 @@ than as a hope. No version bump, no CHANGELOG entry, no new dependency, no
|
||||
threads.
|
||||
|
||||
**Verification.** `cargo fmt --all -- --check` clean; `cargo clippy
|
||||
--all-targets` silent; `cargo test --workspace` green. `vfmt_server` went
|
||||
--all-targets` silent; `cargo test --workspace` green. `lucisv_server` went
|
||||
from 372 to 396 unit tests (+24: 11 in `watch.rs`, 13 in `server.rs`) and
|
||||
from 19 to 21 e2e sessions (+2). `node editors/vscode/smoke.js
|
||||
target/debug/vfmt-server` → OK, 8 messages, unchanged.
|
||||
target/debug/lucisv-server` → OK, 8 messages, unchanged.
|
||||
|
||||
## QA log
|
||||
|
||||
### 2026-08-24 — QA agent, M9
|
||||
|
||||
**Gates.** `cargo fmt --all -- --check` clean. `cargo clippy --all-targets`
|
||||
silent. `cargo test -p vfmt_server`: **394 passed + 2 ignored (= 396 unit) +
|
||||
silent. `cargo test -p lucisv_server`: **394 passed + 2 ignored (= 396 unit) +
|
||||
21 e2e + 3 grammar**, matching the Work log's counts exactly. `cargo test
|
||||
--workspace`: green, no failures anywhere. `node editors/vscode/smoke.js
|
||||
target/debug/vfmt-server` → OK, 8 messages, unchanged (capabilities `{}` →
|
||||
target/debug/lucisv-server` → OK, 8 messages, unchanged (capabilities `{}` →
|
||||
never registered, confirmed both by the new
|
||||
`a_client_that_cannot_watch_files_is_never_asked_to` e2e test and by running
|
||||
smoke.js itself). No `unwrap`/`expect`/`panic!` outside `#[cfg(test)]` in
|
||||
@@ -245,7 +245,7 @@ something *other* than `initialized` as its very next message makes
|
||||
`Server::new` is ever called — pre-existing behavior, not a new race this
|
||||
feature introduces.)
|
||||
|
||||
**Adversarial testing, real `target/release/vfmt-server` binary over stdio**
|
||||
**Adversarial testing, real `target/release/lucisv-server` binary over stdio**
|
||||
(hand-rolled Python framing client, one message at a time — the same
|
||||
write-then-wait-for-reply shape `tests/e2e.rs`'s `Live` harness uses, not a
|
||||
threaded reader, per the prior QA note about that class of harness hang).
|
||||
@@ -259,7 +259,7 @@ Scripts are in the scratchpad, not the repo. All of the following **PASS**:
|
||||
path indexes it, and `workspace/symbol` finds it on the very next query
|
||||
with the location URI round-tripping back to the same path. This is
|
||||
`uri_to_path`'s existing percent-decoding
|
||||
(`crates/vfmt_server/src/uri.rs:36-53`) doing exactly what it already did
|
||||
(`crates/lucisv_server/src/uri.rs:36-53`) doing exactly what it already did
|
||||
for `didOpen`/`hover`/etc — `watch::touches_scope` and the reindex path
|
||||
route every event through the same helper, so there was no new surface for
|
||||
this to go wrong on, and none did.
|
||||
@@ -272,7 +272,7 @@ Scripts are in the scratchpad, not the repo. All of the following **PASS**:
|
||||
what the README says it costs, not more. The server answered a *correct*
|
||||
follow-up query (`workspace/symbol("clk")`, non-empty, right after the
|
||||
burst) every time — never wedged, never stale past the burst. This is
|
||||
faster than the vfmt-server README's own 0.68 s/rebuild debug-build
|
||||
faster than the lucisv-server README's own 0.68 s/rebuild debug-build
|
||||
baseline (release build, as expected) — the honest-gaps assessment below
|
||||
updates the number for a release binary.
|
||||
- **Delete the open file.** Deleted the file backing an open buffer on disk,
|
||||
@@ -288,7 +288,7 @@ Scripts are in the scratchpad, not the repo. All of the following **PASS**:
|
||||
- **`didChangeWatchedFiles` before any `didOpen`.** Sent straight after the
|
||||
registration handshake, zero open buffers: no panic, and the created file
|
||||
is indexed on the next `workspace/symbol` query. The "no shared mutable
|
||||
state, no locks" design (`docs/features/vfmt-server/README.md`) leaves
|
||||
state, no locks" design (`docs/features/lucisv-server/README.md`) leaves
|
||||
nothing that startup ordering could race here, and the run confirms it.
|
||||
- **Filelist emptied.** Rewrote the configured filelist to zero bytes, sent
|
||||
the matching `Changed` event: the index shrinks to what the now-empty
|
||||
@@ -305,17 +305,17 @@ Scripts are in the scratchpad, not the repo. All of the following **PASS**:
|
||||
path specifically** (not just `didSave`, which the filelist feature's own
|
||||
QA already covered): a filelist with an unsupported flag and three missing
|
||||
files, touched via a watched-files event, produced **exactly one**
|
||||
`window/showMessage` ("... and 4 more — see the vfmt log") and **five**
|
||||
`window/showMessage` ("... and 4 more — see the lucisv log") and **five**
|
||||
`window/logMessage`s — the "first warning shown, all of them logged" rule
|
||||
holds on this new trigger, not just the old ones.
|
||||
- **Re-registration.** Changed `vfmt.filelist` three times in a row: to a
|
||||
- **Re-registration.** Changed `lucisv.filelist` three times in a row: to a
|
||||
path containing a space (watched verbatim, not escaped or broken — the
|
||||
glob pattern is a literal path string, not a real glob, so a raw space is
|
||||
correct), to a nonexistent path (still unregisters/re-registers cleanly,
|
||||
still answers requests afterward via the workspace-walk fallback), and
|
||||
back to the same value as immediately before (no re-registration at all —
|
||||
`set_client_settings`'s equality check holds). Registration ids across all
|
||||
three changes were `vfmt-watched-files-0/1/2/3` in strict sequence, never
|
||||
three changes were `lucisv-watched-files-0/1/2/3` in strict sequence, never
|
||||
repeated, and each `client/unregisterCapability` named exactly the id the
|
||||
registration immediately before it carried — confirmed against the wire
|
||||
messages, not just the unit tests already pinning this in `server.rs`.
|
||||
@@ -343,7 +343,7 @@ Work log checks out against the real binary, not only its own test suite.
|
||||
**Honest-gaps assessment (item 4 of the brief).** All three disclosed gaps
|
||||
are stated where a user/maintainer would actually look — the feature
|
||||
README's own Assumptions *and* Status/TODO, and restated in
|
||||
`docs/features/vfmt-server/README.md`'s "State and staleness" section (the
|
||||
`docs/features/lucisv-server/README.md`'s "State and staleness" section (the
|
||||
file most likely to be read for "why is my index stale"):
|
||||
|
||||
- **No debounce.** Measured above: 3×~0.32 s ≈ 0.98 s for a burst on the full
|
||||
@@ -356,7 +356,7 @@ file most likely to be read for "why is my index stale"):
|
||||
a non-coalescing client would be testing a hypothetical client, not this
|
||||
one), but the linear cost model documented ("a burst … costs several
|
||||
rebuilds") is exactly what was measured, no worse. Acceptable as shipped.
|
||||
- **Nested `-f` filelists unwatched, and `vfmt.toml` unwatched.** Read-only
|
||||
- **Nested `-f` filelists unwatched, and `lucisv.toml` unwatched.** Read-only
|
||||
confirmed against the Assumptions section's own reasoning (the missing
|
||||
`Filelist`-reads-filelists field, and "re-read every rebuild" respectively)
|
||||
— both are stated, reasoned, and cheap to work around (save inside the
|
||||
|
||||
@@ -2,22 +2,22 @@
|
||||
|
||||
## Goal
|
||||
|
||||
Teach vfmt the EDA world's own project file. A `.f` filelist — one source
|
||||
Teach lucisv the EDA world's own project file. A `.f` filelist — one source
|
||||
path per line, `-f` nesting, `+incdir+`, `+define+`, comments and `$VAR`
|
||||
expansion — is what every Verilog build already has, so it is the honest
|
||||
answer to rope's `.ropeproject`: when a project has one, it defines
|
||||
*exactly* the set of files the server indexes, and the guesswork of walking
|
||||
a workspace folder disappears. This is M1 of
|
||||
`docs/features/refactor/README.md`: the parser lives in `vfmt_core` (next
|
||||
`docs/features/refactor/README.md`: the parser lives in `lucisv_core` (next
|
||||
to config and walk, so a future CLI `-f` reuses it unchanged), the scope
|
||||
precedence lives in `vfmt_server`, and the two front doors that name a
|
||||
filelist are a `filelist` key in `vfmt.toml` and the VS Code setting
|
||||
`vfmt.filelist`.
|
||||
precedence lives in `lucisv_server`, and the two front doors that name a
|
||||
filelist are a `filelist` key in `lucisv.toml` and the VS Code setting
|
||||
`lucisv.filelist`.
|
||||
|
||||
## Assumptions
|
||||
|
||||
- **The filelist is a *scope*, not a build description.** M1 recorded
|
||||
`+incdir+` and `+define+` and used neither: vfmt does not preprocess, so
|
||||
`+incdir+` and `+define+` and used neither: lucisv does not preprocess, so
|
||||
an include path and a macro value change nothing about what the index
|
||||
contains. They were parsed anyway because a filelist that silently dropped
|
||||
them would have to be re-parsed later, and because "unknown flag" warnings
|
||||
@@ -38,7 +38,7 @@ filelist are a `filelist` key in `vfmt.toml` and the VS Code setting
|
||||
itself was named relatively) so the index sees one spelling per file.
|
||||
Symlinks are deliberately **not** resolved, matching
|
||||
`config-discovery`'s "lexical, not symlink-aware" rule.
|
||||
- **An unknown flag is skipped alone, not with its argument.** vfmt has no
|
||||
- **An unknown flag is skipped alone, not with its argument.** lucisv has no
|
||||
table of which EDA flags take a value, and inventing one would be a
|
||||
guess. So `-y lib/` warns about `-y` and then reports `lib/` as a missing
|
||||
source file (a directory is not a file). Two warnings for one line is
|
||||
@@ -69,13 +69,13 @@ filelist are a `filelist` key in `vfmt.toml` and the VS Code setting
|
||||
- **Reading a filelist is I/O the server does on every index rebuild.** No
|
||||
caching, no watching: `rebuild_index` already re-reads the whole workspace
|
||||
on save, and one extra small file is nothing next to that.
|
||||
- **`vfmt.toml`'s `filelist` value is a path, not a glob.** It is resolved
|
||||
- **`lucisv.toml`'s `filelist` value is a path, not a glob.** It is resolved
|
||||
against the config file's own directory when the config is loaded, so the
|
||||
`FileConfig` a caller receives already carries a usable path.
|
||||
|
||||
## Handshakes
|
||||
|
||||
### `vfmt_core::filelist` (new module)
|
||||
### `lucisv_core::filelist` (new module)
|
||||
|
||||
```rust
|
||||
pub const MAX_NESTING_DEPTH: usize = 256; // how deep `-f` may nest
|
||||
@@ -97,18 +97,18 @@ variable, a repeated filelist, a chain nested past `MAX_NESTING_DEPTH`) is a
|
||||
warning on an otherwise usable result. `read` neither panics nor aborts: on
|
||||
any input, including an adversarial one, it returns.
|
||||
|
||||
### `vfmt_core::config`
|
||||
### `lucisv_core::config`
|
||||
|
||||
`FileConfig` gains `filelist: Option<PathBuf>`, from the new `vfmt.toml` key
|
||||
`FileConfig` gains `filelist: Option<PathBuf>`, from the new `lucisv.toml` key
|
||||
`filelist = "path"`. `parse` records the path **as written** (it has no idea
|
||||
where the file lives); `Discovery` resolves it against the config file's
|
||||
directory, so every `FileConfig` handed out by `Discovery` carries a
|
||||
resolved path. Same strictness as the other keys: a non-string value, a
|
||||
duplicate, or any unknown key is still a hard error naming file and line.
|
||||
|
||||
### `vfmt_server`
|
||||
### `lucisv_server`
|
||||
|
||||
- `ClientSettings` gains `filelist: Option<String>` from `vfmt.filelist`.
|
||||
- `ClientSettings` gains `filelist: Option<String>` from `lucisv.filelist`.
|
||||
An empty string means "unset", which is what the VS Code default is.
|
||||
- `Workspace::set_client_settings` now returns `true` for a `filelist`
|
||||
change as well as an `exclude` change — both change *which files exist*.
|
||||
@@ -126,7 +126,7 @@ Highest first, resolved on every index rebuild:
|
||||
|
||||
| # | Scope | When |
|
||||
|---|---|---|
|
||||
| 1 | The files a **filelist** names | `vfmt.filelist` is set (absolute, or relative to the first workspace root), else the workspace root's `vfmt.toml` has a `filelist` key |
|
||||
| 1 | The files a **filelist** names | `lucisv.filelist` is set (absolute, or relative to the first workspace root), else the workspace root's `lucisv.toml` has a `filelist` key |
|
||||
| 2 | The **workspace-folder walk** | there is a workspace root — unchanged from before this feature |
|
||||
| 3 | Each **open file's own directory**, non-recursive | there is no workspace root at all (a single file opened) |
|
||||
|
||||
@@ -138,41 +138,41 @@ index.
|
||||
|
||||
### `editors/vscode`
|
||||
|
||||
New setting `vfmt.filelist` (string, default `""`), forwarded by the
|
||||
existing `synchronize.configurationSection: 'vfmt'` machinery — no
|
||||
New setting `lucisv.filelist` (string, default `""`), forwarded by the
|
||||
existing `synchronize.configurationSection: 'lucisv'` machinery — no
|
||||
extension code change.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `crates/vfmt_core/src/filelist.rs`: parser + `Filelist` + `read`
|
||||
- [x] `crates/lucisv_core/src/filelist.rs`: parser + `Filelist` + `read`
|
||||
- [x] comments (`//`, `#`), blank lines, `-f` nesting with cycle/repeat
|
||||
detection and a 256-level depth limit, `+incdir+` (multi-`+`),
|
||||
`+define+NAME[=VAL]` (multi-`+`),
|
||||
`$VAR`/`${VAR}` expansion, unknown `+arg`/`-flag` warnings, missing
|
||||
files warned and skipped, relative resolution against the naming
|
||||
filelist
|
||||
- [x] `vfmt.toml` key `filelist`, resolved against the config's directory
|
||||
- [x] `vfmt.filelist` client setting, and the rescan it forces
|
||||
- [x] `lucisv.toml` key `filelist`, resolved against the config's directory
|
||||
- [x] `lucisv.filelist` client setting, and the rescan it forces
|
||||
- [x] Server scope ladder (filelist ⊃ workspace walk ⊃ open-file directory)
|
||||
with warnings surfaced once per rebuild
|
||||
- [x] `vfmt.filelist` in `editors/vscode/package.json` + README; root
|
||||
- [x] `lucisv.filelist` in `editors/vscode/package.json` + README; root
|
||||
README config and editor sections
|
||||
- [x] Unit tests in `vfmt_core` and `vfmt_server`; `cargo fmt`, `cargo
|
||||
- [x] Unit tests in `lucisv_core` and `lucisv_server`; `cargo fmt`, `cargo
|
||||
clippy --all-targets`, `cargo test` all clean
|
||||
- [x] ~~Not done, deliberately: the CLI does not consume `filelist` yet
|
||||
(M1 is config-level plumbing plus the server; a `vfmt -f` flag is its
|
||||
(M1 is config-level plumbing plus the server; a `lucisv -f` flag is its
|
||||
own change with its own exit-code questions).~~ **M13** is that change:
|
||||
`vfmt -f project.f` reuses `read` unchanged and answers the exit-code
|
||||
`lucisv -f project.f` reuses `read` unchanged and answers the exit-code
|
||||
questions this line predicted (warnings never move the exit code, an
|
||||
unreadable root filelist is exit 2) —
|
||||
`docs/features/cli-filelist/README.md`. The `vfmt.toml` **key** is still
|
||||
`docs/features/cli-filelist/README.md`. The `lucisv.toml` **key** is still
|
||||
read by the server only, now on purpose rather than for want of a flag.
|
||||
- [x] ~~Not done, deliberately: `+incdir+`/`+define+` feed nothing.~~
|
||||
`` `include`` resolution arrived in M10 and consumes `Filelist::incdirs`
|
||||
unchanged, exactly as this line predicted — resolved, in filelist order,
|
||||
nested `-f` incdirs flattened in place
|
||||
(`docs/features/include-nav/README.md`). `+define+` still feeds
|
||||
nothing: vfmt does not preprocess.
|
||||
nothing: lucisv does not preprocess.
|
||||
- [ ] Not done, deliberately: no file watching. The filelist is re-read on
|
||||
every index rebuild (save, settings change, open with no root).
|
||||
|
||||
@@ -218,13 +218,13 @@ editor setting. Decisions worth recording:
|
||||
**Files touched outside the brief's scope**, all forced by the new field and
|
||||
kept to the minimum:
|
||||
|
||||
- `crates/vfmt/src/args.rs` — two `FileConfig`/help edits. Adding a public
|
||||
- `crates/lucisv/src/args.rs` — two `FileConfig`/help edits. Adding a public
|
||||
field breaks every struct literal, so the two test literals became
|
||||
`..Default::default()`; and `--help`'s CONFIGURATION paragraph lists the
|
||||
recognized keys by name, which would have been a lie the moment the parser
|
||||
accepted a fourth. The new line says `filelist` is read by `vfmt-server`
|
||||
accepted a fourth. The new line says `filelist` is read by `lucisv-server`
|
||||
only, so nobody expects the CLI to act on it.
|
||||
- `crates/vfmt_server/src/format.rs` — the same struct-literal fix in two
|
||||
- `crates/lucisv_server/src/format.rs` — the same struct-literal fix in two
|
||||
tests. No behavior in that module changed.
|
||||
|
||||
**Deviations from the brief.** Two, both narrowing:
|
||||
@@ -241,19 +241,19 @@ kept to the minimum:
|
||||
|
||||
Also noted and **not** touched, being outside this feature's scope: the
|
||||
root `README.md`'s editor section still says "the server does **not** read
|
||||
`vfmt.toml` yet", which the `editor-settings` feature already made false.
|
||||
`lucisv.toml` yet", which the `editor-settings` feature already made false.
|
||||
Flagged for the lead rather than fixed here. (The neighbouring sentence
|
||||
"One setting, `vfmt.serverPath`" *was* rewritten, because this feature adds
|
||||
"One setting, `lucisv.serverPath`" *was* rewritten, because this feature adds
|
||||
a setting and leaving a count that is now wrong by three would have been
|
||||
worse than the one-line edit.)
|
||||
|
||||
**Verification.** `cargo fmt --all -- --check` clean; `cargo clippy
|
||||
--all-targets` silent; `cargo test --workspace` green — 1007 tests, of
|
||||
which 34 are new: 23 in `vfmt_core` (20 `filelist` + 3 `config`), 9 in
|
||||
`vfmt_server` (2 `settings`, 7 `state`) and 2 e2e sessions against the real
|
||||
which 34 are new: 23 in `lucisv_core` (20 `filelist` + 3 `config`), 9 in
|
||||
`lucisv_server` (2 `settings`, 7 `state`) and 2 e2e sessions against the real
|
||||
binary (a filelist pushed, narrowed and broken mid-session; a file opened
|
||||
with no workspace folder). `node editors/vscode/smoke.js
|
||||
target/debug/vfmt-server` OK, `node --check` on both JS files, and
|
||||
target/debug/lucisv-server` OK, `node --check` on both JS files, and
|
||||
`package.json` parses.
|
||||
|
||||
### 2026-08-24 — dev agent, QA round 1 fixes
|
||||
@@ -295,7 +295,7 @@ exactly QA's reproduction. Restored the constant and the file; the probe
|
||||
test is not in the tree.
|
||||
|
||||
**Re-verified on the real binary, as QA asked.** Built
|
||||
`target/release/vfmt-server`, gave it a scratch workspace whose `vfmt.toml`
|
||||
`target/release/lucisv-server`, gave it a scratch workspace whose `lucisv.toml`
|
||||
names a 20 000-level chain, and drove a raw stdio LSP session
|
||||
(`initialize` + `workspace/symbol` + `shutdown`/`exit`): exit code 0, both
|
||||
requests answered, the package declared in the chain found in the index, and
|
||||
@@ -314,7 +314,7 @@ work log above.
|
||||
|
||||
**Gates after the fix.** `cargo fmt --all -- --check` clean, `cargo clippy
|
||||
--all-targets` silent, `cargo test --workspace` green — 1008 tests (one new
|
||||
regression test), `vfmt_core` at 69 unit tests.
|
||||
regression test), `lucisv_core` at 69 unit tests.
|
||||
|
||||
## QA log
|
||||
|
||||
@@ -323,8 +323,8 @@ regression test), `vfmt_core` at 69 unit tests.
|
||||
**Verification of the dev's claims.** `cargo fmt --all -- --check` clean,
|
||||
`cargo clippy --all-targets --workspace` silent, `cargo test --workspace`
|
||||
green — 1007 tests, matching the Work log's count exactly. Built
|
||||
`target/debug/vfmt-server` and `target/release/vfmt-server` and ran `node
|
||||
editors/vscode/smoke.js target/debug/vfmt-server` — OK. `node --check` on
|
||||
`target/debug/lucisv-server` and `target/release/lucisv-server` and ran `node
|
||||
editors/vscode/smoke.js target/debug/lucisv-server` — OK. `node --check` on
|
||||
`editors/vscode/extension.js` and `smoke.js`, and `package.json` parses as
|
||||
JSON. Read `filelist.rs`, the `config.rs` diff, `state.rs`, `server.rs` and
|
||||
`settings.rs` in full; every claim in the Handshakes/Status sections checks
|
||||
@@ -336,11 +336,11 @@ in any changed file (`grep` over the diffs and over `filelist.rs`), no
|
||||
comments (`Filelist`, `read`, the new `FileConfig::filelist`,
|
||||
`ClientSettings::filelist`, `Workspace::has_roots`, etc.).
|
||||
|
||||
**Adversarial testing.** Built a throwaway `vfmt_core` example (`cargo run -p
|
||||
vfmt_core --example <probe>`, deleted afterwards — not committed) to drive
|
||||
**Adversarial testing.** Built a throwaway `lucisv_core` example (`cargo run -p
|
||||
lucisv_core --example <probe>`, deleted afterwards — not committed) to drive
|
||||
`filelist::read` directly, plus a small Node script driving the real
|
||||
`vfmt-server` binary over stdio the way `smoke.js` does, against a
|
||||
`vfmt.toml`-configured filelist. Tried: a filelist that `-f`s itself, two
|
||||
`lucisv-server` binary over stdio the way `smoke.js` does, against a
|
||||
`lucisv.toml`-configured filelist. Tried: a filelist that `-f`s itself, two
|
||||
filelists that `-f` each other, `-f` with no argument, a bare `+define+`
|
||||
line, `+define+N=a=b`, an unterminated `${VAR`, CRLF line endings, a path
|
||||
naming a directory, an empty filelist, a path containing a space, a `$` alone
|
||||
@@ -376,8 +376,8 @@ ones. A straight chain of uniquely-named filelists, each `-f`-ing the next
|
||||
aborting` (SIGABRT) once it's deep enough:
|
||||
- `filelist::read` alone: overflows around 1500–3000 levels in a debug
|
||||
build, and somewhere between 10 000 and 30 000 in `--release`.
|
||||
- The **real `target/release/vfmt-server` binary**, given a workspace
|
||||
whose `vfmt.toml` names such a filelist, crashes the same way on
|
||||
- The **real `target/release/lucisv-server` binary**, given a workspace
|
||||
whose `lucisv.toml` names such a filelist, crashes the same way on
|
||||
`initialize` (confirmed via a raw stdio LSP session): `closed: code=null
|
||||
signal=SIGABRT`. This takes down the whole language-server process for
|
||||
every open file, not just a diagnostic on one buffer.
|
||||
@@ -404,7 +404,7 @@ aborting` (SIGABRT) once it's deep enough:
|
||||
|
||||
**Finding 2 (Low) — no quoting, so a path containing a space cannot be
|
||||
listed.** The tokenizer is `raw.split_whitespace()`
|
||||
(`crates/vfmt_core/src/filelist.rs:76`); a filelist line like `sp ace/file.sv`
|
||||
(`crates/lucisv_core/src/filelist.rs:76`); a filelist line like `sp ace/file.sv`
|
||||
splits into two tokens and neither resolves, producing two spurious
|
||||
"no such file" warnings instead of one correct entry. Real EDA tools vary
|
||||
here (some support `"quoted paths"`, some don't support spaces at all), so
|
||||
@@ -441,7 +441,7 @@ worklist) to `Reader::nested`/`Reader::filelist` before this ships, with a
|
||||
masked-corruption-style regression test pinning that a filelist nested
|
||||
past the guard still returns a usable `Filelist` with a warning rather than
|
||||
aborting — and re-run the same deep-chain probe against the real
|
||||
`vfmt-server` binary as part of that fix's verification, since that's where
|
||||
`lucisv-server` binary as part of that fix's verification, since that's where
|
||||
the failure is actually user-visible.
|
||||
|
||||
## Review
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
## Goal
|
||||
|
||||
Make a repeat `vfmt` run over an unchanged tree do (almost) no work.
|
||||
Make a repeat `lucisv` run over an unchanged tree do (almost) no work.
|
||||
`TODO.md` §3's content-hash cache item: remember, per file, that *this
|
||||
exact content, under these settings, on this vfmt version* was already
|
||||
exact content, under these settings, on this lucisv version* was already
|
||||
formatted, and skip the whole read-parse-format-verify pipeline on the
|
||||
next run. Monorepo RTL trees are the case that matters — vfmt's per-file
|
||||
next run. Monorepo RTL trees are the case that matters — lucisv's per-file
|
||||
cost is dominated by parse + format + the two runtime safety checks
|
||||
(equivalence and convergence), all of which are pure functions of
|
||||
`(content, config)`, so a cache hit is exactly as trustworthy as the run
|
||||
@@ -24,29 +24,29 @@ what they would have been anyway (modulo one extra summary segment).
|
||||
true (a formatter that reads the file's *name*, or another file), this
|
||||
cache silently goes wrong and the assumption must be revisited here.
|
||||
- **`line-length` and `indent` are the whole config surface.** They are
|
||||
the only two things `vfmt_core::config::FileConfig` can put into
|
||||
the only two things `lucisv_core::config::FileConfig` can put into
|
||||
`vlog_formatter::Config`. The key stores the *resolved values*, not the
|
||||
config file's path or mtime — so moving a `vfmt.toml` around, or
|
||||
config file's path or mtime — so moving a `lucisv.toml` around, or
|
||||
switching from a file to an equivalent `--line-length` flag, correctly
|
||||
does **not** invalidate anything, while a real value change does.
|
||||
`exclude` is not part of the key: it changes *which* files are visited,
|
||||
never how one is formatted.
|
||||
- **The version string is the workspace version** (`env!("CARGO_PKG_VERSION")`
|
||||
read inside `vfmt_core`, whose `version.workspace = true` makes it the
|
||||
read inside `lucisv_core`, whose `version.workspace = true` makes it the
|
||||
same string for every crate here). This is a coarse proxy for "the
|
||||
formatter's behavior": two builds of the same version with different
|
||||
code — a `cargo build` in the middle of development — share a version
|
||||
and therefore share cache entries. **Developers of vfmt itself should
|
||||
and therefore share cache entries. **Developers of lucisv itself should
|
||||
use `--no-cache`** (the test suite does); released binaries are fine.
|
||||
- **Paths are keys, byte-for-byte as processed.** No canonicalization, no
|
||||
symlink resolution (config discovery is lexical for the same reason).
|
||||
`vfmt .` and `vfmt /abs/path/to/tree` therefore do not share entries;
|
||||
`lucisv .` and `lucisv /abs/path/to/tree` therefore do not share entries;
|
||||
they just each build their own. A path that is not valid UTF-8, or that
|
||||
contains a tab or a newline, is never cached (it cannot be written to
|
||||
the line-based store) — those files are simply always re-formatted.
|
||||
- **The cache is not a lock.** Two vfmt processes may write it
|
||||
- **The cache is not a lock.** Two lucisv processes may write it
|
||||
concurrently; see "Concurrency".
|
||||
- **`vfmt check` (the linter) is not cached.** `--no-cache` /
|
||||
- **`lucisv check` (the linter) is not cached.** `--no-cache` /
|
||||
`--cache-dir` are accepted there and do nothing, so a wrapper script
|
||||
can pass them unconditionally. Lint results depend on the rule
|
||||
selection, the waiver comments and the fix mode; caching them is a
|
||||
@@ -56,7 +56,7 @@ what they would have been anyway (modulo one extra summary segment).
|
||||
|
||||
### The key
|
||||
|
||||
Per file: **(content hash, line-length, indent, vfmt version)**, keyed on
|
||||
Per file: **(content hash, line-length, indent, lucisv version)**, keyed on
|
||||
the file path.
|
||||
|
||||
- **Content hash: hand-rolled FNV-1a, 64-bit**, over the file's bytes
|
||||
@@ -69,12 +69,12 @@ the file path.
|
||||
stable within one version. FNV-1a is ~15 lines, has no dependency, and
|
||||
is byte-exactly specified. It is not cryptographic and does not need to
|
||||
be (see collision posture).
|
||||
- Hashing costs one pass over bytes vfmt has already read into memory;
|
||||
- Hashing costs one pass over bytes lucisv has already read into memory;
|
||||
it is noise next to parsing.
|
||||
|
||||
### Collision posture (stated honestly)
|
||||
|
||||
A 64-bit content hash means a collision could make vfmt skip a file that
|
||||
A 64-bit content hash means a collision could make lucisv skip a file that
|
||||
actually changed — a wrong "clean" verdict, the only way this feature can
|
||||
produce a wrong result. Two things bound it:
|
||||
|
||||
@@ -90,9 +90,9 @@ produce a wrong result. Two things bound it:
|
||||
|
||||
It is *not* collision-resistant against an adversary who can choose the
|
||||
file contents: FNV-1a is trivially invertible, so someone able to write
|
||||
files in your tree can craft two files with the same hash and make vfmt
|
||||
files in your tree can craft two files with the same hash and make lucisv
|
||||
skip the second. That threat model (an attacker with write access to your
|
||||
source tree, trying to get past a formatter) is not one vfmt defends
|
||||
source tree, trying to get past a formatter) is not one lucisv defends
|
||||
against; `--no-cache` removes the cache from the picture entirely if it
|
||||
ever matters. This is documented rather than fixed because the fix (a
|
||||
cryptographic hash) is a dependency or ~200 lines of SHA-256 for a threat
|
||||
@@ -118,13 +118,13 @@ the hash of **the bytes that were written** goes in.
|
||||
| Miss, in-place write failed (I/O) | — | **nothing** | error, exit 2 |
|
||||
| Parse error / failed safety check / contained panic | — | **nothing** | error, exit 2 |
|
||||
| `--stdout` | cache off for the run | nothing | printed |
|
||||
| stdin (`vfmt -`) | never | never | as before |
|
||||
| stdin (`lucisv -`) | never | never | as before |
|
||||
|
||||
Why "would reformat" and errors are never cached: the fix for both is
|
||||
**external** to vfmt. A dirty file gets fixed by an editor or by
|
||||
`vfmt` without `--check`; a parse error gets fixed by editing the source
|
||||
**external** to lucisv. A dirty file gets fixed by an editor or by
|
||||
`lucisv` without `--check`; a parse error gets fixed by editing the source
|
||||
or by teaching the parser new syntax. If either verdict were cached, a CI
|
||||
`vfmt --check` would keep reporting a stale complaint (or, worse, stop
|
||||
`lucisv --check` would keep reporting a stale complaint (or, worse, stop
|
||||
reporting a real one) until someone thought to clear the cache. Caching
|
||||
only the fixed-point verdict also means the cache can never *invent* work
|
||||
or *suppress* a diagnostic: the worst a stale, wrong or missing entry can
|
||||
@@ -148,10 +148,10 @@ interesting characters. Lines are sorted by path, so the file is stable
|
||||
and diffable and two runs over the same tree produce byte-identical
|
||||
cache files.
|
||||
|
||||
**No serde, no TOML, no JSON.** `vfmt` and `vfmt_core` have exactly one
|
||||
third-party dependency between them (`rayon`, in `vfmt`). `serde` exists
|
||||
in the workspace only because `vfmt_server` needs it for LSP wire
|
||||
messages — `vfmt`/`vfmt_core` do not depend on it, and taking it here
|
||||
**No serde, no TOML, no JSON.** `lucisv` and `lucisv_core` have exactly one
|
||||
third-party dependency between them (`rayon`, in `lucisv`). `serde` exists
|
||||
in the workspace only because `lucisv_server` needs it for LSP wire
|
||||
messages — `lucisv`/`lucisv_core` do not depend on it, and taking it here
|
||||
would put a proc-macro build step into the CLI's dependency graph to
|
||||
encode five fields. Five fields on a line need no schema; CLAUDE.md's
|
||||
"standard library first" says so.
|
||||
@@ -165,8 +165,8 @@ Loading, corruption and staleness:
|
||||
starts empty. A file we cannot fully parse is not a file we can prove
|
||||
we wrote; partial trust is not worth the branch.
|
||||
- A well-formed line whose *version* is not this binary's is dropped
|
||||
silently (that is not corruption, just another vfmt's entry). It is not
|
||||
carried forward on write, so alternating between two vfmt versions
|
||||
silently (that is not corruption, just another lucisv's entry). It is not
|
||||
carried forward on write, so alternating between two lucisv versions
|
||||
rebuilds the cache each time.
|
||||
- **Writing is atomic**: the new text goes to `<cache-dir>/cache.<pid>.tmp`
|
||||
and is `rename`d over `cache`. A reader therefore sees the old file or
|
||||
@@ -183,7 +183,7 @@ Loading, corruption and staleness:
|
||||
|
||||
The cache directory gets a self-ignoring `.gitignore` containing `*`
|
||||
written into it when it is created, the same trick cargo uses for
|
||||
`target/`; `/.vfmt_cache` is also listed in this repo's root
|
||||
`target/`; `/.lucisv_cache` is also listed in this repo's root
|
||||
`.gitignore`.
|
||||
|
||||
### Flags
|
||||
@@ -191,16 +191,16 @@ written into it when it is created, the same trick cargo uses for
|
||||
| Flag | Meaning |
|
||||
|---|---|
|
||||
| `--no-cache` | do not read and do not write the cache. Nothing is created on disk |
|
||||
| `--cache-dir <PATH>` | use this directory instead of `.vfmt_cache` |
|
||||
| `--cache-dir <PATH>` | use this directory instead of `.lucisv_cache` |
|
||||
|
||||
**Where the default lives: the current directory.** `.vfmt_cache` is
|
||||
**Where the default lives: the current directory.** `.lucisv_cache` is
|
||||
resolved relative to the cwd, not to the input paths and not to the
|
||||
config file's directory. This is wrong for the multi-project invocation
|
||||
(`vfmt ~/a/rtl ~/b/rtl` from a third directory writes one cache in that
|
||||
(`lucisv ~/a/rtl ~/b/rtl` from a third directory writes one cache in that
|
||||
third directory, and running the same command from elsewhere starts a new
|
||||
one), and it is what ruff did for years before growing a per-project
|
||||
resolution. The honest v1 rule is "one cwd, one cache", which is exactly
|
||||
right for the overwhelmingly common `cd repo && vfmt --check .` in CI and
|
||||
right for the overwhelmingly common `cd repo && lucisv --check .` in CI and
|
||||
in a pre-commit hook, and `--cache-dir` covers everything else. Making
|
||||
the default follow the config-file root is the natural next step and is
|
||||
deliberately not guessed at here.
|
||||
@@ -230,7 +230,7 @@ is only mutated in the serial loop afterwards; the file is written once,
|
||||
single-threaded, at the end of the run. There is no lock and no shared
|
||||
mutable state.
|
||||
|
||||
Two vfmt processes running at once: last writer wins the `rename`, so one
|
||||
Two lucisv processes running at once: last writer wins the `rename`, so one
|
||||
process's entries can be lost. That is self-healing and safe:
|
||||
|
||||
- An entry only ever asserts *content that this process verified*, so a
|
||||
@@ -255,18 +255,18 @@ the only writer of an entry is the code path that just observed
|
||||
re-tested with the cache on.
|
||||
- **Consumes `docs/features/config-discovery/README.md`'s promise** that
|
||||
the cache key "must include the resolved per-file settings … not just
|
||||
file content + vfmt version". Done, with the *values*
|
||||
file content + lucisv version". Done, with the *values*
|
||||
(`Config::max_width`, `Config::indent_width`) rather than the config
|
||||
file's identity, so two trees governed by different `vfmt.toml` files
|
||||
file's identity, so two trees governed by different `lucisv.toml` files
|
||||
that happen to say the same thing share entries correctly.
|
||||
- **Consumes `vlog_formatter::Config`** read-only, for its two fields.
|
||||
Nothing in `vlog_parser` / `vlog_formatter` / `vlog_linter` was
|
||||
touched.
|
||||
- **Where the module lives: `vfmt_core::cache`,** next to `config` and
|
||||
`walk`. `vfmt_core` is by its own doc comment "the parts of vfmt that
|
||||
- **Where the module lives: `lucisv_core::cache`,** next to `config` and
|
||||
`walk`. `lucisv_core` is by its own doc comment "the parts of lucisv that
|
||||
decide *which* files are processed and *with what settings*", and "this
|
||||
file is already formatted, skip it" is the third member of that family.
|
||||
It also keeps the door open for `vfmt_server`: a language server that
|
||||
It also keeps the door open for `lucisv_server`: a language server that
|
||||
wanted to avoid re-formatting an unedited buffer on save would want the
|
||||
same predicate, and would otherwise have to duplicate the file format.
|
||||
Nothing in the module is CLI-specific — it takes paths, `u64`s and two
|
||||
@@ -276,7 +276,7 @@ the only writer of an entry is the code path that just observed
|
||||
or every user with a warm cache keeps their old formatting on files
|
||||
that did not otherwise change. This is the same discipline ruff and
|
||||
black need. Within-version development builds must use `--no-cache`.
|
||||
- **Promises to `crates/vfmt/tests/cli.rs`:** the shared `run` helper
|
||||
- **Promises to `crates/lucisv/tests/cli.rs`:** the shared `run` helper
|
||||
appends `--no-cache`, so the pre-existing tests keep running with the
|
||||
cache out of the picture (they share one cwd — the crate root — and
|
||||
would otherwise share one cache directory *and* pollute the repo with
|
||||
@@ -285,13 +285,13 @@ the only writer of an entry is the code path that just observed
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `vfmt_core::cache`: FNV-1a `content_hash`, `Entry`, `Cache`
|
||||
- [x] `lucisv_core::cache`: FNV-1a `content_hash`, `Entry`, `Cache`
|
||||
(`load` / `disabled` / `is_clean` / `record` / `store`).
|
||||
- [x] Hand-rolled tab-separated store, sorted by path, atomic
|
||||
temp+rename write, self-ignoring `.gitignore` in the cache dir.
|
||||
- [x] Corrupt / unreadable / wrong-version entries ignored, never fatal.
|
||||
- [x] `--no-cache` and `--cache-dir <PATH>` in `args.rs` and `--help`,
|
||||
accepted (and inert) for `vfmt check`.
|
||||
accepted (and inert) for `lucisv check`.
|
||||
- [x] Lookup at the top of `process_file`; entries collected through the
|
||||
indexed `par_iter` results and recorded serially in input order.
|
||||
- [x] Only clean verdicts recorded; `--check`/`--diff`/errors/`--stdout`
|
||||
@@ -299,7 +299,7 @@ the only writer of an entry is the code path that just observed
|
||||
- [x] `N files from cache` summary segment.
|
||||
- [x] Unit tests in `cache.rs` (hash stability, round-trip, corruption,
|
||||
version filtering, pruning, atomicity of the rename).
|
||||
- [x] CLI tests in `crates/vfmt/tests/cli.rs` (warm run does no work,
|
||||
- [x] CLI tests in `crates/lucisv/tests/cli.rs` (warm run does no work,
|
||||
content change invalidates, indent change invalidates, wrong
|
||||
version ignored, `--no-cache`, corrupt file tolerated, `--check`
|
||||
exit codes, `--threads` determinism with a warm cache, default
|
||||
@@ -315,18 +315,18 @@ the only writer of an entry is the code path that just observed
|
||||
- Read CLAUDE.md, `TODO.md` §3, `docs/features/parallel-files/README.md`
|
||||
(whose Handshakes section pre-specifies where the lookup goes) and
|
||||
`docs/features/config-discovery/README.md` (whose Handshakes section
|
||||
pre-specifies the key), then all of `crates/vfmt/src` and
|
||||
`crates/vfmt_core/src`.
|
||||
pre-specifies the key), then all of `crates/lucisv/src` and
|
||||
`crates/lucisv_core/src`.
|
||||
|
||||
**Module placement.** `vfmt_core::cache`, reasoning in Handshakes. It
|
||||
costs nothing today (`vfmt` is the only caller) and keeps `vfmt_core`
|
||||
**Module placement.** `lucisv_core::cache`, reasoning in Handshakes. It
|
||||
costs nothing today (`lucisv` is the only caller) and keeps `lucisv_core`
|
||||
dependency-free — `Entry` carries two bare `usize`s rather than a
|
||||
`vlog_formatter::Config`, so the crate still has an empty
|
||||
`[dependencies]`.
|
||||
|
||||
**The store format.** Tab-separated, path last, sorted, one line per
|
||||
entry. Rejected alternatives: (a) `serde`+`serde_json` — real dependency
|
||||
for five fields, and `vfmt`/`vfmt_core` currently have one dependency
|
||||
for five fields, and `lucisv`/`lucisv_core` currently have one dependency
|
||||
total; (b) a binary format — unreadable when debugging exactly the kind
|
||||
of "why did it skip that file?" question a cache creates; (c) one file
|
||||
per cached path (ruff's older layout) — thousands of tiny files, and the
|
||||
@@ -347,14 +347,14 @@ forever in a tree where files get renamed.
|
||||
|
||||
**Test isolation.** Integration tests run with cwd = the crate
|
||||
directory, so a default-on cache would (a) create
|
||||
`crates/vfmt/.vfmt_cache/` in the working tree and (b) make tests
|
||||
`crates/lucisv/.lucisv_cache/` in the working tree and (b) make tests
|
||||
interfere: `thread_count_changes_nothing_but_speed` runs the same tree
|
||||
twice and compares stderr byte-for-byte, which a warm cache would change.
|
||||
The `run` helper therefore appends `--no-cache`, and the cache tests use
|
||||
a new `run_raw` with an explicit `--cache-dir` (or a set cwd for the
|
||||
default-location test). Recorded as a handshake so nobody removes it.
|
||||
|
||||
**Measured.** Release build, 10 logical cores, `vfmt --check` over the
|
||||
**Measured.** Release build, 10 logical cores, `lucisv --check` over the
|
||||
corpus, best of 10 runs (mean in the work log's raw numbers was within
|
||||
10 %). The corpus was formatted first, since a tree that is already
|
||||
clean is exactly the case the cache exists for; the "612 files" column
|
||||
@@ -394,7 +394,7 @@ correctness risk. Not taken.
|
||||
**Attacked before handing over** (release binary, outside the test
|
||||
suite; every one of these degrades quietly, none changes an exit code):
|
||||
|
||||
- **Eight vfmt processes at once** over the same 612-file tree and the
|
||||
- **Eight lucisv processes at once** over the same 612-file tree and the
|
||||
same cache directory: all eight exit 0, no leftover `*.tmp`, the
|
||||
resulting file has 612 well-formed lines (`awk -F'\t' 'NF!=5'` finds
|
||||
none), and the next run is `612 files from cache`. Last-writer-wins,
|
||||
@@ -412,7 +412,7 @@ suite; every one of these degrades quietly, none changes an exit code):
|
||||
as cached and exits 0, which is the proof that a hit skips the *whole*
|
||||
pipeline rather than doing the work and agreeing. That is now the CLI
|
||||
test `a_hit_skips_the_work_entirely`; the same trick with the wrong
|
||||
version stamp is `an_entry_from_another_vfmt_version_is_ignored`.
|
||||
version stamp is `an_entry_from_another_lucisv_version_is_ignored`.
|
||||
|
||||
**Blocked by the workspace, as parallel-files was.** A concurrent agent
|
||||
is mid-landing alignment inference in `vlog_formatter` (`align.rs` plus
|
||||
@@ -420,23 +420,23 @@ is mid-landing alignment inference in `vlog_formatter` (`align.rs` plus
|
||||
gates were therefore run in a scratchpad copy of the workspace with
|
||||
*only* their three crates reverted to `HEAD` (`git checkout --
|
||||
crates/vlog_{formatter,parser,semantic}`); my own files were copied in
|
||||
from the real tree. Nothing outside `crates/vfmt`, `crates/vfmt_core`,
|
||||
from the real tree. Nothing outside `crates/lucisv`, `crates/lucisv_core`,
|
||||
`docs/features/format-cache`, `README.md`, `TODO.md` and `.gitignore`
|
||||
was edited, and `cargo fmt` was run scoped (`-p vfmt -p vfmt_core`) so
|
||||
was edited, and `cargo fmt` was run scoped (`-p lucisv -p lucisv_core`) so
|
||||
no file of theirs was touched. Re-run everything on the merged tree once
|
||||
their work lands.
|
||||
|
||||
**Gates** (scratchpad tree, described above):
|
||||
|
||||
- `cargo test -p vfmt -p vfmt_core`: 28 unit (`vfmt`) + **63** CLI
|
||||
(`vfmt`) + **45** unit (`vfmt_core`), all green. New: 15 CLI tests, 14
|
||||
- `cargo test -p lucisv -p lucisv_core`: 28 unit (`lucisv`) + **63** CLI
|
||||
(`lucisv`) + **45** unit (`lucisv_core`), all green. New: 15 CLI tests, 14
|
||||
`cache.rs` unit tests, 1 `args.rs` test.
|
||||
- `cargo test --workspace`: green, no churn in any other crate's tests —
|
||||
this feature changes no formatter output.
|
||||
- `cargo clippy --workspace --all-targets`: silent.
|
||||
- `cargo fmt -p vfmt -p vfmt_core -- --check`: clean.
|
||||
- `cargo fmt -p lucisv -p lucisv_core -- --check`: clean.
|
||||
- No `Cargo.toml` / `Cargo.lock` change: no new dependency, and
|
||||
`vfmt_core` still has an empty `[dependencies]`.
|
||||
`lucisv_core` still has an empty `[dependencies]`.
|
||||
|
||||
## QA log
|
||||
|
||||
@@ -454,12 +454,12 @@ was reverted). All cargo commands below ran in that copy; the real tree
|
||||
was touched only to append this entry. No commit/push.
|
||||
|
||||
**Gates, reproduced from scratch in the copy:**
|
||||
- `cargo build -p vfmt -p vfmt_core --release` — clean.
|
||||
- `cargo test -p vfmt -p vfmt_core`: 28 (`vfmt` unit) + 63 (`cli.rs`) + 45
|
||||
(`vfmt_core` unit) = 136, all green, matching the claimed counts exactly.
|
||||
- `cargo build -p lucisv -p lucisv_core --release` — clean.
|
||||
- `cargo test -p lucisv -p lucisv_core`: 28 (`lucisv` unit) + 63 (`cli.rs`) + 45
|
||||
(`lucisv_core` unit) = 136, all green, matching the claimed counts exactly.
|
||||
- `cargo test --workspace`: every crate green, no churn elsewhere.
|
||||
- `cargo clippy --workspace --all-targets`: silent.
|
||||
- `cargo fmt -p vfmt -p vfmt_core -- --check`: clean.
|
||||
- `cargo fmt -p lucisv -p lucisv_core -- --check`: clean.
|
||||
- `git diff --stat HEAD -- Cargo.toml Cargo.lock crates/*/Cargo.toml`:
|
||||
empty — no dependency added, confirmed.
|
||||
|
||||
@@ -476,7 +476,7 @@ the corrupt-file/version unit tests, all passing). Confirmed by hand:
|
||||
- `--cache-dir` pointing at an existing plain file, and a `chmod 500`
|
||||
cache directory: both exit 0, run output unaffected, nothing written —
|
||||
matches "silent write failures."
|
||||
- 8 parallel `vfmt --check` processes over a shared 200-file tree and
|
||||
- 8 parallel `lucisv --check` processes over a shared 200-file tree and
|
||||
cache dir: all exit 0, zero `*.tmp` leftovers, exactly 200 well-formed
|
||||
lines afterward (`awk -F'\t' 'NF!=5'` empty), next run is a clean
|
||||
200-file hit.
|
||||
@@ -491,11 +491,11 @@ independent repro:
|
||||
file gives `would reformat: ...`/exit 1 on three consecutive `--check`
|
||||
runs, never "from cache" — the stale-CI-verdict failure mode does not
|
||||
occur.
|
||||
- `--stdout` never creates `.vfmt_cache` even with a warm entry present
|
||||
- `--stdout` never creates `.lucisv_cache` even with a warm entry present
|
||||
for the same file (prints every time, does not read or write the
|
||||
cache) — matches `cache_enabled() == !no_cache && !stdout` in
|
||||
`args.rs`.
|
||||
- `vfmt check <file> --no-cache --cache-dir X`: exits normally (lint
|
||||
- `lucisv check <file> --no-cache --cache-dir X`: exits normally (lint
|
||||
verdict, unrelated to formatting), creates no cache artifact under
|
||||
either name — accepted-but-inert confirmed.
|
||||
- `run_stdin` in `main.rs` never references `Cache` at all — stdin mode
|
||||
@@ -505,11 +505,11 @@ independent repro:
|
||||
chmod-000-after-caching repro below) proves the lookup happens before
|
||||
`format_contained` is ever called.
|
||||
|
||||
**Claim 3 (flags).** `--no-cache`: no `.vfmt_cache` appears for either a
|
||||
`vfmt <file>` or `vfmt --stdout <file>` run — checked directly with `ls`.
|
||||
**Claim 3 (flags).** `--no-cache`: no `.lucisv_cache` appears for either a
|
||||
`lucisv <file>` or `lucisv --stdout <file>` run — checked directly with `ls`.
|
||||
`--cache-dir`: exercised throughout. Default cwd-relative location and
|
||||
self-ignoring `.gitignore`: reproduced outside the test suite too
|
||||
(`vfmt --check .` from a fresh dir leaves exactly `.vfmt_cache/{cache,
|
||||
(`lucisv --check .` from a fresh dir leaves exactly `.lucisv_cache/{cache,
|
||||
.gitignore}`, the latter reading `*\n`). The README's own "Where the
|
||||
default lives" paragraph states the multi-root limitation honestly.
|
||||
|
||||
@@ -568,10 +568,10 @@ strictly warm < cold < `--no-cache` on every run observed.
|
||||
file that is actually dirty): the run trusts it and exits 0. This is
|
||||
exactly the collision/tamper posture the README's "Collision posture"
|
||||
section states outright — "an attacker with write access to your
|
||||
source tree ... is not one vfmt defends against" — so this is
|
||||
source tree ... is not one lucisv defends against" — so this is
|
||||
documentation matching behavior, not an undisclosed hole.
|
||||
- **Two directories with differently-formatted-but-equal-valued
|
||||
`vfmt.toml`** (`indent = 2` vs `indent = 2 # comment`), same
|
||||
`lucisv.toml`** (`indent = 2` vs `indent = 2 # comment`), same
|
||||
file path: still a hit — confirms the key is the resolved *value*, not
|
||||
the config file's text or identity.
|
||||
- **CRLF file**: never reaches a clean fixed point (always "would
|
||||
@@ -620,7 +620,7 @@ Points reviewed and accepted:
|
||||
small touch, right instinct. The whole-file-discard-on-any-malformed-
|
||||
line rule is the right paranoia for a value store.
|
||||
4. **Value-keyed config** (not config-file identity) means two
|
||||
differently-written-but-equal vfmt.tomls share hits — QA probed it.
|
||||
differently-written-but-equal lucisv.tomls share hits — QA probed it.
|
||||
The cwd-relative default cache location is the honest v1 limitation,
|
||||
stated.
|
||||
5. **Both agents' isolation discipline under the concurrent alignment
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
Let an author switch the formatter off for a stretch of code with
|
||||
`// verilog_format: off` … `// verilog_format: on` (Verible's spelling, plus a
|
||||
short `// vfmt: off` / `// vfmt: on` alias) and get those bytes back exactly
|
||||
short `// lucisv: off` / `// lucisv: on` alias) and get those bytes back exactly
|
||||
as they were written. Hand-aligned lookup tables, generated blocks, and
|
||||
column-aligned instance connections are the cases every RTL codebase has;
|
||||
without an escape hatch they are the reason a formatter never gets adopted.
|
||||
@@ -19,18 +19,18 @@ A fence is a **line comment** whose text, after stripping the leading `//` and
|
||||
trimming whitespace on both sides, is *exactly* one of:
|
||||
|
||||
```
|
||||
verilog_format: off vfmt: off
|
||||
verilog_format: on vfmt: on
|
||||
verilog_format: off lucisv: off
|
||||
verilog_format: on lucisv: on
|
||||
```
|
||||
|
||||
Consequences, all deliberate and all tested:
|
||||
|
||||
- `//verilog_format: off` (no space) and `// vfmt: on ` are fences —
|
||||
- `//verilog_format: off` (no space) and `// lucisv: on ` are fences —
|
||||
the text is trimmed. `// verilog_format:off` is **not** (no space after the
|
||||
colon; the match is exact, not fuzzy).
|
||||
- **A fence with trailing text is not a fence.** `// vfmt: off (for now)`
|
||||
- **A fence with trailing text is not a fence.** `// lucisv: off (for now)`
|
||||
formats as an ordinary comment. Rationale: the alternative — prefix
|
||||
matching — silently turns `// vfmt: off-by-one bug here` into a formatting
|
||||
matching — silently turns `// lucisv: off-by-one bug here` into a formatting
|
||||
switch, and a fence that fires by accident is worse than one that does not
|
||||
fire at all. If the author wants a note, it goes on its own line.
|
||||
- **Block comments are not fences.** `/* verilog_format: off */` is an
|
||||
@@ -40,7 +40,7 @@ Consequences, all deliberate and all tested:
|
||||
but whitespace, or another comment, before it on that line). A comment on
|
||||
the same line as preceding *code* is attached to that code as *trailing*
|
||||
trivia, and `Meta.trailing` is an `Option<String>` with no span — there is
|
||||
nothing to splice from. So `wire a; // vfmt: off` is an ordinary comment.
|
||||
nothing to splice from. So `wire a; // lucisv: off` is an ordinary comment.
|
||||
See Handshakes for the parser change that would lift this.
|
||||
- The alias and the long form are interchangeable: an `off` in either
|
||||
spelling is closed by an `on` in either spelling.
|
||||
@@ -143,11 +143,11 @@ either, so no stray blank lines appear where the region swallowed items.
|
||||
- **Before the region**: the usual item separator, blank-line-aware, driven
|
||||
by the `off` fence comment's own `blank_before` flag (which is also the
|
||||
item's, since a `Meta`'s `blank_before` is its first leading comment's).
|
||||
A blank line before `// vfmt: off` survives; two or more collapse to one,
|
||||
A blank line before `// lucisv: off` survives; two or more collapse to one,
|
||||
as everywhere else.
|
||||
- **First line of the region**: byte-exact, because the region starts at the
|
||||
line start, not at the `//`. The exception is a fence preceded on its own
|
||||
line by *another comment* (`/* a */ // vfmt: off`): there the region starts
|
||||
line by *another comment* (`/* a */ // lucisv: off`): there the region starts
|
||||
at the `//`, and the other comment is formatted onto the line above. Still
|
||||
idempotent — on the next pass the fence does start its line.
|
||||
- **Inside the region**: nothing is touched, trailing whitespace on interior
|
||||
@@ -272,7 +272,7 @@ after a line break or at the very start of the output, which is where the
|
||||
fact rather than a claim, and it is what makes the safety net green by
|
||||
construction instead of by argument.
|
||||
- **Chose exact-match fence text over prefix matching.** A prefix match makes
|
||||
`// vfmt: off-by-one` a formatting switch. Exact match's failure mode is a
|
||||
`// lucisv: off-by-one` a formatting switch. Exact match's failure mode is a
|
||||
fence that does not fire, which the author sees immediately in the diff.
|
||||
- **Fences are leading comments only, and only line comments.** The leading
|
||||
restriction is forced: `Meta.trailing` is an `Option<String>` and carries no
|
||||
@@ -336,7 +336,7 @@ after a line break or at the very start of the output, which is where the
|
||||
`HardLine` after each comment and then a `BlankLine` before the next.
|
||||
Reproduced on the pre-change binary; not touched here because fixing it
|
||||
churns snapshots.
|
||||
- Did not touch `crates/vlog_parser`, `crates/vfmt`, `verify.rs`, or
|
||||
- Did not touch `crates/vlog_parser`, `crates/lucisv`, `verify.rs`, or
|
||||
`tools/`. Did not run `git commit`/`git push`.
|
||||
|
||||
**Results:** `cargo test -p vlog_formatter` **53 passed** (was 42: +5 matcher
|
||||
@@ -355,7 +355,7 @@ baseline. No `.sv`/`.v` corpus file contains a fence comment (`grep -rl` over
|
||||
all 820: 0 hits; the only two `verilog_format` matches in the tree are a CI
|
||||
YAML comment and a Verible build script), so the feature is inert there, as
|
||||
expected. Corpus repos `git status --porcelain` clean apart from the
|
||||
pre-existing untracked `.vfmt-corpus-rev` stamps.
|
||||
pre-existing untracked `.lucisv-corpus-rev` stamps.
|
||||
|
||||
Files touched: `crates/vlog_formatter/src/fence.rs` (new),
|
||||
`crates/vlog_formatter/src/{lib,doc,printer,format}.rs`,
|
||||
@@ -380,7 +380,7 @@ identical).
|
||||
— 5 in `fence.rs` + 3 pre-existing in `printer.rs` — 1+4+6+2+32 across
|
||||
`cases.rs`/`deep_nesting.rs`/`fences.rs`/`fixtures.rs`/`verification.rs`).
|
||||
Matches the claimed 42→53.
|
||||
- `cargo test --workspace`: **194 passed, 0 failed** (40+21 in `vfmt`, 53 in
|
||||
- `cargo test --workspace`: **194 passed, 0 failed** (40+21 in `lucisv`, 53 in
|
||||
`vlog_formatter`, 49+19+12 in `vlog_parser` — the last three carry the
|
||||
concurrent error-recovery agent's work, not this feature's).
|
||||
- `cargo clippy -p vlog_formatter --all-targets`: 0 warnings.
|
||||
@@ -401,14 +401,14 @@ identical).
|
||||
- `tools/corpus_check.sh corpus`: 820 files, **0 verification errors, 0
|
||||
crashes**, TSV md5 `3fab114f4f00626b254259e9dafe0ed7` — **matches** the
|
||||
claimed baseline exactly (byte-identical results file). `grep -rl` for
|
||||
`verilog_format|vfmt:` across all `.sv/.v/.svh/.vh` in `corpus/`: **0
|
||||
`verilog_format|lucisv:` across all `.sv/.v/.svh/.vh` in `corpus/`: **0
|
||||
hits**, confirming the feature is inert on the corpus as claimed.
|
||||
|
||||
**Claim 1 (fence grammar) — PASS.** Direct `fence_of()` probes:
|
||||
`// vfmt: off ` (single trailing space) *is* a fence — correctly so, the
|
||||
`// lucisv: off ` (single trailing space) *is* a fence — correctly so, the
|
||||
grammar trims surrounding whitespace and only disqualifies non-whitespace
|
||||
trailing text; my first pass at this check used the wrong expectation and
|
||||
was self-corrected. `// VFMT: off` (case), `// vfmt: off` (inner double
|
||||
was self-corrected. `// LUCISV: off` (case), `// lucisv: off` (inner double
|
||||
space), `// verilog_format:off` (no space after colon) are all correctly
|
||||
rejected — matches the documented grammar exactly, no drift between prose
|
||||
and code. Block comments and same-line trailing comments confirmed inert
|
||||
@@ -541,7 +541,7 @@ zero region byte changes and zero new verification failures. Points
|
||||
reviewed and accepted:
|
||||
|
||||
1. **Exact-match fence grammar** (trailing text disqualifies, no-space
|
||||
`vfmt:off` disqualifies): strict grammars over lenient ones is the
|
||||
`lucisv:off` disqualifies): strict grammars over lenient ones is the
|
||||
config-discovery lesson applied again — a fence that half-matches
|
||||
silently doing nothing would be the worst outcome, and the current
|
||||
rule makes it at least predictable. Verible-compatible spelling plus
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## Goal
|
||||
|
||||
Fix the five confirmed formatter/parser bugs the case-tables and safety-net
|
||||
features found and parked. All five made `vfmt` refuse to write output (exit 2)
|
||||
features found and parked. All five made `lucisv` refuse to write output (exit 2)
|
||||
because the runtime safety net caught them as token loss, comment motion or
|
||||
non-convergence — so every one of them was a file the formatter could not
|
||||
format at all. Each fix lands with its parked `#SKIP` case turned into a live
|
||||
@@ -98,7 +98,7 @@ The five:
|
||||
- `Meta.trailing` is still a bare `String`: several trailing comments merge
|
||||
into one there, and it is printed verbatim on one line, so it needs no
|
||||
position.
|
||||
- Nothing outside `vlog_parser` / `vlog_formatter` was touched. `crates/vfmt`
|
||||
- Nothing outside `vlog_parser` / `vlog_formatter` was touched. `crates/lucisv`
|
||||
and the top-level `README.md` (another agent's scope) are untouched;
|
||||
`cargo fmt` was run and left those files byte-identical.
|
||||
|
||||
@@ -235,7 +235,7 @@ reader). `cargo clippy --all-targets` is now completely silent.
|
||||
**Verification.** Beyond the suite: a hand-written stress file combining all
|
||||
five constructs (labeled package/function/task/fork, a starred sensitivity
|
||||
list with a comment, a commented concatenation, a multi-instance declaration,
|
||||
an indented banner comment) formats cleanly, and `vfmt` on its own output is
|
||||
an indented banner comment) formats cleanly, and `lucisv` on its own output is
|
||||
byte-identical. Every bug's original repro from the two feature READMEs was
|
||||
re-run through the built CLI and now exits 0.
|
||||
|
||||
@@ -254,7 +254,7 @@ and all 4 `tests/fixtures/*.sv` files through 3 passes independently of
|
||||
scripts left at `/private/tmp/claude-501/-Users-guoliangchen-repo-verilogrustformatter/9ecac3b9-8a0e-4065-85de-23cc2a396bad/scratchpad/{stress,stress3.py,regress3.py}` for reference (outside the repo).
|
||||
|
||||
**Tool chain** (workspace root):
|
||||
- `cargo test --workspace`: **70/70 pass**, 0 failed (18 `vfmt` unit + 12
|
||||
- `cargo test --workspace`: **70/70 pass**, 0 failed (18 `lucisv` unit + 12
|
||||
`cli.rs` + 3 `vlog_formatter` unit + 1 `cases.rs` (covering all 200 cases
|
||||
internally) + 2 `fixtures.rs` + 19 `verification.rs` + 15 `vlog_parser`
|
||||
unit). Confirmed 200 cases / 0 `#SKIP` two ways: `grep -c '^====' ` per
|
||||
@@ -360,7 +360,7 @@ scripts left at `/private/tmp/claude-501/-Users-guoliangchen-repo-verilogrustfor
|
||||
third code path exists for either type.
|
||||
7. **200 cases / 0 `#SKIP` / green workspace / silent clippy / clean
|
||||
fmt / self-format-stable — PASS**, all independently reproduced above.
|
||||
Additionally ran vfmt-on-its-own-output beyond the work log's one
|
||||
Additionally ran lucisv-on-its-own-output beyond the work log's one
|
||||
hand-written file: **every one of the 200 committed cases' expected
|
||||
outputs plus all 4 real fixture files** (204 total) through 3 passes via
|
||||
`regress3.py` — 0 failures, 0 cases where pass1's output differs from
|
||||
@@ -399,7 +399,7 @@ scripts left at `/private/tmp/claude-501/-Users-guoliangchen-repo-verilogrustfor
|
||||
unchanged context, not new.
|
||||
- No new dependencies (`git diff` on all three `Cargo.toml` + `Cargo.lock`:
|
||||
empty). No `#[allow]` added anywhere. `TODO.md`, top-level `README.md`,
|
||||
and `crates/vfmt/` are all byte-identical to `HEAD` (`git diff --stat`
|
||||
and `crates/lucisv/` are all byte-identical to `HEAD` (`git diff --stat`
|
||||
empty for all three) — matches the Handshakes claim that nothing outside
|
||||
`vlog_parser`/`vlog_formatter` was touched.
|
||||
|
||||
@@ -408,7 +408,7 @@ scripts left at `/private/tmp/claude-501/-Users-guoliangchen-repo-verilogrustfor
|
||||
Specifically tried to break something that used to work. Constructed and
|
||||
fixed (after finding my own test-file bugs, not formatter bugs — `initial`
|
||||
inside a function, `always` inside a function, `fork` at package scope are
|
||||
all illegal Verilog, not vfmt defects) a combined-stress file
|
||||
all illegal Verilog, not lucisv defects) a combined-stress file
|
||||
(`12_combo_stress.sv`: banner comment + labeled package/function/nested
|
||||
begin + `@( /* c */ * )` + commented concatenation + multi-instance, all in
|
||||
one file) — 3-pass stable, matches the work log's own combined-stress claim.
|
||||
@@ -482,7 +482,7 @@ the exact 100/101-column multi-instance boundary, and mixed sensitivity-list
|
||||
spellings). The three documented remaining refusals all still refuse
|
||||
cleanly with an accurate error and leave the file byte-identical. CLAUDE.md
|
||||
compliance (no unwrap/expect/panic in library paths, no new deps, no
|
||||
un-explained `#[allow]`, TODO.md/README.md/`vfmt` untouched) all confirmed
|
||||
un-explained `#[allow]`, TODO.md/README.md/`lucisv` untouched) all confirmed
|
||||
by direct inspection, not just by trusting the work log's claims.
|
||||
|
||||
## Review
|
||||
|
||||
@@ -7,7 +7,7 @@ M11 of the refactoring plan (`docs/features/refactor/README.md`), TODO.md §8:
|
||||
|
||||
"Who instantiates this module?" and "what does this module instantiate?" are
|
||||
the two questions a hardware engineer asks about a design they did not write,
|
||||
and until now vfmt could answer neither without a grep. LSP already has the
|
||||
and until now lucisv could answer neither without a grep. LSP already has the
|
||||
shape for both: its call hierarchy is a graph of callers and callees, and a
|
||||
design's module hierarchy is that same graph under different names — the
|
||||
modules are the nodes and an instantiation is the call. So
|
||||
@@ -78,7 +78,7 @@ pair unrolls as far as the user keeps clicking.
|
||||
ever really built. This is not the same failure `inlay.rs` guards against:
|
||||
a hint draws one confident, potentially-wrong label, where a hierarchy edge
|
||||
is a fact about the *text* ("this instantiation exists, guarded"), and
|
||||
showing both is the honest answer to a question vfmt cannot resolve without
|
||||
showing both is the honest answer to a question lucisv cannot resolve without
|
||||
evaluating defines. Found in QA (2026-08-25); pinned by
|
||||
`hierarchy::tests::qa_ifdef_instantiation_both_arms_are_reported_undisclosed_in_the_readme`.
|
||||
|
||||
@@ -104,7 +104,7 @@ pair unrolls as far as the user keeps clicking.
|
||||
- **Consumes `crate::state::Workspace`** — `document`, `index`, `text_of`,
|
||||
`sources`. Nothing in `state.rs` was changed; the workspace stays immutable
|
||||
through all three handlers, and no cache was added.
|
||||
- **Promises `vfmt_server`** — `hierarchy::{prepare, incoming, outgoing}`
|
||||
- **Promises `lucisv_server`** — `hierarchy::{prepare, incoming, outgoing}`
|
||||
never panic, never return an item whose `selectionRange` is outside its
|
||||
`range`, and never return a `to`/`from` item for a module the workspace does
|
||||
not really declare.
|
||||
@@ -180,16 +180,16 @@ declared), and still not a hang, but the speed claim is a property of the
|
||||
Real single- or two-letter module names are not a corpus pattern seen so far;
|
||||
recorded here rather than in the backlog because it is a measurement, not a
|
||||
design gap. See `hierarchy::tests::qa_perf_worst_case_common_word_module_name`
|
||||
(`#[ignore]`d, run with `cargo test --release -p vfmt_server --bin
|
||||
vfmt-server qa_perf_worst_case -- --ignored --nocapture`).
|
||||
(`#[ignore]`d, run with `cargo test --release -p lucisv_server --bin
|
||||
lucisv-server qa_perf_worst_case -- --ignored --nocapture`).
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `crates/vfmt_server/src/instantiations.rs`: the shared walk, lifted out
|
||||
- [x] `crates/lucisv_server/src/instantiations.rs`: the shared walk, lifted out
|
||||
of `inlay.rs` with the enclosing declaration threaded through it
|
||||
- [x] `crates/vfmt_server/src/inlay.rs`: reads the shared walk, behavior
|
||||
- [x] `crates/lucisv_server/src/inlay.rs`: reads the shared walk, behavior
|
||||
unchanged (its own 34 tests re-run green untouched)
|
||||
- [x] `crates/vfmt_server/src/hierarchy.rs`: `prepare`, `incoming`, `outgoing`
|
||||
- [x] `crates/lucisv_server/src/hierarchy.rs`: `prepare`, `incoming`, `outgoing`
|
||||
- [x] `callHierarchyProvider` in `main.rs`; three dispatch arms in `server.rs`
|
||||
- [x] `prepare` on a declaration / on an instantiation / on anything else
|
||||
(`null`), including an instance name, a connected expression, a keyword,
|
||||
@@ -207,7 +207,7 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`).
|
||||
- [x] Cost measured over the 860-file corpus, with the I/O split out
|
||||
- [x] `cargo fmt --all -- --check`, `cargo clippy --all-targets`,
|
||||
`cargo test --workspace`, `editors/vscode/smoke.js`
|
||||
- [x] `docs/features/vfmt-server/README.md` capability table + work log
|
||||
- [x] `docs/features/lucisv-server/README.md` capability table + work log
|
||||
- [ ] Not done, backlog: an **instantiation edge table in `WorkspaceIndex`**,
|
||||
built with the index, which would make `incomingCalls` a map lookup and
|
||||
cost one extra tree walk per file at index time. Worth doing when
|
||||
@@ -221,7 +221,7 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`).
|
||||
|
||||
## Work log
|
||||
|
||||
- **2026-08-25 (dev)** — read `workspace-index`, `vfmt-server`,
|
||||
- **2026-08-25 (dev)** — read `workspace-index`, `lucisv-server`,
|
||||
`references-nav` and `inlay-hints` READMEs, then `nav.rs`, `inlay.rs` and
|
||||
`workspace.rs` before writing anything.
|
||||
|
||||
@@ -272,14 +272,14 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`).
|
||||
attribution has to get right — plus one test that both names are found
|
||||
however the nested form parses.
|
||||
|
||||
**Files touched.** New: `crates/vfmt_server/src/instantiations.rs`,
|
||||
`crates/vfmt_server/src/hierarchy.rs`, this README. Edited:
|
||||
`crates/vfmt_server/src/inlay.rs` (its private walk removed, the shared one
|
||||
called; no behavior change), `crates/vfmt_server/src/main.rs` (two module
|
||||
**Files touched.** New: `crates/lucisv_server/src/instantiations.rs`,
|
||||
`crates/lucisv_server/src/hierarchy.rs`, this README. Edited:
|
||||
`crates/lucisv_server/src/inlay.rs` (its private walk removed, the shared one
|
||||
called; no behavior change), `crates/lucisv_server/src/main.rs` (two module
|
||||
declarations, the capability, two tests),
|
||||
`crates/vfmt_server/src/server.rs` (three dispatch arms and their imports),
|
||||
`crates/vfmt_server/tests/e2e.rs` (one new test),
|
||||
`docs/features/vfmt-server/README.md` (capability table and work log).
|
||||
`crates/lucisv_server/src/server.rs` (three dispatch arms and their imports),
|
||||
`crates/lucisv_server/tests/e2e.rs` (one new test),
|
||||
`docs/features/lucisv-server/README.md` (capability table and work log).
|
||||
|
||||
**Not touched, deliberately:** `TODO.md` and the umbrella checklist in
|
||||
`docs/features/refactor/README.md` (the lead's, per the brief), `nav.rs`,
|
||||
@@ -289,7 +289,7 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`).
|
||||
zero warnings, `cargo test --workspace` green at **1463 passed, 0 failed**
|
||||
(1429 before; +34 = 25 in `hierarchy.rs`, 7 in `instantiations.rs`, 1 in
|
||||
`main.rs`, 1 e2e round trip). `node editors/vscode/smoke.js
|
||||
target/release/vfmt-server`: OK. No new dependencies. No commits.
|
||||
target/release/lucisv-server`: OK. No new dependencies. No commits.
|
||||
|
||||
## QA log
|
||||
|
||||
@@ -301,12 +301,12 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`).
|
||||
--workspace`, `cargo test --workspace` all clean before any QA change —
|
||||
**1463 passed, 0 failed**, matching the dev's number exactly (summed the
|
||||
per-crate `test result` lines by hand to be sure). `node
|
||||
editors/vscode/smoke.js target/release/vfmt-server` — OK, against a
|
||||
editors/vscode/smoke.js target/release/lucisv-server` — OK, against a
|
||||
freshly rebuilt release binary. Independently re-ran the dev's own corpus
|
||||
perf test in release: **25 callers, 63.7 ms** — same order as the claimed
|
||||
56 ms (normal run-to-run variance), same caller count.
|
||||
|
||||
**Factoring check.** `git diff HEAD -- crates/vfmt_server/src/inlay.rs`:
|
||||
**Factoring check.** `git diff HEAD -- crates/lucisv_server/src/inlay.rs`:
|
||||
the private `instantiations`/`walk`/`block` functions (previously at the
|
||||
bottom of the file) are deleted in full; the only other change is the call
|
||||
site (`instantiations(&doc.tree)` → `instantiations::sites(&doc.tree.items)`,
|
||||
@@ -336,7 +336,7 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`).
|
||||
file: `incoming(chk)` names `harness` as the caller, not `top`. This is
|
||||
the honest answer given the feature's own "instantiation is the call,
|
||||
enclosing module is the caller" assumption — `bind`'s *effect* targets
|
||||
`top`, but the *instantiation text* sits in `harness`, and vfmt only ever
|
||||
`top`, but the *instantiation text* sits in `harness`, and lucisv only ever
|
||||
reads text. Not a bug; not previously tested at this granularity (the
|
||||
dev's own bind test has target == owner, which cannot distinguish the
|
||||
two).
|
||||
@@ -353,7 +353,7 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`).
|
||||
parser does not evaluate `` `ifdef`` at the item level (confirmed
|
||||
against `vlog_parser::parser::parse_item_kind`; both arms become
|
||||
ordinary `Instantiation` items in source order). This is arguably the
|
||||
honest answer — vfmt cannot know which arm is live and showing both is
|
||||
honest answer — lucisv cannot know which arm is live and showing both is
|
||||
not a single wrong claim the way a mis-ordered inlay hint would be — but
|
||||
it was **undisclosed**: no Assumption, Handshake, or test mentioned
|
||||
`` `ifdef`` anywhere in this feature, despite `inlay-hints/README.md`
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## Goal
|
||||
|
||||
Make `` `include`` a real edge in the project graph instead of a comment the
|
||||
server walks past. M1 taught vfmt to read a filelist and recorded its
|
||||
server walks past. M1 taught lucisv to read a filelist and recorded its
|
||||
`+incdir+` directories; nothing consumed them, so an include line was dead
|
||||
text and a `` `define`` used in one file could only be answered with "here is
|
||||
every definition of that name in the workspace, good luck". This milestone
|
||||
@@ -11,7 +11,7 @@ builds the include graph once per index rebuild and spends it twice: an
|
||||
include line becomes clickable (`textDocument/documentLink` for the underline,
|
||||
`textDocument/definition` for F12 and `gd`), and hover on `` `NAME `` prefers
|
||||
the definition the hovered file actually *reaches* through its includes — the
|
||||
first thing vfmt has that can order two definitions of one macro name.
|
||||
first thing lucisv has that can order two definitions of one macro name.
|
||||
|
||||
## Assumptions
|
||||
|
||||
@@ -43,7 +43,7 @@ first thing vfmt has that can order two definitions of one macro name.
|
||||
region), and a `` `include`` that is not first on its line is missed. Both
|
||||
are rare and both fail in the harmless direction.
|
||||
- **An unresolvable include is silent.** No link, no location, no diagnostic.
|
||||
vfmt does not preprocess, and a project routinely builds with incdirs vfmt
|
||||
lucisv does not preprocess, and a project routinely builds with incdirs lucisv
|
||||
was never told about; underlining those lines in red would be wrong far
|
||||
more often than right.
|
||||
- **The graph is rebuilt whole with the index**, from the same source list, so
|
||||
@@ -76,14 +76,14 @@ first thing vfmt has that can order two definitions of one macro name.
|
||||
knows.
|
||||
- **Symlinks are not resolved.** Resolved paths are folded lexically
|
||||
(`.`/`..` removed) so they compare equal to the index's own spelling, the
|
||||
same lexical rule `vfmt_core::config::Discovery` and
|
||||
`vfmt_core::filelist` follow.
|
||||
same lexical rule `lucisv_core::config::Discovery` and
|
||||
`lucisv_core::filelist` follow.
|
||||
|
||||
## Handshakes
|
||||
|
||||
### Consumed
|
||||
|
||||
- `vfmt_core::filelist::Filelist::incdirs` — recorded since M1, used here for
|
||||
- `lucisv_core::filelist::Filelist::incdirs` — recorded since M1, used here for
|
||||
the first time. Resolved absolute and in filelist order, which is the order
|
||||
they are searched. **`state.rs` no longer drops them**: the scope ladder
|
||||
carries them alongside the file list (`Scope`/`Sources` in `state.rs`) and
|
||||
@@ -92,7 +92,7 @@ first thing vfmt has that can order two definitions of one macro name.
|
||||
- `vlog_semantic::WorkspaceIndex::find_define` — **unchanged**. It still
|
||||
returns every workspace definition, in file order, implying no resolution
|
||||
order. The include-graph precedence is an overlay applied in
|
||||
`vfmt_server::hover`, so no `vlog_semantic` change was needed at all and the
|
||||
`lucisv_server::hover`, so no `vlog_semantic` change was needed at all and the
|
||||
workspace-index contract is exactly what it was.
|
||||
- `vlog_parser` — nothing new. The line scan reads text; the lexer's
|
||||
treatment of `` `include`` (one `TokenKind::Directive` token carrying the
|
||||
@@ -101,20 +101,20 @@ first thing vfmt has that can order two definitions of one macro name.
|
||||
|
||||
### Promised
|
||||
|
||||
- `vfmt_server::includes::IncludeGraph` — `build`, `resolve` and `reachable`
|
||||
- `lucisv_server::includes::IncludeGraph` — `build`, `resolve` and `reachable`
|
||||
are the whole surface. `Workspace::includes()` hands the current one out.
|
||||
A default-constructed `Workspace` has an empty graph, which resolves
|
||||
nothing and reaches nothing; every caller must behave as it did before this
|
||||
feature when that is what it gets.
|
||||
- `vfmt_server::includes::scan` — the one include scanner. `documentLink`,
|
||||
- `lucisv_server::includes::scan` — the one include scanner. `documentLink`,
|
||||
`definition` and the graph build all go through it, so the three can never
|
||||
disagree about what an include line is.
|
||||
- **A third lexical `normalize`.** `includes.rs` carries its own copy of the
|
||||
`.`/`..` folding that `vfmt_core::filelist::Reader::normalize` and
|
||||
`vfmt_core::config::Discovery::absolute` already have (both private, both
|
||||
`.`/`..` folding that `lucisv_core::filelist::Reader::normalize` and
|
||||
`lucisv_core::config::Discovery::absolute` already have (both private, both
|
||||
on stateful structs). Two copies were deliberate duplication (filelist work
|
||||
log, 2026-08-24); three is the point at which extracting a
|
||||
`vfmt_core::path::normalize` and pointing all three at it becomes worth
|
||||
`lucisv_core::path::normalize` and pointing all three at it becomes worth
|
||||
doing. **Request for the lead**, not done here: it touches two modules
|
||||
outside this feature's scope.
|
||||
|
||||
@@ -132,14 +132,14 @@ The graph build is what this feature adds to every index rebuild. Measured
|
||||
|
||||
So roughly 2% of a rebuild that was already happening — a line scan per file
|
||||
plus one `is_file` per include. Pinned by an `#[ignore]`d probe
|
||||
(`cargo test --release -p vfmt_server --bin vfmt-server includes::tests::perf
|
||||
(`cargo test --release -p lucisv_server --bin lucisv-server includes::tests::perf
|
||||
-- --ignored --nocapture`), the same shape as `inlay.rs`'s: timing assertions
|
||||
in a shared runner are flaky, so it prints and asserts nothing but the
|
||||
corpus's presence.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `crates/vfmt_server/src/includes.rs`: `scan`, `Include`, `IncludeGraph`
|
||||
- [x] `crates/lucisv_server/src/includes.rs`: `scan`, `Include`, `IncludeGraph`
|
||||
(`build`/`resolve`/`reachable`), the two capability entry points.
|
||||
- [x] `+incdir+` plumbed from the filelist through `state.rs` to the graph,
|
||||
nested `-f` incdirs included and in order.
|
||||
@@ -164,7 +164,7 @@ corpus's presence.
|
||||
invisible.
|
||||
- [ ] **Not done, deliberately:** no completion of include paths, and no
|
||||
diagnostic for an include that resolves to nothing. Both are their own
|
||||
features, and the second one needs vfmt to be sure it knows every
|
||||
features, and the second one needs lucisv to be sure it knows every
|
||||
incdir — which it is not.
|
||||
|
||||
## Work log
|
||||
@@ -217,7 +217,7 @@ test), `hover.rs` (the narrowing overlay, six tests).
|
||||
**Verification.** `cargo fmt --all -- --check` clean; `cargo clippy
|
||||
--all-targets` silent; `cargo test --workspace` green — 1420 tests, 28 of them
|
||||
new (16 `includes`, 6 `hover`, 3 `state`, 1 `nav`, 1 `main`, 1 e2e session).
|
||||
`node editors/vscode/smoke.js target/debug/vfmt-server` OK. Perf measured as
|
||||
`node editors/vscode/smoke.js target/debug/lucisv-server` OK. Perf measured as
|
||||
above. No new dependency; no version bump.
|
||||
|
||||
### 2026-08-25 — dev agent, QA round 1 fixes
|
||||
@@ -227,7 +227,7 @@ reachable definition.** `IncludeGraph` now carries the in-scope file list it
|
||||
was built from — `known` (exact spellings) and `folded` (lower-cased spelling
|
||||
→ the one file that has it, or `None` when several do) — and every path
|
||||
`resolve` returns goes through `as_the_index_spells_it`
|
||||
(`crates/vfmt_server/src/includes.rs`). Exact match: unchanged. Exactly one
|
||||
(`crates/lucisv_server/src/includes.rs`). Exact match: unchanged. Exactly one
|
||||
case-insensitive match: the index's spelling is adopted, so the graph edge,
|
||||
the reachability comparison in `hover.rs` and the URI go-to-definition hands
|
||||
the editor all name the same file. Zero or several matches: the path as
|
||||
@@ -275,7 +275,7 @@ covering both delimiters and both keyword-prefix cases. Assumptions updated.
|
||||
--all-targets` silent, `cargo test --workspace` green — 1426 tests on macOS
|
||||
(1425 QA left, plus the one new test above; no test was removed, QA's two
|
||||
pinned ones were rewritten in place). `node
|
||||
editors/vscode/smoke.js target/debug/vfmt-server` OK. Perf probe re-run after
|
||||
editors/vscode/smoke.js target/debug/lucisv-server` OK. Perf probe re-run after
|
||||
the fix: ~6ms over the 860-file corpus.
|
||||
|
||||
## QA log
|
||||
@@ -285,8 +285,8 @@ the fix: ~6ms over the 860-file corpus.
|
||||
**Gates.** `cargo fmt --all -- --check` clean. `cargo clippy --all-targets`
|
||||
silent. `cargo test --workspace` green — re-ran repeatedly while adding the
|
||||
tests below; **1425** tests at the end (1420 the dev shipped + 5 added here).
|
||||
`node editors/vscode/smoke.js target/debug/vfmt-server` OK. Perf probe re-run:
|
||||
`cargo test --release -p vfmt_server --bin vfmt-server includes::tests::perf
|
||||
`node editors/vscode/smoke.js target/debug/lucisv-server` OK. Perf probe re-run:
|
||||
`cargo test --release -p lucisv_server --bin lucisv-server includes::tests::perf
|
||||
-- --ignored --nocapture` → **6.5ms** over the 860-file corpus (dev measured
|
||||
~6ms) — confirmed, order of magnitude and absolute number both hold.
|
||||
|
||||
@@ -332,7 +332,7 @@ there, just under the wrong-case key), leaving exactly one candidate. The
|
||||
overlay then does precisely what it is built to do with one candidate: shows
|
||||
it alone, with full confidence, never mentioning the other one exists.
|
||||
Reproduced and pinned as `hover::qa_findings::qa_a_case_mismatched_include_silently_drops_a_reachable_define`
|
||||
(`crates/vfmt_server/src/hover.rs`, gated `cfg(any(target_os = "macos",
|
||||
(`crates/lucisv_server/src/hover.rs`, gated `cfg(any(target_os = "macos",
|
||||
target_os = "windows"))` since the premise needs a case-insensitive default
|
||||
FS). The test asserts *today's* wrong output rather than the correct one, so
|
||||
the suite stays green — a fix must touch this test.
|
||||
@@ -387,7 +387,7 @@ No action required.
|
||||
- `hover::qa_findings::an_angled_include_narrows_hover_same_as_a_quoted_one` —
|
||||
the six hover narrowing tests the dev shipped only ever use the quoted
|
||||
form; the angled (`<sys>`) form narrows correctly too, now pinned.
|
||||
- `crates/vfmt_server/tests/e2e.rs::include_nav_round_trips_in_a_workspace_whose_directory_has_a_space` —
|
||||
- `crates/lucisv_server/tests/e2e.rs::include_nav_round_trips_in_a_workspace_whose_directory_has_a_space` —
|
||||
the one e2e session for this feature used a plain temp dir; every other
|
||||
e2e test in the file hand-rolls unencoded `file://` URIs, so a directory
|
||||
with a space had never gone over the wire for any feature, this one
|
||||
@@ -428,7 +428,7 @@ violation of the feature's central documented promise ("narrows, never
|
||||
widens, and only when it is sure") on the platform this shipped from, using
|
||||
an unremarkable real-world input (one file whose include-site spelling
|
||||
doesn't match its own filename's case — common when headers come from a
|
||||
vendor IP or a different OS's checkout). It should not corrupt anything vfmt
|
||||
vendor IP or a different OS's checkout). It should not corrupt anything lucisv
|
||||
formats (out of scope for the hard invariants in `CLAUDE.md`, which are about
|
||||
formatter output), but it is a silently-wrong LSP answer, not a
|
||||
conservatively-declined one, and that is exactly the failure mode this
|
||||
@@ -458,7 +458,7 @@ flipped to `includes::tests::a_missing_space_before_the_delimiter_is_still_an_in
|
||||
1426 the dev's rework landed at, plus 3 added in this round (below). Perf
|
||||
probe re-run: **6.3ms** over the 860-file corpus (dev claimed ~7ms; this
|
||||
machine has consistently measured 6-6.5ms across both rounds — same order of
|
||||
magnitude, no regression). `node editors/vscode/smoke.js target/debug/vfmt-server`
|
||||
magnitude, no regression). `node editors/vscode/smoke.js target/debug/lucisv-server`
|
||||
OK.
|
||||
|
||||
**Mechanism-level re-verification of Finding 1's fix.** Read
|
||||
@@ -497,13 +497,13 @@ round-1 writeup:**
|
||||
(`includes::qa_round2::a_case_mismatch_on_a_file_outside_the_graphs_scope_is_unchanged`).
|
||||
3. **The real binary, once, on a case-mismatched fixture.** Unit tests calling
|
||||
`resolve`/`hover` directly can't settle what URI an editor actually
|
||||
receives, so this drives `vfmt-server` over real stdio JSON-RPC — the same
|
||||
receives, so this drives `lucisv-server` over real stdio JSON-RPC — the same
|
||||
harness `e2e.rs` uses for every other capability. `top.sv` writes
|
||||
`` `include "defs.svh"``; the real (and indexed) file is `Defs.svh`.
|
||||
Confirmed both `documentLink`'s `target` and F12's `Location.uri` carry
|
||||
the capital-D URI, not the as-written lowercase one
|
||||
(`go_to_definition_lands_on_the_indexs_own_spelling_not_the_includes`,
|
||||
`crates/vfmt_server/tests/e2e.rs`, case-gated). This is the one check none
|
||||
`crates/lucisv_server/tests/e2e.rs`, case-gated). This is the one check none
|
||||
of the unit-level tests — the dev's or mine — could have caught a
|
||||
regression in: it is the only test that round-trips the URI through the
|
||||
actual wire encoding (`path_to_uri`) with a real spawned process on the
|
||||
@@ -521,7 +521,7 @@ round-1 writeup:**
|
||||
new test since it exercises the same `trim_start` call the dev's
|
||||
spaced-form tests already cover and no distinct code path is at risk.
|
||||
6. **Mutation check.** Temporarily reverted `as_the_index_spells_it` to
|
||||
`{ path }` (identity) in a scratch copy, re-ran the full `vfmt_server`
|
||||
`{ path }` (identity) in a scratch copy, re-ran the full `lucisv_server`
|
||||
unit suite: exactly two tests failed —
|
||||
`includes::tests::a_resolved_path_is_re_spelled_the_way_the_index_spells_it`
|
||||
and `hover::qa_findings::a_case_mismatched_include_still_counts_as_reachable`
|
||||
|
||||
@@ -9,7 +9,7 @@ An ordered connection list writes the *values* and leaves the *names* to the
|
||||
reader's memory: `u1 (clk, rst_n, data)` says nothing about which port each
|
||||
expression lands on, and getting that wrong is one of the classic ways to
|
||||
break a design without breaking the build. The module's own declaration knows,
|
||||
and vfmt's workspace index knows where that declaration lives, so
|
||||
and lucisv's workspace index knows where that declaration lives, so
|
||||
`textDocument/inlayHint` draws each port's name as a ghost label before the
|
||||
expression it belongs to — `clk:`, `rst_n:`, `data:` — and does the same for a
|
||||
positional `#( ... )` override against the module's parameters. Nothing is
|
||||
@@ -79,11 +79,11 @@ has no way to tell it is wrong.
|
||||
`Connections`, `OrderedConn`, `Connection`, and the generate-block nodes the
|
||||
walk descends through. Read-only; `Expr::span` is what a hint's position is
|
||||
computed from.
|
||||
- **Consumes `vfmt_server::state`** — `Workspace::document` for the buffer's
|
||||
- **Consumes `lucisv_server::state`** — `Workspace::document` for the buffer's
|
||||
tree, `Workspace::index`/`text_of` for the defining file, exactly as
|
||||
`signature.rs` does. Nothing in `state.rs` was changed: no cross-request
|
||||
cache was added, so the workspace stays immutable through this handler.
|
||||
- **Promises `vfmt_server`** — `inlay::inlay_hints` never panics, never
|
||||
- **Promises `lucisv_server`** — `inlay::inlay_hints` never panics, never
|
||||
returns a hint outside the requested range, and never returns a hint whose
|
||||
label is not a port or parameter name the module's declaration actually
|
||||
writes.
|
||||
@@ -162,7 +162,7 @@ buffer) that is not worth paying for today.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `crates/vfmt_server/src/inlay.rs`: `inlay_hints`, the ordered-list site
|
||||
- [x] `crates/lucisv_server/src/inlay.rs`: `inlay_hints`, the ordered-list site
|
||||
collection for both ports and parameters, the per-request `Plans` cache,
|
||||
the instantiation walk
|
||||
- [x] `inlayHintProvider` in `main.rs`, no `resolveProvider`; the dispatch arm
|
||||
@@ -180,7 +180,7 @@ buffer) that is not worth paying for today.
|
||||
and deleted
|
||||
- [x] `cargo fmt --all -- --check`, `cargo clippy --all-targets`,
|
||||
`cargo test --workspace`, `editors/vscode/smoke.js`
|
||||
- [x] `docs/features/vfmt-server/README.md` capability table + work log
|
||||
- [x] `docs/features/lucisv-server/README.md` capability table + work log
|
||||
- [ ] Not done, backlog: a cross-request plan cache keyed on the index
|
||||
generation (see *Cost*); type hints, value hints and any other hint kind
|
||||
(deliberately out of scope — this milestone is exactly the two).
|
||||
@@ -218,18 +218,18 @@ buffer) that is not worth paying for today.
|
||||
**A mixed parameter list is silent, which is a judgement call.** The brief
|
||||
says "mixed illegal lists → sane". Hinting the positional half of
|
||||
`#(8, .DEPTH(16))` was the alternative; it is exactly the case where the
|
||||
reader cannot tell whether the author meant the entries to shift, so vfmt
|
||||
reader cannot tell whether the author meant the entries to shift, so lucisv
|
||||
says nothing rather than something confident.
|
||||
|
||||
**`bind` is included.** `bind u_dut sub u_chk (a, b);` carries an ordinary
|
||||
instantiation, connection list and all, so the walk descends into it. One
|
||||
match arm; nothing else about `bind` is touched.
|
||||
|
||||
**Files touched.** New: `crates/vfmt_server/src/inlay.rs`, this README.
|
||||
Edited: `crates/vfmt_server/src/main.rs` (the module declaration, the
|
||||
capability, two tests), `crates/vfmt_server/src/server.rs` (one dispatch
|
||||
arm and its imports), `crates/vfmt_server/tests/e2e.rs` (one new test),
|
||||
`docs/features/vfmt-server/README.md` (capability table and work log).
|
||||
**Files touched.** New: `crates/lucisv_server/src/inlay.rs`, this README.
|
||||
Edited: `crates/lucisv_server/src/main.rs` (the module declaration, the
|
||||
capability, two tests), `crates/lucisv_server/src/server.rs` (one dispatch
|
||||
arm and its imports), `crates/lucisv_server/tests/e2e.rs` (one new test),
|
||||
`docs/features/lucisv-server/README.md` (capability table and work log).
|
||||
|
||||
**Not touched, deliberately:** `TODO.md`, the umbrella checklist in
|
||||
`docs/features/refactor/README.md`, `signature.rs`, `completion.rs`,
|
||||
@@ -243,7 +243,7 @@ buffer) that is not worth paying for today.
|
||||
binary: OK. No new dependencies. No commits.
|
||||
|
||||
- **2026-08-25 (dev, M11 hierarchy)** — the private instantiation walk at the
|
||||
bottom of `inlay.rs` moved to `crates/vfmt_server/src/instantiations.rs`, so
|
||||
bottom of `inlay.rs` moved to `crates/lucisv_server/src/instantiations.rs`, so
|
||||
the call hierarchy can read the same one instead of writing a second
|
||||
(`docs/features/hierarchy/README.md`). The lifted version threads the
|
||||
innermost enclosing module declaration through the recursion; `inlay_hints`
|
||||
@@ -264,7 +264,7 @@ buffer) that is not worth paying for today.
|
||||
**Gates.** `cargo fmt --all -- --check`, `cargo clippy --all-targets
|
||||
--workspace`, `cargo test --workspace` all clean before any QA change —
|
||||
**1358 passed, 0 failed**, matching the dev's number exactly. `node
|
||||
editors/vscode/smoke.js target/release/vfmt-server` — OK; confirmed the
|
||||
editors/vscode/smoke.js target/release/lucisv-server` — OK; confirmed the
|
||||
script's fixed capability list (`main.rs`'s check, mirrored in the smoke
|
||||
script) does not include `inlayHintProvider`, matching the disclosed,
|
||||
deliberate handshake gap.
|
||||
@@ -272,7 +272,7 @@ buffer) that is not worth paying for today.
|
||||
**Finding — HIGH, fixed.** A module whose port or parameter list carries
|
||||
`` `ifdef``/`` `else`` directives got hints built from
|
||||
`InstantiationPlan`'s **union of every arm**, which is a shape no single
|
||||
build configuration ever has. Repro: `crates/vfmt_server/src/inlay.rs`,
|
||||
build configuration ever has. Repro: `crates/lucisv_server/src/inlay.rs`,
|
||||
test `an_ifdef_carrying_declaration_gets_no_hints_rather_than_a_wrong_one`
|
||||
— `module sub (`ifdef CFG_A input logic a, `else input logic b, `endif
|
||||
input logic clk);` gives `plan.ports == [a, b, clk]` (verified directly
|
||||
@@ -286,7 +286,7 @@ buffer) that is not worth paying for today.
|
||||
all, despite `instantiation_plan` warning about exactly this
|
||||
(`plan.warnings`) and M4's own README treating the same directive shape as
|
||||
a first-class case worth a warning. `Plans::read`
|
||||
(`crates/vfmt_server/src/inlay.rs:192`) called
|
||||
(`crates/lucisv_server/src/inlay.rs:192`) called
|
||||
`vlog_refactor::instantiation_plan(...).ok()` and discarded `plan.warnings`
|
||||
without ever inspecting it. **Fix applied**: `Plans::read` now returns
|
||||
`None` when `plan.warnings` is non-empty, so a directive-carrying list is
|
||||
@@ -346,7 +346,7 @@ buffer) that is not worth paying for today.
|
||||
|
||||
**Perf.** Rebuilt a cheap harness (`inlay::tests::qa_perf`, `#[ignore]`d,
|
||||
not part of the default suite — run with `cargo test --release -p
|
||||
vfmt_server --bin vfmt-server qa_perf -- --ignored --nocapture`) rather
|
||||
lucisv_server --bin lucisv-server qa_perf -- --ignored --nocapture`) rather
|
||||
than driving the real binary over stdio, since the library call is what
|
||||
the dev's own numbers measure too:
|
||||
- 40 distinct ~90-line ordered modules, one 40-line screen, 840 hints:
|
||||
|
||||
@@ -7,7 +7,7 @@ Ghost text that finishes a block as you open it. Type `if (` and grey
|
||||
inserted with the cursor inside the parens, a second Tab jumping to the
|
||||
indented body line. Type `begin` at the end of a line and the matching
|
||||
`end` appears the same way. This is LSP 3.18's
|
||||
`textDocument/inlineCompletion`, served by `vfmt-server` and opted into by
|
||||
`textDocument/inlineCompletion`, served by `lucisv-server` and opted into by
|
||||
the VS Code extension. It is the completion-templates tier without the
|
||||
completion widget: the same skeletons, offered at the moment the user has
|
||||
already committed to the construct, so accepting one costs a single key.
|
||||
@@ -40,11 +40,11 @@ constructs an RTL designer opens all day. See *The triggers* below.
|
||||
- **The snippet is indented relative to the trigger line, and the editor
|
||||
supplies the rest.** One `\t` per indent step, no `base` — see *The
|
||||
indentation contract* below for the VS Code source this is read off, and
|
||||
for what it costs. Consequence worth naming twice: **`vfmt.indent` does
|
||||
for what it costs. Consequence worth naming twice: **`lucisv.indent` does
|
||||
not decide the width of an accepted ghost snippet.** The editor's own
|
||||
`editor.tabSize`/`editor.insertSpaces` do, because the editor rewrites
|
||||
the leading whitespace of every inserted line whatever the server sent.
|
||||
`vfmt.inlineTemplates`'s setting description says so.
|
||||
`lucisv.inlineTemplates`'s setting description says so.
|
||||
- **There is no position gate**, unlike the completion tier's
|
||||
`at_statement` / `at_item`. Having just typed `if (` or `begin` at the
|
||||
end of a line is already a far stronger signal than a two-letter prefix
|
||||
@@ -74,7 +74,7 @@ constructs an RTL designer opens all day. See *The triggers* below.
|
||||
flop. Everything else answers with exactly one item, and that shape is
|
||||
pinned so a future trigger cannot quietly turn a single offer into a
|
||||
menu.
|
||||
- **`vfmt.inlineTemplates` unset means on.** Every other `vfmt.*` setting
|
||||
- **`lucisv.inlineTemplates` unset means on.** Every other `lucisv.*` setting
|
||||
is "no opinion until a client says otherwise"; this one's absence
|
||||
resolves to `true`, which is what the VS Code default declares.
|
||||
|
||||
@@ -191,7 +191,7 @@ contract*.
|
||||
the completion tier already uses, read for the `for (` split and the
|
||||
`always_ff @(` refusal. Nothing in `templates.rs` changed for this.
|
||||
- `crate::settings::ClientSettings::inline_templates` — **new field**,
|
||||
`Option<bool>` from `vfmt.inlineTemplates`. Nothing else reads it;
|
||||
`Option<bool>` from `lucisv.inlineTemplates`. Nothing else reads it;
|
||||
`Workspace::set_client_settings` does not treat it as a scope change, so
|
||||
toggling it rebuilds no index. `ClientSettings::indent` is **no longer
|
||||
read here** (see *The indentation contract*).
|
||||
@@ -227,20 +227,20 @@ contract*.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `crates/vfmt_server/src/inline.rs`: the data-driven trigger table,
|
||||
- [x] `crates/lucisv_server/src/inline.rs`: the data-driven trigger table,
|
||||
detection over the token stream, the suppression check, the renderer
|
||||
and the hand-rolled wire types
|
||||
- [x] `if (` trigger (and `else if (`, which is the same two tokens)
|
||||
- [x] `begin` trigger
|
||||
- [x] Suppression: unclosed `(` for the paren trigger, `pairs.rs` says
|
||||
"this opener never closed" for the scope trigger
|
||||
- [x] `vfmt.inlineTemplates` in `settings.rs` and in the extension's
|
||||
- [x] `lucisv.inlineTemplates` in `settings.rs` and in the extension's
|
||||
`package.json`
|
||||
- [x] Capability in `main.rs`, dispatch in `server.rs`
|
||||
- [x] VS Code opt-in: `client.registerFeatures(ProposedFeatures.createAll(client))`
|
||||
- [x] `editors/nvim/README.md` note
|
||||
- [x] Unit tests: triggers, negatives, indentation, the serialized shape
|
||||
- [x] End-to-end test in `crates/vfmt_server/tests/e2e.rs`
|
||||
- [x] End-to-end test in `crates/lucisv_server/tests/e2e.rs`
|
||||
- [x] `cargo fmt` / `cargo clippy --all-targets` / `cargo test` green
|
||||
|
||||
### Round 2 — 2026-08-25
|
||||
@@ -264,8 +264,8 @@ contract*.
|
||||
- [x] Wire pins updated: `inline.rs` unit tests, `tests/e2e.rs` (including a
|
||||
new multi-item round trip and the popup's `insertTextMode`),
|
||||
`editors/vscode/smoke.js`.
|
||||
- [x] `vfmt.inlineTemplates`'s setting description names the new triggers and
|
||||
says the editor's indent settings, not `vfmt.indent`, size the result.
|
||||
- [x] `lucisv.inlineTemplates`'s setting description names the new triggers and
|
||||
says the editor's indent settings, not `lucisv.indent`, size the result.
|
||||
- [ ] Not done, deliberately: no `function`/`task` triggers — see *The
|
||||
triggers*.
|
||||
|
||||
@@ -393,7 +393,7 @@ indentation where twice a small number still looks plausible.
|
||||
that path: it fixes the snippet *and* the plain-text spelling with one
|
||||
field, it leaves `Template::render`'s single renderer for both spellings
|
||||
intact (`the_two_spellings_of_a_body_are_the_same_text` still holds), it
|
||||
keeps `vfmt.indent` meaningful for the popup, and it is the protocol saying
|
||||
keeps `lucisv.indent` meaningful for the popup, and it is the protocol saying
|
||||
what we mean — "this text is already positioned" — rather than a guess
|
||||
about what the client will do. The same field went on the module-instantiation
|
||||
skeleton (`completion.rs`'s `item`), which is laid out by the same `Layout`
|
||||
@@ -403,8 +403,8 @@ indentation where twice a small number still looks plausible.
|
||||
caller.
|
||||
|
||||
**Consequence, documented in three places** (Assumptions here, the
|
||||
`vfmt.inlineTemplates` setting description, the module doc comment):
|
||||
`vfmt.indent` no longer sizes an accepted ghost snippet. The editor does.
|
||||
`lucisv.inlineTemplates` setting description, the module doc comment):
|
||||
`lucisv.indent` no longer sizes an accepted ghost snippet. The editor does.
|
||||
That is more correct — it matches whatever the user's tab settings are — but
|
||||
it is a visible behaviour change. The **preview** is now drawn one tab from
|
||||
column zero instead of at its final column, since no adjustment runs before
|
||||
@@ -457,7 +457,7 @@ in a list.
|
||||
|
||||
**Gates:** `cargo fmt --all -- --check` clean; `cargo clippy --all-targets
|
||||
--workspace` zero warnings; `cargo test --workspace` 1633 passed / 0 failed /
|
||||
4 ignored (up from 1614); `node editors/vscode/smoke.js target/debug/vfmt-server`
|
||||
4 ignored (up from 1614); `node editors/vscode/smoke.js target/debug/lucisv-server`
|
||||
→ `smoke: OK`; `node --check editors/vscode/smoke.js` and a `JSON.parse` of
|
||||
`package.json` both clean. No commit, no push.
|
||||
|
||||
@@ -478,7 +478,7 @@ under adversarial input except for one true-EOF edge case, fixed below.
|
||||
(up from the dev's 1607 — this log's new tests). Full tail at the bottom.
|
||||
- `node editors/vscode/smoke.js <path>`: OK against both a fresh debug and a
|
||||
fresh release build. **Caveat, not a code defect:** running it with no
|
||||
argument picks up whatever `vfmt-server` is on `$PATH` — on this machine an
|
||||
argument picks up whatever `lucisv-server` is on `$PATH` — on this machine an
|
||||
Aug-24 build predating this feature, which fails with `capability missing:
|
||||
inlineCompletionProvider`. Anyone re-running the dev's "smoke.js against
|
||||
debug and release" claim should pass the binary path explicitly, the way
|
||||
@@ -565,7 +565,7 @@ tried; results:
|
||||
confirmed by reading `inline.rs:130` (`doc.positions().offset(position)`).
|
||||
|
||||
**Finding 1 (fixed directly) — true-end-of-file trigger silently declined.**
|
||||
`crates/vfmt_server/src/inline.rs:159` (before fix):
|
||||
`crates/lucisv_server/src/inline.rs:159` (before fix):
|
||||
`doc.tokens.iter().rposition(|token| token.span.end <= offset)`. `tokenize`
|
||||
(`vlog_parser::lexer::tokenize`) appends a zero-width `Eof` sentinel token
|
||||
whose span starts *and* ends at `text.len()`. When the buffer's very last
|
||||
@@ -588,7 +588,7 @@ suite re-run clean after the fix (fmt/clippy/`cargo test --workspace`).
|
||||
|
||||
**Finding 2 (filed, not fixed — out of scope for this feature) — `pairs::analyze`
|
||||
is O(depth²) in nesting depth, and this feature is a new caller that hits it
|
||||
per keystroke.** `crates/vfmt_server/src/pairs.rs:157`:
|
||||
per keystroke.** `crates/lucisv_server/src/pairs.rs:157`:
|
||||
`let depth = stack.iter().filter(|f| is_rainbow(f.rule.open)).count() as u32;`
|
||||
runs once per opener *push*, scanning the whole current stack every time. For
|
||||
`n` consecutively nested rainbow openers (`begin`/`fork`) with none closed,
|
||||
@@ -606,13 +606,13 @@ for one request (isolated with `Instant` timers around `asking()` vs
|
||||
`pairs::analyze`).
|
||||
|
||||
This bug predates this feature and lives entirely in `pairs.rs`, which is not
|
||||
on this feature's file list (`crates/vfmt_server/src/pairs.rs` — CLAUDE.md
|
||||
on this feature's file list (`crates/lucisv_server/src/pairs.rs` — CLAUDE.md
|
||||
scope rule), so I have not touched it; `git diff --stat` confirms it is
|
||||
untouched by this change. What *is* this feature's business: `inline.rs`'s
|
||||
`Unclosed::Scope` gate (`inline.rs:190-198`) is a **new caller** of
|
||||
`pairs::analyze` that runs it fresh on every `textDocument/inlineCompletion`
|
||||
request — i.e., potentially every keystroke — where the existing callers
|
||||
(`documentHighlight`, the missing-closer diagnostic, `vfmt/scopePairs`) fire
|
||||
(`documentHighlight`, the missing-closer diagnostic, `lucisv/scopePairs`) fire
|
||||
on click, on save/open, and on hover respectively, all far less frequently.
|
||||
So this feature doesn't introduce the bug but does meaningfully raise its
|
||||
real-world exposure. Filed as a background task (see below) rather than
|
||||
@@ -632,7 +632,7 @@ construction (`layout_at` reads it from the buffer, not from a config
|
||||
value).
|
||||
|
||||
**Setting (item 5)** — unit-level was already covered
|
||||
(`the_setting_turns_the_whole_feature_off`), but every other `vfmt.*`
|
||||
(`the_setting_turns_the_whole_feature_off`), but every other `lucisv.*`
|
||||
setting's e2e coverage in `tests/e2e.rs` goes over the wire via
|
||||
`workspace/didChangeConfiguration`
|
||||
(`pushed_settings_reach_the_formatter_and_can_change_mid_session`,
|
||||
@@ -641,8 +641,8 @@ that. Added `the_inline_templates_setting_is_honoured_over_the_wire` to
|
||||
`tests/e2e.rs`: default-on with nothing pushed, `false` suppresses mid-session
|
||||
with no restart, `true` turns it back on — all over real
|
||||
`workspace/didChangeConfiguration` notifications against a spawned server.
|
||||
`package.json`'s `vfmt.inlineTemplates` (default `true`) and `settings.rs`'s
|
||||
`vfmt.get("inlineTemplates")` spell the same key.
|
||||
`package.json`'s `lucisv.inlineTemplates` (default `true`) and `settings.rs`'s
|
||||
`lucisv.get("inlineTemplates")` spell the same key.
|
||||
|
||||
**Capability / registration (item 6)** — see wire-contract section above;
|
||||
all confirmed by reading the vendored client source, not just by running the
|
||||
@@ -652,7 +652,7 @@ tests.
|
||||
against the stated file list: exact match
|
||||
(`Cargo.toml`, `completion.rs`, `main.rs`, `server.rs`, `settings.rs`,
|
||||
`tests/e2e.rs`, `editors/nvim/README.md`, `editors/vscode/{extension.js,
|
||||
package.json, smoke.js}`, new `crates/vfmt_server/src/inline.rs`, new
|
||||
package.json, smoke.js}`, new `crates/lucisv_server/src/inline.rs`, new
|
||||
`docs/features/inline-templates/`). `crates/vlog_formatter/` and
|
||||
`verify.rs` untouched — confirmed by their absence from the diff. (An
|
||||
unrelated `.DS_Store` sits untracked in the repo root; not this feature's
|
||||
@@ -664,10 +664,10 @@ checked every line of `inline.rs` above its `#[cfg(test)]` boundary and the
|
||||
|
||||
**What I changed**
|
||||
|
||||
- Fixed directly: `crates/vfmt_server/src/inline.rs` — `triggered` now
|
||||
- Fixed directly: `crates/lucisv_server/src/inline.rs` — `triggered` now
|
||||
excludes the lexer's `Eof` sentinel from the "last token ending at the
|
||||
cursor" scan (Finding 1).
|
||||
- Tests added, all in `crates/vfmt_server/src/inline.rs` unless noted:
|
||||
- Tests added, all in `crates/lucisv_server/src/inline.rs` unless noted:
|
||||
`a_trigger_at_the_true_end_of_file_still_offers_a_ghost`,
|
||||
`a_deeply_nested_file_neither_crashes_nor_misses_the_trigger`,
|
||||
`an_empty_file_at_zero_zero_offers_nothing_and_does_not_panic`,
|
||||
@@ -675,7 +675,7 @@ checked every line of `inline.rs` above its `#[cfg(test)]` boundary and the
|
||||
`crlf_line_endings_still_trigger_and_indent_correctly`,
|
||||
`no_space_between_the_keyword_and_the_paren_still_triggers`, and
|
||||
`the_inline_templates_setting_is_honoured_over_the_wire` in
|
||||
`crates/vfmt_server/tests/e2e.rs`.
|
||||
`crates/lucisv_server/tests/e2e.rs`.
|
||||
- Filed, not fixed (out of scope): a `spawn_task` chip for Finding 2
|
||||
(`pairs.rs:157`'s O(depth²) scan).
|
||||
- Nothing else touched. No commit, no push.
|
||||
@@ -710,9 +710,9 @@ asked for a wider net than the dev's own suite cast. No fix was needed.
|
||||
- `cargo test --workspace`: **1644 passed / 0 failed / 4 ignored** (up from
|
||||
the round-2 dev's 1633 — my 11 new tests, all in `inline.rs`; full tail
|
||||
below).
|
||||
- `cargo build -p vfmt_server && node editors/vscode/smoke.js
|
||||
target/debug/vfmt-server`: `smoke: OK`. Ran with the debug binary's
|
||||
explicit path, not a bare `vfmt-server`, for the reason round 1's QA log
|
||||
- `cargo build -p lucisv_server && node editors/vscode/smoke.js
|
||||
target/debug/lucisv-server`: `smoke: OK`. Ran with the debug binary's
|
||||
explicit path, not a bare `lucisv-server`, for the reason round 1's QA log
|
||||
already flagged (a stale `$PATH` binary predating this feature answers
|
||||
`capability missing`).
|
||||
- `node --check editors/vscode/smoke.js` and a `JSON.parse` of
|
||||
@@ -723,7 +723,7 @@ round exists for, so it got the most independent work: a *second*, from-source
|
||||
re-implementation of `TextModel.normalizeIndentation`/
|
||||
`normalizeIndentationFromWhitespace` and `SnippetSession.adjustWhitespace`
|
||||
(`normalize_indentation_from_whitespace`, `normalize_indentation`,
|
||||
`accepted_faithful` — `crates/vfmt_server/src/inline.rs:1108-1177`), built
|
||||
`accepted_faithful` — `crates/lucisv_server/src/inline.rs:1108-1177`), built
|
||||
straight from the quoted VS Code source rather than from the dev's `accepted()`
|
||||
shortcut, so a divergence in the shortcut would have somewhere independent to
|
||||
show up.
|
||||
@@ -799,7 +799,7 @@ against the `lsp-types` 0.97.0 source directly:
|
||||
Both `tests/e2e.rs` pins (`:1258` template item, `:1625` module skeleton)
|
||||
assert `insertTextMode == 1`, correctly. Confirmed `insert_text_mode` is set
|
||||
on exactly the two multi-line item builders
|
||||
(`grep -n "insert_text_mode" crates/vfmt_server/src/completion.rs` → two
|
||||
(`grep -n "insert_text_mode" crates/lucisv_server/src/completion.rs` → two
|
||||
hits) and that `Items::simple` — the keyword/word/index tiers' single-line
|
||||
items — builds with `..Default::default()`, leaving it `None`; no leak.
|
||||
Client capability path (`insertTextModeSupport` in the vendored
|
||||
@@ -823,15 +823,15 @@ commit is not part of this round's uncommitted diff (it is not — `git log`
|
||||
shows it landed before round 2 started).
|
||||
|
||||
**Item 6 — scope check.** `git diff --stat` against the claimed file list:
|
||||
exact match — `crates/vfmt_server/src/{inline.rs,completion.rs}`,
|
||||
`crates/vfmt_server/tests/e2e.rs`, `editors/vscode/{smoke.js,package.json}`,
|
||||
exact match — `crates/lucisv_server/src/{inline.rs,completion.rs}`,
|
||||
`crates/lucisv_server/tests/e2e.rs`, `editors/vscode/{smoke.js,package.json}`,
|
||||
and the two feature READMEs. `templates.rs` is untouched (absent from the
|
||||
diff), confirming the dev's "no new popup templates" claim structurally, not
|
||||
just by reading the work log. No `unwrap()`/`expect()`/`panic!` in
|
||||
non-test code: checked every `+` line of `completion.rs`'s diff and every
|
||||
line of `inline.rs` above its `#[cfg(test)]` boundary — none found. `Layout`
|
||||
removal from `inline.rs` left no dead code: `grep -n Layout
|
||||
crates/vfmt_server/src/inline.rs` — zero hits outside doc comments;
|
||||
crates/lucisv_server/src/inline.rs` — zero hits outside doc comments;
|
||||
`layout_at` is `fn` (private) in `completion.rs`, called only from within
|
||||
that same file (`completion.rs:211` and `:293`, both inside
|
||||
`completion.rs` itself), matching the "no second caller left" claim —
|
||||
@@ -843,7 +843,7 @@ either README.
|
||||
**What I changed**
|
||||
|
||||
- No fixes — nothing broken was found.
|
||||
- Tests added, all in `crates/vfmt_server/src/inline.rs`:
|
||||
- Tests added, all in `crates/lucisv_server/src/inline.rs`:
|
||||
`the_accepted_helper_matches_vscodes_own_algorithm_for_a_self_consistent_buffer`,
|
||||
`every_bodys_first_line_is_stable_under_normalization`,
|
||||
`every_bodys_closer_lands_level_with_the_trigger_and_its_interior_one_step_in`,
|
||||
@@ -870,7 +870,7 @@ test result: ok. 29 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fin
|
||||
|
||||
1644 passed / 0 failed / 4 ignored across the workspace (1633 + my 11).
|
||||
`cargo fmt --all -- --check` and `cargo clippy --all-targets --workspace`
|
||||
both clean. `node editors/vscode/smoke.js target/debug/vfmt-server` →
|
||||
both clean. `node editors/vscode/smoke.js target/debug/lucisv-server` →
|
||||
`smoke: OK`.
|
||||
|
||||
## Review
|
||||
@@ -902,7 +902,7 @@ both clean. `node editors/vscode/smoke.js target/debug/vfmt-server` →
|
||||
directly (`every_bodys_closer_lands_level_with_the_trigger_...`).
|
||||
- The asymmetric fix is right: relative `\t` bodies where the protocol has
|
||||
no opt-out (inline), `insertTextMode: asIs` where it does (popup), each
|
||||
documented as the sibling of the other. `vfmt.indent` no longer sizing
|
||||
documented as the sibling of the other. `lucisv.indent` no longer sizing
|
||||
ghost snippets is the correct trade and is stated in the setting text.
|
||||
- Trigger-table review: all twelve designer constructs check out; the two
|
||||
case-arm and case-gate deviations from the brief are both improvements
|
||||
|
||||
@@ -41,7 +41,7 @@ At the start of this round `interface` was the corpus's top blocker at
|
||||
not supported — a bare `import drive_task, check_task;` is. Neither
|
||||
prototype form occurs in the corpus.
|
||||
- A clocking skew is kept as **text as written** (`#2`, `#1step`,
|
||||
`negedge`), not as an expression: it is a delay or an edge and vfmt
|
||||
`negedge`), not as an expression: it is a delay or an edge and lucisv
|
||||
never re-lays-out either. The `#(min:typ:max)` skew spelling is not
|
||||
supported (0 corpus uses).
|
||||
- A clocking item's optional `= expression` (`input data = top.dut.d;`,
|
||||
@@ -81,7 +81,7 @@ Promised / changed for others:
|
||||
`Clocking(ClockingDecl)`. Minimal arms were added where the match had
|
||||
to stay exhaustive: `vlog_semantic::bind::bind_item` (both are opaque
|
||||
leaves) and `vlog_parser/tests/spans.rs`. `vlog_linter::visit`,
|
||||
`fence.rs`, `range.rs` and `vfmt_server` all have catch-all arms and
|
||||
`fence.rs`, `range.rs` and `lucisv_server` all have catch-all arms and
|
||||
needed no change.
|
||||
- **`clocking` and `endclocking` are now reserved words** (`token.rs`).
|
||||
A design that used either as an identifier would change meaning; no
|
||||
@@ -100,7 +100,7 @@ Requests to other owners (not done here):
|
||||
interface *instantiation* work today for free (an instantiation
|
||||
resolves its module name against the same index). Whether interfaces
|
||||
deserve their own `SymbolKind::Interface` — and with it
|
||||
`vfmt_server`'s `LspKind::INTERFACE` in `symbols.rs` instead of
|
||||
`lucisv_server`'s `LspKind::INTERFACE` in `symbols.rs` instead of
|
||||
`LspKind::CLASS` — is the semantic owner's call; it is a mechanical
|
||||
change across `model.rs`, `symbols.rs`, `hover.rs` and `workspace.rs`,
|
||||
which is why it is not made here. Likewise, a `modport` name and a
|
||||
@@ -185,7 +185,7 @@ Key decisions:
|
||||
code path. A case for the module spelling was added to lock that in.
|
||||
2. **`modport` port lists reuse `delimited_dangling`**, so they collapse
|
||||
onto one line when they fit and break one direction group per line
|
||||
when they do not — the same rule every other bracketed list in vfmt
|
||||
when they do not — the same rule every other bracketed list in lucisv
|
||||
follows. `interface STREAM_DV`'s three modports collapse; a 100-column
|
||||
one breaks.
|
||||
3. **Clocking blocks are parsed structurally**, not kept verbatim: the
|
||||
|
||||
@@ -66,7 +66,7 @@ belongs, and that the corpus loop bucketed into `macro-items` (18 files) and
|
||||
(`ExprKind::Call`). `docs/features/lexer-cleanup/README.md` established why:
|
||||
whether `(b)` is `` `A ``'s argument list or an independent parenthesized
|
||||
value depends on whether the macro was `` `define``d with formals (IEEE 1800
|
||||
§22.5.1), and that definition routinely lives in an `` `include``d file vfmt
|
||||
§22.5.1), and that definition routinely lives in an `` `include``d file lucisv
|
||||
never reads — `` `define NOT ~ `` plus `` `NOT (a) `` is the counterexample.
|
||||
At *item* position that ambiguity does not exist: neither reading is a legal
|
||||
item on its own, so accepting the invocation cannot take a valid parse away
|
||||
@@ -208,7 +208,7 @@ from — both are files arriving from my buckets, not regressions.)
|
||||
|
||||
*Shape 1, parser not lexer.* `docs/features/lexer-cleanup/README.md` assessed
|
||||
the lexer glue and parked it, correctly: in expression position the reading
|
||||
depends on a `` `define`` vfmt cannot see. That analysis is entirely about
|
||||
depends on a `` `define`` lucisv cannot see. That analysis is entirely about
|
||||
expression position, so the fix is the same predicate applied only where an
|
||||
item or a statement belongs. `Parser::at_spaced_macro_call` is deliberately a
|
||||
*separate* predicate from `at_macro_item` rather than a clause inside it,
|
||||
|
||||
@@ -9,8 +9,8 @@ lex because `(*` was unconditionally the start of an attribute (TODO §1);
|
||||
message (`unexpected character 'ï'` — one byte of the BOM's encoding,
|
||||
error-recovery QA log); (3) a non-ASCII character produced the same
|
||||
one-byte mojibake (`'Ã'` for `é`), and — the sneaky half — because the
|
||||
lexer is all-or-nothing, `vfmt check` on such a file reported *nothing*
|
||||
and exited 0 while `vfmt format` correctly refused (lint-rules-2 QA log).
|
||||
lexer is all-or-nothing, `lucisv check` on such a file reported *nothing*
|
||||
and exited 0 while `lucisv format` correctly refused (lint-rules-2 QA log).
|
||||
The fixes make the lexer's answers honest: real spellings lex, real errors
|
||||
name the actual character and position, and a file the linter could not
|
||||
tokenize is a loud per-file error instead of a silent pass.
|
||||
@@ -28,7 +28,7 @@ tokenize is a loud per-file error instead of a silent pass.
|
||||
- **A leading BOM is treated like leading whitespace and is not
|
||||
preserved.** The formatter's output starts at the first token, so
|
||||
formatting a BOM'd file drops the BOM — a deliberate normalization, the
|
||||
same one `vfmt_core`'s config parser already applies to `vfmt.toml`. A
|
||||
same one `lucisv_core`'s config parser already applies to `lucisv.toml`. A
|
||||
BOM anywhere else in the file stays a lex error, now with a message that
|
||||
names it (`byte order mark (U+FEFF) is only allowed at the start of the
|
||||
file`).
|
||||
@@ -42,8 +42,8 @@ tokenize is a loud per-file error instead of a silent pass.
|
||||
Verilog source`) instead of the first byte of its encoding. The decode
|
||||
is defensive (`from_utf8_lossy` over at most 4 bytes) even though
|
||||
`tokenize` takes `&str` and the cursor always sits on a char boundary.
|
||||
- **A lex error under `vfmt check` is a per-file error (exit 2), matching
|
||||
`vfmt format` on the same file** — the frozen exit-code contract's
|
||||
- **A lex error under `lucisv check` is a per-file error (exit 2), matching
|
||||
`lucisv format` on the same file** — the frozen exit-code contract's
|
||||
"error" class. Text-level findings (tabs, trailing whitespace, line
|
||||
length) are still reported for such a file, because those rules really
|
||||
did run; the error says the token- and AST-level rules saw nothing, so
|
||||
@@ -81,20 +81,20 @@ rule at all. Probed end to end: full format, format-twice fixed point, and
|
||||
`format_range` (verbatim splice starts at the first item's span, past the
|
||||
BOM) all converge.
|
||||
|
||||
**Changed in `vlog_linter::ParsedSource` (consumed by `vfmt check`):** a
|
||||
**Changed in `vlog_linter::ParsedSource` (consumed by `lucisv check`):** a
|
||||
new field + accessor, `lex_error() -> Option<&LexError>`, kept from the
|
||||
`tokenize` failure that previously vanished into the error-tree fallback.
|
||||
Additive: `vfmt_server` builds contexts via `from_parse` with its own
|
||||
Additive: `lucisv_server` builds contexts via `from_parse` with its own
|
||||
products and is untouched.
|
||||
|
||||
**Changed in `crates/vfmt/src/lint.rs`:** `run_rules` now also returns
|
||||
**Changed in `crates/lucisv/src/lint.rs`:** `run_rules` now also returns
|
||||
the rendered lex error; `check_one`/`check_stdin` put it in the report's
|
||||
`error` slot — the same slot unreadable files and panics use — so it
|
||||
prints `error: <path>: lex error: <line>:<col>: <message>` on stderr,
|
||||
counts into "N files could not be checked", and exits 2. Violations found
|
||||
by text rules on the same file are still printed.
|
||||
|
||||
**Requested of nobody.** The `vfmt_server` publishes lex errors through
|
||||
**Requested of nobody.** The `lucisv_server` publishes lex errors through
|
||||
its own diagnostics path already; no change needed there.
|
||||
|
||||
## The macro space-before-paren item: assessed, PARKED
|
||||
@@ -125,7 +125,7 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis:
|
||||
verbatim, internal spacing included, so under the hypothetical glue
|
||||
there is no text rewrite for the net to miss). The park does not rest
|
||||
on this argument — arguments 1, 2 and 4 carry it: the reading depends
|
||||
on a definition vfmt cannot see, a fixed answer is provably wrong for
|
||||
on a definition lucisv cannot see, a fixed answer is provably wrong for
|
||||
one population, and today's behavior fails safe.*
|
||||
4. **Today's behavior fails safe.** Item position: clean parse error
|
||||
(documented in macro-items). Expression position: the call parses, the
|
||||
@@ -152,9 +152,9 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis:
|
||||
the leading BOM and BOM'd sources joined `SOURCES`; mid-file BOM is
|
||||
a clear, named error.
|
||||
- [x] Non-ASCII lex error names the character and codepoint.
|
||||
- [x] `vfmt check` on a file that does not lex: exit 2, stderr error,
|
||||
- [x] `lucisv check` on a file that does not lex: exit 2, stderr error,
|
||||
"could not be checked" summary; text-rule findings still reported.
|
||||
(`ParsedSource::lex_error` + `crates/vfmt/src/lint.rs`.)
|
||||
(`ParsedSource::lex_error` + `crates/lucisv/src/lint.rs`.)
|
||||
- [x] BOM'd file through format AND check (CLI tests); non-ASCII file
|
||||
through both (CLI test pins the no-longer-silent behavior).
|
||||
- [x] Losslessness/spans suites green with the BOM decision; error-recovery
|
||||
@@ -169,7 +169,7 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis:
|
||||
|
||||
- Read CLAUDE.md, TODO §1, the error-recovery and lint-rules-2 QA logs,
|
||||
the macro-items Assumption, `lexer.rs`, `spans.rs`, `verify.rs`'s
|
||||
`@`-collapse, and `vfmt`'s check driver before touching code. Baseline:
|
||||
`@`-collapse, and `lucisv`'s check driver before touching code. Baseline:
|
||||
`cargo test --workspace` **791 passed**.
|
||||
- **Probed before designing** (scratchpad harness, deleted): `@( * )` and
|
||||
`@( *)` already lexed — only the adjacent-`(*` spellings (`@(* )`,
|
||||
@@ -183,7 +183,7 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis:
|
||||
the lookahead (`peek_at` returns 0) keeps the old "unterminated
|
||||
attribute" error.
|
||||
- **BOM: option (a) — accept it — chosen over erroring.** Consistency
|
||||
(`vfmt_core` already strips it from config files; editors add it
|
||||
(`lucisv_core` already strips it from config files; editors add it
|
||||
silently; the LSP will see such buffers constantly) beat strictness.
|
||||
The losslessness invariant stays meaningful: the gap rule now reads
|
||||
"whitespace, or the file's leading BOM" — one named exception, only
|
||||
@@ -198,7 +198,7 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis:
|
||||
over a synthetic violation. Reasons: it matches how check already
|
||||
reports unreadable files and panics (same `Report.error` slot, same
|
||||
stderr line shape, same "could not be checked" summary), it matches
|
||||
`vfmt format` on the same file (frozen contract: errors are exit 2),
|
||||
`lucisv format` on the same file (frozen contract: errors are exit 2),
|
||||
and a violation-shaped entry would imply a rule name and a waiver path
|
||||
that make no sense for "the file did not tokenize". The linter crate's
|
||||
only change is keeping the `LexError` it already caught
|
||||
@@ -217,21 +217,21 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis:
|
||||
scoped to the four crates this feature touches; `cargo test --workspace`
|
||||
is re-run at the end only if their tree compiles. Nothing in this
|
||||
feature's scope overlaps theirs.
|
||||
- Did not touch `verify.rs`, `vfmt_server`, `vlog_semantic`. Did not run
|
||||
- Did not touch `verify.rs`, `lucisv_server`, `vlog_semantic`. Did not run
|
||||
`git commit`/`git push`.
|
||||
|
||||
**Results:** `cargo test -p vlog_parser -p vlog_linter -p vlog_formatter
|
||||
-p vfmt`: **589 passed, 0 failed** (+11 tests: 7 lexer unit, 1
|
||||
-p lucisv`: **589 passed, 0 failed** (+11 tests: 7 lexer unit, 1
|
||||
error-recovery, 1 linter context, 2 CLI; plus 3 new spans sources and 6
|
||||
new `.cases` pairs inside existing tests). `cargo clippy -p vlog_parser
|
||||
-p vlog_linter -p vlog_formatter -p vfmt --all-targets` silent. `cargo
|
||||
-p vlog_linter -p vlog_formatter -p lucisv --all-targets` silent. `cargo
|
||||
fmt --check` clean on the same four crates. Corpus: 820 files, 77.6%
|
||||
formattable, 0 verification errors, 0 crashes, TSV byte-identical to the
|
||||
recorded baseline. Files touched: `crates/vlog_parser/src/lexer.rs`,
|
||||
`crates/vlog_parser/tests/{spans,error_recovery}.rs`,
|
||||
`crates/vlog_formatter/tests/cases/statements.cases`,
|
||||
`crates/vlog_linter/src/context.rs`, `crates/vfmt/src/lint.rs`,
|
||||
`crates/vfmt/tests/cli.rs`, `TODO.md` (§1 checkbox), two QA-log
|
||||
`crates/vlog_linter/src/context.rs`, `crates/lucisv/src/lint.rs`,
|
||||
`crates/lucisv/tests/cli.rs`, `TODO.md` (§1 checkbox), two QA-log
|
||||
annotations, this README.
|
||||
|
||||
## QA log
|
||||
@@ -239,18 +239,18 @@ annotations, this README.
|
||||
### 2026-08-20 — QA agent
|
||||
|
||||
Verified against the working tree (four-crate scope; the concurrent
|
||||
class-semantics work in `vlog_semantic`/`vfmt_server` was finished and
|
||||
class-semantics work in `vlog_semantic`/`lucisv_server` was finished and
|
||||
compiling by the end of the session, so the workspace gate was run too).
|
||||
All mutation experiments ran in a scratchpad copy of `crates/`; nothing
|
||||
outside this QA log was written.
|
||||
|
||||
**Gates (reproduced, not taken on trust)**
|
||||
|
||||
- `cargo test -p vlog_parser -p vlog_formatter -p vlog_linter -p vfmt`:
|
||||
- `cargo test -p vlog_parser -p vlog_formatter -p vlog_linter -p lucisv`:
|
||||
**589 passed, 0 failed** — exactly the dev's number.
|
||||
- `cargo test --workspace`: **825 passed, 0 failed** (class-semantics
|
||||
landed in between; recorded for the lead, not claimed for this feature).
|
||||
- `cargo clippy -p vlog_parser -p vlog_formatter -p vlog_linter -p vfmt
|
||||
- `cargo clippy -p vlog_parser -p vlog_formatter -p vlog_linter -p lucisv
|
||||
--all-targets` after touching the three changed sources to defeat the
|
||||
cache: **0 warnings, 0 errors**. `cargo fmt --check` on the same four:
|
||||
clean.
|
||||
@@ -379,9 +379,9 @@ outside this QA log was written.
|
||||
- `--output-format json`: stdout is still a single valid JSON array
|
||||
(parsed with `json.load`) containing only the real violations; the lex
|
||||
error goes to stderr and exit 2. See F5.
|
||||
- stdin: `vfmt check -` on non-lexing input → `error: <stdin>: lex error:
|
||||
- stdin: `lucisv check -` on non-lexing input → `error: <stdin>: lex error:
|
||||
…`, exit 2.
|
||||
- LSP spot-check (cheap, over stdio against `vfmt-server`): a BOM'd
|
||||
- LSP spot-check (cheap, over stdio against `lucisv-server`): a BOM'd
|
||||
document containing `élan` publishes the new decoded message with a
|
||||
sane range on the right line, alongside the `no-tabs` warning;
|
||||
`textDocument/formatting` on it returns `[]` (fail-safe, no edit), and
|
||||
@@ -457,13 +457,13 @@ attribute or on legal expression code, no BOM position skew.
|
||||
- **F3 (should-note, contract nuance).** `--lines`/`format_range` on a
|
||||
BOM'd file drops the BOM even when line 1 is not in any selected range
|
||||
(probed: `--lines 2-2` on a BOM'd file rewrote line 2 *and* removed the
|
||||
BOM). `vfmt --help`'s range-formatting text promises "emit every other
|
||||
BOM). `lucisv --help`'s range-formatting text promises "emit every other
|
||||
byte exactly as written"; the leading BOM is now an unstated exception.
|
||||
Nothing corrupts (converges, verifies, idempotent), but an LSP range
|
||||
format will return an edit touching offset 0. One sentence in the help
|
||||
text or in Assumptions would close it.
|
||||
- **F4 (info).** `vfmt check` prints `error: <path>: lex error: …`;
|
||||
`vfmt format` prints `<path>: lex error: …` (no `error: ` prefix). Each
|
||||
- **F4 (info).** `lucisv check` prints `error: <path>: lex error: …`;
|
||||
`lucisv format` prints `<path>: lex error: …` (no `error: ` prefix). Each
|
||||
is internally consistent with how that command reports its other
|
||||
per-file errors, and the exit class matches as the Assumptions claim —
|
||||
recorded only so the difference is not mistaken for a bug later.
|
||||
|
||||
@@ -20,7 +20,7 @@ a data file, zero Rust.
|
||||
report are the case's own and the source stays valid Verilog. The linter
|
||||
never interprets `//^` (verified: no rule or waiver grammar matches it).
|
||||
- **Markers carry the CLI's coordinates.** `<col>` is the 1-based column
|
||||
`vfmt check` prints (`LineIndex::line_col` of the violation's span start),
|
||||
`lucisv check` prints (`LineIndex::line_col` of the violation's span start),
|
||||
so a marker can be written by copying a diagnostic. A caret positioned
|
||||
*under* the span was rejected deliberately: tabs in the offending line are
|
||||
themselves test content, so visual caret alignment lies, and a `//`-prefixed
|
||||
@@ -35,9 +35,9 @@ a data file, zero Rust.
|
||||
still offers a Safe fix.** Violations without a fix (or with an Unsafe one)
|
||||
may survive — they are findings, not failures.
|
||||
- **Fences are out of the harness's scope.** `--fix` declining to edit inside
|
||||
`// vfmt: off` is `crates/vfmt/src/lint.rs`'s behavior, not
|
||||
`// lucisv: off` is `crates/lucisv/src/lint.rs`'s behavior, not
|
||||
`vlog_linter`'s; it stays tested by the CLI tests in
|
||||
`crates/vfmt/tests/cli.rs`.
|
||||
`crates/lucisv/tests/cli.rs`.
|
||||
- **Unsafe fixes are untested here because none exist.** When the first rule
|
||||
ships one, the fix loop needs an opt-in header (a `#unsafe-fixes` analog of
|
||||
`--unsafe-fixes`) — noted so it is a case-format extension, not a redesign.
|
||||
@@ -77,7 +77,7 @@ the case. Four headers are special:
|
||||
```
|
||||
#SKIP <why> known-bad case: must still fail; passing demands the marker's removal
|
||||
#path rtl/foo.sv lint the source as if read from this path (module-filename, wire-reg-mixup)
|
||||
#select a,b vfmt check --select semantics: replaces the default rule set
|
||||
#select a,b lucisv check --select semantics: replaces the default rule set
|
||||
#tolerant fix case whose input the formatter refuses; must be true (see below)
|
||||
```
|
||||
|
||||
@@ -240,7 +240,7 @@ are API tests, not case tests, per the migration rule.
|
||||
not run on these files": tabs in offending lines are content, so a
|
||||
visually-aligned caret lies under any tab width; and a `//`-prefixed line
|
||||
can never point at columns 1–2, where `no-tabs` — the highest-volume rule —
|
||||
fires. The column is the one `vfmt check` prints, so writing a marker is
|
||||
fires. The column is the one `lucisv check` prints, so writing a marker is
|
||||
copying the diagnostic.
|
||||
- **Columns were verified by the harness, not trusted**: all 76 cases'
|
||||
hand-computed columns passed on the first full run (the one failure in
|
||||
@@ -307,7 +307,7 @@ Counts re-derived from the files, all matching the table: 76 cases across 14
|
||||
case data, 547 LOC of harness, 523 LOC in the deleted `rules.rs` with 55
|
||||
`#[test]` fns.
|
||||
|
||||
**Claim 1 — markers carry `vfmt check`'s coordinates.** Verified by copying
|
||||
**Claim 1 — markers carry `lucisv check`'s coordinates.** Verified by copying
|
||||
five case bodies to disk and running the real CLI. Every marker column is the
|
||||
diagnostic's column, verbatim:
|
||||
|
||||
@@ -321,7 +321,7 @@ diagnostic's column, verbatim:
|
||||
The copy-the-diagnostic property holds. The caret-rejection reasoning also
|
||||
holds *empirically*, not just rhetorically — see the attacks below.
|
||||
|
||||
**Claim 2 — fix cases.** The loop is CLI-equivalent: `crates/vfmt/src/lint.rs`
|
||||
**Claim 2 — fix cases.** The loop is CLI-equivalent: `crates/lucisv/src/lint.rs`
|
||||
has `MAX_FIX_ROUNDS = 10` and the same fix→re-lint shape; the harness allows
|
||||
rounds 0..=9 (10 applications, same as the CLI) and *errors* on an 11th
|
||||
instead of silently stopping, which is the right strictness for a test. The
|
||||
@@ -421,7 +421,7 @@ is a workspace-internal path crate, dev-only, pulling in zero external code
|
||||
was. A workspace-internal dev-dep is a *test-wiring* decision, not a
|
||||
dependency decision, and I do not think it should be held to the same bar as
|
||||
an external runtime dep. The one alternative worth naming for the lead:
|
||||
the cross-tool assertion could have lived in `crates/vfmt`, which already
|
||||
the cross-tool assertion could have lived in `crates/lucisv`, which already
|
||||
depends on both — but that would have split the case format across two
|
||||
crates to avoid a dependency that costs nothing. The dev chose correctly.
|
||||
|
||||
@@ -513,7 +513,7 @@ the scratch test file deleted, `no_tabs.lint`, `lint_cases.rs` and
|
||||
## Review
|
||||
|
||||
**2026-08-20 — lead. Verdict: accepted and committed. The owner's final
|
||||
sequence item lands: writing a lint rule's tests is now copying vfmt's
|
||||
sequence item lands: writing a lint rule's tests is now copying lucisv's
|
||||
own diagnostics into a data file, and the harness polices itself.**
|
||||
|
||||
Points reviewed and accepted:
|
||||
|
||||
@@ -11,7 +11,7 @@ plus `wire-reg-mixup`, the SystemVerilog-ness decision the linter-core round
|
||||
parked; (3) `vlog_linter::rules_markdown()`, a rule reference generated from
|
||||
the registry so the docs cannot drift from the rules (Verible's
|
||||
`--generate_markdown`, ruff's generated rule pages). Everything slots into the
|
||||
existing registry, so `vfmt check`, `--select`/`--ignore` and `vfmt-server`'s
|
||||
existing registry, so `lucisv check`, `--select`/`--ignore` and `lucisv-server`'s
|
||||
diagnostics pick the new rules up with **zero wiring** — verified live, not
|
||||
assumed.
|
||||
|
||||
@@ -22,10 +22,10 @@ assumed.
|
||||
class localparams, class typedefs and class methods. Nothing about a rule
|
||||
is class-aware; the walk is what changed.
|
||||
- **Naming presets are fixed per rule this round.** Verible spells its
|
||||
conventions as RE2 patterns and lets you override them; vfmt spells the same
|
||||
conventions as RE2 patterns and lets you override them; lucisv spells the same
|
||||
conventions as character-class predicates (`src/naming.rs`) and does not
|
||||
let you override them yet. Per-rule style configuration needs the `lint`
|
||||
key in `vfmt.toml`, which is still parked (see Handshakes).
|
||||
key in `lucisv.toml`, which is still parked (see Handshakes).
|
||||
- **Escaped identifiers (`\my$name`) are exempt from every naming rule.**
|
||||
Their whole purpose is to carry characters no convention allows.
|
||||
- **A name's style is judged on ASCII.** A non-ASCII identifier fails
|
||||
@@ -34,7 +34,7 @@ assumed.
|
||||
practical population.
|
||||
- **`wire-reg-mixup` decides SystemVerilog-ness from the file extension
|
||||
alone** — `.sv`/`.svh`, compared case-insensitively. Not from content, not
|
||||
from a config key, and never for a buffer with no name: `vfmt check -`
|
||||
from a config key, and never for a buffer with no name: `lucisv check -`
|
||||
without `--stdin-filename` is silent. This is the whole SV-ness decision,
|
||||
deliberately: any content heuristic ("it uses `logic`, so it's SV") would
|
||||
make the rule's own subject its input.
|
||||
@@ -42,7 +42,7 @@ assumed.
|
||||
parse is still checked, and a `reg` inside a `constraint`/`covergroup`
|
||||
verbatim block is still seen. A `reg` inside a `` `define`` body is *not*:
|
||||
a directive is one `TokenKind::Directive` token and its body is never
|
||||
lexed as keywords. Consistent with vfmt's no-preprocessing stance.
|
||||
lexed as keywords. Consistent with lucisv's no-preprocessing stance.
|
||||
- **`rules_markdown()`'s "Fix" column is declarative metadata**
|
||||
(`Rule::fix()`), not derived from running the rules. A unit test probes the
|
||||
rules against a file that trips every fixable one and asserts the two
|
||||
@@ -68,28 +68,28 @@ assumed.
|
||||
`None`). Both have defaults, so an out-of-crate implementor of `Rule` — if
|
||||
there ever is one — is not broken by them.
|
||||
- `default_rules()` is no longer `all_rules()`: it filters on `default_on()`.
|
||||
Callers are unaffected (`crates/vfmt` calls `select_rules`,
|
||||
`crates/vfmt_server/src/lint.rs` calls `default_rules()`); both keep
|
||||
Callers are unaffected (`crates/lucisv` calls `select_rules`,
|
||||
`crates/lucisv_server/src/lint.rs` calls `default_rules()`); both keep
|
||||
compiling and keep meaning what they meant.
|
||||
- Rule *names* are stable API — they appear in users' waivers. The five new
|
||||
names are `enum-name-style`, `module-name-style`, `parameter-name-style`,
|
||||
`struct-union-name-style`, `wire-reg-mixup`. Four of the five are spelled
|
||||
exactly as Verible spells its equivalent, on purpose: a codebase already
|
||||
annotated `// verilog_lint: waive enum-name-style` is honored by vfmt
|
||||
annotated `// verilog_lint: waive enum-name-style` is honored by lucisv
|
||||
unedited.
|
||||
|
||||
**Requested of others (not done here)**
|
||||
|
||||
- *`crates/vfmt`'s owner (concurrent this round)*: a `vfmt check --rules-doc`
|
||||
- *`crates/lucisv`'s owner (concurrent this round)*: a `lucisv check --rules-doc`
|
||||
flag that prints `vlog_linter::rules_markdown()` to stdout and exits 0.
|
||||
One `println!`; no other wiring. Until then the same output is available as
|
||||
`cargo run -p vlog_linter --example rules_markdown`.
|
||||
- *config-discovery's owner*: the `lint` key in `vfmt.toml` is what
|
||||
- *config-discovery's owner*: the `lint` key in `lucisv.toml` is what
|
||||
per-rule naming-style configuration waits on — the shape wanted is
|
||||
`[lint.parameter-name-style] style = "CamelCase"` picking one of the named
|
||||
presets, not a regex. Restated from `linter-core`, unchanged.
|
||||
- No request to `vlog_formatter`, `vlog_semantic`, `vfmt_server` or
|
||||
`vfmt_core`; none of them was touched.
|
||||
- No request to `vlog_formatter`, `vlog_semantic`, `lucisv_server` or
|
||||
`lucisv_core`; none of them was touched.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
@@ -110,8 +110,8 @@ assumed.
|
||||
- [x] Violating/clean/waived/unused-waiver quartets for all five new rules;
|
||||
class-body coverage tests for all four original AST rules.
|
||||
- [x] Corpus baseline re-run, before/after per rule.
|
||||
- [ ] Per-rule style **configuration** — needs the `vfmt.toml` `lint` key.
|
||||
- [ ] `vfmt check --rules-doc` — `crates/vfmt`, handshake above.
|
||||
- [ ] Per-rule style **configuration** — needs the `lucisv.toml` `lint` key.
|
||||
- [ ] `lucisv check --rules-doc` — `crates/lucisv`, handshake above.
|
||||
- [ ] Parked naming rules, listed with their Verible names below.
|
||||
- [ ] External waiver files — untouched, still `linter-core`'s open item.
|
||||
|
||||
@@ -132,9 +132,9 @@ That check changed two decisions, both recorded honestly below.
|
||||
**`parameter-name-style`** — accepts `CamelCase` or `ALL_CAPS` for both
|
||||
`parameter` and `localparam`. Verible's defaults are `parameter_style:
|
||||
CamelCase|ALL_CAPS` and `localparam_style: CamelCase`, i.e. stricter for
|
||||
`localparam`. vfmt accepts the union for both, deliberately: matching
|
||||
`localparam`. lucisv accepts the union for both, deliberately: matching
|
||||
Verible's `localparam` default would flag `localparam int ADDR_W` — an
|
||||
overwhelmingly common spelling — in a rule that is on by default, and vfmt
|
||||
overwhelmingly common spelling — in a rule that is on by default, and lucisv
|
||||
has no per-rule config key yet to relax it with. When that key lands, the
|
||||
strict split is the natural first setting to offer. Covers item- and
|
||||
statement-level declarations and the `#( ... )` ports of module *and* class
|
||||
@@ -142,12 +142,12 @@ headers; `type` parameters are skipped (they name a type, which is Verible's
|
||||
separate `parameter-type-name-style`, parked).
|
||||
|
||||
**`enum-name-style`** — Verible's default pattern is literally
|
||||
`[a-z_0-9]+(_t|_e)`; vfmt checks `lower_snake_case` ending in `_e` or `_t`,
|
||||
`[a-z_0-9]+(_t|_e)`; lucisv checks `lower_snake_case` ending in `_e` or `_t`,
|
||||
the same shape. Only `typedef enum` is judged: an anonymous enum has no name,
|
||||
and *requiring* the typedef is Verible's separate `typedef-enums` (parked).
|
||||
|
||||
**`struct-union-name-style`** — Verible requires `lower_snake_case` ending in
|
||||
`_t` for `struct` and `union`; vfmt checks the same. Only `typedef struct` /
|
||||
`_t` for `struct` and `union`; lucisv checks the same. Only `typedef struct` /
|
||||
`typedef union`; requiring the typedef is Verible's `typedef-structs-unions`
|
||||
(parked).
|
||||
|
||||
@@ -155,11 +155,11 @@ and *requiring* the typedef is Verible's separate `typedef-enums` (parked).
|
||||
round's brief.** The brief said "snake_case default-on per Verible".
|
||||
Verible has **no `module-name-style` rule at all** — the documentation check
|
||||
above is explicit about it, and the nearest things it does have are
|
||||
`module-filename` (enabled by default, which vfmt already implements) and
|
||||
`module-filename` (enabled by default, which lucisv already implements) and
|
||||
`interface-name-style` for the sibling construct. The instruction for this
|
||||
round was to default a naming rule on *only* where Verible defaults its
|
||||
equivalent on, and there is no equivalent to inherit a default from, so the
|
||||
rule ships selectable but quiet: `vfmt check --select module-name-style`.
|
||||
rule ships selectable but quiet: `lucisv check --select module-name-style`.
|
||||
The rationale in `Rule::doc` cites the lowRISC/Google SystemVerilog style
|
||||
guide, which does require `lower_snake_case` for module names. Flipping it on
|
||||
is a one-line change (`fn default_on`) if the lead prefers the brief's
|
||||
@@ -203,7 +203,7 @@ anything useful to say about `i`.
|
||||
|
||||
## Why no regex dependency
|
||||
|
||||
Verible spells naming conventions as RE2 patterns. vfmt spells them as three
|
||||
Verible spells naming conventions as RE2 patterns. lucisv spells them as three
|
||||
character-class predicates in `src/naming.rs`, roughly 20 lines:
|
||||
|
||||
```
|
||||
@@ -320,11 +320,11 @@ Read honestly:
|
||||
markdown document — 139 lines today. Shape:
|
||||
|
||||
```markdown
|
||||
# vfmt lint rules
|
||||
# lucisv lint rules
|
||||
|
||||
Generated from the rule registry by `vlog_linter::rules_markdown` — do not edit by hand.
|
||||
|
||||
A rule marked **default** runs for a plain `vfmt check`; the others need `--select <name>`. ...
|
||||
A rule marked **default** runs for a plain `lucisv check`; the others need `--select <name>`. ...
|
||||
|
||||
| Rule | Default | Fix |
|
||||
|---|---|---|
|
||||
@@ -362,7 +362,7 @@ Three tests hold it:
|
||||
described in Assumptions.
|
||||
|
||||
`cargo run -p vlog_linter --example rules_markdown` prints it today; the
|
||||
`vfmt check --rules-doc` flag is filed as a handshake because `crates/vfmt`
|
||||
`lucisv check --rules-doc` flag is filed as a handshake because `crates/lucisv`
|
||||
belongs to a concurrent agent this round.
|
||||
|
||||
## Zero-wiring claim, verified
|
||||
@@ -370,17 +370,17 @@ belongs to a concurrent agent this round.
|
||||
The claim that a new rule needs no wiring outside the registry was checked by
|
||||
running the built binary, not by reading the code:
|
||||
|
||||
- `vfmt check corpus/` reports the four new default-on rules with no CLI
|
||||
- `lucisv check corpus/` reports the four new default-on rules with no CLI
|
||||
change (the table above is that run).
|
||||
- `vfmt check ... --select module-name-style` runs an off-by-default rule,
|
||||
- `lucisv check ... --select module-name-style` runs an off-by-default rule,
|
||||
and `--select wire-reg-mixup` an on-by-default one; both were used to
|
||||
produce numbers above.
|
||||
- `--ignore <new-rule>` and `// vfmt: waive <new-rule>` work by construction
|
||||
- `--ignore <new-rule>` and `// lucisv: waive <new-rule>` work by construction
|
||||
(they key on `rule_by_name`), and each new rule has a waiver test.
|
||||
- `crates/vfmt_server/src/lint.rs` was read **read-only**: it calls
|
||||
- `crates/lucisv_server/src/lint.rs` was read **read-only**: it calls
|
||||
`default_rules()` with no filtering of its own, so the four new default-on
|
||||
rules appear as editor diagnostics automatically, and `module-name-style`
|
||||
correctly does not. `cargo test -p vfmt_server` stays green.
|
||||
correctly does not. `cargo test -p lucisv_server` stays green.
|
||||
|
||||
## Work log
|
||||
|
||||
@@ -426,9 +426,9 @@ running the built binary, not by reading the code:
|
||||
`cargo fmt --check` diff, **both in `crates/vlog_formatter`** — the
|
||||
concurrent agent's churn, untouched here.
|
||||
- **Scope**: files changed are `crates/vlog_linter/**`, this README, and
|
||||
`TODO.md` §4 checkboxes. `crates/vfmt`, `vfmt_server`, `vlog_parser`,
|
||||
`vlog_formatter`, `vlog_semantic` and `vfmt_core` were not modified;
|
||||
`vfmt_server/src/lint.rs` was read only.
|
||||
`TODO.md` §4 checkboxes. `crates/lucisv`, `lucisv_server`, `vlog_parser`,
|
||||
`vlog_formatter`, `vlog_semantic` and `lucisv_core` were not modified;
|
||||
`lucisv_server/src/lint.rs` was read only.
|
||||
- **TODO.md §4**: checked the naming-rules item (with the "styles are fixed
|
||||
presets, configuration waits on the `lint` key" caveat spelled out) and the
|
||||
`--generate_markdown` item; checked the `wire`/`reg` sub-item of the seed
|
||||
@@ -439,9 +439,9 @@ running the built binary, not by reading the code:
|
||||
|
||||
### 2026-08-19 — QA
|
||||
|
||||
Scope: `-p vlog_linter` only, plus a read-only look at `crates/vfmt/src/lint.rs`
|
||||
and `crates/vfmt_server/src/lint.rs` for the wiring/fence claims. Did not touch
|
||||
`vlog_formatter`, `vfmt_server`, `vlog_parser` or `vlog_semantic` (concurrent
|
||||
Scope: `-p vlog_linter` only, plus a read-only look at `crates/lucisv/src/lint.rs`
|
||||
and `crates/lucisv_server/src/lint.rs` for the wiring/fence claims. Did not touch
|
||||
`vlog_formatter`, `lucisv_server`, `vlog_parser` or `vlog_semantic` (concurrent
|
||||
this round). All six claims verified; no corpus regression; no preset false
|
||||
positive/negative found. Two documentation-gap findings, no functional bugs.
|
||||
|
||||
@@ -473,7 +473,7 @@ Additionally probed live: `parameter-name-style` fires on a class header
|
||||
fires on a `case` inside a class method. **Pass.**
|
||||
|
||||
**Corpus** (claim 3) — reproduced deterministically.
|
||||
- After: built `vfmt --release` at the current working tree, ran `vfmt check
|
||||
- After: built `lucisv --release` at the current working tree, ran `lucisv check
|
||||
corpus/ --output-format json`. Total **7921**, 96 files, and the per-rule
|
||||
breakdown (no-tabs 7527/45, explicit-parameter-storage-type 183/51,
|
||||
no-trailing-whitespace 85/7, case-missing-default 65/21,
|
||||
@@ -498,15 +498,15 @@ fires on a `case` inside a class method. **Pass.**
|
||||
- Proven zero #1: extracted every `typedef enum ... name;` in the corpus's
|
||||
`.sv`/`.svh` with an independent regex scan (not the linter) — **166**
|
||||
names, **0** violate `[a-z_0-9]+(_t|_e)`. Matches the claimed 166/0 exactly.
|
||||
- Proven zero #2: `vfmt check corpus/picorv32/picorv32.v --select
|
||||
- Proven zero #2: `lucisv check corpus/picorv32/picorv32.v --select
|
||||
wire-reg-mixup` → 0. Copied the identical bytes to `picorv32.sv` in the
|
||||
scratchpad and re-ran → **209**. Matches exactly.
|
||||
- Claim 3: **pass**, every number reproduced independently and exactly, not
|
||||
just re-read from the README.
|
||||
|
||||
**Zero-wiring** (claim 4) — `vfmt check <file> --select nope` lists all
|
||||
**Zero-wiring** (claim 4) — `lucisv check <file> --select nope` lists all
|
||||
**13** known rules in its error, alphabetical, as `registry.rs`'s own test
|
||||
already pins. `crates/vfmt_server/src/lint.rs` read (not modified): both call
|
||||
already pins. `crates/lucisv_server/src/lint.rs` read (not modified): both call
|
||||
sites use `default_rules()` unfiltered, so the four new default-on rules and
|
||||
not `module-name-style` reach server diagnostics automatically, by
|
||||
construction. **Pass.**
|
||||
@@ -536,22 +536,22 @@ leading comment do **not** false-positive — confirmed live, not just by
|
||||
reading the token-kind filter. **Pass.**
|
||||
|
||||
**Attack probes — class-body coverage and the fence/waiver asymmetry**:
|
||||
`// vfmt: waive case-missing-default` inside a class method body suppresses
|
||||
the finding — confirmed live. The fence question (does `// vfmt: off` inside
|
||||
`// lucisv: waive case-missing-default` inside a class method body suppresses
|
||||
the finding — confirmed live. The fence question (does `// lucisv: off` inside
|
||||
a class body protect a `--fix` edit, given the classes round found the
|
||||
*formatter's own* `scan_nested` inactive there) — built a probe file with a
|
||||
tab fenced inside a class body:
|
||||
```systemverilog
|
||||
class c;
|
||||
// vfmt: off
|
||||
// lucisv: off
|
||||
int a;
|
||||
// vfmt: on
|
||||
// lucisv: on
|
||||
endclass
|
||||
```
|
||||
`vfmt check --select no-tabs` **still reports** the tab (fences gate fixes,
|
||||
not diagnostics — confirmed, not assumed). `vfmt check --select no-tabs
|
||||
`lucisv check --select no-tabs` **still reports** the tab (fences gate fixes,
|
||||
not diagnostics — confirmed, not assumed). `lucisv check --select no-tabs
|
||||
--fix` on the same file leaves the tab **untouched** — the fix is correctly
|
||||
declined. `vfmt format` on the identical file, no `--fix`, silently
|
||||
declined. `lucisv format` on the identical file, no `--fix`, silently
|
||||
reformats the tab away, exactly reproducing the classes round's finding that
|
||||
the formatter's own fence is inactive there. Read `fence::protected_regions`
|
||||
(`crates/vlog_formatter/src/fence.rs:96`) to understand *why* these two
|
||||
@@ -584,10 +584,10 @@ empty, confirmed byte-identical to the pre-sabotage state.
|
||||
- *Should-fix, documentation gap (not a corruption, not a corpus regression;
|
||||
the actual behavior is the safe/conservative direction).* Neither
|
||||
`docs/features/classes/README.md` nor this README states that a
|
||||
`// vfmt: off` fence inside a class body **does** protect `vfmt check
|
||||
`// lucisv: off` fence inside a class body **does** protect `lucisv check
|
||||
--fix` (via `fence::protected_regions`'s line-based backstop scan), even
|
||||
though the classes round documented, correctly, that the same fence is
|
||||
**inactive** for `vfmt format` itself (the AST-scoped `scan_nested` doesn't
|
||||
**inactive** for `lucisv format` itself (the AST-scoped `scan_nested` doesn't
|
||||
recurse into class items). Both facts are true and now confirmed by test;
|
||||
neither README says both in one place, so a reader of either document alone
|
||||
would reasonably conclude the fence does nothing at all inside a class
|
||||
@@ -596,22 +596,22 @@ empty, confirmed byte-identical to the pre-sabotage state.
|
||||
`docs/features/classes/README.md`'s existing fence-inactive note) stating
|
||||
the asymmetry plainly, with the mechanism (`collect` vs `scanned_regions`)
|
||||
named. Not fixed directly — it's a cross-cutting note that belongs to
|
||||
whichever agent owns `crates/vfmt/src/lint.rs` / the fence handshake, not a
|
||||
whichever agent owns `crates/lucisv/src/lint.rs` / the fence handshake, not a
|
||||
typo I can fix unambiguously in-place.
|
||||
- *Minor nit, not blocking.* The Assumptions section says "A non-ASCII
|
||||
identifier fails `lower_snake_case` etc. and is reported." In practice a
|
||||
genuinely non-ASCII byte in an identifier does not reach any naming rule at
|
||||
all: `vlog_linter::context`'s own comment says "a lex error leaves no
|
||||
tokens (the lexer is all-or-nothing)", confirmed live — `vfmt check` on a
|
||||
tokens (the lexer is all-or-nothing)", confirmed live — `lucisv check` on a
|
||||
file containing `parameter int élan = 1;` exits 0 with **zero** findings
|
||||
(not even the unrelated `module-filename`), while `vfmt format` on the same
|
||||
(not even the unrelated `module-filename`), while `lucisv format` on the same
|
||||
file correctly refuses with a `lex error` (invariant intact, nothing
|
||||
corrupted). So the practical claim is even truer than stated ("no practical
|
||||
population" because it's unreachable, not just because it's rare) but the
|
||||
wording "is reported" is not literally accurate for that case — pre-existing
|
||||
`context.rs` behavior, not introduced by this round, not worth a code
|
||||
change, just a one-clause wording fix if the README is touched again.
|
||||
*(2026-08-19: delivered by lexer-cleanup — `vfmt check` on a file that
|
||||
*(2026-08-19: delivered by lexer-cleanup — `lucisv check` on a file that
|
||||
does not lex now reports the lex error and exits 2 instead of silently
|
||||
passing; `docs/features/lexer-cleanup/README.md`.)*
|
||||
- No preset false positive or false negative found on any probed shape.
|
||||
@@ -656,5 +656,5 @@ Points reviewed and accepted:
|
||||
belongs to the lexer's existing gap list.
|
||||
|
||||
Remaining §4 items stay honestly open: external waiver files,
|
||||
per-rule style configuration (needs the vfmt.toml lint key), and the
|
||||
per-rule style configuration (needs the lucisv.toml lint key), and the
|
||||
--rules-doc CLI flag (handshake filed; rules_markdown() is ready).
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
## Goal
|
||||
|
||||
Give vfmt a linter — the `vlog_linter` crate and the `vfmt check` subcommand —
|
||||
Give lucisv a linter — the `vlog_linter` crate and the `lucisv check` subcommand —
|
||||
built ruff-style from day one (a rule registry over a shared parse, violations
|
||||
that may carry fixes classified *safe* or *unsafe*, `--select`/`--ignore`, JSON
|
||||
output) with Verible's rule ergonomics (stable kebab-case names, a style-guide
|
||||
rationale per rule, inline waivers). This round ships the engine, seven seed
|
||||
rules and the CLI wiring; the rules deliberately stay **syntactic**, per
|
||||
TODO.md §7, because semantic rules wait on `vlog_semantic`. The formatter is
|
||||
untouched: a bare `vfmt <paths>` behaves exactly as it did before subcommands
|
||||
untouched: a bare `lucisv <paths>` behaves exactly as it did before subcommands
|
||||
existed.
|
||||
|
||||
## Assumptions
|
||||
@@ -36,10 +36,10 @@ existed.
|
||||
`no-trailing-whitespace` neither report nor rewrite a range that touches a
|
||||
`TokenKind::String` span.
|
||||
- **A tab expands to the run's indent width** (`--indent`, or the `indent` key
|
||||
of the governing `vfmt.toml`, default 2) — one tab, one indent level.
|
||||
of the governing `lucisv.toml`, default 2) — one tab, one indent level.
|
||||
- **`module-filename` speaks only for a file with exactly one top-level
|
||||
module**, and never without a file name (stdin without `--stdin-filename`).
|
||||
- **Verible waivers naming rules vfmt does not have are ignored, not
|
||||
- **Verible waivers naming rules lucisv does not have are ignored, not
|
||||
reported.** See Work log 2026-08-19 — this came out of the corpus baseline.
|
||||
- **`// verilog_format: off` regions are reported but never auto-fixed.**
|
||||
See "Fences" below; the linter reads fenced ranges through
|
||||
@@ -59,14 +59,14 @@ existed.
|
||||
- `vlog_formatter::Config`: only `indent_width`, and only as the tab-expansion
|
||||
width. The linter does not format.
|
||||
- `vlog_formatter::fence` (`collect`, `fence_of`, `Fence`, `Region` and its
|
||||
fields) — read by `crates/vfmt/src/lint.rs` to keep `--fix` out of fenced
|
||||
fields) — read by `crates/lucisv/src/lint.rs` to keep `--fix` out of fenced
|
||||
regions. All of it was **already `pub`**, so no visibility change was needed
|
||||
in `vlog_formatter`; nothing in that crate was modified. If `fence::collect`
|
||||
ever narrows its region for the formatter's own reasons, `--fix` narrows
|
||||
with it — that coupling is deliberate: one answer to "what is fenced", not
|
||||
two. Note the linter passes a **tolerant** tree to `collect`, which handles
|
||||
`Error` leaves without panicking (verified live, and by the fences QA round).
|
||||
- `crates/vfmt`: the walk, `--exclude`, `.gitignore` and config discovery are
|
||||
- `crates/lucisv`: the walk, `--exclude`, `.gitignore` and config discovery are
|
||||
reused unchanged — `check` is handed the same `(path, Config)` job list
|
||||
`format` builds, and the same worker pool.
|
||||
|
||||
@@ -84,13 +84,13 @@ existed.
|
||||
- `run(source, path, enabled)` never panics on any input and never writes
|
||||
anything; `LintContext::new` never fails.
|
||||
- Findings come back sorted by `(span.start, span.end, rule)`.
|
||||
- The exit-code contract of `vfmt check` mirrors the frozen formatter one:
|
||||
- The exit-code contract of `lucisv check` mirrors the frozen formatter one:
|
||||
0 clean, 1 violations remain, 2 error.
|
||||
|
||||
**Requested of others (not done here)**
|
||||
|
||||
- *config-discovery's owner*: a `lint = [...]` / `[lint]` section in
|
||||
`vfmt.toml` (selected rules, per-rule settings) is out of scope this round —
|
||||
`lucisv.toml` (selected rules, per-rule settings) is out of scope this round —
|
||||
rule selection is CLI-only (`--select` / `--ignore`). When that key lands,
|
||||
`Options::select`/`ignore` should gain the same "CLI flag > config file"
|
||||
precedence the formatter settings have, and `select_rules` already takes the
|
||||
@@ -101,7 +101,7 @@ existed.
|
||||
thing that would need to accept a pre-built tree.
|
||||
~~is **not** done~~ **Delivered by one-parse (round 19):
|
||||
`LintContext::from_parse` accepts pre-built products, `ParsedSource::parse`
|
||||
is the parse-once bundle, and both `vfmt check` and the server lint from
|
||||
is the parse-once bundle, and both `lucisv check` and the server lint from
|
||||
one parse — see `docs/features/one-parse/README.md`.**
|
||||
|
||||
## Status / TODO
|
||||
@@ -115,14 +115,14 @@ existed.
|
||||
- [x] `apply_fixes` — left-to-right, overlapping fixes skipped, all-or-nothing
|
||||
per fix.
|
||||
- [x] Registry: `all_rules`, `default_rules`, `rule_by_name`, `select_rules`.
|
||||
- [x] Inline waivers: `waive`, `waive-start`/`waive-stop`, `vfmt:` and
|
||||
- [x] Inline waivers: `waive`, `waive-start`/`waive-stop`, `lucisv:` and
|
||||
`verilog_lint:` spellings.
|
||||
- [x] `unused-waiver` pseudo-rule (unused, unknown-rule, malformed,
|
||||
unmatched `waive-stop`), itself waivable and ignorable.
|
||||
- [x] Seed rules: `no-tabs`, `no-trailing-whitespace`, `case-missing-default`,
|
||||
`always-ff-non-blocking`, `always-comb-blocking`,
|
||||
`explicit-parameter-storage-type`, `module-filename`.
|
||||
- [x] `vfmt check` wiring, `vfmt format` alias, backward-compatible bare
|
||||
- [x] `lucisv check` wiring, `lucisv format` alias, backward-compatible bare
|
||||
invocation.
|
||||
- [x] `--output-format json`, `--select`, `--ignore`, `--fix`,
|
||||
`--unsafe-fixes` (plumbed; no unsafe fix exists yet).
|
||||
@@ -132,7 +132,7 @@ existed.
|
||||
- [ ] External waiver files (`waive --rule=X --line=N --location=glob`) — out
|
||||
of scope this round; needs a file format, a discovery rule and a
|
||||
precedence story against inline waivers.
|
||||
- [ ] `lint` config key in `vfmt.toml` — handshake above.
|
||||
- [ ] `lint` config key in `lucisv.toml` — handshake above.
|
||||
- [x] One parse shared by `check` and `format` — handshake above.
|
||||
**Delivered by one-parse (round 19)** for the linter's consumers;
|
||||
`format` keeps its own strict parse by design.
|
||||
@@ -167,7 +167,7 @@ Honest reading of that table:
|
||||
- `unused-waiver` scored **14 before** the Verible-spelling decision below and
|
||||
0 after; every one was `// verilog_lint: waive macro-name-style` in ibex's
|
||||
vendored lowRISC code.
|
||||
- No file errored: the tolerant parse means even the 40 % of the corpus vfmt
|
||||
- No file errored: the tolerant parse means even the 40 % of the corpus lucisv
|
||||
cannot fully parse still gets linted for what it can see. That is also the
|
||||
caveat — AST-rule counts above are a **lower bound**.
|
||||
|
||||
@@ -193,16 +193,16 @@ them quiet and the on/off reasoning are in
|
||||
## Waiver semantics as implemented
|
||||
|
||||
```systemverilog
|
||||
wire a; // vfmt: waive no-tabs suppresses that rule on this line
|
||||
// vfmt: waive no-tabs alone on its line: suppresses the NEXT line
|
||||
// vfmt: waive-start no-tabs ... from this line
|
||||
// vfmt: waive-stop no-tabs ... through this one, both included
|
||||
wire a; // lucisv: waive no-tabs suppresses that rule on this line
|
||||
// lucisv: waive no-tabs alone on its line: suppresses the NEXT line
|
||||
// lucisv: waive-start no-tabs ... from this line
|
||||
// lucisv: waive-stop no-tabs ... through this one, both included
|
||||
```
|
||||
|
||||
- `verilog_lint:` is accepted everywhere `vfmt:` is.
|
||||
- `verilog_lint:` is accepted everywhere `lucisv:` is.
|
||||
- Exactly one rule name per waiver; anything else is `unused-waiver:
|
||||
malformed`. A comment that does not start with one of the two prefixes plus
|
||||
a `waive*` keyword is an ordinary comment (`// vfmt: off` stays a format
|
||||
a `waive*` keyword is an ordinary comment (`// lucisv: off` stays a format
|
||||
fence).
|
||||
- Ranges nest per rule; the innermost open `waive-start` for a rule is what a
|
||||
`waive-stop` closes. An unclosed `waive-start` runs to the end of the file
|
||||
@@ -210,10 +210,10 @@ wire a; // vfmt: waive no-tabs suppresses that rule on this line
|
||||
- A waiver whose rule this run did not enable is silent — with `--select
|
||||
no-tabs`, waivers for other rules are not "unused", they simply had no
|
||||
chance to fire.
|
||||
- A `verilog_lint:` waiver naming a rule vfmt does not implement is ignored
|
||||
silently; the same waiver written `vfmt:` is reported as naming an unknown
|
||||
rule. A codebase annotated for Verible is lintable by vfmt without editing
|
||||
it first, while typos in vfmt's own waivers still surface.
|
||||
- A `verilog_lint:` waiver naming a rule lucisv does not implement is ignored
|
||||
silently; the same waiver written `lucisv:` is reported as naming an unknown
|
||||
rule. A codebase annotated for Verible is lintable by lucisv without editing
|
||||
it first, while typos in lucisv's own waivers still surface.
|
||||
- `unused-waiver` findings can themselves be waived, and the derivation loops
|
||||
until the used-set stops growing so waiving one does not leave the waiver
|
||||
that did it reported as unused.
|
||||
@@ -221,9 +221,9 @@ wire a; // vfmt: waive no-tabs suppresses that rule on this line
|
||||
|
||||
## Fences: reported, never auto-fixed
|
||||
|
||||
A `// verilog_format: off` / `// vfmt: off` region is emitted by the formatter
|
||||
A `// verilog_format: off` / `// lucisv: off` region is emitted by the formatter
|
||||
as the exact source bytes it was written with — hand-aligned tables are the
|
||||
reason the fence exists. `vfmt check` therefore **reports** violations inside a
|
||||
reason the fence exists. `lucisv check` therefore **reports** violations inside a
|
||||
fenced region (a finding is information, and `--select`/`--ignore`/waivers are
|
||||
the ways to silence one) but **never fixes** them: `--fix` drops any fix whose
|
||||
edits intersect a fenced range, leaving those violations reported and the exit
|
||||
@@ -260,7 +260,7 @@ ruff's, verbatim in spirit:
|
||||
changes the circuit.
|
||||
- A fix is all-or-nothing; its edits are applied together or not at all.
|
||||
- Within one pass, a fix overlapping one already applied is skipped rather
|
||||
than merged, so a pass can never garble text. `vfmt check --fix` therefore
|
||||
than merged, so a pass can never garble text. `lucisv check --fix` therefore
|
||||
loops (fix → re-lint) until nothing changes, capped at 10 rounds. The
|
||||
everyday case needing two rounds is a line ending in a tab: `no-tabs` and
|
||||
`no-trailing-whitespace` both want those bytes.
|
||||
@@ -268,21 +268,21 @@ ruff's, verbatim in spirit:
|
||||
Fences above.
|
||||
- Fixed output re-lints clean for the fixed rules — asserted in
|
||||
`crates/vlog_linter/src/lib.rs` (`fixing_leaves_the_file_clean_for_the_fixed_rules`)
|
||||
and end to end in `crates/vfmt/tests/cli.rs`
|
||||
and end to end in `crates/lucisv/tests/cli.rs`
|
||||
(`check_fix_rewrites_the_file_and_the_result_relints_clean`).
|
||||
|
||||
## CLI surface
|
||||
|
||||
```
|
||||
vfmt check [OPTIONS] <file|dir>... lint
|
||||
vfmt format [OPTIONS] <file|dir>... format (alias for the bare invocation)
|
||||
vfmt [OPTIONS] <file|dir>... format — unchanged
|
||||
lucisv check [OPTIONS] <file|dir>... lint
|
||||
lucisv format [OPTIONS] <file|dir>... format (alias for the bare invocation)
|
||||
lucisv [OPTIONS] <file|dir>... format — unchanged
|
||||
```
|
||||
|
||||
The subcommand word is read **only as the first argument**. Everything else is
|
||||
inputs and flags exactly as before, so `vfmt --check rtl/` is still the
|
||||
inputs and flags exactly as before, so `lucisv --check rtl/` is still the
|
||||
formatter's check mode. A file named `check` can be formatted as
|
||||
`vfmt format check`.
|
||||
`lucisv format check`.
|
||||
|
||||
`check`-only flags: `--select RULES`, `--ignore RULES` (comma-separated,
|
||||
repeatable), `--output-format text|json`, `--fix`, `--unsafe-fixes`. Using one
|
||||
@@ -308,7 +308,7 @@ parsable), each element:
|
||||
|
||||
`fix` is `null` when the rule offers none. Serialization is hand-rolled (~30
|
||||
lines): the shape is three fields deep, and no serialization crate is a
|
||||
dependency of this crate or of `vfmt`.
|
||||
dependency of this crate or of `lucisv`.
|
||||
|
||||
Exit codes: **0** clean (or everything fixed), **1** violations remain, **2**
|
||||
error (bad arguments, unknown rule, unreadable file). An error outranks
|
||||
@@ -321,7 +321,7 @@ violations, as in the formatter.
|
||||
- Created `crates/vlog_linter` (files first, workspace member after — the
|
||||
ordering that bit a previous round) with `vlog_parser` + std only. Added
|
||||
`crates/vlog_linter` to the root `members` list additively, leaving the
|
||||
concurrent `vfmt_server` entries and workspace deps untouched.
|
||||
concurrent `lucisv_server` entries and workspace deps untouched.
|
||||
- Modules: `violation` (Violation/Fix/Applicability/apply_fixes), `context`
|
||||
(LintContext), `visit` (item/statement walks), `registry` (Rule trait +
|
||||
tables + selection), `waiver`, `rules/` (one file per rule).
|
||||
@@ -345,26 +345,26 @@ violations, as in the formatter.
|
||||
- **Corpus finding that changed a decision.** The first baseline reported 14
|
||||
`unused-waiver` violations, all of them `// verilog_lint: waive
|
||||
macro-name-style` in vendored lowRISC code — i.e. correct Verible waivers
|
||||
for a rule vfmt has not implemented. Reporting those punishes exactly the
|
||||
for a rule lucisv has not implemented. Reporting those punishes exactly the
|
||||
codebases the `verilog_lint:` spelling exists to welcome. Changed so that an
|
||||
unknown rule name is reported only for the `vfmt:` spelling; a
|
||||
`verilog_lint:` waiver for a rule vfmt lacks is ignored. Corpus
|
||||
`unused-waiver` count went 14 → 0, and a typo'd `// vfmt: waive` is still
|
||||
caught. Tested by `a_verible_waiver_for_a_rule_vfmt_does_not_have_is_ignored`.
|
||||
unknown rule name is reported only for the `lucisv:` spelling; a
|
||||
`verilog_lint:` waiver for a rule lucisv lacks is ignored. Corpus
|
||||
`unused-waiver` count went 14 → 0, and a typo'd `// lucisv: waive` is still
|
||||
caught. Tested by `a_verible_waiver_for_a_rule_lucisv_does_not_have_is_ignored`.
|
||||
- CLI: `args.rs` gained `Command`/`OutputFormat`, the five check-only flags and
|
||||
a scope check that rejects a flag used with the wrong tool; the subcommand is
|
||||
only read as the first argument, which is what keeps every old command line
|
||||
meaning what it did. New `crates/vfmt/src/lint.rs` holds the check driver
|
||||
meaning what it did. New `crates/lucisv/src/lint.rs` holds the check driver
|
||||
and reuses `gather`, `build_pool` and `catch_panic` from `main.rs`.
|
||||
- Tests: 71 unit + 30 inline-marker integration tests in `vlog_linter`;
|
||||
16 new CLI tests in `crates/vfmt/tests/cli.rs` (exit codes, JSON shape,
|
||||
16 new CLI tests in `crates/lucisv/tests/cli.rs` (exit codes, JSON shape,
|
||||
`--fix` round trip in a temp dir, waivers, stdin, walk reuse, and four
|
||||
backward-compatibility tests including a byte-for-byte comparison of
|
||||
`vfmt --check` against `vfmt format --check`).
|
||||
- Gates: `cargo test -p vlog_linter` 71+30+1 green, `cargo test -p vfmt` 46
|
||||
green, `cargo clippy -p vlog_linter -p vfmt --all-targets` silent,
|
||||
`lucisv --check` against `lucisv format --check`).
|
||||
- Gates: `cargo test -p vlog_linter` 71+30+1 green, `cargo test -p lucisv` 46
|
||||
green, `cargo clippy -p vlog_linter -p lucisv --all-targets` silent,
|
||||
`cargo fmt --all --check` clean. The workspace has three failing tests and
|
||||
one clippy warning in `crates/vfmt_server`, which belongs to another agent's
|
||||
one clippy warning in `crates/lucisv_server`, which belongs to another agent's
|
||||
concurrent round and does not depend on this crate.
|
||||
- TODO.md §4: checked the rule trait/registry item, the diagnostic-format +
|
||||
JSON item, the fix-applicability item, the waiver item (with the external
|
||||
@@ -373,11 +373,11 @@ violations, as in the formatter.
|
||||
|
||||
### 2026-08-19 — dev (QA follow-up)
|
||||
|
||||
- **QA should-fix: `--fix` rewrote bytes inside `// vfmt: off` fences.** Fixed
|
||||
- **QA should-fix: `--fix` rewrote bytes inside `// lucisv: off` fences.** Fixed
|
||||
per the lead's ruling: violations inside a fenced region are still reported,
|
||||
but no fix that touches those bytes is applied. Implemented in
|
||||
`crates/vfmt/src/lint.rs` (`fixable_outside_fences` / `touches_fence`), not
|
||||
in `vlog_linter` — `vfmt` already depends on `vlog_formatter`, and doing it
|
||||
`crates/lucisv/src/lint.rs` (`fixable_outside_fences` / `touches_fence`), not
|
||||
in `vlog_linter` — `lucisv` already depends on `vlog_formatter`, and doing it
|
||||
here keeps the linter crate's dependency list at `vlog_parser` + std, which
|
||||
is the property QA verified with `cargo tree`.
|
||||
- **No visibility change was needed.** `fence::{collect, fence_of, Fence,
|
||||
@@ -410,7 +410,7 @@ violations, as in the formatter.
|
||||
per-rule counts byte-identical to the table above (the corpus contains no
|
||||
fences, so the filter is a no-op there — confirmed, not assumed).
|
||||
- Gates after the change: `cargo test -p vlog_linter` 71+30+1,
|
||||
`cargo test -p vfmt` 58 unit + 48 CLI, workspace green, clippy silent, fmt
|
||||
`cargo test -p lucisv` 58 unit + 48 CLI, workspace green, clippy silent, fmt
|
||||
clean.
|
||||
|
||||
## QA log
|
||||
@@ -422,15 +422,15 @@ live corpus run. All PASS unless noted; one should-fix finding below.
|
||||
|
||||
**Gates.** `cargo tree -p vlog_linter`: only `vlog_parser` (+ std),
|
||||
matching the dependency claim. `cargo fmt --all --check` clean.
|
||||
`cargo clippy -p vlog_linter -p vfmt --all-targets` silent on a forced
|
||||
`cargo clippy -p vlog_linter -p lucisv --all-targets` silent on a forced
|
||||
rebuild (touched `lib.rs` first to rule out a stale cache). No `unsafe`,
|
||||
no `#[allow]`, and every `.unwrap()`/`.expect()` in the crate is inside a
|
||||
`#[cfg(test)]` module (checked `crates/vlog_linter/src/**` and
|
||||
`crates/vfmt/src/lint.rs` by hand) — CLAUDE.md's Rust standards hold.
|
||||
`crates/lucisv/src/lint.rs` by hand) — CLAUDE.md's Rust standards hold.
|
||||
`cargo test -p vlog_linter`: 71 unit + 30 integration + 1 doctest, green.
|
||||
`cargo test -p vfmt`: 46 green. Counts match the work log exactly.
|
||||
`cargo test -p lucisv`: 46 green. Counts match the work log exactly.
|
||||
|
||||
**Corpus baseline.** Release build, `vfmt check corpus/ --output-format
|
||||
**Corpus baseline.** Release build, `lucisv check corpus/ --output-format
|
||||
json`: **7806** violations over **93** files, byte-identical across
|
||||
repeated runs and across `--threads 1` vs the default pool (fully
|
||||
deterministic). Per-rule breakdown parsed from the JSON matches the
|
||||
@@ -475,8 +475,8 @@ a discrepancy; determinism and counts are what matter and both check out.
|
||||
matching".
|
||||
- A waiver for a rule dropped by `--ignore` is silent (0 findings, exit
|
||||
0) — confirmed with `--ignore no-tabs --select no-tabs,unused-waiver`.
|
||||
- `verilog_lint: waive <rule vfmt lacks>` → silent; the same spelled
|
||||
`vfmt:` → reported unknown-rule. Both confirmed live via the CLI, not
|
||||
- `verilog_lint: waive <rule lucisv lacks>` → silent; the same spelled
|
||||
`lucisv:` → reported unknown-rule. Both confirmed live via the CLI, not
|
||||
just the unit tests.
|
||||
- `unused-waiver` waiving itself → no findings at all (fixed-point
|
||||
derivation works). `--select unused-waiver` alone still catches an
|
||||
@@ -490,7 +490,7 @@ a discrepancy; determinism and counts are what matter and both check out.
|
||||
(`module-filename`) fixes what it can, leaves the rest reported, exits
|
||||
1.
|
||||
- `check --fix --check` is rejected (`--check is not valid for
|
||||
\`vfmt check\``), confirming `--check` stays a formatter-only flag.
|
||||
\`lucisv check\``), confirming `--check` stays a formatter-only flag.
|
||||
- A second `--fix` run on an already-fixed-as-far-as-possible file is a
|
||||
no-op for fixing (0 additional applied) and exit code reflects only
|
||||
the remaining unfixable violation.
|
||||
@@ -499,21 +499,21 @@ a discrepancy; determinism and counts are what matter and both check out.
|
||||
so `--unsafe-fixes` changing nothing today is accurate, not just
|
||||
claimed.
|
||||
|
||||
**Should-fix finding — `--fix` does not respect `// vfmt: off` fences.**
|
||||
`crates/vfmt/src/lint.rs` (`run_rules`/`fix_source`) builds a
|
||||
**Should-fix finding — `--fix` does not respect `// lucisv: off` fences.**
|
||||
`crates/lucisv/src/lint.rs` (`run_rules`/`fix_source`) builds a
|
||||
`LintContext` straight from the raw source and never consults
|
||||
`fence.rs`; `crate::vlog_linter` has no notion of fences at all (its
|
||||
`Cargo.toml` doesn't even depend on `vlog_formatter` beyond the
|
||||
`Config::indent_width` handshake noted in this README). Repro: a file
|
||||
with `// vfmt: off` around a tab-and-trailing-whitespace line — `vfmt
|
||||
with `// lucisv: off` around a tab-and-trailing-whitespace line — `lucisv
|
||||
check` reports `no-tabs` and `no-trailing-whitespace` *inside* the
|
||||
fenced region, and `vfmt check --fix` rewrites it, while `vfmt format`
|
||||
fenced region, and `lucisv check --fix` rewrites it, while `lucisv format`
|
||||
(the formatter) leaves the same region byte-for-byte untouched by
|
||||
design. This does not corrupt code (the rewrite is a Safe,
|
||||
meaning-preserving one) and does not break any hard invariant, but it
|
||||
violates the fence's whole premise — a user who wrote `// vfmt: off`
|
||||
violates the fence's whole premise — a user who wrote `// lucisv: off`
|
||||
expecting hands-off code gets it silently edited by `check --fix`. Not
|
||||
mentioned anywhere in this README (the one `// vfmt: off` reference,
|
||||
mentioned anywhere in this README (the one `// lucisv: off` reference,
|
||||
lines 162–163, only says the waiver *parser* treats it as an ordinary
|
||||
comment, which is correct and unrelated to this). Recommend either (a)
|
||||
`LintContext`/the fix/report path skip fenced ranges, matching the
|
||||
@@ -529,12 +529,12 @@ confirmed on a clean file, exit 0.
|
||||
|
||||
**Backward compatibility.** Built the pre-round binary from a `git
|
||||
worktree` at HEAD (`1ac9746`, before this round's uncommitted changes)
|
||||
and compared `vfmt --check` over the full corpus against the new
|
||||
and compared `lucisv --check` over the full corpus against the new
|
||||
binary: stdout byte-identical, stderr byte-identical (including the
|
||||
same 359 parse-error lines and the same "488 files would be
|
||||
reformatted, 13 files left unchanged, 359 files failed to format"
|
||||
summary), same exit code (2). Also reconfirmed live that `vfmt --check`
|
||||
and `vfmt format --check` are byte-identical on the new binary. The
|
||||
summary), same exit code (2). Also reconfirmed live that `lucisv --check`
|
||||
and `lucisv format --check` are byte-identical on the new binary. The
|
||||
linter changes did not perturb the formatter at all, as the README
|
||||
promises.
|
||||
|
||||
@@ -557,23 +557,23 @@ break. One should-fix finding (fences vs. `--fix`, above).
|
||||
## Review
|
||||
|
||||
**2026-08-19 — lead. Verdict: accepted after one directed fix; commits
|
||||
jointly with vfmt-server (round 11). `vfmt check` completes the ruff
|
||||
jointly with lucisv-server (round 11). `lucisv check` completes the ruff
|
||||
analog.**
|
||||
|
||||
Points reviewed and accepted:
|
||||
|
||||
1. **The Verible-waiver asymmetry** is the round's best judgment call:
|
||||
`verilog_lint:` waivers naming rules vfmt lacks are ignored, not
|
||||
`verilog_lint:` waivers naming rules lucisv lacks are ignored, not
|
||||
reported, because punishing them punishes exactly the vendored
|
||||
codebases the compatibility spelling exists to welcome — while
|
||||
typo'd `vfmt:` waivers still get caught. A design decision changed
|
||||
typo'd `lucisv:` waivers still get caught. A design decision changed
|
||||
by corpus evidence, recorded with the evidence.
|
||||
2. **The fix engine's conservatism** (Safe/Unsafe from day one,
|
||||
overlaps skipped not merged, fix→re-lint loop with a cap,
|
||||
`always-*-blocking` deliberately fixless because swapping `=`/`<=`
|
||||
changes the circuit) is the right posture for a tool whose sibling
|
||||
formatter promises never to corrupt.
|
||||
3. **The fence ruling** (violations reported inside `// vfmt: off`,
|
||||
3. **The fence ruling** (violations reported inside `// lucisv: off`,
|
||||
fixes never applied there) was implemented better than directed:
|
||||
the dev discovered that `fence::collect` yields no regions on files
|
||||
with a parse error before the fence — exactly the tolerant-parse
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# vfmt-core-lift
|
||||
# lucisv-core-lift
|
||||
|
||||
## Goal
|
||||
|
||||
The CLI and the language server were answering two different questions with
|
||||
two different pieces of code: `vfmt` discovers `vfmt.toml` and walks a tree
|
||||
honoring `.gitignore` and `--exclude`, while `vfmt-server` formatted with
|
||||
two different pieces of code: `lucisv` discovers `lucisv.toml` and walks a tree
|
||||
honoring `.gitignore` and `--exclude`, while `lucisv-server` formatted with
|
||||
built-in defaults and indexed everything it could find, because both rules
|
||||
lived inside the `vfmt` **binary** crate where nothing else could reach them
|
||||
(the two Handshake requests filed by `docs/features/vfmt-server/README.md`).
|
||||
lived inside the `lucisv` **binary** crate where nothing else could reach them
|
||||
(the two Handshake requests filed by `docs/features/lucisv-server/README.md`).
|
||||
That is the classic way an editor's format-on-save drifts away from CI's
|
||||
`vfmt --check`. This round lifts `config.rs` and `walk.rs` — unchanged — into
|
||||
a new std-only library crate `crates/vfmt_core`, re-points the CLI at it with
|
||||
`lucisv --check`. This round lifts `config.rs` and `walk.rs` — unchanged — into
|
||||
a new std-only library crate `crates/lucisv_core`, re-points the CLI at it with
|
||||
no behavior change at all, and wires the server through the same code: one
|
||||
discovery rule, one walk, two front ends.
|
||||
|
||||
@@ -21,13 +21,13 @@ discovery rule, one walk, two front ends.
|
||||
line of their 31 unit tests, was edited. The modules kept their names inside
|
||||
the new crate, so even the import paths in the moved tests (`use super::*`)
|
||||
needed no change. Everything the CLI does is therefore unchanged by
|
||||
construction, and the untouched `crates/vfmt/tests/cli.rs` (48 tests) plus a
|
||||
construction, and the untouched `crates/lucisv/tests/cli.rs` (48 tests) plus a
|
||||
byte-identical 820-file corpus (count corrected by lead per QA) run are the evidence.
|
||||
- **`vfmt_core` is two modules, not a framework.** `pub mod config; pub mod
|
||||
- **`lucisv_core` is two modules, not a framework.** `pub mod config; pub mod
|
||||
walk;` and nothing else — no re-export layer, no new traits, no
|
||||
configuration struct invented for a third caller that does not exist. The
|
||||
crate has no dependencies, std only, as both modules already did.
|
||||
- **Precedence in the server is `vfmt.toml` > the client's `tabSize` > the
|
||||
- **Precedence in the server is `lucisv.toml` > the client's `tabSize` > the
|
||||
built-in default**, which is deliberately *not* the CLI's `--flag > config >
|
||||
default`. The CLI's flag is typed by a human for one run, so it outranks a
|
||||
file. `FormattingOptions::tab_size` is not that: LSP requires the client to
|
||||
@@ -35,18 +35,18 @@ discovery rule, one walk, two front ends.
|
||||
own default (VS Code's `editor.tabSize`, 4 unless changed) or its guess from
|
||||
the file's existing indentation. Treating an editor default as a deliberate
|
||||
override would let an unconfigured editor silently beat a checked-in
|
||||
`vfmt.toml` — reintroducing exactly the CLI/editor divergence this feature
|
||||
exists to delete, and making format-on-save fight `vfmt --check` in CI.
|
||||
`lucisv.toml` — reintroducing exactly the CLI/editor divergence this feature
|
||||
exists to delete, and making format-on-save fight `lucisv --check` in CI.
|
||||
Where the config file is *silent*, `tabSize` still beats the built-in
|
||||
default, so a project with no `vfmt.toml` behaves exactly as the server did
|
||||
default, so a project with no `lucisv.toml` behaves exactly as the server did
|
||||
before this round. `line-length` has no client analog at all and comes from
|
||||
the config file or not at all.
|
||||
- **A broken `vfmt.toml` warns the editor; it does not fail it.** The CLI's
|
||||
- **A broken `lucisv.toml` warns the editor; it does not fail it.** The CLI's
|
||||
contract for an unparsable config is fatal: exit 2, nothing written, all
|
||||
configs resolved before any file is touched
|
||||
(`docs/features/config-discovery/README.md`). That is right for a batch tool
|
||||
where a half-applied run is the danger. It is wrong for an editor: a user who
|
||||
types a typo into `vfmt.toml` in one tab must not find that format-on-save
|
||||
types a typo into `lucisv.toml` in one tab must not find that format-on-save
|
||||
has stopped working in every other tab, with an error where their code should
|
||||
be. So the server formats with the **built-in defaults** (never a partial mix
|
||||
of the broken file's keys — nothing at all is taken from a file that failed
|
||||
@@ -57,14 +57,14 @@ discovery rule, one walk, two front ends.
|
||||
parses are identical.
|
||||
- **The warning is said once per file change.** A format-on-save loop asks to
|
||||
format on every save; repeating the same config error forever would train the
|
||||
user to dismiss vfmt's messages. The server remembers which documents it has
|
||||
user to dismiss lucisv's messages. The server remembers which documents it has
|
||||
warned about and re-arms a document when its text changes (`didOpen`,
|
||||
`didChange`, `didSave` with text) or when it is closed.
|
||||
- **The index scan anchors its excludes on the workspace root.** `exclude` is
|
||||
resolved once per command-line input in the CLI, never mid-walk
|
||||
(config-discovery's own assumption); the server's analog of "an input" is a
|
||||
workspace root, so the config governing the root supplies the exclude
|
||||
patterns for that root's whole scan. A `vfmt.toml` in a subdirectory still
|
||||
patterns for that root's whole scan. A `lucisv.toml` in a subdirectory still
|
||||
governs `line-length`/`indent` for files under it when they are formatted —
|
||||
discovery there is per-document — it just cannot add excludes mid-scan,
|
||||
exactly as in the CLI.
|
||||
@@ -78,7 +78,7 @@ discovery rule, one walk, two front ends.
|
||||
- **The server's walk-depth cap is gone, deliberately.** The old plain walk
|
||||
capped recursion at 64 directories to survive a symlink cycle; the lifted
|
||||
walk has no cap, because the CLI's does not. Keeping the cap would mean the
|
||||
index silently covering fewer files than `vfmt` formats — the divergence this
|
||||
index silently covering fewer files than `lucisv` formats — the divergence this
|
||||
round exists to remove — and *adding* a cap to the shared walk would silently
|
||||
drop deep files from CLI runs, which is a behavior change this mechanical
|
||||
lift must not make. Cycle detection belongs in the shared walk where it would
|
||||
@@ -87,7 +87,7 @@ discovery rule, one walk, two front ends.
|
||||
search from, so it is formatted with `tabSize`-or-defaults, as before.
|
||||
- **Discovery is rebuilt per formatting request.** `Discovery`'s cache is
|
||||
per-instance and the server is long-lived, so a cached answer would go stale
|
||||
the moment a user edits `vfmt.toml`. A fresh `Discovery` per request costs
|
||||
the moment a user edits `lucisv.toml`. A fresh `Discovery` per request costs
|
||||
one file read on an explicit, user-initiated action — cheaper than any
|
||||
invalidation scheme that could be wrong. (config-discovery's Handshakes
|
||||
anticipated exactly this: "a server can drop and rebuild one when a config
|
||||
@@ -95,42 +95,42 @@ discovery rule, one walk, two front ends.
|
||||
|
||||
## Handshakes
|
||||
|
||||
- **New crate `vfmt_core`, consumed by `vfmt` and `vfmt_server`.** Public
|
||||
surface, unchanged from what it was inside `crates/vfmt`:
|
||||
- `vfmt_core::config`: `FileConfig { line_length, indent, exclude }`,
|
||||
- **New crate `lucisv_core`, consumed by `lucisv` and `lucisv_server`.** Public
|
||||
surface, unchanged from what it was inside `crates/lucisv`:
|
||||
- `lucisv_core::config`: `FileConfig { line_length, indent, exclude }`,
|
||||
`parse(&str) -> Result<FileConfig, String>`, `Discovery::{new, for_input,
|
||||
for_file, for_dir}`.
|
||||
- `vfmt_core::walk`: `EXTENSIONS`, `collect_files(input, exclude, gitignore,
|
||||
- `lucisv_core::walk`: `EXTENSIONS`, `collect_files(input, exclude, gitignore,
|
||||
&mut Vec<PathBuf>) -> Result<(), String>`, `is_excluded(&Path, &[String])`.
|
||||
Every item already carried the one-line doc comment CLAUDE.md asks for; no
|
||||
signature changed, so no crate-public boundary moved in a way that needed a
|
||||
new one. The rules themselves stay documented where they were:
|
||||
`docs/features/config-discovery/README.md` and
|
||||
`docs/features/parallel-files/README.md`.
|
||||
- **`crates/vfmt` consumes `vfmt_core`** and keeps nothing of its own: the two
|
||||
- **`crates/lucisv` consumes `lucisv_core`** and keeps nothing of its own: the two
|
||||
modules are gone from its `src/`, `mod config;`/`mod walk;` are gone from
|
||||
`main.rs`, and the three call sites now say `vfmt_core::…`. No duplicated
|
||||
`main.rs`, and the three call sites now say `lucisv_core::…`. No duplicated
|
||||
logic was left behind.
|
||||
- **Discharges both Handshake requests filed by
|
||||
`docs/features/vfmt-server/README.md`** (items 1 and 2, config discovery and
|
||||
`docs/features/lucisv-server/README.md`** (items 1 and 2, config discovery and
|
||||
the ignore-aware walk). Both are annotated **DELIVERED** in that README, one
|
||||
line each, as the only edits made to another feature's document.
|
||||
- **Request to the lead — stale prose in `docs/features/vfmt-server/README.md`
|
||||
- **Request to the lead — stale prose in `docs/features/lucisv-server/README.md`
|
||||
and `TODO.md`, deliberately not edited here** (out of this feature's stated
|
||||
scope, and a concurrent editor-packaging round is live in the same files):
|
||||
- vfmt-server README, Assumptions: "**The workspace walk is plain** …
|
||||
`.gitignore` and `--exclude` are **not** honored" and "**`vfmt.toml` is not
|
||||
- lucisv-server README, Assumptions: "**The workspace walk is plain** …
|
||||
`.gitignore` and `--exclude` are **not** honored" and "**`lucisv.toml` is not
|
||||
discovered** … The server uses `Config::default()` … with the client's tab
|
||||
size overriding the indent" are both now false, and the tab-size sentence
|
||||
is contradicted by the precedence decided above.
|
||||
- vfmt-server README, Status/TODO: "**Not done:** `vfmt.toml` discovery,
|
||||
- lucisv-server README, Status/TODO: "**Not done:** `lucisv.toml` discovery,
|
||||
`.gitignore`-aware indexing — both blocked on the two Handshake requests
|
||||
above" is now done.
|
||||
- `TODO.md:103` and `TODO.md:120` point at `crates/vfmt/src/config.rs` and
|
||||
`crates/vfmt/src/walk.rs`; both files now live in `crates/vfmt_core/src/`.
|
||||
- `TODO.md:103` and `TODO.md:120` point at `crates/lucisv/src/config.rs` and
|
||||
`crates/lucisv/src/walk.rs`; both files now live in `crates/lucisv_core/src/`.
|
||||
`docs/features/spans/README.md:308` names the old config path in a work-log
|
||||
sentence about a concurrent round — historical, best left alone.
|
||||
- **Follow-up for whoever next touches `vfmt_core::walk`:** the walk has no
|
||||
- **Follow-up for whoever next touches `lucisv_core::walk`:** the walk has no
|
||||
symlink-cycle detection (a depth cap, or device+inode tracking). It never
|
||||
had; the CLI has always been exposed to it, and the server now shares the
|
||||
exposure since its own 64-directory cap was removed for parity. Fixing it in
|
||||
@@ -138,37 +138,37 @@ discovery rule, one walk, two front ends.
|
||||
behavior (deep trees, cyclic links), so it wants its own round with its own
|
||||
tests, not a quiet addition inside a mechanical lift.
|
||||
- **`TODO.md`: no matching checkbox.** The §3 config and `.gitignore` items and
|
||||
the §6 `vfmt_server` item are already checked; this round moves code and
|
||||
the §6 `lucisv_server` item are already checked; this round moves code and
|
||||
wires the server, and adds no item of its own. Nothing was checked off.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `crates/vfmt_core` created with a **compiling skeleton first**, built
|
||||
- [x] `crates/lucisv_core` created with a **compiling skeleton first**, built
|
||||
standalone, and only then added to the root `members` (round 11's
|
||||
ordering lesson, taken literally).
|
||||
- [x] `config.rs` and `walk.rs` moved as 100% renames, unit tests and all.
|
||||
- [x] `crates/vfmt` re-wired to `vfmt_core` (`Cargo.toml`, `main.rs`,
|
||||
- [x] `crates/lucisv` re-wired to `lucisv_core` (`Cargo.toml`, `main.rs`,
|
||||
`args.rs`); no logic left behind, no CLI behavior change.
|
||||
- [x] Server formatting discovers `vfmt.toml` anchored at the document's own
|
||||
- [x] Server formatting discovers `lucisv.toml` anchored at the document's own
|
||||
path, by the CLI's rule.
|
||||
- [x] Precedence `config > tabSize > built-in default`, decided and documented.
|
||||
- [x] Broken config → one `showMessage` warning per file change, formatting
|
||||
proceeds with defaults, never a crash and never a partial config.
|
||||
- [x] `initialize`'s scan uses the lifted walk: same extensions, `.gitignore`
|
||||
honored, excludes from the workspace root's config.
|
||||
- [x] Tests: `vfmt_core` inherits its 31 moved unit tests; server gains 8 unit
|
||||
tests (config-beats-tabSize, `vfmt.toml` governing a real buffer, broken
|
||||
- [x] Tests: `lucisv_core` inherits its 31 moved unit tests; server gains 8 unit
|
||||
tests (config-beats-tabSize, `lucisv.toml` governing a real buffer, broken
|
||||
config, untitled buffer, gitignore-honoring scan, root-config excludes,
|
||||
broken root config, extension filter) and 2 e2e tests through the real
|
||||
binary over stdio.
|
||||
- [x] Both vfmt-server Handshakes annotated DELIVERED.
|
||||
- [x] Both lucisv-server Handshakes annotated DELIVERED.
|
||||
- [x] Gates: `cargo test --workspace`, `cargo clippy --workspace
|
||||
--all-targets`, `cargo fmt --all --check`, corpus check.
|
||||
- [ ] **Not done, deliberately:** symlink-cycle detection in the shared walk
|
||||
(see Handshakes — a real behavior change, wants its own round).
|
||||
- [ ] **Not done:** re-resolving `exclude` per directory during a scan. The CLI
|
||||
does not either; the two agree, which is the point of this round.
|
||||
- [ ] **Not done:** watching `vfmt.toml` for changes
|
||||
- [ ] **Not done:** watching `lucisv.toml` for changes
|
||||
(`workspace/didChangeWatchedFiles`). Discovery is re-run per formatting
|
||||
request, so an edited config takes effect at the next format without it.
|
||||
|
||||
@@ -177,11 +177,11 @@ discovery rule, one walk, two front ends.
|
||||
### 2026-08-19 — dev agent
|
||||
|
||||
- Read `CLAUDE.md`, the two Handshake requests in
|
||||
`docs/features/vfmt-server/README.md`, all of
|
||||
`docs/features/lucisv-server/README.md`, all of
|
||||
`docs/features/config-discovery/README.md` and the behavior half of
|
||||
`docs/features/parallel-files/README.md` (both QA logs included), and
|
||||
`crates/vfmt/src/{config,walk,main,args,lint}.rs` before writing anything.
|
||||
- **Ordering lesson taken literally.** `crates/vfmt_core` was created with a
|
||||
`crates/lucisv/src/{config,walk,main,args,lint}.rs` before writing anything.
|
||||
- **Ordering lesson taken literally.** `crates/lucisv_core` was created with a
|
||||
literal-versioned manifest carrying an empty `[workspace]` table — making it
|
||||
its own workspace — the two modules were `git mv`'d in, and
|
||||
`cargo test` was run **standalone** (31 passed) *before* the root `members`
|
||||
@@ -193,11 +193,11 @@ discovery rule, one walk, two front ends.
|
||||
moves as `(100%)`. The 31 unit tests moved with their modules and did not
|
||||
need even an import-path edit, because the modules kept their names. The
|
||||
brief allowed edits to those imports; none were required.
|
||||
- **Behavior preservation, measured rather than asserted.** `crates/vfmt`'s
|
||||
- **Behavior preservation, measured rather than asserted.** `crates/lucisv`'s
|
||||
unit count is unchanged in total (58 = 27 that stayed + 31 that moved), and
|
||||
`crates/vfmt/tests/cli.rs` — 48 CLI integration tests — is **byte-untouched**
|
||||
and green. Then the strongest check available: a release `vfmt` built from a
|
||||
clean `git worktree` at `HEAD` and the working-tree `vfmt` were both run over
|
||||
`crates/lucisv/tests/cli.rs` — 48 CLI integration tests — is **byte-untouched**
|
||||
and green. Then the strongest check available: a release `lucisv` built from a
|
||||
clean `git worktree` at `HEAD` and the working-tree `lucisv` were both run over
|
||||
the 820-file corpus (count corrected by lead per QA), and their per-file TSVs are **byte-identical** (`diff`
|
||||
silent; verification-error: none, crash: none in both). The committed
|
||||
`corpus-check-results.tsv` in the repo predates several landed rounds and was
|
||||
@@ -208,7 +208,7 @@ discovery rule, one walk, two front ends.
|
||||
version is that LSP forces the client to send `tabSize` on every request, so
|
||||
it is a *default*, not an *intent*, and a default must not beat a file a
|
||||
human checked in. The rule is pinned by `a_config_file_beats_the_editors_tab_size`
|
||||
(unit) and by `a_vfmt_toml_governs_formatting_over_the_editors_tab_size`
|
||||
(unit) and by `a_lucisv_toml_governs_formatting_over_the_editors_tab_size`
|
||||
(e2e: the client asks for `tabSize: 2`, the config says `indent = 4`, the
|
||||
wire carries four spaces).
|
||||
- **Split `format::formatting` in two** rather than letting it talk to the
|
||||
@@ -234,7 +234,7 @@ discovery rule, one walk, two front ends.
|
||||
private file list, so they pin the behavior a user sees.
|
||||
- **The format unit tests that need a real tree write a `.git` marker** into
|
||||
their scratch directory. That stops the upward discovery walk at the temp
|
||||
dir, so a `vfmt.toml` in some real ancestor of `/tmp` can never leak into a
|
||||
dir, so a `lucisv.toml` in some real ancestor of `/tmp` can never leak into a
|
||||
test result — the `.git`-stops-the-walk rule config-discovery documents,
|
||||
used as a test-hermeticity tool.
|
||||
- **Two clippy fixes on the way through**, both in the e2e test: `&PathBuf` →
|
||||
@@ -251,47 +251,47 @@ discovery rule, one walk, two front ends.
|
||||
**Results** (settled tree, all re-run at the end):
|
||||
|
||||
- `cargo test --workspace`: **512 passed, 0 failed** (baseline before this
|
||||
round: 503; +31 `vfmt_core`, −31 moved out of `vfmt`, +7 net `vfmt_server`
|
||||
unit, +2 `vfmt_server` e2e).
|
||||
- `vfmt_core`: 31 unit (20 config + 11 walk), all moved, all unmodified.
|
||||
- `vfmt`: 27 unit + **48 CLI integration, unmodified** — the
|
||||
round: 503; +31 `lucisv_core`, −31 moved out of `lucisv`, +7 net `lucisv_server`
|
||||
unit, +2 `lucisv_server` e2e).
|
||||
- `lucisv_core`: 31 unit (20 config + 11 walk), all moved, all unmodified.
|
||||
- `lucisv`: 27 unit + **48 CLI integration, unmodified** — the
|
||||
behavior-preservation proof.
|
||||
- `vfmt_server`: 82 unit (was 75) + 3 e2e (was 1).
|
||||
- `lucisv_server`: 82 unit (was 75) + 3 e2e (was 1).
|
||||
- `cargo clippy --workspace --all-targets`: **0 warnings**.
|
||||
- `cargo fmt --all --check`: clean.
|
||||
- Corpus: HEAD binary vs. lifted binary over 860 files → **identical TSVs**,
|
||||
`verification-error: none`, `crash: none`. `corpus-check-results.tsv`
|
||||
unmodified in the repo.
|
||||
- Files added: `crates/vfmt_core/{Cargo.toml,src/lib.rs}` (+ the two moved
|
||||
- Files added: `crates/lucisv_core/{Cargo.toml,src/lib.rs}` (+ the two moved
|
||||
modules), this README. Files edited: root `Cargo.toml` (one `members` line,
|
||||
additive), `crates/vfmt/{Cargo.toml,src/main.rs,src/args.rs}`,
|
||||
`crates/vfmt_server/{Cargo.toml,src/{format,server,state}.rs,tests/e2e.rs}`,
|
||||
and two annotation lines in `docs/features/vfmt-server/README.md`.
|
||||
additive), `crates/lucisv/{Cargo.toml,src/main.rs,src/args.rs}`,
|
||||
`crates/lucisv_server/{Cargo.toml,src/{format,server,state}.rs,tests/e2e.rs}`,
|
||||
and two annotation lines in `docs/features/lucisv-server/README.md`.
|
||||
|
||||
## QA log
|
||||
|
||||
### 2026-08-19 — QA agent
|
||||
|
||||
Scope: `-p vfmt_core -p vfmt -p vfmt_server`. Verified every claim in the
|
||||
Scope: `-p lucisv_core -p lucisv -p lucisv_server`. Verified every claim in the
|
||||
brief; **all PASS, no blocking findings.**
|
||||
|
||||
**1. Mechanical lift.**
|
||||
- `git diff -M --summary`: both moves report `(100%)` — confirmed rename,
|
||||
zero content diff by definition.
|
||||
- `git show HEAD:crates/vfmt/src/config.rs | diff - crates/vfmt_core/src/config.rs`
|
||||
- `git show HEAD:crates/lucisv/src/config.rs | diff - crates/lucisv_core/src/config.rs`
|
||||
and the same for `walk.rs`: **both `diff` exit 0** — byte-identical, no
|
||||
divergence line.
|
||||
- `crates/vfmt/tests/cli.rs`: `git diff HEAD` empty (byte-untouched);
|
||||
- `crates/lucisv/tests/cli.rs`: `git diff HEAD` empty (byte-untouched);
|
||||
`grep -c '#\[test\]'` = 48, all pass.
|
||||
- Unit total conserved: `vfmt_core` 31 (20 config + 11 walk), `vfmt` 27 +
|
||||
48 CLI = 75. 58 (27+31) was the pre-lift `vfmt` total; post-lift it's
|
||||
27 (stayed) + 31 (moved to vfmt_core) = 58, matches exactly.
|
||||
- `main.rs`/`args.rs` call sites confirmed rewired: `use vfmt_core::config::Discovery`,
|
||||
`use vfmt_core::walk::{collect_files, EXTENSIONS}` (main.rs:28-29),
|
||||
`use vfmt_core::config::FileConfig` (args.rs:3). No `mod config;`/`mod walk;`
|
||||
- Unit total conserved: `lucisv_core` 31 (20 config + 11 walk), `lucisv` 27 +
|
||||
48 CLI = 75. 58 (27+31) was the pre-lift `lucisv` total; post-lift it's
|
||||
27 (stayed) + 31 (moved to lucisv_core) = 58, matches exactly.
|
||||
- `main.rs`/`args.rs` call sites confirmed rewired: `use lucisv_core::config::Discovery`,
|
||||
`use lucisv_core::walk::{collect_files, EXTENSIONS}` (main.rs:28-29),
|
||||
`use lucisv_core::config::FileConfig` (args.rs:3). No `mod config;`/`mod walk;`
|
||||
left in `main.rs`.
|
||||
|
||||
**2. CLI behavior identical (corpus md5).** Built `target/release/vfmt` from
|
||||
**2. CLI behavior identical (corpus md5).** Built `target/release/lucisv` from
|
||||
the working tree and a second binary from a `git worktree add ... HEAD`
|
||||
checkout, ran `tools/corpus_check.sh` with each (`-b <binary>`) over the
|
||||
same `corpus/` tree (820 `.v`/`.sv` files — not 860 as the work log states;
|
||||
@@ -301,14 +301,14 @@ hash**, `diff` silent, `verification-error: none`, `crash: none` in both.
|
||||
Worktree removed after (`git worktree remove --force`).
|
||||
|
||||
**3. Server config — all sub-claims verified live**, driving the real
|
||||
`target/debug/vfmt-server` binary over stdio with a custom interactive
|
||||
`target/debug/lucisv-server` binary over stdio with a custom interactive
|
||||
Python driver (scratchpad: `drive_lsp.py`) that can mutate the filesystem
|
||||
*between* requests in one session — the packaged `talk()` e2e helper writes
|
||||
the whole session up front and can't do that, so this fills the gap the
|
||||
brief asked for ("drive the server live").
|
||||
- **Fresh discovery per request**: scratch dir with `vfmt.toml` (`indent=4`),
|
||||
- **Fresh discovery per request**: scratch dir with `lucisv.toml` (`indent=4`),
|
||||
`didOpen`, format with `tabSize:2` → 4-space output (config wins).
|
||||
Deleted `vfmt.toml` from disk, sent a `didChange` touch (same text),
|
||||
Deleted `lucisv.toml` from disk, sent a `didChange` touch (same text),
|
||||
formatted again → 2-space output (tabSize wins). Confirms the
|
||||
strongest claim in Assumptions.
|
||||
- **Bonus, not required by the brief**: repeated the above *without* the
|
||||
@@ -323,14 +323,14 @@ brief asked for ("drive the server live").
|
||||
touch is required.
|
||||
- **Precedence, `config > tabSize > default`**: unit test
|
||||
`a_config_file_beats_the_editors_tab_size` and e2e
|
||||
`a_vfmt_toml_governs_formatting_over_the_editors_tab_size` both green.
|
||||
- **Precedence edge (config silent on indent)**: scratch `vfmt.toml`
|
||||
`a_lucisv_toml_governs_formatting_over_the_editors_tab_size` both green.
|
||||
- **Precedence edge (config silent on indent)**: scratch `lucisv.toml`
|
||||
with only `line-length = 100`, formatted with `tabSize:3` →
|
||||
`newText` used 3-space indent (`"module m;\n wire a;\nendmodule\n"`).
|
||||
Per-setting precedence confirmed, not per-file.
|
||||
- **Broken config**: one `window/showMessage` (type 2 = Warning) per file
|
||||
change, formatting proceeds on defaults, CLI's `path:line: message`
|
||||
format preserved (`vfmt.toml:2` and `unknown key \`bogus\`` both
|
||||
format preserved (`lucisv.toml:2` and `unknown key \`bogus\`` both
|
||||
present in the message). Two formats with no edit between → exactly
|
||||
one warning (live-verified: warnings-after-format#1 = 1,
|
||||
warnings-after-format#2-no-edit = 1).
|
||||
@@ -342,15 +342,15 @@ brief asked for ("drive the server live").
|
||||
`didSave`-with-text, and on `didClose`) documents. Matches the README's
|
||||
"once per file change" rule to the letter — a config-only edit does
|
||||
not reset it (there's no code path that would), a document edit does.
|
||||
- `a_vfmt_toml_governs_formatting_over_the_editors_tab_size` and
|
||||
`a_broken_vfmt_toml_warns_once_and_still_formats`: both green,
|
||||
- `a_lucisv_toml_governs_formatting_over_the_editors_tab_size` and
|
||||
`a_broken_lucisv_toml_warns_once_and_still_formats`: both green,
|
||||
assertions match the brief exactly (`newText` diff, warning count,
|
||||
message content).
|
||||
|
||||
**4. Server scan.**
|
||||
- `state.rs`: confirmed `MAX_WALK_DEPTH`/`SOURCE_EXTENSIONS`/`walk()`/
|
||||
`is_source()` are gone; `source_files()` (state.rs:143) calls
|
||||
`vfmt_core::walk::collect_files` with `gitignore=true` always and
|
||||
`lucisv_core::walk::collect_files` with `gitignore=true` always and
|
||||
`Discovery::new(true).for_dir(root)`'s `exclude`, anchored per root —
|
||||
matches the "workspace-root config excludes" claim exactly.
|
||||
- Live-verified: scratch workspace with `.gitignore` containing
|
||||
@@ -363,46 +363,46 @@ brief asked for ("drive the server live").
|
||||
`a_broken_root_config_does_not_stop_the_scan`,
|
||||
`the_scan_takes_only_source_extensions` all present and green.
|
||||
- Follow-up filing: confirmed present in this README's Handshakes
|
||||
("Follow-up for whoever next touches `vfmt_core::walk`" — symlink-cycle
|
||||
("Follow-up for whoever next touches `lucisv_core::walk`" — symlink-cycle
|
||||
detection, deliberately deferred) and cross-referenced in
|
||||
`docs/features/vfmt-server/README.md`'s superseded-prose note
|
||||
`docs/features/lucisv-server/README.md`'s superseded-prose note
|
||||
("symlink-cycle exposure now shared with the CLI, filed as a follow-up
|
||||
in that feature's README"). Filing exists as claimed.
|
||||
|
||||
**5. Gates.**
|
||||
- `cargo test --workspace`: **512 passed, 0 failed** — summed every
|
||||
crate's reported count by hand to cross-check the workspace-wide
|
||||
figure (concurrent round's crates included): 27+48 (vfmt) + 31
|
||||
(vfmt_core) + 82+3 (vfmt_server) + 8+1+4+6+2+39 (vlog_formatter) +
|
||||
figure (concurrent round's crates included): 27+48 (lucisv) + 31
|
||||
(lucisv_core) + 82+3 (lucisv_server) + 8+1+4+6+2+39 (vlog_formatter) +
|
||||
71+30 (vlog_linter) + 53+24+19+17 (vlog_parser) + 6+1+19+20
|
||||
(vlog_semantic) + 1 doctest = 512. Exact match to the claim; the
|
||||
concurrent comments-round-2 work in `vlog_parser`/`vlog_formatter` was
|
||||
green at the time of this run.
|
||||
- Scoped counts confirmed exactly: `vfmt_core` 31 unit; `vfmt` 27 unit +
|
||||
48 CLI integration; `vfmt_server` 82 unit + 3 e2e (all three e2e tests
|
||||
- Scoped counts confirmed exactly: `lucisv_core` 31 unit; `lucisv` 27 unit +
|
||||
48 CLI integration; `lucisv_server` 82 unit + 3 e2e (all three e2e tests
|
||||
green, including `the_binary_serves_a_whole_session_over_stdio` which
|
||||
predates this round).
|
||||
- `cargo clippy --workspace --all-targets`: 0 warnings.
|
||||
- `cargo fmt --all --check`: clean.
|
||||
- Handshakes: both vfmt-server Handshake items 1 and 2 annotated
|
||||
**DELIVERED** in `docs/features/vfmt-server/README.md` (lines 256,
|
||||
- Handshakes: both lucisv-server Handshake items 1 and 2 annotated
|
||||
**DELIVERED** in `docs/features/lucisv-server/README.md` (lines 256,
|
||||
268), one line each as required, plus a Status/TODO checkbox flip and
|
||||
superseded-prose annotations on the two stale Assumptions bullets —
|
||||
all carrying a "(lead note)" attribution, consistent with this being
|
||||
the lead acting on the Handshakes request rather than dev-agent scope
|
||||
creep. `TODO.md:103` and `:120`x2 (via `git diff`, now at different
|
||||
line numbers) already point at `crates/vfmt_core/src/{config,walk}.rs`
|
||||
line numbers) already point at `crates/lucisv_core/src/{config,walk}.rs`
|
||||
— also already fixed, also outside this feature's own diff per the
|
||||
work log's file list. Nothing left for QA to do on these two items.
|
||||
|
||||
**6. CLAUDE.md compliance.**
|
||||
- `cargo tree -p vfmt_core`: single line, `vfmt_core v0.1.0 (...)`, zero
|
||||
- `cargo tree -p lucisv_core`: single line, `lucisv_core v0.1.0 (...)`, zero
|
||||
dependencies — std-only confirmed.
|
||||
- No `unwrap()`/`expect(`/`panic!` outside `#[cfg(test)]` in
|
||||
`vfmt_core/src/{config,walk,lib}.rs` or `vfmt_server/src/{format,state,
|
||||
`lucisv_core/src/{config,walk,lib}.rs` or `lucisv_server/src/{format,state,
|
||||
server}.rs` (checked with an awk pass that stops counting at the
|
||||
`#[cfg(test)]` marker per file — zero hits before it in every file).
|
||||
`vfmt/src/{main,args}.rs`'s `unwrap()`/`panic!` calls are all inside
|
||||
`lucisv/src/{main,args}.rs`'s `unwrap()`/`panic!` calls are all inside
|
||||
`#[cfg(test)] mod tests` blocks — allowed.
|
||||
- Every `pub` item in `config.rs`/`walk.rs` carries a `///` doc comment
|
||||
(spot-checked `FileConfig`, `parse`, `Discovery`, `EXTENSIONS`,
|
||||
@@ -447,7 +447,7 @@ Points reviewed and accepted:
|
||||
is (an editor default sent on every request, not a deliberate
|
||||
choice). Rejecting the CLI analogy (`--flag > config`) for the
|
||||
editor was correct — the whole feature exists to stop format-on-save
|
||||
fighting `vfmt --check` in CI, and treating an unconfigured editor's
|
||||
fighting `lucisv --check` in CI, and treating an unconfigured editor's
|
||||
4 as an override would have reintroduced that fight. QA verified the
|
||||
per-setting edge (config sets only line-length → tabSize still
|
||||
governs indent) live.
|
||||
@@ -466,6 +466,6 @@ Points reviewed and accepted:
|
||||
instinct, twice.
|
||||
|
||||
Lead fix on acceptance: the corpus file-count figure (860→820) per QA.
|
||||
The stale vfmt-server Assumptions this lift superseded were struck
|
||||
The stale lucisv-server Assumptions this lift superseded were struck
|
||||
through with lead notes at the editor-packaging review, alongside the
|
||||
TODO path pointers.
|
||||
@@ -1,9 +1,9 @@
|
||||
# vfmt-server
|
||||
# lucisv-server
|
||||
|
||||
## Goal
|
||||
|
||||
`crates/vfmt_server` is the analog of ruff's `ruff_server`: one binary,
|
||||
`vfmt-server`, that speaks LSP over stdio and serves both VS Code and
|
||||
`crates/lucisv_server` is the analog of ruff's `ruff_server`: one binary,
|
||||
`lucisv-server`, that speaks LSP over stdio and serves both VS Code and
|
||||
Vim/Neovim with no editor-specific logic below the protocol layer (TODO.md
|
||||
§6). Every engine it needs already exists — the tolerant parser, the span and
|
||||
line-index utilities, the `` `define`` table, `vlog_semantic` and the
|
||||
@@ -55,12 +55,12 @@ into a full instantiation skeleton and `signatureHelpProvider` names the ports
|
||||
inside a connection list — see
|
||||
`docs/features/refactor-instantiate/README.md`**, ~~and cross-file
|
||||
references~~ **delivered by references-nav (M7): `textDocument/references`
|
||||
now routes through the same collection a rename runs, so what vfmt lists and
|
||||
what vfmt would edit are one answer — see
|
||||
now routes through the same collection a rename runs, so what lucisv lists and
|
||||
what lucisv would edit are one answer — see
|
||||
`docs/features/references-nav/README.md`, which also brought
|
||||
`documentHighlight` for symbols and `foldingRange`.**
|
||||
(`vfmt.toml` discovery and `.gitignore`-aware indexing, deferred when this
|
||||
was written, were delivered by vfmt-core-lift the same day — lead note.)
|
||||
(`lucisv.toml` discovery and `.gitignore`-aware indexing, deferred when this
|
||||
was written, were delivered by lucisv-core-lift the same day — lead note.)
|
||||
|
||||
## Dependencies, and the justification CLAUDE.md asks for
|
||||
|
||||
@@ -193,7 +193,7 @@ handler is milliseconds; the complexity of a worker pool buys nothing yet.
|
||||
| layer | rebuilt when | cost |
|
||||
|---|---|---|
|
||||
| a document's `Semantics` + tokens + diagnostics | every `didOpen`/`didChange` | one file, full recompute |
|
||||
| the `WorkspaceIndex` | `initialize`, every `didSave`, every `workspace/didChangeWatchedFiles`, and a changed `vfmt.exclude`/`vfmt.filelist` | full re-scan of the roots |
|
||||
| the `WorkspaceIndex` | `initialize`, every `didSave`, every `workspace/didChangeWatchedFiles`, and a changed `lucisv.exclude`/`lucisv.filelist` | full re-scan of the roots |
|
||||
| the `` `include`` graph | with the `WorkspaceIndex`, from the same file list | a line scan per file (~6ms over the 860-file corpus). An open buffer's *own* includes are re-resolved on every request instead, so a line just typed is clickable before the next save |
|
||||
|
||||
**Per-file recompute on every keystroke** is the strategy TODO.md §6 states
|
||||
@@ -225,7 +225,7 @@ remains, honestly:** a client that did not advertise
|
||||
`workspace.didChangeWatchedFiles.dynamicRegistration` cannot be registered
|
||||
(the protocol has no static form of the capability) and keeps the save-only
|
||||
model above; nested `-f` filelists are not watched, only the root one;
|
||||
`vfmt.toml` is not watched either (it is re-read on every rebuild, so the next
|
||||
`lucisv.toml` is not watched either (it is re-read on every rebuild, so the next
|
||||
rebuild from any cause picks it up); and there is no time-based debouncing, so
|
||||
a burst arriving as several separate notifications costs one rebuild each.
|
||||
|
||||
@@ -254,7 +254,7 @@ not see.
|
||||
- **The workspace walk is plain.** `initialize`'s `workspace_folders` (falling
|
||||
back to `root_uri`) are walked recursively for `*.v`/`*.sv`/`*.vh`/`*.svh`.
|
||||
~~`.gitignore` and `--exclude` are **not** honored~~ **Superseded by
|
||||
vfmt-core-lift (lead note): the scan now uses the lifted `vfmt_core` walk —
|
||||
lucisv-core-lift (lead note): the scan now uses the lifted `lucisv_core` walk —
|
||||
`.gitignore` always on, workspace-root config excludes applied. The old
|
||||
64-directory depth cap is gone for CLI parity (symlink-cycle exposure now
|
||||
shared with the CLI, filed as a follow-up in that feature's README).**
|
||||
@@ -268,11 +268,11 @@ not see.
|
||||
becomes a second error item. Symbols and diagnostics in that state are
|
||||
oddly-placed but never wrong about their spans. This is the documented
|
||||
shape, not a bug in this crate.
|
||||
- ~~**`vfmt.toml` is not discovered.**~~ **Superseded by vfmt-core-lift
|
||||
(lead note): discovery now runs per formatting request via `vfmt_core`,
|
||||
- ~~**`lucisv.toml` is not discovered.**~~ **Superseded by lucisv-core-lift
|
||||
(lead note): discovery now runs per formatting request via `lucisv_core`,
|
||||
with precedence config > client tabSize > built-in default, and a broken
|
||||
config warns once and formats with defaults. See
|
||||
`docs/features/vfmt-core-lift/README.md`.**
|
||||
`docs/features/lucisv-core-lift/README.md`.**
|
||||
|
||||
## Handshakes
|
||||
|
||||
@@ -308,11 +308,11 @@ the binary's name and its stdio contract, nothing else.
|
||||
**Requested of other modules** — none of these block this round, and none was
|
||||
done here:
|
||||
|
||||
1. **DELIVERED** by `docs/features/vfmt-core-lift/README.md` (round 12):
|
||||
`config.rs` now lives in `crates/vfmt_core`, and formatting discovers
|
||||
`vfmt.toml` anchored at the document's own path. **`crates/vfmt`: make
|
||||
config discovery reusable.** `vfmt.toml` search,
|
||||
parsing and precedence live in `crates/vfmt/src/config.rs`, inside a binary
|
||||
1. **DELIVERED** by `docs/features/lucisv-core-lift/README.md` (round 12):
|
||||
`config.rs` now lives in `crates/lucisv_core`, and formatting discovers
|
||||
`lucisv.toml` anchored at the document's own path. **`crates/lucisv`: make
|
||||
config discovery reusable.** `lucisv.toml` search,
|
||||
parsing and precedence live in `crates/lucisv/src/config.rs`, inside a binary
|
||||
crate, so the server cannot call it. The LSP needs exactly the same
|
||||
answer the CLI gives for the same file, and duplicating the search rule is
|
||||
how the two silently diverge. The ask: lift `config.rs` into a small
|
||||
@@ -320,12 +320,12 @@ done here:
|
||||
`discover(path) -> Config`-shaped entry point. Until then the server
|
||||
formats with defaults, which is wrong for any project that sets
|
||||
`line-length`.
|
||||
2. **DELIVERED** by `docs/features/vfmt-core-lift/README.md` (round 12):
|
||||
`walk.rs` now lives in `crates/vfmt_core`, and the index scan uses it, so
|
||||
the index skips what the CLI skips. **`crates/vfmt`: make the ignore-aware
|
||||
2. **DELIVERED** by `docs/features/lucisv-core-lift/README.md` (round 12):
|
||||
`walk.rs` now lives in `crates/lucisv_core`, and the index scan uses it, so
|
||||
the index skips what the CLI skips. **`crates/lucisv`: make the ignore-aware
|
||||
walk reusable.** Same shape of
|
||||
problem for `walk.rs` (`.gitignore` + `--exclude`). The server's plain walk
|
||||
will index generated netlists a `vfmt` run would skip.
|
||||
will index generated netlists a `lucisv` run would skip.
|
||||
3. **`vlog_parser`: token-kind detail the lexer folds away.** Two spellings
|
||||
are indistinguishable in `TokenKind` today and are therefore classified
|
||||
coarsely by `semanticTokens` rather than reached for privately: an operator
|
||||
@@ -428,7 +428,7 @@ resolves a fence's info string against the language registry rather than
|
||||
against the hovered document. Changing the tag, or fencing a new surface with a
|
||||
different one, silently returns every card to flat grey. The three call sites
|
||||
pin the exact fenced string in their own tests; the registration is pinned by
|
||||
`crates/vfmt_server/tests/grammar.rs`, which also holds the extension's keyword
|
||||
`crates/lucisv_server/tests/grammar.rs`, which also holds the extension's keyword
|
||||
list to `vlog_parser::KEYWORDS`. Rationale and inventory:
|
||||
`docs/features/editor-packaging/README.md`.
|
||||
|
||||
@@ -451,7 +451,7 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory:
|
||||
- [x] Handler-level tests against constructed state, no process spawned.
|
||||
- [x] One end-to-end smoke test that spawns the built binary and speaks
|
||||
framed JSON-RPC.
|
||||
- [x] TODO.md §6 `vfmt_server` checkbox, annotated with what shipped.
|
||||
- [x] TODO.md §6 `lucisv_server` checkbox, annotated with what shipped.
|
||||
- [x] ~~**Not done, deliberately:** `rangeFormatting`. It reuses TODO.md §2's
|
||||
`--lines`, which does not exist yet; advertising the capability before
|
||||
the engine does is how an editor learns to distrust a server.~~
|
||||
@@ -479,8 +479,8 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory:
|
||||
(`vlog_refactor::find_references`) rather than from new machinery. The
|
||||
same round added `documentHighlight` for symbols and `foldingRange`.
|
||||
`docs/features/references-nav/README.md`.
|
||||
- [x] ~~**Not done:**~~ `vfmt.toml` discovery, `.gitignore`-aware indexing —
|
||||
delivered by vfmt-core-lift (both Handshakes below marked DELIVERED).
|
||||
- [x] ~~**Not done:**~~ `lucisv.toml` discovery, `.gitignore`-aware indexing —
|
||||
delivered by lucisv-core-lift (both Handshakes below marked DELIVERED).
|
||||
- [x] `textDocument/inlayHint` — delivered by **inlay-hints** (M8): port and
|
||||
parameter names on ordered connection lists, off the same
|
||||
`instantiation_plan` completion and signature help read.
|
||||
@@ -503,7 +503,7 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory:
|
||||
### 2026-08-25 — dev agent (M14 macro-expansion, 0.5.0)
|
||||
|
||||
- **No new capability, one new module, one card grew a section.**
|
||||
`crates/vfmt_server/src/expand.rs` turns a macro-use token plus the `Define`
|
||||
`crates/lucisv_server/src/expand.rs` turns a macro-use token plus the `Define`
|
||||
the card already chose into an "expands to" block; `hover.rs`'s private
|
||||
`define_text` takes the call text as a fourth argument and appends the
|
||||
section when there is one. `server.rs`, `state.rs`, the capability list and
|
||||
@@ -517,7 +517,7 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory:
|
||||
pinned by the e2e round trip, which now asserts a whole macro hover card byte
|
||||
for byte rather than by `contains`.
|
||||
- All eighteen pre-existing hover tests pass with no assertion changed.
|
||||
`cargo test -p vfmt_server`: **528 passed, 0 failed** (498 unit + 27 e2e +
|
||||
`cargo test -p lucisv_server`: **528 passed, 0 failed** (498 unit + 27 e2e +
|
||||
3 grammar), up 27. Rules and non-goals:
|
||||
`docs/features/macro-expansion/README.md`.
|
||||
|
||||
@@ -526,10 +526,10 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory:
|
||||
- **One new capability, two new modules, one lifted walk.**
|
||||
`callHierarchyProvider` is advertised as a plain `true` — the three requests
|
||||
are either all served or none are — `server.rs` gained three dispatch arms,
|
||||
and `crates/vfmt_server/src/hierarchy.rs` holds the answers. No engine
|
||||
and `crates/lucisv_server/src/hierarchy.rs` holds the answers. No engine
|
||||
change: `WorkspaceIndex` is read exactly as before.
|
||||
- **The instantiation walk is now shared.**
|
||||
`crates/vfmt_server/src/instantiations.rs` holds the walk that used to be
|
||||
`crates/lucisv_server/src/instantiations.rs` holds the walk that used to be
|
||||
private to `inlay.rs`, with the innermost enclosing module declaration
|
||||
threaded through it. `inlay.rs` calls it and ignores the owner; its 34 tests
|
||||
were left untouched as the evidence that the factoring changed nothing.
|
||||
@@ -555,7 +555,7 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory:
|
||||
- **One new capability, one new module, nothing else moved.**
|
||||
`inlayHintProvider` is advertised as `InlayHintOptions` with no
|
||||
`resolveProvider` (every hint is returned complete), `server.rs` gained one
|
||||
dispatch arm, and `crates/vfmt_server/src/inlay.rs` holds the whole answer.
|
||||
dispatch arm, and `crates/lucisv_server/src/inlay.rs` holds the whole answer.
|
||||
No engine change: `vlog_refactor::module_definition` +
|
||||
`instantiation_plan` were already public for M4, and this feature reads only
|
||||
the port/parameter **names** out of the plan.
|
||||
@@ -608,7 +608,7 @@ turned one of this crate's output details into a cross-module contract.
|
||||
`workspace-index` before writing anything. Every query this crate needed
|
||||
existed already; **no change was required in any engine crate**, which is
|
||||
the outcome the two-layer design in `workspace-index` was aiming for.
|
||||
- **Took the ordering lesson literally.** `crates/vfmt_server/` was created
|
||||
- **Took the ordering lesson literally.** `crates/lucisv_server/` was created
|
||||
with a `Cargo.toml` and a `fn main() {}` and *built* before the root
|
||||
`members` entry was added, then the entry, then a build, then the
|
||||
dependencies, then a build. A members line pointing at nothing breaks the
|
||||
@@ -664,19 +664,19 @@ turned one of this crate's output details into a cross-module contract.
|
||||
the server exits on `exit` so stdout closes and the read terminates on its
|
||||
own. No timeouts, no reader thread, and it cannot deadlock.
|
||||
- Did not touch `vlog_parser`, `vlog_formatter`, `vlog_semantic`,
|
||||
`vlog_linter` or `crates/vfmt`. Did not run `git commit`/`git push`.
|
||||
`vlog_linter` or `crates/lucisv`. Did not run `git commit`/`git push`.
|
||||
- **Concurrency note:** another agent's `vlog_linter` round is live in the same
|
||||
tree and added its own `members` line to the root `Cargo.toml` mid-round;
|
||||
left alone, as expected. Something in that round also ran `cargo fmt --all`
|
||||
across the tree, which reflowed a few of this crate's lines — harmless, and
|
||||
the final `cargo fmt --all --check` is clean.
|
||||
|
||||
**Results.** `cargo test -p vfmt_server`: **76 passed, 0 failed** (75 unit +
|
||||
**Results.** `cargo test -p lucisv_server`: **76 passed, 0 failed** (75 unit +
|
||||
1 e2e; counts trued up by the lead per the QA log — the workspace total
|
||||
below also moved as the concurrent linter round landed). `cargo test
|
||||
--workspace`: **494+ passed, 0 failed**. `cargo clippy
|
||||
--workspace --all-targets`: silent, 0 warnings. `cargo fmt --all --check`:
|
||||
clean. Files added: `crates/vfmt_server/{Cargo.toml,src/{main,server,state,
|
||||
clean. Files added: `crates/lucisv_server/{Cargo.toml,src/{main,server,state,
|
||||
convert,uri,locate,diagnostics,format,tokens,hover,nav,symbols}.rs,
|
||||
tests/e2e.rs}`, this README. Files edited: root `Cargo.toml` (one `members`
|
||||
entry, four `[workspace.dependencies]` lines — additive only), `TODO.md`
|
||||
@@ -686,21 +686,21 @@ entry, four `[workspace.dependencies]` lines — additive only), `TODO.md`
|
||||
|
||||
### 2026-08-19 — QA agent
|
||||
|
||||
Scope: `-p vfmt_server` only. Did not touch `vlog_linter`, `crates/vfmt`, or
|
||||
Scope: `-p lucisv_server` only. Did not touch `vlog_linter`, `crates/lucisv`, or
|
||||
`docs/features/linter-core` (a concurrent QA round owns those). No source was
|
||||
edited; this entry is the only write.
|
||||
|
||||
**Gates.** `cargo fmt -p vfmt_server -- --check`: clean. `cargo clippy -p
|
||||
vfmt_server --all-targets`: 0 warnings. `cargo test -p vfmt_server`: **76
|
||||
**Gates.** `cargo fmt -p lucisv_server -- --check`: clean. `cargo clippy -p
|
||||
lucisv_server --all-targets`: 0 warnings. `cargo test -p lucisv_server`: **76
|
||||
passed, 0 failed (75 unit + 1 e2e)** — stable across two runs. `cargo test
|
||||
--workspace`: green (503 passed at the instant measured; the concurrent
|
||||
`vlog_linter` round is landing tests live in the same tree, so this number
|
||||
moves independently of anything here — `-p vfmt_server`'s own 76 is the
|
||||
moves independently of anything here — `-p lucisv_server`'s own 76 is the
|
||||
number that matters for this feature and is not moving).
|
||||
|
||||
**Dependency audit, independently reproduced.** `git diff HEAD -- Cargo.lock`
|
||||
adds exactly the 18 named packages, plus two *local* workspace crates
|
||||
(`vfmt_server` itself and `vlog_linter`, the concurrent round — not part of
|
||||
(`lucisv_server` itself and `vlog_linter`, the concurrent round — not part of
|
||||
the transitive count). Exactly one `syn` resolves, `3.0.3`. Exact-pin lines
|
||||
in root `Cargo.toml` confirmed: `lsp-server = "=0.10.0"`, `lsp-types =
|
||||
"=0.97.0"`, `serde = "=1.0.229"`, `serde_json = "=1.0.140"`. Read all five
|
||||
@@ -740,11 +740,11 @@ All PASS:
|
||||
- `hover` on `` `WIDTH`` → macro body `` `define WIDTH 8``; `hover` on `K`
|
||||
(reached via `import P::K`) → `**parameter** — declared in pkg.sv:2`.
|
||||
- `didChange` introducing `localparam int ;` → two diagnostics, non-empty
|
||||
sane ranges (`severity: 1`, `source: "vfmt"`).
|
||||
sane ranges (`severity: 1`, `source: "lucisv"`).
|
||||
- `didChange` reverting the fix → **diagnostics array published empty** —
|
||||
the classic forgotten-clear case, verified actually clearing.
|
||||
- `textDocument/formatting` on the unformatted file → one edit whose
|
||||
`newText` is **byte-for-byte identical** to `target/debug/vfmt --stdout`
|
||||
`newText` is **byte-for-byte identical** to `target/debug/lucisv --stdout`
|
||||
on the same source.
|
||||
- `textDocument/formatting` on the already-formatted output → `result: []`.
|
||||
- `semanticTokens/full` on `B.sv` → decoded the delta stream by hand (12
|
||||
@@ -795,7 +795,7 @@ and `"clk"` (a common substring almost certainly matching far more than 256
|
||||
declarations across a real 860-file corpus) both return exactly 256 hits;
|
||||
`"uart_core"` returns the correct single hit.
|
||||
|
||||
*Tooling note, not a vfmt_server defect:* an earlier attempt at this same
|
||||
*Tooling note, not a lucisv_server defect:* an earlier attempt at this same
|
||||
check, using a persistent bidirectional-threaded Python client (a reader
|
||||
thread continuously draining stdout while the main thread issues requests —
|
||||
the natural way to extend the e2e pattern for an interactive multi-request
|
||||
@@ -815,18 +815,18 @@ flagging it so nobody mistakes the interactive-client hang for a server
|
||||
issue if they re-run a similar probe.
|
||||
|
||||
**CLAUDE.md / TODO.md compliance.** README has all seven required sections.
|
||||
TODO.md §6's `vfmt_server` checkbox (`TODO.md:330`) is checked and its
|
||||
TODO.md §6's `lucisv_server` checkbox (`TODO.md:330`) is checked and its
|
||||
shipped/not-shipped annotation matches the README's Capabilities table and
|
||||
Status/TODO checklist exactly — no over-claiming. Both filed Handshakes
|
||||
(`config.rs` and `walk.rs` lifting requests, README.md:370-371) are
|
||||
recorded; confirmed independently that `crates/vfmt` is `[[bin]]`-only (no
|
||||
recorded; confirmed independently that `crates/lucisv` is `[[bin]]`-only (no
|
||||
`[lib]` target in its `Cargo.toml`), so the Handshake's premise — that
|
||||
`vfmt_server` genuinely cannot call into them today — holds.
|
||||
`lucisv_server` genuinely cannot call into them today — holds.
|
||||
|
||||
**Minor, non-blocking:** the Work log's "Results" paragraph
|
||||
(README.md:447-448) says "75 passed, 0 failed (74 unit + 1 e2e)" and "493
|
||||
passed" workspace-wide. Current actual counts are 76 (75 unit + 1 e2e) and
|
||||
503 workspace-wide (the latter net of concurrent work). The `-p vfmt_server`
|
||||
503 workspace-wide (the latter net of concurrent work). The `-p lucisv_server`
|
||||
count is off by exactly one unit test from what's written — likely a test
|
||||
added after that paragraph was written. Not fixed here since it's prose in
|
||||
another agent's Work log entry, not a code or test defect; flagging so the
|
||||
@@ -848,7 +848,7 @@ What earned it:
|
||||
ten rounds of foundations were sufficient exactly as documented,
|
||||
which is the strongest validation the feature-README discipline has
|
||||
produced. Where the CLI's config/gitignore behavior couldn't be
|
||||
reached (they live in the vfmt binary), the dev filed Handshakes
|
||||
reached (they live in the lucisv binary), the dev filed Handshakes
|
||||
instead of duplicating logic — those two lifts are round-12 work.
|
||||
2. **Honest capability advertising**: deferred features are absent
|
||||
from the initialize result, so no editor is lied to. rangeFormatting
|
||||
@@ -22,7 +22,7 @@ expanded, not even checked for existence. Two reasons, and they are the reason
|
||||
this stays bookkeeping rather than becoming a preprocessor:
|
||||
|
||||
1. **Expanding the nest is preprocessing.** It needs a definition set, which
|
||||
needs the conditional-compilation state, which vfmt deliberately does not
|
||||
needs the conditional-compilation state, which lucisv deliberately does not
|
||||
have (`define-table`'s Assumptions: `` `ifdef`` arms are both recorded and
|
||||
neither is evaluated). One honest step is worth more than a cascade built on
|
||||
a guess about which arm is live.
|
||||
@@ -170,7 +170,7 @@ argument on a private function and one section on one card, `main.rs` gains one
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `crates/vfmt_server/src/expand.rs` (new, ~250 lines with tests):
|
||||
- [x] `crates/lucisv_server/src/expand.rs` (new, ~250 lines with tests):
|
||||
`single_step`, `has_macro_use`, `CAP`, `Expansion`. No dependencies.
|
||||
- [x] Argument splitting on top-level commas, mirroring `read_params`
|
||||
(nesting, strings, comments, `` `NAME()`` = zero arguments).
|
||||
@@ -189,7 +189,7 @@ argument on a private function and one section on one card, `main.rs` gains one
|
||||
trip pinning the exact card. All pre-existing hover tests unchanged.
|
||||
- [x] Version 0.5.0 across the workspace and the extension; `CHANGELOG.md`
|
||||
entry covering M7–M14.
|
||||
- [x] `define-table`'s promise annotated as kept; `vfmt-server`'s hover row
|
||||
- [x] `define-table`'s promise annotated as kept; `lucisv-server`'s hover row
|
||||
updated.
|
||||
- [ ] **Not done, deliberately:** expanding the nest (see "One step"),
|
||||
stringification/paste semantics, and a `` `define`` chosen by cursor
|
||||
@@ -200,7 +200,7 @@ argument on a private function and one section on one card, `main.rs` gains one
|
||||
|
||||
### 2026-08-25 — dev agent
|
||||
|
||||
- Read `CLAUDE.md`, the `define-table`, `include-nav` and `vfmt-server`
|
||||
- Read `CLAUDE.md`, the `define-table`, `include-nav` and `lucisv-server`
|
||||
READMEs, `hover.rs`, `defines.rs` and the lexer's `` ` `` arm before writing
|
||||
anything. Baseline: `cargo test --workspace` **1556 passed, 0 failed**;
|
||||
clippy silent; fmt clean.
|
||||
@@ -210,7 +210,7 @@ argument on a private function and one section on one card, `main.rs` gains one
|
||||
`(call text, Define)`, which is what let the substitution rules get 18 tests
|
||||
without constructing a `Workspace`.
|
||||
- **The hard decision was what "one step" excludes**, and it was decided by
|
||||
what vfmt already refuses to know. Expanding a nested `` `INNER`` would need
|
||||
what lucisv already refuses to know. Expanding a nested `` `INNER`` would need
|
||||
a definition set resolved through conditional compilation; `define-table`
|
||||
records both `` `ifdef`` arms and evaluates neither, so any cascade would sit
|
||||
on a guess. Stopping after one substitution pass also removes recursion,
|
||||
@@ -266,9 +266,9 @@ argument on a private function and one section on one card, `main.rs` gains one
|
||||
**1. Gates — PASS.** `cargo test --workspace`: **1583 passed, 0 failed**
|
||||
(summed across every test binary; matches the work log's claim exactly).
|
||||
`cargo clippy --all-targets`: silent. `cargo fmt --all --check`: clean.
|
||||
`node editors/vscode/smoke.js target/debug/vfmt-server`: `smoke: OK`.
|
||||
`node editors/vscode/smoke.js target/debug/lucisv-server`: `smoke: OK`.
|
||||
`npx @vscode/vsce ls` (in `editors/vscode/`): exit 0, manifest accepted.
|
||||
`vfmt --version` → `vfmt 0.5.0`. Version sweep: root `Cargo.toml`
|
||||
`lucisv --version` → `lucisv 0.5.0`. Version sweep: root `Cargo.toml`
|
||||
`version = "0.5.0"`, all eight crates inherit via `version.workspace = true`
|
||||
(confirmed by reading every `crates/*/Cargo.toml`), `editors/vscode/package.json`
|
||||
and `package-lock.json` (both places) at `0.5.0`, `tools/RELEASING.md`,
|
||||
@@ -326,7 +326,7 @@ plus my boundary probe above cover the char-vs-byte question from two angles;
|
||||
both green.
|
||||
|
||||
**5. M10-narrowing consistency — independently re-verified outside the unit
|
||||
tests**, by building two `vfmt-server` binaries and driving both over real
|
||||
tests**, by building two `lucisv-server` binaries and driving both over real
|
||||
stdio with a hand-written Python LSP client (temporary, deleted after the
|
||||
run — not `cargo test`, so it exercises the wire format the same way
|
||||
`smoke.js` does but for hover):
|
||||
@@ -337,7 +337,7 @@ run — not `cargo test`, so it exercises the wire format the same way
|
||||
narrowed definition, not a guess.
|
||||
- **2 candidates, unnarrowed, byte-identical to pre-M14.** Fixture: both
|
||||
`a.svh` (`x + 1`) and `b.svh` (`x + 2`) included, so the lookup lists both
|
||||
candidates. Built `vfmt-server` at HEAD (`36ddaba`, pre-M14, via
|
||||
candidates. Built `lucisv-server` at HEAD (`36ddaba`, pre-M14, via
|
||||
`git stash push -u` / `git stash pop` around the build — working tree
|
||||
restored immediately after, confirmed via `git status --short` matching the
|
||||
pre-stash listing exactly) and at the current M14 tree, ran the identical
|
||||
@@ -352,7 +352,7 @@ run — not `cargo test`, so it exercises the wire format the same way
|
||||
**6. Independent e2e — PASS.** Same Python stdio client (not the dev's
|
||||
`e2e.rs`, a separate harness) against `` `define M(x) x + 1`` / `` `M(7)``
|
||||
returned `expands to` → `7 + 1` over the real LSP wire. The dev's own
|
||||
`crates/vfmt_server/tests/e2e.rs::a_macro_call_hover_carries_its_single_step_expansion_over_the_wire`
|
||||
`crates/lucisv_server/tests/e2e.rs::a_macro_call_hover_carries_its_single_step_expansion_over_the_wire`
|
||||
was also run and pins a whole card byte for byte
|
||||
(`` `define MAX(a, b) ((a) > (b) ? (a) : (b))`` / `` `MAX(p, q + 1)`` →
|
||||
`((p) > (q + 1) ? (p) : (q + 1))``) — both independently green.
|
||||
@@ -378,8 +378,8 @@ work log: `expand.rs` 18 unit tests (counted directly, matches), `hover.rs`
|
||||
(`a_macro_call_hover_carries_its_single_step_expansion_over_the_wire`,
|
||||
confirmed present and green), 1583 total workspace (summed every `test
|
||||
result: ok` line myself rather than trusting the printed total).
|
||||
`vfmt_server`'s own count (498 unit + 27 e2e + 3 grammar = 528, from
|
||||
`docs/features/vfmt-server/README.md`'s work log) reproduced exactly with a
|
||||
`lucisv_server`'s own count (498 unit + 27 e2e + 3 grammar = 528, from
|
||||
`docs/features/lucisv-server/README.md`'s work log) reproduced exactly with a
|
||||
clean tree; it read 510 while my 12 temporary QA tests were still present
|
||||
(510 − 12 = 498), which is itself a small confirmation the base count is
|
||||
honest rather than coincidental.
|
||||
|
||||
@@ -197,7 +197,7 @@ precisely to carry free text:
|
||||
|
||||
The leading whitespace of `line two` is part of the string's **value**.
|
||||
Round 1 re-indented it like any other continuation line (QA measured 3 spaces
|
||||
becoming 7) *and* masked the change in `verify.rs`, so `vfmt` exited 0 and
|
||||
becoming 7) *and* masked the change in `verify.rs`, so `lucisv` exited 0 and
|
||||
wrote corrupted code — a real violation of hard invariant #1. The same hole
|
||||
existed for `` `define `` bodies with a `\`-continued string and for
|
||||
`(* attr = "..." *)`; both pre-date this feature and are fixed here too, since
|
||||
@@ -271,7 +271,7 @@ From QA round 1 (2026-08-19):
|
||||
Re-ran `./tools/corpus_check.sh corpus` against the same pinned 820-file corpus
|
||||
as the baseline in `docs/features/corpus-check/README.md`. The corpus was
|
||||
verified unmodified afterwards (`git status --porcelain` clean in all four
|
||||
repos; only the untracked `.vfmt-corpus-rev` stamps show).
|
||||
repos; only the untracked `.lucisv-corpus-rev` stamps show).
|
||||
|
||||
| metric | baseline (35.2% era) | after macro-items |
|
||||
|---|---|---|
|
||||
@@ -404,7 +404,7 @@ argument — one file per dialect the corpus README named.
|
||||
gained, **0 lost**, and all 22 new verification errors traced back to the
|
||||
four root causes already catalogued in the corpus-check README (none touches
|
||||
a macro token). Confirmed all four corpus repos unmodified afterwards.
|
||||
- Did not touch `tools/`, `corpus/`, `crates/vfmt/` or `TODO.md` (no matching
|
||||
- Did not touch `tools/`, `corpus/`, `crates/lucisv/` or `TODO.md` (no matching
|
||||
checkbox exists). Did not run `git commit`/`git push`.
|
||||
|
||||
**Results:** `cargo test --workspace` **95 passed, 0 failed** (up from 86: +4
|
||||
@@ -420,7 +420,7 @@ Files touched: `crates/vlog_parser/src/{lexer,token,ast,parser}.rs`,
|
||||
|
||||
- **Reproduced the blocking finding before touching anything**, end-to-end
|
||||
through the real debug binary rather than from the QA write-up: the string's
|
||||
second line went from 3 leading spaces to 7, `vfmt` exited 0, and the file
|
||||
second line went from 3 leading spaces to 7, `lucisv` exited 0, and the file
|
||||
was written. Confirmed QA's point that convergence does not help — the
|
||||
corrupted output is a stable fixed point, so re-formatting reproduces it.
|
||||
- **Widened the finding before fixing it.** QA reported it against macro
|
||||
@@ -463,7 +463,7 @@ Files touched: `crates/vlog_parser/src/{lexer,token,ast,parser}.rs`,
|
||||
verification-error, 0 crash; 179 gained, **0 lost** against the committed
|
||||
baseline. Honest delta from this fix: **zero**, because no corpus file
|
||||
carries a string across a line break inside a macro, directive or attribute.
|
||||
The fix is about what vfmt would do to code it has not met yet, which is the
|
||||
The fix is about what lucisv would do to code it has not met yet, which is the
|
||||
whole point of the net. All four corpus repos confirmed unmodified.
|
||||
|
||||
**Results:** `cargo test --workspace` **98 passed, 0 failed** (up from 95: +3
|
||||
@@ -491,7 +491,7 @@ time before moving on).
|
||||
|
||||
**Tools — exact results.**
|
||||
- `cargo test --workspace`: **95 passed, 0 failed**, 0 ignored, across
|
||||
vfmt (18 unit + 13 cli), vlog_formatter (3 unit + 1 cases + 4 deep_nesting +
|
||||
lucisv (18 unit + 13 cli), vlog_formatter (3 unit + 1 cases + 4 deep_nesting +
|
||||
2 fixtures + 22 verification), vlog_parser (32 unit). Matches the claimed
|
||||
86→95 (+4 lexer, +3 parser, +2 verification).
|
||||
- `cargo clippy --all-targets`: silent, 0 warnings (`grep -c warning:` → 0).
|
||||
@@ -509,12 +509,12 @@ body, package body, generate region, generate `if`/`for`/`case`, `begin`/
|
||||
without-`begin`, `for`-without-`begin`, `foreach`-without-`begin`,
|
||||
case-item body, `else` branch, sole content of a generate `if`/`else` block
|
||||
— all parse, format, and round-trip idempotent (formatted, then `--check`d
|
||||
the result → exit 0) via `target/debug/vfmt -`. Did **not** find a statement
|
||||
the result → exit 0) via `target/debug/lucisv -`. Did **not** find a statement
|
||||
position where a macro fails to parse; this claim holds without
|
||||
qualification for everywhere tested.
|
||||
|
||||
**Claim 2 (disambiguation) — PASS, with one documented edge case.**
|
||||
Adversarial cases through `target/release/vfmt -` (or debug, same logic):
|
||||
Adversarial cases through `target/release/lucisv -` (or debug, same logic):
|
||||
|
||||
| input | result |
|
||||
|---|---|
|
||||
@@ -569,7 +569,7 @@ equivalence check passes.
|
||||
|
||||
Reproduced two ways:
|
||||
|
||||
1. **End-to-end through the real binary** (`target/debug/vfmt -`), no
|
||||
1. **End-to-end through the real binary** (`target/debug/lucisv -`), no
|
||||
handcrafted internals:
|
||||
```
|
||||
module m;
|
||||
@@ -650,7 +650,7 @@ TSV (`corpus-check-results.tsv` is gitignored and only the post-feature copy
|
||||
was on disk), so per the task instructions I rebuilt one: `git worktree add`
|
||||
a detached checkout at `HEAD` (no stash, no modification to the working
|
||||
tree — verified `git status --porcelain` identical before/after), built
|
||||
`target/release/vfmt` there, and ran `tools/corpus_check.sh` against the
|
||||
`target/release/lucisv` there, and ran `tools/corpus_check.sh` against the
|
||||
*same* corpus with `-b` pointed at that baseline binary vs. the feature
|
||||
binary. Worktree removed after.
|
||||
|
||||
@@ -669,7 +669,7 @@ would-reformat file silently became verification-error, etc.) — the +22
|
||||
verification-errors are entirely accounted for by files that were
|
||||
parse-error at baseline and land in verification-error now, matching the
|
||||
dev's claim precisely. All four corpus repos confirmed `git status
|
||||
--porcelain` clean except the untracked `.vfmt-corpus-rev` stamp, both
|
||||
--porcelain` clean except the untracked `.lucisv-corpus-rev` stamp, both
|
||||
before and after. Ran the feature corpus check twice — byte-identical TSVs
|
||||
both times (deterministic).
|
||||
|
||||
@@ -733,7 +733,7 @@ test files were dropped into `crates/vlog_formatter/tests/`, run, and
|
||||
removed, verified clean each time.
|
||||
|
||||
**1. Original repro re-run — FIXED, confirmed both ways.**
|
||||
- End-to-end through `target/debug/vfmt -` on the exact round-1 input: exit
|
||||
- End-to-end through `target/debug/lucisv -` on the exact round-1 input: exit
|
||||
0, and the string's second line is now byte-identical between input and
|
||||
output (`"line one\n line two with leading spaces"` — 3 leading spaces
|
||||
in, 3 leading spaces out; previously became 7). Idempotent (formatted the
|
||||
@@ -758,14 +758,14 @@ each through the real binary for idempotency:
|
||||
| `/* ... */` comment spanning lines with quotes inside, followed by a real string | corruption of the real string **rejected**; reindenting *inside* the block comment itself (no real string reachable from it) is still **accepted** | verbatim for the string; comment-only case reindents normally, idempotent |
|
||||
| a string containing `/*` (must not be read as opening a comment) | corruption inside that string **rejected** | verbatim, idempotent |
|
||||
| backtick-nested macro, inner string spans a line inside the outer token's raw text (`` `A("x", `B("y\nz")) ``) | corruption inside the inner string **rejected** | verbatim, idempotent |
|
||||
| CRLF: `\r` immediately before an in-string `\n` | corruption (reindent) of the string **rejected**; the `\r` is not silently trimmed as ordinary whitespace | in practice the lexer strips `\r` from every token before it's ever recorded, so real `vfmt` input never carries `\r` this deep — confirmed by feeding it a raw `\r\n` file end-to-end: output is pure `\n`, idempotent. The `verify_equivalence`-level test still matters because that function accepts raw strings from any caller, not just the file-reading pipeline. |
|
||||
| CRLF: `\r` immediately before an in-string `\n` | corruption (reindent) of the string **rejected**; the `\r` is not silently trimmed as ordinary whitespace | in practice the lexer strips `\r` from every token before it's ever recorded, so real `lucisv` input never carries `\r` this deep — confirmed by feeding it a raw `\r\n` file end-to-end: output is pure `\n`, idempotent. The `verify_equivalence`-level test still matters because that function accepts raw strings from any caller, not just the file-reading pipeline. |
|
||||
| CRLF, reindent outside any string | **accepted** | reindented normally, idempotent |
|
||||
|
||||
Repro saved to the QA scratchpad as `qa_round2_state_machine_attack.rs`
|
||||
(10/10 passed, not committed). No masked-corruption pair survived.
|
||||
|
||||
**3. Directive/Attribute fix — confirmed end-to-end.** Ran the dev's two
|
||||
named repro shapes through `target/debug/vfmt -`:
|
||||
named repro shapes through `target/debug/lucisv -`:
|
||||
- `` `define MSG "line one \<newline> line two" `` inside an indented
|
||||
block: output's continuation line is byte-identical to input
|
||||
(` line two"`, 3 leading spaces, untouched) — previously this pre-existing
|
||||
@@ -808,7 +808,7 @@ containing a bare `"` still reindents normally end-to-end).
|
||||
files, exactly as the dev predicted (no corpus file carries a string
|
||||
across a line break inside a macro/directive/attribute). All four corpus
|
||||
repos confirmed `git status --porcelain` clean (only the untracked
|
||||
`.vfmt-corpus-rev` stamp) before and after.
|
||||
`.lucisv-corpus-rev` stamp) before and after.
|
||||
- `git status --porcelain`: identical to the dev's stated diff throughout —
|
||||
no stray files left behind.
|
||||
|
||||
@@ -845,7 +845,7 @@ errors.
|
||||
The rejection was for the one thing that matters more than any feature:
|
||||
the verify.rs normalization added for multi-line macro tokens could mask
|
||||
real corruption — a string literal spanning lines inside a macro arg had
|
||||
its bytes changed by re-indent, and vfmt exited 0. First genuine
|
||||
its bytes changed by re-indent, and lucisv exited 0. First genuine
|
||||
invariant-#1 violation in the project. Credit where due on the rework:
|
||||
|
||||
1. **The dev widened the finding before fixing it** — the same defect
|
||||
|
||||
@@ -81,7 +81,7 @@ A fourth shape was investigated and deliberately **not** implemented: see
|
||||
defined in `corpus/ibex/dv/formal/check/top.sv:206` as a chain of `` `X(...)
|
||||
`` invocations, and the file-local `` `define X(c) ... && `` makes the
|
||||
expansion end in a dangling `&&`, so `` `X_EACH_CSR 1 `` is one expression
|
||||
only *after* preprocessing. vfmt deliberately does not read `` `define ``
|
||||
only *after* preprocessing. lucisv deliberately does not read `` `define ``
|
||||
bodies from other files, and the only rule that would accept the shape
|
||||
without them — "a macro in expression position may be followed by an
|
||||
operand" — would have to accept `` `A b `` everywhere, which is exactly the
|
||||
@@ -243,7 +243,7 @@ would fail to lex and the net would refuse it, which is what
|
||||
|
||||
| file | category | reason |
|
||||
|---|---|---|
|
||||
| `corpus/ibex/dv/formal/check/peek/compare_helper.sv` | macro-items | `` `X_EACH_CSR 1 `` — needs the macro body, which lives in another file vfmt does not read. See Assumptions. Not mine to fix and not fixable. |
|
||||
| `corpus/ibex/dv/formal/check/peek/compare_helper.sv` | macro-items | `` `X_EACH_CSR 1 `` — needs the macro body, which lives in another file lucisv does not read. See Assumptions. Not mine to fix and not fixable. |
|
||||
| `corpus/picorv32/scripts/smtbmc/mulcmp.v` | other | Not in this cluster's scope (deliberately unsupported). |
|
||||
|
||||
**Gates.** `cargo fmt --all` clean; `cargo clippy --all-targets` clean (no new
|
||||
@@ -312,7 +312,7 @@ correctly *forgiven* (so the fix isn't just "reject everything").
|
||||
prefix-truncation and every single-character deletion (2231 trials): 0
|
||||
crashes, 0 timeouts, every one either a clean exit 0/1 or a clean exit 2.
|
||||
Ran a second pass inserting a block comment and a line comment at every
|
||||
whitespace/newline gap, wrapping each case in `// vfmt: off` / `// vfmt: on`
|
||||
whitespace/newline gap, wrapping each case in `// lucisv: off` / `// lucisv: on`
|
||||
fences, and running `--lines <N>-<N>` for every line (807 trials): same, 0
|
||||
crashes.
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ now serves both the opening and the closing label, which used to be parsed by
|
||||
two different snippets).
|
||||
|
||||
**Promised to `vlog_semantic`** (and to the workspace index, and to
|
||||
`vfmt_server` when it exists):
|
||||
`lucisv_server` when it exists):
|
||||
|
||||
- Every field in the table above is the exact byte range of the name as
|
||||
written: `src[name_span] == name`, with the one documented
|
||||
@@ -313,7 +313,7 @@ the same expected strings. Nothing else in any existing test moved. `cargo clipp
|
||||
warning. `cargo fmt --all --check` clean. `tools/corpus_check.sh corpus`
|
||||
(read-only): 820 files, **0 verification errors, 0 crashes**, TSV md5
|
||||
`aa982463f68c1a3568c02a0fc5e0c455` — byte-identical to the baseline. Corpus
|
||||
repos clean apart from the pre-existing untracked `.vfmt-corpus-rev` stamps.
|
||||
repos clean apart from the pre-existing untracked `.lucisv-corpus-rev` stamps.
|
||||
`cargo test -p vlog_semantic --test corpus`: 21 485 symbols, 73 708
|
||||
references, **0 names unplaced**, unchanged in every digit.
|
||||
|
||||
@@ -337,7 +337,7 @@ commit/push.
|
||||
19, `tests/spans.rs` **17**, up from 12 as claimed).
|
||||
- `cargo test -p vlog_formatter`, `-p vlog_semantic`, `--workspace`: all
|
||||
green. Per-crate counts summed to **299 passed, 0 failed**, matching the
|
||||
work log exactly (50+30+8+1+4+6+2+39 vfmt/vlog_formatter,
|
||||
work log exactly (50+30+8+1+4+6+2+39 lucisv/vlog_formatter,
|
||||
53+24+19+17 vlog_parser, 6+1+19+20 vlog_semantic).
|
||||
- `cargo clippy --workspace --all-targets`: silent (forced a re-check with
|
||||
`touch` on `parser.rs` first, since a cached `Finished` line proves
|
||||
@@ -419,7 +419,7 @@ mutate/revert cycle is **byte-identical** (diffed the two `git diff` outputs
|
||||
directly).
|
||||
|
||||
**Formatter byte-identity beyond the corpus TSV (claim 4).** Built a
|
||||
baseline `vfmt` release binary from a `git worktree` at `HEAD` (`7cf657a`,
|
||||
baseline `lucisv` release binary from a `git worktree` at `HEAD` (`7cf657a`,
|
||||
the dev's stated baseline — confirmed by the worktree's own "detached HEAD
|
||||
7cf657a" message). Formatted 5 corpus files with `--stdout` (non-mutating)
|
||||
on both the baseline and the current worktree binary and md5'd the output:
|
||||
@@ -431,7 +431,7 @@ tree at `7cf657a`, matching `master`'s current position (branch is `[ahead
|
||||
8]` of its upstream, unrelated to this feature).
|
||||
|
||||
**Process note, not a feature defect — full disclosure.** My first pass at
|
||||
the byte-identity check invoked `vfmt <file>` (no `--stdout`/`--check`),
|
||||
the byte-identity check invoked `lucisv <file>` (no `--stdout`/`--check`),
|
||||
which writes in place; this reformatted `corpus/common_cells/src/
|
||||
binary_to_gray.sv` once. Caught it because the corpus repos under `corpus/`
|
||||
are themselves real git checkouts (from `tools/corpus_fetch.sh`, gitignored
|
||||
@@ -439,7 +439,7 @@ at the top level but each subdir has its own `.git`): `git status` inside
|
||||
`corpus/common_cells` showed the one modified file, `git checkout --
|
||||
src/binary_to_gray.sv` restored it exactly, and a follow-up `git status` in
|
||||
all four corpus repos (`common_cells`, `ibex`, `picorv32`, `opentitan`) came
|
||||
back clean (only the pre-existing untracked `.vfmt-corpus-rev` stamps). The
|
||||
back clean (only the pre-existing untracked `.lucisv-corpus-rev` stamps). The
|
||||
corpus-md5 gate above and the semantic-corpus numbers were both captured
|
||||
*after* this restoration, so neither is affected. Re-ran the 5-file
|
||||
comparison with `--stdout` afterward, which is what the numbers above
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
TODO §4's "one parse, two tools", delivered on the linter side: parse a file
|
||||
once and lint from those products, instead of every consumer re-lexing and
|
||||
re-parsing text somebody already parsed. `LintContext` gains a constructor
|
||||
that accepts pre-built parse products; `vfmt check` builds the products once
|
||||
per file; and `vfmt_server` — which already holds a fully analyzed `Document`
|
||||
that accepts pre-built parse products; `lucisv check` builds the products once
|
||||
per file; and `lucisv_server` — which already holds a fully analyzed `Document`
|
||||
per buffer — lints from that document's own tokens and tree rather than
|
||||
paying two extra lexes and an extra tolerant parse per keystroke. Behavior is
|
||||
the hard gate: every finding, position, fix, diagnostic and exit code is
|
||||
@@ -36,7 +36,7 @@ byte-identical to before; only duplicated work is removed.
|
||||
them, keeps them where they always were: on `Document`.
|
||||
- **The `--fix` loop's per-round re-parse is inherent.** Each round rewrites
|
||||
the text, and products of the old text describe nothing. Only the *first*
|
||||
round of `vfmt check --fix` (and all of a plain `vfmt check`) saves work.
|
||||
round of `lucisv check --fix` (and all of a plain `lucisv check`) saves work.
|
||||
- **Per-change recompute stays the server's model.** This round removes
|
||||
duplicate work *within* one change/request; it adds no caching or
|
||||
invalidation machinery beyond what `Document` already is (TODO §6:
|
||||
@@ -62,7 +62,7 @@ unchanged in behavior):
|
||||
construction.
|
||||
- `pub struct ParsedSource` + `ParsedSource::parse(source) -> ParsedSource` +
|
||||
`ParsedSource::context(&self, path) -> LintContext<'_>` — the owned bundle
|
||||
of products for callers with no `Document` of their own (`vfmt check`, and
|
||||
of products for callers with no `Document` of their own (`lucisv check`, and
|
||||
`run`/`LintContext::new` internally). `parse` lexes **once** and builds the
|
||||
tree from a clone of the token stream.
|
||||
- `LintContext::new(source, path)` **stays**, as the convenience wrapper the
|
||||
@@ -77,7 +77,7 @@ unchanged in behavior):
|
||||
**Consumed**
|
||||
|
||||
- `vlog_parser::parse_tolerant(tokens, source)` — newly consumed by
|
||||
`vlog_linter` and `vfmt_server` (both already depended on the crate; it was
|
||||
`vlog_linter` and `lucisv_server` (both already depended on the crate; it was
|
||||
already `pub`). Relied on: with the same tokens it returns exactly the tree
|
||||
`parse_source_tolerant(source)` would (that function *is* `tokenize` +
|
||||
`parse_tolerant`), and on a well-formed file the tree equals `parse`'s.
|
||||
@@ -86,12 +86,12 @@ unchanged in behavior):
|
||||
|
||||
**Changed call sites**
|
||||
|
||||
- `crates/vfmt/src/lint.rs::run_rules` — parses once via `ParsedSource` and
|
||||
- `crates/lucisv/src/lint.rs::run_rules` — parses once via `ParsedSource` and
|
||||
hands the products to the context.
|
||||
- `crates/vfmt_server/src/state.rs::Document` — gains the `tree: SourceFile`
|
||||
- `crates/lucisv_server/src/state.rs::Document` — gains the `tree: SourceFile`
|
||||
field (it was parsed and thrown away after `analyze`), and `Document::new`
|
||||
lexes once instead of twice.
|
||||
- `crates/vfmt_server/src/lint.rs::{violations, fixable}` — the one call site
|
||||
- `crates/lucisv_server/src/lint.rs::{violations, fixable}` — the one call site
|
||||
server-lint's README predicted: both lint from the document's own products
|
||||
via `from_parse` instead of re-parsing `doc.text`.
|
||||
|
||||
@@ -108,7 +108,7 @@ products for, per request, as of the start of this round:
|
||||
| `Document::new` (every buffer change) | the text lexed twice: `tokenize` for `doc.tokens`, then `parse_source_tolerant`'s internal `tokenize` | **Eliminated** — one lex, tree built by `parse_tolerant` over a clone of the tokens; the lex-error fallback still goes through `parse_source_tolerant` so the error tree and diagnostic are byte-identical |
|
||||
| `format::formatting` / `range_formatting` | `format_source`/`format_range` lex+parse strictly inside `vlog_formatter` | **Kept** — the formatter's parse is the *strict* one (a tree `Document` does not hold), and the runtime safety net (equivalence + convergence) is defined over `format_source` doing its own work; sharing would need `vlog_formatter` API changes, which is the concurrent round's crate and a different feature |
|
||||
| `Workspace::rebuild_index` (initialize + every didSave) | re-reads and re-parses every workspace file inside `WorkspaceIndex::build`, open unchanged buffers included | **Kept** — the documented full-scan index model (TODO §6 defers incrementality to salsa); making it incremental is invalidation machinery this round explicitly must not build |
|
||||
| `semanticTokens`, `hover`, `definition`, `references`, `documentSymbol`, `workspace/symbol`, `diagnostics::diagnostics` | none — all already read `doc.tokens` / `doc.semantics` / `doc.defines` / `doc.diagnostics` | already clean (verified by grep for `tokenize`/`parse` over `crates/vfmt_server/src`) |
|
||||
| `semanticTokens`, `hover`, `definition`, `references`, `documentSymbol`, `workspace/symbol`, `diagnostics::diagnostics` | none — all already read `doc.tokens` / `doc.semantics` / `doc.defines` / `doc.diagnostics` | already clean (verified by grep for `tokenize`/`parse` over `crates/lucisv_server/src`) |
|
||||
|
||||
## The protected_regions decision: left alone
|
||||
|
||||
@@ -121,7 +121,7 @@ construction"? Almost — the server would pass `doc.tree` and the CLI its
|
||||
current round's tree — but "almost" is the problem: the CLI's `--fix` loop
|
||||
rebuilds text every round, and a future caller passing last round's tree is
|
||||
precisely the bug the `&str` signature makes unwritable. The cost lands only
|
||||
on fix-application paths (`vfmt check --fix`, `textDocument/codeAction`),
|
||||
on fix-application paths (`lucisv check --fix`, `textDocument/codeAction`),
|
||||
never on the per-keystroke diagnostics path. Two further reasons to leave
|
||||
it: it is `vlog_formatter`'s code, which belongs to the concurrent
|
||||
dynamic-types round this session; and the interior parse is of the *current*
|
||||
@@ -134,22 +134,22 @@ answer.**
|
||||
- [x] `vlog_linter`: `LintContext<'a>`, `from_parse`, `ParsedSource`,
|
||||
`new` kept as the wrapper; single-lex parse recipe in one place.
|
||||
- [x] Rules, visitors, waivers untouched (they compile and read unchanged).
|
||||
- [x] `crates/vfmt/src/lint.rs`: `run_rules` parses once via `ParsedSource`.
|
||||
- [x] `crates/vfmt_server`: `Document.tree` kept; `Document::new` single-lex;
|
||||
- [x] `crates/lucisv/src/lint.rs`: `run_rules` parses once via `ParsedSource`.
|
||||
- [x] `crates/lucisv_server`: `Document.tree` kept; `Document::new` single-lex;
|
||||
`lint::violations`/`fixable` lint from the document's products.
|
||||
- [x] Server catalog above; semanticTokens/hover verified already clean.
|
||||
- [x] protected_regions decision written (left alone).
|
||||
- [x] Tests: products-in == source-in property over rule-test inputs;
|
||||
lex-error and broken-file paths; existing CLI + server suites green
|
||||
**unmodified**.
|
||||
- [x] Byte-identity: corpus `vfmt check` (text + JSON) vs a HEAD worktree
|
||||
- [x] Byte-identity: corpus `lucisv check` (text + JSON) vs a HEAD worktree
|
||||
binary; server diagnostics vs a HEAD worktree binary over a real stdio
|
||||
session.
|
||||
- [x] Timing before/after.
|
||||
- [x] TODO §4 checkbox + linter-core / server-lint annotation lines.
|
||||
- [ ] **Not done, deliberately:** `vfmt format` sharing the parse. The
|
||||
- [ ] **Not done, deliberately:** `lucisv format` sharing the parse. The
|
||||
formatter requires a *strict* parse and runs its safety net over its own
|
||||
products; wiring `vfmt check --fix --format` workflows is a future
|
||||
products; wiring `lucisv check --fix --format` workflows is a future
|
||||
feature and is not blocked by anything here.
|
||||
- [ ] **Not done, deliberately:** any caching/invalidation in the server
|
||||
beyond `Document`'s per-change recompute.
|
||||
@@ -161,7 +161,7 @@ answer.**
|
||||
- Read `CLAUDE.md`, TODO §4, and the linter-core / server-lint /
|
||||
shared-fence-filter READMEs in full (QA logs and Reviews included) before
|
||||
writing anything, then the code: `vlog_linter`'s `context.rs`/`lib.rs`,
|
||||
`crates/vfmt/src/lint.rs`, and every file in `crates/vfmt_server/src`.
|
||||
`crates/lucisv/src/lint.rs`, and every file in `crates/lucisv_server/src`.
|
||||
- **The design was forced by one fact: `SourceFile` is not `Clone`.** The
|
||||
server's `Document` owns one tree that must serve semantics, published
|
||||
diagnostics *and* linting, so the products constructor has to borrow —
|
||||
@@ -196,7 +196,7 @@ answer.**
|
||||
`lint::violations` and `lint::fixable` now share a four-line `context(doc)`
|
||||
helper over `from_parse`. `vlog_linter::run` is no longer imported there.
|
||||
The catalog above was compiled by grepping `tokenize|parse` over
|
||||
`crates/vfmt_server/src` and reading each hit.
|
||||
`crates/lucisv_server/src` and reading each hit.
|
||||
- **Tests.** The products-in == source-in property was put where it covers
|
||||
the most ground: inside the rule-test harness's `assert_lint_with`, so all
|
||||
55 inline-marker cases (every rule × fires/quiet/waived/unused-waiver,
|
||||
@@ -205,9 +205,9 @@ answer.**
|
||||
Two new unit tests in `context.rs`: borrowed-vs-owned accessor equality,
|
||||
and the lex-error fallback producing the exact old error tree. Existing
|
||||
CLI and server suites pass **unmodified** (`git diff` on
|
||||
`crates/vfmt/tests`, `crates/vfmt_server` tests: empty).
|
||||
`crates/lucisv/tests`, `crates/lucisv_server` tests: empty).
|
||||
- Did not touch `vlog_parser`, `vlog_formatter`, `vlog_semantic`,
|
||||
`vfmt_core`, `editors/**`, or any `Cargo.toml`/`Cargo.lock` (no dependency
|
||||
`lucisv_core`, `editors/**`, or any `Cargo.toml`/`Cargo.lock` (no dependency
|
||||
moved; `parse_tolerant` was already `pub`). Did not run
|
||||
`git commit`/`git push`.
|
||||
- **Concurrency note.** A dynamic-types round was announced live in
|
||||
@@ -220,18 +220,18 @@ answer.**
|
||||
**Results.**
|
||||
|
||||
- `cargo test -p vlog_linter`: 118 unit + 55 integration + 1 doctest, green
|
||||
(118 was 116: the two new `context.rs` tests). `cargo test -p vfmt`:
|
||||
(118 was 116: the two new `context.rs` tests). `cargo test -p lucisv`:
|
||||
green including all 69 CLI integration tests, unmodified.
|
||||
`cargo test -p vfmt_server`: 115 unit + 6 e2e, green, unmodified.
|
||||
`cargo test -p lucisv_server`: 115 unit + 6 e2e, green, unmodified.
|
||||
`cargo test --workspace`: **770 passed, 0 failed**.
|
||||
- `cargo clippy --workspace --all-targets`: silent. `cargo fmt -p
|
||||
vlog_linter -p vfmt -p vfmt_server -- --check`: clean (scoped, per the
|
||||
vlog_linter -p lucisv -p lucisv_server -- --check`: clean (scoped, per the
|
||||
concurrency rule). No `#[allow]`, no `unwrap`/`expect`/`panic!`/`unsafe`
|
||||
outside `#[cfg(test)]` in anything touched.
|
||||
- **Byte-identity, CLI** (HEAD worktree binary at `e9008b6` vs this tree,
|
||||
both release):
|
||||
- `vfmt check corpus/`: stdout, stderr and exit code (1) identical.
|
||||
- `vfmt check corpus/ --output-format json`: **2 418 071 bytes of JSON,
|
||||
- `lucisv check corpus/`: stdout, stderr and exit code (1) identical.
|
||||
- `lucisv check corpus/ --output-format json`: **2 418 071 bytes of JSON,
|
||||
byte-identical**, stderr identical, exit identical.
|
||||
- `check --fix` over ten crafted shapes in twin directories (tabs +
|
||||
trailing whitespace, fence, fence-in-broken-file, waiver, lex failure,
|
||||
@@ -246,7 +246,7 @@ answer.**
|
||||
byte-identical** between the two binaries, canonicalized only by
|
||||
stripping the differing scratch-dir prefix from the URI.
|
||||
- **Timing, CLI** (release, median of 7, 860-file corpus):
|
||||
`vfmt check corpus/` **265.5 → 207.9 ms** at `--threads 1` (−22 %),
|
||||
`lucisv check corpus/` **265.5 → 207.9 ms** at `--threads 1` (−22 %),
|
||||
**79.7 → 70.5 ms** at the default thread count (−12 %). The single-thread
|
||||
number is the honest one (the pool hides latency); the saving matches the
|
||||
arithmetic — the lint pipeline did 2 lexes + 1 parse per file and now does
|
||||
@@ -296,7 +296,7 @@ identity run below was done in an **isolated copy**: `scratchpad/qa-new` =
|
||||
a byte copy of the dev's HEAD worktree (`scratchpad/head-wt`, verified clean
|
||||
at `e9008b6`) with **exactly this round's six code files** overlaid.
|
||||
`diff -rq head-wt qa-new` reports those six files and nothing else. The
|
||||
baseline binaries are `head-wt/target/release/{vfmt,vfmt-server}`; the "new"
|
||||
baseline binaries are `head-wt/target/release/{lucisv,lucisv-server}`; the "new"
|
||||
ones were rebuilt from `qa-new`. `corpus/` was never written to — the `--fix`
|
||||
runs used copies.
|
||||
|
||||
@@ -327,7 +327,7 @@ runs used copies.
|
||||
`unterminated block comment` + `no-tabs`, identical on both binaries).
|
||||
3. *Server catalog complete* — **PASS.** `grep -rn
|
||||
'tokenize|parse_source_tolerant|parse_tolerant|format_source|format_range|
|
||||
rebuild_index' crates/vfmt_server/src` returns exactly the sites the
|
||||
rebuild_index' crates/lucisv_server/src` returns exactly the sites the
|
||||
catalog names: `state.rs:56-61` (`Document::new`, one lex),
|
||||
`format.rs:57,87` (kept, strict parse), `state.rs:123/137` +
|
||||
`server.rs:251` (`rebuild_index`, kept), `lint.rs:54`
|
||||
@@ -339,7 +339,7 @@ runs used copies.
|
||||
`git diff --name-only -- crates/vlog_formatter/src/fence.rs` is empty; the
|
||||
file is untouched by this round (and by the concurrent one).
|
||||
5. *Behavior identity* — **PASS, re-run from scratch, not taken on trust.**
|
||||
- `vfmt check corpus/` (820 files): stdout **692 198 bytes identical**,
|
||||
- `lucisv check corpus/` (820 files): stdout **692 198 bytes identical**,
|
||||
stderr identical, exit 1 both.
|
||||
- `--output-format json`: **2 418 071 bytes identical** (matches the dev's
|
||||
figure exactly), stderr identical, exit 1 both.
|
||||
@@ -351,8 +351,8 @@ runs used copies.
|
||||
case-missing-default,module-filename` over the whole corpus. **12/12
|
||||
identical.**
|
||||
- `check --fix` over 13 crafted shapes (multi-round tab+trailing, a real
|
||||
`// verilog_format: off/on` fence, the `// vfmt: off/on` alias, an
|
||||
unclosed fence, `// vfmt: waive`, unused + malformed + unknown-rule
|
||||
`// verilog_format: off/on` fence, the `// lucisv: off/on` alias, an
|
||||
unclosed fence, `// lucisv: waive`, unused + malformed + unknown-rule
|
||||
waivers, a lex-error file, a filename mismatch, CRLF, multi-byte +
|
||||
emoji + tab, an empty file, a class body, a parse-error file): every
|
||||
rewritten file byte-identical, stdout (path-normalized) and stderr
|
||||
@@ -383,14 +383,14 @@ runs used copies.
|
||||
**8.2 → 3.7 ms** (informational; dev reported 18.0 → 11.0 and 7.6 → 3.4).
|
||||
7. *Gates* — **PASS.** In the isolated tree: `cargo test --workspace`
|
||||
**770 passed, 0 failed** (27 result lines; vlog_linter 118 unit + 55
|
||||
integration + 1 doctest, vfmt 30 unit + 69 CLI, vfmt_server 115 unit + 6
|
||||
integration + 1 doctest, lucisv 30 unit + 69 CLI, lucisv_server 115 unit + 6
|
||||
e2e — every count the work log claims). `cargo clippy --workspace
|
||||
--all-targets` exit 0, **zero warnings**. `cargo fmt --all -- --check`
|
||||
clean (not just the scoped set). In the *merged* tree the scoped crates are
|
||||
also green (`cargo test -p vlog_linter -p vfmt -p vfmt_server`: 30/69/115/
|
||||
also green (`cargo test -p vlog_linter -p lucisv -p lucisv_server`: 30/69/115/
|
||||
6/118/55/1) with scoped clippy and fmt clean. Test churn is zero:
|
||||
`git diff --numstat crates/vlog_linter/tests/rules.rs` is **12 added, 0
|
||||
removed**, and no other test file in `vfmt`/`vfmt_server`/`vlog_linter` is
|
||||
removed**, and no other test file in `lucisv`/`lucisv_server`/`vlog_linter` is
|
||||
touched. No `unwrap`/`expect`/`panic!`/`unsafe`/`#[allow]` outside
|
||||
`#[cfg(test)]` in any of the six files.
|
||||
|
||||
@@ -445,11 +445,11 @@ runs used copies.
|
||||
- **QA-1 (MEDIUM — missing coverage, not a defect in shipped behavior).**
|
||||
The stale-tree bug that this round newly makes possible is caught by **no
|
||||
test in the workspace**. With the sabotage above in place, `cargo test -p
|
||||
vfmt_server` passes **115 unit + 6 e2e, 0 failed**, and `cargo test
|
||||
lucisv_server` passes **115 unit + 6 e2e, 0 failed**, and `cargo test
|
||||
--workspace` passes **773, 0 failed** (770 + 3 scratch probes). Only a live
|
||||
stdio session caught it. `Document.tree` is now a cached derivation of
|
||||
`Document.text`, and nothing asserts they agree. The cheapest guard is one
|
||||
`#[cfg(test)]` case in `crates/vfmt_server/src/lint.rs` or `state.rs`:
|
||||
`#[cfg(test)]` case in `crates/lucisv_server/src/lint.rs` or `state.rs`:
|
||||
`set_document` a buffer whose module name mismatches the filename, then
|
||||
`set_document` the renamed text, and assert `violations` no longer contains
|
||||
`module-filename` — an AST-rule finding, which is exactly the class that
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
## Goal
|
||||
|
||||
Make `vfmt` format a whole RTL tree on all cores instead of one, and stop
|
||||
Make `lucisv` format a whole RTL tree on all cores instead of one, and stop
|
||||
walking into directories the repository already declares generated. Two
|
||||
`TODO.md` §3 items in one change, because they touch the same loop:
|
||||
formatting is a pure function of `(source, config)`, so the per-file loop in
|
||||
`crates/vfmt/src/main.rs` parallelises with `rayon::par_iter` once panic
|
||||
`crates/lucisv/src/main.rs` parallelises with `rayon::par_iter` once panic
|
||||
containment and output ordering are reworked for concurrency; and
|
||||
`.gitignore` support is the other half of the file-discovery item whose
|
||||
`--exclude` half already shipped with cli-polish. The user-visible contract
|
||||
@@ -27,7 +27,7 @@ same invocation, regardless of thread count.
|
||||
therefore produce byte-identical stdout and stderr.
|
||||
- **Output is buffered until the run ends.** The price of ordered reporting is
|
||||
that `--diff` / `--stdout` text is held in memory until every file is done,
|
||||
rather than streaming. For the sizes vfmt targets (a large RTL tree is tens
|
||||
rather than streaming. For the sizes lucisv targets (a large RTL tree is tens
|
||||
of MiB of source) this is acceptable; it is the reason `--stdout` over a
|
||||
huge tree is no longer incremental.
|
||||
- **8 MiB of worker stack is enough.** Taken from
|
||||
@@ -86,7 +86,7 @@ literally or as plain `*`, they are not errors):
|
||||
space).
|
||||
- The global ignore file (`core.excludesFile`), `.git/info/exclude`, and
|
||||
`$GIT_DIR/info/exclude`.
|
||||
- Git's "already-tracked files are not ignored" rule: vfmt has no index, so
|
||||
- Git's "already-tracked files are not ignored" rule: lucisv has no index, so
|
||||
a tracked file matching an ignore rule *is* skipped.
|
||||
- Re-including a path inside an ignored directory. An ignored directory is
|
||||
never descended into, so a `!` rule underneath it cannot bring anything
|
||||
@@ -142,13 +142,13 @@ A path named directly on the command line is never ignored, exactly as with
|
||||
|
||||
CLAUDE.md requires a written justification for every dependency; `TODO.md` §3
|
||||
pre-sanctions this one by name. It is the workspace's first third-party
|
||||
dependency, and `vfmt`'s only one.
|
||||
dependency, and `lucisv`'s only one.
|
||||
|
||||
**Why not hand-rolled threads.** The obvious alternative is *N* `std::thread`s
|
||||
each draining a shared `Mutex<vec::IntoIter>`, about 30 lines. Three things
|
||||
make that the worse choice here:
|
||||
|
||||
1. **Work stealing.** vfmt's per-file cost varies by two orders of magnitude
|
||||
1. **Work stealing.** lucisv's per-file cost varies by two orders of magnitude
|
||||
(a 20-line header vs. a 10 000-line generated netlist). A static chunking
|
||||
leaves cores idle behind one slow file; a shared-queue design fixes that
|
||||
but then contends on the mutex for short files. rayon's per-worker deques
|
||||
@@ -156,7 +156,7 @@ make that the worse choice here:
|
||||
2. **Panic propagation.** A panic on a hand-rolled worker either poisons the
|
||||
shared mutex or is silently swallowed by a detached `JoinHandle`. rayon
|
||||
propagates a worker panic to the thread that called `par_iter` — which
|
||||
matters because vfmt's own containment (`catch_panic`) is the *inner*
|
||||
matters because lucisv's own containment (`catch_panic`) is the *inner*
|
||||
layer, and anything that escapes it must still surface as a crash rather
|
||||
than as a quietly missing file.
|
||||
3. **Maintenance.** Thread count, stack size, worker naming, and clean
|
||||
@@ -166,10 +166,10 @@ make that the worse choice here:
|
||||
|
||||
**Cost.** Five transitive crates (`rayon-core`, `crossbeam-deque`,
|
||||
`crossbeam-epoch`, `crossbeam-utils`, `either`), all from the same
|
||||
well-maintained ecosystem, no build scripts, no `unsafe` in vfmt itself, and
|
||||
well-maintained ecosystem, no build scripts, no `unsafe` in lucisv itself, and
|
||||
~9 s of cold release compile time. The version is pinned with `=` rather than
|
||||
a caret: a work-stealing scheduler is exactly the kind of dependency whose
|
||||
minor releases can change thread behavior, and vfmt's determinism claim is
|
||||
minor releases can change thread behavior, and lucisv's determinism claim is
|
||||
worth an explicit bump.
|
||||
|
||||
## Work log
|
||||
@@ -178,7 +178,7 @@ worth an explicit bump.
|
||||
|
||||
- Read CLAUDE.md, `TODO.md` §3, `docs/features/cli-polish/README.md`
|
||||
(the panic-hook handshake), `docs/features/recursion-limit/README.md`
|
||||
(Handshakes: the 8 MiB request) and all of `crates/vfmt/src` before
|
||||
(Handshakes: the 8 MiB request) and all of `crates/lucisv/src` before
|
||||
writing anything.
|
||||
- **Blocked on the workspace for most of the run.** Another agent was
|
||||
mid-flight creating `crates/vlog_semantic`; its `Cargo.toml` was in the
|
||||
@@ -225,7 +225,7 @@ parallel iterator, so the collect restores input order; `run_files` then
|
||||
walks that vector serially, printing and counting. Diff hunks and error
|
||||
lines therefore cannot interleave, and the summary counters are derived
|
||||
from the ordered vector rather than from shared counters. Verified at
|
||||
corpus scale: `vfmt --diff` over the 860-file corpus produces 2 424 208
|
||||
corpus scale: `lucisv --diff` over the 860-file corpus produces 2 424 208
|
||||
bytes of stdout and 66 019 bytes of stderr that are **byte-identical**
|
||||
across `--threads 1`, `2`, `8`, the default, and a repeat run.
|
||||
|
||||
@@ -271,7 +271,7 @@ one" and "the last line in a file wins" from one loop.
|
||||
expectations: a scratchpad `git init` tree with a root `.gitignore`
|
||||
(`build/`, `*_gen.sv`, `/anchored.sv`, `gen/rtl`, `sub/*.sv`, a comment) and
|
||||
a nested `sub/.gitignore` (`!keep_gen.sv`, `drop.sv`) over 13 `.sv` files.
|
||||
`git check-ignore` and vfmt agree on **every** file.
|
||||
`git check-ignore` and lucisv agree on **every** file.
|
||||
|
||||
On the real corpus (28 `.gitignore` files across ibex, OpenTitan, PULP
|
||||
common_cells and picorv32) the honoured rules change nothing: the same 860
|
||||
@@ -325,7 +325,7 @@ accurately; nothing fabricated. Did not touch `crates/vlog_semantic`
|
||||
`a_deeply_nested_file_formats_on_a_worker_thread` — it fails with the
|
||||
child process losing its exit code entirely (`panicked at
|
||||
cli.rs:81:23: exit code`), i.e. a hard crash, not a graceful error;
|
||||
restored the file and confirmed `git diff crates/vfmt/src/main.rs`
|
||||
restored the file and confirmed `git diff crates/lucisv/src/main.rs`
|
||||
byte-identical to before the experiment (`diff` of the two captured
|
||||
diffs was empty). **Pass.**
|
||||
2. **Hook.** Single `Once`-guarded `install_panic_hook` (`main.rs:266`);
|
||||
@@ -342,7 +342,7 @@ accurately; nothing fabricated. Did not touch `crates/vlog_semantic`
|
||||
scratchpad build: it still prints the full `thread 'main' panicked at
|
||||
… note: run with RUST_BACKTRACE=1`, exit 101 — the default hook is
|
||||
intact for real bugs. **Pass.**
|
||||
3. **Determinism.** Ran `vfmt --diff` over the full 860-file corpus (not
|
||||
3. **Determinism.** Ran `lucisv --diff` over the full 860-file corpus (not
|
||||
just ~100) at `--threads` 1/2/8/default, 3 repeats each (12 runs) plus 2
|
||||
more default-thread repeats (5 total for that setting): stdout hashes to
|
||||
one value across all 12, stderr to one value across all 12 —
|
||||
@@ -357,15 +357,15 @@ accurately; nothing fabricated. Did not touch `crates/vlog_semantic`
|
||||
(`scratchpad/gitprobe/`) covering all four requested tricky cases plus
|
||||
extras: a `!secret.sv` inside `build/` (ignored by the parent `build/`
|
||||
rule — git prunes the directory before reading its `.gitignore`, and so
|
||||
does vfmt); `/x.sv` anchored inside a *nested* `anchor_test/.gitignore`
|
||||
does lucisv); `/x.sv` anchored inside a *nested* `anchor_test/.gitignore`
|
||||
(correctly scoped to that directory only, not its `sub2/`); `!keepdir/`
|
||||
negating a directory while `*.sv` still catches the file inside it
|
||||
(git: ignored; vfmt: ignored — negating the directory doesn't negate the
|
||||
(git: ignored; lucisv: ignored — negating the directory doesn't negate the
|
||||
per-file pattern); and the `build/` vs. bare `build` directory-only
|
||||
distinction (already covered by the existing unit test
|
||||
`a_trailing_slash_matches_directories_only`, confirmed still green).
|
||||
Ran `git check-ignore -q` against every `.sv` file in the tree, compared
|
||||
to which files vfmt actually visited (16 files, 6 not ignored) —
|
||||
to which files lucisv actually visited (16 files, 6 not ignored) —
|
||||
**exact agreement, 0 discrepancies.** Corpus visited-set check: `--diff`
|
||||
with and without `--no-gitignore` over the real 860-file corpus (28
|
||||
`.gitignore` files) produced byte-identical stdout and stderr, matching
|
||||
@@ -377,15 +377,15 @@ accurately; nothing fabricated. Did not touch `crates/vlog_semantic`
|
||||
(extensions: v, sv, vh, svh)`, exit 2 — sane, and `--no-gitignore`
|
||||
recovers the files as expected. `.gitignore` + `--exclude` together:
|
||||
both apply simultaneously (verified with one pattern from each). **Pass.**
|
||||
5. **Deps.** `cargo tree -p vfmt` shows exactly `rayon` → `either`,
|
||||
5. **Deps.** `cargo tree -p lucisv` shows exactly `rayon` → `either`,
|
||||
`rayon-core` → `crossbeam-deque` → `crossbeam-epoch`/`crossbeam-utils`
|
||||
(5 transitive crates as documented); `cargo metadata` confirms none of
|
||||
the six packages (rayon included) declare a build script. `rayon` is
|
||||
pinned `=1.12.0` in both `Cargo.toml` and `Cargo.lock`. Justification
|
||||
section present and specific. **Pass.**
|
||||
6. **Tools.** `cargo test -p vfmt`: 50 unit + 30 CLI, all green (0.01s +
|
||||
0.14–0.21s). `cargo clippy -p vfmt --all-targets` and
|
||||
`cargo fmt -p vfmt -- --check`: both silent/clean. Workspace-wide (now
|
||||
6. **Tools.** `cargo test -p lucisv`: 50 unit + 30 CLI, all green (0.01s +
|
||||
0.14–0.21s). `cargo clippy -p lucisv --all-targets` and
|
||||
`cargo fmt -p lucisv -- --check`: both silent/clean. Workspace-wide (now
|
||||
that `vlog_semantic` compiles): `cargo build --workspace`,
|
||||
`cargo clippy --workspace --all-targets` clean, `cargo test --workspace`
|
||||
green across all crates. Note: workspace-wide `cargo fmt --check` is
|
||||
@@ -427,7 +427,7 @@ accurately; nothing fabricated. Did not touch `crates/vlog_semantic`
|
||||
(error outranks would-reformat), no interleaving.
|
||||
|
||||
**One methodology note, not a product finding:** immediately after the
|
||||
`WORKER_STACK` sabotage-and-restore in item 1, `cargo build -p vfmt`
|
||||
`WORKER_STACK` sabotage-and-restore in item 1, `cargo build -p lucisv`
|
||||
reported "Finished in 0.01s" and silently kept serving the *stale* 2 MiB
|
||||
binary — restoring the file with `mv` from a `sed -i.bak` backup left its
|
||||
mtime older than the already-rebuilt (sabotaged) target, so Cargo's
|
||||
@@ -435,18 +435,18 @@ mtime fast-path skipped recompilation despite the content being back to
|
||||
the original 8 MiB source. This briefly made `cargo test --workspace`
|
||||
report `a_deeply_nested_file_formats_on_a_worker_thread` and
|
||||
`deeply_nested_file_does_not_kill_the_batch` as crashing. `touch`ing
|
||||
`crates/vfmt/src/main.rs` and rebuilding made both pass again immediately,
|
||||
`crates/lucisv/src/main.rs` and rebuilding made both pass again immediately,
|
||||
and `git diff` on the file was unaffected throughout (content never
|
||||
changed). Recorded here in case anyone else sees the same thing after a
|
||||
`sed -i.bak` / `mv` round-trip on this codebase — it is a Cargo caching
|
||||
quirk local to that workflow, not a vfmt bug.
|
||||
quirk local to that workflow, not a lucisv bug.
|
||||
|
||||
**Severity summary:** no BLOCKING findings (zero nondeterminism observed
|
||||
across ~40 varied repeated runs), no should-fix gitignore/git
|
||||
disagreements (0 of many probe files disagreed). CLAUDE.md compliance:
|
||||
no `unwrap`/`expect`/`panic!` in library code paths in `main.rs`/`args.rs`/
|
||||
`walk.rs` outside `#[cfg(test)]` (grepped directly); all `pub` items carry
|
||||
a one-line doc comment; feature stayed inside `crates/vfmt` +
|
||||
a one-line doc comment; feature stayed inside `crates/lucisv` +
|
||||
`docs/features/parallel-files` as scoped, confirmed via `git status`/`git
|
||||
diff --stat` against `HEAD`. README.md and TODO.md claims read as
|
||||
accurate against what I independently measured.
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
## Goal
|
||||
|
||||
Format only the lines the caller names and emit every other byte exactly as it
|
||||
was written — `vfmt --lines M-N[,M-N...]`, and `textDocument/rangeFormatting`
|
||||
was written — `lucisv --lines M-N[,M-N...]`, and `textDocument/rangeFormatting`
|
||||
on the same engine. This is the adoption story for a legacy tree: a formatter
|
||||
that can only rewrite a whole 2000-line file is one that never gets turned on,
|
||||
because the first patch it touches becomes unreviewable. Verible ships
|
||||
`git-verible-verilog-format.sh` on top of exactly this, and `tools/vfmt-changed.sh`
|
||||
`git-verible-verilog-format.sh` on top of exactly this, and `tools/lucisv-changed.sh`
|
||||
is our version. A range is morally an **inverted fence**: the same
|
||||
`Doc::Verbatim` splice `docs/features/format-fences/README.md` built, over
|
||||
byte ranges the *caller* chose instead of ranges a comment marked.
|
||||
@@ -118,7 +118,7 @@ file is read.
|
||||
### `// verilog_format: off` outranks `--lines`
|
||||
|
||||
A fenced item is never laid out, whatever the caller selected. `off` means
|
||||
hands off across all of vfmt (the position `docs/features/shared-fence-filter/README.md`
|
||||
hands off across all of lucisv (the position `docs/features/shared-fence-filter/README.md`
|
||||
already took for `--fix` and the server's quick fixes), and a range is a
|
||||
weaker signal than a comment somebody wrote into the source. Mechanically the
|
||||
planner asks `fence::region_at` before it asks about lines, and the two
|
||||
@@ -210,7 +210,7 @@ differently on the replay and the check would fail for a bookkeeping reason.
|
||||
**Promised, and checked at runtime:** replaying the same selection is a fixed
|
||||
point. That is what "the output is stable" means for a partial run.
|
||||
|
||||
**True in practice, and tested:** running `vfmt --lines M-N` twice on the same
|
||||
**True in practice, and tested:** running `lucisv --lines M-N` twice on the same
|
||||
lines changes nothing the second time — *when the first run did not move the
|
||||
selected lines*. Every hand-written case in `tests/ranges.rs` is of that kind,
|
||||
which is the normal editing experience.
|
||||
@@ -234,7 +234,7 @@ further on a second run with the same line numbers, and **every one of them
|
||||
settled on that second run** (checked to 12 iterations; none needed a third).
|
||||
|
||||
**Also not promised, and this is the feature:** a partial run is not a fixed
|
||||
point of the *whole-file* formatter. `vfmt` with no `--lines` afterwards will
|
||||
point of the *whole-file* formatter. `lucisv` with no `--lines` afterwards will
|
||||
reformat more. That is the point of having formatted less.
|
||||
|
||||
*(Lead note, per lexer-cleanup QA: one more unstated exception to
|
||||
@@ -251,12 +251,12 @@ the promise's edges are all in one place.)*
|
||||
line ranges; comma-separated and repeatable
|
||||
```
|
||||
|
||||
- **Format only.** `vfmt check --lines` is an error: the linter has no notion
|
||||
- **Format only.** `lucisv check --lines` is an error: the linter has no notion
|
||||
of a line range (waivers are its equivalent).
|
||||
- **Explicit files, never a directory.** "Line 12 of everything under `rtl/`"
|
||||
is not a thing anyone meant, so a directory input is an error. Several file
|
||||
arguments are accepted and get the same ranges each — defined, but a wrapper
|
||||
should invoke once per file, which `tools/vfmt-changed.sh` does.
|
||||
should invoke once per file, which `tools/lucisv-changed.sh` does.
|
||||
- **Combines with** `--check`, `--diff`, `--stdout`, and stdin (`-`, with
|
||||
`--stdin-filename`). `--check` exits 1 only if the *partial* format would
|
||||
change something, which is what makes "CI checks the lines this PR touched"
|
||||
@@ -267,14 +267,14 @@ the promise's edges are all in one place.)*
|
||||
under the "already formatted" verdict, which is the one thing
|
||||
`docs/features/format-cache/README.md` promises the cache only ever stores.
|
||||
|
||||
### `tools/vfmt-changed.sh`
|
||||
### `tools/lucisv-changed.sh`
|
||||
|
||||
The `git diff` half of TODO.md §2's follow-up. It reads `git diff -U0` hunk
|
||||
headers, turns each `@@ -old +first,count @@` into `first-(first+count-1)`,
|
||||
and calls `vfmt --lines` once per changed `.sv`/`.svh`/`.v`/`.vh` file. A hunk
|
||||
and calls `lucisv --lines` once per changed `.sv`/`.svh`/`.v`/`.vh` file. A hunk
|
||||
with `count == 0` deleted only and contributes nothing. `--check`/`--diff` and
|
||||
a base revision pass through, so `tools/vfmt-changed.sh --check origin/main`
|
||||
is the CI form. A `vfmt --diff-base <rev>` flag *inside* the binary is still
|
||||
a base revision pass through, so `tools/lucisv-changed.sh --check origin/main`
|
||||
is the CI form. A `lucisv --diff-base <rev>` flag *inside* the binary is still
|
||||
open; the script answers the need without teaching the CLI about git.
|
||||
|
||||
## LSP
|
||||
@@ -346,7 +346,7 @@ to `fence.rs`: two `fn` → `pub(crate) fn`, no behavior.**
|
||||
one definition of the answer — but only `format_range` and `LineRanges` are
|
||||
meant for outside callers.
|
||||
|
||||
**Promised to `crates/vfmt` and `crates/vfmt_server`:** both call
|
||||
**Promised to `crates/lucisv` and `crates/lucisv_server`:** both call
|
||||
`format_range` and nothing else new. `Options::lines` and
|
||||
`Options::cache_enabled` are the CLI's own.
|
||||
|
||||
@@ -381,19 +381,19 @@ is a leaf, as it was for fences.
|
||||
the spec grammar, the line-shift counterexample, and a corpus spot
|
||||
check.
|
||||
- [x] CLI `--lines`: comma and repeated forms, `--check`/`--diff`/`--stdout`/
|
||||
stdin, directory refusal, cache bypass, `vfmt check` rejection — 6 CLI
|
||||
stdin, directory refusal, cache bypass, `lucisv check` rejection — 6 CLI
|
||||
tests + 2 arg unit tests.
|
||||
- [x] LSP `documentRangeFormattingProvider` + `format::range_formatting` — 6
|
||||
handler tests and one e2e leg over the wire with UTF-16 content.
|
||||
- [x] `tools/vfmt-changed.sh`.
|
||||
- [x] `tools/lucisv-changed.sh`.
|
||||
- [x] README.md usage block + a Range formatting section; TODO.md §2
|
||||
checkbox; the one-line `vfmt-server` README annotation.
|
||||
checkbox; the one-line `lucisv-server` README annotation.
|
||||
- [ ] **Not done, deliberately:** statement-level ranges (an intersected
|
||||
`always` block lays out whole).
|
||||
- [ ] **Not done, deliberately:** descending into `generate` regions,
|
||||
classes, functions and tasks. One `scope_of` arm plus a head/tail doc
|
||||
each, whenever a real file makes it hurt.
|
||||
- [ ] **Not done:** a `vfmt --diff-base <rev>` flag. `tools/vfmt-changed.sh`
|
||||
- [ ] **Not done:** a `lucisv --diff-base <rev>` flag. `tools/lucisv-changed.sh`
|
||||
covers the need from outside; putting git inside the binary is a
|
||||
separate decision.
|
||||
|
||||
@@ -402,7 +402,7 @@ is a leaf, as it was for fences.
|
||||
### 2026-08-19 — dev agent
|
||||
|
||||
- Read `CLAUDE.md`, TODO.md §2/§6, and the Handshakes of `format-fences`,
|
||||
`spans`, `vfmt-server` and `alignment` before writing anything. Baseline:
|
||||
`spans`, `lucisv-server` and `alignment` before writing anything. Baseline:
|
||||
`cargo test -p vlog_formatter` **113 passed**, clippy silent, fmt clean.
|
||||
(`cargo test --workspace` did not build at that moment — a concurrent
|
||||
`vlog_linter` round had the tree mid-edit; it was green again before the
|
||||
@@ -476,8 +476,8 @@ is a leaf, as it was for fences.
|
||||
- `cargo test --workspace`: **768 passed, 0 failed** (a moving number — the
|
||||
concurrent `vlog_linter` round is landing tests in the same tree; it read
|
||||
767 an hour earlier). This feature's own crates: `vlog_formatter` 113 →
|
||||
**141** (+6 unit tests in `range.rs`, +22 in `tests/ranges.rs`), `vfmt`
|
||||
91 → **99** (+2 arg unit tests, +6 CLI tests), `vfmt_server` 114 → **121**
|
||||
**141** (+6 unit tests in `range.rs`, +22 in `tests/ranges.rs`), `lucisv`
|
||||
91 → **99** (+2 arg unit tests, +6 CLI tests), `lucisv_server` 114 → **121**
|
||||
(+6 handler tests, +1 e2e).
|
||||
- `cargo clippy --workspace --all-targets`: silent, 0 warnings.
|
||||
`cargo fmt --all --check`: clean.
|
||||
@@ -498,20 +498,20 @@ is a leaf, as it was for fences.
|
||||
in; `tests/ranges.rs`'s corpus spot check is the committed version.
|
||||
|
||||
Files added: `crates/vlog_formatter/src/range.rs`,
|
||||
`crates/vlog_formatter/tests/ranges.rs`, `tools/vfmt-changed.sh`, this README.
|
||||
`crates/vlog_formatter/tests/ranges.rs`, `tools/lucisv-changed.sh`, this README.
|
||||
Files edited: `crates/vlog_formatter/src/{lib,format,fence}.rs`,
|
||||
`crates/vfmt/src/{args,main}.rs`, `crates/vfmt/tests/cli.rs`,
|
||||
`crates/vfmt_server/src/{main,server,format}.rs`,
|
||||
`crates/vfmt_server/tests/e2e.rs`, `README.md`, `TODO.md`,
|
||||
`docs/features/vfmt-server/README.md` (the deferred-capability annotation).
|
||||
`crates/lucisv/src/{args,main}.rs`, `crates/lucisv/tests/cli.rs`,
|
||||
`crates/lucisv_server/src/{main,server,format}.rs`,
|
||||
`crates/lucisv_server/tests/e2e.rs`, `README.md`, `TODO.md`,
|
||||
`docs/features/lucisv-server/README.md` (the deferred-capability annotation).
|
||||
|
||||
## QA log
|
||||
|
||||
### 2026-08-19 — QA agent
|
||||
|
||||
Read `CLAUDE.md`, this README, `range.rs`, the `format.rs`/`fence.rs`/`lib.rs`
|
||||
diffs, `tests/ranges.rs`, the `vfmt`/`vfmt_server` diffs, and
|
||||
`tools/vfmt-changed.sh` before touching anything. Verified by (a) rebuilding
|
||||
diffs, `tests/ranges.rs`, the `lucisv`/`lucisv_server` diffs, and
|
||||
`tools/lucisv-changed.sh` before touching anything. Verified by (a) rebuilding
|
||||
and re-running the gates myself, (b) an independent binary-diff of the
|
||||
no-default-change claim, (c) hand-written probe files against the real
|
||||
release binaries (not just re-running the shipped test suite), and (d) one
|
||||
@@ -535,14 +535,14 @@ nothing else — read the whole diff, not just the summary.
|
||||
re-run.** `tools/corpus_check.sh corpus` here: TSV md5
|
||||
`b74f2f167c57e381d46f3503363a79b3`, byte-for-byte the value in the Work log.
|
||||
Then, independently of the dev's worktree (which was already removed):
|
||||
created my own `git worktree` at `003e076`, built its `vfmt --release`, and
|
||||
created my own `git worktree` at `003e076`, built its `lucisv --release`, and
|
||||
compared `--stdout` output against the current binary over all 578
|
||||
formattable corpus files (from the TSV's `ok-unchanged`/`would-reformat`
|
||||
rows) — 0 differing via a `$()`-capture pass over all 578, then a second,
|
||||
byte-exact `cmp` pass on a 20-file stride subset (every 29th file). Both
|
||||
clean. Worktree removed after.
|
||||
|
||||
**Semantics (claim 1) — pass.** Hand probes against `target/release/vfmt`,
|
||||
**Semantics (claim 1) — pass.** Hand probes against `target/release/lucisv`,
|
||||
not just re-running `tests/ranges.rs`:
|
||||
- Unit rule: a range on only a leading comment lays out the whole unit
|
||||
(comment + declaration), sibling untouched — matches the doc's "selecting a
|
||||
@@ -566,7 +566,7 @@ not just re-running `tests/ranges.rs`:
|
||||
whole, not partially — confirmed via CLI, matches the shipped test.
|
||||
|
||||
**Interactions (claim 2) — pass.**
|
||||
- Fence wins: `--lines` on lines fully inside a `// vfmt: off` region leaves
|
||||
- Fence wins: `--lines` on lines fully inside a `// lucisv: off` region leaves
|
||||
the region untouched; the on-fence-line quirk (selecting the `on` line
|
||||
selects the *next* item, not the region) reproduced independently.
|
||||
- Alignment split: `ALIGNED`-shaped probe with lines 2-3 selected — the two
|
||||
@@ -600,7 +600,7 @@ not just re-running `tests/ranges.rs`:
|
||||
- `--lines` forms (comma, repeated), `--check`/`--diff` combination (diff
|
||||
patch applied cleanly with `patch` against a copy and matched the actual
|
||||
`--lines` output byte-for-byte), stdin, directory refusal (exit 2, correct
|
||||
message, file untouched), `vfmt check --lines` rejection (exit 2) — all
|
||||
message, file untouched), `lucisv check --lines` rejection (exit 2) — all
|
||||
reproduced directly against the binary, not just by reading `cli.rs`.
|
||||
- `--lines` bypasses the cache in both directions: verified via `cli.rs`'s
|
||||
own test (already covers "warm cache, `--lines` run still does the work,
|
||||
@@ -608,30 +608,30 @@ not just re-running `tests/ranges.rs`:
|
||||
reading it, since it is a single boolean at one call site
|
||||
(`args.rs::cache_enabled`) and the existing test already exercises both
|
||||
the hit-skip and the no-write cases.
|
||||
- LSP: drove the **real** `vfmt-server` release binary over stdio with a
|
||||
- LSP: drove the **real** `lucisv-server` release binary over stdio with a
|
||||
hand-rolled Content-Length framer (independent of `e2e.rs`'s harness) —
|
||||
`initialize` advertises `documentRangeFormattingProvider: true`; a range
|
||||
mid-module (line 3 of a 3-item module) returns one whole-document
|
||||
`TextEdit` containing only that line reformatted; a range on an
|
||||
already-clean line returns `"result": []` (empty, no edit). Matches the
|
||||
doc's "reply absent/empty when nothing changes" and "one whole-document
|
||||
edit" claims. `cargo test -p vfmt_server` (part of the workspace run
|
||||
edit" claims. `cargo test -p lucisv_server` (part of the workspace run
|
||||
above) is green, e2e included.
|
||||
- Did not independently re-derive the end-at-character-0 UTF-16 conversion
|
||||
math beyond reading `format.rs::range_formatting` and its unit tests
|
||||
(`crates/vfmt_server/src/format.rs:80-90`) — the logic is a two-line `if`
|
||||
(`crates/lucisv_server/src/format.rs:80-90`) — the logic is a two-line `if`
|
||||
with four unit tests covering exactly the boundary cases the doc names
|
||||
(cursor-only, "select two lines" ending at char 0, single line via the same
|
||||
rule, and a multi-byte line proving only line numbers survive the
|
||||
conversion); re-tracing it by hand against each test agreed with both.
|
||||
|
||||
**vfmt-changed.sh — pass.** Scratch git repo, two files, three edited lines
|
||||
**lucisv-changed.sh — pass.** Scratch git repo, two files, three edited lines
|
||||
(one in `a.sv`, two in `b.sv`): only the touched declarations moved, module
|
||||
headers and untouched siblings stayed exactly as written. A deletion-only
|
||||
hunk (`sed -i '' '3d'`, no added lines) was skipped entirely — file
|
||||
untouched, confirmed by diff. `--check` pass-through: exit 1 when the
|
||||
touched hunk would still reformat, exit 0 once clean, exit 2 when
|
||||
`$VFMT` points at a nonexistent binary (the script's own guard, not vfmt's
|
||||
`$LUCISV` points at a nonexistent binary (the script's own guard, not lucisv's
|
||||
exit code, but still the documented "2 = error" contract).
|
||||
|
||||
**Sabotage (required by CLAUDE.md invariant #4's spirit, even though this
|
||||
@@ -695,7 +695,7 @@ Points reviewed and accepted:
|
||||
2. **The honest limit is measured and pinned**, not hidden: same LINE
|
||||
NUMBERS can sweep in a neighbor when the first run moved lines
|
||||
(449/8236 corpus trials, all settled next run), with a committed
|
||||
counterexample test. Users of vfmt-changed.sh get self-stabilizing
|
||||
counterexample test. Users of lucisv-changed.sh get self-stabilizing
|
||||
behavior; the docs say why.
|
||||
3. **Run-merged verbatim slices** — found by a probe, not reasoning —
|
||||
is the kind of bug (separator-collapsed blank lines between
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
`vlog_parser` is a recursive-descent parser, so nesting in the input becomes
|
||||
nesting on the call stack. Deeply nested input therefore did not produce a
|
||||
parse error — it overflowed the stack and killed the process (SIGABRT). A
|
||||
stack overflow is not a panic, so `catch_unwind` in `crates/vfmt/src/main.rs`
|
||||
stack overflow is not a panic, so `catch_unwind` in `crates/lucisv/src/main.rs`
|
||||
could not contain it: the run died mid-batch, every file after the offending
|
||||
one went unprocessed, and there was not even an exit-code-2 summary
|
||||
(cli-polish QA finding, `docs/features/cli-polish/README.md`). This feature
|
||||
@@ -51,7 +51,7 @@ not by 64 × 256.
|
||||
`parse_gen_if`), one `.b` or one `+` costs 1 link. The limits are a
|
||||
stack-safety budget, not a style rule.
|
||||
- **8 MiB of stack is available.** That is the default main-thread stack on
|
||||
macOS and Linux, and `vfmt` parses on the main thread. Anything that parses
|
||||
macOS and Linux, and `lucisv` parses on the main thread. Anything that parses
|
||||
on a *spawned* thread must give it a comparable stack — the default 2 MiB
|
||||
is not enough to reach the limit in an unoptimized build (see Handshakes;
|
||||
the tests here spawn 16 MiB threads for exactly this reason).
|
||||
@@ -274,7 +274,7 @@ not inflate depth — the output of a max-depth file re-parses inside
|
||||
|
||||
- **Consumed from `vlog_parser`:** nothing new. `parse()` keeps its
|
||||
signature; the limit shows up as a normal `ParseError`, so `vlog_formatter`
|
||||
and `vfmt` report it through the paths they already had (`FormatError::
|
||||
and `lucisv` report it through the paths they already had (`FormatError::
|
||||
Source` → `error: <path>: parse error: …` → exit 2).
|
||||
- **Promised to `vlog_formatter`:** AST depth on any path is bounded by
|
||||
`vlog_parser::parser::MAX_NESTING_DEPTH + MAX_CHAIN_LENGTH` (both public,
|
||||
@@ -311,7 +311,7 @@ not inflate depth — the output of a max-depth file re-parses inside
|
||||
- [x] Parser unit tests: at limit / past limit, one per construct family.
|
||||
- [x] Formatter tests (`tests/deep_nesting.rs`): max-legal depth formats and
|
||||
converges; past-limit input surfaces as a parse error.
|
||||
- [x] CLI test (`crates/vfmt/tests/cli.rs`): the cli-polish repro (150 levels)
|
||||
- [x] CLI test (`crates/lucisv/tests/cli.rs`): the cli-polish repro (150 levels)
|
||||
exits 2, is left untouched, and files after it are still formatted.
|
||||
- [x] `cargo test --workspace`, `cargo clippy --all-targets`,
|
||||
`cargo fmt --check` all clean.
|
||||
@@ -390,16 +390,16 @@ From QA round 1 (2026-08-19):
|
||||
live outside the repo; nothing generated by them was committed.
|
||||
|
||||
**Results:** `cargo test --workspace` **80 passed, 0 failed** (up from 70:
|
||||
+6 `vlog_parser` unit, +3 `vlog_formatter` `deep_nesting`, +1 `vfmt` CLI).
|
||||
+6 `vlog_parser` unit, +3 `vlog_formatter` `deep_nesting`, +1 `lucisv` CLI).
|
||||
`cargo clippy --all-targets` silent. `cargo fmt --check` clean.
|
||||
Files touched: `crates/vlog_parser/src/parser.rs`,
|
||||
`crates/vlog_formatter/tests/deep_nesting.rs` (new),
|
||||
`crates/vfmt/tests/cli.rs` (one test), `TODO.md` (one checkbox), this README.
|
||||
`crates/lucisv/tests/cli.rs` (one test), `TODO.md` (one checkbox), this README.
|
||||
|
||||
### 2026-08-19 (later) — dev agent, answering QA round 1
|
||||
|
||||
- **The blocking finding is correct and was reproduced first thing**:
|
||||
`./target/debug/vfmt` on `assign x = a` + `.b`×1500 died with SIGABRT
|
||||
`./target/debug/lucisv` on `assign x = a` + `.b`×1500 died with SIGABRT
|
||||
(exit 134). Bisected the crash with the real binary before touching
|
||||
anything, and swept the whole shape class rather than just the reported
|
||||
one — crash thresholds on the default 8 MiB main-thread stack, debug:
|
||||
@@ -480,8 +480,8 @@ grew a second pathological file). `cargo clippy --all-targets` silent.
|
||||
- `cargo fmt --check`: clean, exit 0.
|
||||
|
||||
**Claim 4 (150-level repro, batch survival) — CONFIRMED**, checked two ways:
|
||||
- `cargo test -p vfmt deeply_nested_file_does_not_kill_the_batch` passes.
|
||||
- Independently, ran the real debug `vfmt` binary (not the test harness) on
|
||||
- `cargo test -p lucisv deeply_nested_file_does_not_kill_the_batch` passes.
|
||||
- Independently, ran the real debug `lucisv` binary (not the test harness) on
|
||||
a 3-file batch (`good`, 150-level `if…begin` repro, `good`) in the
|
||||
scratchpad: exit 2, `error: b_deep.sv: parse error: 32:5: nesting too deep
|
||||
(limit 64) (found "clk")`, `2 files reformatted, 1 file failed to format`,
|
||||
@@ -522,7 +522,7 @@ python3 -c "
|
||||
n = 1500
|
||||
s = 'module m;\nassign x = a' + '.b'*n + ';\nendmodule\n'
|
||||
open('member_chain_1500.sv','w').write(s)"
|
||||
./target/debug/vfmt member_chain_1500.sv
|
||||
./target/debug/lucisv member_chain_1500.sv
|
||||
# thread 'main' (NNNN) has overflowed its stack
|
||||
# fatal runtime error: stack overflow, aborting
|
||||
# exit code 134 (SIGABRT)
|
||||
@@ -715,7 +715,7 @@ file so its own count is unchanged but its assertions grew). `cargo clippy
|
||||
**Job 1 — original blocking repros: CONFIRMED FIXED.** Rebuilt the debug
|
||||
binary fresh (touched `parser.rs` to force a rebuild, confirmed via the
|
||||
binary's mtime) and reran all four original crash shapes at n=1500 through
|
||||
the real `vfmt`, default 8 MiB stack:
|
||||
the real `lucisv`, default 8 MiB stack:
|
||||
|
||||
```
|
||||
member1500.sv -> parse error: 2:525: expression chain too long (limit 256) (found ".") exit 2
|
||||
|
||||
@@ -5,7 +5,7 @@ hinting**.
|
||||
|
||||
## Goal
|
||||
|
||||
Give vfmt the thing rope gets from Python's type hints and no Verilog tool
|
||||
Give lucisv the thing rope gets from Python's type hints and no Verilog tool
|
||||
ships well: the workspace already knows every module's parameters and ports,
|
||||
so an instantiation should be *generated from the definition* rather than
|
||||
typed by hand. Typing a module name at item position offers the whole
|
||||
@@ -14,7 +14,7 @@ a named connection, the ports that already have a same-named signal in scope
|
||||
bound to it and the rest left as snippet tabstops — and once the connection
|
||||
list is open, signature help names the remaining ports with their directions
|
||||
and types. The facts live in `vlog_refactor` so Vim and a future CLI get the
|
||||
same answers; `vfmt_server` owns only the position gate, the snippet encoding
|
||||
same answers; `lucisv_server` owns only the position gate, the snippet encoding
|
||||
and the LSP items.
|
||||
|
||||
Nothing in this milestone edits a file. Everything it produces is *offered*
|
||||
@@ -37,7 +37,7 @@ corrupt.
|
||||
editor-snippets assumption restated for generated text, and it is verified
|
||||
rather than assumed — see the corpus test under *Work log*. It is what
|
||||
forced parameter defaults through a parse-back probe.
|
||||
- **vfmt does not preprocess.** A port or parameter list split across
|
||||
- **lucisv does not preprocess.** A port or parameter list split across
|
||||
`` `ifdef`` arms is read straight through, so the plan lists **every arm's**
|
||||
entries and says so in a warning. Policy chosen deliberately over refusing:
|
||||
a skeleton is a suggestion the user edits before it becomes code, unlike M3's
|
||||
@@ -63,8 +63,8 @@ corrupt.
|
||||
- **The client's `snippetSupport` is read once, at `initialize`.** The
|
||||
protocol offers no way to learn it later, and a client that changes its mind
|
||||
mid-session is not a case worth modelling.
|
||||
- **The indent step comes from `vfmt.indent` (default 2), not from
|
||||
`vfmt.toml`.** `format::indent_width` discovers a config file from disk on
|
||||
- **The indent step comes from `lucisv.indent` (default 2), not from
|
||||
`lucisv.toml`.** `format::indent_width` discovers a config file from disk on
|
||||
every call; a completion request arrives on every keystroke, and walking the
|
||||
tree for a config file that often is not a trade worth making. Deviation
|
||||
from how the formatter resolves the same setting — recorded here so the lead
|
||||
@@ -84,12 +84,12 @@ corrupt.
|
||||
`ports::visible_in` went from private to `pub(crate)` so `instantiate.rs`
|
||||
reuses them instead of writing a second scope walk. No behaviour changed;
|
||||
both still have exactly one definition.
|
||||
- **Consumes `vfmt_server::pairs`** — `pairs::analyze` and the public
|
||||
- **Consumes `lucisv_server::pairs`** — `pairs::analyze` and the public
|
||||
`ScopeAnalysis`/`Pair`/`Unmatched` it already exposes — to decide whether the
|
||||
cursor is at module-item position. Nothing in `pairs.rs` was changed: the
|
||||
gate is built entirely from its published output, so editor-scopes keeps
|
||||
ownership of the matcher.
|
||||
- **Promises `vfmt_server`**: `instantiation_plan` never panics and never
|
||||
- **Promises `lucisv_server`**: `instantiation_plan` never panics and never
|
||||
returns a plan whose plain rendering fails to parse — corpus-verified over
|
||||
all 454 modules, plus escaped-identifier cases the corpus does not contain
|
||||
(see the *Escaped identifiers* section). `render_with` is the single layout
|
||||
@@ -110,7 +110,7 @@ corrupt.
|
||||
parse ("unexpected keyword `struct` in expression"). Two corpus headers
|
||||
(`common_cells/src/ecc_encode.sv`, `ecc_decode.sv`) declare
|
||||
`parameter type` with such a default. M4 drops the default rather than
|
||||
writing back text vfmt cannot read.
|
||||
writing back text lucisv cannot read.
|
||||
2. An **interface-typed ANSI port** (`module m (iface_bus.mst bus, input
|
||||
logic clk);`) stops the whole header from parsing ("expected `)` (found
|
||||
\".\")"), so no `Module` item is produced and module hinting is silently
|
||||
@@ -282,7 +282,7 @@ hold a module of that name.
|
||||
stdio round trips
|
||||
- [x] `cargo fmt --all -- --check`, `cargo clippy --all-targets`,
|
||||
`cargo test --workspace`
|
||||
- [x] `docs/features/vfmt-server/README.md` capability table updated
|
||||
- [x] `docs/features/lucisv-server/README.md` capability table updated
|
||||
- [x] QA rework (2026-08-24): escaped-identifier spacing + plain-text
|
||||
fallback, the `.*` wildcard in signature help, the parse-failure
|
||||
refusal message
|
||||
@@ -293,7 +293,7 @@ hold a module of that name.
|
||||
## Work log
|
||||
|
||||
- **2026-08-24 (dev)** — read M1–M3 first: the umbrella plan, the ports and
|
||||
rename READMEs, `vlog_refactor`'s `Scope`, and `vfmt_server`'s dispatch,
|
||||
rename READMEs, `vlog_refactor`'s `Scope`, and `lucisv_server`'s dispatch,
|
||||
`state.rs` and `ports.rs`.
|
||||
|
||||
**Design decision 1 — the engine takes an index and a file's text, not the
|
||||
@@ -316,7 +316,7 @@ hold a module of that name.
|
||||
**Deviation from the brief — no `// auto-connected` comments.** The
|
||||
milestone's example writes `.clk(clk), // auto-connected` into the inserted
|
||||
text. Not done: those comments are permanent (nothing later removes them),
|
||||
they would appear on the majority of connections in real RTL, and vfmt
|
||||
they would appear on the majority of connections in real RTL, and lucisv
|
||||
writing editorial comments into a user's design is a line the formatter has
|
||||
never crossed. The information is in the completion item's documentation
|
||||
panel instead ("connected, same name in scope"), where it is read once and
|
||||
@@ -336,10 +336,10 @@ hold a module of that name.
|
||||
caught two: `common_cells`' `ecc_encode`/`ecc_decode` declare
|
||||
`parameter type encoded_data_t = struct packed { ... }` across several lines,
|
||||
and the skeleton pasted the source's own indentation into a `#( ... )` on
|
||||
someone else's line *and* produced text vfmt's own parser rejects. Fixed by
|
||||
someone else's line *and* produced text lucisv's own parser rejects. Fixed by
|
||||
`default_text`: a default written across lines is dropped, and every
|
||||
surviving default is probed by writing it into a throwaway
|
||||
`m #(.P(...)) u ();` and requiring a clean parse. A default vfmt cannot write
|
||||
`m #(.P(...)) u ();` and requiring a clean parse. A default lucisv cannot write
|
||||
back is not offered — the tabstop comes up empty. The parser gap itself is
|
||||
filed in *Handshakes*, unfixed, because it belongs to another crate.
|
||||
|
||||
@@ -349,17 +349,17 @@ hold a module of that name.
|
||||
what makes collapsing safe there and unsafe for parameter defaults.
|
||||
|
||||
**Files touched.** New: `crates/vlog_refactor/src/instantiate.rs`,
|
||||
`crates/vfmt_server/src/completion.rs`,
|
||||
`crates/vfmt_server/src/signature.rs`, this README. Edited:
|
||||
`crates/lucisv_server/src/completion.rs`,
|
||||
`crates/lucisv_server/src/signature.rs`, this README. Edited:
|
||||
`crates/vlog_refactor/src/lib.rs` (module + re-exports + a paragraph on the
|
||||
one member that edits nothing), `crates/vlog_refactor/src/ports.rs`
|
||||
(`find_module` and `visible_in` to `pub(crate)`, no behaviour change),
|
||||
`crates/vfmt_server/src/main.rs` (two capabilities, `snippet_support`,
|
||||
`Server::new` gained the flag), `crates/vfmt_server/src/server.rs` (two
|
||||
`crates/lucisv_server/src/main.rs` (two capabilities, `snippet_support`,
|
||||
`Server::new` gained the flag), `crates/lucisv_server/src/server.rs` (two
|
||||
dispatch arms, the flag on `Server`),
|
||||
`crates/vlog_refactor/tests/corpus.rs` and
|
||||
`crates/vfmt_server/tests/e2e.rs` (new tests only),
|
||||
`docs/features/vfmt-server/README.md` (capability table).
|
||||
`crates/lucisv_server/tests/e2e.rs` (new tests only),
|
||||
`docs/features/lucisv-server/README.md` (capability table).
|
||||
|
||||
**Not touched, deliberately:** `TODO.md`, the umbrella checklist,
|
||||
`pairs.rs`, `hover.rs` (module hover already works through nav), and every
|
||||
@@ -417,8 +417,8 @@ hold a module of that name.
|
||||
QA suggested.
|
||||
|
||||
**Files touched this round:** `crates/vlog_refactor/src/instantiate.rs`,
|
||||
`crates/vfmt_server/src/completion.rs`,
|
||||
`crates/vfmt_server/src/signature.rs`, this README. Nothing else; no
|
||||
`crates/lucisv_server/src/completion.rs`,
|
||||
`crates/lucisv_server/src/signature.rs`, this README. Nothing else; no
|
||||
behaviour outside M4 was reached.
|
||||
|
||||
## QA log
|
||||
@@ -488,7 +488,7 @@ run and then fully reverted — nothing left in the tree (confirmed with
|
||||
- A signal declared in an enclosing `generate`/`endgenerate` block before
|
||||
the site — binds, as expected.
|
||||
|
||||
**MEDIUM — an escaped-identifier port name produces a skeleton `vfmt`'s own
|
||||
**MEDIUM — an escaped-identifier port name produces a skeleton `lucisv`'s own
|
||||
parser rejects, falsifying the feature's own stated invariant**
|
||||
|
||||
`docs/features/refactor-instantiate/README.md`'s Handshakes section
|
||||
@@ -552,7 +552,7 @@ endmodule
|
||||
(`expected \`)\` (found ".")`, confirmed directly against
|
||||
`parse_source_tolerant`), so no `Module` item is produced for `m` at all,
|
||||
and `instantiation_plan("m", ...)` refuses with *"the file that declared
|
||||
\`m\` no longer declares it, so vfmt cannot write an instantiation of
|
||||
\`m\` no longer declares it, so lucisv cannot write an instantiation of
|
||||
it."* — a message that reads as "someone edited the file out from under
|
||||
the index" when the real cause is "the parser never supported this
|
||||
syntax." This is the identical class of gap the dev already found and
|
||||
@@ -574,7 +574,7 @@ substance (no skeleton is offered) even if imprecise in wording.
|
||||
**MEDIUM — dead code means `.*` inside a connection list is never
|
||||
recognized, so it falls through into a wrong active-parameter count**
|
||||
|
||||
`active_entry` (`crates/vfmt_server/src/signature.rs:219-257`) has this
|
||||
`active_entry` (`crates/lucisv_server/src/signature.rs:219-257`) has this
|
||||
branch, evidently meant to treat `.*` as a name (so that, like an unknown
|
||||
`.name`, it highlights nothing rather than being mistaken for an ordered
|
||||
connection):
|
||||
@@ -655,14 +655,14 @@ All via temporary probes, reverted:
|
||||
|
||||
Ran the dev's own `completion_and_signature_help_round_trip_over_the_wire`
|
||||
and `a_client_without_snippet_support_gets_the_skeleton_as_plain_text`
|
||||
(`crates/vfmt_server/tests/e2e.rs`) as part of the full-suite gate run —
|
||||
(`crates/lucisv_server/tests/e2e.rs`) as part of the full-suite gate run —
|
||||
both pass, part of the workspace's 1222. They already exercise exactly
|
||||
what the brief asked for: one real `initialize` → `completion` round trip
|
||||
over stdio asserting the JSON-decoded snippet text is byte-for-byte the
|
||||
expected `${n:...}` syntax, one `signatureHelp` round trip with UTF-16
|
||||
label-offset arithmetic checked against the decoded label string, and the
|
||||
advertised `completionProvider`/`signatureHelpProvider` capability shapes.
|
||||
Re-ran both in isolation (`cargo test -p vfmt_server --test e2e
|
||||
Re-ran both in isolation (`cargo test -p lucisv_server --test e2e
|
||||
completion_and_signature_help_round_trip -- --nocapture` and the plain-text
|
||||
one) to confirm independently rather than trust the aggregate count — both
|
||||
pass standalone.
|
||||
@@ -680,7 +680,7 @@ No disagreements to file. Specifically:
|
||||
review above; divergence between the two spellings is impossible by
|
||||
construction, confirmed.
|
||||
3. No `// auto-connected` comments — reasonable; the stated reasons
|
||||
(permanent, majority-case noise, a line vfmt hasn't crossed elsewhere)
|
||||
(permanent, majority-case noise, a line lucisv hasn't crossed elsewhere)
|
||||
are sound, and the alternative (documentation panel) genuinely carries
|
||||
the same information. Agree.
|
||||
4. Measuring `parse_source_tolerant` before choosing eager-vs-`resolve` —
|
||||
@@ -717,8 +717,8 @@ limitation and does not block shipping on its own.
|
||||
|
||||
### Files touched during QA (all reverted; nothing left in the tree)
|
||||
|
||||
`crates/vlog_refactor/src/instantiate.rs`, `crates/vfmt_server/src/completion.rs`,
|
||||
`crates/vfmt_server/src/signature.rs` — 12 temporary `qa_probe_*`/probe
|
||||
`crates/vlog_refactor/src/instantiate.rs`, `crates/lucisv_server/src/completion.rs`,
|
||||
`crates/lucisv_server/src/signature.rs` — 12 temporary `qa_probe_*`/probe
|
||||
tests added, run with `--nocapture`, then removed. Verified clean with
|
||||
`grep -rn qa_probe` (zero hits) and a final `cargo fmt --all -- --check` +
|
||||
`cargo clippy --all-targets` + `cargo test --workspace` (1222 passed)
|
||||
@@ -793,7 +793,7 @@ very first character); `\u_weird-mod` is.
|
||||
`has_escaped_identifier()` correctly returns `true` from the module-name
|
||||
check alone; `instance_name()` correctly returns `\u_weird-mod`; the
|
||||
skeleton `\weird-mod \u_weird-mod (\n .a(a)\n);` parses.
|
||||
- `crates/vfmt_server/src/completion.rs:126`'s gate
|
||||
- `crates/lucisv_server/src/completion.rs:126`'s gate
|
||||
(`snippets && !plan.has_escaped_identifier()`) — confirmed it forces
|
||||
plain text for the module-name-only case too, not just the
|
||||
port/param-escaped cases the dev's test already covers.
|
||||
@@ -857,7 +857,7 @@ _definition` already filters to names the index found.
|
||||
|
||||
### MEDIUM #2 (`.*` dead code) — mechanism review
|
||||
|
||||
Read the fix (`crates/vfmt_server/src/signature.rs:225-271`). The wildcard
|
||||
Read the fix (`crates/lucisv_server/src/signature.rs:225-271`). The wildcard
|
||||
check now lives inside the `if token.kind == TokenKind::Symbol` arm,
|
||||
*before* the `match` that does depth bookkeeping:
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ would: add a port and every instantiation in the project gains a connection for
|
||||
it; remove a port and every instantiation loses it; ask one instantiation to
|
||||
catch up with the module it instantiates and the missing connections appear.
|
||||
The engine lives in `crates/vlog_refactor` beside M2's rename, so Vim, VS Code
|
||||
and any future CLI get identical behavior; `vfmt_server` maps the protocol —
|
||||
and any future CLI get identical behavior; `lucisv_server` maps the protocol —
|
||||
two code actions and three `workspace/executeCommand` commands — and decides
|
||||
nothing. Every edit comes from a node `vlog_parser` parsed or a name
|
||||
`vlog_semantic` resolved, and the whole edit is verified in memory before it is
|
||||
@@ -44,7 +44,7 @@ editor says the same thing. A lightbulb that only ever explains why it cannot
|
||||
help is worse than no lightbulb, so a refusal produces no action at all.
|
||||
|
||||
`ModuleRef::At` exists because a code action or a keybinding knows a cursor,
|
||||
not a name; `ModuleRef::Name` because `vfmt.addPort` is also the API a UI calls
|
||||
not a name; `ModuleRef::Name` because `lucisv.addPort` is also the API a UI calls
|
||||
after asking the user which module (M4's instantiate work will want it too).
|
||||
|
||||
## What each refactoring does — exactly
|
||||
@@ -116,7 +116,7 @@ its body declaration; both are the same removal.
|
||||
- **An empty connection list** is not edited: there was nothing there.
|
||||
- Every occurrence of the port's name in text **the preprocessor owns** — a
|
||||
macro invocation's arguments (`` `BUMP(rst) ``), a `` `define`` body — is
|
||||
reported, in the module's file and in every file the removal edits. vfmt does
|
||||
reported, in the module's file and in every file the removal edits. lucisv does
|
||||
not expand macros, so an invocation is one opaque token: nothing there can be
|
||||
edited, and nothing there is visible to the body-use refusal either. Silence
|
||||
would be the worst answer, because only a real preprocessor would discover
|
||||
@@ -146,7 +146,7 @@ comment and the new element after it, as two insertions. A comma written after
|
||||
|
||||
### Conditional compilation — where a new port may not go
|
||||
|
||||
vfmt does not preprocess, so an `` `ifdef`` arm is ordinary text to it. That
|
||||
lucisv does not preprocess, so an `` `ifdef`` arm is ordinary text to it. That
|
||||
makes "append after the last declared port" wrong in one specific, silent way:
|
||||
|
||||
```systemverilog
|
||||
@@ -162,7 +162,7 @@ The last declared port is inside the arm, so the byte after it is inside the
|
||||
arm too, and a port appended there **only exists when `HAS_RST` is defined** —
|
||||
the opposite of what "add a port" means. None of the five verification checks
|
||||
can see this, by design: the file parses, no name changes meaning, and the
|
||||
re-parsed header really does declare the port, because vfmt reads straight
|
||||
re-parsed header really does declare the port, because lucisv reads straight
|
||||
through the `` `ifdef``. It is a *planning* mistake, not a verification gap, so
|
||||
it is caught in the planner:
|
||||
|
||||
@@ -174,10 +174,10 @@ it is caught in the planner:
|
||||
- **A non-zero count refuses the whole refactoring**, naming the arm and its
|
||||
line, and says to place the port by hand. (The ruling asked for `> 0`; `< 0`
|
||||
— more `` `endif``s than opens, a region opened outside the list — is refused
|
||||
too, since vfmt equally cannot tell what it would be writing into.)
|
||||
too, since lucisv equally cannot tell what it would be writing into.)
|
||||
- **A zero count proceeds, with a warning** naming the directives: the port
|
||||
lands outside every arm, which is correct, but the module's port set is
|
||||
configuration-dependent and the user should know that vfmt only sees one
|
||||
configuration-dependent and the user should know that lucisv only sees one
|
||||
spelling of it.
|
||||
|
||||
A macro *item* in a body (`` `ASSERT_INIT(...) ``) is not counted: it is a
|
||||
@@ -188,10 +188,10 @@ call, not a directive, and cannot open a region.
|
||||
Positional connections are where a port refactoring can silently change what a
|
||||
circuit does, so each case is decided rather than guessed:
|
||||
|
||||
| Situation | What vfmt does |
|
||||
| Situation | What lucisv does |
|
||||
|---|---|
|
||||
| `add_port`, ordered list whose length **equals** the module's port count before the change | Appends a position at the end. The new port *is* the new last port, so the end is where it belongs. |
|
||||
| `add_port`, ordered list of a **different** length | **Refuses the whole refactoring**, naming the instance and both counts, and says to convert it to named connections first. vfmt cannot tell which port a short list meant to connect. |
|
||||
| `add_port`, ordered list of a **different** length | **Refuses the whole refactoring**, naming the instance and both counts, and says to convert it to named connections first. lucisv cannot tell which port a short list meant to connect. |
|
||||
| `add_port`, **empty** list (`u1 ()`) | Left alone, with a warning. An empty list connects nothing before *and* after; appending would bind the new port to position 0. |
|
||||
| `add_port`, ordered site where no same-named signal is in scope | The position is written **empty** (`u1 (a, b, )`), not `/* TODO */`: a comment between two commas *is* an empty position, so a placeholder there would be a lie. Warned. |
|
||||
| `remove_port`, **any** non-empty ordered list anywhere in scope | **Refuses the whole refactoring.** Dropping one positional connection re-binds every one after it. The message says to convert to named connections first. |
|
||||
@@ -215,7 +215,7 @@ because nothing before it moves; deleting from one is not.
|
||||
port count (above).
|
||||
6. The module writes an `import` in its header and has **no** port list at all:
|
||||
the `;` that ends such a header cannot be told from the import's own `;`
|
||||
without preprocessing, so vfmt asks for `()` to be written first. (Today's
|
||||
without preprocessing, so lucisv asks for `()` to be written first. (Today's
|
||||
parser rejects that header outright, so this is a guard, not a path users
|
||||
reach.)
|
||||
7. The insertion point falls **inside a conditional arm**, or the directives
|
||||
@@ -232,7 +232,7 @@ because nothing before it moves; deleting from one is not.
|
||||
it is a warning instead; see above.)
|
||||
12. A deletion range would swallow a **comment** — a connection or a port with
|
||||
a comment written inside it. Comments are never dropped (invariant 3), and
|
||||
vfmt will not decide where a comment should move.
|
||||
lucisv will not decide where a comment should move.
|
||||
13. Verification fails.
|
||||
|
||||
`propagate_ports` refuses when:
|
||||
@@ -326,13 +326,13 @@ byte-for-byte.
|
||||
|
||||
## The LSP surface
|
||||
|
||||
**Code actions** (`vfmt_server/src/ports.rs`), kind
|
||||
`refactor.rewrite.vfmt.ports`, advertised alongside the existing quick-fix
|
||||
**Code actions** (`lucisv_server/src/ports.rs`), kind
|
||||
`refactor.rewrite.lucisv.ports`, advertised alongside the existing quick-fix
|
||||
kinds and honoring the client's `only` filter:
|
||||
|
||||
- On a port declaration in a header (or its non-ANSI body declaration):
|
||||
*"vfmt: remove port `p` (updates 3 instantiations)"*.
|
||||
- On an instantiation missing connections: *"vfmt: connect 2 missing ports"*.
|
||||
*"lucisv: remove port `p` (updates 3 instantiations)"*.
|
||||
- On an instantiation missing connections: *"lucisv: connect 2 missing ports"*.
|
||||
|
||||
Both carry the computed `WorkspaceEdit` inline — nothing to resolve — and
|
||||
neither is offered where the refactoring would be refused. They answer for the
|
||||
@@ -353,9 +353,9 @@ constructs.
|
||||
|
||||
| Command | Arguments | Why it exists |
|
||||
|---|---|---|
|
||||
| `vfmt.addPort` | `[uri, module-name-or-Position, "input logic [7:0] cfg"]` | A code action carries no free-form input. This is the API a UI calls once it has asked the user; the VS Code side can grow an input box over it without the engine changing. |
|
||||
| `vfmt.removePort` | `[uri, Position]` | A Vim user has no lightbulb; a command works wherever a keybinding does. |
|
||||
| `vfmt.propagatePorts` | `[uri, Position]` | Same. |
|
||||
| `lucisv.addPort` | `[uri, module-name-or-Position, "input logic [7:0] cfg"]` | A code action carries no free-form input. This is the API a UI calls once it has asked the user; the VS Code side can grow an input box over it without the engine changing. |
|
||||
| `lucisv.removePort` | `[uri, Position]` | A Vim user has no lightbulb; a command works wherever a keybinding does. |
|
||||
| `lucisv.propagatePorts` | `[uri, Position]` | Same. |
|
||||
|
||||
Each answers with the `WorkspaceEdit` for the client to apply. The server does
|
||||
**not** push `workspace/applyEdit`: the client asked for the command and owns
|
||||
@@ -373,25 +373,25 @@ engine's sentence verbatim, M2's precedent.
|
||||
disk — the same list `WorkspaceIndex::build` was given. The crate does no I/O.
|
||||
(M2's assumption, unchanged.)
|
||||
- **A module name is unique in scope.** Every instantiation resolves by name;
|
||||
if the workspace declares the name twice, vfmt refuses rather than guessing.
|
||||
if the workspace declares the name twice, lucisv refuses rather than guessing.
|
||||
- **`inst.module` is compared by name.** A scope-qualified instantiation
|
||||
(`pkg::mod u1 (...)`) is stored with its `::` glued and therefore does not
|
||||
match a bare module name — such an instantiation is not found and not edited.
|
||||
Real RTL does not write them; if it starts to, this is where to look.
|
||||
- **vfmt does not preprocess.** An instantiation hidden inside a macro body or
|
||||
- **lucisv does not preprocess.** An instantiation hidden inside a macro body or
|
||||
produced by a macro invocation is one opaque token and cannot be edited or
|
||||
even seen. An instantiation inside an `` `ifdef`` arm *is* ordinary tokens and
|
||||
*is* edited, in every arm — the same honesty M2 documents.
|
||||
- **vfmt does not elaborate.** "Is a signal called `cfg` in scope here?" is a
|
||||
- **lucisv does not elaborate.** "Is a signal called `cfg` in scope here?" is a
|
||||
lexical-scope question answered by `vlog_semantic`, not an elaboration; a
|
||||
name that would come from a wildcard package import that vfmt cannot resolve
|
||||
name that would come from a wildcard package import that lucisv cannot resolve
|
||||
reads as "not in scope", so the connection is a TODO rather than a wrong
|
||||
guess.
|
||||
- **A port refactoring is a rare, user-initiated request**, so re-parsing the
|
||||
in-scope files that mention the module (twice: once to plan, once to verify)
|
||||
is affordable. The substring prefilter M2 introduced keeps it to a handful of
|
||||
files. Measured below.
|
||||
- **Two spaces** are used for the one indentation vfmt has to invent (a body
|
||||
- **Two spaces** are used for the one indentation lucisv has to invent (a body
|
||||
declaration in a module with no items at all). Every other insertion copies an
|
||||
indentation that is already in the file.
|
||||
|
||||
@@ -424,7 +424,7 @@ engine's sentence verbatim, M2's precedent.
|
||||
rename's wording. M2's warning text and ordering are byte-for-byte
|
||||
unchanged; its 48 behavior tests pin that.
|
||||
|
||||
**Promised to `vfmt_server`** (and to any future CLI):
|
||||
**Promised to `lucisv_server`** (and to any future CLI):
|
||||
|
||||
- None of the four public functions panics, and none returns a partial edit:
|
||||
`Ok` means every edit in it verified *together*, `Err` means nothing at all is
|
||||
@@ -436,14 +436,14 @@ engine's sentence verbatim, M2's precedent.
|
||||
- `warnings` are informational: an `Ok` with warnings is still safe to apply.
|
||||
- `PortAction.title` is user-facing text; the server does not rewrite it.
|
||||
|
||||
**Changed in `vfmt_server`** (protocol layer only): `code_action::wanted` is
|
||||
**Changed in `lucisv_server`** (protocol layer only): `code_action::wanted` is
|
||||
now `pub` so the port actions can honor the same `only` filter the lint actions
|
||||
do; `server.rs` gained the `workspace/executeCommand` arm and the port-action
|
||||
call inside the existing `textDocument/codeAction` arm; `main.rs` advertises
|
||||
`executeCommandProvider` and the new code-action kind.
|
||||
|
||||
**Requested of nobody.** No change was needed in `vlog_parser`,
|
||||
`vlog_semantic`, `vlog_formatter` or `vfmt_core` for this milestone.
|
||||
`vlog_semantic`, `vlog_formatter` or `lucisv_core` for this milestone.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
@@ -464,7 +464,7 @@ call inside the existing `textDocument/codeAction` arm; `main.rs` advertises
|
||||
resolution identity outside the edits — plus the shape check
|
||||
- [x] Masked-corruption attacks for every new forgiveness (10 attacks and 2
|
||||
positive controls in `check.rs`)
|
||||
- [x] `vfmt_server`: code actions, three commands, capabilities
|
||||
- [x] `lucisv_server`: code actions, three commands, capabilities
|
||||
- [x] `may_have_port_action` — the one-file pre-check that keeps a
|
||||
cursor-move-frequency code-action request off the workspace walk
|
||||
- [x] Conditional-compilation guard on both insertion paths: refuse inside an
|
||||
@@ -474,13 +474,13 @@ call inside the existing `textDocument/codeAction` arm; `main.rs` advertises
|
||||
M2's scan (QA HIGH #2)
|
||||
- [x] Tests: 138 in `vlog_refactor` (36 unit — 12 of them the splice
|
||||
verifier's, 10 attacks and 2 positive controls — 50 behavior in
|
||||
`tests/ports.rs`, 48 rename behavior, 4 corpus), 9 in `vfmt_server`'s
|
||||
`tests/ports.rs`, 48 rename behavior, 4 corpus), 9 in `lucisv_server`'s
|
||||
`ports.rs`, 2 capability assertions, 1 e2e session covering a code
|
||||
action, all three commands and two refusals
|
||||
- [ ] Deferred to the umbrella backlog: reorder ports, parameter add/remove,
|
||||
task/function arguments, ordered → named conversion (which would turn
|
||||
three of the refusals above into an offer to convert first)
|
||||
- [ ] Deferred: a VS Code input box over `vfmt.addPort` (the command is the API
|
||||
- [ ] Deferred: a VS Code input box over `lucisv.addPort` (the command is the API
|
||||
until then; M4's instantiate work is the natural moment)
|
||||
|
||||
## Corpus acceptance
|
||||
@@ -494,7 +494,7 @@ corpus add_port over 860 files: Ok((6, 18)) in 0.39s (release; 1.9s debug)
|
||||
corpus rename over 860 files: Ok((6, 18)) in 0.38s
|
||||
```
|
||||
|
||||
Adding `input logic vfmt_probe_i` to `prim_fifo_sync` — a module OpenTitan
|
||||
Adding `input logic lucisv_probe_i` to `prim_fifo_sync` — a module OpenTitan
|
||||
instantiates all over — edits **6 files in 18 places**: the declaration, and
|
||||
every instantiation of it in the corpus, all of which are named-connection
|
||||
sites. Every edit is asserted to be an insertion of non-empty text, and the
|
||||
@@ -567,7 +567,7 @@ Checks at the end: `cargo fmt --all -- --check` clean, `cargo clippy
|
||||
--all-targets` silent (zero warnings, workspace-wide), `cargo test --workspace`
|
||||
green at **1164** tests (was 1085). No `unwrap`/`expect`/`panic!` and no
|
||||
`unsafe` in any library path of either crate (test modules only). One
|
||||
`#![allow(clippy::mutable_key_type)]` in `vfmt_server/src/ports.rs`, with the
|
||||
`#![allow(clippy::mutable_key_type)]` in `lucisv_server/src/ports.rs`, with the
|
||||
same reason `rename.rs` carries: `WorkspaceEdit.changes` is keyed by
|
||||
`lsp_types::Uri`, whose interior mutability is its own parse cache and takes no
|
||||
part in `Hash`/`Eq`.
|
||||
@@ -594,27 +594,27 @@ guard is exactly the ruling: count `` `ifdef``/`` `ifndef`` opens minus
|
||||
body for the non-ANSI declaration path — and refuse when the count is not zero,
|
||||
naming the arm and its line. When directives exist but the point is balanced,
|
||||
the edit proceeds with a warning naming them, because the module's port set is
|
||||
configuration-dependent either way and vfmt only ever sees one spelling of it.
|
||||
configuration-dependent either way and lucisv only ever sees one spelling of it.
|
||||
`` `else``/`` `elsif`` continue a region rather than opening one; a macro item
|
||||
in a body is a call, not a directive, and is not counted.
|
||||
|
||||
The ruling said "unbalanced (> 0)"; the implementation refuses on **any**
|
||||
non-zero count. A negative count means a region was opened outside the list, and
|
||||
vfmt can tell just as little about what it would be writing into — refusing is
|
||||
lucisv can tell just as little about what it would be writing into — refusing is
|
||||
the same answer for the same reason. Flagging the widening rather than doing it
|
||||
quietly.
|
||||
|
||||
Where the guard lives matters and is now stated in the README: this is a
|
||||
*planning* rule, not a verification one. All five verification checks correctly
|
||||
pass QA's reproduction — the file parses, no name changes meaning, and the
|
||||
re-parsed header does declare the port, because vfmt reads through the
|
||||
re-parsed header does declare the port, because lucisv reads through the
|
||||
`` `ifdef``. Only the planner can know the insertion point was wrong.
|
||||
Regression tests: QA's exact source as a crate-level refusal
|
||||
(`a_port_that_would_land_inside_an_ifdef_arm_is_refused`), the balanced mirror
|
||||
(`a_port_list_with_a_closed_conditional_is_edited_and_reported`), the non-ANSI
|
||||
body path (`a_non_ansi_body_declaration_that_would_land_inside_an_ifdef_arm_is_refused`),
|
||||
and QA's e2e shape kept: the existing port session gained a third file and a
|
||||
`vfmt.addPort` that comes back `-32803` with the arm named.
|
||||
`lucisv.addPort` that comes back `-32803` with the arm named.
|
||||
|
||||
**2. `remove_port` macro silence — now warned (QA HIGH #2).** M2's two scans
|
||||
were factored rather than copied: `Scope::define_sites` and
|
||||
@@ -664,7 +664,7 @@ One clippy-driven tidy while there: the header planner's arguments are now a
|
||||
Work log's number exactly (was 1085 before this milestone). Per-crate
|
||||
breakdown confirmed against the `Running`/`test result` pairs:
|
||||
`vlog_refactor` unit 36 + `corpus` 4 + `ports` 44 + `rename` 48 = 132;
|
||||
`vfmt_server` unit 222 + `e2e` 13 = 235; the rest unchanged from M1/M2.
|
||||
`lucisv_server` unit 222 + `e2e` 13 = 235; the rest unchanged from M1/M2.
|
||||
All three gates: **pass, claims confirmed.**
|
||||
|
||||
### Priority — `Shift::map`'s predicate change (`range.start < span.start` →
|
||||
@@ -741,7 +741,7 @@ task brief specifically raised:
|
||||
| Move a comment's exact text inside a string literal elsewhere in the file, with an edit that claims no changes | **Rejected.** The comment disappears as a `Piece::Comment` (piece-count/positional mismatch against the re-tokenized "after"); reappearing inside a string's token text doesn't fool the piece-kind comparison. |
|
||||
| A declared edit range covering only *half* the bytes of a `/* ... */` comment (partial overlap, not the whole span) | **Rejected**, via the existing "would delete a comment" rule — `overlaps()` is a share-a-byte test, so a partial overlap still counts as "deleted" and refuses outright, which is the conservative direction. |
|
||||
| An edit landing in the parameter list `#( ... )` instead of the port list `( ... )` — lexically clean, no comment touched, resolution identity holds, file still parses | **`verify_splice` alone returns `Ok`** — confirmed directly by calling it on a hand-built plan. This is not a hole; it is exactly the gap the README says `ports::confirm` (the shape check) exists to close, checks 1–4 have no concept of "port list vs. parameter list". |
|
||||
| The same parameter-list-injection plan, run through `ports::confirm` (the shape check) with the plan's own `expected` `Shape` (as `plan_add` would compute it) | **Rejected** — `confirm` re-parses the edited text, reads back the module's actual declared ports, sees `cfg` is not among them (it's a parameter), and refuses with "would not leave the signature vfmt intended". This proves end-to-end that a parameter-list capture is caught, and specifically that it is `confirm`, not `verify_splice`, doing the catching — matching the README's claim in "The shape check" and "One change to shared code" precisely. |
|
||||
| The same parameter-list-injection plan, run through `ports::confirm` (the shape check) with the plan's own `expected` `Shape` (as `plan_add` would compute it) | **Rejected** — `confirm` re-parses the edited text, reads back the module's actual declared ports, sees `cfg` is not among them (it's a parameter), and refuses with "would not leave the signature lucisv intended". This proves end-to-end that a parameter-list capture is caught, and specifically that it is `confirm`, not `verify_splice`, doing the catching — matching the README's claim in "The shape check" and "One change to shared code" precisely. |
|
||||
|
||||
No holes found in the verifier itself. The two-layer design (checks 1–4 for
|
||||
lexical/semantic honesty, check 5/`confirm` for "landed in the right list")
|
||||
@@ -767,7 +767,7 @@ brief's attack ideas:
|
||||
`"input a) (input b"`, `"input a)) (( input b"`, `` "input a /* ) */ b" ``,
|
||||
`` "input a `define X 1" ``) — all refused, none escaped the throwaway-header
|
||||
probe. (One string I initially treated as an injection attempt,
|
||||
`"input a[__vfmt_port_probe]"`, is not one on reflection — it's a legal ANSI
|
||||
`"input a[__lucisv_port_probe]"`, is not one on reflection — it's a legal ANSI
|
||||
port named `a` with an unpacked-array dimension that happens to *mention*
|
||||
the probe module's name; the probe is discarded after parsing, so there is
|
||||
nothing for it to interact with. Correctly accepted; my test's original
|
||||
@@ -775,12 +775,12 @@ brief's attack ideas:
|
||||
- Duplicate module names in the workspace (`m` declared in two files) →
|
||||
refused, "declared in more than one indexed file".
|
||||
- `propagate_ports` on an instantiation of an unindexed module name →
|
||||
refused, "vfmt indexes no module named `unknown_mod`".
|
||||
refused, "lucisv indexes no module named `unknown_mod`".
|
||||
- `.rst()` (empty named connection) is correctly treated as *already
|
||||
connected* by `propagate_ports` — refused with "already connects every
|
||||
port `sub` declares" rather than treating the empty parens as missing.
|
||||
- `remove_port` on a port used only inside an `` `ifdef NEVER_DEFINED``
|
||||
arm → **refused** ("still used inside `m` at m.sv:6"), confirming vfmt's
|
||||
arm → **refused** ("still used inside `m` at m.sv:6"), confirming lucisv's
|
||||
documented "does not preprocess" honesty extends correctly to body-use
|
||||
checking: an ifdef arm is ordinary tokens regardless of whether the guard
|
||||
is ever true.
|
||||
@@ -817,7 +817,7 @@ brief's attack ideas:
|
||||
|
||||
Reproduced twice: once through the crate's public `add_port` API, and
|
||||
independently through the **real server binary over stdio**
|
||||
(`vfmt.addPort` executeCommand — see below) to rule out a test-harness
|
||||
(`lucisv.addPort` executeCommand — see below) to rule out a test-harness
|
||||
artifact.
|
||||
|
||||
```systemverilog
|
||||
@@ -859,7 +859,7 @@ region.
|
||||
This is not a lexical, resolution, or shape-check failure — `verify_splice`
|
||||
correctly finds nothing to object to (the file parses, no comment moves, no
|
||||
name outside the edit changes meaning), and `confirm`'s shape check correctly
|
||||
finds `cfg` declared as a port in the re-parsed text (vfmt doesn't
|
||||
finds `cfg` declared as a port in the re-parsed text (lucisv doesn't
|
||||
preprocess, so it parses through the `` `ifdef`` regardless of the guard). So
|
||||
none of the four checks can catch this class of bug **by design** — it's not
|
||||
a verification gap, it's a planning gap: the plan itself asked for the wrong
|
||||
@@ -871,7 +871,7 @@ the response — no warning, no refusal — tells the user. This is exactly the
|
||||
brief named.
|
||||
|
||||
Confirmed independently over the **real server binary via stdio**
|
||||
(`workspace/executeCommand` → `vfmt.addPort`, `["<uri>","m","input logic cfg"]`):
|
||||
(`workspace/executeCommand` → `lucisv.addPort`, `["<uri>","m","input logic cfg"]`):
|
||||
the returned `WorkspaceEdit`'s single insertion lands at line 3 (0-indexed)
|
||||
of the source above — one line before `` `endif `` on line 4 — reproducing
|
||||
the finding through the full LSP stack, not just a direct crate call.
|
||||
@@ -918,7 +918,7 @@ valid-looking tokens to any downstream tool that also doesn't preprocess) but
|
||||
whose macro expansion, once actually preprocessed by a real compiler,
|
||||
references a port name that no longer exists — with the refactoring reporting
|
||||
complete, silent success. Not a byte-level corruption (hard invariant 1
|
||||
is about vfmt's own output being verified-correct or refused, and the output
|
||||
is about lucisv's own output being verified-correct or refused, and the output
|
||||
here *is* what the edit promised), but it is the same "silently wrong,
|
||||
zero indication" shape QA flagged as HIGH in M2, applied to the sibling
|
||||
feature that reused none of the fix.
|
||||
@@ -940,30 +940,30 @@ Handshake. Noting for awareness, not asking for a fix.
|
||||
### Real server binary over stdio
|
||||
|
||||
Ran the dev's own `a_port_code_action_and_the_port_commands_round_trip_over_the_wire`
|
||||
(`crates/vfmt_server/tests/e2e.rs:1001`) as part of the full-suite gate run
|
||||
(`crates/lucisv_server/tests/e2e.rs:1001`) as part of the full-suite gate run
|
||||
(pass, part of the 13 e2e sessions) — it already drives one `textDocument/codeAction`
|
||||
and all three `workspace/executeCommand`s (`vfmt.propagatePorts`,
|
||||
`vfmt.addPort` twice, once refused) against the real `vfmt-server` binary,
|
||||
and all three `workspace/executeCommand`s (`lucisv.propagatePorts`,
|
||||
`lucisv.addPort` twice, once refused) against the real `lucisv-server` binary,
|
||||
and asserts the code action's inline `WorkspaceEdit`, the command responses'
|
||||
edits, the advertised capabilities (`executeCommandProvider`, the
|
||||
`refactor.rewrite.vfmt.ports` code-action kind), and the `-32803` refusal
|
||||
`refactor.rewrite.lucisv.ports` code-action kind), and the `-32803` refusal
|
||||
shape. I re-ran it in isolation to confirm independently rather than trust
|
||||
the aggregate count, and it passed.
|
||||
|
||||
I additionally wrote and ran (temporarily, then reverted) my own independent
|
||||
e2e session — not reusing the dev's fixture — that drives `vfmt.addPort`
|
||||
e2e session — not reusing the dev's fixture — that drives `lucisv.addPort`
|
||||
through `workspace/executeCommand` against the real binary on the
|
||||
`` `ifdef ``-in-port-list source above; see the HIGH finding.
|
||||
|
||||
### Files touched during QA (all reverted; nothing left in the tree)
|
||||
|
||||
`crates/vlog_refactor/src/lib.rs`, `crates/vlog_refactor/src/check.rs`,
|
||||
`crates/vlog_refactor/src/ports.rs`, `crates/vfmt_server/tests/e2e.rs` each
|
||||
`crates/vlog_refactor/src/ports.rs`, `crates/lucisv_server/tests/e2e.rs` each
|
||||
had temporary `#[test] fn qa_*` functions added, run, and then restored
|
||||
byte-for-byte from a pre-edit copy (diffed against the copy to confirm a
|
||||
clean revert). `crates/vlog_refactor/tests/qa_probe.rs` was created, run,
|
||||
and deleted. `git status --short` after cleanup shows only the dev's
|
||||
original changes; `cargo build -p vlog_refactor -p vfmt_server --tests`
|
||||
original changes; `cargo build -p vlog_refactor -p lucisv_server --tests`
|
||||
rebuilds clean.
|
||||
|
||||
### Summary
|
||||
@@ -1039,7 +1039,7 @@ record):** in the trailing-directive-after-insertion case above, the edit is
|
||||
correctly accepted, but the accompanying warning still names the (entirely
|
||||
irrelevant, position-wise) trailing directives: `` "`m`'s port list carries
|
||||
compiler directives (`ifdef UNUSED` at m.sv:4, and 1 more), so what ports it
|
||||
declares depends on the configuration; vfmt added the port outside every
|
||||
declares depends on the configuration; lucisv added the port outside every
|
||||
conditional arm." `` The new port is *not* actually configuration-dependent
|
||||
here (nothing is declared inside that trailing, empty `` `ifdef``), because
|
||||
`guard_conditionals`'s warning branch reads from the full unfiltered
|
||||
@@ -1076,7 +1076,7 @@ invoked with no args vs. with args":
|
||||
all, so silence here is correct, not a gap.
|
||||
- **A *different* macro whose body spells the port name, invoked bare
|
||||
elsewhere** (`` `define GET_RST rst`` ... `` `GET_RST;``) — **correctly
|
||||
reported**: `` "`rst` appears in the body of macro `GET_RST` ... vfmt does
|
||||
reported**: `` "`rst` appears in the body of macro `GET_RST` ... lucisv does
|
||||
not preprocess, so that body still names the removed port." `` Confirms
|
||||
`define_sites` catches this via the `` `define`` table directly, independent
|
||||
of how the macro is later invoked (bare or with parens) — a body-spelling
|
||||
@@ -1111,7 +1111,7 @@ different from the ones already in `tests/rename.rs`, calling the public
|
||||
- `` `define BUMP(x) x = x + 1`` / `` `BUMP(a);``, renaming `a` → `b`:
|
||||
warning text came back **exactly** `` "`a` appears in the arguments of the
|
||||
macro invocation `BUMP` at m.sv:4 and was left unchanged; a macro
|
||||
invocation is one opaque token to vfmt, which does not expand macros." ``
|
||||
invocation is one opaque token to lucisv, which does not expand macros." ``
|
||||
— byte-for-byte the template `rename.rs::macro_use_warnings` has always
|
||||
produced.
|
||||
- `` `define HOLDS_A a`` (no invocation at all, just the body), renaming
|
||||
|
||||
@@ -4,11 +4,11 @@ Milestone **M2** of `docs/features/refactor/README.md`.
|
||||
|
||||
## Goal
|
||||
|
||||
Give vfmt the refactoring every Verilog user misses: rename a symbol and have
|
||||
Give lucisv the refactoring every Verilog user misses: rename a symbol and have
|
||||
*every* reference to it change, across files, or have the request refused with
|
||||
a sentence explaining why. The engine lives in a new crate,
|
||||
`crates/vlog_refactor`, so the CLI and every editor get identical behavior;
|
||||
`vfmt_server` only maps the protocol (`textDocument/prepareRename`,
|
||||
`lucisv_server` only maps the protocol (`textDocument/prepareRename`,
|
||||
`textDocument/rename` → `WorkspaceEdit`). Every edit comes from a span the
|
||||
semantic layer resolved — there is no textual search-and-replace anywhere in
|
||||
this feature — and the whole edit is verified in memory before it is returned:
|
||||
@@ -33,7 +33,7 @@ pub fn rename(files: &[(PathBuf, String)], file: &Path, offset: u32, new_name: &
|
||||
|
||||
`files` is **the boring option**: the in-scope files as `(path, text)` pairs —
|
||||
exactly what `WorkspaceIndex::build` already takes, and exactly what
|
||||
`vfmt_server`'s scope resolution (M1's filelist ⊃ walk ⊃ siblings ladder, open
|
||||
`lucisv_server`'s scope resolution (M1's filelist ⊃ walk ⊃ siblings ladder, open
|
||||
buffers overlaying disk) already produces. No trait, no borrow of server
|
||||
state, no I/O inside the crate.
|
||||
|
||||
@@ -105,7 +105,7 @@ sites, `.port(...)` connection names, and `#(.PARAM(...))` overrides.
|
||||
caught when the rename starts *from the declaration* and so never reaches
|
||||
rule 8.
|
||||
10. Some other in-scope reference to the name resolves ambiguously **onto this
|
||||
declaration** — a use vfmt would have to edit but cannot attribute.
|
||||
declaration** — a use lucisv would have to edit but cannot attribute.
|
||||
11. The declaration's `name_span` is empty (the layer could not find the name
|
||||
literally in the source), or an edit span does not slice back to the name.
|
||||
12. **Collision / capture.** After applying the edits in memory and
|
||||
@@ -181,7 +181,7 @@ microseconds on a Verilog file and needs no argument at all. Simplicity first.
|
||||
|
||||
## Preprocessor honesty
|
||||
|
||||
vfmt does not preprocess (TODO.md §7). What that means here, exactly as
|
||||
lucisv does not preprocess (TODO.md §7). What that means here, exactly as
|
||||
implemented:
|
||||
|
||||
- **`` `define`` bodies and macro names are never edited.** A `` `define`` is
|
||||
@@ -197,7 +197,7 @@ implemented:
|
||||
warns per occurrence: "`a` appears in the arguments of the macro invocation
|
||||
`` `BUMP `` at m.sv:4 …". This scan covers files the rename never edits, since
|
||||
a macro call in an untouched file still expands to the old name.
|
||||
- **`` `ifdef`` arms are ordinary tokens to vfmt**, so a resolved reference
|
||||
- **`` `ifdef`` arms are ordinary tokens to lucisv**, so a resolved reference
|
||||
inside one **is** renamed — in every arm. That is the honest behavior: the
|
||||
tokens are there, they bound to the declaration, and editing only one arm
|
||||
would break the build for the other. No warning; there is nothing left
|
||||
@@ -205,15 +205,15 @@ implemented:
|
||||
- **Occurrences the layer records nothing for are left alone and warned
|
||||
about, grouped by *why*** — the warning names the actual construct rather
|
||||
than guessing at a template:
|
||||
- `a hierarchical or member tail, which vfmt does not resolve` —
|
||||
- `a hierarchical or member tail, which lucisv does not resolve` —
|
||||
`u_inst.sig`, `a.b.c`, and `defparam u1.P` paths. This is the honest
|
||||
limitation: resolving a tail needs instance elaboration, which is a
|
||||
non-goal of `vlog_semantic`. A `defparam` naming a renamed parameter is
|
||||
therefore left pointing at the old name, and said so.
|
||||
- `an end label vfmt could not attach to its declaration` — a mismatched
|
||||
- `an end label lucisv could not attach to its declaration` — a mismatched
|
||||
label, or one whose declaration was a redeclaration.
|
||||
- `a label vfmt records no declaration for`, and
|
||||
`an occurrence vfmt cannot attribute to any declaration` for the rest.
|
||||
- `a label lucisv records no declaration for`, and
|
||||
`an occurrence lucisv cannot attribute to any declaration` for the rest.
|
||||
|
||||
## Assumptions
|
||||
|
||||
@@ -256,7 +256,7 @@ implemented:
|
||||
ranges that slice back to the name — every edit span is one of these, and
|
||||
the engine re-checks the slice before emitting it.
|
||||
|
||||
**Promised to `vfmt_server`** (and to any future CLI):
|
||||
**Promised to `lucisv_server`** (and to any future CLI):
|
||||
|
||||
- `rename` never panics and never returns a partial edit: `Ok` means every
|
||||
edit in it verified together, `Err` means nothing at all is to be applied.
|
||||
@@ -308,9 +308,9 @@ a much larger change than an end label and is not part of M2.
|
||||
HIGH #2), and unaccounted-occurrence warnings grouped by reason
|
||||
- [x] End labels renamed with their declaration, through a lead-authorized
|
||||
`vlog_semantic` change (QA round 1, priority finding)
|
||||
- [x] `vfmt_server`: `rename.rs`, `prepareRename` + `rename`, capabilities
|
||||
- [x] `lucisv_server`: `rename.rs`, `prepareRename` + `rename`, capabilities
|
||||
- [x] Tests: 64 in `vlog_refactor` (14 unit incl. 8 masked-corruption attacks,
|
||||
48 behavior, 2 corpus), 3 new in `vlog_semantic`, 8 in `vfmt_server`
|
||||
48 behavior, 2 corpus), 3 new in `vlog_semantic`, 8 in `lucisv_server`
|
||||
(7 in `rename.rs`, 1 capability), 1 e2e session
|
||||
- [ ] Deferred: rename in comments and strings (rope's `docs=True`) — the
|
||||
umbrella lists it as an option, off by default, "until asked for"
|
||||
@@ -397,14 +397,14 @@ Two things worth flagging for review:
|
||||
record nothing", `docs/features/vlog-semantic/README.md`), which is a
|
||||
handshake for a later round rather than a textual patch here. *(The lead
|
||||
authorized exactly that handshake; see the rework entry below.)*
|
||||
- **A `#[allow(clippy::mutable_key_type)]`** on `crates/vfmt_server/src/rename.rs`,
|
||||
- **A `#[allow(clippy::mutable_key_type)]`** on `crates/lucisv_server/src/rename.rs`,
|
||||
with the reason in a comment: `WorkspaceEdit.changes` is keyed by
|
||||
`lsp_types::Uri`, whose interior mutability is its own parse cache and takes
|
||||
no part in `Hash`/`Eq`. The map's shape is the protocol's, not ours.
|
||||
|
||||
Checks at the end: `cargo fmt --all -- --check` clean,
|
||||
`cargo clippy --all-targets` silent (zero warnings, workspace-wide),
|
||||
`cargo test --workspace` green — 55 in `vlog_refactor`, 212 in `vfmt_server`'s
|
||||
`cargo test --workspace` green — 55 in `vlog_refactor`, 212 in `lucisv_server`'s
|
||||
unit suite, 12 e2e sessions, nothing else moved. No `unwrap`/`expect`/`panic!`
|
||||
and no `unsafe` in any library path of either crate (test modules only).
|
||||
|
||||
@@ -486,13 +486,13 @@ Checks after the rework: `cargo fmt --all -- --check` clean,
|
||||
- `cargo test --workspace` — green, 0 failures across every crate. Counts
|
||||
match the Work log's claims: `vlog_refactor` 55 (14 unit incl. 8
|
||||
masked-corruption attacks in `check.rs`, 39 behavior in `tests/rename.rs`,
|
||||
2 corpus), `vfmt_server` unit suite 212, `vfmt_server` e2e 12 sessions
|
||||
2 corpus), `lucisv_server` unit suite 212, `lucisv_server` e2e 12 sessions
|
||||
(`the_binary_serves_a_whole_session_over_stdio` and friends).
|
||||
- Spot-checked the "no `unwrap`/`expect`/`panic!`/`unsafe` in library paths"
|
||||
claim: the only `expect()` calls in `crates/vlog_refactor/src/check.rs` are
|
||||
inside `#[cfg(test)] mod tests` (lines 302-303, 380). None in
|
||||
`crates/vfmt_server/src/rename.rs` outside its test module. The single
|
||||
`#![allow(clippy::mutable_key_type)]` in `vfmt_server/src/rename.rs:13`
|
||||
`crates/lucisv_server/src/rename.rs` outside its test module. The single
|
||||
`#![allow(clippy::mutable_key_type)]` in `lucisv_server/src/rename.rs:13`
|
||||
carries the required explanatory comment (lines 8-12). All confirmed.
|
||||
- All three gates: **pass, claims confirmed.**
|
||||
|
||||
@@ -664,7 +664,7 @@ implementation doesn't match its own contract.
|
||||
|
||||
### Real server binary over stdio
|
||||
|
||||
Built `target/debug/vfmt-server` and drove it directly with a hand-rolled
|
||||
Built `target/debug/lucisv-server` and drove it directly with a hand-rolled
|
||||
LSP/stdio client (`initialize` → `initialized` → `didOpen` →
|
||||
`textDocument/rename` → `shutdown` → `exit`), not just the crate's Rust
|
||||
tests:
|
||||
@@ -678,7 +678,7 @@ tests:
|
||||
`WorkspaceEdit` with the edit range exactly `{18, 19}` on that line — the
|
||||
"a" and nothing else. Correct.
|
||||
- **Refusal case.** Same file, rename to `module` (a keyword). Got back a
|
||||
JSON-RPC error, `code: -32803` (`RequestFailed`), `message: "vfmt: \`module\`
|
||||
JSON-RPC error, `code: -32803` (`RequestFailed`), `message: "lucisv: \`module\`
|
||||
is a Verilog keyword."` — matches the documented `-32803` refusal
|
||||
convention exactly.
|
||||
|
||||
@@ -744,7 +744,7 @@ named-`begin`) plus fork/join and interface, which round 1 didn't try:
|
||||
`module m; endmodule module other; endmodule : m` (the `: m` on `other` is
|
||||
already-illegal SV, since it doesn't match `other`) — renaming `m` leaves
|
||||
`other`'s `endmodule : m` **untouched**, with a warning naming it as "an
|
||||
end label vfmt could not attach to its declaration." Correct: it must never
|
||||
end label lucisv could not attach to its declaration." Correct: it must never
|
||||
attach by name.
|
||||
- The "redeclaration binds no symbol" case: `wire m; initial begin : m ... end
|
||||
: m` (a block label colliding with an existing net name — pre-existing
|
||||
@@ -813,7 +813,7 @@ and "the code path is actually reachable."
|
||||
Re-ran the round-1 repro (`` `define BUMP(x) x = x + 1`` /
|
||||
`` `BUMP(a)``, renaming `a`): now warned —
|
||||
"`a` appears in the arguments of the macro invocation `BUMP` at m.sv:4 and
|
||||
was left unchanged; a macro invocation is one opaque token to vfmt, which
|
||||
was left unchanged; a macro invocation is one opaque token to lucisv, which
|
||||
does not expand macros." Matches the dev's new test
|
||||
(`the_name_inside_a_macro_invocations_arguments_is_warned_about`).
|
||||
|
||||
@@ -880,7 +880,7 @@ unchanged, and the fixes held. The `vlog_semantic` change is scoped exactly
|
||||
as narrow as the Handshakes section says (additive, one target variant, one
|
||||
helper, no `vlog_parser` change), and the remaining warned-not-fixed
|
||||
surface (hierarchical tails, `defparam` paths, mismatched/redeclared end
|
||||
labels) is honestly disclosed and consistent with the "vfmt does not
|
||||
labels) is honestly disclosed and consistent with the "lucisv does not
|
||||
preprocess / does not elaborate" boundary the umbrella already draws.
|
||||
|
||||
## Review
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
This is the **umbrella plan** for porting the ideas of
|
||||
[rope](https://github.com/python-rope/rope) — Python's refactoring library —
|
||||
to vfmt. It is the single source of truth for the refactoring roadmap: the
|
||||
to lucisv. It is the single source of truth for the refactoring roadmap: the
|
||||
feature list below is the checklist the lead crosses off as milestones land
|
||||
and pass QA. Each milestone is implemented as its **own feature** with its own
|
||||
`docs/features/<name>/README.md`, per the repo's document-based workflow; this
|
||||
@@ -10,12 +10,12 @@ file links to them.
|
||||
|
||||
## Goal
|
||||
|
||||
Give vfmt the refactoring layer that ruff/Pylance users take for granted and
|
||||
Give lucisv the refactoring layer that ruff/Pylance users take for granted and
|
||||
no Verilog tool ships well: rename that actually updates every reference
|
||||
across files, module signature changes (add/remove ports) that update every
|
||||
instantiation, and "module hinting" — instantiation skeletons generated from
|
||||
the module's real definition, the way type hints drive completion in Python.
|
||||
All of it server-first (VS Code + Vim through the one `vfmt-server` binary),
|
||||
All of it server-first (VS Code + Vim through the one `lucisv-server` binary),
|
||||
scoped by an explicit **filelist** when the user has one and by sensible
|
||||
defaults when they don't, and covered by the same never-corrupt-code contract
|
||||
as the formatter.
|
||||
@@ -142,7 +142,7 @@ Found by auditing the shipped capability set against the LSP end goal
|
||||
built but nothing consumes yet. Ordered by value ÷ cost:
|
||||
|
||||
- [x] **Cross-file find-all-references** — `textDocument/references` is
|
||||
still in-file only (nav.rs:50; vfmt-server README names it "not done"),
|
||||
still in-file only (nav.rs:50; lucisv-server README names it "not done"),
|
||||
yet M2's rename already collects cross-file reference sets in
|
||||
`vlog_refactor`. Rename can change what references can't even list.
|
||||
Reuse M2's collection for the references answer — mostly wiring.
|
||||
@@ -171,8 +171,8 @@ built but nothing consumes yet. Ordered by value ÷ cost:
|
||||
multiply-driven: TODO.md §7 calls this the differentiation Verible
|
||||
cannot do, `vlog_semantic` has existed for rounds, and no semantic rule
|
||||
ships yet.
|
||||
- [x] **CLI `-f` filelist flag** — the vfmt.toml `filelist` key and the
|
||||
server consume M1's parser; `vfmt -f files.f` (format/lint exactly the
|
||||
- [x] **CLI `-f` filelist flag** — the lucisv.toml `filelist` key and the
|
||||
server consume M1's parser; `lucisv -f files.f` (format/lint exactly the
|
||||
project's files) still does not exist.
|
||||
- [x] **Single-step macro expansion on hover** — the define-table README
|
||||
promised it "later"; hover shows the body but expands nothing.
|
||||
@@ -189,7 +189,7 @@ corpus-check CI wiring, `--diff-base`, salsa (TODO.md §4–6).
|
||||
from a resolved reference span. Where resolution is honest about
|
||||
uncertainty (`InheritedCandidate`, ambiguous duplicates), the refactoring
|
||||
refuses rather than guesses — rope's "unsure matches" mode is *not* ported.
|
||||
- vfmt does not preprocess. A rename target whose name also appears inside
|
||||
- lucisv does not preprocess. A rename target whose name also appears inside
|
||||
a `` `define`` body or an `` `ifdef``-excluded region is reported as a
|
||||
warning on the response, and those occurrences are left untouched.
|
||||
- Verification budget: re-parsing every touched file after an edit is
|
||||
@@ -210,28 +210,28 @@ corpus-check CI wiring, `--diff-base`, salsa (TODO.md §4–6).
|
||||
`references_of`), `WorkspaceIndex` and `ExternalResolutions` read-only.
|
||||
Any resolution gap found while refactoring is filed against
|
||||
`vlog-semantic`, not patched around in the refactor crate.
|
||||
- **`vfmt_server`**: owns only the protocol mapping (WorkspaceEdit,
|
||||
- **`lucisv_server`**: owns only the protocol mapping (WorkspaceEdit,
|
||||
completion/snippet encoding, signature help); all edit *computation*
|
||||
lives in the new `vlog_refactor` crate so Vim gets identical behavior.
|
||||
- **`vfmt_core`**: filelist parsing lives here (next to config/walk), so a
|
||||
- **`lucisv_core`**: filelist parsing lives here (next to config/walk), so a
|
||||
future CLI `-f` flag reuses it unchanged.
|
||||
- **`vlog_formatter`**: not a dependency. Refactored output is *edited
|
||||
source*, not reformatted source — the user runs the formatter separately.
|
||||
(Keeps refactor edits minimal and reviewable, and keeps the formatter's
|
||||
safety net out of scope.)
|
||||
- **`editors/vscode`**: new setting `vfmt.filelist` (string path, default
|
||||
empty) forwarded like the existing `vfmt.*` settings.
|
||||
- **`editors/vscode`**: new setting `lucisv.filelist` (string path, default
|
||||
empty) forwarded like the existing `lucisv.*` settings.
|
||||
|
||||
## Milestones
|
||||
|
||||
Each is one feature dir, one dev agent, one QA pass, one lead review, one
|
||||
commit — in order:
|
||||
|
||||
1. **M1 `filelist`** — `.f` parsing in `vfmt_core` (paths, `-f` nesting with
|
||||
1. **M1 `filelist`** — `.f` parsing in `lucisv_core` (paths, `-f` nesting with
|
||||
cycle detection, `+incdir+`/`+define+` recorded, `#`//`//` comments,
|
||||
`$VAR`/`${VAR}` expansion; unknown `+args`/`-flags` skipped with a
|
||||
warning), server scope resolution (filelist ⊃ workspace walk ⊃
|
||||
current-file directory), `vfmt.filelist` VS Code setting + vfmt.toml
|
||||
current-file directory), `lucisv.filelist` VS Code setting + lucisv.toml
|
||||
`filelist` key.
|
||||
2. **M2 `refactor-rename`** — new crate `vlog_refactor` with the edit-plan
|
||||
model (`RefactorEdit { file → Vec<TextEdit> }`, verification by
|
||||
@@ -288,10 +288,10 @@ commit — in order:
|
||||
is. Workspace suite grew 1007 → 1232 tests. Backlog triage is the next
|
||||
session's first task.
|
||||
- **2026-08-24 (lead)**: Umbrella plan created from the rope overview docs
|
||||
and the current state of `vlog_semantic`/`vfmt_server`/`WorkspaceIndex`.
|
||||
and the current state of `vlog_semantic`/`lucisv_server`/`WorkspaceIndex`.
|
||||
Key decisions: server-first (no CLI surface yet), semantic-resolution-only
|
||||
edits (no textual fallback), whole-edit-or-nothing verification by
|
||||
re-parse, filelist in `vfmt_core`, rope's history/restructure explicitly
|
||||
re-parse, filelist in `lucisv_core`, rope's history/restructure explicitly
|
||||
not ported. Milestone READMEs are created by their dev agents.
|
||||
|
||||
## QA log
|
||||
|
||||
@@ -8,7 +8,7 @@ milestone taken from that plan's "LSP-parity and plumbing gaps" triage.
|
||||
Three navigation capabilities that were all wiring over machinery the tree
|
||||
already had. **Cross-file find-all-references**: `textDocument/references`
|
||||
answered in-file only, while M2's rename had been collecting cross-file
|
||||
reference sets since it shipped — so vfmt could *change* references it could
|
||||
reference sets since it shipped — so lucisv could *change* references it could
|
||||
not *list*. **Document highlight for symbols**: the cursor on a signal now
|
||||
highlights its declaration and every use in the file, where before only a
|
||||
`begin`/`end` pair answered and everything else fell through to the editor's
|
||||
@@ -28,7 +28,7 @@ predicate, and three handlers.
|
||||
layer. Consequence: a declaration the index has not seen yet (a buffer
|
||||
edited but not saved, when the file is new) is answered in-file until the
|
||||
next rebuild. That is the same staleness window every other cross-file
|
||||
answer already has, documented in `docs/features/vfmt-server/README.md`.
|
||||
answer already has, documented in `docs/features/lucisv-server/README.md`.
|
||||
- **A references answer costs what a rename costs.** The cross-file path calls
|
||||
`Workspace::sources()`, which re-reads every in-scope file, and then
|
||||
re-analyzes the files that spell the name. Measured at 218 ms over the
|
||||
@@ -80,10 +80,10 @@ out of `collect_edits`, which now calls it and turns the spans into edits.
|
||||
spans. The alternative considered was lifting the walk into `vlog_semantic`;
|
||||
it was rejected because the walk is not a semantic query — it needs the
|
||||
`Scope` cache, the workspace overlay *per file*, and the ambiguity policy,
|
||||
all of which are refactor-crate concerns, and `vfmt_server` already depends
|
||||
all of which are refactor-crate concerns, and `lucisv_server` already depends
|
||||
on `vlog_refactor`. Copy-pasting the walk into the server was never on the
|
||||
table: a references list that disagreed with what a rename would touch is a
|
||||
lie about what vfmt is going to do.
|
||||
lie about what lucisv is going to do.
|
||||
|
||||
**Consumed from `vlog_semantic`** (all pre-existing, nothing requested):
|
||||
`Semantics::{reference_at, reference_id_at, references_of, symbol, symbol_at,
|
||||
@@ -96,7 +96,7 @@ scope}`, `Scope::owner`, `Symbol::{name, scope, name_span}`,
|
||||
|
||||
**Consumed from this crate's own `pairs.rs`**: `analyze(&[Token]) ->
|
||||
ScopeAnalysis`, unchanged. `folding.rs` is its fourth consumer
|
||||
(`documentHighlight`, the missing-closer warnings, `vfmt/scopePairs`, folding)
|
||||
(`documentHighlight`, the missing-closer warnings, `lucisv/scopePairs`, folding)
|
||||
and reads only `pairs`, never `unmatched_open`/`unmatched_close`.
|
||||
|
||||
**Promised to the editors**: nothing new to configure. `foldingRange` is a
|
||||
@@ -123,7 +123,7 @@ and none was made.
|
||||
- [x] `foldingRangeProvider` advertised in `main.rs`.
|
||||
- [x] e2e: one session covering cross-file references (both
|
||||
`includeDeclaration` values), `foldingRange` and `documentHighlight`.
|
||||
- [x] `docs/features/vfmt-server/README.md`: capability table, the "not done"
|
||||
- [x] `docs/features/lucisv-server/README.md`: capability table, the "not done"
|
||||
list, and Handshakes updated.
|
||||
- [ ] **Not done, deliberately:** line-comment run folding (`//` blocks). The
|
||||
token stream carries each `//` comment separately, so folding a *run* of
|
||||
@@ -145,7 +145,7 @@ and none was made.
|
||||
### 2026-08-24 — dev agent (M7)
|
||||
|
||||
- **Read first**: `CLAUDE.md`, `docs/features/refactor/README.md`'s triage,
|
||||
`docs/features/vfmt-server/README.md` in full, then `nav.rs`, `pairs.rs`,
|
||||
`docs/features/lucisv-server/README.md` in full, then `nav.rs`, `pairs.rs`,
|
||||
`state.rs`, `server.rs`, `main.rs`, `vlog_refactor/src/rename.rs` and
|
||||
`vlog_semantic`'s `workspace.rs`/`model.rs`. The design decisions below all
|
||||
came out of that reading rather than out of the brief.
|
||||
@@ -169,7 +169,7 @@ and none was made.
|
||||
- **`documentHighlight` gained a second answer rather than a second
|
||||
handler.** `pairs::highlights` is tried first and `nav::document_highlights`
|
||||
second; both return `Option`, and both `None` means `null`, which is what
|
||||
keeps the editor's own word highlighting alive where vfmt knows nothing.
|
||||
keeps the editor's own word highlighting alive where lucisv knows nothing.
|
||||
The two never compete: a scope keyword is never an identifier.
|
||||
- **Folding stops one line short of the closer** (`endLine = close line - 1`).
|
||||
LSP hides `startLine + 1 ..= endLine`, so this leaves `end`/`endmodule` on
|
||||
@@ -194,20 +194,20 @@ and none was made.
|
||||
inside the 1 s budget the brief set.
|
||||
- **No new dependencies.** No `unsafe`, no `unwrap`/`expect`/`panic!` outside
|
||||
`#[cfg(test)]`, no new `#[allow]`.
|
||||
- Did not touch `vlog_parser`, `vlog_formatter`, `vlog_linter`, `vfmt_core`,
|
||||
`crates/vfmt`, `editors/`, `TODO.md` or the umbrella plan. Did not run
|
||||
- Did not touch `vlog_parser`, `vlog_formatter`, `vlog_linter`, `lucisv_core`,
|
||||
`crates/lucisv`, `editors/`, `TODO.md` or the umbrella plan. Did not run
|
||||
`git commit`/`git push`. No version bump (0.5.0 is M14's).
|
||||
|
||||
**Results.** `cargo fmt --all -- --check`: clean. `cargo clippy --all-targets`:
|
||||
0 warnings. `cargo test --workspace`: **1329 passed, 0 failed**, of which **34 are new**:
|
||||
15 in `folding.rs`, 11 added to `nav.rs` (20 there in total), 7 in
|
||||
`references.rs`, and 1 e2e (18 in that file now).
|
||||
`node editors/vscode/smoke.js target/release/vfmt-server`: OK.
|
||||
`node editors/vscode/smoke.js target/release/lucisv-server`: OK.
|
||||
Files added: `crates/vlog_refactor/src/references.rs`,
|
||||
`crates/vfmt_server/src/folding.rs`, this README. Files edited:
|
||||
`crates/lucisv_server/src/folding.rs`, this README. Files edited:
|
||||
`crates/vlog_refactor/src/{lib.rs,rename.rs}`,
|
||||
`crates/vfmt_server/src/{main.rs,server.rs,nav.rs}`,
|
||||
`crates/vfmt_server/tests/e2e.rs`, `docs/features/vfmt-server/README.md`.
|
||||
`crates/lucisv_server/src/{main.rs,server.rs,nav.rs}`,
|
||||
`crates/lucisv_server/tests/e2e.rs`, `docs/features/lucisv-server/README.md`.
|
||||
|
||||
## QA log
|
||||
|
||||
@@ -221,7 +221,7 @@ Files added: `crates/vlog_refactor/src/references.rs`,
|
||||
- `cargo test --workspace` — **1329 passed, 0 failed**, matching the Work
|
||||
log's count exactly, before I added one regression test (see below); 1330
|
||||
after.
|
||||
- `node editors/vscode/smoke.js target/release/vfmt-server` — OK.
|
||||
- `node editors/vscode/smoke.js target/release/lucisv-server` — OK.
|
||||
- `cargo test -p vlog_refactor` standalone — **48/48** rename behavior tests
|
||||
green (`tests/rename.rs`), confirming the `collect_edits`/
|
||||
`collect_occurrences` split changed nothing rename depends on.
|
||||
@@ -270,7 +270,7 @@ removed after the round, not committed) exercising the public API directly:
|
||||
`find_references(..., include_declaration: true)` are **identical** after
|
||||
sorting. Spot-checked in code, not just eyeballed.
|
||||
|
||||
#### Attempts to break it (`vfmt_server::nav`, handler level)
|
||||
#### Attempts to break it (`lucisv_server::nav`, handler level)
|
||||
|
||||
Six scratch tests added temporarily to `nav.rs`'s own test module, run, then
|
||||
removed (`git diff --stat` on `nav.rs` returned to the dev's exact
|
||||
@@ -310,7 +310,7 @@ removed (`git diff --stat` on `nav.rs` returned to the dev's exact
|
||||
|
||||
**Fix applied (small, unambiguous per CLAUDE.md's QA license):** added
|
||||
`a_name_declared_in_two_files_degrades_references_to_the_in_file_answer` to
|
||||
`crates/vfmt_server/src/nav.rs` (permanent, not a probe) — the one claim
|
||||
`crates/lucisv_server/src/nav.rs` (permanent, not a probe) — the one claim
|
||||
above that had behavior verified correct but zero regression coverage.
|
||||
Workspace test count is now 1330 (was 1329), gates re-run green after the
|
||||
addition.
|
||||
@@ -404,13 +404,13 @@ is a completely ordinary real-world query, not an edge case.
|
||||
"820 source files indexed"; the Assumptions section separately says "the
|
||||
860-file corpus". A plain `find` over `corpus/` for `.v`/`.sv`/`.svh`/`.vh`
|
||||
returns exactly **860**, matching every earlier round's number for this same
|
||||
directory (`docs/features/vfmt-server/README.md`'s QA log, 2026-08-19: "860
|
||||
directory (`docs/features/lucisv-server/README.md`'s QA log, 2026-08-19: "860
|
||||
files"). `corpus/` itself is listed in the repo's own `.gitignore`, but the
|
||||
LSP root was pointed *at* `corpus/`, so that rule is moot; however `corpus/`
|
||||
contains **19 nested `.gitignore` files** from the vendored upstream repos
|
||||
themselves (`corpus/ibex/.gitignore`, `corpus/opentitan/.gitignore`, etc.),
|
||||
and the workspace walk has honored `.gitignore` unconditionally since
|
||||
`vfmt-core-lift` landed the same day as this round. So 820 vs. 860 is
|
||||
`lucisv-core-lift` landed the same day as this round. So 820 vs. 860 is
|
||||
plausibly real — some vendored generated/build files are legitimately
|
||||
excluded now that they weren't when the 860 number was first measured — but
|
||||
I could not independently confirm 820 exactly: LSP exposes no
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
## Goal
|
||||
|
||||
Make vfmt a thing that can be *handed to someone* rather than a working tree:
|
||||
Make lucisv a thing that can be *handed to someone* rather than a working tree:
|
||||
a real `LICENSE`, a user-facing `CHANGELOG.md` for **0.2.0**, one version
|
||||
number that actually reaches `vfmt --version` and the language server's
|
||||
number that actually reaches `lucisv --version` and the language server's
|
||||
`serverInfo`, a `tools/release.sh` that turns a clean tree into
|
||||
`dist/{binaries, .vsix, SHA256SUMS}` with nothing but cargo, npm and `shasum`,
|
||||
and a `tools/RELEASING.md` that says where every one of those numbers lives.
|
||||
@@ -23,7 +23,7 @@ a Handshake request to the repo root.
|
||||
in two files if so: `LICENSE` and its copy `editors/vscode/LICENSE`.
|
||||
- **0.2.0 is the first release.** There are no git tags and no prior changelog;
|
||||
`0.1.0` was the workspace's initial version number and was never tagged or
|
||||
distributed. So the changelog describes vfmt as it stands rather than a delta
|
||||
distributed. So the changelog describes lucisv as it stands rather than a delta
|
||||
against a shipped predecessor, and says so in its own text.
|
||||
- **The `LICENSE` copy under `editors/vscode/` is a real file, not a symlink.**
|
||||
`vsce` requires the file next to `package.json`, and a symlink is one more
|
||||
@@ -36,7 +36,7 @@ a Handshake request to the repo root.
|
||||
- **`dist/` is disposable.** The script `rm -rf`s and recreates it, and it is
|
||||
gitignored. Nothing should ever be authored there.
|
||||
- **The binaries are the authority on the version**, not `Cargo.toml`:
|
||||
`release.sh` reads `vfmt --version` from the binary it just built, so a
|
||||
`release.sh` reads `lucisv --version` from the binary it just built, so a
|
||||
stale build can never be labeled with a fresh version number.
|
||||
|
||||
## Handshakes
|
||||
@@ -47,7 +47,7 @@ a Handshake request to the repo root.
|
||||
against the freshly copied server binary before packaging anything. Contract
|
||||
used: `node smoke.js <path>` exits 0 on a healthy binary, non-zero otherwise.
|
||||
If that script's argument shape changes, `release.sh` changes with it.
|
||||
- `crates/vfmt`'s `--version` output format: `vfmt <semver>` on one line, with
|
||||
- `crates/lucisv`'s `--version` output format: `lucisv <semver>` on one line, with
|
||||
the version in field 2. `release.sh` parses it with `awk '{print $2}'`.
|
||||
- `editors/vscode/.vscodeignore` — still the thing that keeps `smoke.js` out of
|
||||
the package; the script does not re-implement it, it verifies the result.
|
||||
@@ -59,13 +59,13 @@ a Handshake request to the repo root.
|
||||
`editors/vscode/package-lock.json`) and nowhere in Rust source. Anyone adding
|
||||
a hard-coded version string breaks that promise and should update
|
||||
`tools/RELEASING.md` §1 in the same change.
|
||||
- `tools/release.sh`'s output layout (`dist/vfmt-<version>-<host>`,
|
||||
`dist/vfmt-server-<version>-<host>`, `dist/vfmt-<version>.vsix`,
|
||||
- `tools/release.sh`'s output layout (`dist/lucisv-<version>-<host>`,
|
||||
`dist/lucisv-server-<version>-<host>`, `dist/lucisv-<version>.vsix`,
|
||||
`dist/SHA256SUMS`) is what `README.md` and `tools/RELEASING.md` document.
|
||||
|
||||
**Requested of other modules:** none. Nothing under `crates/` was modified —
|
||||
the serverInfo version wire the brief flagged as "wire if trivial" turned out
|
||||
to already exist (`crates/vfmt_server/src/main.rs:98` uses
|
||||
to already exist (`crates/lucisv_server/src/main.rs:98` uses
|
||||
`env!("CARGO_PKG_VERSION")`), so the workspace bump reached it for free.
|
||||
|
||||
## Status / TODO
|
||||
@@ -79,8 +79,8 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses
|
||||
- [x] Version bumped to **0.2.0**: `Cargo.toml` `[workspace.package]` (all
|
||||
seven crates inherit), `Cargo.lock`, `editors/vscode/package.json`,
|
||||
`editors/vscode/package-lock.json` (both entries).
|
||||
- [x] `vfmt --version` → `vfmt 0.2.0`; `initialize` → `serverInfo` →
|
||||
`{"name":"vfmt-server","version":"0.2.0"}`, checked over the wire.
|
||||
- [x] `lucisv --version` → `lucisv 0.2.0`; `initialize` → `serverInfo` →
|
||||
`{"name":"lucisv-server","version":"0.2.0"}`, checked over the wire.
|
||||
- [x] `tools/release.sh` — host-target release build, smoke test, `.vsix`,
|
||||
`SHA256SUMS`, into `dist/`. Std tooling only, no new dependency.
|
||||
- [x] `tools/RELEASING.md` — bump locations, gate, artifacts, `.vsix` details
|
||||
@@ -102,7 +102,7 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses
|
||||
- [ ] **Not done, deliberately:** cross-compiled binaries, a release tarball
|
||||
layout, CI packaging, and signing/notarization. Each is a real project
|
||||
with a dependency behind it; none is needed to hand someone a binary.
|
||||
- [ ] **Not verified here:** `code --install-extension dist/vfmt-0.2.0.vsix`.
|
||||
- [ ] **Not verified here:** `code --install-extension dist/lucisv-0.2.0.vsix`.
|
||||
Installing into the user's editor is a change to their environment, not
|
||||
a validation step — the same line editor-packaging's dev round drew. The
|
||||
package was built and its contents inspected instead.
|
||||
@@ -123,7 +123,7 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses
|
||||
harmless and pre-existing; removing them would be a change nobody asked for).
|
||||
What I did keep in `editors/vscode/README.md` is a **correctness** edit, not
|
||||
a marketing one: its install block still said `--skip-license` and
|
||||
`vfmt-0.1.0.vsix`, both of which are now false.
|
||||
`lucisv-0.1.0.vsix`, both of which are now false.
|
||||
- **The `LICENSE` closed an open Handshake, not just a checkbox.**
|
||||
`docs/features/editor-packaging/README.md` filed "Repo root: no `LICENSE`
|
||||
file exists" as a request, and its README and the top-level README both
|
||||
@@ -131,11 +131,11 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses
|
||||
in `editors/vscode/`, `npx @vscode/vsce package` runs clean and ships
|
||||
`extension/LICENSE.txt` — confirmed in the built package, not assumed.
|
||||
- **No version string was hard-coded anywhere, and none had to be added.**
|
||||
`vfmt --version` and `ServerInfo.version` both already read
|
||||
`lucisv --version` and `ServerInfo.version` both already read
|
||||
`env!("CARGO_PKG_VERSION")`, and all seven crates use
|
||||
`version.workspace = true`, so the bump is genuinely one line plus the two
|
||||
lockfiles. I checked for version-asserting tests before bumping (the brief
|
||||
warned some might exist): `crates/vfmt_server/tests/e2e.rs:393` asserts
|
||||
warned some might exist): `crates/lucisv_server/tests/e2e.rs:393` asserts
|
||||
`serverInfo.name` only, and no test anywhere matches `0.1.0`. Nothing needed
|
||||
fixing, and nothing under `crates/` was touched — the concurrent
|
||||
parser/formatter round's files are untouched by me.
|
||||
@@ -148,8 +148,8 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses
|
||||
release script that ships an untested binary is a release script that ships
|
||||
a broken one eventually. If `node` is absent the script says so on stderr and
|
||||
continues rather than failing — the binaries are still valid artifacts.
|
||||
- **The checksum line is explicit, not a glob.** `shasum -a 256 vfmt-*` would
|
||||
have matched `vfmt-server-*` twice and raced the `> SHA256SUMS` redirect
|
||||
- **The checksum line is explicit, not a glob.** `shasum -a 256 lucisv-*` would
|
||||
have matched `lucisv-server-*` twice and raced the `> SHA256SUMS` redirect
|
||||
against its own glob; the script builds the file list by name instead.
|
||||
- **The `vsce` sandbox-path failure is documented where someone will hit it.**
|
||||
editor-packaging's QA traced it (vsce shells out to `npm list --parseable`
|
||||
@@ -180,25 +180,25 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| `tools/release.sh` end to end | exit 0, all four artifacts produced |
|
||||
| `target/release/vfmt --version` | `vfmt 0.2.0` |
|
||||
| `initialize` → `serverInfo` (hand-driven LSP session over stdio) | `{"name":"vfmt-server","version":"0.2.0"}`, exit 0 |
|
||||
| `node smoke.js dist/vfmt-server-0.2.0-aarch64-apple-darwin` | `smoke: OK` — 3 messages, exit 0 |
|
||||
| `target/release/lucisv --version` | `lucisv 0.2.0` |
|
||||
| `initialize` → `serverInfo` (hand-driven LSP session over stdio) | `{"name":"lucisv-server","version":"0.2.0"}`, exit 0 |
|
||||
| `node smoke.js dist/lucisv-server-0.2.0-aarch64-apple-darwin` | `smoke: OK` — 3 messages, exit 0 |
|
||||
| `npx @vscode/vsce package` **without** `--skip-license` | packaged, 321 files, 463.1 KB |
|
||||
| `.vsix` contains `extension/LICENSE.txt` | yes, 1062 bytes (the MIT text) |
|
||||
| `.vsix` contains `smoke.js` | no (`unzip -l \| grep -c smoke.js` → 0) |
|
||||
| `cd dist && shasum -a 256 -c SHA256SUMS` | 3/3 OK |
|
||||
| `git check-ignore dist/vfmt-0.2.0.vsix` | ignored via `.gitignore:4:/dist` |
|
||||
| `git check-ignore dist/lucisv-0.2.0.vsix` | ignored via `.gitignore:4:/dist` |
|
||||
| `cargo test --workspace` | **589 passed, 0 failed**, exit 0 |
|
||||
| `cargo fmt --check` | exit 0 |
|
||||
| `cargo clippy --all-targets` | exit 0, zero warnings |
|
||||
|
||||
**Artifacts (aarch64-apple-darwin, vfmt 0.2.0):**
|
||||
**Artifacts (aarch64-apple-darwin, lucisv 0.2.0):**
|
||||
|
||||
| File | Bytes | SHA-256 |
|
||||
|---|---|---|
|
||||
| `vfmt-0.2.0-aarch64-apple-darwin` | 1,292,080 | `5a0c9d7ad936230461be163efdfec8b654c5c49e3efcd19641a8d091014083aa` |
|
||||
| `vfmt-server-0.2.0-aarch64-apple-darwin` | 2,211,072 | `ab3a5d8acb19bc5ec692ac0150b3f0d475e5a7d4a160d20255a2bb2ded5d0e09` |
|
||||
| `vfmt-0.2.0.vsix` | 474,214 | `1c9493d2225d5766e930b089de38ab7213478f150619a81f46ec84a4f2771afe` |
|
||||
| `lucisv-0.2.0-aarch64-apple-darwin` | 1,292,080 | `5a0c9d7ad936230461be163efdfec8b654c5c49e3efcd19641a8d091014083aa` |
|
||||
| `lucisv-server-0.2.0-aarch64-apple-darwin` | 2,211,072 | `ab3a5d8acb19bc5ec692ac0150b3f0d475e5a7d4a160d20255a2bb2ded5d0e09` |
|
||||
| `lucisv-0.2.0.vsix` | 474,214 | `1c9493d2225d5766e930b089de38ab7213478f150619a81f46ec84a4f2771afe` |
|
||||
|
||||
(The `.vsix` hash is not reproducible across runs — a zip embeds mtimes — so it
|
||||
identifies one build, not the source it came from.)
|
||||
@@ -242,13 +242,13 @@ happened when I exercised `tools/release.sh` anyway.
|
||||
`publisher` is still the literal string `REPLACE-ME`; `categories`,
|
||||
`repository` etc. are untouched (pre-existing, not added this round).
|
||||
`git diff editors/vscode/README.md` is exactly the three claimed edits:
|
||||
`--skip-license` removed, `vfmt-0.1.0.vsix` → `vfmt-0.2.0.vsix`, and a new
|
||||
`--skip-license` removed, `lucisv-0.1.0.vsix` → `lucisv-0.2.0.vsix`, and a new
|
||||
"sideloading is the supported install" paragraph — no marketplace-audience
|
||||
restructuring. Marketplace commands (`vsce publish`, `ovsx publish`) appear
|
||||
only inside `tools/RELEASING.md`'s `## Appendix — if the owner ever publishes
|
||||
to a marketplace` section, explicitly headed "Optional and deferred."
|
||||
Independent corroboration: sideloading the built `.vsix` (see job below)
|
||||
resolved the extension id as `replace-me.vfmt@0.2.0` — the placeholder is
|
||||
resolved the extension id as `replace-me.lucisv@0.2.0` — the placeholder is
|
||||
live, not just present in the source file.
|
||||
|
||||
**2. Artifacts — PASS**, checked against the dist/ state as left by the dev,
|
||||
@@ -257,17 +257,17 @@ before I ran anything myself:
|
||||
`dist/SHA256SUMS` matched the work-log table character for character
|
||||
(`5a0c9d7a…83aa`, `ab3a5d8a…d5d0e09`, `1c9493d2…2771afe`), as did all three
|
||||
file sizes (1,292,080 / 2,211,072 / 474,214 bytes).
|
||||
- `unzip -l dist/vfmt-0.2.0.vsix` → exactly `321 files`; `extension/LICENSE.txt`
|
||||
- `unzip -l dist/lucisv-0.2.0.vsix` → exactly `321 files`; `extension/LICENSE.txt`
|
||||
present at exactly `1062` bytes; `grep -c smoke.js` over the listing → `0`.
|
||||
- `unzip -p dist/vfmt-0.2.0.vsix extension/readme.md | diff - editors/vscode/README.md`
|
||||
- `unzip -p dist/lucisv-0.2.0.vsix extension/readme.md | diff - editors/vscode/README.md`
|
||||
→ identical. The hand-repackage claim (vsix readme matches the *current*
|
||||
vscode README, not the one from the full script run) checks out.
|
||||
|
||||
**3. Version — PASS.**
|
||||
`dist/vfmt-0.2.0-aarch64-apple-darwin --version` → `vfmt 0.2.0`. Hand-rolled a
|
||||
`dist/lucisv-0.2.0-aarch64-apple-darwin --version` → `lucisv 0.2.0`. Hand-rolled a
|
||||
minimal LSP client (Python, framed `initialize` over stdio) against
|
||||
`dist/vfmt-server-0.2.0-aarch64-apple-darwin`: `serverInfo` came back
|
||||
`{"name":"vfmt-server","version":"0.2.0"}` — confirms the claim independent of
|
||||
`dist/lucisv-server-0.2.0-aarch64-apple-darwin`: `serverInfo` came back
|
||||
`{"name":"lucisv-server","version":"0.2.0"}` — confirms the claim independent of
|
||||
the smoke test, which doesn't check `serverInfo` at all. All seven
|
||||
`crates/*/Cargo.toml` have `version.workspace = true` (grepped each file by
|
||||
hand). `Cargo.lock` shows `version = "0.2.0"` for all seven workspace crates
|
||||
@@ -293,8 +293,8 @@ described.
|
||||
**6. RELEASING.md — PASS**, one non-blocking note.
|
||||
§1's four bump locations match reality; a repo-wide `git grep -n "0\.1\.0"`
|
||||
turned up exactly one hit outside `Cargo.lock`, and it is not a checklist
|
||||
gap: `docs/features/vfmt-core-lift/README.md:399` quotes an *illustrative*
|
||||
`cargo tree` example (`vfmt_core v0.1.0 (...)`) inside a different, older
|
||||
gap: `docs/features/lucisv-core-lift/README.md:399` quotes an *illustrative*
|
||||
`cargo tree` example (`lucisv_core v0.1.0 (...)`) inside a different, older
|
||||
feature's doc prose — not a version string any tool reads or ships. Leaving
|
||||
it as an FYI for whoever next touches that doc, not filing it as a
|
||||
release-prep defect. The sandbox-path `vsce` warning is present in
|
||||
@@ -321,10 +321,10 @@ this isn't a false claim, just worth knowing before running it offline.
|
||||
**Additional jobs:**
|
||||
- **Sideload dry run — did the real install, not just unzip-inspection**,
|
||||
since it's cheaply reversible: `code --install-extension
|
||||
dist/vfmt-0.2.0.vsix` → "successfully installed"; `code --list-extensions
|
||||
--show-versions` showed `replace-me.vfmt@0.2.0`; `code --uninstall-extension
|
||||
replace-me.vfmt` → "successfully uninstalled", confirmed gone from the list
|
||||
afterward. What a user would see: VS Code installs and activates "vfmt —
|
||||
dist/lucisv-0.2.0.vsix` → "successfully installed"; `code --list-extensions
|
||||
--show-versions` showed `replace-me.lucisv@0.2.0`; `code --uninstall-extension
|
||||
replace-me.lucisv` → "successfully uninstalled", confirmed gone from the list
|
||||
afterward. What a user would see: VS Code installs and activates "lucisv —
|
||||
Verilog/SystemVerilog" with no publisher verification badge (since
|
||||
`REPLACE-ME` isn't a real Marketplace identity) — consistent with a
|
||||
sideload-only extension, nothing more.
|
||||
@@ -336,14 +336,14 @@ this isn't a false claim, just worth knowing before running it offline.
|
||||
concurrently-running parser/formatter round (touched exactly the files that
|
||||
round's own compile errors pointed at, see below), none of them plausibly a
|
||||
release-prep edit (no version strings, no CLI/LSP wiring in the diffs).
|
||||
`crates/vfmt`, `crates/vfmt_server`, `crates/vfmt_core`, `crates/vlog_linter`
|
||||
`crates/lucisv`, `crates/lucisv_server`, `crates/lucisv_core`, `crates/vlog_linter`
|
||||
and `crates/vlog_semantic` show no pending changes at all.
|
||||
|
||||
**Honesty note — what I did to the tree, and why the dist/ hashes above are
|
||||
"as of the start of QA", not "as of right now".** After validating the
|
||||
original `dist/` (all results above are against that original build), I
|
||||
attempted a compile as instructed. `cargo build --release -p vfmt -p
|
||||
vfmt_server` happened to succeed on the first try (18s, clean). Following the
|
||||
attempted a compile as instructed. `cargo build --release -p lucisv -p
|
||||
lucisv_server` happened to succeed on the first try (18s, clean). Following the
|
||||
brief's instruction to attempt `tools/release.sh` end-to-end once, I ran it:
|
||||
it failed with a real error, `crates/vlog_parser/src/parser.rs:3109`,
|
||||
`at_postfix_segment` called with 0 args against a 1-arg signature — a
|
||||
@@ -355,7 +355,7 @@ once" and a failure isn't informative about the actual release path, I ran it
|
||||
a second time a few minutes later; by then the concurrent round had apparently
|
||||
moved past that error, and it succeeded end-to-end, **which overwrote `dist/`
|
||||
with a fresh build**. I re-validated that new output for self-consistency
|
||||
(`shasum -c` 3/3 OK against its own new `SHA256SUMS`, `--version` → `vfmt
|
||||
(`shasum -c` 3/3 OK against its own new `SHA256SUMS`, `--version` → `lucisv
|
||||
0.2.0`, vsix still 321 files / no smoke.js / `LICENSE.txt` present) — the
|
||||
script still produces a correct, internally consistent release even against a
|
||||
tree that moved under it. But the specific hashes quoted in the Work log
|
||||
@@ -371,7 +371,7 @@ gates, per the brief.
|
||||
|
||||
## Review
|
||||
|
||||
**2026-08-19 — lead. Verdict: accepted and committed. vfmt 0.2.0 is a
|
||||
**2026-08-19 — lead. Verdict: accepted and committed. lucisv 0.2.0 is a
|
||||
buildable, checksummed, sideloadable release — publishing stays fully
|
||||
optional per the owner, and nothing was published anywhere.**
|
||||
|
||||
@@ -381,7 +381,7 @@ Points reviewed and accepted:
|
||||
arrived before any marketplace polish was written, the README edit
|
||||
that did ship is correctness-only (the stale `--skip-license` and
|
||||
versioned-vsix references), and QA corroborated the placeholder
|
||||
publisher live (`replace-me.vfmt@0.2.0` on a real
|
||||
publisher live (`replace-me.lucisv@0.2.0` on a real
|
||||
install/uninstall cycle).
|
||||
2. **The LICENSE closing the vsce handshake** (packaging now runs
|
||||
without `--skip-license`) resolves the last open item from
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Goal
|
||||
|
||||
Make "vfmt can never corrupt code" a *runtime* guarantee instead of a
|
||||
Make "lucisv can never corrupt code" a *runtime* guarantee instead of a
|
||||
test-suite property. Every call to `format_source()` re-lexes its own
|
||||
output and compares the token stream (comments included) against the
|
||||
input, then formats the output a second time and checks for a fixed
|
||||
@@ -48,7 +48,7 @@ This is TODO.md §1's first three items, and mirrors what Verible does in
|
||||
## Consequence: known formatter bugs now refuse to produce output
|
||||
|
||||
The safety net does not fix formatting bugs, it *stops* them. Three
|
||||
already-known bugs (all marked `#SKIP` in `tests/cases/`) now make vfmt
|
||||
already-known bugs (all marked `#SKIP` in `tests/cases/`) now make lucisv
|
||||
report an error and leave the file untouched instead of writing bad
|
||||
output:
|
||||
|
||||
@@ -67,7 +67,7 @@ output:
|
||||
token stream and are caught the same way if they cross a token.
|
||||
|
||||
This is the intended contract (hard invariant 1: no partial output), but
|
||||
it is a visible behavior change: files that vfmt used to rewrite badly
|
||||
it is a visible behavior change: files that lucisv used to rewrite badly
|
||||
are now refused with exit code 2.
|
||||
|
||||
## Handshakes
|
||||
@@ -93,7 +93,7 @@ are now refused with exit code 2.
|
||||
comment before re-indenting it. Recording the original column — or the
|
||||
byte span TODO.md §6 wants anyway — would let the comment-formatting
|
||||
bug above be fixed properly.
|
||||
- **`crates/vfmt/src/main.rs`** needed no structural change: it already
|
||||
- **`crates/lucisv/src/main.rs`** needed no structural change: it already
|
||||
treats a `format_source` error as "report, skip the file, exit 2".
|
||||
Two cosmetic edits only — a space after the filename in the error
|
||||
line, and the summary now says "failed to format" instead of "failed
|
||||
@@ -203,11 +203,11 @@ gap fixed directly.
|
||||
**PASS**. Read `format_source` (`crates/vlog_formatter/src/format.rs:62-68`):
|
||||
unconditionally calls `verify_equivalence` then `verify_convergence`
|
||||
after every `format_once`; both are `?`-propagated, no bypass path, no
|
||||
config flag to skip it. `crates/vfmt/src/main.rs:165-187`: `fs::write`
|
||||
config flag to skip it. `crates/lucisv/src/main.rs:165-187`: `fs::write`
|
||||
is only reached after a successful `format_source`, so any
|
||||
`FormatError` (source or verification) leaves the file alone; error
|
||||
path increments `errors` and hits `ExitCode::from(2)` at line 210.
|
||||
Confirmed live with the real CLI (`target/debug/vfmt`, built from this
|
||||
Confirmed live with the real CLI (`target/debug/lucisv`, built from this
|
||||
tree) — see the two bug repros below, both exit 2 with byte-identical
|
||||
files (`cmp` confirms).
|
||||
|
||||
@@ -271,12 +271,12 @@ files (`cmp` confirms).
|
||||
**Claim 3 (catches the two pre-existing bugs)** — **PASS**, confirmed
|
||||
end-to-end with the real CLI, not just unit tests:
|
||||
- `end : label` drop: `module m; initial begin : blk x = 1; end : blk
|
||||
endmodule` → `vfmt` prints `verification failed: token stream
|
||||
endmodule` → `lucisv` prints `verification failed: token stream
|
||||
diverges at index 12: input has symbol ':' at 4:7, output has keyword
|
||||
'endmodule' at 5:1`, exit code 2, `cmp` confirms the file is
|
||||
byte-identical to the original afterward.
|
||||
- Block comment reindent non-convergence: a 3-line indented `/* one /
|
||||
two / three */` comment → `vfmt` prints `verification failed:
|
||||
two / three */` comment → `lucisv` prints `verification failed:
|
||||
formatting is not idempotent; line 3 changed from " two" to
|
||||
" two"`, exit code 2, file byte-identical afterward.
|
||||
|
||||
@@ -290,7 +290,7 @@ list — makes the real formatter drop the comment. Root cause:
|
||||
discards whatever leading comments were attached to those tokens (the
|
||||
AST variant carries no comment field), and
|
||||
`crates/vlog_formatter/src/format.rs:1111` always prints `SensList::Star`
|
||||
as the canonical `@(*)`. Reproduced live: `target/debug/vfmt` on a file
|
||||
as the canonical `@(*)`. Reproduced live: `target/debug/lucisv` on a file
|
||||
containing `always @( /* comment inside sensitivity list */ * ) y = a;`
|
||||
exits 2 with `token stream diverges at index 5: input has symbol '(' at
|
||||
2:11, output has symbol '*' at 2:12`, file left untouched. This is not
|
||||
@@ -320,9 +320,9 @@ change, out of this feature's scope).
|
||||
and `cargo test -p vlog_formatter --test verification` after the
|
||||
change: still 0 diffs, still 19/19 passing.
|
||||
- No new dependencies: confirmed by reading all three `Cargo.toml`
|
||||
files (`vlog_parser`, `vlog_formatter`, `vfmt`) — `vlog_parser` has
|
||||
files (`vlog_parser`, `vlog_formatter`, `lucisv`) — `vlog_parser` has
|
||||
zero dependencies, `vlog_formatter` depends only on `vlog_parser` via
|
||||
a path dependency, `vfmt` depends only on both via path. Matches the
|
||||
a path dependency, `lucisv` depends only on both via path. Matches the
|
||||
"no new deps" implicit claim.
|
||||
- README sections: all six required sections present (Goal,
|
||||
Assumptions, Handshakes, Status/TODO, Work log, QA log); Assumptions
|
||||
@@ -334,7 +334,7 @@ change, out of this feature's scope).
|
||||
than being swallowed as an attribute).
|
||||
|
||||
**Performance** — sane, not pathological. `tests/fixtures/` is 4 files,
|
||||
215 lines total. 200 sequential `target/release/vfmt --check` process
|
||||
215 lines total. 200 sequential `target/release/lucisv --check` process
|
||||
invocations over all 4 files completed in 0.71s wall time (~3.5ms per
|
||||
invocation, including process startup, parsing+printing+re-lexing the
|
||||
input twice and re-parsing+printing once more per file). No fixture
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
## Goal
|
||||
|
||||
The first three lint rules vfmt writes against the *symbol table* rather than
|
||||
The first three lint rules lucisv writes against the *symbol table* rather than
|
||||
the syntax tree (TODO.md §8, M12): `unused-signal`, `undriven-net` and
|
||||
`multiply-driven`. TODO.md §7's non-goal — "no semantic claims in v1 lint
|
||||
rules; semantic rules only after `vlog_semantic` exists" — is crossed here,
|
||||
which is the whole point: these are the rules Verible structurally cannot
|
||||
write, because each one needs to know which declaration a name refers to. The
|
||||
round also wires the analysis into `LintContext` so `vfmt check` and the
|
||||
round also wires the analysis into `LintContext` so `lucisv check` and the
|
||||
language server both reach it through the existing one-parse path, and pays
|
||||
for it only when a semantic rule actually runs.
|
||||
|
||||
@@ -33,14 +33,14 @@ listed as a decision rather than left implicit.
|
||||
`clocking` block's signals, and the implicit `.name` connection form.
|
||||
- **A name a macro, a compiler directive, an attribute, a verbatim block
|
||||
(`constraint`/`covergroup`/concurrent assertion) or an unparsed region
|
||||
mentions is dropped from every judgement.** vfmt does not expand macros and
|
||||
mentions is dropped from every judgement.** lucisv does not expand macros and
|
||||
does not evaluate directives, so what those regions do to a signal is
|
||||
unknowable. This is measured, not theoretical: it is what keeps
|
||||
`` `ASSERT_KNOWN(FooKnown_A, foo) `` from making `foo` look unused.
|
||||
- **A module that hides code is not judged at all.** Two ways to hide it: an
|
||||
instance connected with `.*` (which reads and drives same-named signals
|
||||
without writing any of their names down) and an `` `include`` written
|
||||
*inside* the module body (arbitrary code vfmt does not follow — this is
|
||||
*inside* the module body (arbitrary code lucisv does not follow — this is
|
||||
exactly how `prim_rom.sv` loads its memory array). A file-level
|
||||
`` `include`` does not blind anything: it brings in macro definitions, and
|
||||
any macro *use* is already guarded above.
|
||||
@@ -60,9 +60,9 @@ listed as a decision rather than left implicit.
|
||||
- **The intentionally-unused convention is Verilator's, not Verible's.**
|
||||
Verible has no unused-signal rule to be compatible with, so there is no
|
||||
Verible spelling to match. Verilator's `--unused-regexp` defaults to
|
||||
`*unused*`; vfmt exempts a name containing `unused` (case-insensitive) or
|
||||
`*unused*`; lucisv exempts a name containing `unused` (case-insensitive) or
|
||||
starting with `_`. It is not configurable this round — that waits on the
|
||||
`lint` key in `vfmt.toml`, like every other rule setting.
|
||||
`lint` key in `lucisv.toml`, like every other rule setting.
|
||||
- **`analyze` is exact enough to lint on.** The `vlog-semantic` corpus test
|
||||
asserts every one of its 95 193 name spans slices back to the name it
|
||||
claims; these rules trust `references_of` for "is this used" and the
|
||||
@@ -103,7 +103,7 @@ listed as a decision rather than left implicit.
|
||||
`with_semantics(&Semantics)` (lends a caller's). `from_parse`'s signature
|
||||
is **unchanged**, so no existing caller had to move.
|
||||
- The analysis is lazy: a `LintContext` on which no semantic rule ever runs
|
||||
never calls `analyze`. Measured — a default `vfmt check` over the corpus is
|
||||
never calls `analyze`. Measured — a default `lucisv check` over the corpus is
|
||||
byte-identical and time-identical to the one before this round.
|
||||
- The signal table is built once per context and shared by all three rules,
|
||||
so enabling three costs what enabling one costs. Also measured.
|
||||
@@ -118,7 +118,7 @@ listed as a decision rather than left implicit.
|
||||
than attempted: it changes a rule from single-file to project-wide, which
|
||||
is a design decision, not a patch.
|
||||
- *config-discovery's owner*: the intentionally-unused convention wants to be
|
||||
a `vfmt.toml` setting (`[lint.unused-signal] ignore = "..."`), for the same
|
||||
a `lucisv.toml` setting (`[lint.unused-signal] ignore = "..."`), for the same
|
||||
reason the naming styles do. Restated, unchanged.
|
||||
|
||||
## The three rules
|
||||
@@ -185,12 +185,12 @@ driver that is:
|
||||
It also steps aside when a conditional-compilation directive
|
||||
(`` `ifdef``/`` `else``/`` `endif``) is written between the first and last
|
||||
driver — the preprocessor's spelling of the same exclusivity `generate` has.
|
||||
vfmt parses both arms of an `` `ifdef`` as ordinary items, so without this
|
||||
lucisv parses both arms of an `` `ifdef`` as ordinary items, so without this
|
||||
guard the `` `ifdef FAST / `else `` pattern would report every time.
|
||||
|
||||
## The corpus measurement, and the on/off ruling
|
||||
|
||||
Release build, `vfmt check corpus --select <rule> --output-format json`, over
|
||||
Release build, `lucisv check corpus --select <rule> --output-format json`, over
|
||||
the 860 `.v`/`.sv`/`.svh` files in `corpus/` (Ibex, OpenTitan, PULP
|
||||
common_cells, picorv32), 2026-08-25:
|
||||
|
||||
@@ -263,10 +263,10 @@ Same corpus, best of five runs, this machine:
|
||||
|
||||
| run | 1 thread | 10 cores |
|
||||
|---|---:|---:|
|
||||
| `vfmt check` before this round | 0.21 s | 0.07 s |
|
||||
| `vfmt check` after (semantic rules off) | 0.22 s | 0.07 s |
|
||||
| `vfmt check --select <defaults>,unused-signal` | 0.26 s | 0.07 s |
|
||||
| `vfmt check --select <defaults>` + all three | 0.26 s | 0.07 s |
|
||||
| `lucisv check` before this round | 0.21 s | 0.07 s |
|
||||
| `lucisv check` after (semantic rules off) | 0.22 s | 0.07 s |
|
||||
| `lucisv check --select <defaults>,unused-signal` | 0.26 s | 0.07 s |
|
||||
| `lucisv check --select <defaults>` + all three | 0.26 s | 0.07 s |
|
||||
|
||||
Reading it: the default run is unchanged — proven byte-for-byte, not
|
||||
inferred, by diffing the whole-corpus JSON and stderr of this build against a
|
||||
@@ -286,14 +286,14 @@ disappears into the worker pool.
|
||||
whole-word mention scan, the `.*` / `` `include`` blindness rule.
|
||||
- [x] `unused-signal`, `undriven-net`, `multiply-driven` — registered,
|
||||
documented, diagnose-only, off by default.
|
||||
- [x] Server wiring: `vfmt_server` lends the document's own `Semantics`, so
|
||||
- [x] Server wiring: `lucisv_server` lends the document's own `Semantics`, so
|
||||
a keystroke never analyzes twice.
|
||||
- [x] `force`/`release`/`deassign` classified as their own driver kinds, out
|
||||
of `multiply-driven` entirely and half-out of `undriven-net` (QA
|
||||
finding, fixed 2026-08-25).
|
||||
- [x] 69 new unit tests: 23 in `signals.rs` (the classification), 43 across
|
||||
the three rule modules, 2 in `context.rs` (lazy vs lent analysis), 1 in
|
||||
`vfmt_server::lint` (the server reads the document's own table).
|
||||
`lucisv_server::lint` (the server reads the document's own table).
|
||||
- [x] 52 `.lint` cases across three new case files — 16 + 20 + 16 —
|
||||
covering violating / clean / waived / unused-waiver and every guard.
|
||||
- [x] Corpus measurement, per-finding judgement, and the on/off ruling above.
|
||||
@@ -309,7 +309,7 @@ disappears into the worker pool.
|
||||
unknown. Deliberately not done — it is a second resolution mechanism
|
||||
and wants the workspace index behind it anyway.
|
||||
- [ ] Per-rule configuration of the intentionally-unused convention — needs
|
||||
the `vfmt.toml` `lint` key.
|
||||
the `lucisv.toml` `lint` key.
|
||||
|
||||
## Work log
|
||||
|
||||
@@ -332,7 +332,7 @@ disappears into the worker pool.
|
||||
one 658-line module (`signals.rs`, plus 275 lines of its own tests) and
|
||||
`vlog_semantic` is untouched.
|
||||
- **Lazy analysis — decision.** Making `from_parse` take a `Semantics`
|
||||
would have forced every caller to build one, i.e. made `vfmt check` pay for
|
||||
would have forced every caller to build one, i.e. made `lucisv check` pay for
|
||||
an analysis nobody reads on a default run. Instead `LintContext` holds a
|
||||
`OnceCell<Semantics>` filled on first use, plus `with_semantics` for the
|
||||
server, which analyzes every buffer anyway. `from_parse`'s signature never
|
||||
@@ -362,7 +362,7 @@ disappears into the worker pool.
|
||||
clocking case is a `judgeable` test and not a `connected` one); an
|
||||
expression statement that is not `x++` is a call whose arguments may be
|
||||
`output` arguments.
|
||||
- **The `` `ifdef`` guard for `multiply-driven`** exists because vfmt parses
|
||||
- **The `` `ifdef`` guard for `multiply-driven`** exists because lucisv parses
|
||||
both arms of a conditional as ordinary items — the same property that makes
|
||||
`unused-signal` see through an `` `ifdef``. Two `always_comb` blocks in
|
||||
opposite arms would otherwise report every time. Implemented as "is a
|
||||
@@ -370,14 +370,14 @@ disappears into the worker pool.
|
||||
narrow: a directive elsewhere in the file excuses nothing.
|
||||
- **Part-selects: silence.** The task named this as the judgement call.
|
||||
`a[0]` in one block and `a[1]` in another *is* illegal in `always_comb`, but
|
||||
it is also the everyday shape of legacy `always` code, and vfmt does not
|
||||
it is also the everyday shape of legacy `always` code, and lucisv does not
|
||||
resolve bit ranges. Any partial driver takes the signal out of the rule.
|
||||
- **On/off**: measured, judged per finding, ruled off for all three, with the
|
||||
reasoning and the dissent for `multiply-driven` written above rather than
|
||||
buried.
|
||||
- **Scope**: `crates/vlog_linter/{Cargo.toml,src/context.rs,src/lib.rs,
|
||||
src/signals.rs,src/rule_docs.rs,src/registry.rs,src/rules/**,tests/cases/**}`,
|
||||
`crates/vfmt_server/src/lint.rs` (the two-line lend + one test, which the
|
||||
`crates/lucisv_server/src/lint.rs` (the two-line lend + one test, which the
|
||||
task authorized), this README, `docs/features/linter-core/README.md`'s rule
|
||||
table, and the top-level `README.md`'s Linting section (the three rules and
|
||||
their off-by-default footnote — changed because that section called the
|
||||
@@ -391,7 +391,7 @@ disappears into the worker pool.
|
||||
`git worktree`: 1474 — the delta is exactly this pass's 61 new tests);
|
||||
`cargo test -p vlog_linter` 182 unit (was 122) + 14 case-harness + 1 doc. CLI smoke:
|
||||
all three rules fire on a crafted module, the `_ignored` name is exempt, a
|
||||
`// vfmt: waive unused-signal` suppresses its finding, the default run on
|
||||
`// lucisv: waive unused-signal` suppresses its finding, the default run on
|
||||
the same file is clean, and JSON carries `"fix":null`.
|
||||
|
||||
### 2026-08-25 — dev (QA follow-up: the `force`/`release` ruling)
|
||||
@@ -450,7 +450,7 @@ QA's should-fix, and the lead's ruling on it, implemented in full.
|
||||
three JSON outputs are byte-identical to the pre-fix run — the corpus's two
|
||||
`force`/`release` files write through hierarchical paths these rules do not
|
||||
track, which is exactly why the corpus never showed the bug. Default
|
||||
`vfmt check` over the corpus is still byte-identical (stdout **and**
|
||||
`lucisv check` over the corpus is still byte-identical (stdout **and**
|
||||
stderr) to a `git worktree` build of `HEAD` a96c908.
|
||||
- **README**: the `undriven-net` driver list now names `force` and states
|
||||
that `release`/`deassign` are not drives; `multiply-driven`'s exclusion
|
||||
@@ -480,7 +480,7 @@ flags as "closest to default-on."
|
||||
--workspace` silent (forced rebuild by touching `lib.rs` first, per the
|
||||
house discipline). `cargo test --workspace`: **1535 passed**, 0 failed,
|
||||
summed from every `test result:` line — matches the claim exactly.
|
||||
`node editors/vscode/smoke.js target/debug/vfmt-server`: `OK`. No `unsafe`;
|
||||
`node editors/vscode/smoke.js target/debug/lucisv-server`: `OK`. No `unsafe`;
|
||||
the only `.unwrap()`/`.expect()`/`panic!` in the five touched files
|
||||
(`signals.rs:675-676`, `context.rs:355`) are inside `#[cfg(test)]` modules.
|
||||
No `#[allow]` anywhere in the new code. `cargo tree -p vlog_linter -e
|
||||
@@ -491,7 +491,7 @@ version stayed `0.4.2` (no bump), `TODO.md` untouched, confirmed by
|
||||
|
||||
**Byte-identical claim — verified myself, not re-trusted.** Built HEAD
|
||||
(`a96c908`) in a `git worktree`, release profile, alongside the working
|
||||
tree's release build. `vfmt check corpus --output-format json` from both
|
||||
tree's release build. `lucisv check corpus --output-format json` from both
|
||||
binaries: stdout **byte-identical**, stderr **byte-identical** (same
|
||||
single lex-error line and the same "found 7932 violations, 1 file could
|
||||
not be checked" summary — the corpus grew a naming-rule finding since the
|
||||
@@ -606,7 +606,7 @@ and not told apart from each other. Two consequences, reproduced live:
|
||||
assign q = a;
|
||||
endmodule
|
||||
```
|
||||
`vfmt check --select multiply-driven` on this file: 1 violation,
|
||||
`lucisv check --select multiply-driven` on this file: 1 violation,
|
||||
`` `a` is driven both by a continuous assignment and by a procedural
|
||||
block``. This is exactly the kind of finding CLAUDE.md and this
|
||||
feature's own "not crying wolf" bar exist to prevent — a real,
|
||||
@@ -634,7 +634,7 @@ and not told apart from each other. Two consequences, reproduced live:
|
||||
assign q = a;
|
||||
endmodule
|
||||
```
|
||||
`vfmt check --select undriven-net`: 0 violations, even though `a` is
|
||||
`lucisv check --select undriven-net`: 0 violations, even though `a` is
|
||||
never actually assigned a value anywhere in the file. This is the
|
||||
silent/harmless direction (no false accusation), so it is not a
|
||||
blocking bug, but it is a real behavior gap the doc doesn't own, and it
|
||||
@@ -674,20 +674,20 @@ because the QA brief asked about "procedural continuous assign/deassign"
|
||||
by name and the honest answer is "silently and safely out of scope," not
|
||||
"handled."
|
||||
|
||||
**Waivers.** Spot-ran `// vfmt: waive <rule>` on the declaration/violation
|
||||
**Waivers.** Spot-ran `// lucisv: waive <rule>` on the declaration/violation
|
||||
line for all three rules live (not just the `.lint` harness, which was
|
||||
also re-run: `cargo test -p vlog_linter --test lint_cases` — 14/14 green,
|
||||
including the three new case files' own suites). Every waiver suppressed
|
||||
its rule's finding as expected.
|
||||
|
||||
**Server parity.** `crates/vfmt_server/src/lint.rs`'s `context()` now
|
||||
**Server parity.** `crates/lucisv_server/src/lint.rs`'s `context()` now
|
||||
calls `.with_semantics(&doc.semantics)`, and the round's own test
|
||||
(`a_semantic_rule_reads_the_documents_own_analysis`) proves both that a
|
||||
semantic rule fires correctly through the server's `LintContext` and that
|
||||
`context(doc).semantics()` is pointer-identical to `&doc.semantics` (the
|
||||
lent table, not a second analysis) — read and re-run, passes. **Caveat
|
||||
worth recording**: `vfmt_server::lint::violations`/`diagnostics` call
|
||||
`lint(&context(doc), &default_rules())` only (`crates/vfmt_server/src/
|
||||
worth recording**: `lucisv_server::lint::violations`/`diagnostics` call
|
||||
`lint(&context(doc), &default_rules())` only (`crates/lucisv_server/src/
|
||||
lint.rs:35-36`) — there is no server-side rule-selection surface yet, so
|
||||
none of the three semantic rules can actually be *reached* through the
|
||||
live LSP path today; the parity claim is true at the plumbing level (verified
|
||||
@@ -700,7 +700,7 @@ editor today."
|
||||
**Test-count reconciliation — exact, not approximate.** `grep -c
|
||||
"#\[test\]"`: `signals.rs` 21, `rules/{unused_signal,undriven_net,
|
||||
multiply_driven}.rs` 12+13+12=37, `context.rs` 9 total (2 new — the other
|
||||
7 predate this round), `vfmt_server/src/lint.rs` 11 total (1 new). New
|
||||
7 predate this round), `lucisv_server/src/lint.rs` 11 total (1 new). New
|
||||
total: 21+37+2+1 = **61**, matching the claim exactly. `.lint` case
|
||||
files: 15/15/13 `====` separators → 16/16/14 cases (one more case than
|
||||
separators, per the format) = **46**, matching exactly. This precision
|
||||
@@ -710,7 +710,7 @@ the narrative is trustworthy.
|
||||
**Minor, cosmetic finding.** The Work log's "Scope" bullet
|
||||
(`docs/features/semantic-lints/README.md`, the "2026-08-25 — dev" entry)
|
||||
lists the touched files as `crates/vlog_linter/{...}`,
|
||||
`crates/vfmt_server/src/lint.rs`, "this README, and
|
||||
`crates/lucisv_server/src/lint.rs`, "this README, and
|
||||
`docs/features/linter-core/README.md`'s rule table" — it does not mention
|
||||
the top-level `README.md`, which `git diff HEAD -- README.md` shows *was*
|
||||
changed (a "Linting" section update adding the three new rules and the
|
||||
@@ -833,14 +833,14 @@ No new false positives or false negatives found in this pass.
|
||||
**Test-count and case-count reconciliation, exact again.** `#[test]`
|
||||
counts: `signals.rs` 23 (+2), `unused_signal.rs`/`undriven_net.rs`/
|
||||
`multiply_driven.rs` 12+15+16=43 (+6), `context.rs` 9 (unchanged),
|
||||
`vfmt_server/src/lint.rs` 11 (unchanged) → **8 new unit tests**, matching
|
||||
`lucisv_server/src/lint.rs` 11 (unchanged) → **8 new unit tests**, matching
|
||||
the claim exactly. `.lint` `====` separators: `unused_signal` 15
|
||||
(unchanged, 16 cases), `undriven_net` 19 (+4, 20 cases), `multiply_driven`
|
||||
15 (+2, 16 cases) → **6 new cases**, totalling **52** (16+20+16), matching
|
||||
both the round-2 claim and the arithmetic in `Status/TODO`.
|
||||
|
||||
**Byte-identical claim, re-verified with a fresh worktree build.** Built
|
||||
HEAD (`a96c908`) in a new `git worktree`, release profile. `vfmt check
|
||||
HEAD (`a96c908`) in a new `git worktree`, release profile. `lucisv check
|
||||
corpus --output-format json`: stdout and stderr byte-identical to the
|
||||
working tree's release build (same exit 2, same single lex-error line,
|
||||
same summary line). Also diffed the new `--select <rule>` corpus outputs
|
||||
@@ -884,7 +884,7 @@ extension was the correct call for the right reason: driver semantics is
|
||||
a lint concept, and the binder discards the context it would need by
|
||||
design. QA's force/release find was real — the fix's two independent
|
||||
layers (own DriverKind; override-excludes-entirely) each carry their own
|
||||
only-test-that-goes-red, verified by sabotage twice over. Default `vfmt
|
||||
only-test-that-goes-red, verified by sabotage twice over. Default `lucisv
|
||||
check` output stays byte-identical to HEAD, worktree-diffed by three
|
||||
different people now. Accepted; M12 checked off in the umbrella plan and
|
||||
TODO §8. The path to default-on runs through the workspace-index
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
## Goal
|
||||
|
||||
`vfmt check` has existed since round 11 and the language server has published
|
||||
`lucisv check` has existed since round 11 and the language server has published
|
||||
parse errors since the same round, but the two never met: an editor running
|
||||
`vfmt-server` saw syntax errors and nothing else, while CI running `vfmt check`
|
||||
`lucisv-server` saw syntax errors and nothing else, while CI running `lucisv check`
|
||||
saw seven rules' worth of findings. This round wires `vlog_linter` into
|
||||
`vfmt_server` so the editor shows what CI will say — lint findings as
|
||||
`lucisv_server` so the editor shows what CI will say — lint findings as
|
||||
**warnings** alongside the parse **errors**, in **one** `publishDiagnostics` per
|
||||
change — and adds `textDocument/codeAction`: a quick fix per Safe fix, and a
|
||||
`source.fixAll.vfmt` action for fix-on-save. Nothing about the linter changed;
|
||||
this is protocol-layer wiring, which is all `vfmt_server` is allowed to be.
|
||||
`source.fixAll.lucisv` action for fix-on-save. Nothing about the linter changed;
|
||||
this is protocol-layer wiring, which is all `lucisv_server` is allowed to be.
|
||||
|
||||
## Assumptions
|
||||
|
||||
@@ -28,14 +28,14 @@ this is protocol-layer wiring, which is all `vfmt_server` is allowed to be.
|
||||
- **A lint finding is a `Warning`, a parse error stays an `Error`.** The linter
|
||||
has opinions; the parser reports the file not being Verilog. `code` is the
|
||||
rule's stable kebab-case name — the string the user needs to write a waiver or
|
||||
an `--ignore`, and the string a code action matches on. `source` is `"vfmt"`
|
||||
an `--ignore`, and the string a code action matches on. `source` is `"lucisv"`
|
||||
for both, as before.
|
||||
- **The linter is handed the URI's own path**, so `module-filename` can speak.
|
||||
It is the one default rule that needs a file name; without the path it goes
|
||||
quiet, which would have made the editor disagree with CI on exactly the rule
|
||||
whose whole subject is the file name. An `untitled:` buffer genuinely has no
|
||||
path and genuinely gets no `module-filename` finding — the same behavior as
|
||||
`vfmt check` on stdin without `--stdin-filename`.
|
||||
`lucisv check` on stdin without `--stdin-filename`.
|
||||
- **The document is parsed twice per change, and that is a known cost, not an
|
||||
oversight.** `Document::new` parses for the server, and `LintContext::new`
|
||||
parses again inside the linter. `linter-core`'s own Handshakes file this as
|
||||
@@ -57,7 +57,7 @@ this is protocol-layer wiring, which is all `vfmt_server` is allowed to be.
|
||||
code (`quick_fix` returns `None` for anything not `Applicability::Safe`) and
|
||||
in `apply_fixes(.., include_unsafe = false)` for the fix-all path, not just
|
||||
stated here.
|
||||
- **`source.fixAll.vfmt` is one pass, deliberately.** `vfmt check --fix` loops
|
||||
- **`source.fixAll.lucisv` is one pass, deliberately.** `lucisv check --fix` loops
|
||||
fix → re-lint until nothing changes, because a single pass skips any fix
|
||||
overlapping one already applied (the everyday case is a line ending in a tab,
|
||||
which `no-tabs` and `no-trailing-whitespace` both want to rewrite). The server
|
||||
@@ -72,33 +72,33 @@ this is protocol-layer wiring, which is all `vfmt_server` is allowed to be.
|
||||
interleave two fixes in a way the linter's own skip rule would have refused.
|
||||
It matches what `textDocument/formatting` already sends, so no client is
|
||||
surprised by the shape.
|
||||
- **A quick fix's tab-expansion width comes from `vfmt.toml`.** A code-action
|
||||
- **A quick fix's tab-expansion width comes from `lucisv.toml`.** A code-action
|
||||
request carries no `FormattingOptions`, so unlike formatting there is no
|
||||
client `tabSize` in play: the precedence is `vfmt.toml` > the built-in
|
||||
client `tabSize` in play: the precedence is `lucisv.toml` > the built-in
|
||||
default, via `format::indent_width`. Without this, a project with `indent = 4`
|
||||
would get a quick fix inserting two spaces that format-on-save then rewrites —
|
||||
precisely the CLI/editor divergence `vfmt-core-lift` exists to prevent. The
|
||||
precisely the CLI/editor divergence `lucisv-core-lift` exists to prevent. The
|
||||
diagnostics path does not do this lookup: it never reads a fix, so it would be
|
||||
a config file read per keystroke bought for nothing.
|
||||
- **A broken `vfmt.toml` is silent on the code-action path.** The formatting
|
||||
path already warns once per file change (`vfmt-core-lift`); warning again from
|
||||
- **A broken `lucisv.toml` is silent on the code-action path.** The formatting
|
||||
path already warns once per file change (`lucisv-core-lift`); warning again from
|
||||
a lightbulb an editor requests on every cursor move would train the user to
|
||||
ignore vfmt's messages. The fix falls back to the built-in indent width.
|
||||
ignore lucisv's messages. The fix falls back to the built-in indent width.
|
||||
- **The client's `context.only` filter is honored here rather than left to the
|
||||
client.** The spec permits a server to return everything and let the client
|
||||
filter, but fix-on-save asks for `source.fixAll.vfmt` alone, and computing
|
||||
filter, but fix-on-save asks for `source.fixAll.lucisv` alone, and computing
|
||||
every quick fix for a request that discards them is work nobody reads.
|
||||
Filtering is hierarchical, as the spec says: `source` selects
|
||||
`source.fixAll.vfmt`.
|
||||
`source.fixAll.lucisv`.
|
||||
- **A quick fix is offered when its diagnostic range *touches* the requested
|
||||
range.** A cursor sitting on the first character of a warning is asking about
|
||||
that warning; an empty requested range (a bare cursor) is the normal case.
|
||||
- **Waivers, fences and rule selection are the linter's business, not this
|
||||
crate's.** A `// vfmt: waive no-tabs` suppresses the diagnostic and therefore
|
||||
crate's.** A `// lucisv: waive no-tabs` suppresses the diagnostic and therefore
|
||||
the lightbulb, because the finding never reaches this crate. **Note the one
|
||||
asymmetry with the CLI:** `vfmt check --fix` additionally refuses to fix
|
||||
asymmetry with the CLI:** `lucisv check --fix` additionally refuses to fix
|
||||
inside a `// verilog_format: off` fence, and that refusal lives in
|
||||
`crates/vfmt/src/lint.rs`, not in `vlog_linter` — so it is **not** inherited
|
||||
`crates/lucisv/src/lint.rs`, not in `vlog_linter` — so it is **not** inherited
|
||||
here. See Status/TODO; it is the one honest gap this round leaves.
|
||||
~~not inherited here~~ **Inherited as of shared-fence-filter (round 14): the
|
||||
filter moved to `vlog_formatter::fence` and this crate calls it.**
|
||||
@@ -125,12 +125,12 @@ waivers), `run` **never panics and never writes**, and findings come back
|
||||
**sorted by `(span.start, span.end, rule)`** — all three are promises in
|
||||
`docs/features/linter-core/README.md`'s Handshakes.
|
||||
|
||||
**Consumed from `vfmt_core`** — nothing new: `format::indent_width` reuses the
|
||||
**Consumed from `lucisv_core`** — nothing new: `format::indent_width` reuses the
|
||||
existing private `discover`, which is `Discovery::for_file`.
|
||||
|
||||
**Promised to nobody.** `vfmt_server` is still a leaf binary with no library
|
||||
**Promised to nobody.** `lucisv_server` is still a leaf binary with no library
|
||||
target. `editors/**` was not touched: a client needs no change to receive lint
|
||||
diagnostics, and `editor.codeActionsOnSave` naming `source.fixAll.vfmt` is a
|
||||
diagnostics, and `editor.codeActionsOnSave` naming `source.fixAll.lucisv` is a
|
||||
user setting, not an extension one.
|
||||
|
||||
**Requested of others — not done here:**
|
||||
@@ -142,14 +142,14 @@ user setting, not an extension one.
|
||||
file that changes.
|
||||
**Delivered by one-parse (round 19) — `lint.rs` was indeed the one file
|
||||
(plus `Document` gaining its `tree` field).**
|
||||
2. *linter-core / config-discovery*: **a `lint` key in `vfmt.toml`.** The server
|
||||
2. *linter-core / config-discovery*: **a `lint` key in `lucisv.toml`.** The server
|
||||
runs `default_rules()` and nothing else, because there is no configured rule
|
||||
set to read — `--select`/`--ignore` are CLI-only. When `lint = [...]` lands,
|
||||
`lint.rs` should resolve it through the same `Discovery` the formatter uses,
|
||||
with the same anchored-at-the-document rule.
|
||||
3. *lead*: **the fence gap.** `vfmt check --fix` will not rewrite bytes inside a
|
||||
3. *lead*: **the fence gap.** `lucisv check --fix` will not rewrite bytes inside a
|
||||
`// verilog_format: off` region, but that filter lives in
|
||||
`crates/vfmt/src/lint.rs` (it needs `vlog_formatter::fence`, which the linter
|
||||
`crates/lucisv/src/lint.rs` (it needs `vlog_formatter::fence`, which the linter
|
||||
crate deliberately does not depend on). This round did not duplicate it — a
|
||||
third copy of "what is fenced" is exactly how the three answers drift — so a
|
||||
quick fix in this server *can* edit inside a fence. Reported honestly rather
|
||||
@@ -161,7 +161,7 @@ user setting, not an extension one.
|
||||
is now the one answer both front ends call, and `lint::fixable` withholds
|
||||
any fix that would edit a fenced byte — reported, never auto-fixed, exactly
|
||||
as the CLI.**
|
||||
4. *lead*: **`TODO.md:353` is now stale.** §6's `vfmt_server` entry still lists
|
||||
4. *lead*: **`TODO.md:353` is now stale.** §6's `lucisv_server` entry still lists
|
||||
"lint diagnostics (waits on `vlog_linter`)" under **Not shipped**. TODO.md is
|
||||
outside this round's stated scope, so it was left alone rather than edited;
|
||||
the checkbox itself is already `[x]` and needs no flip.
|
||||
@@ -171,7 +171,7 @@ user setting, not an extension one.
|
||||
| LSP request | Engine it consumes | Notes |
|
||||
|---|---|---|
|
||||
| `textDocument/publishDiagnostics` | `vlog_parser::parse_source_tolerant` **+ `vlog_linter::run`** | One publish per change carrying both: parse errors as `Error`, lint findings as `Warning` with `code` = rule name |
|
||||
| `textDocument/codeAction` | `vlog_linter` fixes | `quickfix` per Safe fix (`isPreferred`, `diagnostics` populated); one `source.fixAll.vfmt` whole-document edit |
|
||||
| `textDocument/codeAction` | `vlog_linter` fixes | `quickfix` per Safe fix (`isPreferred`, `diagnostics` populated); one `source.fixAll.lucisv` whole-document edit |
|
||||
|
||||
The `initialize` diff is exactly one field:
|
||||
|
||||
@@ -179,7 +179,7 @@ The `initialize` diff is exactly one field:
|
||||
code_action_provider: Some(CodeActionProviderCapability::Options(CodeActionOptions {
|
||||
code_action_kinds: Some(vec![
|
||||
CodeActionKind::QUICKFIX,
|
||||
CodeActionKind::new("source.fixAll.vfmt"),
|
||||
CodeActionKind::new("source.fixAll.lucisv"),
|
||||
]),
|
||||
work_done_progress_options: WorkDoneProgressOptions::default(),
|
||||
resolve_provider: None,
|
||||
@@ -197,7 +197,7 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `vlog_linter` added to `crates/vfmt_server/Cargo.toml` (path dependency;
|
||||
- [x] `vlog_linter` added to `crates/lucisv_server/Cargo.toml` (path dependency;
|
||||
the crate was already a workspace member, so the root `Cargo.toml` needed
|
||||
**no** edit).
|
||||
- [x] `src/lint.rs`: violations for the diagnostics path, violations-with-fixes
|
||||
@@ -206,7 +206,7 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file
|
||||
- [x] `server.rs`: `publish()` sends that one list; every path that published
|
||||
before (`didOpen`, `didChange`, `didSave`, and the post-save republish of
|
||||
every open buffer) now publishes both sources, unchanged otherwise.
|
||||
- [x] `src/code_action.rs`: quick fixes, `source.fixAll.vfmt`, `context.only`
|
||||
- [x] `src/code_action.rs`: quick fixes, `source.fixAll.lucisv`, `context.only`
|
||||
filtering, range-overlap matching.
|
||||
- [x] `format::indent_width` — the config-governed tab width a fix writes.
|
||||
- [x] `textDocument/codeAction` wired into the request dispatcher.
|
||||
@@ -218,14 +218,14 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file
|
||||
- [x] e2e through the real binary: one publish carrying two rule codes, the
|
||||
capability's kinds on the wire, quick fixes + fixAll, and a filtered
|
||||
fix-on-save request.
|
||||
- [x] `docs/features/vfmt-server/README.md` deferred list annotated.
|
||||
- [ ] **Not done, deliberately:** rule selection. No `vfmt.toml` `lint` key
|
||||
- [x] `docs/features/lucisv-server/README.md` deferred list annotated.
|
||||
- [ ] **Not done, deliberately:** rule selection. No `lucisv.toml` `lint` key
|
||||
exists (Handshake 2); the server runs `default_rules()`.
|
||||
- [ ] **Not done, deliberately:** offering Unsafe fixes. No rule ships one, and
|
||||
when one does it wants a decision (a separate `source.fixAll` kind? a
|
||||
client setting?), not a silent inclusion.
|
||||
- [x] ~~**Not done:** fence-aware fixes (Handshake 3) — a quick fix can edit
|
||||
inside a `// verilog_format: off` region, where `vfmt check --fix` would
|
||||
inside a `// verilog_format: off` region, where `lucisv check --fix` would
|
||||
not.~~ Delivered by **shared-fence-filter** (round 14).
|
||||
- [ ] **Not done:** `codeAction/resolve`. Every action is cheap to build in
|
||||
full; lazy resolution is a payload optimization for actions that are not.
|
||||
@@ -236,9 +236,9 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file
|
||||
|
||||
### 2026-08-19 — dev agent
|
||||
|
||||
- Read `CLAUDE.md`, `docs/features/vfmt-server/README.md`,
|
||||
- Read `CLAUDE.md`, `docs/features/lucisv-server/README.md`,
|
||||
`docs/features/linter-core/README.md` and
|
||||
`docs/features/vfmt-core-lift/README.md` in full (QA logs and Reviews
|
||||
`docs/features/lucisv-core-lift/README.md` in full (QA logs and Reviews
|
||||
included) before writing anything, plus `vlog_linter`'s public surface
|
||||
(`lib.rs`, `violation.rs`, `context.rs`, `registry.rs`). No engine crate
|
||||
needed a change, again: every entry point this round wanted was already
|
||||
@@ -254,10 +254,10 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file
|
||||
- **Two lint entry points, for one honest reason.** `lint::violations` (the
|
||||
diagnostics path) calls `vlog_linter::run` and never looks at a fix, so it
|
||||
does no config work per keystroke. `lint::fixable` (the code-action path)
|
||||
builds a `LintContext` with the tab width of the governing `vfmt.toml`, since
|
||||
builds a `LintContext` with the tab width of the governing `lucisv.toml`, since
|
||||
a fix that writes two spaces into an `indent = 4` project is a fix
|
||||
format-on-save immediately overwrites. The split costs three lines and buys
|
||||
the CLI/editor parity `vfmt-core-lift` was about.
|
||||
the CLI/editor parity `lucisv-core-lift` was about.
|
||||
- **`fixAll` is one pass and says so in a doc comment at the function**, with
|
||||
the reasoning (the client's own edit/re-lint cycle *is* the convergence loop).
|
||||
The tab-and-trailing-whitespace case — the everyday two-round example from
|
||||
@@ -269,7 +269,7 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file
|
||||
`lint::diagnostic` the publisher uses, so the diagnostic in the action is
|
||||
equal to the one on screen rather than a lookalike reconstructed by hand.
|
||||
- **`context.only` is honored** with hierarchical prefix matching, because
|
||||
fix-on-save requests `source.fixAll.vfmt` alone and would otherwise be handed
|
||||
fix-on-save requests `source.fixAll.lucisv` alone and would otherwise be handed
|
||||
every quick fix in the file to throw away.
|
||||
- **Two clippy warnings fixed by restructuring, not by `#[allow]`**: both were
|
||||
`clippy::mutable_key_type` on a `let`-bound `&HashMap<Uri, Vec<TextEdit>>` in
|
||||
@@ -280,7 +280,7 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file
|
||||
- No `unwrap`/`expect`/`panic!`/`unsafe` outside `#[cfg(test)]` in any file
|
||||
added or touched.
|
||||
- Did not touch `vlog_linter`, `vlog_parser`, `vlog_formatter`, `vlog_semantic`,
|
||||
`vfmt`, `vfmt_core` or `editors/**`. Root `Cargo.toml` needed no edit —
|
||||
`lucisv`, `lucisv_core` or `editors/**`. Root `Cargo.toml` needed no edit —
|
||||
`vlog_linter` is already a workspace member, so the dependency is one path
|
||||
line in this crate's own manifest (`Cargo.lock` gained the corresponding
|
||||
one-line edge). `TODO.md` left alone per the round's stated scope, with the
|
||||
@@ -288,10 +288,10 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file
|
||||
|
||||
**Results.**
|
||||
|
||||
- `cargo test -p vfmt_server`: **108 passed, 0 failed** (104 unit + 4 e2e),
|
||||
- `cargo test -p lucisv_server`: **108 passed, 0 failed** (104 unit + 4 e2e),
|
||||
up from 85 (82 + 3). New: 7 in `lint.rs`, 10 in `code_action.rs`, 2 in
|
||||
`diagnostics.rs`, 2 in `format.rs`, 2 in `main.rs`, 1 e2e.
|
||||
- `cargo clippy -p vfmt_server --all-targets`: **0 warnings from this crate**.
|
||||
- `cargo clippy -p lucisv_server --all-targets`: **0 warnings from this crate**.
|
||||
One warning reaches the output from a dependency — `vlog_formatter`'s
|
||||
`with_comma is never used` — which belongs to the concurrent round live in
|
||||
`vlog_parser`/`vlog_formatter`, not to anything here.
|
||||
@@ -301,20 +301,20 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file
|
||||
- **Concurrency note.** Mid-round the other agent landed new `ast::Module` /
|
||||
`ast::AnsiPort` fields, and for ~20 minutes nothing in the workspace compiled,
|
||||
this crate included. Nothing was touched in response; the gates were re-run
|
||||
once `vlog_parser` built again and are the numbers above. `-p vfmt_server`'s
|
||||
once `vlog_parser` built again and are the numbers above. `-p lucisv_server`'s
|
||||
own 104 + 4 is the count that belongs to this feature and did not move across
|
||||
the break.
|
||||
- Files added: `crates/vfmt_server/src/{lint,code_action}.rs`, this README.
|
||||
Files edited: `crates/vfmt_server/Cargo.toml` (one line),
|
||||
`crates/vfmt_server/src/{main,server,diagnostics,format}.rs`,
|
||||
`crates/vfmt_server/tests/e2e.rs`, one annotation line in
|
||||
`docs/features/vfmt-server/README.md`.
|
||||
- Files added: `crates/lucisv_server/src/{lint,code_action}.rs`, this README.
|
||||
Files edited: `crates/lucisv_server/Cargo.toml` (one line),
|
||||
`crates/lucisv_server/src/{main,server,diagnostics,format}.rs`,
|
||||
`crates/lucisv_server/tests/e2e.rs`, one annotation line in
|
||||
`docs/features/lucisv-server/README.md`.
|
||||
|
||||
## QA log
|
||||
|
||||
### 2026-08-19 — QA agent
|
||||
|
||||
Scoped to `-p vfmt_server` per the concurrency note (a second agent was live
|
||||
Scoped to `-p lucisv_server` per the concurrency note (a second agent was live
|
||||
in `vlog_parser`/`vlog_formatter` for the directives-in-lists round; the tree
|
||||
briefly failed to build mid-session and recovered on its own — retested after
|
||||
and the numbers below are post-recovery). No files touched outside this QA
|
||||
@@ -322,18 +322,18 @@ log entry.
|
||||
|
||||
**Gates.**
|
||||
|
||||
- `cargo test -p vfmt_server`: **104 unit + 4 e2e, 0 failed** — matches the
|
||||
- `cargo test -p lucisv_server`: **104 unit + 4 e2e, 0 failed** — matches the
|
||||
claimed count exactly.
|
||||
- `cargo clippy -p vfmt_server --all-targets`: **0 warnings from this crate.**
|
||||
- `cargo clippy -p lucisv_server --all-targets`: **0 warnings from this crate.**
|
||||
- `cargo fmt --all -- --check`: clean.
|
||||
- `grep -rn "#\[allow" crates/vfmt_server/src/{lint,code_action,diagnostics,format,main,server}.rs crates/vfmt_server/tests/e2e.rs`
|
||||
- `grep -rn "#\[allow" crates/lucisv_server/src/{lint,code_action,diagnostics,format,main,server}.rs crates/lucisv_server/tests/e2e.rs`
|
||||
finds exactly one hit, `main.rs:112` (`#[allow(deprecated)]` on
|
||||
`root_uri`) — confirmed via `git diff crates/vfmt_server/src/main.rs` to
|
||||
`root_uri`) — confirmed via `git diff crates/lucisv_server/src/main.rs` to
|
||||
predate this round (it sits outside every hunk this diff touches). **No
|
||||
new `#[allow]` was added.**
|
||||
|
||||
**Claim 1 — single-publish merge: PASS.**
|
||||
`grep -rn "send_diagnostics\|PublishDiagnostics" crates/vfmt_server/src/`
|
||||
`grep -rn "send_diagnostics\|PublishDiagnostics" crates/lucisv_server/src/`
|
||||
shows exactly one call site that ever sends a non-empty diagnostics list —
|
||||
`server.rs:259`, `self.send_diagnostics(uri.clone(), diagnostics::all(doc))`
|
||||
inside `publish()` — plus the `didClose` clear-with-`Vec::new()` at line 236,
|
||||
@@ -346,7 +346,7 @@ client, framed JSON-RPC over stdio, script kept at
|
||||
error) produced **exactly one** `publishDiagnostics`, carrying one `Error`
|
||||
(unnamed `wire`) and one `Warning` `code: "no-tabs"`. `didChange` fixing the
|
||||
parse error but keeping the tab: still one publish, error gone, `no-tabs`
|
||||
warning persists. `didChange` adding `// vfmt: waive no-tabs`: still one
|
||||
warning persists. `didChange` adding `// lucisv: waive no-tabs`: still one
|
||||
publish, diagnostics array empty. All three steps matched the claim exactly.
|
||||
|
||||
**Claim 2 — codeAction: PASS**, verified against the real binary
|
||||
@@ -355,12 +355,12 @@ publish, diagnostics array empty. All three steps matched the claim exactly.
|
||||
(`isPreferred: true`, `diagnostics` = one entry, built from the same
|
||||
`lint::diagnostic` the publisher uses — confirmed both by source
|
||||
(`code_action.rs:63`) and by the wire payload being byte-identical to the
|
||||
publish's own diagnostic) and one `source.fixAll.vfmt`. The quickfix's
|
||||
publish's own diagnostic) and one `source.fixAll.lucisv`. The quickfix's
|
||||
edit, applied by hand from UTF-16 positions, was byte-identical to
|
||||
`vfmt check --fix`'s output on the same file.
|
||||
`lucisv check --fix`'s output on the same file.
|
||||
- `fixAll` carried no `diagnostics` key (absent from the JSON entirely, i.e.
|
||||
`None`, matching the one-pass argument in the README) and its one
|
||||
whole-document edit also matched `vfmt check --fix`.
|
||||
whole-document edit also matched `lucisv check --fix`.
|
||||
- Convergence: a line with both a leading tab and a trailing tab
|
||||
(`no-tabs` + `no-trailing-whitespace` both wanting those bytes) took
|
||||
**3 rounds** to reach a clean buffer via repeated `fixAll` → `didChange` →
|
||||
@@ -370,11 +370,11 @@ publish, diagnostics array empty. All three steps matched the claim exactly.
|
||||
- `context.only=["source"]` returned only the `fixAll` action (1 action);
|
||||
`context.only=["quickfix"]` returned only the quickfix (1 action) — both
|
||||
confirmed live, not just via the existing unit test.
|
||||
- Tab width from `vfmt.toml`: a scratch tree with `indent = 4` produced a
|
||||
- Tab width from `lucisv.toml`: a scratch tree with `indent = 4` produced a
|
||||
quickfix expanding the tab to 4 spaces; a tree with no config produced 2
|
||||
spaces (the built-in default) — both driven through the real binary
|
||||
(`test6_config_and_filename.py`).
|
||||
- Diagnostics path skips config reads: `grep -rn "indent_width" crates/vfmt_server/src/*.rs`
|
||||
- Diagnostics path skips config reads: `grep -rn "indent_width" crates/lucisv_server/src/*.rs`
|
||||
shows `format::indent_width` called from exactly one site,
|
||||
`server.rs:131`, inside the `CodeActionRequest` handler. Neither
|
||||
`lint::violations` nor `lint::diagnostics` (the path every `didOpen`/
|
||||
@@ -388,7 +388,7 @@ publish, diagnostics array empty. All three steps matched the claim exactly.
|
||||
|
||||
**Claim 3 — capabilities: PASS.** `main.rs`'s `capabilities()` diff is
|
||||
exactly the one field the README documents (`code_action_provider: Options`
|
||||
with `[QUICKFIX, "source.fixAll.vfmt"]`, `resolve_provider: None`); nothing
|
||||
with `[QUICKFIX, "source.fixAll.lucisv"]`, `resolve_provider: None`); nothing
|
||||
else in `capabilities()` changed per `git diff`. `caps.code_action_provider`
|
||||
is `Options`, not `Simple(true)` — asserted by
|
||||
`the_two_code_action_kinds_are_named_in_the_capability` and by the e2e test
|
||||
@@ -402,13 +402,13 @@ in spirit — only gained one new assertion for `code_action_provider`).
|
||||
**Claim 5 — handshakes: PASS**, and the fence gap was reproduced live rather
|
||||
than taken on faith. `test4_fence_gap.py`: a file with
|
||||
`// verilog_format: off` / a tabbed line / `// verilog_format: on` —
|
||||
`vfmt check --fix` left the tab untouched (confirmed: output still contains
|
||||
`lucisv check --fix` left the tab untouched (confirmed: output still contains
|
||||
the literal tab byte); the server's `fixAll` action **did** rewrite it to
|
||||
spaces (confirmed: applied output has the tab replaced). This is exactly
|
||||
what Handshake 3 claims, stated as a known gap rather than silently — the
|
||||
handshake text is accurate, not aspirational. The other three handshakes
|
||||
(second-parse-per-keystroke in `lint.rs`'s own doc comments, no `lint` key
|
||||
in `vfmt.toml` yet, `TODO.md:353` being stale) were spot-checked against the
|
||||
in `lucisv.toml` yet, `TODO.md:353` being stale) were spot-checked against the
|
||||
actual files and are accurate: `TODO.md`'s "Not shipped, deliberately: ...
|
||||
lint diagnostics (waits on `vlog_linter`)" line is indeed still present and
|
||||
now stale, and its checkbox is already `[x]`, exactly as claimed.
|
||||
@@ -416,7 +416,7 @@ now stale, and its checkbox is already `[x]`, exactly as claimed.
|
||||
**UTF-16 under fixes: PASS.** `test5_utf16.py`: a violation on a line after
|
||||
`🎉🎉 café` (multi-byte, multi-UTF-16-unit content) — the server's `fixAll`
|
||||
edit, applied from its UTF-16 positions, produced output **byte-identical**
|
||||
to `vfmt check --fix` on the same file, and the emoji/accented content was
|
||||
to `lucisv check --fix` on the same file, and the emoji/accented content was
|
||||
untouched.
|
||||
|
||||
**module-filename via URI: PASS.** A `file://` URI whose module name
|
||||
@@ -428,14 +428,14 @@ hang on a subsequent `codeAction` request against the same untitled buffer
|
||||
|
||||
**Documentation.** README has all seven CLAUDE.md-required sections, all
|
||||
populated except Review (correctly reserved for the lead). The two
|
||||
`docs/features/vfmt-server/README.md` annotation locations (the "Deferred"
|
||||
`docs/features/lucisv-server/README.md` annotation locations (the "Deferred"
|
||||
paragraph's `lint diagnostics (waits on \`vlog_linter\`)` clause, and the
|
||||
Status/TODO `lint diagnostics` checklist item) are each a single
|
||||
struck-through-and-replaced item, word-wrapped across several physical lines
|
||||
in the file's existing 80-column convention — consistent with "one
|
||||
annotation" per location, not a rewrite of surrounding content. Minor,
|
||||
non-blocking nit: the dev's own work-log sentence says "one annotation line
|
||||
in `docs/features/vfmt-server/README.md`" (singular), but two separate
|
||||
in `docs/features/lucisv-server/README.md`" (singular), but two separate
|
||||
locations in that file were actually touched (the Deferred-paragraph clause
|
||||
and the Status/TODO item) — the substance of both edits is correct and
|
||||
scoped, this is purely a miscount in the work-log's own wording.
|
||||
@@ -467,19 +467,19 @@ Points reviewed and accepted:
|
||||
`diagnostics` list on the action because a pass that skips
|
||||
overlapping fixes can't honestly name what it resolved. Declining
|
||||
to claim what you can't prove is the house style.
|
||||
3. **Quick fixes byte-identical to `vfmt check --fix`** — the two
|
||||
3. **Quick fixes byte-identical to `lucisv check --fix`** — the two
|
||||
front ends provably agree, which is the property users will
|
||||
actually rely on.
|
||||
4. **The fence gap filed, not papered over**: a server fix can edit
|
||||
inside `// vfmt: off` because the fence filter lives in
|
||||
`crates/vfmt`, and a third copy of "what is fenced" is how answers
|
||||
inside `// lucisv: off` because the fence filter lives in
|
||||
`crates/lucisv`, and a third copy of "what is fenced" is how answers
|
||||
drift. QA reproduced both sides live. This is the top item for the
|
||||
next round — a shared fence-region helper (likely in
|
||||
`vlog_formatter` next to `fence.rs`, or `vfmt_core`) that the CLI
|
||||
`vlog_formatter` next to `fence.rs`, or `lucisv_core`) that the CLI
|
||||
and the server both call. Until then: no corruption is possible
|
||||
(only Safe fixes exist), but the hands-off promise has a documented
|
||||
editor-side hole.
|
||||
5. The second-parse-per-keystroke cost and the `vfmt.toml` `lint` key
|
||||
5. The second-parse-per-keystroke cost and the `lucisv.toml` `lint` key
|
||||
stay filed where they belong (vlog_linter's one-parse-two-tools
|
||||
TODO and config-discovery's key list respectively).
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
There were two answers to "which bytes does a `// verilog_format: off` fence
|
||||
protect from an automatic edit", and one of them was missing. The formatter
|
||||
had `fence::collect`; `vfmt check --fix` had its own union of that plus a
|
||||
line-scan backstop, written inside `crates/vfmt/src/lint.rs` because the
|
||||
had `fence::collect`; `lucisv check --fix` had its own union of that plus a
|
||||
line-scan backstop, written inside `crates/lucisv/src/lint.rs` because the
|
||||
linter crate deliberately does not depend on `vlog_formatter`; and
|
||||
`vfmt_server`'s quick fixes had **none**, so a lightbulb in an editor happily
|
||||
rewrote bytes `vfmt check --fix` refused to touch (server-lint Handshake 3,
|
||||
`lucisv_server`'s quick fixes had **none**, so a lightbulb in an editor happily
|
||||
rewrote bytes `lucisv check --fix` refused to touch (server-lint Handshake 3,
|
||||
reproduced live by that round's QA). This round moves the CLI's computation
|
||||
down into `vlog_formatter::fence` as `protected_regions` + `is_protected` and
|
||||
has both front ends call it, so the fence answer is defined once. The CLI's
|
||||
@@ -32,12 +32,12 @@ behavior is unchanged byte for byte; the server gains the CLI's
|
||||
example of that width — the formatter's `collect` does not yet fire inside
|
||||
class bodies, the classes round's filed gap, but the scan backstop does, so
|
||||
a fence inside a class body protects `--fix` and server quick fixes even
|
||||
though `vfmt format` ignores it there.)
|
||||
though `lucisv format` ignores it there.)
|
||||
- **`protected_regions` takes `&str` and parses internally, on purpose.** The
|
||||
alternative — accepting a caller's `SourceFile` — would let the two front
|
||||
ends feed different trees and get different answers, which is the drift this
|
||||
feature exists to end. The cost is one tolerant parse per call, paid only on
|
||||
paths that are about to *apply* a fix: `vfmt check --fix` (already
|
||||
paths that are about to *apply* a fix: `lucisv check --fix` (already
|
||||
re-parsing per round) and `textDocument/codeAction`. The server's
|
||||
per-keystroke diagnostics path pays nothing, because it never reads a fix.
|
||||
- **The regions this function returns are for `is_protected` only.** Unlike
|
||||
@@ -68,12 +68,12 @@ question. `fence_of`, `collect`, `region_at`, `Fence` and `Region` are
|
||||
unchanged, and the formatter's own use of `collect` is untouched — this is
|
||||
additive.
|
||||
|
||||
**Consumed by `crates/vfmt/src/lint.rs`**: `fixable_outside_fences` now calls
|
||||
**Consumed by `crates/lucisv/src/lint.rs`**: `fixable_outside_fences` now calls
|
||||
`protected_regions`, and `touches_fence` is a one-line map over
|
||||
`is_protected`. The file's own `scanned_fence_regions` was **moved**, not
|
||||
copied — it no longer exists there.
|
||||
|
||||
**Consumed by `crates/vfmt_server/src/lint.rs`**: `fixable` — the code-action
|
||||
**Consumed by `crates/lucisv_server/src/lint.rs`**: `fixable` — the code-action
|
||||
path, and only that path — drops any violation whose fix would edit a
|
||||
protected byte. `violations`/`diagnostics` (the publishing path) are
|
||||
deliberately untouched, which is what keeps a fenced finding reported.
|
||||
@@ -94,22 +94,22 @@ dependency for no gain: the two lines that remain are "which violations does
|
||||
|
||||
- [x] `fence::protected_regions` + `fence::is_protected` in
|
||||
`crates/vlog_formatter/src/fence.rs`, with the scan (`scanned_regions`)
|
||||
moved down from `crates/vfmt/src/lint.rs`.
|
||||
moved down from `crates/lucisv/src/lint.rs`.
|
||||
- [x] Unit tests in `fence.rs`: the boundary matrix (first/last byte inside,
|
||||
adjacent-outside both ends, straddling either edge, insertions, empty
|
||||
region list), a good-tree region, the broken-file backstop (asserting
|
||||
the premise — `collect` really does return nothing there), an unclosed
|
||||
fence running to EOF, and ordinary comments protecting nothing.
|
||||
- [x] `crates/vfmt/src/lint.rs` rewired; the boundary test matrix and every
|
||||
- [x] `crates/lucisv/src/lint.rs` rewired; the boundary test matrix and every
|
||||
CLI test pass unmodified.
|
||||
- [x] `crates/vfmt_server/src/lint.rs`: `fixable` filters through the shared
|
||||
- [x] `crates/lucisv_server/src/lint.rs`: `fixable` filters through the shared
|
||||
answer; `fix_touches_fence` is the all-or-nothing rule.
|
||||
- [x] Server tests: a fenced violation is reported but not fixable, a fence
|
||||
holds in a file that does not parse, an unfenced file is unaffected;
|
||||
no `quickfix` action on a fenced line while the neighbouring free line
|
||||
still has one; `fixAll` leaves fenced bytes byte-identical.
|
||||
- [x] e2e through both real binaries: the server's `fixAll` edit is
|
||||
byte-identical to what `vfmt check --fix` writes for the same content,
|
||||
byte-identical to what `lucisv check --fix` writes for the same content,
|
||||
with the CLI still exiting 1 for the finding it declined to fix.
|
||||
- [x] `docs/features/server-lint/README.md` Handshake 3 annotated as
|
||||
delivered.
|
||||
@@ -137,7 +137,7 @@ dependency for no gain: the two lines that remain are "which violations does
|
||||
and `Region` was already the vocabulary). What is *not* shared is which
|
||||
violations a tool offers, because that is genuinely each tool's own
|
||||
question; what is shared is every byte of "what is fenced".
|
||||
- The scan was **moved verbatim** from `crates/vfmt/src/lint.rs` into
|
||||
- The scan was **moved verbatim** from `crates/lucisv/src/lint.rs` into
|
||||
`fence.rs` as `scanned_regions` (private; `protected_regions` is the only
|
||||
way in), with `fence::fence_of` calls becoming bare `fence_of`. Same
|
||||
pairing, same EOF rule, same `Region` construction. The CLI's
|
||||
@@ -151,7 +151,7 @@ dependency for no gain: the two lines that remain are "which violations does
|
||||
**unmodified**, as do all 48 CLI integration tests including
|
||||
`check_reports_inside_a_fence_but_never_fixes_there` and
|
||||
`a_fence_holds_even_in_a_file_that_does_not_parse`.
|
||||
- Three unit tests in `crates/vfmt/src/lint.rs` did have to change, because
|
||||
- Three unit tests in `crates/lucisv/src/lint.rs` did have to change, because
|
||||
they called the private `scanned_fence_regions` that no longer lives there.
|
||||
They were rewritten to assert the same three behaviors (broken-file
|
||||
backstop, unclosed fence to EOF, ordinary comments) through
|
||||
@@ -164,21 +164,21 @@ dependency for no gain: the two lines that remain are "which violations does
|
||||
fixes and `fixAll` at once and cannot be forgotten by a future third action
|
||||
kind. `violations` was left alone, on purpose and with a doc comment saying
|
||||
why: the finding must still be published.
|
||||
- The e2e test finds the `vfmt` binary by path next to `CARGO_BIN_EXE_vfmt-server`
|
||||
- The e2e test finds the `lucisv` binary by path next to `CARGO_BIN_EXE_lucisv-server`
|
||||
(Cargo names no env var for another package's binary) and **skips with a
|
||||
printed note** if it is absent, which can only happen under
|
||||
`cargo test -p vfmt_server` in a tree where `vfmt` was never built. Under
|
||||
`cargo test -p lucisv_server` in a tree where `lucisv` was never built. Under
|
||||
the `--workspace` gate it always runs. A test that fails for a reason that
|
||||
is not about the code under test is worse than one that says it skipped.
|
||||
- Did not touch `verify.rs`, `format.rs`, any `.cases` file, `vlog_parser`,
|
||||
`vlog_linter`, `vlog_semantic`, `vfmt_core` or `editors/**`. No new
|
||||
`vlog_linter`, `vlog_semantic`, `lucisv_core` or `editors/**`. No new
|
||||
dependency, no `Cargo.toml` edit, no `#[allow]`, no `unwrap`/`expect`/
|
||||
`panic!`/`unsafe` outside `#[cfg(test)]`. Did not run `git commit`/`git push`.
|
||||
- **Concurrency note.** Another agent was live in `crates/vlog_parser` (the
|
||||
directives-in-instances round) for part of this session; the workspace did
|
||||
not compile for a stretch, exactly as the previous round recorded. Nothing
|
||||
was touched in response; the gates below were run once `vlog_parser` built
|
||||
again. `cargo fmt` was scoped to `-p vlog_formatter -p vfmt -p vfmt_server`
|
||||
again. `cargo fmt` was scoped to `-p vlog_formatter -p lucisv -p lucisv_server`
|
||||
rather than `--all` for the same reason. That round's `format.rs` had landed
|
||||
in the tree by then; `git diff` on it shows four hunks, every one of them
|
||||
their own semantic edit and none a whitespace-only reflow, so the
|
||||
@@ -188,21 +188,21 @@ dependency for no gain: the two lines that remain are "which violations does
|
||||
|
||||
- `cargo test --workspace`: **574 passed, 0 failed**, up from **563** at the
|
||||
session's start commit `6e6aacb`. The +11 are all this round's: 5 in
|
||||
`vlog_formatter`'s `fence.rs`, 3 in `vfmt_server`'s `lint.rs`, 2 in its
|
||||
`code_action.rs`, 1 e2e. `crates/vfmt` is net 0 — three scan tests became
|
||||
`vlog_formatter`'s `fence.rs`, 3 in `lucisv_server`'s `lint.rs`, 2 in its
|
||||
`code_action.rs`, 1 e2e. `crates/lucisv` is net 0 — three scan tests became
|
||||
three filter tests.
|
||||
- `cargo clippy --workspace --all-targets`: **silent** (re-run after touching
|
||||
every file this round changed, to rule out a cached result).
|
||||
- `cargo fmt -p vlog_formatter -p vfmt -p vfmt_server -- --check`: clean.
|
||||
- `cargo fmt -p vlog_formatter -p lucisv -p lucisv_server -- --check`: clean.
|
||||
`--all` was deliberately **not** used: `crates/vlog_parser` belongs to the
|
||||
concurrent round and is not this round's to reformat.
|
||||
|
||||
**Byte-identity of the CLI, measured rather than argued.** Two `git worktree`
|
||||
builds — `old` at `6e6aacb`, `new` at `6e6aacb` + this round's diff to
|
||||
`fence.rs` and `crates/vfmt/src/lint.rs` and nothing else, so the concurrent
|
||||
`fence.rs` and `crates/lucisv/src/lint.rs` and nothing else, so the concurrent
|
||||
round's uncommitted parser work perturbs neither:
|
||||
|
||||
- `vfmt check corpus/ --output-format json`: **byte-identical** (2 407 345
|
||||
- `lucisv check corpus/ --output-format json`: **byte-identical** (2 407 345
|
||||
bytes of JSON), stderr byte-identical, both exit 1.
|
||||
- 22 crafted fence shapes (simple, unclosed, broken-parse-before-the-fence,
|
||||
long spelling, `off-by-one`, block comment, indented fence, trailing fence,
|
||||
@@ -234,26 +234,26 @@ their round, not this one.
|
||||
### 2026-08-19 — QA
|
||||
|
||||
Read `CLAUDE.md`, this feature's README (dev's Work log included), and the
|
||||
diff to `fence.rs`, `crates/vfmt/src/lint.rs`, `crates/vfmt_server/src/lint.rs`,
|
||||
diff to `fence.rs`, `crates/lucisv/src/lint.rs`, `crates/lucisv_server/src/lint.rs`,
|
||||
`code_action.rs`, `tests/e2e.rs`, and `server-lint`'s annotations, before
|
||||
touching anything. Scoped to `-p vlog_formatter -p vfmt -p vfmt_server`
|
||||
touching anything. Scoped to `-p vlog_formatter -p lucisv -p lucisv_server`
|
||||
throughout, per the concurrency note (`vlog_parser`/`format.rs`/`.cases` were
|
||||
live under another agent for part of this session).
|
||||
|
||||
**Gates.** `cargo test -p vlog_formatter -p vfmt -p vfmt_server`: all 11 test
|
||||
binaries green (vfmt-server unittests 109, `cli.rs` 48, `e2e.rs` 5,
|
||||
**Gates.** `cargo test -p vlog_formatter -p lucisv -p lucisv_server`: all 11 test
|
||||
binaries green (lucisv-server unittests 109, `cli.rs` 48, `e2e.rs` 5,
|
||||
`vlog_formatter` unittests 13, its `verification.rs` 63, `fences.rs` 6, etc.)
|
||||
— **0 failures**. `crates/vfmt/tests/cli.rs` has an **empty `git diff`**,
|
||||
— **0 failures**. `crates/lucisv/tests/cli.rs` has an **empty `git diff`**,
|
||||
i.e. the 48 CLI tests are not merely passing, they are byte-for-byte
|
||||
unmodified, confirming the README's claim directly rather than by count.
|
||||
`cargo clippy -p vlog_formatter -p vfmt -p vfmt_server --all-targets`:
|
||||
silent. `cargo fmt -p vlog_formatter -p vfmt -p vfmt_server -- --check`: clean
|
||||
`cargo clippy -p vlog_formatter -p lucisv -p lucisv_server --all-targets`:
|
||||
silent. `cargo fmt -p vlog_formatter -p lucisv -p lucisv_server -- --check`: clean
|
||||
at the time of this check. Note: mid-session it briefly reported diffs, all
|
||||
three confined to `crates/vlog_formatter/tests/verification.rs` lines
|
||||
600-679 — `git diff` on that file attributes those lines to the concurrent
|
||||
directives-in-instances round (new tests added there), not to this diff; the
|
||||
five files this feature actually touches (`fence.rs`,
|
||||
`vfmt/src/lint.rs`, `vfmt_server/src/lint.rs`, `code_action.rs`, `e2e.rs`)
|
||||
`lucisv/src/lint.rs`, `lucisv_server/src/lint.rs`, `code_action.rs`, `e2e.rs`)
|
||||
were independently checked with `rustfmt --check` and are clean on their own,
|
||||
and the workspace-wide check is clean again as of this writing (the other
|
||||
agent evidently ran its own `cargo fmt` since). No `#[allow]`, `unwrap`/
|
||||
@@ -271,7 +271,7 @@ Confirmed.
|
||||
|
||||
**Claim 2 (CLI byte-identity).** Built two release binaries in isolated
|
||||
`git worktree`s: `old` at `6e6aacb`, `new` at `6e6aacb` plus only this
|
||||
feature's diff to `fence.rs` and `crates/vfmt/src/lint.rs` (copied the two
|
||||
feature's diff to `fence.rs` and `crates/lucisv/src/lint.rs` (copied the two
|
||||
files directly; `git diff --stat` in that worktree confirmed exactly those
|
||||
two files, 171 lines, matching the dev's own isolation). Ran 8 crafted fence
|
||||
shapes (simple, unclosed-to-EOF, broken-parse-before-the-fence/scan-backstop,
|
||||
@@ -281,7 +281,7 @@ file byte-identical** (`cmp` clean on all 8), stdout identical
|
||||
(`found 15 violations, fixed 8 violations` from both), exit 1 from both.
|
||||
This is a smaller sample than the dev's 22-shape run but corroborates it
|
||||
independently rather than repeating it. The 3 rewritten unit tests in
|
||||
`crates/vfmt/src/lint.rs` were read: they now call `fixable_outside_fences`
|
||||
`crates/lucisv/src/lint.rs` were read: they now call `fixable_outside_fences`
|
||||
end-to-end with a `no-tabs`-shaped violation instead of asserting on
|
||||
`scanned_fence_regions`'s return shape directly, but assert the same three
|
||||
behaviors (broken-file backstop, unclosed-to-EOF, ordinary-comment-is-not-
|
||||
@@ -289,7 +289,7 @@ a-fence) — confirmed by reading, and by the sabotage below, which fails two
|
||||
of exactly these three.
|
||||
|
||||
**Claim 3 (server drops fenced fixes, diagnostics untouched).** Drove the
|
||||
real `vfmt-server` debug binary live over hand-framed LSP JSON-RPC (Python,
|
||||
real `lucisv-server` debug binary live over hand-framed LSP JSON-RPC (Python,
|
||||
not the Rust `talk()` helper, so this is independent of the e2e test's own
|
||||
plumbing):
|
||||
- Fenced tab: diagnostic published at both the fenced and unfenced lines;
|
||||
@@ -301,7 +301,7 @@ plumbing):
|
||||
diagnostics still published (including the fenced tab's `no-tabs`), and
|
||||
`codeAction` at the fenced tab still returns `[]` — the scan backstop
|
||||
holds through the server's path too, not just the CLI's.
|
||||
- Fence + waiver: `// vfmt: waive no-tabs` on the line before a fenced,
|
||||
- Fence + waiver: `// lucisv: waive no-tabs` on the line before a fenced,
|
||||
tabbed `wire a;` → **zero diagnostics for that violation** (not
|
||||
"reported but unfixable" — genuinely absent), while the unfenced tab two
|
||||
lines later is still reported. This is correct and is not a fence
|
||||
@@ -334,7 +334,7 @@ lead, not fixed here.
|
||||
`vlog_formatter`/`vlog_parser` as path deps, so as not to touch any crate
|
||||
under test):
|
||||
- `protected_regions("")` → 0 regions.
|
||||
- Fence spelled inside a string literal (`string s = "// vfmt: off";`) → 0
|
||||
- Fence spelled inside a string literal (`string s = "// lucisv: off";`) → 0
|
||||
regions — correct, the line as a whole does not start with `//` after
|
||||
trimming, so `fence_of` never fires on it.
|
||||
- Block-comment spelling (`/* verilog_format: off */`) → 0 regions —
|
||||
@@ -364,8 +364,8 @@ under test):
|
||||
— protected, per the `end.max(start+1)` rule — insertion just past the
|
||||
end — not protected). Both front ends call `fence::is_protected` with
|
||||
identical argument shape (`(range.start as usize, range.end as usize)` in
|
||||
both `vfmt/src/lint.rs::touches_fence` and
|
||||
`vfmt_server/src/lint.rs::fix_touches_fence`), so "both front ends refuse
|
||||
both `lucisv/src/lint.rs::touches_fence` and
|
||||
`lucisv_server/src/lint.rs::fix_touches_fence`), so "both front ends refuse
|
||||
identically" is a structural guarantee, not merely an observed one —
|
||||
there is no live rule today that emits a pure-insertion fix to exercise
|
||||
this end-to-end (`no-tabs` and `no-trailing-whitespace` both replace
|
||||
@@ -374,11 +374,11 @@ under test):
|
||||
|
||||
**Sabotage.** Edited `protected_regions` in the working tree to drop the
|
||||
`regions.extend(scanned_regions(src))` line (tree-only). Result:
|
||||
`crates/vfmt/src/lint.rs` unit tests — 3 failures (`the_line_scan_backstops_
|
||||
`crates/lucisv/src/lint.rs` unit tests — 3 failures (`the_line_scan_backstops_
|
||||
a_file_that_does_not_parse`, `an_unclosed_fence_runs_to_the_end_of_the_file`,
|
||||
`fixes_outside_a_fence_survive_the_filter`); `crates/vfmt`'s own CLI
|
||||
`fixes_outside_a_fence_survive_the_filter`); `crates/lucisv`'s own CLI
|
||||
integration test `a_fence_holds_even_in_a_file_that_does_not_parse` —
|
||||
failed; `vfmt_server`'s `lint::tests::a_fence_holds_even_when_the_file_
|
||||
failed; `lucisv_server`'s `lint::tests::a_fence_holds_even_when_the_file_
|
||||
does_not_parse` — failed; `vlog_formatter`'s own
|
||||
`the_line_scan_backstops_a_file_that_does_not_parse` — failed, as expected.
|
||||
Reverted by hand (restored the two-line body exactly); `git diff` on
|
||||
|
||||
@@ -176,7 +176,7 @@ Decisions, all unit-tested:
|
||||
rust-analyzer. A 4 GiB Verilog file is not a use case; `u32` halves the
|
||||
size cost of putting a span on every node. Nothing enforces this: a larger
|
||||
file would truncate offsets rather than fail, which is worth a guard if
|
||||
vfmt ever grows an entry point that does not read the whole file into a
|
||||
lucisv ever grows an entry point that does not read the whole file into a
|
||||
`String` first (today `usize`→`u32` conversion happens only in the lexer,
|
||||
from offsets into a `&str` the CLI already read whole).
|
||||
- **One file, no virtual sources.** A `TextRange` has no file identity;
|
||||
@@ -305,8 +305,8 @@ check that matters.
|
||||
- Did not touch `verify.rs`, `tools/`, `corpus/`, or the formatter's
|
||||
behavior. Did not run `git commit`/`git push`.
|
||||
- **Concurrency note:** another agent's `config-discovery` work landed in the
|
||||
same working tree during this round (`crates/vfmt/src/config.rs`,
|
||||
`crates/vfmt/tests/cli.rs`, `args.rs`, `main.rs`, `README.md`, TODO.md §3).
|
||||
same working tree during this round (`crates/lucisv/src/config.rs`,
|
||||
`crates/lucisv/tests/cli.rs`, `args.rs`, `main.rs`, `README.md`, TODO.md §3).
|
||||
Mid-round its `a_config_file_is_found_by_searching_upward` was failing at
|
||||
`cli.rs:317` (with `indent = 4` in the config it expected `WIDE_SPLIT`, a
|
||||
constant written with 2-space indent). Confirmed it was theirs and not this
|
||||
@@ -326,7 +326,7 @@ md5 `3fab114f4f00626b254259e9dafe0ed7` — **byte-identical** to the
|
||||
pre-change baseline; 820 files, 466 would-reformat, 2 ok-unchanged, 352
|
||||
parse-error, **0 verification errors, 0 crashes**. All four corpus repos
|
||||
`git status --porcelain` clean apart from the pre-existing untracked
|
||||
`.vfmt-corpus-rev` stamps. Files touched:
|
||||
`.lucisv-corpus-rev` stamps. Files touched:
|
||||
`crates/vlog_parser/src/{span,line_index}.rs` (new),
|
||||
`crates/vlog_parser/src/{lib,token,lexer,ast,parser}.rs`,
|
||||
`crates/vlog_parser/tests/spans.rs` (new),
|
||||
@@ -346,7 +346,7 @@ part of the final diff. No commits made.
|
||||
**Tool results — all green:**
|
||||
- `cargo test --workspace`: **158 passed, 0 failed** at the time of this
|
||||
round (later observed at 160 as the concurrent `config-discovery` agent's
|
||||
work landed two more `vfmt` unit tests in the same tree — unrelated to
|
||||
work landed two more `lucisv` unit tests in the same tree — unrelated to
|
||||
this feature, confirmed by re-diffing; this feature's own crates stayed at
|
||||
47 (`vlog_parser` unit) + 10 (`tests/spans.rs`) throughout).
|
||||
- `cargo clippy --workspace --all-targets`: 0 warnings.
|
||||
@@ -415,13 +415,13 @@ than trusted from the work log.**
|
||||
— byte-identical to the dev's reported baseline. (Built from the current
|
||||
tree, which also includes the now-committed `config-discovery` change;
|
||||
the match confirms neither feature altered corpus-visible output.)
|
||||
- Built a second `vfmt` release binary from a `git worktree` at `HEAD`
|
||||
- Built a second `lucisv` release binary from a `git worktree` at `HEAD`
|
||||
(`481cce2`, i.e. immediately pre-spans, config-discovery already
|
||||
committed) and diffed its `--stdin-filename f - < f` output against the
|
||||
working-tree binary (spans included) over **all 820 `.sv`/`.v` corpus
|
||||
files**, not just 3-4: **0 differences**. Worktree removed after.
|
||||
- Corpus repos' `git status --porcelain`: clean apart from the pre-existing
|
||||
untracked `.vfmt-corpus-rev` stamps, confirmed again.
|
||||
untracked `.lucisv-corpus-rev` stamps, confirmed again.
|
||||
- No `.cases`/fixture/snapshot files under `crates/vlog_formatter/tests/`
|
||||
show as modified in `git status`.
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
## Goal
|
||||
|
||||
Close the `types-decls` bucket of `scripts/score.sh`: the seven declaration
|
||||
shapes that real RTL writes and vfmt could not parse. All of them are about a
|
||||
**type standing somewhere vfmt only accepted a name** — an anonymous
|
||||
shapes that real RTL writes and lucisv could not parse. All of them are about a
|
||||
**type standing somewhere lucisv only accepted a name** — an anonymous
|
||||
`enum`/`struct`/`union` used as a type in place, a typedef'd name carrying
|
||||
packed dimensions, a `type` parameter outside the `#( ... )` list — plus a
|
||||
`for` loop whose init declares more than one variable.
|
||||
@@ -64,7 +64,7 @@ packed dimensions, a `type` parameter outside the `#( ... )` list — plus a
|
||||
- `ast::{EnumType, EnumMember, StructType, StructMember, Declarator,
|
||||
ListDirective}` now derive `Clone`, so `DataType` can keep deriving it.
|
||||
- No new `ItemKind` / `StmtKind` / `ExprKind` variants, so no exhaustive-match
|
||||
arms were needed in `vlog_linter::visit`, `vlog_semantic` or `vfmt_server`.
|
||||
arms were needed in `vlog_linter::visit`, `vlog_semantic` or `lucisv_server`.
|
||||
|
||||
**Requests for other modules (not done here)**
|
||||
|
||||
@@ -174,7 +174,7 @@ size and clippy is clean with no suppressions.
|
||||
**Not fixed, and why.**
|
||||
`corpus/ibex/vendor/google_riscv-dv/src/isa/custom/riscv_custom_instr_enum.sv`
|
||||
is an `include` fragment — a bare `CUSTOM_1,` at top level, meant to be
|
||||
pasted inside an enum body. It is not a translation unit and vfmt should keep
|
||||
pasted inside an enum body. It is not a translation unit and lucisv should keep
|
||||
rejecting it. It is classified `invalid-or-fragment`, not `types-decls`, in
|
||||
both the before and after TSVs, so it was never in this bucket's count.
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ region | generate block | for-generate header | for/foreach statement`.
|
||||
- `token::is_keyword` — to tell a built-in type keyword from a user type name,
|
||||
and to drop keywords the parser left in identifier slots.
|
||||
|
||||
**Promised to consumers** (`vfmt_server`, the workspace index, future lint
|
||||
**Promised to consumers** (`lucisv_server`, the workspace index, future lint
|
||||
rules):
|
||||
|
||||
- `analyze` never panics and never fails, on any input, tolerant tree or not.
|
||||
@@ -380,10 +380,10 @@ Gates:
|
||||
- Root `Cargo.toml` diff: the `members` line gains `vlog_semantic`, as
|
||||
claimed. (The diff also carries an unrelated `[workspace.dependencies]
|
||||
rayon = "=1.12.0"` hunk — that belongs to the concurrently-worked
|
||||
`parallel-files`/`vfmt` feature, out of my scope, noted only so the
|
||||
`parallel-files`/`lucisv` feature, out of my scope, noted only so the
|
||||
"members-line-only" claim for *this* feature isn't misread against the
|
||||
whole file.)
|
||||
- `cargo test --workspace`: **2 failures**, both in `crates/vfmt`
|
||||
- `cargo test --workspace`: **2 failures**, both in `crates/lucisv`
|
||||
(`a_deeply_nested_file_formats_on_a_worker_thread`,
|
||||
`deeply_nested_file_does_not_kill_the_batch`) — outside my gate
|
||||
(`-p vlog_semantic` is green) and inside the area another QA agent owns
|
||||
@@ -526,7 +526,7 @@ What earned it:
|
||||
clean files, 19.6% waiting on the index) is exactly the honest
|
||||
number the workspace-index feature will be measured against.
|
||||
|
||||
The workspace-green gate was transiently false during QA (two vfmt
|
||||
The workspace-green gate was transiently false during QA (two lucisv
|
||||
deep-nesting tests) — timing overlap with the parallel-files QA's
|
||||
deliberate stack-sabotage check, verified restored before the joint
|
||||
commit.
|
||||
@@ -14,7 +14,7 @@ against that index and answers them in an **overlay** keyed by reference id.
|
||||
That is what turns `import prim_pkg::*` and `prim_fifo_sync u_fifo (...)` into
|
||||
a jump into the file that declares them — TODO.md §6's "cross-file resolution
|
||||
through header imports", the last piece `textDocument/definition` needs before
|
||||
`vfmt_server` can be written.
|
||||
`lucisv_server` can be written.
|
||||
|
||||
## API as built
|
||||
|
||||
@@ -183,7 +183,7 @@ caller does know which file it means.
|
||||
the corpus does this.
|
||||
- `build` is O(files) and single-threaded. Measured at 860 files below; a
|
||||
workspace an order of magnitude larger would want the same rayon treatment
|
||||
`vfmt` already applies to formatting, which is a change of caller, not of
|
||||
`lucisv` already applies to formatting, which is a change of caller, not of
|
||||
this API.
|
||||
|
||||
## Non-goals
|
||||
@@ -229,7 +229,7 @@ unchanged by where the span comes from. Nothing here needs revisiting when
|
||||
ever change the spelling of a path, `follow_one` in `workspace.rs` changes
|
||||
with it.
|
||||
|
||||
**Promised to consumers (`vfmt_server`):**
|
||||
**Promised to consumers (`lucisv_server`):**
|
||||
|
||||
- `WorkspaceIndex::build` never panics and never fails, on any input,
|
||||
including files that do not lex.
|
||||
|
||||
Reference in new issue
Block a user