Skip to main content

Module fork

Module fork 

Source
Expand description

Fork: a new Run whose in-window history is a byte-identical prefix of the mother sequence. Forking is not resurrection: the mother’s frozen state never changes, and the new RunId arrives from the caller — this module is pure. crates/runtime/spec/Fork.lean proves what a fork must hold (§8-2): the prefix is the mother’s first lines, and the cut never splits a wave.

prefix consumes VerifiedLedger, so replay and fork share one rebuilder; a branch’s conversation is rebuilt through the ledger index by inherited_indexed, because the ledger’s only writer asks for it and verified the ledger when it opened it.

Structs§

Inherited
What a new session inherits from the one it branched off: the conversation the mother had exchanged by a safe point.

Functions§

fork_draft
The run_forked draft for the city Ledger; the caller supplies the new run id, the room it lands in, and the clock reading.
inherited_indexed
Rebuilds the mother’s conversation from the ledger, through at_seq or through the nearest safe point before it.
prefix
The fork prefix: raw lines 0..=at_seq, byte-exact. Past the tail is E_INVALID_ARGS, never a silent clamp.