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]>
Lint warnings (code = rule name, source = vfmt) merge with parse
errors into ONE publishDiagnostics through the single publish path --
the two-publish flicker bug is structurally impossible, pinned by an
e2e asserting notification count. textDocument/codeAction offers a
quickfix per Safe fix (byte-identical to vfmt check --fix, verified
live) and source.fixAll.vfmt as one honest pass with no converge
loop (the client's edit/re-lint cycle converges, verified at 3
rounds) and no claimed-resolved diagnostics list. context.only
honored; tab width from vfmt.toml; module-filename speaks via the
URI; waived violations never published; Unsafe fixes never offered.
Filed, not papered over: a server fix can currently edit inside a
// vfmt: off fence (the fence filter lives in crates/vfmt; a shared
helper is the next round's top item -- no corruption possible since
only Safe fixes exist, but the hands-off promise has a documented
editor-side hole). Also filed: the per-keystroke second parse and a
future vfmt.toml lint key.
108 vfmt_server tests (104 unit + 4 e2e). Dev: Opus agent; QA:
Sonnet agent (every claim driven live over stdio); review in
docs/features/server-lint/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]>
collect_defines() is a post-lex pass over Directive tokens (zero
lexer changes) building an ordered DefineTable: name, params (as
written, defaults included), body normalized exactly as a
preprocessor joins continuations (backslash-newline removed, every
other byte preserved -- string values survive), span and name_span.
Redefinitions and `undef events are all recorded in source order
(latest()/all()); position-aware resolution is deliberately left to
the future hover implementation, which needs the history.
Pure data feature: no behavior change anywhere. 24 tests including
mutation-testing of the normalization rule against alternatives that
would rewrite string values. QA swept 502 defines from the corpus
with zero span/name mismatches and hand-verified prim_assert.sv
macros; CRLF continuations confirmed at lexer and table layers.
TODO §6 data foundations now complete (spans, error recovery,
define table).
Dev: Opus agent; QA: Sonnet agent; review in
docs/features/define-table/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]>
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]>
Every fix makes the AST carry a fact the formatter used to invent or
discard: SensSep preserves each event-list separator as written
(, stays , / or stays or, mixed lists round-trip); module-header
imports keep one statement per import; Instantiation::params and
Module::param_ports become Option<Vec> so empty #() survives; and
seven distinct comment-motion shapes (closing paren, empty
connection, declarator-to-;, after binary operator, case labels,
ternary, assign-to-value) keep comments where the source put them,
with Fmt::inline_comments as the single comment-run printer.
verify.rs is byte-identical: the net was right on all 46 refusing
files. Seven new rejection tests pin that judgment (sabotage-checked
by QA). Also removes a latent split_off underflow panic
(Parser::take_around) that QA reproduced on the pre-fix binary, and
fixes the ternary comment refusal from the earlier bug round.
Corpus after: 468/820 parse, 0 verification errors, 0 crashes —
corpus_check.sh exits 0 for the first time. Exactly 46 files moved
verification-error -> would-reformat by path diff; nothing else
changed. 111 workspace tests (was 98), case table 237 entries,
clippy silent.
Dev: Opus agent; QA: Sonnet agent (all claims independently
reproduced); review in docs/features/corpus-bugs/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
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]>
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]>
183 {input, expected} cases across 10 construct files under
tests/cases/, driven by a ~180-line std-only harness (==== / ----
format). Each case asserts formatting and idempotency; #SKIP parks
known formatter bugs and fails the suite once they start passing.
Documents four real formatter bugs found while deriving expected
output (block-comment re-indent non-idempotency, comment lifted out
of expression groups, closing block labels dropped, multi-instance
declaration layout) — parked as #SKIP, to be fixed in a follow-up
feature. Also adds rustfmt.toml matching the codebase style.
Dev: Opus agent; QA: Sonnet agent; review in
docs/features/case-tables/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>