Trail stores a history of operations rather than only snapshots. Each operation records who changed the workspace, which root it changed from and to, which paths changed, and which parent operations it follows.
The public Operation model contains:
change_id: stable operation identifier.kind: operation type such asInit,ManualRecord,WatchRecord,LanePatch,LaneRecord,LaneMerge,Merge, orGitExport.parents: parent operation IDs.before_rootandafter_root: root objects before and after the operation.branch: branch name.actor: human, agent, or system actor.session_id: optional durable lane session link.message: optional human-readable message.changes: file and line change summaries.created_at: timestamp.
Branches and lane branches point to refs. Refs point to operations and roots. A root describes the full worktree state at that point.
This lets Trail answer questions such as:
- What changed in this operation?
- Which operation introduced this line?
- Which branch root should be materialized?
- Is a lane branch merge-ready?
Trail can import from and export to Git, but it is not just a Git wrapper. It tracks stable file IDs, line IDs, lane sessions, messages, approvals, test/eval gates, trace events, and merge queue state.
- Operation model:
trail/src/model/domain/operations.rs - Ref storage:
trail/src/db/storage/refs.rs - Reports:
trail/src/model/reports/worktree.rs,trail/src/model/reports/merge.rs