mirror of
https://github.com/bdbrown4/peltier.io.git
synced 2026-11-07 10:58:28 +00:00
Bootstrap hotpath from engineering spec v0.1
Commit the spec and scaffold the system it describes:
- SPEC.md: the full v0.1 engineering spec
- crates/: trust-layer Rust workspace, unit-tested
- bench-runner: interleaved ABAB scheduling with discarded warm-ups,
deterministic bootstrap CIs over the ratio of medians,
CI-lower-bound accept rule, env fingerprinting, and a CLI with
compare + A/A self-test modes (A/A verified passing end-to-end)
- diff-test: gate outcome model, sha256 corpus pin verifier that
refuses on mismatch, per-target equivalence policy parser
(byte-identical default, explicit fp-tolerance opt-in)
- ledger: append-only SQLite attempt schema with UPDATE/DELETE
refused by triggers, anti-double-attempt query
- report: cores-saved and dollars/yr ROI math over speedup CIs,
pricing.toml inputs
- playbook/: classes 1-7 with preconditions, procedure, verification
notes, and known failure modes per class
- agent/: Python package skeleton — six-tool contract and prompting
spine, harness IPC deferred to Phase 1
- config/: accept.toml (2% threshold, 30 runs/side), pricing.toml
- targets/, corpora/, results/calibration/: layout and policy docs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcKPWQ3MQD4NdEHwar96u2
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
//! Accept-threshold configuration, loaded from `config/accept.toml`.
|
||||
|
||||
use serde::Deserialize;
|
||||
use std::path::Path;
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct AcceptConfig {
|
||||
/// CI lower bound must clear 1 + threshold (default 2%).
|
||||
pub threshold: f64,
|
||||
/// Measured runs per side (SPEC minimum: 30).
|
||||
pub runs_per_side: usize,
|
||||
/// Unmeasured warm-up runs per side, discarded.
|
||||
pub warmup_runs: usize,
|
||||
/// Bootstrap resample count.
|
||||
pub bootstrap_iters: usize,
|
||||
/// Confidence level for the ratio CI, e.g. 0.95.
|
||||
pub confidence: f64,
|
||||
/// PRNG seed for the bootstrap (reproducible calibration).
|
||||
pub bootstrap_seed: u64,
|
||||
}
|
||||
|
||||
impl Default for AcceptConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
threshold: 0.02,
|
||||
runs_per_side: 30,
|
||||
warmup_runs: 3,
|
||||
bootstrap_iters: 10_000,
|
||||
confidence: 0.95,
|
||||
bootstrap_seed: 0x707E_17E5,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl AcceptConfig {
|
||||
pub fn load(path: &Path) -> anyhow::Result<Self> {
|
||||
let raw = std::fs::read_to_string(path)?;
|
||||
let cfg: Self = toml::from_str(&raw)?;
|
||||
anyhow::ensure!(cfg.runs_per_side >= 2, "runs_per_side must be >= 2");
|
||||
anyhow::ensure!(cfg.threshold > 0.0, "threshold must be positive");
|
||||
anyhow::ensure!(
|
||||
(0.0..1.0).contains(&cfg.confidence),
|
||||
"confidence must be in (0, 1)"
|
||||
);
|
||||
Ok(cfg)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user