pub struct Runner;Expand description
The runner: executes a sealed FlowIR against an open provider
session, journaling every transition into the single-writer store.
Entry signatures accept only FlowIR, never strings (principles 1/2).
Implementations§
Source§impl Runner
impl Runner
Sourcepub async fn run(
flow: &FlowIR,
params: Value,
session: Box<dyn ProviderSession>,
store: &mut Store,
opts: RunOptions,
) -> Result<RunOutcome, RunnerError>
pub async fn run( flow: &FlowIR, params: Value, session: Box<dyn ProviderSession>, store: &mut Store, opts: RunOptions, ) -> Result<RunOutcome, RunnerError>
Runs a flow from the beginning (spine §6.2 pipeline; §6.1 event
vocabulary). This segment’s supervisePolicy is recorded verbatim
in runStarted — explicitly null when unsupervised (R13,
per-segment self-describing ledger).
Sourcepub async fn resume(
new_flow: &FlowIR,
run_id: &str,
session: Box<dyn ProviderSession>,
store: &mut Store,
opts: ResumeOptions,
) -> Result<RunOutcome, RunnerError>
pub async fn resume( new_flow: &FlowIR, run_id: &str, session: Box<dyn ProviderSession>, store: &mut Store, opts: ResumeOptions, ) -> Result<RunOutcome, RunnerError>
Resumes a run (07 §4) without subflows. Legality ⟺ (A) every
completed record is still recognized under the (possibly repaired)
new IR — recorded as alignmentReport in runResumed; (B) a
pending intent on the frontier has been reconciled
(ProviderSession::reconcile); (C) the world passes the resume
probes — the first to-execute step’s declared preflight runs
before its act; a step without probes resumes honestly unprobed
(I3).
Sourcepub async fn resume_with_subflows(
new_flow: &FlowIR,
subflows: &BTreeMap<Hash, FlowIR>,
run_id: &str,
session: Box<dyn ProviderSession>,
store: &mut Store,
opts: ResumeOptions,
) -> Result<RunOutcome, RunnerError>
pub async fn resume_with_subflows( new_flow: &FlowIR, subflows: &BTreeMap<Hash, FlowIR>, run_id: &str, session: Box<dyn ProviderSession>, store: &mut Store, opts: ResumeOptions, ) -> Result<RunOutcome, RunnerError>
Runner::resume with a resolved subflow registry — required when
the (new) flow pins callees; see RunOptions::subflows.
Sourcepub async fn align_preview(
new_flow: &FlowIR,
subflows: &BTreeMap<Hash, FlowIR>,
run_id: &str,
store: &Store,
platform: Option<&str>,
vision: Option<&dyn VisionVerifier>,
forced: &[String],
old_flow_ir: Option<&FlowIR>,
) -> Result<AlignmentReport, RunnerError>
pub async fn align_preview( new_flow: &FlowIR, subflows: &BTreeMap<Hash, FlowIR>, run_id: &str, store: &Store, platform: Option<&str>, vision: Option<&dyn VisionVerifier>, forced: &[String], old_flow_ir: Option<&FlowIR>, ) -> Result<AlignmentReport, RunnerError>
The READ-ONLY alignment preview (08 §2.7): the resume path’s
classification verbatim — same-IR trivial adoption or the flat
cross-IR align — but no session, no attestation, no writes, no
commitment. The preview is not a promise: the world can drift
between preview and resume; the resume-time preflight probes stay
the final judge. A confirmation-gated alignment is a preview
RESULT here (the report shows what the real resume would refuse),
not an error.