Commit Graph
38 Commits
Author SHA1 Message Date
lucioandClaude Fable 5 b560909a76 README truth pass: releases exist now, and the server reads lucisv.toml
The v0.7.1 release made three claims false: 'there are no prebuilt
downloads' (the releases page now has five platforms + the .vsix per
tag), 'the script builds for the host triple only' (--cross has existed
since 0.7.0's cross-platform release), and the hardcoded
lucisv-0.5.0.vsix example. The bigger correction: the 'server does not
read lucisv.toml yet' caveat has been stale since the config ladder
landed in lucisv_server/src/format.rs -- replaced with the actual
precedence (lucisv.toml > lucisv.* settings > tab size > default). Also
states plainly that Linux/Windows artifacts are audited, not executed.
.DS_Store untracked and gitignored.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 02:10:54 -07:00
lucioandClaude Fable 5 033e53b381 README/ROADMAP: directive-split round 3 — 99.1%, loop log and review
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 01:26:28 -07:00
lucio eeaffafd56 Rename the tool to lucisv (Language Utility for Coding In SystemVerilog) 2026-08-25 23:36:00 -07:00
lucioandClaude Fable 5 d26f08335b Macro expansion M14: hover shows the one-step expansion; v0.5.0
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]>
2026-08-25 03:14:49 -07:00
lucioandClaude Fable 5 36ddabac6c CLI filelist M13: vfmt -f files.f
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]>
2026-08-25 02:44:38 -07:00
lucioandClaude Fable 5 80978f324f Semantic lints M12: unused-signal, undriven-net, multiply-driven
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]>
2026-08-25 02:24:37 -07:00
lucioandClaude Fable 5 04be0cfb37 Color decorators 0.4.2: #200 is a delay, not a colour
VS Code's built-in default colour provider (editor.defaultColorDecorators,
default auto since 1.78) pattern-matches CSS-style hex in languages where
no extension provides document colours - so delay controls like #200 grew
RGB swatches. The extension now ships the language-scoped configuration
default "never" for [verilog] and [systemverilog]; user-overridable,
invisible to every other language. Diagnosis verified on the reporting
machine: no colour-provider extension installed, no server capability, no
user override.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 20:51:06 -07:00
lucioandClaude Fable 5 302b3ed443 Hover highlighting 0.4.1: ship a TextMate grammar
Hover cards fence their declaration snippets as systemverilog markdown,
but VS Code colors fences with a TextMate grammar and the extension
deliberately shipped none - so hovers rendered plain. One compact
lookaround-free grammar (comments, strings closing at end of line, based
and fill and real and time literals, directives then macro uses, system
tasks, all 181 keywords generated from vlog_parser::KEYWORDS with a
mutation-checked drift test) registered for both language ids. Buffers
also gain colors before the server starts; semantic tokens still win once
it does. Fence tags are pinned as a contract in hover and completion.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 20:15:47 -07:00
lucioandClaude Fable 5 e9b7510ca4 Templates 0.4.0: context-gated statement/item snippet completion
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]>
2026-08-24 17:28:31 -07:00
lucioandClaude Fable 5 ab89152264 Rainbow 0.3.1: never paint begin/end invisible; unmatched go red
The rainbow painted depth 3-5 pairs with editorBracketHighlight
.foreground4..6, whose VS Code defaults are fully transparent — a begin
typed three levels deep vanished with its end. The extension now uses
contributed vfmt.rainbow1..6 colors with opaque defaults in every theme
variant (dark/light/HC/HC-light), and vfmt/scopePairs additionally
reports genuinely unmatched begin/end/fork/join tokens, painted
vfmt.rainbowUnmatched bright red — file characters are never hidden.
Matched pairs, depths and 78eeef6's counting are unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 15:45:54 -07:00
lucioandClaude Fable 5 d8e37086df Refactoring M5: keyword + project-wide identifier completion; v0.3.0
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]>
2026-08-24 15:07:57 -07:00
lucioandClaude Fable 5 315bbf23ab Refactoring M1: EDA filelist (.f) defines the index scope
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]>
2026-08-24 04:11:45 -07:00
lucioandClaude Fable 5 a4f8476894 Fix round-1 QA findings: Inline width in fits(), action-block nesting, comment gaps
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]>
2026-08-21 02:11:59 -07:00
lucioandClaude Fable 5 e35da292bd Add mop-up-2: macro items ending their line, new shallow copy, 32'h`MACRO
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]>
2026-08-21 01:42:53 -07:00
lucioandClaude Fable 5 f1db1e5746 Add dv-statements: with clauses, foreach targets, randcase, let, labels
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]>
2026-08-21 01:19:49 -07:00
lucioandClaude Fable 5 c2ea1656e1 Add expressions-2: casts, streaming, ->, drive strengths, pattern replication
Casts with parenthesized/keyword/scoped bases, streaming operators, -> and <-> implication, assign (weak0, pull1) drive strengths, (* attr *) on named connections, '{N{x}} replication in assignment patterns, x inside `MACRO, const ref tf arguments.

