gleamunison/transcript_json
Audit tape reader: the from_json half of the transcript serialization contract. transcript.gleam owns capture/playback and the writer (to_json); this module owns parsing tape files back into Tape values. Split so both halves stay under the LOC ceiling and each has one job: JSON text in, all-or-nothing Tape out.
The writer escapes via json.json_quote, so this reader understands every escape the JSON boundary can emit — \r, \t, and C0 controls as \uXXXX — and stays lenient about raw control characters: legacy audit files written before the escaper fix contain them, and a tape that loads is a tape that can replay.
Values
pub fn from_json(text: String) -> Result(transcript.Tape, String)
Parse a tape file. Entry fields decode as strings; a malformed payload is an Error, never a partial tape. When every entry carries v2 base64 blobs, the raw values are rebuilt and the tape replays for real; otherwise it loads audit-only (all-or-nothing: a half-raw tape is a lie about which run it records).