Skip to content

docs(legal): say that app.fctl.sh keeps the diffs of sessions' changes - #105

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/677-in-the-session-viewer-it-should-be-possi
Nov 5, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/677-in-the-session-viewer-it-should-be-possi

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The privacy policy now says that app.fctl.sh keeps the diff of each file a session's agent changed, as the agent last read it (at most 512 KB a file and 8 MB a session), and that diffs contain code: a newer diff replaces the one before, a file's goes once the agent's work no longer changes it, and deleting a project deletes them with its sessions.

This describes hyperstructure/fctl#386, which isn't merged yet: merge this once app.fctl.sh runs a release with that change, and bump updated to that day if it is later than today's.

fctl session


Note

Low risk. It only changes the wording of the privacy policy, though the policy is a legal document and has to match what app.fctl.sh really stores.

What it does. Adds to the privacy policy that app.fctl.sh keeps, for each file a session's agent changed, a diff of it (up to 512 KB a file and 8 MB a session), so the session's page can show the changes. It says the diffs contain your code and how a newer diff replaces an older one, and adds diffs to what is deleted with a project's sessions.

fctl review's first look at e1a84ca · 1 file, +9 −2 · Review agent settings

A session keeps the latest diff of each file its agent changed, up to
512 KB a file and 8 MB a session, for its page to show, and deletes them
with the session's project.
kalaspuff pushed a commit to hyperstructure/fctl that referenced this pull request Nov 5, 2026
…ge (#386)

## Summary

A file under Changes on a session's page now opens its diff in a dialog
over the page. The diff is highlighted by the file's language and
numbered as the file is, and the words that changed between a removed
line and the line that replaced it are marked. Lines go one below the
other or side by side (`s`), and wrap with `w` (by default on phones).
The session's other changed files sit beside the diff, grouped by
directory, and `j`/`k` steps through them. Languages come from Shiki,
chosen by the file's name, extension or `#!` line: Markdown, Python,
TypeScript, Rust, JavaScript, shell scripts, Dockerfiles, `.gitignore`
and `.dockerignore` (a small grammar of our own), `.env` and
`.env.example`, Terraform, TOML, JSON, lockfiles in JSON or TOML
(`Cargo.lock`, `package-lock.json`, `uv.lock`, others by their first
line), and the rest of Shiki's languages. The transcript's Edit,
MultiEdit and Write diffs are highlighted too, and numbered as the file
is when Claude Code's result carries hunks. Additions are now green
wherever the session viewer counts them (the rail's letters, bars and
totals, and the transcript's commit and tool lines), and in session
rows, so the numbers agree everywhere.

The diffs come from the sandbox. Each time fctl-agent reads the
repositories' state, it also reads each changed file's diff, gives the
file its diff's digest in the `git` event, and hands the diffs to its
host. The host sends SessionDO, over the session's uplink, the diffs it
doesn't have yet, ahead of the `git` event that lists them. SessionDO
keeps the latest diff of each file and serves them at `GET
/api/v1/sessions/{id}/diff`, which `fctl diff` prints as git does. Diffs
therefore still show after a session stops ([ADR
0074](docs/adr/0074-sessions-keep-their-changes-diffs-for-their-viewers.md)).
Along the way, Changes stops listing renamed files as `src/{old.rs =>
new.rs}` and quoted paths without their quotes, since numstat is now
read with NULs. fake-claude's replayed edits and writes now report
Claude Code's `structuredPatch` too.

Every protocol addition is optional. Hosts and agents from before keep
working, and the dialog says why a file from one of them has no diff.
Agents send diffs only to hosts that ask for them (`AgentConfig.diffs`).

Verified with unit tests in each layer: git output parsing, the agent
reading real repositories (renames, untracked and binary files), the
supervisor's frame order, the host's framing, and the web app's
renderer, dialog and rail. `cargo xtask check` passes. I also ran `cargo
xtask demo` end to end: every demo session's agent sent its diffs, the
API served them, and their digests matched the sessions' `git` events.
The screenshots come from that stack.

The privacy policy needs a matching change before app.fctl.sh runs this:
the draft below adds it. The demo's shooter (`xtask/demo/shoot.mjs
--features`) now also takes the diff view for fctl.sh's Sessions and
Review agents pages, which the second draft below puts there; it takes
the Review agents page's phone diff in place of that page's phone shot
of the same review.

## Screenshots

At 7bb9f38, from `cargo xtask demo`.

A file's diff over its session (milkfloat#97), dark:

![A changed Rust file's diff over the session page,
dark](https://app.fctl.sh/api/v1/published/Br9zyxFmfvSLTueEs9oDVgq3llX1xyQEDOKqndluhHx/pr-rust-dark.png)

Terraform in the light theme (infra#37):

![A changed Terraform file's diff,
light](https://app.fctl.sh/api/v1/published/Cu0eBwa9DWHamypXeUCiQx9kwBWfEFLUfhCNAXWlSrv/pr-terraform-light.png)

Side by side (`s`):

![The same kind of diff side by side,
dark](https://app.fctl.sh/api/v1/published/8YqxX4az01Lka04OMrWxGu1YbFe9Wfs5lExRK3jeaIY/pr-split-dark.png)

The transcript's edits, and Changes in the rail, before and after:

| Before | After |
|---|---|
| ![Before: an edit in the transcript, unhighlighted and unnumbered,
additions in
yellow](https://app.fctl.sh/api/v1/published/2Ml8DiIjnGy9S0jADqVgZ8YApeuZJkpetUmTBOT9Ipu/b-edit.png)
| ![After: the edit highlighted and numbered, additions in
green](https://app.fctl.sh/api/v1/published/VCBF5cXiBMW4AlvdH8HbUx8OsMuvHi6VG3wikCuFx55/d-edit.png)
|

On a phone, 390 px wide, the diff and its list of files:

| Diff | Files |
|---|---|
| ![A Python diff on a phone, lines
wrapped](https://app.fctl.sh/api/v1/published/f34D2y5AYZkjQcFfnWJ4jLjqzeGXFGTqDQpMEvntqM8/pr-phone-dark.png)
| ![The changed files on a phone, grouped by
directory](https://app.fctl.sh/api/v1/published/IVQs03HWrefhXo1KHE4FXxNVq5N5clIEg2JDLS7yGED/pr-phone-list-dark.png)
|

## Related

- hyperstructure/fctl-site#105
- hyperstructure/fctl-site#106

## Worth confirming

- **Decision:** The control plane now keeps code: the latest diff of
each changed file (at most 512 KB a file and 8 MB a session, deleted
with the session's project), so that diffs show for sessions that have
stopped. Asking the live sandbox instead would show nothing for most
sessions people read.
- **Decision:** The dialog links to the file on GitHub only while the
branch is pushed and its pull request isn't merged, since GitHub may
delete a merged branch.
- **Decision:** Additions are green in session rows on the project and
session lists too, not only in the session viewer, so the same numbers
have the same color everywhere.

[fctl session](https://app.fctl.sh/s/ses_01M6PAS5NQ948REQTXK0C18MGQ)

<!-- FCTL_REVIEW_SUMMARY -->
---

> [!NOTE]
> **Medium risk.** It adds a path from the sandbox agent through the
host to SessionDO that stores and serves file contents (diffs) for every
session, and changes how Changes are read from git, though every
protocol addition is optional.
>
> **What it does.** A changed file under Changes on a session page now
opens its diff in a dialog, highlighted by language, with word-level
marks, unified or side-by-side views and keyboard stepping between
files. fctl-agent reads each changed file's diff (at most 16 MB per
refresh), the host forwards new ones to SessionDO, which keeps the
latest per file (up to 512 KB a file and 8 MB a session) and serves them
at `GET /api/v1/sessions/{id}/diff`, which `fctl diff` prints. The
transcript's edit diffs are highlighted too and additions are green
throughout the viewer. The latest commit only adds diff shots to the
demo screenshot script for fctl.sh's feature pages.
>
> **Control plane stores code.** SessionDO now keeps the latest diff of
each changed file, and the privacy policy on fctl.sh needs a matching
change (fctl-site#105) before app.fctl.sh runs this.
>
> <sub>[fctl
review](https://app.fctl.sh/s/ses_01M6PM5VQJ305813XZ3KB9E76P)'s first
look at
[`3472659`](3472659)
· 55 files, +5948 −234 · [Review agent
settings](https://app.fctl.sh/p/fctl?tab=reviews)</sub>

<!-- /FCTL_REVIEW_SUMMARY -->

---------

Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
@kalaspuff
kalaspuff marked this pull request as ready for review November 5, 2026 20:29
@kalaspuff
kalaspuff merged commit e6a5cb4 into main Nov 5, 2026
6 checks passed
@kalaspuff
kalaspuff deleted the fctl/677-in-the-session-viewer-it-should-be-possi branch November 5, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant