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
Showing only changes of commit d7b9f81e53 - Show all commits
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# The single pre-merge gate for wiggleverse-ecomm (SD-0001 §6.8). Runs, in order:
# 1. the import-linter layering contract (main > domains > platform)
# 2. the backend test suite (pytest, against Postgres)
# 3. the frontend typecheck + production build
# CI (.gitea/workflows/ci.yml) calls this exact script, so local and server gates
# cannot drift. Exits non-zero on the first failure.
#
# Requires a reachable Postgres for the backend tests: locally the compose service
# (scripts/dev.sh brings it up); in CI a Postgres service container. Override its
# admin DSN with ECOMM_TEST_ADMIN_URL.
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# Pick an interpreter: explicit $PYTHON (CI), else the repo venv, else PATH.
if [ -n "${PYTHON:-}" ]; then
PY="$PYTHON"
elif [ -x "$repo_root/.venv/bin/python" ]; then
PY="$repo_root/.venv/bin/python"
else
PY="$(command -v python3 || command -v python)"
fi
lint="$(dirname "$PY")/lint-imports"
[ -x "$lint" ] || lint="lint-imports"
echo "==> import boundaries (lint-imports)"
( cd "$repo_root/backend" && "$lint" )
echo "==> backend tests (pytest)"
( cd "$repo_root/backend" && "$PY" -m pytest -q )
echo "==> frontend typecheck + build"
( cd "$repo_root/frontend" && npm run build )
echo "==> all gates green"