pub fn write_captured_record(
directory: &Path,
record: &CapturedRecord,
) -> Result<(), CaptureOrderError>Expand description
What:
Writes captured.json exclusively and whole, without syncing it.
Why:
A transaction directory holds one captured record,
and a second write means a bug, so the exclusive open refuses it.
A torn or lost record only costs a warning and subsumption in later replays (the tearing table in
doc/planning/cli-git-spawn-and-sync-reduction.md), so no flush is worth waiting for.
In TS you’d write (pseudocode):
await writeCapturedRecord({ directory, record });