feat: add ataegina up --wait[=SECONDS] (readiness contract)#28
Merged
Conversation
Turn `up`'s best-effort readiness report into a contract an agent can gate on. With --wait, up blocks until every server it launched is accepting TCP connections (up to SECONDS, default 60 or ATE_UP_WAIT) and exits 75 if any is not ready by the deadline, so `ataegina up --wait && curl "$BACKEND_URL"` works with no hand-rolled poll loop and no race against a not-yet-bound port. Without the flag, up is unchanged (fire-and-forget, always exit 0). New ate_wait_ready is strict and terse (poll-until-listening-or-timeout); the rich crash-vs-slow diagnostic stays on the non-wait path. The up/restart dispatch now captures cmd_up's exit code explicitly and still runs the throttled version check. A non-integer --wait value is rejected up front (exit 2) — without that guard a bad value spins forever in the poll loop. Spec: docs/design/agent-native.md. Completion (bash+zsh), man page (+ the ATE_UP_WAIT env var), README, and CHANGELOG updated. New hermetic suite tests/up_wait.bats (10 tests): the not-ready path under ATE_PORT_TOOL=none, the ready path via a fake `ss` reporting the port LISTEN, --wait=0, scope none, ATE_UP_WAIT, arg validation, restart propagation, and completion. 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
Second of five agent-native additions (
docs/design/agent-native.md).upalready reported readiness (best-effort, always exit 0).--waitturns that into a contract:SECONDS(default60, orATE_UP_WAIT).75if any launched server isn't ready by the deadline;0when everything launched is ready (or nothing was launched).ataegina up --wait && curl "$BACKEND_URL/health"— no hand-rolled poll loop, no race against a not-yet-bound port.upis unchanged (fire-and-forget report).restart --waitpropagates the same exit code.A non-integer
--waitvalue is rejected up front (exit 2) — mutation testing showed that without the guard a bad value spins forever in the poll loop.Discipline
docs/design/agent-native.md.tests/up_wait.bats— 10 hermetic tests. Not-ready path underATE_PORT_TOOL=none(no lingering process); ready path via a fakessreporting the derived portLISTEN(no real socket);--wait=0,--scope none,ATE_UP_WAIT, arg validation (non-integer + negative),restartpropagation, completion.ready, exit 0), a real backend that never binds (→NOT ready, exit 75), and confirmedup --wait && …short-circuits on failure.set -euo pipefail, exit codes independently live-verified.ATE_UP_WAITin ENVIRONMENT), CHANGELOG, bash+zsh completion.🤖 Generated with Claude Code