server: CommunityStore writeKit / readKit / writeHtml (phase-3 plan Task 2) #69

Closed
opened 2026-08-31 05:20:12 +00:00 by ben · 3 comments
Owner

Plan

docs/superpowers/plans/2026-08-31-coa-phase-3.md Task 2.

Deliverable

CommunityStore gains writeKit(slug, kit: Kit) (validates with KitSchema, refuses a kit whose slug differs, writes kit.json), readKit(slug): Promise<Kit|undefined>, writeHtml(slug, html) (temp file + rename). Tests appended to server/test/community-store.test.ts (plan text).

Acceptance

  • Directory listing after write+kit is exactly backend.json brand.json features.json index.html kit.json logo.svg onboarding.json status.json.
  • Mismatched slug → throws /slug/. readKit on a community without a kit → undefined.
  • pnpm -r typecheck && pnpm -r test green.

depends_on

  • schema: INSTALLERS, KitSchema, BuildCompleteSchema, Status v2 (Task 1)

Phase gate

Feature toggles / nav order in builds are phase 4. Never delete or rewrite anything under communities/ (ADR 0002/0003); phase 3 rewrites only kit.json, status.json, index.html. No test reaches the real network, sends real mail, dispatches a real build or provisions a real tenant.

## Plan `docs/superpowers/plans/2026-08-31-coa-phase-3.md` **Task 2**. ## Deliverable `CommunityStore` gains `writeKit(slug, kit: Kit)` (validates with `KitSchema`, refuses a kit whose `slug` differs, writes `kit.json`), `readKit(slug): Promise<Kit|undefined>`, `writeHtml(slug, html)` (temp file + rename). Tests appended to `server/test/community-store.test.ts` (plan text). ## Acceptance - Directory listing after write+kit is exactly `backend.json brand.json features.json index.html kit.json logo.svg onboarding.json status.json`. - Mismatched slug → throws `/slug/`. `readKit` on a community without a kit → `undefined`. - `pnpm -r typecheck && pnpm -r test` green. ## depends_on - schema: INSTALLERS, KitSchema, BuildCompleteSchema, Status v2 (Task 1) ## Phase gate Feature toggles / nav order in builds are phase 4. Never delete or rewrite anything under `communities/` (ADR 0002/0003); phase 3 rewrites only `kit.json`, `status.json`, `index.html`. No test reaches the real network, sends real mail, dispatches a real build or provisions a real tenant.

This was generated by AI during triage.

Ruled by agent under ADR 0174 (two-way-door doctrine) — veto anytime

Ruling: ready-for-agent. CommunityStore writeKit / readKit / writeHtml (atomic replace).

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: appended server/test/community-store.test.ts cases (temp dirs only); pnpm -r test green.

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.

> *This was generated by AI during triage.* ## Ruled by agent under ADR 0174 (two-way-door doctrine) — veto anytime **Ruling:** `ready-for-agent`. CommunityStore writeKit / readKit / writeHtml (atomic replace). **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:** appended `server/test/community-store.test.ts` cases (temp dirs only); `pnpm -r test` green. 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=1268
(automated multi-host claim — lowest live claim id works this ticket)

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

close-report for #69 — status success

✅ close-report gates passed — every claim verified against main; PR #103 (#103) was already merged (a reconcile pass landed it before this close-report ran) and the merge closed this issue via closes #69.

envelope
{
  "issue": 69,
  "status": "success",
  "commits": [
    "fbaa29bcd600122f3d0982a4f3997db20a46e791"
  ],
  "changed_files": [
    "server/src/community-store.ts",
    "server/test/community-store.test.ts",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "pnpm -r typecheck",
      "exit_code": 0
    },
    {
      "command": "pnpm -r test",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Directory listing after write+kit is exactly backend.json brand.json features.json index.html kit.json logo.svg onboarding.json status.json": "server/test/community-store.test.ts 'CommunityStore phase 3' asserts the eight-file readdir listing after write+writeKit+writeHtml; green in commit fbaa29b",
    "Mismatched slug -> throws /slug/": "writeKit in server/src/community-store.ts throws `kit slug ${kit.slug} does not match ${slug}`; test 'rejects a kit for another slug' asserts rejects.toThrow(/slug/)",
    "readKit on a community without a kit -> undefined": "readKit returns undefined on ENOENT (server/src/community-store.ts); test asserts store.readKit(...) toBeUndefined() before writeKit",
    "pnpm -r typecheck && pnpm -r test green": "both run with exit_code 0; 52 server tests pass incl. the two appended phase-3 cases"
  },
  "summary": "CommunityStore gained writeKit (validates KitSchema, refuses mismatched slug), readKit (undefined when absent), and writeHtml (atomic replace), with tests appended.",
  "reason": "Phase-3 plan Task 2 delivered on the ticket's stated interface with test-first coverage; merged to main via PR #103 with the CI seam green.",
  "blockers": []
}
**close-report** for #69 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; PR #103 (https://git.matou.nz/Matou/coa/pulls/103) was already merged (a reconcile pass landed it before this close-report ran) and the merge closed this issue via `closes #69`. <details><summary>envelope</summary> ```json { "issue": 69, "status": "success", "commits": [ "fbaa29bcd600122f3d0982a4f3997db20a46e791" ], "changed_files": [ "server/src/community-store.ts", "server/test/community-store.test.ts", "STATUS.md" ], "tests": [ { "command": "pnpm -r typecheck", "exit_code": 0 }, { "command": "pnpm -r test", "exit_code": 0 } ], "criteria": { "Directory listing after write+kit is exactly backend.json brand.json features.json index.html kit.json logo.svg onboarding.json status.json": "server/test/community-store.test.ts 'CommunityStore phase 3' asserts the eight-file readdir listing after write+writeKit+writeHtml; green in commit fbaa29b", "Mismatched slug -> throws /slug/": "writeKit in server/src/community-store.ts throws `kit slug ${kit.slug} does not match ${slug}`; test 'rejects a kit for another slug' asserts rejects.toThrow(/slug/)", "readKit on a community without a kit -> undefined": "readKit returns undefined on ENOENT (server/src/community-store.ts); test asserts store.readKit(...) toBeUndefined() before writeKit", "pnpm -r typecheck && pnpm -r test green": "both run with exit_code 0; 52 server tests pass incl. the two appended phase-3 cases" }, "summary": "CommunityStore gained writeKit (validates KitSchema, refuses mismatched slug), readKit (undefined when absent), and writeHtml (atomic replace), with tests appended.", "reason": "Phase-3 plan Task 2 delivered on the ticket's stated interface with test-first coverage; merged to main via PR #103 with the CI 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.

Reference
Matou/coa#69
No description provided.