QA round 1: adversarial review logs and a with-block attack test

No blocking findings over the 8 round-1 clusters: whole-corpus idempotency
and comment-preservation sweep clean (796/820), 476-run mutation fuzz clean,
no swallowed errors in the diff. Adds
reindented_string_inside_a_with_block_is_rejected. Findings (non-blocking)
are in each feature README's QA log; the printer fits() / Doc::Inline gap
is fixed separately.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5 committed 2026-08-21 01:37:33 -07:00
1 parent f1db1e5746
commit 0557933994
9 files changed
+400 -8

No files matched your search

+66 -1
View File
@@ -280,4 +280,69 @@ Files changed:
## QA log
## Review
### 2026-08-21 — round-1 adversarial QA
Verified: `cargo test --workspace`/clippy/fmt clean; corpus score 796/820;
whole-corpus idempotency + comment-preservation sweep clean; 476-case mutation
fuzz clean.
Targeted attacks:
- **`skip_action_stmt` running off the end / infinite loop on unbalanced
input.** Not found — `skip_balanced` and the outer `skip_action_stmt` loop
both check `at_eof()` on every iteration and return a clean parse error
("expected `)`" / "expected `;`" / "expected `end`") rather than looping.
- **`skip_action_stmt` swallowing the FOLLOWING item/statement — found a real
gap (clean error, not corruption).** `skip_action_stmt`'s non-`begin`
branch (parser.rs, `fn skip_action_stmt`, ~line 1665) scans token-by-token
for a depth-0 `;`, tracking nesting only for `(`/`[`/`{`. It does **not**
track `begin`/`end` nesting unless the pass statement's *very first* token
is literally `begin`. So when the pass statement is, e.g., an `if` whose
then-branch is a `begin ... end` block, the scan stops at the first `;`
**inside** that nested block instead of after the block's `end`. Repro:
```verilog
assert property (@(posedge clk) a |-> b)
if (cond)
begin
x = 1;
end
else
y = 2;
```
→ `parse error: 8:7: unsupported construct starting with keyword 'else'
(found "else")` (exit 2). Without the `else`, the leftover `end` after the
prematurely-ended verbatim span becomes `parse error: 8:5: expected
declaration or instantiation (found "z")` for whatever follows. Both are
**clean rejections** — exit 2, zero bytes written, input untouched on disk
— so no hard invariant is broken, but this is a real, reproducible parsing
gap in the assertions cluster: an otherwise-legal concurrent-assertion
action block (`if` with a `begin/end` body, optionally followed by `else`)
is currently unformattable. Files at
`/private/tmp/claude-501/.../scratchpad/qa/assert1.sv` and `assert2.sv`.
**NON-BLOCKING** (no corruption/idempotency/comment-loss), but flagged as a
concrete follow-up: `skip_action_stmt`'s generic branch needs `begin`/`end`
depth tracking alongside its bracket tracking.
- **`restrict` matched by text.** No case found where an ordinary identifier
named `restrict` followed by `property` gets misidentified — the exact
scenario the dev's comment says cannot happen (no type/instance name is
ever followed by the `property` keyword) held up under testing.
- **Verbatim raw_text with a multi-line string inside `else $error("...")`.**
Constructed a concurrent assertion whose action block contains
`$error("line one\nline two")` at a nested `generate`/`begin` indent level
different from column 0; the whole assertion — multi-line string included —
reproduces byte-identical and is idempotent; the first line gets
re-indented with the rest of the item, the string's continuation line does
not move (per `crosses_line_inside_string`/`raw_text`, format.rs).
- **Comment immediately after `assert`/`property`/inside the property
paren/around the action-block boundary.** `assert /*c1*/ property /*c2*/ (
/*c3*/ @(posedge clk) a |-> b /*c4*/ ) /*c5*/ else /*c6*/ $error("x")
/*c7*/ ;` — every comment position round-trips byte-identical (the whole
construct is one verbatim span), no losses.
No BLOCKING findings for this cluster. The `skip_action_stmt` begin/end gap
above is the most concrete follow-up item.