Skip to content

feat(townhouse): DockerOrchestrator HS profile + getHsHostname admin client (Story 45.3)#44

Open
ALLiDoizCode wants to merge 2 commits intomainfrom
feat/45-3-orchestrator-profile-param
Open

feat(townhouse): DockerOrchestrator HS profile + getHsHostname admin client (Story 45.3)#44
ALLiDoizCode wants to merge 2 commits intomainfrom
feat/45-3-orchestrator-profile-param

Conversation

@ALLiDoizCode
Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • pnpm --filter @toon-protocol/townhouse test orchestrator — 71 tests pass (zero test-file edits, AC feat: implement Epic 2 - SPSP over Nostr #2)
  • pnpm --filter @toon-protocol/townhouse test admin-client — 16 tests pass (5 new getHsHostname cases)
  • pnpm --filter @toon-protocol/townhouse test orchestrator-hs — 14 new HS-path unit tests pass (no Docker required)
  • pnpm --filter @toon-protocol/townhouse test:canary — connector image contract canary green (AC docs: add Epic 5 (DVM Compute Marketplace) and Epic 6 (Advanced DVM + TEE) #17)
  • pnpm --filter @toon-protocol/townhouse buildOrchestratorError, HsHostnameResponse, getHsHostname, profile?: ComposeProfile visible in dist/index.d.ts
  • RUN_DOCKER_INTEGRATION=1 pnpm --filter @toon-protocol/townhouse test:integration -- orchestrator-hs — requires real Docker + dist/image-manifest.json (CI gate)

Pre-existing test failures (not introduced by this PR)

src/api/routes/logs.test.ts (4 tests) fail on main before this PR — confirmed by stash-and-retest.

🤖 Generated with Claude Code

ALLiDoizCode and others added 2 commits May 9, 2026 21:26
…client (Story 45.3)

- Add `profile: 'dev' | 'hs'` constructor option to DockerOrchestrator
- HS path shells out to `docker compose -f <composePath> up -d` with
  deterministic `--profile` flag ordering (town → mill → dvm)
- Poll `GET /admin/hs-hostname` until hostname non-null (120s budget);
  fail-fast on 503 (anon-disabled) without retrying
- Surface compose subprocess failures via existing `containerState` event
  interface with stderr pattern-matching + fallback event
- HS `down()` uses `docker compose down` without `-v` (preserves anon volume)
- Inject `execFileAsync` + `adminClientFactory` via constructor options for
  testable subprocess mocking without vi.mock('node:child_process')
- Add `OrchestratorError` class with `service`, `exitCode`, `stderr` fields
- Add `getHsHostname()` to ConnectorAdminClient with 503 anon-disabled handling
- Add `HsHostnameResponse` to connector types
- Update three CLI orchestrator call sites to pass `{ profile: 'dev' }` explicitly
- 14 new HS-path unit tests + 3 integration test stubs (RUN_DOCKER_INTEGRATION gate)
- All 71 existing orchestrator tests + 16 admin-client tests pass without modification

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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