Coverage loop round 1, cluster 7: 751 -> 772 / 820 (91.6% -> 94.1%).
Feature README: docs/features/expressions-2/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 00:46:39 -07:00
lucioandClaude Fable 5 d071957393 Add types-decls: inline aggregates, typedef'd types with packed dims
Anonymous enum/struct/union declarations, struct packed as a parameter type default, user_t [N:0] x; at item and statement position, typedef enum with a typedef'd base, nested anonymous structs, localparam type as a body item, multi-declaration for-loop inits.

Coverage loop round 1, cluster 6: 740 -> 751 / 820 (90.2% -> 91.6%).
Feature README: docs/features/types-decls/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 00:24:04 -07:00
lucioandClaude Fable 5 2a63faf9a2 Add interfaces, modport, clocking blocks and virtual interface types
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]>
2026-08-21 00:01:53 -07:00
lucioandClaude Fable 5 e24d33afab Add concurrent assertions, sequence and property as verbatim items
assert/assume/cover/restrict property (...) [action block], optionally labeled, at item and statement position; sequence...endsequence and property...endproperty declarations. Verbatim pass-through like constraint/covergroup; verify.rs untouched, attack tests added.

Coverage loop round 1, cluster 4: 699 -> 712 / 820 (85.2% -> 86.8%).
Feature README: docs/features/assertions/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-20 23:38:22 -07:00
lucioandClaude Fable 5 f7c66c79bf Add bind directives
bind <target> [: inst, ...] <module> [#(...)] <inst> (...); reusing the instantiation AST and layout wholesale.

Coverage loop round 1, cluster 3: 671 -> 699 / 820 (81.8% -> 85.2%).
Feature README: docs/features/bind/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-20 23:23:41 -07:00
lucioandClaude Fable 5 8007a71932 Add dpi-export: DPI-C import/export and package export
import "DPI-C" [context|pure] function/task prototypes, export "DPI-C" function/task, and export pkg::*; / pkg::item.

Coverage loop round 1, cluster 2: 661 -> 671 / 820 (80.6% -> 81.8%).
Feature README: docs/features/dpi-export/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-20 23:09:49 -07:00
lucioandClaude Fable 5 f52beff48f Add item-misc: spaced macro calls, line-aware macro items, `error, elab tasks
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]>
2026-08-20 22:54:47 -07:00
lucioandClaude Fable 5 da1448ecd0 Add dynamic-types and one-parse (round 19)
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]>
2026-08-19 20:22:18 -07:00
lucioandClaude Fable 5 e9008b680c Add range formatting and the second lint-rule set (round 18)
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]>
2026-08-19 15:28:24 -07:00
lucioandClaude Fable 5 003e0766e9 Add alignment inference and the format cache (round 17)
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]>
2026-08-19 14:42:07 -07:00
lucioandClaude Fable 5 7f2e78fc1c Add classes: SystemVerilog class support, corpus 58.0% -> 70.5%
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]>
2026-08-19 13:45:18 -07:00
lucioandClaude Fable 5 26a59c1d6a Add release-prep: vfmt 0.2.0, LICENSE, CHANGELOG, release tooling
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]>
2026-08-19 12:39:10 -07:00
lucioandClaude Fable 5 692496fb89 Add directives-in-instances and shared-fence-filter (round 15)
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]>
2026-08-19 12:09:51 -07:00
lucioandClaude Fable 5 6e6aacb392 Add directives-in-lists: ifdef/define/`include between list elements
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]>
2026-08-19 11:31:14 -07:00
lucioandClaude Fable 5 832bf4afc6 Add editor-packaging and vfmt-core-lift (round 12: TODO §6 closes)
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]>
2026-08-19 10:08:14 -07:00
lucioandClaude Fable 5 c8b936a741 Add vfmt-server and linter-core (jointly: round 11)
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]>
2026-08-19 09:15:54 -07:00
lucioandClaude Fable 5 7cf657a538 Add vlog_semantic and parallel-files (jointly: shared root manifest)
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]>
2026-08-19 06:39:51 -07:00
lucioandClaude Fable 5 02f68655b5 Add error-recovery and format-fences (jointly: entangled in format.rs)
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]>
2026-08-19 05:23:05 -07:00
lucioandClaude Fable 5 481cce2a3e Add config-discovery: vfmt.toml / .vfmt.toml, ruff-style
Upward per-directory search (vfmt.toml preferred, .git stops the walk
after the directory is checked, nearest file wins, no merging), a
~100-line strict TOML-subset parser (std only; unknown keys, bad
values and unsupported TOML are hard errors naming file:line), and
per-setting precedence CLI > config > default with exclude patterns
accumulating. Config errors are fatal before anything is written --
gather() resolves every file's config up front, preserving the frozen
exit-code contract. --no-config skips discovery entirely.

