Files
Aura/fieldtests/cycle-295-shell-boundary/sb_4_reproduce.rs
T
claude 9df217d868 fieldtest: shell-boundary — 4 examples, 6 findings
Downstream-consumer corpus for the #295 library surface: a standalone
workspace (path-deps, no aura-cli in the link graph — cargo tree
verified) exercising the four cycle axes as a World program would,
public interface only: a DefaultMemberRunner member run over real
GER40, a hand-authored campaign document through
aura_campaign::execute, the IC + registry deflation dispatch as
library calls, and load_family/reproduce round-trips. Run transcripts
committed beside the sources.

Findings routed separately: the family-id mismatch between the
registry enumeration and the reproduce keying (list-then-reproduce
dead-ends) to debug; the reproduce-API friction (no report on the
simple path; DataSource/pip re-specification the manifest already
holds, wrong pip silently DIVERGED) to a follow-up. Four working
confirmations, chief among them the cycle's acceptance claim: all
four axes compiled first-try from the public docs alone.

refs #295
2026-07-21 07:10:09 +02:00

84 lines
3.5 KiB
Rust

//! Axis 4 — project loading + bit-identical reproduction (C18/C1) as a library
//! consumer. Opens the default `Env`, discovers a persisted family in the run
//! registry (written by the sb_2_campaign fixture), inspects it via `load_family`,
//! and re-derives it via `reproduce_family`. Also probes `reproduce_family_in`,
//! the only variant that returns a programmatic `ReproduceReport`. No `aura`
//! binary; library crates only.
//!
//! Usage: `… --bin sb_4_reproduce [<family-id>]`
//! (omit the id to auto-pick the first family the registry holds).
use aura_ingest::default_data_server;
use aura_runner::family::DataSource;
use aura_runner::reproduce::{load_family, reproduce_family, reproduce_family_in};
use aura_runner::Env;
const SYMBOL: &str = "GER40";
const FROM_MS: i64 = 1_725_148_800_000;
const TO_MS: i64 = 1_727_740_800_000;
fn main() {
let env = Env::std();
let reg = env.registry();
println!("runs root: {}", env.runs_root().display());
// Discover a persisted family id (or take one from argv).
let arg_id = std::env::args().nth(1);
let family_id = match arg_id {
Some(id) => id,
None => {
let members = match reg.load_family_members() {
Ok(m) => m,
Err(e) => {
println!("could not read registry: {e:?}");
return;
}
};
match members.first() {
Some(rec) => rec.family.clone(),
None => {
println!("no persisted families — run the sb_2_campaign fixture first.");
return;
}
}
}
};
println!("reproducing family: {family_id}");
// 1. Inspect the persisted family programmatically.
match load_family(&reg, &family_id) {
Ok(fam) => println!(" load_family OK: kind={:?} members={}", fam.kind, fam.members.len()),
Err(e) => println!(" load_family failed: exit={} msg={}", e.exit_code, e.message),
}
// 2. The ergonomic path: reproduce_family(id, env) -> Result<(), RunnerError>.
// Auto-derives the data source from the stored manifest.
println!(" --- reproduce_family(id, env) ---");
match reproduce_family(&family_id, &env) {
Ok(()) => println!(" reproduce_family returned Ok(()) — bit-identical (no per-member detail returned)."),
Err(e) => println!(" reproduce_family failed: exit={} msg={}", e.exit_code, e.message),
}
// 3. The only variant that returns a ReproduceReport: reproduce_family_in,
// which forces the consumer to re-specify the DataSource (symbol/window/pip)
// that the family manifest already records. pip re-specified by hand here.
println!(" --- reproduce_family_in(reg, id, data, env) -> ReproduceReport ---");
let data = DataSource::Real {
server: default_data_server(),
symbol: SYMBOL.to_string(),
from_ms: Some(FROM_MS),
to_ms: Some(TO_MS),
pip: 1.0,
};
match reproduce_family_in(&reg, &family_id, &data, &env) {
Ok(report) => {
let n = report.outcomes.len();
let identical = report.outcomes.iter().filter(|(_, ok)| *ok).count();
println!(" ReproduceReport: {identical}/{n} members bit-identical");
for (member, ok) in &report.outcomes {
println!(" {} {member}", if *ok { "IDENTICAL" } else { "DIVERGED " });
}
}
Err(e) => println!(" reproduce_family_in failed: exit={} msg={}", e.exit_code, e.message),
}
}