Skip to content

feat: run catalog — registry tombstones, cross-project view picker, agent pids#42

Merged
lroolle merged 1 commit into
mainfrom
feat/run-catalog
Jul 16, 2026
Merged

feat: run catalog — registry tombstones, cross-project view picker, agent pids#42
lroolle merged 1 commit into
mainfrom
feat/run-catalog

Conversation

@lroolle

@lroolle lroolle commented Jul 16, 2026

Copy link
Copy Markdown
Member

First cut of ideas 7+8, on the design's preferred road: tombstones, not trace relocation — traces stay in-project, the registry remembers where they are.

Tombstones (the run catalog)

  • Capture runs stop deleting their <data-dir>/instances/<run-id>.json on exit: tombstone() stamps endedAt, stops the heartbeat, and leaves the entry as a catalog record (client, project path, absolute trace file, session id, time range).
  • view runs still unregister — a view is not a run.
  • Tombstones are never listed live, exempt from live GC (they'd always look abandoned), and prune after 30 days at register time.

Cross-project view picker

cctrace view with no target now appends recent runs elsewhere after the local trace list — project + client + trace + age, selectable by number. Every offer is re-stat'd first: a tombstone written in another container may name a path that doesn't resolve here; such runs simply don't list (never an error).

Listing order + pids

  • ps, the header switcher, and /api/instances sort project-first, newest within — registry scan order stops reading once several containers run concurrently.
  • Registry entries carry agentPid (the spawned claude/codex/grok child) beside cctrace's own pid: new AGENT column in ps, both pids in the switcher tooltip. Informational only — pids are namespace-local and never feed liveness (heartbeat+probe unchanged).

Not in this cut

The in-page trace library (browse/open traces inside the web UI) and the always-on hub port are follow-up — they need the serve-shaped server design settled first; the tombstone catalog this PR adds is the data layer both will read.

Smoke-tested: a tombstoned run in project A lists (and opens) from an empty project B's picker. 408 tests pass (4 new tombstone tests).

🤖 Generated with Claude Code

…gent pids

Ideas 7+8 first cut, taking the tombstone road (option b): traces stay
in-project, the registry remembers where they are. Capture runs no
longer delete their instance entry on exit — they tombstone it (endedAt
stamped, heartbeat stopped), leaving a catalog entry: client, project
path, ABSOLUTE trace file, session id, time range. view runs still
unregister (a view is not a run). Tombstones prune after 30 days, are
never listed live, and are exempt from live GC.

cctrace view's no-target picker now lists 'recent runs elsewhere' from
the catalog after the local traces — cross-project, re-stat'd before
offering (a path from another container that doesn't resolve here just
doesn't list, never errors), selectable by number.

User-facing listings (ps, the header switcher, /api/instances) sort
project-first then newest — registry scan order is arbitrary and reads
as noise once several containers run concurrently.

Registry entries also carry the traced client child's agentPid next to
cctrace's own pid: a new AGENT column in ps and both pids in the
switcher tooltip. Informational only — pids stay namespace-local and
never feed liveness (that stays heartbeat+probe).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lroolle
lroolle merged commit f68ed90 into main Jul 16, 2026
1 check passed
@lroolle
lroolle deleted the feat/run-catalog branch July 16, 2026 10:45
lroolle added a commit that referenced this pull request Jul 17, 2026
Release housekeeping for the #37-#42 feature train: CHANGELOG entries
for all six, landing-page drift fixes (tunnel-by-default scope replaced
the stale "intercepts ALL hosts" claim; exit snapshots are gone, view
--html is the story now, Codex/Grok join the title), and the npm
description aligned with the multi-client reality.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant