Scanner Determinism Score Guide

Status: Stable (2025-11)
Owners: Scanner Guild · QA Guild · DevEx/CLI Guild · DevOps Guild

1. Goal

Quantify how repeatable a scanner release is by re-running scans under frozen conditions and reporting the ratio of bit-for-bit identical outputs. The determinism score lets customers and auditors confirm that Stella Ops scans are replayable and trustworthy.

2. Test harness overview (SCAN-DETER-186-009)

  1. Inputs: image digests, policy bundle SHA, feed snapshot SHA, scanner container digest, platform (linux/amd64 by default).
  2. Execution loop: run the scanner N times (default 10) with:
    • --fixed-clock <timestamp>
    • RNG_SEED=1337
    • SCANNER_MAX_CONCURRENCY=1
    • feeds/policy tarballs mounted read-only
    • --network=none, --cpuset-cpus=0, --memory=2G
  3. Canonicalisation: normalise JSON outputs (SBOM, VEX, findings, logs) using the same serializer as production (StellaOps.Scanner.Replay helpers).
  4. Hashing: compute SHA-256 for each canonical artefact per run.
  5. Score calculation: identical_runs / total_runs (per image and overall). A run is “identical” if all artefact hashes match the baseline (run 1).

The harness persists the full run set under CAS, allowing regression tests and Offline kit inclusion.

3. determinism.json schema (SCAN-DETER-186-010)

Required fields:

Output bundle layout:

4. CI integration (DEVOPS-SCAN-90-004)

5. CLI support (CLI-DETER-70-003/004)

6. Policy & UI consumption

7. Evidence & replay

Replay instructions (deterministic, offline-friendly):

  1. Fetch a published determinism bundle (determinism.json + run_*) and the corresponding scanner image.
  2. Run scripts/scanner/determinism-run.sh --replay --bundle path/to/bundle --image sha256:... (uses fixed clock/seed).
  3. Verify hashes match the recorded artifact_hashes; tool exits non-zero on mismatch.
  4. Attach the bundle to Evidence Locker with DSSE signature before export.

8. Implementation checklist

AreaTask IDNotes
HarnessSCAN-DETER-186-009Deterministic execution + hashing
ArtefactsSCAN-DETER-186-010Publish JSON, CAS storage
CLICLI-DETER-70-003/004Local runs + reporting
DevOpsDEVOPS-SCAN-90-004CI enforcement
DocsDOCS-DETER-70-002(this document)

Update this guide with links to code once tasks move to DONE.