Pre-Execution Safety Gate
Inspects target directory before any scanner executes: blocks missing paths, symlink escapes outside repo root, oversized trees (>20,000 files or >250 MB), large binary blobs (>25 MB), and suspicious git hooks.
Audit Methodology & Invariants
Auditeur treats security scoring as reproducible engineering evidence. Every stage produces content-addressed receipts, every finding survives independent refutation before impacting a score, and every gap in scanner coverage is disclosed beside the grade.
Kernel Architecture
Inspects target directory before any scanner executes: blocks missing paths, symlink escapes outside repo root, oversized trees (>20,000 files or >250 MB), large binary blobs (>25 MB), and suspicious git hooks.
Resolves canonical repository root, records exact Git HEAD commit SHA, git dirty flag, and computes a deterministic SHA-256 tree digest across every tracked source file.
Catalogs files by extension and language (TypeScript, JavaScript, Python, Rust, Go, Solidity), package manifests, lockfiles, GitHub Actions workflows, LICENSE, and SECURITY.md presence.
Runs built-in static rules (secrets, JS/TS dangerous sinks, Solidity risks, GitHub Actions pinning/permissions, supply-chain hygiene) plus configured external scanners (Gitleaks, Semgrep, OSV-Scanner, Slither, Aderyn). Unavailable tools are recorded explicitly — never faked.
Deduplicates findings deterministically, binds each verified finding to its scanner receipt ID, and segregates any externally supplied unverified hypotheses so they cannot influence scores.
Runs an independent cross-provider, cross-session refutation pass verifying receipt digests and exact line SHA-256 snippets. Computes scores strictly from accepted post-refutation findings across applicable dimensions.
Rolls sorted receipt digests into a domain-separated binary SHA-256 Merkle root, content-addresses the report, and signs the canonical AuditProofPayloadV1 envelope with Ed25519.
False-Positive Defense
Enforced by @hopper/engines-finding-refutation before any report reaches publication.
A proposer can never confirm its own findings. Calling runRefutationPass with the same session ID or (in strict mode) the same provider ID immediately throws SAME_SESSION_REFUTATION_FORBIDDEN.
Both the proposer and the refuter must cite existing receipt IDs with valid SHA-256 digests and real file line ranges inside the canonical repo root (rejecting path traversal, symlinks, out-of-bounds lines, and mismatched snippetSha256).
When the refuter disproves a claim (comment-only code, missing vulnerability pattern, or broken citation), the finding is preserved transparently in the report's Refuted Findings section with exact rationale and 0 score penalty.
Confirmed matches confined exclusively to test, fixture, or mock paths (e.g., tests/, __fixtures__/) are automatically downgraded (critical/high/medium → low, low → info) — preventing noisy test fixtures from masking real production risk while keeping them fully auditable.
Transparent Math
Defined verbatim in @hopper/engines-code-audit/src/scoring.ts. Base weights renormalize strictly across applicable verified dimensions.
| Dimension | Base Weight | Applicability |
|---|---|---|
| Code Security (code_security) | 25% | Always applicable (code & workflow security) |
| Secrets Posture (secrets_posture) | 25% | Always applicable (deduplicated per file:line) |
| Supply Chain & Hygiene (supply_chain_hygiene) | 20% | Always applicable (lockfiles, OSV, LICENSE, SECURITY.md) |
| Smart Contract Security (smart_contract_security) | 15% | Only when Solidity (.sol) files exist |
| Web Surface Posture (web_surface_posture) | 15% | Only when an HTTPS endpoint probe snapshot is included |
| Severity | Dimension Penalty | Grade & Rating Thresholds |
|---|---|---|
| CRITICAL | -30 pts | A+ (95–100), A (90–94), A- (85–89) |
| HIGH | -18 pts | B+ (80–84), B (75–79), B- (70–74) |
| MEDIUM | -8 pts | C+ (65–69), C (60–64), C- (55–59) |
| LOW | -3 pts | D (40–54), F (0–39) |
| INFO | 0 pts | Green ≥ 80 · Amber 60–79 · Red < 60 |