feat(cli): C6 — up / down commands (spec 07/09) - #10
Merged
Conversation
Wire the orchestrate saga into the cobra tree, replacing the up/down stubs.
- `up [project...]` — reconcile, then BuildUp + Saga.Run: preflight → network →
generate → shared(health-gated) → compose-up → hooks. Plain mode streams one
line per phase as it completes (orchestrate.FormatPlain via the Emit hook);
--json emits the documented array ([{phase,status,durationMs,error,detail}]);
the exit code is non-zero iff a phase failed. Flags: --build, --no-hooks,
--no-preflight, --profile.
- `down [project...]` — run preDown hooks (warn-by-default), `compose down` each
project stack (never -v: volumes/DBs survive), drop its ref rows. The shared
network and shared containers are left alone (autostop is X1 config + spec 03).
- buildUpDeps assembles deps over the real Engine SDK client (up/down need a
daemon; the preflight phase reports an unreachable one clearly).
docker.Compose.base() now omits -f when File is empty so down/stop can run
label-driven by project name even if the generated compose file is absent.
orchestrate gains a NoPreflight option (--no-preflight).
Verified end-to-end against a real Engine 29.5.3 in an isolated XDG sandbox
(then fully torn down): `up` ensured the network, brought up shared-postgres
HEALTHY (the cross-project health gate), built+started the project stack, ran
postUp; a re-run skipped every satisfied phase; --json matched the contract;
`down` removed the project + dropped refs to 0 while leaving postgres running.
Unit tests cover registration + workspace-discovery errors; the daemon e2e in
CI lands with G1's isolation harness.
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Chunk C6 (M2-remainder) — the headline verbs
Wires the orchestrate saga into the cobra tree, replacing the
up/downstubs.What
up [project...]— reconcile, thenBuildUp+Saga.Run: preflight → network → generate → shared(health-gated) → compose-up → hooks. Plain mode streams one line per phase as it completes;--jsonemits the documented array[{phase,status,durationMs,error,detail}]; exit code non-zero iff a phase failed. Flags:--build,--no-hooks,--no-preflight,--profile.down [project...]— runpreDownhooks (warn-by-default),compose downeach project stack (never-v), drop its ref rows. The shared network + containers are left alone (autostop is X1 + spec 03).docker.Compose.base()omits-fwhenFileis empty →down/stopwork label-driven by project name. orchestrate gainsNoPreflight.Verified end-to-end (real Engine 29.5.3, isolated XDG sandbox, then torn down)
[skipped](resumability).--jsonmatched the spec contract (error:null,detail).downremoved the project + droppedshared-postgresrefs to 0 while leaving postgres running.Tests
Unit: command registration (real RunE, not stubs) + workspace-discovery errors. The daemon e2e in CI lands with G1's isolation harness.
Gate
make ci+make determinism+make smokegreen.🤖 Generated with Claude Code