Scope the Changes panel to the latest agent turn (#81)

* server: record turn baselines and serve turn-scoped diffs

When a pane starts a turn (agent.working not from blocked), snapshot the
workspace checkout into a tree through a private index copy and keep it
as the workspace's latest turn baseline. workspace.diff and
workspace.file_diff accept scope "turn" and compare that tree with a
fresh one, so work the agent committed during the turn stays visible.
A capture emits workspace.turn_started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* cli: add workspace diff --turn

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* gui: scope the Changes panel to the latest agent turn

An All / Turn toggle in the panel header switches between changes
against HEAD and changes since the latest turn started. The turn view
re-reads itself when its workspace starts or stops a turn, and says so
when no turn is recorded yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: record turn baselines (ADR-0029, spec 041)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* server: stage turn snapshots in a private temp directory

The private index lived at a predictable /tmp path that std::fs::copy opened with create+truncate, following symlinks, and kept the source index mode. Create a fresh 0700 directory per capture instead (mkdir never follows a symlink and fails on an existing path) and remove it on every path.

* server: reject a non-repo turn diff before any turn

workspace.diff with scope "turn" returned an empty turn:null summary for a workspace that is not a Git repo; docs/08-ipc.md promises BAD_PARAMS for a non-repo, as the HEAD scope does.

---------

Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Grok Bot <grok-bot@users.noreply.github.com>
77ed96a734Simone committed on 10/10/2026, 4:26:47 PM· committed by GitHubparent43eef47
20 files changedLine totals unavailable