# Scope the Changes panel to the latest agent turn \(\#81\) · lucenx/signaltty

[View on GitCafe](https://git.cafe/lucenx/signaltty/commit/77ed96a734a08ff5c7aa2e8d92f907fa9cce08e1)

Repository: [lucenx/signaltty](https://git.cafe/lucenx/signaltty)

Visibility: public

Requested revision: 77ed96a734a08ff5c7aa2e8d92f907fa9cce08e1

Requested commit: 77ed96a734a08ff5c7aa2e8d92f907fa9cce08e1

Commit: 77ed96a734a08ff5c7aa2e8d92f907fa9cce08e1

Tree: e141eb7ae9a99c4b9351366add11879507bab37d

Author: Simone

Committer: GitHub

## Message

```
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>
```

## Parents

- [43eef479915e1aa4c5f85a3dbc420f5d94944bdb](https://git.cafe/lucenx/signaltty/commit/43eef479915e1aa4c5f85a3dbc420f5d94944bdb?format=markdown)

[Source at this commit](https://git.cafe/lucenx/signaltty/tree/77ed96a734a08ff5c7aa2e8d92f907fa9cce08e1?format=markdown)
