feat(orchestrator): slice 13c(iii) — host-side control-plane client #373

Closed
didericis-claude wants to merge 1 commits from orchestrator-client into orchestrator-gateway-net
Collaborator

Sub-slice of slice 13c. The launch path's counterpart to the gateway-side PolicyResolver: a trusted host-side HTTP client for the orchestrator control plane, so the CLI can register / tear down / re-policy bottles over /bottles.

API

  • register_bottle(source_ip, *, image_ref, metadata, policy) -> RegisteredBottle(bottle_id, identity_token)POST /bottles
  • teardown_bottle(id) -> boolDELETE; 404 → False (idempotent for cleanup traps)
  • set_policy(id, policy) -> boolPUT; live reload
  • list_bottles() / health()

Trust posture

Unlike the fail-closed data-plane resolver (which denies on error), this is the control-plane caller: a non-2xx (other than the meaningful 404s) raises OrchestratorClientError, so the launch path surfaces failures rather than silently proceeding. Stdlib-only — the CLI drives the orchestrator with no dependency.

Verification

pyright 0 errors, pylint 9.82/10, unit suite green (1742 tests; the 13 test_sidecar_init /bin/sleep errors are pre-existing NixOS-local noise). 12 new tests: register (id+token, payload, missing-field, non-2xx), teardown (success/404/verb), health, set_policy, unreachable.

Stacked on #372.

🤖 Generated with Claude Code

Sub-slice of **slice 13c**. The launch path's counterpart to the gateway-side `PolicyResolver`: a **trusted host-side HTTP client** for the orchestrator control plane, so the CLI can register / tear down / re-policy bottles over `/bottles`. ### API - `register_bottle(source_ip, *, image_ref, metadata, policy) -> RegisteredBottle(bottle_id, identity_token)` — `POST /bottles` - `teardown_bottle(id) -> bool` — `DELETE`; **404 → False** (idempotent for cleanup traps) - `set_policy(id, policy) -> bool` — `PUT`; live reload - `list_bottles()` / `health()` ### Trust posture Unlike the fail-closed **data-plane** resolver (which denies on error), this is the **control-plane** caller: a non-2xx (other than the meaningful 404s) raises `OrchestratorClientError`, so the launch path surfaces failures rather than silently proceeding. Stdlib-only — the CLI drives the orchestrator with no dependency. ### Verification pyright **0 errors**, pylint **9.82/10**, unit suite green (1742 tests; the 13 `test_sidecar_init` `/bin/sleep` errors are pre-existing NixOS-local noise). 12 new tests: register (id+token, payload, missing-field, non-2xx), teardown (success/404/verb), health, set_policy, unreachable. Stacked on #372. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
didericis-claude added 1 commit 2026-07-13 21:51:29 -04:00
feat(orchestrator): slice 13c(iii) — host-side control-plane client
test / unit (pull_request) Successful in 1m9s
test / integration (pull_request) Successful in 29s
test / coverage (pull_request) Successful in 1m18s
lint / lint (push) Successful in 2m10s
72286f188d
The launch path's counterpart to the gateway-side PolicyResolver: a trusted
host-side HTTP client for the orchestrator control plane, so the CLI can
register/teardown/re-policy bottles. Stdlib-only.

- OrchestratorClient.register_bottle(source_ip, *, image_ref, metadata,
  policy) -> RegisteredBottle(bottle_id, identity_token)  (POST /bottles)
- teardown_bottle(id) -> bool (DELETE; 404 -> False, idempotent for cleanup)
- set_policy(id, policy) -> bool (PUT; live reload)
- list_bottles() / health()
- Unlike the fail-closed data-plane resolver, this is the trusted caller: a
  non-2xx (other than the meaningful 404s) raises OrchestratorClientError so
  the launch path surfaces failures rather than swallowing them.

pyright 0 errors; pylint 9.82/10; unit suite green (1742 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:39 -04:00
Some checks are pending
test / unit (pull_request) Successful in 1m9s
test / integration (pull_request) Successful in 29s
test / coverage (pull_request) Successful in 1m18s
lint / lint (push) Successful in 2m10s

Pull request closed

Sign in to join this conversation.