Phase 8: Gitea CI — runner probe + PR gating jobs (fast-checks + api) #3

Merged
luckberg merged 66 commits from gsd/phase-08-gitea-ci into main 2026-06-11 16:11:42 -04:00
Showing only changes of commit 92acf02989 - Show all commits
@@ -0,0 +1,79 @@
---
phase: 8
slug: gitea-ci
status: draft
nyquist_compliant: false
wave_0_complete: false
created: 2026-06-11
---
# Phase 8 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-------|
| **Framework** | Vitest 4.1.x (API + PWA unit), @playwright/test 1.60.0 (E2E harness) |
| **Config file** | `apps/api/vitest.config.ts`, `apps/pwa/playwright.config.ts` |
| **Quick run command** | `pnpm lint && pnpm typecheck` |
| **Full suite command** | `pnpm test` then `pnpm test:e2e` (CI=true, dev stack up) |
| **Estimated runtime** | unit ~tens of seconds; harness several minutes (2 device profiles) |
**Note:** Phase 8 delivers CI plumbing (`.gitea/workflows/*.yml`). The "tests" for this phase are the CI workflow runs themselves — validation is observed by triggering the workflow on a branch/PR and reading Gitea Actions logs, not by a local unit-test file per task.
---
## Sampling Rate
- **After every task commit:** YAML lint / `act_runner` dry-validate where possible; push branch and observe the probe/CI run in Gitea Actions
- **After every plan wave:** Confirm all jobs in that wave pass on a test PR (W0 probe green → W1 fast-checks + integration green → W2 harness + publish green)
- **Before `/gsd-verify-work`:** Full CI green on a real PR targeting `main`
- **Max feedback latency:** one CI run (minutes), bounded by the harness job
---
## Per-Task Verification Map
| Task ID | Plan | Wave | Requirement | Threat Ref | Secure Behavior | Test Type | Automated Command | File Exists | Status |
|---------|------|------|-------------|------------|-----------------|-----------|-------------------|-------------|--------|
| _planner-fills_ | — | 0 | CI-01 | — | runner-probe surfaces runner mode / Docker / action resolution | workflow run | observe `.gitea/workflows/runner-probe.yml` in Gitea Actions | ❌ W0 | ⬜ pending |
| _planner-fills_ | — | 1 | CI-01 | — | lint/typecheck/unit/integration gate the PR | workflow run | `pnpm lint`, `pnpm typecheck`, `pnpm test`, `pnpm --filter @familysync/api test` | ✅ (scripts exist) | ⬜ pending |
| _planner-fills_ | — | 2 | CI-01 | — | harness runs against CI dev stack, failure blocks merge | workflow run | `pnpm test:e2e` with `CI=true`, `DEV_AUTH_BYPASS=true` | ✅ (Phase 7 specs) | ⬜ pending |
| _planner-fills_ | — | 2 | CI-02 | T-PAT | image published, PAT never in logs | workflow run | `docker pull <registry>/<repo>:latest` | ❌ W2 | ⬜ pending |
*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky — planner expands one row per task.*
---
## Wave 0 Requirements
- [ ] `.gitea/workflows/runner-probe.yml` — runner-probe workflow (new file; Wave 0 task). Must answer: runner mode (Docker vs host), Docker socket access, `actions/*` resolution, Node 22 / pnpm availability, internet access, WebKit dep installability.
- [ ] `.gitea/workflows/ci.yml` — main CI workflow scaffolding (new file; Waves 12).
*Existing unit/integration/E2E infrastructure (Vitest + Playwright) is reused unchanged; no new local test framework is installed.*
---
## Manual-Only Verifications
| Behavior | Requirement | Why Manual | Test Instructions |
|----------|-------------|------------|-------------------|
| Runner registered on Unraid | CI-01/CI-02 | Operator infra action outside the repo; 0 runners currently registered | Install/register `act_runner` on Unraid against `git.bergerhouse.net`; confirm it appears in Gitea Actions runners list |
| Gitea registry PAT created | CI-02 | Secret creation is an operator action; cannot be scripted in-repo | Create PAT with `write:package`; store as repo secret (e.g. `GITEA_REGISTRY_PAT`); confirm publish job authenticates |
| PR merge actually blocked on failure | CI-01 | Requires branch-protection "required status checks" config in Gitea | Configure required checks on `main`; open a failing PR; confirm merge button is blocked |
---
## Validation Sign-Off
- [ ] All tasks have an observable CI-run verification or Wave 0 dependency
- [ ] Sampling continuity: every wave has a green-gate before the next
- [ ] Wave 0 covers all MISSING references (runner-probe answers all unknowns)
- [ ] No watch-mode flags
- [ ] `nyquist_compliant: true` set in frontmatter (after planner expands the map)
**Approval:** pending