beans update

This commit is contained in:
2026-03-20 21:59:43 +01:00
parent 3881971214
commit 2364922b58
5 changed files with 124 additions and 1021 deletions

View File

@@ -0,0 +1,68 @@
---
# nuzlocke-tracker-1y09
title: Enforce feature branch workflow for agents
status: todo
type: task
priority: high
created_at: 2026-03-20T20:48:21Z
updated_at: 2026-03-20T20:59:21Z
---
## Problem
Agents sometimes commit directly to `develop` instead of creating feature branches. The CLAUDE.md branching strategy documents the intent but isn't enforced — agents can ignore it.
## Solution
Add a Claude Code `PreToolCall` hook that blocks `git commit` when the current branch is `develop` or `main`, forcing agents to always work on `feature/*` branches. Also update CLAUDE.md to document the stricter workflow.
**Scope:** Agent-only enforcement (humans can still commit on `develop` if needed).
## Changes
### 1. Claude Code hook (`.claude/settings.json`)
Add a `PreToolCall` hook that:
- Triggers on `Bash` tool calls containing `git commit`
- Checks the current branch name via `git branch --show-current`
- **Blocks** if branch is `develop` or `main` with a clear error message
- **Allows** if branch matches `feature/*` or any other pattern
```json
{
"hooks": {
"PreToolCall": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash -c 'if echo \"$TOOL_INPUT\" | grep -q \"git commit\"; then BRANCH=$(git branch --show-current); if [ \"$BRANCH\" = \"develop\" ] || [ \"$BRANCH\" = \"main\" ]; then echo \"BLOCK: Cannot commit directly to $BRANCH. Create a feature branch first: git checkout -b feature/<name>\"; exit 2; fi; fi'"
}
]
}
]
}
}
```
> Note: Exit code 2 blocks the tool call. The hook should parse `$TOOL_INPUT` (JSON) to check for git commit commands.
### 2. CLAUDE.md update
Update the "Branching Strategy" section to add:
- **Never commit directly to `develop` or `main`.** Always create a `feature/*` branch first.
- When starting an **epic**, create `feature/<epic-title-slug>` off `develop`
- When starting a **standalone task/bug** (no parent epic), create `feature/<task-title-slug>` off `develop`
- Each task within an epic gets its own commit(s) on the epic's feature branch
- Branch naming: use a kebab-case slug of the bean title (e.g., `feature/add-auth-system`)
- When the epic/task is complete, squash merge into `develop`
## Checklist
- [ ] Add `PreToolCall` hook to `.claude/settings.json` that blocks commits on `develop`/`main`
- [ ] Test hook by verifying it blocks a commit attempt on `develop`
- [ ] Test hook by verifying it allows a commit on a `feature/*` branch
- [ ] Update CLAUDE.md branching strategy with new workflow rules
- [ ] Verify hook handles edge cases (e.g., `git commit --amend`, `git commit -m "..."`)

View File

@@ -0,0 +1,54 @@
---
# nuzlocke-tracker-he1n
title: Add local GoTrue container for dev auth testing
status: todo
type: feature
created_at: 2026-03-20T20:57:04Z
updated_at: 2026-03-20T20:57:04Z
---
## Problem
The current local Docker setup has no auth service — Supabase is only available as a cloud service. This means:
- Auth flows (login, signup, JWT verification) cannot be tested locally
- The frontend's `supabase.ts` falls back to a stub client (`http://localhost:54321`) that doesn't actually exist
- Backend tests mock auth entirely via `conftest.py` fixtures, so integration testing of the full auth flow is impossible
## Approach
Add a **GoTrue** container (Supabase's auth engine) to the local `docker-compose.yml`. GoTrue is a standalone Go service that provides the same auth API that Supabase cloud exposes. This gives us local email/password auth without needing Discord/Google OAuth providers configured.
**Architecture (Option 3):**
- **Local dev**: Own PostgreSQL + GoTrue container → full auth testing
- **Production**: Own PostgreSQL + Supabase cloud for auth (handles Discord/Google OAuth)
GoTrue will use the existing `db` PostgreSQL container, creating its own `auth` schema (separate from the app's tables managed by Alembic).
## Files to modify
- `docker-compose.yml` — add GoTrue service, configure env vars
- `.env.example` — add GoTrue-specific local defaults
- `frontend/src/lib/supabase.ts` — point to local GoTrue when in dev mode
- `backend/src/app/core/config.py` — may need local JWT secret default
- `README.md` or docs — document local auth setup
## Checklist
- [ ] Research GoTrue Docker image and required env vars (JWT secret, DB connection, SMTP disabled, etc.)
- [ ] Add `gotrue` service to `docker-compose.yml` using the existing `db` container
- [ ] Configure GoTrue to use the same PostgreSQL with its own `auth` schema
- [ ] Set local JWT secret (e.g. `super-secret-jwt-token-for-local-dev`) shared between GoTrue and the backend
- [ ] Update `.env.example` with local GoTrue defaults (`SUPABASE_URL=http://localhost:9999`, local JWT secret, local anon key)
- [ ] Update `frontend/src/lib/supabase.ts` to use `http://localhost:9999` in dev (GoTrue's local port)
- [ ] Verify backend JWT verification works with GoTrue-issued tokens (same HS256 + shared secret)
- [ ] Test email/password signup and login flow end-to-end locally
- [ ] Verify OAuth buttons gracefully handle missing providers in local dev (show disabled state or helpful message)
- [ ] Update `docker-compose.yml` healthcheck for GoTrue readiness
- [ ] Document the local auth setup in README or contributing guide
## Notes
- GoTrue image: `supabase/gotrue` (official, regularly updated)
- GoTrue needs: `GOTRUE_DB_DATABASE_URL`, `GOTRUE_JWT_SECRET`, `GOTRUE_SITE_URL`, `GOTRUE_EXTERNAL_EMAIL_ENABLED=true`, `GOTRUE_MAILER_AUTOCONFIRM=true` (skip email verification locally)
- The `anon` key for local dev can be a static JWT signed with the local secret (Supabase docs show how to generate this)
- Production docker-compose.prod.yml is NOT modified — it continues using Supabase cloud via env vars

View File

@@ -1,11 +1,11 @@
---
# nuzlocke-tracker-kix5
title: Fix e2e tests after boss feature changes
status: draft
status: scrapped
type: bug
priority: normal
created_at: 2026-03-20T19:19:31Z
updated_at: 2026-03-20T19:19:36Z
updated_at: 2026-03-20T20:49:19Z
blocked_by:
- nuzlocke-tracker-neqv
---