Skip to content

Commit 35948ac

Browse files
audit: classify FFI binding unsafe blocks as legitimate (PA001/PA007, 129 entries) (#67)
## Summary `panic-attack assail` reports 88 `UnsafeCode` (PA001) + 41 `UnsafeFFI` (PA007) Critical/High findings across this repo's binding-language directories. All sit at the C-ABI boundary: every \`bindings/<lang>/src/\` directory is a *thin wrapper* over the C ABI exposed by \`libproven\` via the Zig FFI bridge. **No logic is reimplemented in any binding** — every function calls through to the formally-verified Idris 2 implementation. This PR adds the user-classification registry so the next assail pass suppresses these 129 findings, leaving any **new** unsafe code outside the FFI roots visible. ## What changes - \`audits/assail-classifications.a2ml\` — 129 \`(classification ...)\` entries, all \`classification="legitimate-ffi"\`. - \`audits/audit-ffi-bindings-2026-05-26.md\` — per-binding rationale. ## Scope The classification is **scoped to FFI-boundary roots**: - \`bindings/*/src/\` - \`ffi/*/src/\` - \`domain-specific/*/ffi/*/src/\` Any unsafe block outside those roots remains visible. The audit doc enumerates exactly which binding languages are covered (Ada, AffineScript, C, Elixir, ephapax-{affine,linear}, Go, Haskell, Rust, SML, VCL, Zig, BEAM NIF, http-Zig). ## Why classification, not code fix You can't \"fix\" FFI unsafe — it's structural. The C ABI requires unsafe at the boundary in every host language. The reviewable record is the registry + audit pair: any *new* unsafe block introduced inside the FFI roots needs a companion classification entry, which is a separate visible edit. ## Anti-gameability Same pattern as \`hyperpolymath/007\` and \`hyperpolymath/echidna\`. Registry is a separate file from any source under scan; suppression cannot be added one-sidedly without a companion audit-doc edit. ## Verification Locally on this branch: \`panic-attack assail . --headless\` reports: | Category | Active (Critical/High) | Suppressed | |---|---|---| | UnsafeCode (PA001) | 0 | 88 | | UnsafeFFI (PA007) | 0 | 41 | (The 1 remaining UnsafeCode and 8 UnsafeFFI are Medium severity, out of scope this PR.) ## Out of scope this PR (separate follow-ups) | Category | Count | Notes | |---|---|---| | CommandInjection (PA003) | 15 | Mostly tooling/build scripts | | HardcodedSecret (PA009) | 6 | Mostly test fixtures | | DynamicCodeExecution | 5 | Separate triage | | SupplyChain (PA023) | 2 | Version-pinning judgement | | UnsafeTypeCoercion / UncheckedAllocation / PanicPath | 5 | Spot triage | ## Test plan - [ ] CI green (hypatia-scan, secret-scanner, codeql, governance, scorecard) - [ ] Post-merge: \`panic-attack assail .\` shows 0 active Critical/High UnsafeCode + UnsafeFFI - [ ] No findings outside FFI roots reduced Refs hyperpolymath/panic-attack#32 (estate sweep tracker). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent edee1e1 commit 35948ac

2 files changed

Lines changed: 1034 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)