Add the lane-C reader surface: list, detail, and an action button-group
fragment over the lane-A store reads/actions, behind the web.Auth seam.
- Templ components (base layout, list+filters, detail, ActionButtons) with
committed *_templ.go so go build/task check work without the templ binary;
`task generate` regenerates. Filters and action toggles are HTMX-swapped and
degrade to plain form GET/POST (POST→303→GET) without JS.
- Handlers (internal/web): GET / (channel+date filters, in-memory),
GET /v/{videoId}, POST /v/{videoId}/action (re-click clears, else SetAction;
store enforces watched↔skipped exclusion), GET /healthz (no auth). Store ops
run as the configured UserID; Auth only gates.
- `tapir serve` wires store + StubAuth{Subject: cfg.UserID} + http.Server on
TAPIR_HTTP_ADDR (default :8080), graceful shutdown on signal. Handlers depend
only on web.Auth — Conductor swaps StubAuth → oidc.DexAuth at merge (one line
in cmdServe).
- Handler tests: real store (embedded-postgres) + StubAuth — list rows+state,
HTMX fragment vs full page, channel filter, detail highlights/takeaways,
404, action toggle+clear, no-JS redirect, bad-verb 400.
New dep: github.com/a-h/templ — the house default for typed server-rendered
HTML (CLAUDE.md stack, ui-spec.md §3). Generated code is committed so the
templ binary is build-time-optional.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
version: "3"
|
|
|
|
# Quality gate for Tapir. `task check` is THE gate referenced by ADR-009 and the
|
|
# CI workflow. Run it before every push (TBD: commit directly to main).
|
|
|
|
tasks:
|
|
default:
|
|
cmds:
|
|
- task: check
|
|
|
|
check:
|
|
desc: Full quality gate — fmt check, vet, lint, test.
|
|
cmds:
|
|
- task: fmt-check
|
|
- task: vet
|
|
- task: lint
|
|
- task: test
|
|
|
|
fmt:
|
|
desc: Format all Go code.
|
|
cmds:
|
|
- gofmt -w .
|
|
|
|
fmt-check:
|
|
desc: Fail if any file is not gofmt-clean.
|
|
cmds:
|
|
- "test -z \"$(gofmt -l .)\" || { echo 'gofmt: files need formatting:'; gofmt -l .; exit 1; }"
|
|
|
|
vet:
|
|
desc: go vet.
|
|
cmds:
|
|
- go vet ./...
|
|
|
|
lint:
|
|
desc: golangci-lint (installed by CI; skipped locally if absent).
|
|
cmds:
|
|
- 'command -v golangci-lint >/dev/null 2>&1 && golangci-lint run ./... || echo "golangci-lint not installed — skipping (CI installs it)"'
|
|
|
|
test:
|
|
desc: Run all tests, including the acceptance suite (RED until the engine is implemented).
|
|
cmds:
|
|
- go test ./...
|
|
|
|
generate:
|
|
desc: Regenerate Templ components (*_templ.go) from *.templ sources.
|
|
cmds:
|
|
- 'command -v templ >/dev/null 2>&1 && templ generate || go run github.com/a-h/templ/cmd/templ@latest generate'
|
|
|
|
build:
|
|
desc: Compile the binary.
|
|
cmds:
|
|
- go build -o bin/tapir ./cmd/tapir
|
|
|
|
skills:
|
|
desc: Wire the engineering skills library into this repo (symlinks, gitignored).
|
|
cmds:
|
|
- curl -fsSL https://gitea.d-ma.be/mathias/skills/raw/branch/main/install.sh | bash
|