SLICE-1: walking skeleton (SD-0001 §7.2) — scaffold, dev Postgres, migration runner, /healthz #5

Merged
ben.stull merged 13 commits from claude/agitated-heyrovsky-1a1f47 into main 2026-06-10 15:50:42 +00:00
Owner

Summary

Implements SLICE-1 (walking skeleton) of SD-0001 v0.3.0 §7.2 — the localhost half of BUC-5 (PUC-10). A clean checkout now boots a four-layer FastAPI backend against an empty, self-migrating PostgreSQL database and serves /healthz.

Ships:

  • Backend 4-layer package main > domains > platform with the import-linter contract (§6.2; GraphQL api layer deferred).
  • platform/db — psycopg 3 + small pool, forward-only migration runner (advisory-lock-guarded, fail-stop, INV-7) and migration 0001 laying the §6.3 schema (account, auth_code, storefront, storefront_membership; INV-2/4/5 honored — no UNIQUE(account_id)).
  • platform/config — single env-driven config surface (INV-8).
  • FastAPI factory + /healthz (200/503 per §6.4); self-migrates at startup (INV-1).
  • Dev Postgres compose.yaml (single pinned postgres:16, named volume, healthcheck; D-7).
  • scripts/dev.sh (owns the container lifecycle; bash-3.2 portable) and scripts/check.sh (the single gate: lint-imports + pytest + frontend build).
  • Vite/React shell with /api proxy; Gitea CI workflow; docs/BOOTSTRAP.md localhost runbook.

Test Plan

  • scripts/check.sh green — import-linter contract kept, 7 pytest green against real Postgres, frontend tsc + build.
  • Clean-checkout simulation (.venv + node_modules moved aside, docker compose down -v) → scripts/dev.sh/healthz 200 {"status":"ok"} on an empty self-migrated DB (0 accounts, migration 0001 applied).
  • Migration runner: migrate-from-empty + idempotent re-migrate (INV-1 partial); INV-4 many-capable shape asserted.
  • dev.sh Ctrl-C reaps both :8000 and :5173 cleanly.
  • CI gate (inert until a Gitea Actions runner is registered).

Per session ecomm-0021. Plan: docs/superpowers/plans/2026-06-10-slice-1-walking-skeleton.md.

🤖 Generated with Claude Code

## Summary Implements **SLICE-1 (walking skeleton)** of [SD-0001 v0.3.0](https://git.wiggleverse.org/wiggleverse/wiggleverse-ecomm-content/src/branch/main/specs/SD-0001-mvp-sign-up-and-single-storefront.md) §7.2 — the localhost half of BUC-5 (PUC-10). A clean checkout now boots a four-layer FastAPI backend against an empty, self-migrating PostgreSQL database and serves `/healthz`. **Ships:** - Backend 4-layer package `main > domains > platform` with the import-linter contract (§6.2; GraphQL `api` layer deferred). - `platform/db` — psycopg 3 + small pool, forward-only **migration runner** (advisory-lock-guarded, fail-stop, INV-7) and migration `0001` laying the §6.3 schema (`account`, `auth_code`, `storefront`, `storefront_membership`; INV-2/4/5 honored — no `UNIQUE(account_id)`). - `platform/config` — single env-driven config surface (INV-8). - FastAPI factory + `/healthz` (200/503 per §6.4); self-migrates at startup (INV-1). - Dev Postgres `compose.yaml` (single pinned `postgres:16`, named volume, healthcheck; D-7). - `scripts/dev.sh` (owns the container lifecycle; bash-3.2 portable) and `scripts/check.sh` (the single gate: lint-imports + pytest + frontend build). - Vite/React shell with `/api` proxy; Gitea CI workflow; `docs/BOOTSTRAP.md` localhost runbook. ## Test Plan - [x] `scripts/check.sh` green — import-linter contract kept, **7 pytest** green against real Postgres, frontend tsc + build. - [x] Clean-checkout simulation (`.venv` + `node_modules` moved aside, `docker compose down -v`) → `scripts/dev.sh` → `/healthz` **200** `{"status":"ok"}` on an empty self-migrated DB (0 accounts, migration 0001 applied). - [x] Migration runner: migrate-from-empty + idempotent re-migrate (INV-1 partial); INV-4 many-capable shape asserted. - [x] `dev.sh` Ctrl-C reaps both `:8000` and `:5173` cleanly. - [ ] CI gate (inert until a Gitea Actions runner is registered). Per session ecomm-0021. Plan: `docs/superpowers/plans/2026-06-10-slice-1-walking-skeleton.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ben.stull added 13 commits 2026-06-10 15:50:32 +00:00
Just-in-time plan for SLICE-1 (§7.2): backend 4-layer scaffold + import-linter,
dev Postgres compose, psycopg migration runner + migration 0001, /healthz,
scripts/check.sh + dev.sh, Vite/React shell, CI, docs/BOOTSTRAP.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Four-layer package (main > domains > platform) per SD-0001 §6.2; GraphQL api layer
deferred. main.py is a stub so the top layer exists from the start (fleshed out in
the /healthz task). lint-imports green on the skeleton.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Forward-only, fail-stop, advisory-lock-guarded psycopg runner; migration 0001 lays
the account/auth_code/storefront/membership schema. Tests prove migrate-from-empty
and idempotent re-migrate (INV-1 partial) and the INV-4 many-capable shape.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Single tsconfig (no project-references split — avoids composite/noEmit friction for
the minimal shell); tsc typechecks src, vite loads its config via esbuild.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
macOS ships bash 3.2 (no wait -n): poll with kill -0 instead. npm spawns vite as a
grandchild, so cleanup now recurses pgrep -P to reap the whole subtree — Ctrl-C frees
both :8000 and :5173 cleanly. Verified clean-checkout -> dev.sh -> empty self-migrated
Postgres -> /healthz 200, and trap teardown.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
docs(slice-1): README status — walking skeleton in place
ci / check (push) Has been cancelled
ci / check (pull_request) Has been cancelled
f184802f1f
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ben.stull merged commit 9373177ed3 into main 2026-06-10 15:50:42 +00:00
Sign in to join this conversation.