Skip to main content

Crate borg_trace

Crate borg_trace 

Source
Expand description

Canonical touch streams from agent transcripts.

Every harness (Claude Code, omp, later opencode) is reduced to the same sequence of Events. Phase 0 mines these for headroom; later the same parser drives offline counterfactual replay of borg’s recall policy.

Modules§

claude
Claude Code transcripts: ~/.claude/projects/<slug>/<session>.jsonl (sub-agents under <session>/subagents/).
dialogue
The conversation between engineer and drone, as the live hooks see it: the engineer’s prompts, the drone’s visible text, what its tool calls touched, and tool calls the engineer refused with words. The touch streams (claude::parse, omp::parse) drop all of this; replay evals of hook logic (the queen) need it.
fingerprint
Deterministic fingerprints: the same error seen by two drones (or two sessions weeks apart) must hash the same, regardless of line numbers, temp paths, ids or durations.
omp
omp (oh-my-pi) sessions: ~/.omp/agent/sessions/<slug>/<ts>_<id>.jsonl.
scars
Execution memory (layer 1): scars and protocols, learned deterministically from what a session did, at zero tokens.

Structs§

Event
Reasoning
Session

Enums§

Harness
Kind

Functions§

approx_tokens
Approximate token count of a JSON tool result.
jsonl_files
All *.jsonl files below root.
parse_ts
Parse an RFC 3339 UTC timestamp (2026-09-15T22:18:11.638Z) to epoch ms.
repo_key
Resolve the repository a session worked in: nearest ancestor with .git, with borg/claude worktree suffixes folded back onto their parent repo. Only a worktree itself folds: a repo of its own nested deeper inside a worktree (a test fixture, a sandbox HOME’s repos) keeps its own name.
result_text
Flatten a tool result into text (for error fingerprinting).