server: POST /api/build-complete — HMAC callback flips ready/failed, re-renders, emails (phase-3 plan Task 8) #75
Labels
No labels
agent-blocked
agent-working
bug
deferred
enhancement
model-haiku
model-opus
model-sonnet
needs-info
needs-triage
no-triage
priority
product-decision
ready-for-agent
ready-for-human
ready-for-session
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Depends on
Reference
Matou/coa#75
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plan
docs/superpowers/plans/2026-08-31-coa-phase-3.mdTask 8.Deliverable
server/src/webhook-signature.ts(signBody,verifySignature—sha256=<hex>,timingSafeEqual);server/src/routes/build-complete.tsmounted at/api/build-complete: no secret → 503webhook-unconfigured; bad/missing signature → 401signature; invalid body → 400validation; unknown slug → 404unknown-slug; stale build → 200{ignored:'stale', build, current}; success →ready+ assets/releaseUrl/buildRunUrl, re-render +writeHtml, publish, installers-ready email; failure →failed+ buildRunUrl/error, re-render, publish, build-failed email to contact andnotifyEmail; email/publish failures recorded, still 200. Testswebhook-signature.test.ts,build-complete.test.ts(plan text).Acceptance
pnpm -r typecheck && pnpm -r testgreen.depends_on
Phase gate
Feature toggles / nav order in builds are phase 4. Never delete or rewrite anything under
communities/(ADR 0002/0003); phase 3 rewrites onlykit.json,status.json,index.html. No test reaches the real network, sends real mail, dispatches a real build or provisions a real tenant.Ruled by agent under ADR 0174 (two-way-door doctrine) — veto anytime
Ruling:
ready-for-agent. POST /api/build-complete HMAC callback flips ready/failed, re-renders, emails.Why this is a two-way door: it is revertible by a later commit or label change, and provable by the tests the plan specifies — which never reach the real network, send real mail, dispatch a real build or provision a real tenant. It is not on the one-way-door list: the credential bytes, real GitHub dispatch/release and live coa-shared tenant are already carved out into the human ticket #79 and the session tickets #80/#81; env-gated defaults keep the wired code inert (noop/static, 503/unconfigured) until those land.
What proves it:
webhook-signature.test.ts+build-complete.test.ts(raw-body HMAC, stubbed mailer/publisher);pnpm -r testgreen.The ticket body is a complete agent brief (Deliverable / Acceptance / depends_on). The native Forgejo dependency links already mirror the plan's graph, so the swarm ready-list filter holds this ticket until its blockers close.
swarm-claim host=matou-dev-server-01 run=1464
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #75 — status
success✅ close-report gates passed — every claim verified against main; PR #106 (#106) was already merged (a reconcile pass landed it before this close-report ran) and the merge closed this issue via
closes #75.envelope