Audit Methodology & Invariants

Deterministic Pipelines, Adversarial Refutation, and Fail-Closed Proofs

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

The 7-Stage Deterministic Audit Pipeline

01

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.

02

Commit-Pinned Custody Snapshot

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.

03

Repository Inventory

Catalogs files by extension and language (TypeScript, JavaScript, Python, Rust, Go, Solidity), package manifests, lockfiles, GitHub Actions workflows, LICENSE, and SECURITY.md presence.

04

Deterministic Multi-Scanner Execution

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.

05

Evidence Normalization & Receipt Hashing

Deduplicates findings deterministically, binds each verified finding to its scanner receipt ID, and segregates any externally supplied unverified hypotheses so they cannot influence scores.

06

Adversarial Refutation & 5-Dimension Scoring

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.

07

Merkle Receipt Root & Ed25519 Proof

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

Independent Adversarial Refutation Gate

Enforced by @hopper/engines-finding-refutation before any report reaches publication.

Strict Cross-Session & Cross-Provider Isolation

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.

Cryptographic Line & Receipt Citations

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).

Refuted Findings = 0 Score Impact

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.

Non-Production Test-Path Downgrades

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

5-Dimension Rubric Weights & Severity Penalties

Defined verbatim in @hopper/engines-code-audit/src/scoring.ts. Base weights renormalize strictly across applicable verified dimensions.

DimensionBase WeightApplicability
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
SeverityDimension PenaltyGrade & Rating Thresholds
CRITICAL-30 ptsA+ (95–100), A (90–94), A- (85–89)
HIGH-18 ptsB+ (80–84), B (75–79), B- (70–74)
MEDIUM-8 ptsC+ (65–69), C (60–64), C- (55–59)
LOW-3 ptsD (40–54), F (0–39)
INFO0 ptsGreen ≥ 80 · Amber 60–79 · Red < 60

Fail-Closed Invariants

  • No scanner receipt, no score credit: Missing or tampered deterministic scanner receipts hard-block publication (MISSING_SCANNER_RECEIPT / TAMPERED_OR_INVALID_RECEIPT).
  • LLM-only hypotheses cannot alter scores: Any AI-proposed finding without verified deterministic evidence and independent refutation is quarantined as unverified with 0 score impact.
  • Severity can never silently escalate: A refuter may confirm, refute, downgrade, or mark inconclusive, but attempting to raise severity fails closed immediately.
  • Honest coverage boundaries: Unavailable external scanners are recorded inside unverifiedAreas and embedded directly inside the Ed25519-signed proof payload so verifiers see exact scan scope.