Function undo_run
pub fn undo_run(
run: &AgentRun,
by: Option<&str>,
authors: &AuthorDirectory,
open: &mut [(String, String, &mut AutoCommit)],
) -> RunUndoReportExpand description
Undo every step of a run, given the documents the caller could open.
open pairs a step’s (app, record) with the live document that owns it.
The caller assembles it, because only the caller knows which apps are running
here — and assembling it is also the pre-flight: any step of run with no
entry in open refuses the whole run, and nothing is written.
Each visited document is left with an open transaction. The caller commits per document, so each undo is stamped and attributed where it lands.