Skip to content

Detachment milestone 1: graff agents + attach, for deliberately-backgrounded sessions only #431

Description

@justrach

The narrowest useful slice of #420, and the only one until it earns trust: the default REPL stays exactly as it is (see the P1 out-of-the-box invariant issue); detachment exists only for sessions the user deliberately backgrounds.

Surface: graff agents (list background sessions), graff attach <name> (connect a TUI), a way to start detached or detach a running session. Nothing else — no auto-daemonization, no client-owned workers, no update coordination.

Build on what exists: serve already supervises <exe> --json children with a seq-stamped EventLog, gap-free ?from=N replay, and Follower tailing (serve.zig, serve_events.zig); the #422 contract carries {generation, sequence} cursors for exactly this. Milestone 1 is a local supervisor on a unix socket (0600, per-uid dir) routing the same wire.

Prime-agent patterns — adopt only where earned (from the 2026-08-06 deep-dive):

Acceptance: the attach-parity eval — the same scripted session run in-process and attached must produce a byte-identical rendered transcript — plus a delta-to-paint p99 benchmark showing no regression on the in-process default, both wired into the harness. Kill the supervisor mid-session: the worker survives and a reattach replays without gaps. graff doctor never kills a live session's worker.

Depends on: output inversion completion, input inversion, #413. Bound by the P1 invariant issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions