Stepfork stores traces as UTF-8 directory bundles with the .sftrace suffix.
The v0.1 layout is:
example.sftrace/
├── manifest.json
├── events.jsonl
├── redactions.json
└── integrity.json
integrity.json was added after the initial v0.1 storage work. Older bundles
without it remain loadable but are reported as unverified_legacy.
manifest.json contains bundle-level metadata:
format: alwaysstepforkschema_version: currently0.1run_idagent_namecreated_atstatus:running,completed, orfailedfailure: required for failed runsenvironmenttotals
events.jsonl stores one complete JSON event per non-blank line. Blank lines
are invalid. Event order is significant and preserved by Trace.load().
Supported event types:
run_startllm_requestllm_responsetool_calltool_resultstate_changeerrorrun_end
Events share structural fields such as id, run_id, parent_id, step,
timestamp, status, and replay_policy. Payload hashes are stored in
input_hash and output_hash where applicable.
input_hash and output_hash are SHA-256 digests over Stepfork's canonical
JSON profile after redaction has been applied. During replay, dependency
inputs are re-normalized, redacted, canonicalized, and compared against the
recording. For LLM requests this means prompt payload changes, model changes,
and provider changes are treated as replay divergence.
redactions.json stores non-secret metadata describing redactions:
{
"schema_version": "0.1",
"entries": [
{
"event_id": "evt_002",
"path": "/input/api_key",
"reason": "sensitive_key",
"replacement": "[REDACTED]"
}
]
}Paths use JSON Pointer escaping for ~ and /. Redaction metadata must never
store original secrets, reversible encodings, or hashes of secret values.
integrity.json stores SHA-256 digests of the exact persisted bytes of:
manifest.jsonevents.jsonlredactions.json
It does not include itself. This detects accidental modification and ordinary tampering when the expected integrity record is trusted. It is not a digital signature.
The schema version is currently 0.1. New readers should keep loading older
valid v0.1 bundles where possible. Missing integrity metadata means unverified
legacy, not verified. Older or hand-built events may also lack payload hashes;
they can still replay if their stored inputs exactly match the live calls, but
Stepfork reports computed fingerprints in diagnostics rather than silently
treating them as integrity-verified.