Skip to content

Add robustness badges mined from each parser's source and behavior#19

Merged
LucaCappelletti94 merged 2 commits into
mainfrom
robustness-badges
Jun 9, 2026
Merged

Add robustness badges mined from each parser's source and behavior#19
LucaCappelletti94 merged 2 commits into
mainfrom
robustness-badges

Conversation

@LucaCappelletti94

@LucaCappelletti94 LucaCappelletti94 commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Adds per-parser robustness badges to each parser page (static panic discipline, empirical panic rate on the real corpus, unsafe surface, recursion-depth resilience, dependency count, serde-on-AST), produced by a new offline featurescan crate that scans each parser's source with syn and probes recursion depth in a child process, plus a ParseOutcome enum that lets grading tell a caught panic apart from an honest error. qusql-parse is the only parser that panics on real input, and only sqlparser-rs and sqlite3-parser are depth-guarded among the pure-Rust parsers (polyglot-sql overflows at depth 232). Also strips prose semicolons from rustdoc across the repo.

New featurescan crate parses each parser's library src with syn, counting panic-inducing constructs (panic, unreachable, unimplemented, todo, unwrap, expect, indexing) and unsafe usage, reading the crate's own lint policy, and probing recursion depth in a child process. Counts exclude tests, benches, examples, cfg(test) items, and test-helper files, and are a code-smell proxy rather than a crash proof.

Grading now tells a caught panic apart from an honest error via a ParseOutcome enum, so each parser page reports its empirical panic rate on the real corpus. qusql-parse is the only non-zero offender (84 of 101085, 0.083 percent), all Option::unwrap on None.

Each parser page gains six badges in the existing metadata grid (panic discipline, empirical panic rate, unsafe, recursion depth, deps, serde AST). The redundant hand-recorded unsafe pill is removed in favor of the scanned count. The feature scan and depth probe run as part of cargo regen, the shared schema lives in viz, and both committed snapshots are baked into the wasm at build time.
Replaces prose semicolons with periods in doc and code comments across the repo, per the no-semicolons-in-prose convention. Literal semicolon characters inside backticks (discussing SQL or code) are left intact. Comments only, no code or behavior change.
@LucaCappelletti94 LucaCappelletti94 merged commit 5e5ac90 into main Jun 9, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant