A complete synthetic workflow
The source distribution includes a runnable Rust example that ties the primitives together. It creates a frozen release question, records a 30% prior, updates from an attributable readiness signal, reports a likelihood-ratio envelope, and supplies a synthetic yes outcome.
//! Synthetic workflow: these inputs are illustrative, not measured evidence.
use supercast::{Probability as P, Result, bayes, decompose::Indicator, workflow::*};
fn main() -> Result<()> {
let question = Question {
id: "synthetic-launch-001".into(),
version: 1,
proposition: "Will release X be generally available before the frozen deadline?".into(),
opens_at: 1_800_000_000,
deadline: 1_810_000_000,
resolve_after: 1_810_086_400,
yes_rule: "Official archive records general availability strictly before deadline".into(),
no_rule: "Complete official archive establishes no qualifying release by deadline".into(),
void_rule: "Release identity becomes undefined or archive permanently inaccessible".into(),
resolution_sources: vec!["official release archive".into()],
};
let mut ledger = Ledger::new(question)?;
let prior = P::new(12.0 / 40.0)?;
ledger.append(Forecast {
id: "f1".into(),
as_of: 1_800_000_000,
evidence_cutoff: 1_800_000_000,
probability: prior,
previous_id: None,
change: Change::Initial,
method: "empirical reference class".into(),
rationale: "12 of 40 comparable attempts succeeded".into(),
assumptions: vec!["Supplied cases are comparable".into()],
next_review_trigger: "independent readiness signal".into(),
evidence: vec![],
})?;
let evidence = Evidence {
id: "readiness-1".into(),
origin_id: "original-test-1".into(),
locator: "supplied:synthetic-readiness-test".into(),
claim: "Independent readiness test passed".into(),
published_at: 1_800_001_000,
observed_at: Some(1_800_000_900),
};
let mut updates = UpdateSession::new(prior, 1_800_001_000, &[])?;
let posterior = updates.apply(&evidence, P::new(0.8)?, P::new(0.2)?)?;
ledger.append(Forecast {
id: "f2".into(),
as_of: 1_800_001_000,
evidence_cutoff: 1_800_001_000,
probability: posterior,
previous_id: Some("f1".into()),
change: Change::Evidence,
method: "Bayesian likelihood update".into(),
rationale: "Readiness test is more likely for on-time releases".into(),
assumptions: vec!["Likelihoods 0.8 and 0.2 are illustrative judgments".into()],
next_review_trigger: "independently verified dependency completion".into(),
evidence: vec![evidence],
})?;
let (low, high) = bayes::sensitivity(prior, 2.0, 6.0)?;
let indicator = Indicator {
chance: P::new(0.5)?,
if_yes: P::new(0.8)?,
if_no: P::new(0.3)?,
};
println!(
"Synthetic forecast: {:.2}% -> {:.2}%",
100.0 * prior.get(),
100.0 * posterior.get()
);
println!(
"LR 2..6 assumption envelope: {:.2}%..{:.2}%",
100.0 * low.get(),
100.0 * high.get()
);
println!(
"Candidate indicator's separate model: prior {:.2}%, information {:.4} nats",
100.0 * indicator.implied_prior().get(),
indicator.information_gain()
);
ledger.resolve(Resolution {
at: 1_810_086_400,
source: "official release archive".into(),
rationale: "Synthetic archive confirms qualifying release".into(),
outcome: Outcome::Yes,
})?;
println!(
"Resolved yes; final Brier: {:.6}",
supercast::score::brier(posterior, true)
);
println!("Preserved {} forecast revisions", ledger.forecasts().len());
Ok(())
}
extern crate supercast;
The final posterior is approximately 63.16%, and the one-component Brier score after yes is approximately 0.135734. The 30% prior alone would score 0.49 for that outcome. This one synthetic case demonstrates arithmetic and workflow behavior; it says nothing about real forecasting advantage.
What is auditable
The initial forecast remains in the ledger. The revision points to it, carries a later as-of time and evidence cutoff, identifies the new observation’s origin, and records the modeling assumptions. The resolution names a source frozen in the question contract.
The candidate indicator shown near the end uses a separate hypothetical model. Its implied prior is 55%; it is not quietly substituted for the release forecast. A real use of that indicator would first reconcile its branches with the current forecast.
Run the durable version
The JSON fixture examples/agent-workflow.jsonl contains seven requests: question creation, initial forecast, Bayesian revision, sensitivity, resolution, evaluation, and ledger retrieval. The Python demonstration sends them through the actual process using a temporary database.
It then starts a new process, repeats the Bayesian request with the same ID, and reads the ledger. Both the original receipt and the full history must match. This covers an operational failure mode that a standalone arithmetic example cannot: retrying a committed write after the caller loses its response.
The Engineering Reference documents those operations individually, with setup requests and outputs produced by executing the examples. Use that reference when adapting this workflow to an agent tool loop.