QA verified pre-write fatality under adversarial walk order, CRLF
configs, symlinked inputs, and 10-level chains. Lead fixes on
acceptance: BOM stripped; leading + rejected per the documented
digit+ grammar. 61 vfmt tests.

Dev: Opus agent; QA: Sonnet agent; review in
docs/features/config-discovery/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-19 04:37:44 -07:00
lucioandClaude Fable 5 3325905f21 Add macro-items: macro invocations at item/statement position
The corpus-measured #1 blocker (~60% of RTL parse errors). Macro
invocations (`NAME, `NAME(args), optional trailing ;) now parse
wherever a module item or statement can appear; the invocation is an
AST leaf (MacroCall{RawText, semi}) emitted verbatim with column-
aware re-indent, semicolon reproduced only if written. Disambiguation
is safe by construction: both readings emit identical token streams.
The lexer's balanced-arg scan is hardened (strings, comments, 256-cap
nesting counter, iterative). Corpus parse rate: 35.2% -> 57.1%
(179 files gained, 0 regressed).

Round 1 was rejected in review: QA proved the new verify.rs
normalization could mask real corruption -- a string literal spanning
lines inside a macro arg had its bytes changed by re-indent, with
exit 0. The rework widened the finding to `define bodies and
attributes (same pre-existing defect, same shared root) and fixed
both sides: line_starts_inside_string, a lexer-mirroring scanner, is
the single shared definition of "which line breaks are data" -- the
verifier trims only outside strings, and the formatter emits any
token with an in-string line break fully verbatim (idempotent by
construction). Re-QA attacked the scanner on ten edge shapes and
found no hole; corpus TSV byte-identical pre/post fix.

Process consequence, codified as CLAUDE.md hard-invariant #4: any
widening of verify.rs forgiveness ships with masked-corruption attack
tests, dev-written and QA-re-attacked.

Dev + rework: Opus agent; QA + re-QA: Sonnet agent; full history in
docs/features/macro-items/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-19 03:22:13 -07:00
lucioandClaude Fable 5 980bd9c5d4 Add corpus-check: ecosystem check against 820 files of real RTL
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]>
2026-08-19 00:46:32 -07:00
lucioandClaude Fable 5 0a6c365ec2 Add cli-polish: --diff, --stdin-filename, --exclude, panic containment
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]>
2026-08-19 00:03:19 -07:00
lucioandClaude Fable 5 d3d9786791 Initial commit: vfmt — ruff-style Verilog/SystemVerilog formatter
Workspace with comment-preserving parser (vlog_parser), prettier-style
document IR + formatting rules (vlog_formatter), and CLI (vfmt).
Includes snapshot/idempotency tests and a TODO backlog of practices
adopted from ruff and Verible.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-18 23:12:01 -07:00