Skip to content

feat(cli): C6 — up / down commands (spec 07/09) - #10

Merged
gustavobertoi merged 1 commit into
mainfrom
nightly/C6
Jun 29, 2026
Merged

feat(cli): C6 — up / down commands (spec 07/09)#10
gustavobertoi merged 1 commit into
mainfrom
nightly/C6

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

Chunk C6 (M2-remainder) — the headline verbs

Wires the orchestrate saga into the cobra tree, replacing the up/down stubs.

What

  • 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; --json emits 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...] — run preDown hooks (warn-by-default), compose down each project stack (never -v), drop its ref rows. The shared network + containers are left alone (autostop is X1 + spec 03).
  • docker.Compose.base() omits -f when File is empty → down/stop work label-driven by project name. orchestrate gains NoPreflight.

Verified end-to-end (real Engine 29.5.3, isolated XDG sandbox, then torn down)

[ok]      preflight (8ms)
[ok]      network (38ms)
[ok]      generate
[ok]      shared            # devstack-shared-postgres-1 → Up (healthy)  ← cross-project health gate
[ok]      app/compose-up    # built + started devstack-app-web-1
[ok]      app/hooks
  • Re-run → every satisfied phase [skipped] (resumability).
  • --json matched the spec contract (error:null, detail).
  • down removed the project + dropped shared-postgres refs 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 smoke green.

🤖 Generated with Claude Code

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>
@gustavobertoi
gustavobertoi merged commit 855488f into main Jun 29, 2026
9 checks passed
@gustavobertoi
gustavobertoi deleted the nightly/C6 branch June 29, 2026 13:32
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