server: no auto-dispatch on submit — builds are triggered manually after the whakawhanaungatanga session #119

Closed
opened 2026-09-04 10:19:28 +00:00 by ben · 3 comments
Owner

Ben (2026-09-04): with the relationship-first flow (#117/#118), the build pipeline must only be triggered manually — a submission alone must not provision a tenant or dispatch a coa-builds run. Matou triggers the build after the whakawhanaungatanga session.

Scope

  • /api/submit keeps: validate → store → render → publish → email. It no longer calls the provisioner or dispatcher.
  • New operator command in the existing CLI family (make rebuild / provision / resend KIND=): make build KIND=<slug> (name flexible) that runs the current phase-3 tail — provision tenant, write kit.json, dispatch coa-builds — for one community, printing the run URL. /api/build-complete is unchanged.
  • Page + email copy for the interim state. Proposed default: the pending status card reads that the community's app is built after the whakawhanaungatanga session ("We build your app after we've met — book/attend your whakawhanaungatanga session"), and the submit confirmation email says the same. Wording is a product call — flag on the ticket if the default is wrong.
  • Status semantics: page-ready becomes the parked state until the manual trigger; building/ready/failed unchanged after it.

Acceptance

  • Server test: a submit stores + renders + emails but the injected provisioner/dispatcher stubs are NOT called.
  • CLI test (pattern of rebuild/resend tests): build provisions, writes kit.json, dispatches, updates status to building, publishes.
  • e2e: submit → page shows the parked pending state; run the CLI against the e2e server → page flips to building; signed callback → ready (existing spec extended).

Notes

  • This deliberately reverts part of the phase-3 submit tail (ADR 0004/0005 flow) to manual — record the decision as a DDR in docs/adr/.
  • Deploy note: after landing, the live server needs docker restart coa (GOTCHAS 17).
Ben (2026-09-04): with the relationship-first flow (#117/#118), the build pipeline must only be triggered manually — a submission alone must not provision a tenant or dispatch a coa-builds run. Matou triggers the build after the whakawhanaungatanga session. ## Scope - `/api/submit` keeps: validate → store → render → publish → email. It no longer calls the provisioner or dispatcher. - New operator command in the existing CLI family (`make rebuild / provision / resend KIND=`): `make build KIND=<slug>` (name flexible) that runs the current phase-3 tail — provision tenant, write kit.json, dispatch `coa-builds` — for one community, printing the run URL. `/api/build-complete` is unchanged. - Page + email copy for the interim state. Proposed default: the pending status card reads that the community's app is built after the whakawhanaungatanga session ("We build your app after we've met — book/attend your whakawhanaungatanga session"), and the submit confirmation email says the same. Wording is a product call — flag on the ticket if the default is wrong. - Status semantics: `page-ready` becomes the parked state until the manual trigger; `building/ready/failed` unchanged after it. ## Acceptance - Server test: a submit stores + renders + emails but the injected provisioner/dispatcher stubs are NOT called. - CLI test (pattern of rebuild/resend tests): `build` provisions, writes kit.json, dispatches, updates status to `building`, publishes. - e2e: submit → page shows the parked pending state; run the CLI against the e2e server → page flips to building; signed callback → ready (existing spec extended). ## Notes - This deliberately reverts part of the phase-3 submit tail (ADR 0004/0005 flow) to manual — record the decision as a DDR in `docs/adr/`. - Deploy note: after landing, the live server needs `docker restart coa` (GOTCHAS 17).

swarm-claim host=matou-dev-server-01 run=2839
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=2839 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #119 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • no open agent PR (agent/issue-119) for this issue — pr-mode commits land on a PR before they can close it (#13)
envelope
{
  "issue": 119,
  "status": "success",
  "commits": [
    "3390b4f45d787c1ad901945faaf591a23fb69673",
    "717937de6e6243ae73dd4053432404203b8a21ca",
    "a39d3d88d6137185b486a0d13fa44a0b02fd11a3"
  ],
  "changed_files": [
    "server/src/routes/submit.ts",
    "server/src/cli/build.ts",
    "server/test/build.test.ts",
    "server/test/submit.test.ts",
    "server/src/mailer.ts",
    "server/test/mailer.test.ts",
    "server/package.json",
    "templates/src/community-page.ts",
    "templates/test/community-page.test.ts",
    "site/src/pages/Done.tsx",
    "site/src/pages/Done.test.tsx",
    "e2e/apply.spec.ts",
    "e2e/community-page.spec.ts",
    "Makefile",
    "README.md",
    "STATUS.md",
    "docs/adr/0007-design-manual-build-trigger.md",
    "docs/adr/README.md"
  ],
  "tests": [
    {
      "command": "pnpm -r typecheck",
      "exit_code": 0
    },
    {
      "command": "pnpm -r test",
      "exit_code": 0
    }
  ],
  "criteria": {
    "/api/submit keeps validate→store→render→publish→email; no longer calls the provisioner or dispatcher": "server/src/routes/submit.ts — startBuild tail removed; submit returns page-ready (commit 3390b4f)",
    "Server test: a submit stores + renders + emails but the injected provisioner/dispatcher stubs are NOT called": "server/test/submit.test.ts new test 'parks at page-ready and never provisions, writes kit.json or dispatches' asserts provisions==[] and _dispatched==[] and no kit.json; index.html + one email present (commit 3390b4f)",
    "New operator command (make build KIND=<slug>, name flexible) runs the phase-3 tail (provision, kit.json, dispatch) and prints the run URL; /api/build-complete unchanged": "server/src/cli/build.ts build(slug,deps) wraps startBuild + re-render + publish; wired as `make build-app SLUG=<slug>` (server package.json script, Makefile) — chosen non-clashing name since `make build`/`build` already = workspace build (flagged, ticket says name flexible); prints the community page URL; README documented; build-complete route untouched (commit 3390b4f)",
    "CLI test (pattern of rebuild/resend): build provisions, writes kit.json, dispatches, updates status to building, publishes": "server/test/build.test.ts — asserts dispatch build 1, kit.json written, status building/build 1/configUrl, page HTML flipped to building, publisher.publish called; plus a dispatch-failure case (commit 3390b4f)",
    "Page + email copy for the interim state (parked = built after the whakawhanaungatanga session)": "templates/src/community-page.ts page-ready card reads 'We build your app after we've met — book/attend your whakawhanaungatanga session'; server/src/mailer.ts renderPageReadyEmail says the same; site/src/pages/Done.tsx copy matches (commit 3390b4f)",
    "Status semantics: page-ready is the parked state; building/ready/failed unchanged after the trigger": "submit parks at page-ready; renderStatusCta distinguishes page-ready (parked) from building; ready/failed and /api/build-complete transitions unchanged (commit 3390b4f)",
    "e2e: submit → parked pending state → run the CLI → building → signed callback → ready (existing spec extended)": "e2e/apply.spec.ts and e2e/community-page.spec.ts extended to assert parked whakawhanaungatanga state, spawn `make build-app` against the e2e server (execFileSync), assert building, then signed callback → ready; specs typecheck (pnpm -r typecheck exit 0). The Playwright browser tier could not execute in-sandbox (missing system lib libnspr4.so, no root for install-deps) — noted in the milestone log (commit 3390b4f)",
    "Record the decision as a DDR in docs/adr/": "docs/adr/0007-design-manual-build-trigger.md (renumbered from 0006 after #120 claimed 0006 on main) + docs/adr/README.md index; records the partial reversal of the ADR 0004/0005 submit tail to a manual trigger (commits 3390b4f, 717937d)"
  },
  "summary": "/api/submit no longer auto-builds — a submission parks at page-ready and the build is triggered manually with `make build-app SLUG=<slug>` after the whakawhanaungatanga session (DDR 0007).",
  "reason": "Implements #119's relationship-first flow: submit keeps validate→store→render→publish→email, the phase-3 tail moves behind a new operator CLI that provisions/writes kit.json/dispatches/re-renders to building/publishes; page + email + /done copy updated; DDR recorded; seam green.",
  "blockers": []
}
**close-report** for #119 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - no open agent PR (agent/issue-119) for this issue — pr-mode commits land on a PR before they can close it (#13) <details><summary>envelope</summary> ```json { "issue": 119, "status": "success", "commits": [ "3390b4f45d787c1ad901945faaf591a23fb69673", "717937de6e6243ae73dd4053432404203b8a21ca", "a39d3d88d6137185b486a0d13fa44a0b02fd11a3" ], "changed_files": [ "server/src/routes/submit.ts", "server/src/cli/build.ts", "server/test/build.test.ts", "server/test/submit.test.ts", "server/src/mailer.ts", "server/test/mailer.test.ts", "server/package.json", "templates/src/community-page.ts", "templates/test/community-page.test.ts", "site/src/pages/Done.tsx", "site/src/pages/Done.test.tsx", "e2e/apply.spec.ts", "e2e/community-page.spec.ts", "Makefile", "README.md", "STATUS.md", "docs/adr/0007-design-manual-build-trigger.md", "docs/adr/README.md" ], "tests": [ { "command": "pnpm -r typecheck", "exit_code": 0 }, { "command": "pnpm -r test", "exit_code": 0 } ], "criteria": { "/api/submit keeps validate→store→render→publish→email; no longer calls the provisioner or dispatcher": "server/src/routes/submit.ts — startBuild tail removed; submit returns page-ready (commit 3390b4f)", "Server test: a submit stores + renders + emails but the injected provisioner/dispatcher stubs are NOT called": "server/test/submit.test.ts new test 'parks at page-ready and never provisions, writes kit.json or dispatches' asserts provisions==[] and _dispatched==[] and no kit.json; index.html + one email present (commit 3390b4f)", "New operator command (make build KIND=<slug>, name flexible) runs the phase-3 tail (provision, kit.json, dispatch) and prints the run URL; /api/build-complete unchanged": "server/src/cli/build.ts build(slug,deps) wraps startBuild + re-render + publish; wired as `make build-app SLUG=<slug>` (server package.json script, Makefile) — chosen non-clashing name since `make build`/`build` already = workspace build (flagged, ticket says name flexible); prints the community page URL; README documented; build-complete route untouched (commit 3390b4f)", "CLI test (pattern of rebuild/resend): build provisions, writes kit.json, dispatches, updates status to building, publishes": "server/test/build.test.ts — asserts dispatch build 1, kit.json written, status building/build 1/configUrl, page HTML flipped to building, publisher.publish called; plus a dispatch-failure case (commit 3390b4f)", "Page + email copy for the interim state (parked = built after the whakawhanaungatanga session)": "templates/src/community-page.ts page-ready card reads 'We build your app after we've met — book/attend your whakawhanaungatanga session'; server/src/mailer.ts renderPageReadyEmail says the same; site/src/pages/Done.tsx copy matches (commit 3390b4f)", "Status semantics: page-ready is the parked state; building/ready/failed unchanged after the trigger": "submit parks at page-ready; renderStatusCta distinguishes page-ready (parked) from building; ready/failed and /api/build-complete transitions unchanged (commit 3390b4f)", "e2e: submit → parked pending state → run the CLI → building → signed callback → ready (existing spec extended)": "e2e/apply.spec.ts and e2e/community-page.spec.ts extended to assert parked whakawhanaungatanga state, spawn `make build-app` against the e2e server (execFileSync), assert building, then signed callback → ready; specs typecheck (pnpm -r typecheck exit 0). The Playwright browser tier could not execute in-sandbox (missing system lib libnspr4.so, no root for install-deps) — noted in the milestone log (commit 3390b4f)", "Record the decision as a DDR in docs/adr/": "docs/adr/0007-design-manual-build-trigger.md (renumbered from 0006 after #120 claimed 0006 on main) + docs/adr/README.md index; records the partial reversal of the ADR 0004/0005 submit tail to a manual trigger (commits 3390b4f, 717937d)" }, "summary": "/api/submit no longer auto-builds — a submission parks at page-ready and the build is triggered manually with `make build-app SLUG=<slug>` after the whakawhanaungatanga session (DDR 0007).", "reason": "Implements #119's relationship-first flow: submit keeps validate→store→render→publish→email, the phase-3 tail moves behind a new operator CLI that provisions/writes kit.json/dispatches/re-renders to building/publishes; page + email + /done copy updated; DDR recorded; seam green.", "blockers": [] } ``` </details>

close-report for #119 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 119,
  "status": "success",
  "commits": [
    "3390b4f45d787c1ad901945faaf591a23fb69673",
    "717937de6e6243ae73dd4053432404203b8a21ca",
    "a39d3d88d6137185b486a0d13fa44a0b02fd11a3"
  ],
  "changed_files": [
    "server/src/routes/submit.ts",
    "server/src/cli/build.ts",
    "server/test/build.test.ts",
    "server/test/submit.test.ts",
    "server/src/mailer.ts",
    "server/test/mailer.test.ts",
    "server/package.json",
    "templates/src/community-page.ts",
    "templates/test/community-page.test.ts",
    "site/src/pages/Done.tsx",
    "site/src/pages/Done.test.tsx",
    "e2e/apply.spec.ts",
    "e2e/community-page.spec.ts",
    "Makefile",
    "README.md",
    "STATUS.md",
    "docs/adr/0007-design-manual-build-trigger.md",
    "docs/adr/README.md"
  ],
  "tests": [
    {
      "command": "pnpm -r typecheck",
      "exit_code": 0
    },
    {
      "command": "pnpm -r test",
      "exit_code": 0
    }
  ],
  "criteria": {
    "/api/submit keeps validate→store→render→publish→email; no longer calls the provisioner or dispatcher": "server/src/routes/submit.ts — startBuild tail removed; submit returns page-ready (commit 3390b4f)",
    "Server test: a submit stores + renders + emails but the injected provisioner/dispatcher stubs are NOT called": "server/test/submit.test.ts new test 'parks at page-ready and never provisions, writes kit.json or dispatches' asserts provisions==[] and _dispatched==[] and no kit.json; index.html + one email present (commit 3390b4f)",
    "New operator command (make build KIND=<slug>, name flexible) runs the phase-3 tail (provision, kit.json, dispatch) and prints the run URL; /api/build-complete unchanged": "server/src/cli/build.ts build(slug,deps) wraps startBuild + re-render + publish; wired as `make build-app SLUG=<slug>` (server package.json script, Makefile) — chosen non-clashing name since `make build`/`build` already = workspace build (flagged, ticket says name flexible); prints the community page URL; README documented; build-complete route untouched (commit 3390b4f)",
    "CLI test (pattern of rebuild/resend): build provisions, writes kit.json, dispatches, updates status to building, publishes": "server/test/build.test.ts — asserts dispatch build 1, kit.json written, status building/build 1/configUrl, page HTML flipped to building, publisher.publish called; plus a dispatch-failure case (commit 3390b4f)",
    "Page + email copy for the interim state (parked = built after the whakawhanaungatanga session)": "templates/src/community-page.ts page-ready card reads 'We build your app after we've met — book/attend your whakawhanaungatanga session'; server/src/mailer.ts renderPageReadyEmail says the same; site/src/pages/Done.tsx copy matches (commit 3390b4f)",
    "Status semantics: page-ready is the parked state; building/ready/failed unchanged after the trigger": "submit parks at page-ready; renderStatusCta distinguishes page-ready (parked) from building; ready/failed and /api/build-complete transitions unchanged (commit 3390b4f)",
    "e2e: submit → parked pending state → run the CLI → building → signed callback → ready (existing spec extended)": "e2e/apply.spec.ts and e2e/community-page.spec.ts extended to assert parked whakawhanaungatanga state, spawn `make build-app` against the e2e server (execFileSync), assert building, then signed callback → ready; specs typecheck (pnpm -r typecheck exit 0). The Playwright browser tier could not execute in-sandbox (missing system lib libnspr4.so, no root for install-deps) — noted in the milestone log (commit 3390b4f)",
    "Record the decision as a DDR in docs/adr/": "docs/adr/0007-design-manual-build-trigger.md (renumbered from 0006 after #120 claimed 0006 on main) + docs/adr/README.md index; records the partial reversal of the ADR 0004/0005 submit tail to a manual trigger (commits 3390b4f, 717937d)"
  },
  "summary": "/api/submit no longer auto-builds — a submission parks at page-ready and the build is triggered manually with `make build-app SLUG=<slug>` after the whakawhanaungatanga session (DDR 0007).",
  "reason": "Implements #119's relationship-first flow: submit keeps validate→store→render→publish→email, the phase-3 tail moves behind a new operator CLI that provisions/writes kit.json/dispatches/re-renders to building/publishes; page + email + /done copy updated; DDR recorded; seam green.",
  "blockers": []
}
**close-report** for #119 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 119, "status": "success", "commits": [ "3390b4f45d787c1ad901945faaf591a23fb69673", "717937de6e6243ae73dd4053432404203b8a21ca", "a39d3d88d6137185b486a0d13fa44a0b02fd11a3" ], "changed_files": [ "server/src/routes/submit.ts", "server/src/cli/build.ts", "server/test/build.test.ts", "server/test/submit.test.ts", "server/src/mailer.ts", "server/test/mailer.test.ts", "server/package.json", "templates/src/community-page.ts", "templates/test/community-page.test.ts", "site/src/pages/Done.tsx", "site/src/pages/Done.test.tsx", "e2e/apply.spec.ts", "e2e/community-page.spec.ts", "Makefile", "README.md", "STATUS.md", "docs/adr/0007-design-manual-build-trigger.md", "docs/adr/README.md" ], "tests": [ { "command": "pnpm -r typecheck", "exit_code": 0 }, { "command": "pnpm -r test", "exit_code": 0 } ], "criteria": { "/api/submit keeps validate→store→render→publish→email; no longer calls the provisioner or dispatcher": "server/src/routes/submit.ts — startBuild tail removed; submit returns page-ready (commit 3390b4f)", "Server test: a submit stores + renders + emails but the injected provisioner/dispatcher stubs are NOT called": "server/test/submit.test.ts new test 'parks at page-ready and never provisions, writes kit.json or dispatches' asserts provisions==[] and _dispatched==[] and no kit.json; index.html + one email present (commit 3390b4f)", "New operator command (make build KIND=<slug>, name flexible) runs the phase-3 tail (provision, kit.json, dispatch) and prints the run URL; /api/build-complete unchanged": "server/src/cli/build.ts build(slug,deps) wraps startBuild + re-render + publish; wired as `make build-app SLUG=<slug>` (server package.json script, Makefile) — chosen non-clashing name since `make build`/`build` already = workspace build (flagged, ticket says name flexible); prints the community page URL; README documented; build-complete route untouched (commit 3390b4f)", "CLI test (pattern of rebuild/resend): build provisions, writes kit.json, dispatches, updates status to building, publishes": "server/test/build.test.ts — asserts dispatch build 1, kit.json written, status building/build 1/configUrl, page HTML flipped to building, publisher.publish called; plus a dispatch-failure case (commit 3390b4f)", "Page + email copy for the interim state (parked = built after the whakawhanaungatanga session)": "templates/src/community-page.ts page-ready card reads 'We build your app after we've met — book/attend your whakawhanaungatanga session'; server/src/mailer.ts renderPageReadyEmail says the same; site/src/pages/Done.tsx copy matches (commit 3390b4f)", "Status semantics: page-ready is the parked state; building/ready/failed unchanged after the trigger": "submit parks at page-ready; renderStatusCta distinguishes page-ready (parked) from building; ready/failed and /api/build-complete transitions unchanged (commit 3390b4f)", "e2e: submit → parked pending state → run the CLI → building → signed callback → ready (existing spec extended)": "e2e/apply.spec.ts and e2e/community-page.spec.ts extended to assert parked whakawhanaungatanga state, spawn `make build-app` against the e2e server (execFileSync), assert building, then signed callback → ready; specs typecheck (pnpm -r typecheck exit 0). The Playwright browser tier could not execute in-sandbox (missing system lib libnspr4.so, no root for install-deps) — noted in the milestone log (commit 3390b4f)", "Record the decision as a DDR in docs/adr/": "docs/adr/0007-design-manual-build-trigger.md (renumbered from 0006 after #120 claimed 0006 on main) + docs/adr/README.md index; records the partial reversal of the ADR 0004/0005 submit tail to a manual trigger (commits 3390b4f, 717937d)" }, "summary": "/api/submit no longer auto-builds — a submission parks at page-ready and the build is triggered manually with `make build-app SLUG=<slug>` after the whakawhanaungatanga session (DDR 0007).", "reason": "Implements #119's relationship-first flow: submit keeps validate→store→render→publish→email, the phase-3 tail moves behind a new operator CLI that provisions/writes kit.json/dispatches/re-renders to building/publishes; page + email + /done copy updated; DDR recorded; seam green.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#119
No description provided.