Files
peltier.io/justfile
T
Claude 0d29d51f72 gates: diff-test orchestration — corpus pin + tests + golden per target
Adds the diff-test CLI ('just gates <target>'): loads
targets/<name>/target.toml (new [corpus] section: manifest, root,
golden_sha256; commands now repo-root-relative), verifies the corpus
manifest FIRST and refuses to run any gate on mismatch, then runs the
upstream test suite and golden replay (stdout sha256 vs pinned hash).
Differential fuzz and sanitizers remain per-attempt manual steps in
Phase 1 and are reported as skipped-with-reason; all-skipped is not a
pass.

Verified end-to-end on both vendored targets (comrak: 1 pinned file,
848 tests, golden PASS; tokei: 545 pinned files, 250 tests, golden
PASS) and the refusal path (tampered corpus -> 'HASH MISMATCH ...
refusing to run' before any gate executes).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcKPWQ3MQD4NdEHwar96u2
2026-07-06 23:30:40 +00:00

41 lines
1.4 KiB
Makefile

# hotpath task runner. `just --list` for a summary.
# Build the trust-layer workspace
build:
cargo build --workspace
# Run all trust-layer unit tests
test:
cargo test --workspace
# Lint: warnings are errors in the trust layer
lint:
cargo clippy --workspace --all-targets -- -D warnings
cargo fmt --all --check
# A/A self-test of the bench harness against a sample command.
# Must print a null verdict; an "accept" is a calibration failure.
aa cmd="sleep 0.05":
cargo run -p bench-runner -- --config config/accept.toml aa --cmd "{{cmd}}"
# Interleaved A/B comparison of two shell commands
compare baseline candidate:
cargo run -p bench-runner -- --config config/accept.toml compare \
--baseline "{{baseline}}" --candidate "{{candidate}}"
# Verify a target corpus against its pinned manifest
# (wired through diff-test CLI once it exists; manual check for now)
pin-check target:
cd corpora/{{target}} && sh gen-corpus.sh
# Automated calibration: N A/A sessions (<5% false-positive required) +
# N injected-slowdown sessions (>=95% detection required), JSON evidence
calibrate cmd out sessions="20":
cargo run -p bench-runner -- --config config/accept.toml calibrate \
--cmd "{{cmd}}" --sessions {{sessions}} --out "{{out}}"
# Equivalence gates for a target: corpus pin (refuses on mismatch) ->
# upstream tests -> golden replay. Fuzz/sanitizers stay per-attempt.
gates target:
cargo run -p diff-test -- {{target}}