Expand description
Cheap workspace environment-delta observability.
Long-horizon agents operate in a changing environment: files are written, processes mutate state, git trees move. The harness needs a fast way to detect that the environment drifted between turns so it can re-ground assumptions instead of trusting a stale picture.
WorkspaceSnapshot captures a lightweight fingerprint of every tracked
file (size + mtime + a short content hash of the head), and diff
computes added/changed/removed paths. Snapshots are cheap enough to take at
each turn boundary and to persist as a derived view.
Structs§
- File
Stat - A compact fingerprint of a single file.
- Snapshot
Delta - The difference between two workspace snapshots.
- Workspace
Snapshot - A point-in-time fingerprint of a workspace’s tracked files.
Functions§
- capture
- Capture a snapshot of
workspace, skipping VCS/ build/ cache directories. - diff
- Compute the delta from
oldtonew. - is_
drift - Whether the delta indicates meaningful environment drift.
- load_
json - Load a previously persisted snapshot.
- save_
json - Persist a snapshot as JSON (e.g. as a session derived view).
- snapshot_
path - Resolve the on-disk path for a session’s environment snapshot.