server: POST /api/submit — validate submission + logo, no persistence (plan Task 9) #13

Closed
opened 2026-08-28 15:06:46 +00:00 by ben · 3 comments
Owner

Plan

docs/superpowers/plans/2026-08-27-coa-phase-0-1.md Task 9.

Deliverable

server/src/multipart.ts (parseSubmissionForm(form) → {ok:true, submission, logo} | {ok:false, issues[]}), server/src/routes/submit.ts mounted at /api/submit, app.onError → 500 JSON; server/test/submit.test.ts.

Acceptance (plan's five tests)

  • Multipart submission (JSON) + logo (file). Shared backend → 200 {accepted:true, slug, submission, logo:{type,bytes}} with features.identity === true.
  • Invalid data → 400 {error:'validation', issues:[{path:'brand.slug',…}]}.
  • Missing / image/gif / >2 MiB logo → 400.
  • Self-hosted backend whose probes fail → 422 {error:'backend', report}; passing → 200 with backendReport.ok === true.
  • Phase gate: nothing is written to communities/, nothing rendered, no email — this is CLAUDE.md's standing rule.

depends_on

  • server: POST /api/validate-backend (Task 8)

out_of_scope

slug uniqueness / 409 (phase 2, needs communities/).

depends_on (issue refs)

## Plan `docs/superpowers/plans/2026-08-27-coa-phase-0-1.md` **Task 9**. ## Deliverable `server/src/multipart.ts` (`parseSubmissionForm(form) → {ok:true, submission, logo} | {ok:false, issues[]}`), `server/src/routes/submit.ts` mounted at `/api/submit`, `app.onError` → 500 JSON; `server/test/submit.test.ts`. ## Acceptance (plan's five tests) - Multipart `submission` (JSON) + `logo` (file). Shared backend → 200 `{accepted:true, slug, submission, logo:{type,bytes}}` with `features.identity === true`. - Invalid data → 400 `{error:'validation', issues:[{path:'brand.slug',…}]}`. - Missing / `image/gif` / >2 MiB logo → 400. - Self-hosted backend whose probes fail → 422 `{error:'backend', report}`; passing → 200 with `backendReport.ok === true`. - **Phase gate:** nothing is written to `communities/`, nothing rendered, no email — this is `CLAUDE.md`'s standing rule. ## depends_on - server: POST /api/validate-backend (Task 8) ## out_of_scope slug uniqueness / 409 (phase 2, needs `communities/`). ## depends_on (issue refs) - #12

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: enhancement + ready-for-agent (was needs-triage).

  • Category — enhancement. New phase-1 code (plan Task 9); nothing is broken, so not a bug.
  • Not already implemented. No packages/ / server/ / site/ / tools/ / e2e/ in the tree yet (#7 is the first code ticket); no matching .out-of-scope/ rejection. Redundancy and prior-rejection checks both clear.
  • Fully specified — no grilling needed. The body (Deliverable · Interfaces · Acceptance · out_of_scope) together with plan Task 9, cited verbatim as the contract, is the agent brief; I'm not duplicating it.
  • Dependencies: #12 — registered on the tracker and enforced by the claim gate, so labelling the whole chain ready-for-agent now cannot let a worker start out of order.
  • Phase gate held. No write to communities/, no render, no email — CLAUDE.md's standing phase-1 rule, and itself an acceptance criterion. The gate keeps this clear of every one-way door.

Why a two-way door. The outcome is a label, reverted by a later label change, and every acceptance criterion is provable by the plan's own tests (pnpm -r typecheck && pnpm -r test). It touches no credential, emails no community contact, dispatches no build or release, provisions no shared-infra tenant, writes no real communities/ data, widens no security posture, and changes no form contract the spec does not already state — none of this repo's one-way doors.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Ruling:** `enhancement` + `ready-for-agent` (was `needs-triage`). - **Category — enhancement.** New phase-1 code (plan Task 9); nothing is broken, so not a bug. - **Not already implemented.** No `packages/` / `server/` / `site/` / `tools/` / `e2e/` in the tree yet (#7 is the first code ticket); no matching `.out-of-scope/` rejection. Redundancy and prior-rejection checks both clear. - **Fully specified — no grilling needed.** The body (Deliverable · Interfaces · Acceptance · out_of_scope) together with plan **Task 9**, cited verbatim as the contract, *is* the agent brief; I'm not duplicating it. - **Dependencies:** #12 — registered on the tracker and enforced by the claim gate, so labelling the whole chain `ready-for-agent` now cannot let a worker start out of order. - **Phase gate held.** No write to `communities/`, no render, no email — CLAUDE.md's standing phase-1 rule, and itself an acceptance criterion. The gate keeps this clear of every one-way door. **Why a two-way door.** The outcome is a label, reverted by a later label change, and every acceptance criterion is provable by the plan's own tests (`pnpm -r typecheck && pnpm -r test`). It touches no credential, emails no community contact, dispatches no build or release, provisions no shared-infra tenant, writes no real `communities/` data, widens no security posture, and changes no form contract the spec does not already state — none of this repo's one-way doors.

Blocked — CI seam event-source not dispatching (GOTCHAS 10)

The implementation is complete and green: PR #45 (sandcastle/worker/20260829-052907-84c8e2) implements plan Task 9 — server/src/multipart.ts (parseSubmissionForm), server/src/routes/submit.ts mounted at /api/submit, app.onError → 500 JSON, and server/test/submit.test.ts (the plan's five acceptance tests). Locally pnpm -r typecheck and pnpm -r test all pass (server 13/13). The seam passed on the first commit d4e2eb96 (Forgejo Actions task 31975, pull_request seam → success).

What blocks landing: after rebasing/merging main (STATUS.md conflict, resolved preserving both #15 and #13), the seam status registers pending (runs 338 / 342) but no runner task is ever created for the PR head — the exact GOTCHAS 10 symptom (pull_request event-source silently stops dispatching). I applied the documented in-scope re-fire (empty commit 1358823); it did not take — still no task after ~5 min.

Per GOTCHAS 10, when re-registration does not take the runner / event-source needs an operator restart, or .forgejo/workflows/ci.yml must be pushed to main to re-register triggers — a protected path workers cannot edit. This is the ready-for-human one-way door GOTCHAS 10 names.

Why human

An operator must re-register the ci.yml triggers (push the protected workflow file to main) or restart the runner / event-source, then re-fire PR #45's seam (push an empty commit to its branch). Once a fresh pull_request seam task runs green, MERGE_AUTHORITY=agent-after-green will merge #45; the issue can then be closed via the close-report gate. No code change is needed — the PR is mergeable and correct.

## Blocked — CI seam event-source not dispatching (GOTCHAS 10) The implementation is complete and green: **PR #45** (`sandcastle/worker/20260829-052907-84c8e2`) implements plan Task 9 — `server/src/multipart.ts` (`parseSubmissionForm`), `server/src/routes/submit.ts` mounted at `/api/submit`, `app.onError` → 500 JSON, and `server/test/submit.test.ts` (the plan's five acceptance tests). Locally `pnpm -r typecheck` and `pnpm -r test` all pass (server 13/13). The seam **passed on the first commit** `d4e2eb96` (Forgejo Actions task 31975, `pull_request` seam → success). **What blocks landing:** after rebasing/merging `main` (STATUS.md conflict, resolved preserving both #15 and #13), the seam status registers `pending` (runs 338 / 342) but **no runner task is ever created** for the PR head — the exact GOTCHAS 10 symptom (`pull_request` event-source silently stops dispatching). I applied the documented in-scope re-fire (empty commit `1358823`); it did **not** take — still no task after ~5 min. Per GOTCHAS 10, when re-registration does not take the runner / event-source needs an operator restart, or `.forgejo/workflows/ci.yml` must be pushed to `main` to re-register triggers — a protected path workers cannot edit. This is the `ready-for-human` one-way door GOTCHAS 10 names. ## Why human An operator must re-register the `ci.yml` triggers (push the protected workflow file to `main`) or restart the runner / event-source, then re-fire PR #45's seam (push an empty commit to its branch). Once a fresh `pull_request` seam task runs green, `MERGE_AUTHORITY=agent-after-green` will merge #45; the issue can then be closed via the close-report gate. No code change is needed — the PR is mergeable and correct.
Author
Owner

Ruled by agent under the two-way-door doctrine — veto anytime. Not a lost event: GET /actions/runs shows PR #45's seam for 1358823 as waiting behind ~10 other repos' runs on two capacity-1 runners (a /actions/tasks row only appears once a runner picks the job up). No operator action needed; the interactive session will merge #45 when the queued seam goes green and close this via Closes #13. GOTCHAS 10 amended so workers check /actions/runs before parking. Removing ready-for-human.

**Ruled by agent under the two-way-door doctrine — veto anytime.** Not a lost event: `GET /actions/runs` shows PR #45's seam for `1358823` as `waiting` behind ~10 other repos' runs on two capacity-1 runners (a `/actions/tasks` row only appears once a runner picks the job up). No operator action needed; the interactive session will merge #45 when the queued seam goes green and close this via `Closes #13`. GOTCHAS 10 amended so workers check `/actions/runs` before parking. Removing `ready-for-human`.
ben closed this issue 2026-08-29 06:45:28 +00:00
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.

Reference
Matou/coa#13
No description provided.