Expand description
Typed schemas for the on-disk session formats.
The loaders in crate::session used to pluck fields out of untyped
serde_json::Values, which meant anything we didn’t explicitly look for was
silently lost — and invisible. These modules give each format a typed
representation instead, with two deliberate escape hatches that turn “what
are we missing?” into a mechanical question:
- every discriminated enum has a
#[serde(other)]Unknownvariant, so an unmodeled record/block/payload type deserializes into a named bucket instead of erroring or vanishing; and - every record struct carries a flattened
extra: ExtraFieldsmap, so an unmodeled field is captured rather than dropped.
The crate::audit module walks a corpus, deserializes into these types,
and reports every Unknown and every non-empty extra — an evidence-based
map of exactly where our coverage ends.
Modules§
- claude_
code - Typed schema for Claude Code transcript JSONL
(
~/.claude/projects/<encoded-cwd>/<id>.jsonl). - codex
- Typed schema for Codex rollout JSONL (
~/.codex/sessions/.../rollout-*.jsonl).
Enums§
- Content
Block - A content block that may carry text, used by both formats’ message bodies.
Unknown block types are preserved by tag in
ContentBlock::Unknown.
Functions§
- raw_
block_ tag - Recover the
typediscriminant of an arbitrary JSON content block, even one that deserialized asContentBlock::Unknown— used by the audit to name the unknown.
Type Aliases§
- Extra
Fields - Catch-all for object fields a struct does not explicitly model.