Skip to content

Session handover — 2026-07-06

Opened the multi-tenant CMS workstream. Settled the topology as a fleet of single-tenant workers — one per site (ADR-0008, new), then shipped Slices 1–2 plus a baked-seed fix. waterfordcountypainters is live as a second, fully isolated worker at wcp.dcathal.org. One commit on master.

What changed — where to look

  • ADR-0008 (new) — CMS deployment topology: one single-tenant worker per site, sharded across Cloudflare accounts (~450/account × ~4). Resolves ADR-0004's "Multi-tenant deferral" by choosing the opposite of the runtime-shared design; rationale grounded in emdash's tenant-less loader (loader.ts slug+locale only). Slice tracker + Slice-2 execution notes are in the ADR.
  • Slice 1 — tenant parameterisation. SITE env → apps/cms/seed/<site>.json via scripts/lib/resolve-site.mjs; emit-theme-css / reseed / transform-seed-images resolve the active site; garvanbay seed renamed seed.jsongarvanbay.json (byte-identical global.css). Swept lib/capture-section-backgrounds.js + lib/cms/apply-section-tones.js too (they read the seed path).
  • Slice 2 — wrangler templating + live 2nd site. sites/<site>.jsonc + wrangler.template.jsoncscripts/emit-wrangler.mjs generates a gitignored wrangler.jsonc (garvanbay byte-identical). Provisioned + deployed WCP: D1 replatform-emdash-waterfordcountypainters (9430e6f7…580), Access app (AUD 6319…291), custom domain wcp.dcathal.org, worker version 94d7469e.
  • Baked-seed fix. scripts/emit-seed.mjs emits .emdash/seed.json per site so a fresh tenant auto-seeds its own content — see known-patterns "emdash bakes the seed from virtual:emdash/seed".
  • known-patterns (2 new): fresh-tenant D1 bootstrap = a human /_emdash login (no headless migrate); baked-seed per-site.
  • known-issues (3 new): cross-account sharding unproven (Slice 2 was same-account); non-fatal No matching export for "default" build errors on Map/Prose/Features (pre-existing); WCP worker carries garvanbay's baked seed (cosmetic, self-corrects on redeploy).

Verified

  • Both sites live & isolated: emdash.dcathal.orgGarvan Bay Accounting (untouched by the WCP deploy); wcp.dcathal.orgWaterford County Painters, 24 pages, HTTP 200; WCP /_emdash/admin 302 → Access with the WCP AUD.
  • Baked-seed fix via the built artifact: a SITE=waterfordcountypainters build has 0 garvanbay strings in dist/.
  • garvanbay wrangler.jsonc + global.css regenerate byte-identical through the new generators (Phase-3 regression).

Live resources created this session (personal account 1ceb…)

WCP D1 (replatform-emdash-waterfordcountypainters), WCP worker + auto-provisioned SESSION KV, plus the operator-created Access app + wcp.dcathal.org domain. R2 is the shared replatform-emdash-media bucket (domain-prefixed, no change).

Next priority

Slice 3 — provisioning + sharding automation (planned): one command to create D1 + Access app + domain + deploy + reseed for a site on a chosen account, automating (or headless-reproducing) the /_emdash-login schema bootstrap. The cross-account sharding proof rides along (see known-issues "Cross-account sharding unproven"). The baked-seed fix already removes the manual clear+reseed step for fresh tenants.