feat: add ataegina list --json (fleet view)#31
Merged
Conversation
Emit the registry as a JSON array — the shared slot shape per worktree (primary at index 0 first, then each registry entry) plus two list-only fields: `stale` (its directory is gone) and `live` (a coarse best-effort "a derived port is listening"; always false under a `none` port backend). This is the fleet view a supervising agent uses to see all its parallel workers at once. Human `list` output is unchanged. `list` becomes cmd_list; _ate_list_entry_json computes a slot for an arbitrary (index, path) from the repo's config (port bases, DB naming) rather than the current tree, reusing emit_db_json for the per-entry db object. This completes the five-part agent-native surface. Spec: docs/design/agent-native.md. Completion (bash+zsh), man page, README, CHANGELOG, and in-script --help updated. New hermetic suite tests/list_json.bats (10 tests): the array shape, per-worktree ports, stale (a removed worktree dir), live (fake `ss` on a derived port), per-worktree db naming, the single-primary case, human-output regression, arg validation, completion. Completion assertions across ports/status/list made robust to future group changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Compare repo_root (and the human list path) against git's resolved toplevel via a resolved() helper, not the raw mktemp path. On macOS CI $TMPDIR is /var -> /private/var (a symlink) which git rev-parse resolves, so the raw comparison failed on both macOS jobs (tests 1/2/3/7) while passing on Linux/Windows. Same class as the PR #27 fix; now applied to this file too. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
What & why
Fifth and final planned agent-native addition (
docs/design/agent-native.md). A supervising agent that spawns workers across worktrees needs to see the whole fleet in one structured call.list --jsonemits the registry as a JSON array — the shared slot shape per worktree (primary first) plusstaleandlive:[{"index":0,"repo_root":"…","frontend":{…},"backend":{…},"log_dir":"…","db":null,"stale":false,"live":false}, {"index":1,"repo_root":"…-wtA","frontend":{"port":5174,…},…,"stale":false,"live":true}]stale— the worktree directory is gone (runprune).live— coarse best-effort: any of its derived ports is listening (alwaysfalseunder anoneport backend).listoutput is unchanged._ate_list_entry_jsoncomputes a slot for an arbitrary(index, path)from the repo's config (port bases, DB naming) rather than the current tree, reusingemit_db_jsonfor each entry's db object.Discipline
docs/design/agent-native.md.tests/list_json.bats— 10 hermetic tests: array shape, per-worktree ports,stale(a removed worktree dir),live(fakesson a derived port), per-worktree db naming (unsuffixed primary +wtN), single-primary case, human-output regression, arg validation, completion. Completion assertions acrossports/status/listmade robust to future group changes.python -m json.tool.--help. Checksum regenerated. No new dependencies.Series
Completes #27 (
ports --json), #28 (up --wait), #29 (status --json), #30 (up --json).🤖 Generated with Claude Code