feat: add ataegina up --json (one-shot slot + readiness)#30
Merged
Conversation
After starting the resolved scope, print one machine-readable JSON line on stdout — the ports --json slot shape plus `started` (the surfaces this invocation launched) and a per-surface `ready` boolean — so an agent learns the slot and readiness in a single call instead of running up then ports. All human log/hook output is routed to stderr (fd 3 swap) so stdout stays pure JSON. `ready` honors --wait's polling: with --wait it reflects the wait outcome (and the exit code still follows --wait: 0, or 75 on a not-ready deadline); a plain --json does a single immediate check and stays exit 0 (fire-and-forget). `restart --json` also works — its stop-phase chatter is routed to stderr (fd 4 swap) so stdout is a single JSON line. The readiness section is unified (strict ate_wait_ready path for --json/--wait, best-effort ate_report_ready otherwise) with the plain-`up` behavior unchanged. Spec: docs/design/agent-native.md. Completion (bash+zsh), man page, README, CHANGELOG, and in-script --help updated. New hermetic suite tests/up_json.bats (10 tests) proves stdout purity (stdout/stderr captured separately, no bats 1.5 dependency), started/ready for backend|both|none, ready=true via a fake `ss`, the --wait 75/ready-false path, db object, and restart --json purity. 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
Fourth of five agent-native additions (
docs/design/agent-native.md). Closes the "runup, then separately runportsto learn the slot" round-trip:up --jsonprints one JSON line — theports --jsonslot shape plusstarted(surfaces launched) and a per-surfaceready:{"index":0,"repo_root":"…","frontend":{"port":5173,"url":"…"},"backend":{"port":8000,"url":"…"},"log_dir":"…","db":null,"started":["backend"],"ready":{"backend":true}}readyhonors--wait: with--waitit reflects the wait outcome and the exit code follows--wait(0, or75on a not-ready deadline); a plain--jsondoes a single immediate check and stays exit 0 (fire-and-forget).restart --jsonworks too — its stop-phase chatter is routed to stderr (fd-4 swap) so stdout is a single JSON line.ate_wait_readyfor--json/--wait, best-effortate_report_readyotherwise); plainupbehavior is unchanged.Discipline
docs/design/agent-native.md.tests/up_json.bats— 10 hermetic tests. Stdout purity proven by capturing stdout/stderr into separate vars (norun --separate-stderr, so no bats-1.5 dependency across CI runners);started/readyfor backend/both/none;ready=truevia a fakess; the--wait75 + ready-false path; db object;restart --jsonpurity.up --wait --jsongivesready:{backend:true}exit 0; never-binds →--wait=1 --jsonexit 75ready:false;restart --jsonemits a single clean JSON line.--help. Checksum regenerated. No new dependencies.🤖 Generated with Claude Code