Expand description
keel record — capture effects during a run, then turn the capture into
an offline replay fixture + generated test glue (dx-spec §6 standing
structure item 5; docs/recording-format.md).
Subcommands:
keel record run <script> [args…]— exactlykeel run <script> [args…](same dispatch viarun::plan/[run::exec_with], same exit-code passthrough), plusKEEL_RECORD=<fresh path>in the child’s environment. The front end (not this binary) does the actual capture — seepython/keel/src/keel/_record.py,node/keel/src/record.mjs.keel record list— recordings under.keel/recordings/, newest first.keel record test <recording> [--out DIR]— generate a pytest fixture (Python recording) ornode:testfile (Node recording) from a completed recording.
Non-contract end to end: the .ndjson line format lives entirely in the
front ends and is versioned but outside contracts/ — this module only
reads/writes plain files under .keel/recordings/, never contracts/.
Constants§
- RECORDINGS_
SUBDIR - The subdirectory of
.keel/holding recordings (mirrorskeel-core::events::EVENTS_SUBDIR’s convention for non-contract, per-run tooling data). - RECORDING_
EXT - File extension of a recording (newline-delimited JSON).
Functions§
- list
keel record listforproject: one row per.keel/recordings/*.ndjsonfile, newest first. A file that isn’t a readable Keel recording (nometaheader) is skipped rather than failing the whole listing — best-effort, likekeel tail’s NDJSON line hygiene.- run
keel record run <target> [args…]: plan the dispatch exactly likekeel run, then exec withKEEL_RECORDset to a fresh path under.keel/recordings/so the front end tees every intercepted call into it. Otherwise byte-identical tokeel run— recording is a pure observer (docs/recording-format.md).- test_
gen keel record test <recording> [--out DIR]: read the recording’smetaheader to learn its language, then write one ready-to-run generated test file next to it (or underout_dir).