Expand description
Session traces for the self-feedback loop (ADR-015).
A session is the execution of one skill (or any caller that opts in
through the devboy trace CLI). Events land as JSON Lines at
<target>/.devboy/sessions/<YYYY-MM-DD>/<skill>/<session_id>/trace.jsonl,
and a sibling meta.json in the same per-session directory carries
session-level metadata. The <session_id> segment keeps concurrent
or repeated invocations of the same skill on the same day isolated
from each other (ADR-015 requires self-contained sessions).
The SessionTracer writer is intentionally small — it serialises
one event per line with no framing, no network I/O, and no reliance
on the host logging stack. The companion [devboy trace] CLI
subcommand family in devboy-cli lets shell-based skills write into
the same format.
The redaction pass in redact::sanitize strips values that match
known credential shapes and values of environment variables named
*_TOKEN / *_SECRET / *_KEY / *_PASSWORD / *_PASSPHRASE /
AUTHORIZATION / COOKIE before anything is written to disk.
Modules§
- redact
- Redaction of sensitive values before traces hit disk.
Structs§
- Session
Meta meta.json— written at session end and optionally touched during long sessions.- Session
Tracer - Appends events to a session’s
trace.jsonl. - Trace
Record - One line of
trace.jsonl.
Enums§
- Outcome
- Session outcome — recorded on
Endin both the event stream and the per-sessionmeta.json. - Phase
- Event phases. Kept small; readers must silently ignore unknown values.
- Trace
Target - Where to write session traces.
Functions§
- append_
event - Append one event to an existing session’s
trace.jsonl. - create_
session - Create the session directory, write the opening
startevent, and return the session id + session directory. The returned path is the value the user passed throughTraceTargetwith the<date>/<skill> /<session_id>suffix appended — it is not canonicalised, so a relativeTraceTarget::Custom(".traces")produces a relative path and an absolute target produces an absolute path. Callers pass both values back intoappend_eventandfinalise_sessionon subsequent CLI invocations. - finalise_
session - Write the final
endevent and refreshmeta.jsonwith the outcome + aggregated counts derived from the existing trace.