Repository navigation
Latch v0.2.0
Latch v0.2.0 makes the agent cache-aware and sandbox-first. Compared to
v0.1.1, provider-visible history is now append-only within durable cache
epochs, every command runs inside a mandatory bubblewrap sandbox,
mode/safety/permissions are orthogonal controls, and a running task can be
steered without weakening durable state.
Highlights
Prompt-cache locality: durable append-only cache epochs
- Replaced the sliding recent-context window with cache epochs: ordinary turns
only append, and already-sent messages are never front-evicted or rewritten. - Kernel context (canonical state, evidence and validation updates, failure and
re-ground updates, recall, archival index, extension context) is persisted as
durable snapshot/delta events instead of a regenerated synthetic tail, so
previous context never silently disappears and resume replays the exact
provider-visible history. - Rotation is hysteretic and whole-unit: it happens occasionally under
sustained pressure, retains a large working set (roughly three quarters of
the budget) plus growth headroom, never splits a tool transaction, and never
deletes raw history./compactremains the only explicit reset. - Canonical state stays authoritative while history stays provenance, with
explicit higher-revision supersession of old decisions, constraints, and
evidence. - The compiled system prompt is session-stable again: canonical task state no
longer churns the reusable prefix.
Cache observability
- Three distinct measurements replace the conflated "cache hit": estimated
architecture cacheability (common_prefix_tokens / request_tokens), provider
prefix utilization (cache_read_tokens / common_prefix_tokens), and the
actual provider-reported hit rate (hit / (hit + miss)). Provider usage stays
authoritative. - The sidebar exposes compact epoch diagnostics: generation, turns since
rotation, last rotation reason, and retained tokens. - Cached tokens are no longer double-charged, unknown provider cache categories
stay unknown instead of being fabricated as zero, and common-prefix
measurement stays on UTF-8 character boundaries.
Mandatory sandbox with orthogonal safety controls
- All command execution now goes through bubblewrap: there is no unsandboxed
fallback, and a failed startup probe refuses to run with an actionable
diagnostic. - Mode (ASK/PLAN/WORK), Safety (Strict/Standard/Autonomous), and Permissions
(human/AI/auto approval) are separate, composable controls with/safetyand
/permissionsselectors and durable resume. - Hard deny is independent of every profile and resolver; external writes,
network access, and Git metadata mutation become explicit, auditable asks. A
safety/sandbox regression matrix now covers the composition.
Live steering
- A running task can be steered from the TUI: messages are recorded durably as
normal user turns and consumed at safe model boundaries, never between an
assistant tool call and its results. - The handshake is atomic: an accepted message is consumed by the running turn
or rejected, never queued into a later run. Not-yet-started side-effecting
calls are superseded, and every tool call still receives exactly one terminal
result.
Reliability and long-horizon behavior
- Durable transitions fail closed: a live state change is never reported
successful before its event commits. - Incremental, indexed history access keeps long sessions fast without
weakening continuity; working memory decays gradually and the archival
episode index is built incrementally. read_filereturns a smaller token-aware window with continuation offsets;
undo survives resume, including whether a change created the file.- Failure signatures ignore elapsed timing, so unchanged failures still
accumulate toward re-ground instead of resetting the streak.
Architecture and CI
- The agent, tools, and TUI god-files are split into responsibility modules.
- CI is now a small architectural philosophy gate (fmt, clippy, and the
deterministictests/invariants.rstier); detailed and stress suites run
locally. Cache epochs are performance boundaries, not memory boundaries, and
cache locality never overrides long-horizon correctness.
Install
Download latch-v0.2.0-x86_64-unknown-linux-gnu.tar.gz below and verify it
with SHA256SUMS, or install from the repository:
cargo install --path crates/latch-cli --lockedRuntime prerequisites are bwrap (mandatory sandbox) and rg (search).
Validation
cargo test --workspaceis green across kernel, providers, sandbox,
continuity, TUI snapshots, and extensions.- 48-turn cache stress: 3 rotations with 94% high prefix reuse, versus 30% for
the old sliding window, while canonical truth, unresolved work, recall, and
the full raw event log are preserved.
Full Changelog: v0.1.1...v0.2.0