feat(home-registry): Home Registry + dashboard Home picker#131
Merged
Conversation
Captures the grilled design for the Home Registry + dashboard home picker (#130): new CONTEXT.md glossary terms (Home, Home Registry, Active Home), a Home-aware Session Dashboard, and docs/adr/0008 recording the advisory, per-machine, gc-reconciled registry decision. Change-Id: I0dc1149392295870c53a17bd5bdfd5d1b98ee7c9 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Thomas Kosiewski <tk@coder.com>
…me picker
Persist every agent-tty Home (state root) that has hosted a Session in a
per-machine advisory registry, so the dashboard can switch Homes and `home
list` can enumerate them — comparable to `list` for Sessions.
- HomeRegistry store at ${XDG_STATE_HOME:-~/.local/state}/agent-tty/homes.json:
{path, lastSeenAt} entries, atomic temp+rename writes, independent of
AGENT_TTY_HOME. Auto-registered on `create` (advisory; never fails create).
- `home list [--all] [--json]` and `home forget <path>`: a read-only manifest
scan that never reconciles, prune-on-read, newest-first; counts derived live.
- Dashboard gains a full-screen Home picker (press H); browsing Homes never
reconciles, entering a Home reconciles exactly as the single-Home dashboard.
- gc becomes cross-Home by default — sweeps every registered Home and
deregisters emptied/gone ones; `--home`/`AGENT_TTY_HOME` scopes to one and
touches no registry. Never deletes a Home directory. New cross-Home result
shape (homes[] + aggregates). BACKWARD-INCOMPATIBLE: automation relying on
plain `gc` collecting only the default Home must now pass `--home`.
- CommandContext.explicitHome distinguishes a selected vs defaulted Home.
Per-machine / local-only boundary (reconcile uses local PIDs); cross-machine
shared Homes are unsupported and the machine-id guard is deferred (ADR 0008).
Implements #130.
Change-Id: I05a58990ffaeadcb9deebee37042a6f968c0000e
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: I1c5fac5f81d322c5277537f05b273e0b05c12609 Signed-off-by: Thomas Kosiewski <tk@coder.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Home Registry + dashboard Home picker so agent-tty can see across the many Homes (state roots) you run it in — the default
~/.agent-tty, throwawaymktemp -ddirs, and per-projectAGENT_TTY_HOMEoverrides — instead of only the single Home resolved for one invocation.Closes #130. Design captured in
CONTEXT.md(Home / Active Home / Home Registry terms) anddocs/adr/0008-home-registry-advisory-per-machine.md.What's new
${XDG_STATE_HOME:-~/.local/state}/agent-tty/homes.json({path, lastSeenAt}entries; counts derived live, never cached). Auto-registered the first time a Home hosts a Session (create); the write is advisory and never fails creation. Atomic temp+rename tolerates concurrent creates.home list [--all] [--json]— registered Homes (Active Homes by default;--alladds terminal-only), each row showing path, live active/total Session counts, and last-seen, newest-first.home forget <path>deregisters a Home without touching disk.Hfor a full-screen picker; select a Home to observe its Sessions and open a Live View. Browsing Homes is a read-only scan that never reconciles; entering a Home reconciles exactly as the single-Home dashboard does today. Opens on the launched/resolved Home (additive — nothing about today's behavior changes).gcis now cross-Home by default — sweeps every registered Home and deregisters emptied/deleted ones;--home/AGENT_TTY_HOMEscopes to a single Home and touches no registry. gc never deletes a Home directory (only Session directories + registry entries).Plain
agent-tty gcchanges from "collect the default Home" to "sweep all registered Homes", and its--jsonresult changes shape to{ dryRun, homes[], removedSessionCount, totalBytesFreed, deregisteredHomes }(per-Home outcomes live underhomes[]). Automation relying on the old behavior or the old flat shape must pass--homeand readhomes[]. Called out inCHANGELOG.md.Boundaries (ADR 0008)
Per-machine and local-only: reconcile/kill judge liveness with local PIDs and manifests carry no machine identity, so a Home shared across machines (e.g. NFS) is unsupported; a machine-id guard is deferred. This matches the Coder model (separate workspaces are separate machines, each with its own registry).
Testing
AGENT_TTY_HOME), the read-only scope scan (including a guard that a dead-hostrunningmanifest is not reconciled by listing),home list/home forgetenvelopes, cross-HomerunGcCommand(scoped vs sweep, deregister-on-empty),createauto-registration + advisory-failure tolerance, and golden-envelope contracts for the new/changed result shapes.gcsweep + deregistration (never deletes the Home dir).typecheck,oxlint,oxfmt --check, the full unit suite, andbuildpass locally. (Host-dependent integration/e2e run in CI.)Notes for reviewers
0008currently collides with the unpushedfeat/workflow-hero-demobranch's0008-carry-two-parallel-hero-demos— whichever merges second must renumber.🤖 Generated with Claude Code