hpr_validate/lib.rs
1//! The validation harness: case files, oracle references, metrics and reports.
2//!
3//! [Accuracy][guide-accuracy] gives every validation result. [Checking a claim][guide-claim]
4//! traces a number to its source, its test and its validation.
5//!
6//! [guide-accuracy]: https://hpr.fusionspace.co/accuracy.html
7//! [guide-claim]: https://hpr.fusionspace.co/checking-a-claim.html
8//! [lessons]: https://github.com/nrdptel/fusionspace-eridanus/blob/main/docs/research/loft-lessons.md
9//! [validation]: https://github.com/nrdptel/fusionspace-eridanus/blob/main/docs/VALIDATION.md
10//! [adr-015]: https://github.com/nrdptel/fusionspace-eridanus/blob/main/docs/DECISIONS.md#adr-015-the-validation-harness-cases-references-tolerances-and-reports-2026-09-17
11//!
12//! A case ([`Case`]) is a TOML file under `validation/cases/`. It says what to fly, how, and which
13//! metrics to compare against which reference, each with its own tolerance. A reference
14//! ([`Reference`]) is a JSON file under `validation/fixtures/`, written by a generator script
15//! under `validation/oracles/`. It carries the oracle's name, the command that produced it and a
16//! source for every value. Running a case gives a [`Comparison`] per metric, and the run gives a
17//! [`Report`] in Markdown and JSON.
18//!
19//! Five [lessons from Loft][lessons], mistakes found in the project that came before hpr-sim,
20//! shape the rules:
21//!
22//! - An oracle's inputs come from the case file, never from hpr's own output.
23//! - A reference is never regenerated to make a comparison pass. It moves only when its generator
24//! runs, which is a separate, deliberate step.
25//! - Every reference value carries provenance, so no number is a hand-written "stored result".
26//! - The cases that must run are locked, so a suite that silently skips one fails instead of
27//! reporting green.
28//! - Every metric a case reports has a tolerance; nothing is "ungated".
29//!
30//! The method is in [the validation plan][validation], and the design in [the decision record on
31//! the validation harness][adr-015].
32
33#![allow(
34 clippy::disallowed_methods,
35 clippy::disallowed_types,
36 reason = "the validation harness reads case and reference files; it is not part of the pure core"
37)]
38
39pub mod case;
40pub mod census;
41pub mod committed;
42pub mod flight_metrics;
43pub mod metrics;
44pub mod report;
45pub mod rocketpy;
46pub mod run;
47pub mod summary;
48pub mod tip_off;
49
50pub use case::{Case, CaseLock, DragMode, Metric, Tolerance, committed_cases};
51pub use metrics::{Measured, Reference, ReferenceValue};
52pub use report::{Comparison, Gap, NotReproduced, Report, Source, Verdict};
53pub use run::{CaseRun, ValidateError, run_case, run_lock};
54
55pub mod correction;
56pub mod openrocket;
57pub mod predicted_first;
58pub mod public_predictions;
59pub mod real_flight;
60#[cfg(test)]
61mod tests;