feat(orchestrator): slice 13c(vi) — consolidated launch sequence (composition) #376

Closed
didericis-claude wants to merge 1 commits from orchestrator-consolidated-launch into orchestrator-gateway-provision
Collaborator

Sub-slice of slice 13c — the top-level composition that ties the primitives together.

launch_consolidated(egress_plan, git_gate_plan)

  1. ensure the orchestrator control plane + shared gateway are up (13a);
  2. read the gateway network's subnet + the gateway's own address, then allocate the bottle a pinned source IP (13c-ii), skipping the gateway + every live bottle;
  3. register it — egress policy blob + slug metadata (13b, 13c-iii) → bottle id + identity token;
  4. provision its git-gate repos/creds into the running gateway (13c-v).

Returns a LaunchContext (bottle_id, identity_token, source_ip, network, gateway_ip, orchestrator_url) — everything the agent container needs to attach. Rolls the registration back if provisioning fails, so a partial launch leaves no orphan.

teardown_consolidated(bottle_id) deregisters + deprovisions (idempotent).

The agent docker run itself stays the backend's job (provider provisioning) — this owns the orchestrator-facing wiring so the sequence is unit-testable: collaborators mocked, next_free_ip + registration_inputs run for real (IP allocation + the policy blob asserted end to end, including the rollback path).

Verification

pyright 0 errors, pylint 9.83/10 (new files 10.00), unit suite green (1755 tests; the 13 test_sidecar_init /bin/sleep errors are pre-existing NixOS-local noise).

Stacked on #375.

🤖 Generated with Claude Code

Sub-slice of **slice 13c** — the top-level composition that ties the primitives together. ### `launch_consolidated(egress_plan, git_gate_plan)` 1. ensure the orchestrator control plane + shared gateway are up (13a); 2. read the gateway network's subnet + the gateway's own address, then **allocate the bottle a pinned source IP** (13c-ii), skipping the gateway + every live bottle; 3. **register** it — egress policy blob + slug metadata (13b, 13c-iii) → bottle id + identity token; 4. **provision** its git-gate repos/creds into the running gateway (13c-v). Returns a `LaunchContext` (bottle_id, identity_token, source_ip, network, gateway_ip, orchestrator_url) — everything the agent container needs to attach. **Rolls the registration back** if provisioning fails, so a partial launch leaves no orphan. `teardown_consolidated(bottle_id)` deregisters + deprovisions (idempotent). The agent `docker run` itself stays the **backend's** job (provider provisioning) — this owns the orchestrator-facing wiring so the sequence is unit-testable: collaborators mocked, `next_free_ip` + `registration_inputs` run for real (IP allocation + the policy blob asserted end to end, including the rollback path). ### Verification pyright **0 errors**, pylint **9.83/10** (new files 10.00), unit suite green (1755 tests; the 13 `test_sidecar_init` `/bin/sleep` errors are pre-existing NixOS-local noise). Stacked on #375. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
didericis-claude added 1 commit 2026-07-13 22:03:23 -04:00
feat(orchestrator): slice 13c(vi) — consolidated launch sequence (composition)
test / unit (pull_request) Successful in 1m3s
test / integration (pull_request) Successful in 21s
test / coverage (pull_request) Successful in 1m12s
lint / lint (push) Successful in 2m5s
9896986810
Composes the orchestrator primitives into the register/teardown sequence
that replaces the per-bottle bundle:

  launch_consolidated(egress_plan, git_gate_plan): ensure orchestrator +
    gateway up -> read the gateway network's subnet + the gateway's own
    address -> allocate the bottle a pinned source IP (skip the gateway +
    live bottles) -> register (egress policy blob + slug metadata) ->
    provision its git-gate repos/creds into the gateway. Returns a
    LaunchContext (bottle_id, identity_token, source_ip, network, gateway_ip,
    orchestrator_url) — everything the agent container needs to attach.
    Rolls the registration back if provisioning fails, so no orphan.

  teardown_consolidated(bottle_id): deregister + deprovision (idempotent).

The agent `docker run` itself stays the backend's job (provider
provisioning); this owns the orchestrator-facing wiring so the sequence is
unit-testable — collaborators mocked, next_free_ip + registration_inputs run
for real (IP allocation + policy blob asserted end to end).

pyright 0 errors; pylint 9.83/10; unit suite green (1755 tests; the 13
test_sidecar_init /bin/sleep errors are pre-existing NixOS-local noise).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBMWTEtQdJ4W5UrWuLHCck
Author
Collaborator

Collapsed into the single stack PR #380 (per-host orchestrator, PRD 0070). Closing this slice PR; review + merge happens on #380.

Collapsed into the single stack PR #380 (per-host orchestrator, PRD 0070). Closing this slice PR; review + merge happens on #380.
didericis-claude closed this pull request 2026-07-14 00:57:44 -04:00
Some checks are pending
test / unit (pull_request) Successful in 1m3s
test / integration (pull_request) Successful in 21s
test / coverage (pull_request) Successful in 1m12s
lint / lint (push) Successful in 2m5s

Pull request closed

Sign in to join this conversation.