Skip to main content

Module replay

Module replay 

Source
Expand description

The .replay failure artifact.

A failing run emits a self-contained, human-diffable JSON bundle — seed + full schedule trace + embedded source + input transcript + failure coordinate — that reproduces the execution byte-for-byte on any machine. Consumed by largo replay --verify, largo debug, the DAP adapter, and the Studio; a bundle committed under tests/replays/ is a permanent regression.

The bundle carries its OWN wire representation of scheduling choices (TraceChoice) rather than the runtime’s ChoicePoint, so the artifact format outlives internal enum shape.

Structs§

Cursor
The causal cursor (§0.4): (epoch, task, seq). Wave 1 stamps epoch (the count of recorded scheduling decisions at failure) and task; the per-task event seq starts moving when the observation channel lands (Wave 7).
Failure
Why this artifact exists: the reproduced-or-it-didn’t-happen record.
FailureSpan
The failing sentence’s source coordinates, when the failing tier carries spans.
ReplayBundle
The .replay bundle (constitution §0.5).
Schedule
The schedule: the seed alone regenerates the trace while the source is unchanged; the full trace makes drift detectable and carries explored schedules that no seed generates.
SourceSection
The embedded program: content hash + entry name + every source file, so the bundle opens anywhere, forever.
StdinRead
One recorded stdin read, cursor-stamped.
TraceChoice
One recorded scheduling decision (wire form of the runtime’s ChoicePoint).
Transcript
Everything that crossed the world boundary.

Enums§

FailureKind
Why the artifact exists. replay_lock.rs holds a no-wildcard corpus over every variant — adding a kind without a corpus entry fails the build there.
Verify
The verdict of re-executing a bundle.

Constants§

REPLAY_FORMAT
Bundle format version. Bumping it requires a decision-record amendment in the constitution and a new golden in replay_lock.rs.

Functions§

capture_failure
Run source (entry file named entry) under seed with args; if the run fails, capture the complete artifact. None when the program succeeds — recording costs nothing until the moment of failure (D0.4).
verify
Re-execute the bundle from its embedded source under its recorded seed and check the failure reproduces byte-identically. Drift is DETECTED and named, never silently misreplayed.