Commit b604172
authored
* fix(prove): drop force-unwrap that zeroed checkers.rs to 0.0/F (Refs #219)
checkers.rs was the only F-grade file among 908 and capped the whole project
grade at B. Its sub-scores are healthy and sum to 85.77 (A-); pmat 3.29.0
discarded that total and substituted 0.0/F because of one force-unwrap:
CRITICAL DEFECT: .unwrap() calls in src/core/prove/checkers.rs:71:33
Code: stack.last_mut().unwrap().1 += 1;
The unwrap is provably safe — line 63 is `while let Some(&(node, idx)) =
stack.last()`, so the stack cannot be empty at line 71. Matching instead of
force-unwrapping is semantics-preserving and removes the critical defect.
This also unbreaks main's pre-commit hook. .pmat/baseline.json stores this file
as AMinus/85.77419/has_critical_defects:false, while a live run computed
F/0.0/true, so check-regression saw A- -> F and failed on a pristine tree. The
baseline value came from pmat's non-git code path, which reports
critical_defects_count: 1 yet leaves has_critical_defects false and skips the
zeroing (reproduced with byte-identical copies differing only by `git init`).
After this change: 85.3/A-, "No critical defects found", and check-regression
against the existing baseline reports "No quality regressions detected
(908 files analyzed)" with no F-grade warning. The 85.77 -> 85.3 delta is the
added `if let` nudging structural complexity, well inside --max-score-drop 5.
cargo test --lib: 12665 passed, 0 failed. clippy -D warnings clean.
* chore(pmat): refresh TDG baseline — checkers.rs now A-, zero F-grade files (Refs #219)
Regenerated by the pre-commit hook after the force-unwrap fix. checkers.rs
moves from the stale AMinus/85.77419 (recorded via pmat's non-git path, which
skips the critical-defect zeroing) to a genuine AMinus/85.29715 with
has_critical_defects: false.
The baseline now contains zero F-grade files, so nothing caps the project
grade at B. Verified no file regressed: comparing all 894 entries shared with
origin/main, 0 moved to a worse grade.
1 parent b724f1a commit b604172
2 files changed
Lines changed: 1602 additions & 589 deletions
0 commit comments