Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 3.24 KB

README.md

File metadata and controls

47 lines (30 loc) · 3.24 KB

DepRisk Benchmark & Calibration Kit

This directory contains the reproducible evaluation harness scripts and protocol for benchmarking DepRisk's baselines (B1 CVSS-only, B2 KEV/EPSS/CVSS, B3 naive/conservative reachability) against the seeded Monte Carlo risk model (deprisk bench) and fitting calibrated Reach parameters (deprisk bench calibrate, ADR 0017, ADR 0018).

Honesty rule: Benchmark numbers are never hand-written. Only untouched JSON files emitted by deprisk bench on a labeled dataset with "synthetic": false are reported as empirical results under benchmarks/results/.

1. Dataset manifest format

Every benchmark dataset is described by a JSON manifest validated against schemas/bench-manifest.v1.schema.json:

  • dataset.synthetic: must be false for real empirical datasets (true is reserved for test fixtures and triggers an explicit warning in every output).
  • signalsAsOf: ISO-8601 date of the EPSS/KEV/advisory snapshot.
  • outcomeWindow.from / outcomeWindow.to: strictly after signalsAsOf (enforced by DepRisk's temporal leakage guard; exit code 4 on leakage).
  • cases[]: pinned projects with split ("dev" or "test") and ground-truth exploitation/reachability labels.

2. One-command reproducible run

On Windows (PowerShell):

.\benchmarks\run-benchmark.ps1 -Manifest .\benchmarks\datasets\my-dataset.json -OutDir .\benchmarks\results\my-run

On Linux / macOS:

./benchmarks/run-benchmark.sh benchmarks/datasets/my-dataset.json benchmarks/results/my-run

The script performs three deterministic offline steps:

  1. Evaluates uncalibrated defaults on --split dev (bench-dev-uncalibrated.json).
  2. Fits the Beta posterior Reach parameters on --split dev (risk-params.calibrated.json) via deprisk bench calibrate.
  3. Evaluates the fitted parameters on the held-out --split test (bench-test-calibrated.json) so calibration is never judged on training data.

3. Included reproducible 4-language corpus (v1.5-curated)

A self-contained 4-language corpus (C#, JS/TS, Python, Java — 12 cases: 8 dev, 4 test) is included at datasets/v1.5-curated/manifest.json (ADR 0062). Its untouched outputs produced by deprisk bench and deprisk bench calibrate with the compiled deprisk-reach binary are committed under benchmarks/results/:

Because v1.5-curated is a self-contained micro-project corpus rather than longitudinal production telemetry, its manifest sets "synthetic": true so every output transparently states that it exercises the calibration pipeline rather than claiming real-world incidence rates.

4. Using calibrated parameters in CI gates

Once risk-params.calibrated.json has been evaluated on a held-out real ("synthetic": false) test split, it can be passed to deprisk ci --model risk --risk-params risk-params.calibrated.json --fail-on "risk-cvar95>=0.5" (ADR 0049). Uncalibrated placeholder defaults are always refused with exit code 4.