//! The L3 stage grades a fabric-priced figure by its weakest input: with every //! member that ran priced by a calibrated figure (here a `Measured` row), the //! receipt says ModelBased — a calibrated per-operation model, never a reading. //! Its own test process, because the fabric is discovered once per process. mod common; use joule_code_receipt::Provenance; use jouleclaw_fabric::EnergyProvenance; #[test] fn a_call_priced_by_calibrated_figures_is_model_based() { let (energy, window) = common::resolve_priced_at("measured", Some(EnergyProvenance::Measured)); eprintln!("window: {window:?}\nenergy: {energy:?}"); assert!(!window.is_empty()); for e in &window { assert_eq!(e.projected_grade, Some(EnergyProvenance::Measured), "{e:?}"); } assert!(energy.estimated_uj > 0, "the projection is reported: {energy:?}"); assert_eq!((energy.provenance, energy.measured_uj), (Provenance::ModelBased, None), "{energy:?}"); assert!(energy.check_provenance().is_ok()); }