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

Merged
matou-build-agent merged 3 commits from agent/issue-69 into main 2026-08-31 13:00:10 +00:00

closes #69

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

Adds writeKit (validates KitSchema, refuses mismatched slug), readKit (undefined when absent), writeHtml (atomic replace). Tests appended (temp dirs only, no network). pnpm -r typecheck && pnpm -r test green.

closes #69 sandcastle: #69 — CommunityStore writeKit/readKit/writeHtml (phase-3 plan Task 2). Adds writeKit (validates KitSchema, refuses mismatched slug), readKit (undefined when absent), writeHtml (atomic replace). Tests appended (temp dirs only, no network). pnpm -r typecheck && pnpm -r test green.
sandcastle: #71 — BuildDispatcher (coa-builds workflow_dispatch, phase-3 plan Task 4)
All checks were successful
ci / seam (pull_request) Successful in 1m2s
4319da5305
- server/src/build-dispatcher.ts: DispatchRequest/DispatchResult/BuildDispatcher;
  githubDispatcher POSTs workflow_dispatch (inputs slug/kit_url/build:String/config_url/
  callback_url; Bearer + accept + x-github-api-version; 204->ok, else '<status> <body<=200>',
  network error caught); noopDispatcher() records calls.
- server/src/app.ts: AppDeps.dispatcher; defaultDeps() env-gates github vs noop
  (GITHUB_DISPATCH_TOKEN, COA_BUILDS_REPO/_WORKFLOW/_REF defaults) — inert until #79/#80/#81.
- Test verbatim from plan except stub returns null body for null-body statuses
  (204/205/304): undici rejects a non-null 204 body, so the plan stub threw before the
  dispatcher ran. Assertions unchanged. Ruled two-way-door on the issue.
- STATUS.md milestone log entry. No route calls dispatch yet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- server/src/tenant-provisioner.ts: ProvisionResult/TenantProvisioner;
  httpProvisioner({adminUrl, token, publicUrl, fetch}) POSTs {slug} to
  ${adminUrl}/admin/tenants with Authorization: Bearer — 201 and 409 → ok with
  configUrl=${publicUrl}/${slug}; other statuses/network errors → {ok:false,
  error:'<status> <body≤200>'}. staticProvisioner(publicUrl) returns URL, no call.
- server/src/app.ts: AppDeps.provisioner; defaultDeps() env-gates http vs static
  (COA_SHARED_ADMIN_TOKEN set → http, COA_SHARED_ADMIN_URL/COA_SHARED_PUBLIC_URL
  defaults) — inert (static) until #79/#80/#81. No route provisions yet.
- Test verbatim from plan; fetch always injected, no network.
- STATUS.md milestone log entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sandcastle: #69 — CommunityStore writeKit/readKit/writeHtml (phase-3 plan Task 2)
All checks were successful
ci / seam (pull_request) Successful in 47s
fbaa29bcd6
Adds three methods to CommunityStore (server/src/community-store.ts):
- writeKit(slug, kit): refuses a kit whose slug differs (throws /slug/),
  validates with KitSchema, writes kit.json.
- readKit(slug): parsed Kit or undefined when kit.json is absent (ENOENT).
- writeHtml(slug, html): atomic replace of index.html (temp file + rename).

Tests appended to server/test/community-store.test.ts (temp dirs only, no
network): directory after write+kit is exactly the eight-file listing;
mismatched slug throws; readKit before writeKit is undefined.

STATUS.md milestone log entry. No route calls these yet.

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!103
No description provided.