Skip to content

Commit 8636e15

Browse files
fix(hypatia): scoped exemption for the unsatisfiable unsafe_block rule (#147)
Follow-up to #146 — the one finding that survived. hypatia's `unsafe_block` rule is a bare `unsafe\s*\{` regex (`lib/rules/code_safety.ex`): it flags every unsafe block regardless of documentation, so no SAFETY comment can ever satisfy it (the adjacency fix in #146 was a no-op against a rule that never looks). The single unsafe block in my-llvm is mandatory (inkwell declares `build_gep` unsafe) and fully documented, so this uses the same scoped `.hypatia-ignore` mechanism as the existing `coq_axiom`/`transmute` keyword-match exemptions — a permanent fact should not be expiring baseline debt. Upstream rule fix is a candidate for hypatia itself. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 1ff3bf5 commit 8636e15

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.hypatia-ignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,13 @@ security_errors/secret_detected:docs/wiki/guides/getting-started.md
9999
# GetElementPtr pointer invariant. `grep -nE 'transmute\s*(::<|\()'` over the file
100100
# returns nothing. No unchecked bit-reinterpretation exists here.
101101
code_safety/transmute:crates/my-llvm/src/lib.rs
102+
103+
# --- Rule cannot be satisfied: `unsafe_block` is a bare `unsafe\s*\{` regex
104+
# (hypatia lib/rules/code_safety.ex) — it flags EVERY unsafe block regardless
105+
# of documentation; the "requires SAFETY comment" in its description is not
106+
# actually checked. The single unsafe block here is mandatory (inkwell declares
107+
# `build_gep` unsafe) and carries a 17-line SAFETY invariant argument plus an
108+
# adjacent `// SAFETY:` marker. Until the rule checks for SAFETY comments
109+
# (upstream fix candidate), a scoped exemption is the only correct mechanism —
110+
# a baseline entry would just regenerate as expiring debt for a permanent fact.
111+
code_safety/unsafe_block:crates/my-llvm/src/lib.rs

0 commit comments

Comments
 (0)