textDocument/willSaveWaitUntil is advertised and served, gated on a new
lucisv.formatOnSave setting that defaults to off (a server that formats
uninvited fights the editor's own format-on-save and doubles up); the
decline is one comparison, before any buffer lookup. When on, the hook
is textDocument/formatting with a different trigger: the same engine,
the same all-or-nothing verified-output contract, settings resolved by
the new format::settings_without_editor_options — the ladder minus the
tabSize rung the protocol simply does not carry here, with the honest
consequence (save-format can differ from manual format without a
lucisv.toml) documented in the README, the VS Code setting description
and the nvim README. Every save reason formats; refusals are shown per
save, on purpose.
18 tests added across settings/format/server/e2e, including QA's
executable proofs of the tab-size gap and its lucisv.toml resolution, a
no-reindex/no-generation-bump guard for the new setting, and an
idempotency round-trip through a real didChange. QA also fixed the
stale 'not advertised' feature list in editors/nvim/README.md and
sharpened the config-warning dedup claim to what the code does (once
per buffer state) — reworded in the README, pinned by test.
docs/features/will-save-wait-until/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
textDocument/didChange now applies ranged content changes instead of
requiring the whole buffer per keystroke. New pure sync::apply_changes
applies each change against the document as the previous ones left it
(fresh line table per change), clamping inherited from convert.rs and a
backwards range read as a pure insertion — the one rule that cannot lose
text. One notification stays one reparse / one generation bump / one
publish. Full-sync clients (rangeless changes) keep byte-identical
behavior; save advertises includeText: false and didSave still honours
text when sent.
35 tests added (28 unit incl. a 400-sequence randomized cross-check
against an independent reference model and QA's surrogate/CRLF/final-
newline attacks, 6 server-level, 1 e2e pinning the wire capability
shape). QA's one finding — CRLF split across two same-position inserts
in one batch lands \n\r — is pre-existing convert.rs behavior, pinned
by test, unreachable by real clients; see the feature README.
docs/features/incremental-sync/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
The three top findings of the LSP 3.18 audit (TODO.md §9), one round of
dev (Opus) + QA (Sonnet) + lead review:
- executeCommand now pushes its WorkspaceEdit as workspace/applyEdit and
reads the client's verdict; the old return-the-edit behavior stays as
the documented fallback for clients without the capability. This fixes
the three port commands doing nothing in stock clients — the returned
edit was dropped by vscode-languageclient and Neovim alike.
docs/features/apply-edit/README.md
- textDocument/diagnostic + workspace/diagnostic (LSP 3.17), served from
the same parse+lint pass the push model publishes, with resultId /
unchanged caching on one generation counter; a pulling client is pushed
nothing, a pushing client is unchanged. QA's exhaustive input trace
found no stale-unchanged path. docs/features/pull-diagnostics/README.md
- textDocument/selectionRange: chains from token spans, the tolerant
parse's item/statement spans and the scope-pair matcher, filtered to
strict nesting; the invariant swept over all 860 corpus files (6,880
positions, held everywhere). docs/features/selection-range/README.md
43 tests added across unit/e2e (server 557 -> 594+ unit, 29 -> 32 e2e);
fmt/clippy/test/smoke all clean, re-verified independently by QA and by
the lead.
Co-Authored-By: Claude Fable 5 <[email protected]>
Compared lucisv_server against the LSP 3.18 spec. §9a is the round-1
scope (applyEdit compliance, pull diagnostics, selectionRange), §9b/9c
the ranked backlog, §9d the documented skips.
Co-Authored-By: Claude Fable 5 <[email protected]>
tools/release.sh --cross builds, next to the host Apple Silicon pair,
x86_64-apple-darwin (runs under Rosetta here, full smoke passed),
x86_64-unknown-linux-musl (static, no glibc dependency) and
x86_64-pc-windows-gnu (.exe depending only on DLLs Windows 10+ ships,
audited). The rustup stable toolchain is addressed by absolute path so
the Homebrew rust on PATH keeps owning day-to-day builds; the musl link
needs DYLD_FALLBACK_LIBRARY_PATH for rust-lld's libLLVM, the Windows
link needs mingw-w64's import libraries - both encoded in the script and
RELEASING.md so nobody rediscovers them. Author metadata: Cargo.toml
authors, package.json publisher guoliangchen + author, LICENSE holder -
all Guoliang Chen.
Co-Authored-By: Claude Fable 5 <[email protected]>
Hovering `NAME(args) now appends an expands-to section: the definition
the card already chose (single_step is blind to lookup, so they cannot
disagree) with parameters substituted by the call's arguments - one
step, so nested macro names stay as written. Strings, `" markers and
escaped identifiers are never substituted into; count mismatches,
unnarrowed multiple candidates and paren-less function-like uses get no
section rather than a guess; an empty argument takes the parameter's
declared default. 2000-char cap with a note. Version 0.5.0 closes the
M7-M14 navigation run with a CHANGELOG entry covering all eight.
Co-Authored-By: Claude Fable 5 <[email protected]>
The -f flag (repeatable) feeds M1's filelist parser to format, check,
--check and --diff: listed paths are exact like positional args (never
excluded or gitignored), warnings go to stderr without touching the
frozen exit-code contract, an unreadable filelist is exit 2 with nothing
written, and inputs from every source dedup by lexical absolute path -
which also closes the old vfmt rtl/ rtl/a.sv double-processing. --lines
and stdin reject -f at parse time. vfmt.toml's filelist key stays
server-only, deliberately. QA's exit-code matrix confirmed all eight
cells; its pre-existing torn-write find is filed in TODO §1.
Co-Authored-By: Claude Fable 5 <[email protected]>
The first rules that use vlog_semantic, crossing TODO §7's threshold the
careful way: a read/write/unknown classification layer in vlog_linter
(vlog_semantic untouched - driver semantics is a lint concept), whole-
word mention guards so ifdef arms and macro bodies never produce a false
unused, connections treated as unknown direction, and force/release with
their own driver kind so a test override is neither a second driver nor
the only one. All three default off, decided from data: 55 corpus hits,
zero wrong on reading, but single-file scanning cannot see cross-file
readers. Default vfmt check output is byte-identical to before,
worktree-diffed. ~45ms per 860 files when enabled; three rules cost one.
Co-Authored-By: Claude Fable 5 <[email protected]>
LSP callHierarchy with modules as the nodes: prepare on a declaration or
any instantiation, incoming grouped by instantiating module with every
site as a fromRange, outgoing one call per distinct instantiated module.
The instantiation walk moved out of inlay hints into a shared module
with the owning module threaded through - inlay's 34 untouched tests
prove the factoring changed nothing. A substring prefilter skips 834 of
860 corpus files before parsing (56ms incoming on a real module;
the prefilter-defeating worst case is documented at ~206ms). ifdef arms
both count, disclosed; incoming/outgoing consistency QA-verified.
Co-Authored-By: Claude Fable 5 <[email protected]>
One line scanner feeds three consumers that can never disagree:
documentLink underlines every include path, definition lands on the
resolved file, and hover's define lookup narrows to definitions
reachable through the hovered file's include graph (narrow, never
widen; local defines always win). Resolution is own-directory then the
filelist's +incdir+s in order - M1 recorded them, M10 finally spends
them; angled includes skip the own-directory rung. Resolved paths are
re-spelled the way the index spells them so a case-insensitive
filesystem cannot make hover silently drop a reachable define (QA HIGH,
fixed with a pure lookup that latches to ambiguity on collisions).
Graph build: ~7ms over the 860-file corpus.
Co-Authored-By: Claude Fable 5 <[email protected]>
workspace/didChangeWatchedFiles via dynamic registration (globs for the
four source extensions plus the configured filelist's own path), one
rebuild per notification with the same warning surfacing as save, and
re-registration when vfmt.filelist moves. Registration happens in
Server::new because lsp-server's initialize_finish consumes the
initialized notification - the protocol-suggested handler would be dead
code (verified against the vendored source). Open-buffer overlays
survive rebuilds; malformed and out-of-scope events rebuild nothing.
git pull, external editors and filelist edits now land without a save.
Co-Authored-By: Claude Fable 5 <[email protected]>
textDocument/inlayHint draws ghost portname:/PARAM: labels on positional
connection lists and all-positional #(...) overrides, from the same plan
extraction M4 uses — walked off the parse tree, so nested-call commas
cannot shift positions. Range filtering runs before any definition is
parsed; plans are cached per request (O(distinct modules)); every
uncertainty is silent, including QA's find: an ifdef-carrying port list
unions its arms in the plan, which is right for an editable skeleton and
wrong for a read-only label, so such plans now hint nothing.
Co-Authored-By: Claude Fable 5 <[email protected]>
textDocument/references now answers across files by reusing rename's
occurrence walk (collect_occurrences factored out of collect_edits,
behavior-identical) — a module, port or package member lists every use
the index scope can see; the cross-file gate asks the workspace index,
never re-derives exportedness, and an ambiguous name degrades to the
in-file answer. foldingRange is the fourth consumer of pairs::analyze
(end line stays visible, unmatched openers fold nothing, block comments
included); documentHighlight lights a symbol's in-file occurrences with
the begin/end pair highlighting preserved. M7-M14 queue added to TODO §8.
Co-Authored-By: Claude Fable 5 <[email protected]>
A template tier between index names and keywords: if / if-else / else-if
(gated on the line head, so it appears after end but not after an
identifier), case and casez with default, loops, always_ff (plain and
reset variants), always_comb, always @(...), initial, and declaration
templates - logic/localparam/parameter in .sv, wire/reg/integer twins in
.v; pathless buffers get the conservative Verilog set. One renderer
spells each body as snippet and plain text so the two cannot drift, and a
registry-wide test parses every untouched expansion. Nine overlapping
static VS Code snippets moved server-side; file-level ones stay static.
Co-Authored-By: Claude Fable 5 <[email protected]>
Five completion tiers in one response: module skeletons (M4, unchanged
gate), scope-visible symbols with real kinds, workspace-index names and
`define macros (backtick-aware, never inventing punctuation), Verilog/SV
keywords (single-source KEYWORDS list factored from the lexer's table,
lexing unchanged), and token-harvested project words — comments and
strings contribute nothing and get no completions. Candidate tables build
with the index over the M1 scope ladder (94 ms / 860 files, ~1.4 MiB);
a keystroke answers in ~300 µs, budget-tested. Version 0.3.0 across the
workspace and extension, CHANGELOG covers the M1-M5 refactoring layer.
Co-Authored-By: Claude Fable 5 <[email protected]>
vlog_refactor instantiate engine: InstantiationPlan read from the
definition (params with parse-probed defaults, ports with direction/type,
auto-connect by the same scope lookup ports.rs uses), one renderer for the
plain and snippet spellings. Server ships textDocument/completion (module
skeletons as snippets, plain-text fallback when the client lacks snippet
support or the plan carries escaped identifiers) and signatureHelp
(named-by-name, ordered-by-comma-count, wildcard-aware). Corpus property
test: all 454 corpus modules' skeletons re-parse.
Co-Authored-By: Claude Fable 5 <[email protected]>
vlog_refactor ports engine: add_port (ANSI + non-ANSI, named/ordered/.*
sites, .p(p) vs TODO placeholder by real scope lookup), remove_port
(refuses positional connections and live body uses, lists dropped
expressions), propagate_ports, all through a new splice verifier (piece
equality, comments never deleted, no new parse diagnostics, resolution
identity) plus a per-feature shape check. A new port can never silently
land inside an `ifdef arm (nesting-aware refusal, both insertion paths);
macro-argument/define-body occurrences of a removed port warn. Server:
code actions + vfmt.addPort/removePort/propagatePorts executeCommands.
Co-Authored-By: Claude Fable 5 <[email protected]>
New crate vlog_refactor: rename any symbol vlog_semantic resolves, in-file
and cross-file, with whole-edit-or-nothing verification (token identity +
before/after resolution print over every file spelling either name).
End labels rename too via a new vlog_semantic Target::Declaration bound at
declaration time. Server ships prepareRename/rename; refusals are LSP
request errors, define-body/macro-argument/hierarchical-tail occurrences
warn instead of guessing. QA round 1 found two silent HIGHs (third-file
collision, macro-argument silence) — both closed with regression tests.
Co-Authored-By: Claude Fable 5 <[email protected]>
Rope-port umbrella plan (docs/features/refactor) + TODO.md §8; M1 ships
vfmt_core::filelist (-f nesting with cycle + 256-depth guard, +incdir+/
+define+ recorded, env vars, warnings not errors), the vfmt.toml filelist
key, the server scope ladder (filelist > workspace walk > open file's
directory when rootless) and the vfmt.filelist VS Code setting.
Co-Authored-By: Claude Fable 5 <[email protected]>
printer::fits() now measures from a multi-line Doc::Inline's last line and
keeps measuring the rest of the group (a with {...} block no longer hides
an overflow). skip_action_stmt tracks begin/end, fork/join, case/endcase
nesting so a concurrent assertion's action block is captured whole.
Comments between bind/target/module and around randomize(...) with are
attached and reprinted instead of being refused by the safety net.
All 800 passing corpus files format byte-identically before and after.
Co-Authored-By: Claude Fable 5 <[email protected]>
A macro invocation that ends its line is a complete item whatever opens
the next line; new <expr> shallow-copy constructor; a based number whose
digits come from a macro (32'h`BOOT_ADDR) lexes as a base-only number
joined with the macro in the parser. verify.rs untouched, attack tests added.
Coverage loop round 2: 796 -> 800 / 820 (97.1% -> 97.6%).
Feature README: docs/features/mop-up-2/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
randomize()/std::randomize() with { ... } (block verbatim), array-method
with (expr), foreach over scoped/hierarchical/indexed arrays, randcase,
wait fork, import as a statement, let declarations, empty call arguments,
general statement labels, and endtask: name; (stray semicolon kept).
Also fixes a pre-existing verification failure for a comment between a
then-branch and its else.
Coverage loop round 1, cluster 8: 772 -> 796 / 820 (94.1% -> 97.1%).
Feature README: docs/features/dv-statements/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
interface...endinterface shares the module header/body machinery (ItemKind::Module with kw == "interface"); modport and clocking are structural items; virtual <iface>[#(...)] is accepted in every type position. module-filename now applies to interfaces.
Coverage loop round 1, cluster 5: 712 -> 740 / 820 (86.8% -> 90.2%).
Feature README: docs/features/interfaces/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
Macro invocations with whitespace before the argument list, a bare macro on its own line followed by a declaration, `error/`warning directives, and $error/$fatal/$warning/$info as module/generate items.
Coverage loop round 1, cluster 1: 636 -> 661 / 820 (77.6% -> 80.6%).
Feature README: docs/features/item-misc/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
The lint-testing backbone TODO §5 asked for. Rule tests are now .lint
case files: house .cases framing plus //^ <col> <rule> markers that
copy vfmt check's own diagnostics (a positioned caret was rejected --
tabs in offending lines are content, and a //-prefixed caret cannot
reach columns 1-2 where no-tabs fires). Matching is exact in both
directions with a readable both-named failure report. Fix cases split
input from expected output and carry the cross-tool guarantee: the
fixed output must be lint-clean AND formatter-convergent (sabotage-
proven to reach all 5 fix cases); the #tolerant escape is empty today
and enforced in both directions like #SKIP.
The harness polices itself: 13 self-policing tests (12 dev + 1 lead)
feed it deliberately wrong cases -- wrong columns both directions,
stale markers (a renamed rule takes its markers along, proven by a
live rename turning 13 cases red), unknown #select, wrong fixed
output with a diff, and (lead fix per QA) a typo'd #word directive is
now a loud case-file error instead of silently becoming a case name.
Migration audited, not claimed: all 55 deleted test functions mapped
individually onto 76 cases (58 old line-rule assertion shapes -> 76
line+col+rule cases), coverage strictly up, all 119 src unit tests
untouched. vlog_formatter enters as a workspace-internal dev-only
dependency (cargo tree -e normal unchanged; QA and lead ruled it a
test-wiring decision, not a dependency decision).
786 workspace tests. Dev: Fable agent; QA: Opus agent; review in
docs/features/lint-harness/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
class-semantics: classes are first-class in vlog_semantic -- class
scopes and symbols, member/method/prototype binding, this.x
(nearest-class-only), super.x, cls::x with lexical unit heads,
out-of-body cls::method bound into the class's scope with the extern
prototype as the definition (rule 10), and the honest
InheritedCandidate{base, paths} shape: a member miss in an extending
class records what the unknown base might supply (import paths
included) and is never chased, not even in-file -- the future
inheritance round's worklist, measured at 1303 candidates. Unit-name
misses stay ExternalCandidate (QA-found, lead-ruled: bases supply
members, not package names; +170 recovered navigations, pinned).
Workspace index gains classes as units (246) and their members
(11399). scan.rs migrated to parser name-spans: 26 call sites down
to the 2 documented consumers. 114044 spans, 0 unplaced, 0 panics;
UVM code now has hover/definition/references/outline.
lexer-cleanup: the three filed gaps -- @(* ) lexes via a
starts_attribute backoff (an attribute cannot begin with `)`; real
attributes pinned, no misfire on legal expressions), a leading BOM
is accepted as a named losslessness exception (mid-file BOM errors
clearly; 20k-case position fuzz clean), and non-ASCII lex errors now
decode the full character AND surface through vfmt check's error
slot (exit 2, matching format, text-rule findings still reported --
the silent-pass hole closed). The macro space-before-paren item is
parked with a QA-hardened analysis: the reading depends on a
definition vfmt cannot see, any fixed answer is provably wrong for
one population, and today's behavior fails safe.
827 workspace tests. Dev: 2 Fable agents; QA: 2 Opus agents; reviews
in docs/features/{class-semantics,lexer-cleanup}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
dynamic-types: queues ($ as an expression primary -- one grammar
addition and [$], [$:N], q[$-1] all fall out of existing machinery),
dynamic [] and wildcard [*] dims (DimKind, the round's one
non-additive AST change: three consumers, all updated), empty {}
literals, named call arguments f(.a(x)) as ExprKind::NamedArg,
case ... inside with range labels, bare @event sensitivities (also
fixing a pre-existing invented-parens refusal), and macro items
before ident-dot statements. Everything structural, nothing
verbatim; verify.rs and fence.rs byte-identical. Corpus 578 ->
636/820 formattable (70.5% -> 77.6%), parse-error 242 -> 184, 58
gained / 0 lost by path, all 636 round-tripped, all 578 previously-
formattable files byte-compared old-vs-new with zero differences.
Two newly-reachable comment drops fixed in-round (one pre-existing,
one this round's own new code -- split documented honestly post-QA).
New top blockers: interface (25), the `else head-swap (13).
one-parse: LintContext::from_parse accepts pre-built parse products
(Backing enum forced by SourceFile: !Clone; new() stays a one-line
wrapper -- all 12 rule files byte-untouched); ParsedSource::parse
lexes once; vfmt check parses once per file; the server lints from
Document's own products, eliminating the per-keystroke second parse.
Behavior identity proven at the byte level (2.4MB corpus JSON, 13
server publishes, corpus-wide --fix); check --threads 1 20% faster,
server didChange latency roughly halved. protected_regions left
alone per its documented anti-drift signature. Lead fixes on
acceptance: the from_parse contract-cost doc sentence, and a stale-
tree guard test in the server (QA's sabotage passed all 773 tests --
nothing pinned text/tree agreement; now one test does, through the
merged diagnostics path where the stale warning actually lives).
791 workspace tests. Dev: 2 Fable agents; QA: 2 Opus agents; reviews
in docs/features/{dynamic-types,one-parse}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
range-formatting: --lines M-N[,M-N...] formats only the top-level
items intersecting the ranges; modules/packages split head/body/tail
with independent decisions, everything else is atomic, and
unselected units are emitted as merged verbatim source slices (the
run-merge is load-bearing: per-item slices let separators collapse
blank lines between untouched items). Convergence via Selection
replay -- same-selection re-runs are fixed points, sound because the
equivalence check has already proven token identity; QA's sabotage
of the replay failed immediately on real RTL. The honest limit
(same line numbers can sweep in a neighbor after lines move;
449/8236 corpus trials, all settled next run) is measured and
pinned. Fence wins over range; alignment groups split at verbatim
boundaries; cache fully bypassed; LSP rangeFormatting advertised and
consumes only lines (no UTF-16 column math); tools/vfmt-changed.sh
derives ranges from git diff. Default behavior provably unchanged
(TSV md5 + all-578-file byte-compare vs a pre-round binary).
lint-rules-2: visit.rs walks class bodies (closing the classes
handshake; +6 real findings in UVM code), five new rules with
evidence-based defaults -- parameter/enum/struct-union-name-style ON
with Verible's exact names and published defaults (vendored waivers
now honored), module-name-style OFF (Verible has no such rule; the
brief's premise was checked and corrected), wire-reg-mixup ON (0
corpus noise in .v, 209 findings on a .sv rename -- both zeroes
proven). rules_markdown() generates the rule reference; 13 rules
total, zero CLI/server wiring needed.
Also: lead notes in classes and shared-fence-filter READMEs
documenting the fence asymmetry lint-rules-2 QA found (a fence in a
class body protects fixes via the scan backstop even though the
formatter ignores it there).
768 workspace tests. Dev: 2 Opus agents; QA: 2 Sonnet agents;
reviews in docs/features/{range-formatting,lint-rules-2}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
alignment: Verible-style alignment-intent inference for ANSI ports
(name column), named connections (paren column) and parameter items
(name and = columns). A group aligns iff the author asked: >=4
excess spaces somewhere, or the group already sits consistently at
one column -- single-space code keeps today's bytes exactly (zero
churn across all 397 pre-existing cases; corpus outcome TSV
byte-identical while 291/578 formattable files change content).
Fixed-point by construction: aligned output re-infers the same
targets, flush re-infers flush; the whole verdict is decided at
document-build time (a printer-side split diverged ibex_core.sv at
width 60 during development -- caught by a 2312-run config sweep and
redesigned). Groups break at comments/attributes/directives/blank
lines; a group that cannot fit falls back to flush whole, never
mixed. No lexer changes: name_span plus the source answers every
spacing question. QA's sabotage confirmed the runtime convergence
check catches the predicted flip-flop even with the unit test gone.
format-cache: warm runs skip verified-clean files. Key = (FNV-1a 64
content hash, resolved config values, vfmt version), path-keyed;
only the fixed-point verdict is ever cached, so --check/--diff can
never go stale and a hit can only skip work, never produce output.
One atomic text file in self-gitignoring .vfmt_cache/; --no-cache /
--cache-dir; 8-process concurrency clean. Warm corpus check: 2x at
default threads, 7.7x single-threaded.
655 workspace tests. Dev: 2 Opus agents (both isolated their gates
from the other's churn via HEAD-reverted scratchpad copies); QA: 2
Sonnet agents; reviews in docs/features/{alignment,format-cache}/
README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
The top corpus blocker (142 extends-blocked UVM/DV files) falls.
Structural support: class/virtual class with parameter ports,
extends (named/ordered params), implements, property qualifiers
(rand/randc/local/protected/static/const), virtual interface
properties, parameterized types, method qualifiers with extern and
pure-virtual prototypes plus out-of-body cls::method definitions,
typedef class, scoped parameterized calls, disable fork. Class
bodies reuse the existing item loop, so Meta, directives, macros and
nesting work with no per-site code. Constraint blocks, covergroups
and parameterized-type #() arguments are span-sliced verbatim leaves
-- their internals are a distinct sub-language where formatting has
no payoff and corruption risk is highest, so 9 masked-corruption
rejection tests ship although verify.rs is byte-identical
(invariant-4 discipline, voluntarily; QA's sabotage recreated the
historical in-string corruption and exactly one pin turned red).
Corpus: 476 -> 578/820 formattable (70.5%), parse-error 344 -> 242,
zero regressions by path, all 578 formattable files round-tripped
individually. 72 of the 142 extends files format; 70 advance to
named next blockers -- queues/dynamic arrays are now the top corpus
blocker (41 files). Two verification failures fixed en route: a
pre-existing lexer blank-line-after-continuation bug (proven
pre-existing on a HEAD worktree) and raw_inline convergence for
mid-line verbatim starts.
Handshakes filed: fences inactive inside class bodies; the four
AST-walking lint rules skip class members (line-based rules still
fire); vlog_semantic treats class bodies as opaque -- the LSP
navigation gap is that crate's natural next round. parse() now takes
the source (verbatim capture in strict mode); single caller updated.
612 workspace tests (397 cases). Dev: Opus agent; QA: Sonnet agent
(pre-feature worktree diff, full 578-file round-trip, UVM torture,
two reverted sabotages); review in docs/features/classes/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
Version bumped to 0.2.0 (workspace-inherited, one line + lockfiles;
both binaries report it). Root MIT LICENSE plus the editors/vscode
copy that lets vsce package run without --skip-license, closing the
editor-packaging handshake. CHANGELOG.md is a user-facing first-
release document: six area paragraphs linking the feature READMEs,
stating the current corpus truth (476/820 formattable, zero
verification errors, zero crashes). tools/release.sh builds
checksummed host binaries + the sideloadable .vsix into gitignored
dist/ (aborts before deleting prior artifacts on failure -- proven
live); tools/RELEASING.md is the checklist, with marketplace/OpenVSX
commands demoted to an explicitly optional appendix per the owner:
publishing is fully deferred, sideloading via code
--install-extension is the supported path, publisher stays
REPLACE-ME.
Dev: Opus agent (mid-flight scope trim handled cleanly); QA: Sonnet
agent (artifacts, real sideload cycle, all 26 changelog links);
review in docs/features/release-prep/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
directives-in-instances: `ifdef/`else/`elsif/`endif/`define/`include
now parse between elements of instantiation #() override lists and
connection lists (param_directives on Instantiation, conn_directives
on Instance -- an all-in-arm list is Connections::Ordered(vec![]),
so the vector cannot live inside it; commas stored on Connection and
OrderedConn, never derived). All six named corpus targets format and
converge; no corpus file is blocked on a compiler directive any more
(backtick parse errors 6 -> 0); corpus 476/820 formattable (58.0%),
clean-file external resolution 94.0%. One bug found en route and
fixed: directive_entry overwrote before_sep, dropping a comment
(net-caught; pinned by directives_in_lists.cases:780, sabotage-
verified).
shared-fence-filter: one definition of "which bytes are fenced" --
protected_regions/is_protected in vlog_formatter::fence (the CLI's
scan MOVED in, not copied; grep finds one owner). The CLI filter is
byte-identical (isolated-diff worktrees, 8 shapes, 48 CLI tests
diff-empty); the server's quickfix and fixAll paths now drop fixes
touching protected bytes -- off means hands-off in the editor too.
Sabotage: removing the scan union fails six tests across three
crates. Lead fix: the good-tree test now genuinely pins the collect
path (QA found it only exercised the scan).
(The stale corpus-check-results.tsv two QAs flagged turned out to be
an untracked ignored working file, not a committed one -- deleted
from disk after this commit; it regenerates on every corpus run.)
589 workspace tests. Dev: 2 Opus agents; QA: 2 Sonnet agents;
reviews in docs/features/{directives-in-instances,
shared-fence-filter}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
Roadmap item 6: conditional-compilation directives are now accepted
between elements of port lists, parameter-port lists and enum member
lists, carried as parallel ListDirective vectors (source order via a
before-index; additive AST so vlog_semantic and vlog_linter compile
unmodified) and emitted verbatim. Commas are STORED, never derived:
two real corpus shapes (comma inside the `ifdef arm; no comma at all
in `else alternatives) kill any derivation rule in opposite
directions. A comma printed on a directive's line would be swallowed
into the condition on re-parse -- prevented by a forced break,
sabotage-verified against the safety net.
Corpus: parse-error 352 -> 350 (ibex_core.sv formats), six more
files advance to later blockers -- picorv32.v parses 1986 lines
further but still refuses on restrict property (item 7). The real
payoff is the workspace index: picorv32/_axi/_wb now index
(530 modules, 9174 members), cross-file external resolution
87.0% -> 93.6% on clean files, unresolved externals 2.6% -> 1.3%.
0 verification errors, 0 crashes, verify.rs byte-identical.
563 workspace tests (20 new cases, 9 verification, 7 parser units).
Dev: Opus agent; QA: Sonnet agent (both semantic baselines
reproduced from a detached worktree); review in
docs/features/directives-in-lists/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
Resolves the owner's comment-drop report (comments-round-2). Three
root causes: (1) a comment between a module header's imports and its
#( landed as the first parameter port's leading comment, printed
inside the brackets -- fixed by take_before_open (the opening-bracket
twin of take_before_sep, no-op unless the cursor is on the bracket)
feeding new bracket-comment slots on Module/Instantiation/Instance;
(2) Meta kept attributes and leading comments in two lists and the
formatter emitted list order, swapping (* attr *) with an adjacent
comment -- fixed by merging on span.start, with the fence check
hoisted so fenced items still emit attrs as source bytes only;
(3) found in the sweep survivors: a lone instance's leading comments
were parsed and never printed (latent invariant-#3 violation).
Acceptance: the reported 14 corpus insertion failures -> 0; the
exhaustive 62k-trial per-line sweep fixed 95 positions with 0 newly
refusing; all 240 survivors are in families already parked by
comments-round and refuse on HEAD too. verify.rs byte-identical
(8 new rejection tests, sabotage-verified); corpus TSV md5
unchanged; fences suite untouched and green. 524 workspace tests.
Dev: Opus agent; QA: Sonnet agent (14/14 reproduced, HEAD-diffed
sweep, attack pass on every new slot); review in
docs/features/comments-round-2/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
editor-packaging: a minimal VS Code extension (41-line plain JS on
vscode-languageclient =9.0.1, one setting vfmt.serverPath, languages
verilog/systemverilog) with a zero-dependency smoke.js that validates
the extension's exact spawn contract against the real binary, plus
Neovim/Vim/coc setup docs (including the load-bearing
vim.filetype.add — Vim maps *.v by content heuristic and *.vh not at
all). Everything headless-validatable was validated: the .vsix
builds, smoke passes with negative controls, npm ci reproduces.
vfmt-core-lift: config.rs and walk.rs moved to a new std-only
vfmt_core crate as byte-identical 100% renames (CLI suite untouched,
corpus TSV md5 equal from HEAD and lifted builds). The LSP server
now discovers vfmt.toml per document with precedence config > client
tabSize > built-in default (an editor default is not a deliberate
override), warns once per document change on a broken config while
formatting with defaults, and scans the workspace with the lifted
gitignore-aware walk. QA drove every claim live over stdio.
With these, every TODO §6 item is delivered: spans, tolerant
parsing, define table, single-file semantics, workspace index, the
server, and both editors. Lead trued up the caveats this round made
stale across five documents.
Dev: 2 Opus agents; QA: 2 Sonnet agents; reviews in
docs/features/{editor-packaging,vfmt-core-lift}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
vfmt-server (new crate, binary vfmt-server): LSP over stdio on
rust-analyzer's minimal stack (lsp-server/lsp-types/serde/serde_json,
exact-pinned, 18 packages audited incl. all build scripts). Ships
formatting (byte-identical to the CLI), tolerant-parse diagnostics
with UTF-16-correct positions (CRLF collapse pinned; EOF spans
widened to drawable lines), semanticTokens/full, hover with `define
expansion (file table -> workspace fallback), definition through
both resolution layers (Ambiguous -> all locations), references,
documentSymbol and capped workspace/symbol. Deferred capabilities
are not advertised. 860-file corpus session: 0.79s, 29.5MB. QA drove
a real stdio session: diagnostics clear on fix, staleness model
honored, malformed frames survived.
linter-core (new crate vlog_linter + vfmt check): ruff-style rules
with Safe/Unsafe fix applicability, inline waivers with unused-
waiver detection (Verible-spelling waivers for unimplemented rules
deliberately tolerated -- corpus-driven), seven seed rules, --fix /
--select / --ignore / --output-format json, frozen exit codes, bare
vfmt byte-identical to before (worktree-proven). Corpus baseline:
7806 violations in 93 files, deterministic. Lead-directed fix:
--fix never edits inside // vfmt: off fences (reported, not
auto-fixed), with a scan backstop for tolerant-parse trees where
fence::collect sees no regions.
Both dev agents were interrupted by a session limit mid-round and
resumed from transcripts; the workspace survived intact.
Dev: 2 Opus agents; QA: 2 Sonnet agents; reviews in
docs/features/{vfmt-server,linter-core}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
workspace-index (vlog_semantic): cross-file resolution -- the
owner's `import pkg::*;`-anywhere requirement delivered.
WorkspaceIndex maps modules/packages/file-scope typedefs, package
exports, module ports/params and per-file define tables; built
tolerantly (broken files still contribute), deterministic by
construction (FileIds assigned after path sort). resolve_external
answers ExternalCandidates in a two-layer overlay keyed by
ReferenceId -- Semantics stays a pure single-file fact; local
declarations outrank imports. Corpus: 87% of external candidates
answered (external rate 19.6% -> 2.6% on clean files), ambiguity
kept honest (OpenTitan prim_generic/prim_xilinx), 0.7s build,
workspace_symbols substring search.
name-spans (vlog_parser): the approved vlog-semantic handshake --
the parser records every declared name's span at parse time (28
fields across 21 node kinds; Name/ImportPath bundles where parallel
Vecs could desync; ImportPath splits p::x for the index). Content-
pinned by the exhaustive walker on every source, mutation-tested
three ways, zero behavior change (corpus md5 exact, QA byte-compared
formatter output against a HEAD worktree). scan.rs is now one
consumer away from deletion (DataType span, handshake item 2).
TODO §6 foundations complete: spans, error recovery, define table,
single-file semantics, workspace index. Next: vfmt_server.
Dev: 2 Opus agents; QA: 2 Sonnet agents; reviews in
docs/features/{workspace-index,name-spans}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
vlog_semantic (new crate): single-file symbol tables and reference
resolution -- the layer that powers go-to-definition, references,
hover and document outline, and later the semantic lint rules.
Two-pass bind-then-resolve (Verilog forward references), 15 symbol
kinds, scope tree, and a three-state Resolution (Resolved /
ExternalCandidate carrying import paths for the future workspace
index / NotFound). scan.rs recovers name spans the AST lacks (95k
corpus spans verified; handshake filed and approved to move
name_span into the parser, which deletes the module). Corpus
baseline: 79.5% in-file resolution, 0.9% unresolved on clean files,
zero panics including tolerant-parse trees.
parallel-files (vfmt): rayon-parallel per-file formatting -- first
dependency, exact-pinned with written justification. 8 MiB worker
stacks discharge the recursion-limit handshake (sabotage-verified);
single-install panic hook discharges the cli-polish handshake;
deterministic input-order output (one stdout/stderr hash across 14
corpus runs at 4 thread counts); --threads flag; hand-rolled
.gitignore subset with 16/16 differential agreement against git
check-ignore. 3.6x wall-clock on the 860-file corpus.
Dev: 2 Opus agents; QA: 2 Sonnet agents; reviews in
docs/features/{vlog-semantic,parallel-files}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
Meta.trailing is now Option<Comment> (line/col/span — delivers the
format-fences handshake; same-line fences stay deliberately inert),
and Meta::before_sep keeps a comment on its element's side of the
separator across every list kind, including the closing-bracket
buckets. take_before_sep is a no-op unless the cursor is on the
separator, which is why all 299 pre-existing cases stayed
byte-identical. Also fixes: EnumType::dangling comments parsed but
never printed (a latent invariant-#3 violation), the double-blank
between leading comments (six corpus files became fixed points), and
five documented expression refusals (replication interior,
compact-bracket operator position, assign-value, concat brace,
header imports via HeaderImport).
Reproducible acceptance metrics (HEAD-worktree control): line-
position comment injection refusals 2.3% -> 0.4%; exhaustive gap
probe 90 -> 22 refused; delimiter-position 61% -> 36%. Remaining
parked positions documented. verify.rs byte-identical; +7 rejection
tests; corpus 0 verification errors, 0 crashes, parse 468/820.
229 workspace tests, clippy silent. Dev: Opus agent; QA: Sonnet
agent (sabotage-verified pins, independent probes); review in
docs/features/comments-round/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
error-recovery (vlog_parser): parse_source_tolerant never fails —
errors become positioned ParseDiagnostics and ItemKind::Error /
StmtKind::Error leaves (raw text + span, nesting invariant intact),
with recovery at documented sync tokens, bracket-balanced skipping,
and stray-closer collapse. Strict parse_source is byte-identical in
behavior (shared grammar, tolerant flag). Guarantees tested:
tolerant==strict on 500 valid sources; depth/links budgets neither
reset nor leak across recovery (mutation-tested); no panic across
27k+ truncation cuts, every single-char fixture deletion, 1MB of
semicolons (500k recoveries, 344ms). The future LSP parses mid-edit
code; the formatter still refuses on the first error.
format-fences (vlog_formatter): // verilog_format: off|on and
// vfmt: off|on emit fenced item ranges as exact source bytes via
spans (Doc::Verbatim), Verible-style item-level regions per scope,
unmatched off to end of scope, byte-exact including indentation and
idempotent at every join (24 adversarial probes). ~2000 corpus fence
injections: zero region byte changes, zero new verification
failures. verify.rs untouched; with no fences output is
byte-identical (corpus TSV md5 unchanged).
Also surfaced and queued in TODO: comment-in-list refusals
(112/1868 injection trials) and the double-blank leading-comment
nit — the next comments round.
Dev: 2 Opus agents; QA: 2 Sonnet agents; reviews in
docs/features/{error-recovery,format-fences}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
The LSP cornerstone (TODO §6) and the prerequisite for format-off
fences and range formatting. Convention: node span = code extent
(first to last token; attributes included, comments excluded and
carrying their own spans) — chosen because it makes child-nests-in-
parent a total, assertable invariant. Expr became {kind, span};
element structs carry spans; payload structs whose extent equals
their wrapper's deliberately don't (one fact, one place). LineIndex
maps offset <-> 1-based line:col in UTF-8 bytes, with clamping.
A token-level losslessness test asserts every source byte is covered
by token/trivia spans (whitespace aside) and concatenation
reconstructs the input — it immediately surfaced and documented two
pre-existing lexer normalizations (sized-literal tick spacing,
merged same-line trailing comments), both whitespace-only.
Zero behavior change, proven: corpus TSV md5-identical, and QA
diffed formatter output on all 820 corpus files against a pre-spans
worktree binary — no differences. Mutation-tested by dev and QA;
one unpinned span QA found (GenIf content) is now pinned by a
lead-added slice test. 161 workspace tests.
Dev: Opus agent; QA: Sonnet agent; review in
docs/features/spans/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
TODO.md §6 rewritten per owner requirement: vfmt becomes an LSP
server for VS Code and Vim with Pylance/ruff-parity features for
Verilog (synthesizable subset first) — semantic tokens, formatting,
diagnostics, go-to-definition, references, hover with `define
expansion, symbols; cross-file resolution of header imports via a
workspace index. Added define-table and workspace-index items and an
editor-packaging item; clarified the no-preprocessing non-goal
(recording defines for hover is bookkeeping, not expansion).
Co-Authored-By: Claude Fable 5 <[email protected]>
Two budgets, both measured rather than guessed: MAX_NESTING_DEPTH=64
gates the five recursion cycles in the parser (debug frames run to
~50KB; 64 peaks at ~3.9MiB against the 8MiB stack), and
MAX_CHAIN_LENGTH=256 charges postfix segments and binary/inside
operators, whose loops deepen the AST without parser recursion.
Restore-by-assignment makes the chain budget correct on every early
return. Invariant: AST depth on any root-to-leaf path <= 64+256,
so the formatter's structural recursion is bounded too.
Deep or chain-heavy inputs now get a clean "nesting too deep" /
"expression chain too long" parse error with position, exit 2, batch
unaffected -- replacing an uncatchable stack-overflow abort that
killed whole runs (3KiB of a.b.b... sufficed before).
Round 1 was rejected in review: QA found postfix chains ungated and
the leak test unable to detect missing releases (proven by sabotage).
The rework widened the finding to binary/inside chains, added the
second budget, and made leak tests sabotage-complete (7/7); re-QA
attacked the additive-composition invariant and found no hole, with
no acceptance regressions (128-term sums, 10k statements still fine).
Dev + rework: Opus agent; QA + re-QA: Sonnet agent; full history in
docs/features/recursion-limit/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
tools/corpus_fetch.sh pins picorv32, ibex, common_cells and two
OpenTitan IPs by exact SHA; tools/corpus_check.sh buckets per-file
outcomes (parse/format/verification-error/crash) into a summary,
a deduped error histogram, and a TSV diffable between commits.
Baseline at 9f1a6cf: 35.2% parsed, zero crashes, zero corruption;
24 safety-net refusals reducing to four formatter bugs (event-list
comma -> or, dropped comments in port lists and always blocks,
merged header imports, dropped empty #()) — queued as the next
bug-fix round with corpus files as acceptance inputs.
The corpus proved the README roadmap order wrong: macro invocation
at item/statement position blocks ~60% of RTL parse errors (it
wasn't listed), interfaces (was #1) blocked one file. README
roadmap re-ordered by measured impact.
Dev: Opus agent; QA: Sonnet agent (all claims pass, re-run
byte-identical; fixed a TSV tab-splitting bug); review in
docs/features/corpus-check/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
All five briefed bugs fixed, plus a sixth found during the work:
1. Block-comment continuation drift: token::Comment gained line/col;
continuation lines are dedented by the comment's original column
before re-indenting, making reformatting a true fixed point while
preserving the author's relative indentation inside the comment.
2. Comments inside expression groups (concat, parens, call args,
assignment patterns, binary operands) now force the group to break
instead of being lifted out.
3. Closing block labels preserved for end/join*/endfunction/endtask/
endpackage, matching endmodule.
4. Multi-instance declarations fit on one line when they fit and
indent their continuations when they break.
5. @( /* c */ * ) keeps its comments (SensList::Star before/after).
6. Multi-line `define/attribute bodies no longer drift (RawText.col).
verify.rs comparison logic untouched (diagnostic positions only) —
QA audited the diff to confirm the safety net was not weakened.
All four #SKIP cases un-skipped verbatim as spec; 17 cases added
(183 -> 200, 0 skipped). QA triple-formatted 204 inputs with zero
regressions. Clippy is now fully silent workspace-wide.
Remaining comment-placement refusals (4) and a pre-existing @(* )
lexer limitation are documented as open items, not hacked around.
Dev: Opus agent; QA: Sonnet agent; review in
docs/features/formatter-bug-fixes/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
main.rs split into args/walk/diff modules, all std-only. --diff emits
a patch-applicable unified diff (bounded-resync hunks, GNU-style
missing-newline marker); --exclude is a small component-glob matcher
that prunes directory walks; --stdin-filename names stdin buffers in
messages; per-file catch_unwind turns formatter panics into ordinary
errors. Exit-code contract (0/1/2) frozen and documented in --help
and README. 12 CLI integration tests + 18 unit tests.
Known gap found by QA, queued in TODO §1: deep nesting overflows the
parser stack (uncatchable), needs an explicit recursion-depth limit.
Dev: Opus agent; QA: Sonnet agent; review in
docs/features/cli-polish/README.md (includes one lead fix: the
no-final-newline marker is now emitted the way patch(1) expects).
Co-Authored-By: Claude Fable 5 <[email protected]>
format_source now verifies every result before returning it, per
Verible's practice: the output must re-lex to the same token stream
as the input (comments included, whitespace ignored) and formatting
it a second time must be a fixed point. Any failure returns
FormatError::Verification and the caller keeps the original text —
"never corrupt code" and idempotency are now runtime guarantees.
Normalizations (documented in the feature README): multi-line
comments/directives/attributes compare line-trimmed since the
formatter re-indents them; @(*)/@* is a whitelisted canonicalization.
The net already catches three real pre-existing bugs (closing-label
drop, block-comment re-indent drift, sens-list comment drop), which
now refuse output with exit 2 instead of corrupting files. Fixes
queued as the next feature. Checks off TODO.md §1 items 1-3.
Dev: Opus agent; QA: Sonnet agent (17 adversarial pairs, all caught);
review in docs/features/safety-net/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>