#74 server: startBuild — provision, kit.json, dispatch; /api/submit phase-3 tail #104

Merged
matou-build-agent merged 1 commit from sandcastle/worker/20260831-214228-ce6788 into main 2026-08-31 21:57:31 +00:00

Implements #74 — Task 7 of the phase-3 plan.

server/src/build-pipeline.ts startBuild(slug, deps): config URL (self-hosted URL, else provisioner.provision; failure → tenantError, no kit, no dispatch) → build = (status.build ?? 0)+1 → writeKit → dispatcher.dispatch (failure → buildError, configUrl kept, build not stored) → patchStatus({state:"building", …}). /api/submit calls it after publish and returns its status; still 200 on any provision/dispatch failure. AppDeps gains notifyEmail / webhookSecret.

Tests: server/test/build-pipeline.test.ts (6) + submit phase-3 tail. pnpm -r typecheck && pnpm -r test green. e2e not in the CI seam; phase-2 facts unaffected.

🤖 Generated with Claude Code

Implements #74 — Task 7 of the phase-3 plan. `server/src/build-pipeline.ts` `startBuild(slug, deps)`: config URL (self-hosted URL, else `provisioner.provision`; failure → `tenantError`, no kit, no dispatch) → `build = (status.build ?? 0)+1` → `writeKit` → `dispatcher.dispatch` (failure → `buildError`, `configUrl` kept, `build` not stored) → `patchStatus({state:"building", …})`. `/api/submit` calls it after publish and returns its status; still 200 on any provision/dispatch failure. `AppDeps` gains `notifyEmail` / `webhookSecret`. Tests: `server/test/build-pipeline.test.ts` (6) + submit phase-3 tail. `pnpm -r typecheck && pnpm -r test` green. e2e not in the CI seam; phase-2 facts unaffected. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sandcastle: #74 — startBuild (provision, kit.json, dispatch); /api/submit phase-3 tail
All checks were successful
ci / seam (pull_request) Successful in 1m18s
8867dd0990
server/src/build-pipeline.ts adds startBuild(slug, deps): config URL
(self-hosted URL, else provisioner.provision — failure → tenantError, no kit,
no dispatch) → build = (status.build ?? 0)+1 → writeKit → dispatcher.dispatch
(failure → buildError, configUrl kept, build not stored) → patchStatus
({state:'building', …, errors cleared}). Never throws for provision/dispatch
failures. /api/submit calls it after publish and returns its status; still 200
on any failure. AppDeps gains notifyEmail (COA_NOTIFY_EMAIL, default
notify@mail.matou.nz) and webhookSecret (BUILD_WEBHOOK_SECRET, default '').

Tests: server/test/build-pipeline.test.ts (6) + submit.test.ts phase-3 tail
(shared→building+kit+dispatch; dispatch-fail→200 page-ready+buildError);
existing submit success assertions now expect state 'building'.

Docs: CLAUDE.md phase line → phase 3; .env.example phase-3 builds/coa-shared
block; docs/SECRETS_CHECKLIST.md COA_SHARED_ADMIN_TOKEN + coa-builds repo
secrets. STATUS.md milestone log entry.

Verified: pnpm -r typecheck && pnpm -r test green. make e2e not runnable in
sandbox (no root to install browser system libs; e2e is not in the CI seam and
phase-2 facts unaffected — index.html still rendered at page-ready).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/coa!104
No description provided.