Commit graph

25 commits

Author SHA1 Message Date
ae596f2722 docs(01-10): complete SvelteKit Frontend Scaffold plan
- SUMMARY.md with all accomplishments and deviations
- STATE.md updated with plan 10 position and decisions
- ROADMAP.md updated with plan progress
- REQUIREMENTS.md: UI-05, UI-06 marked complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:57:51 +01:00
ae90d9bfae feat(01-04): add clock warnings, API routes, tests, and server wiring
- Clock API routes: start, pause, resume, advance, rewind, jump, get, warnings
- Role-based access control (floor+ for mutations, any auth for reads)
- Clock state persistence callback to DB on meaningful changes
- Blind structure levels loaded from DB on clock start
- Clock registry wired into HTTP server and cmd/leaf main
- 25 tests covering: state machine, countdown, pause/resume, auto-advance,
  jump, rewind, hand-for-hand, warnings, overtime, crash recovery, snapshot
- Fix missing crypto/rand import in auth/pin.go (Rule 3 auto-fix)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:56:23 +01:00
99545bd128 feat(01-05): implement building block CRUD and API routes
- ChipSetService with full CRUD, duplication, builtin protection
- BlindStructure service with level validation and CRUD
- PayoutStructure service with bracket/tier nesting and 100% sum validation
- BuyinConfig service with rake split validation and all rebuy/addon fields
- TournamentTemplate service with FK validation and expanded view
- WizardService generates blind structures from high-level inputs
- API routes: /chip-sets, /blind-structures, /payout-structures, /buyin-configs, /tournament-templates
- All mutations require admin role, reads require floor+
- Wired template routes into server protected group

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:55:47 +01:00
47e1f19edd feat(01-10): SvelteKit frontend scaffold with Catppuccin theme and clients
- SvelteKit SPA with adapter-static, prerender, SSR disabled
- Catppuccin Mocha/Latte theme CSS with semantic color tokens
- WebSocket client with auto-reconnect and exponential backoff
- HTTP API client with JWT auth and 401 handling
- Auth state store with localStorage persistence (Svelte 5 runes)
- Tournament state store handling all WS message types (Svelte 5 runes)
- PIN login page with numpad, 48px touch targets
- Updated Makefile frontend target for real SvelteKit build

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:54:29 +01:00
9ce05f6c67 feat(01-04): implement clock engine state machine, ticker, and registry
- ClockEngine with full state machine (stopped/running/paused transitions)
- Level management: load, advance, rewind, jump, hand-for-hand mode
- Drift-free ticker at 100ms with 1/sec broadcast (10/sec in final 10s)
- ClockRegistry for multi-tournament support (thread-safe)
- ClockSnapshot for reconnecting clients (CLOCK-09)
- Configurable overtime mode (repeat/stop)
- Crash recovery via RestoreState (resumes as paused for safety)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:51:07 +01:00
8be69688e9 docs(01-01): complete project scaffold + core infrastructure plan
- SUMMARY.md with full execution details, 2 task commits, 2 deviations
- STATE.md updated with position (Plan 2/14), decisions, metrics
- REQUIREMENTS.md: ARCH-01, ARCH-04, ARCH-05, ARCH-06, ARCH-07 marked complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:47:04 +01:00
16caa12d64 feat(01-01): implement core infrastructure — NATS, LibSQL, WebSocket hub, HTTP server
- Embedded NATS server with JetStream (sync_interval=always per Jepsen 2025)
- AUDIT and STATE JetStream streams for tournament event durability
- NATS publisher with UUID validation to prevent subject injection
- WebSocket hub with JWT auth (query param), tournament-scoped broadcasting
- Origin validation and slow-consumer message dropping
- chi HTTP router with middleware (logger, recoverer, request ID, CORS, body limits)
- Server timeouts: ReadHeader 10s, Read 30s, Write 60s, Idle 120s, MaxHeader 1MB
- MaxBytesReader middleware for request body limits (1MB default)
- JWT auth middleware with HMAC-SHA256 validation
- Role-based access control (admin > floor > viewer)
- Health endpoint reporting all subsystem status (DB, NATS, WebSocket)
- SvelteKit SPA served via go:embed with fallback routing
- Signal-driven graceful shutdown in reverse startup order
- 9 integration tests covering all verification criteria

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:42:42 +01:00
9bfd959eaf docs(01-02): complete database schema + migrations plan
- SUMMARY.md with full execution record and deviations
- STATE.md updated: plan 2/14, decisions, session info
- ROADMAP.md updated: Phase 1 progress 2/14
- REQUIREMENTS.md: ARCH-03, ARCH-08, PLYR-01, PLYR-07, SEAT-01, SEAT-02 complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:39:59 +01:00
0afa04a473 feat(01-02): implement migration runner with FTS5, seed data, and dev seed
- Statement-splitting migration runner for go-libsql compatibility
  (go-libsql does not support multi-statement Exec)
- FTS5 virtual table on player names with sync triggers
- Default seed data: DKK venue settings, Standard and Copenhagen chip sets
- Dev-only seed: default admin operator (PIN: 1234, bcrypt hashed)
- Dev mode flag (--dev) controls dev seed application
- First-run setup detection when no operators exist
- Single connection forced during migration for table visibility
- Idempotent: second startup skips all applied migrations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:37:22 +01:00
af13732b2b feat(01-01): initialize Go module, dependency tree, and project scaffold
- Go module at github.com/felt-app/felt with go-libsql pinned to commit hash
- Full directory structure per research recommendations (cmd/leaf, internal/*, frontend/)
- Makefile with build, run, run-dev, test, frontend, all, clean targets
- LibSQL database with WAL mode, foreign keys, and embedded migration runner
- SvelteKit SPA stub served via go:embed
- Package stubs for all internal packages (server, nats, store, auth, clock, etc.)
- go build and go vet pass cleanly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:34:44 +01:00
17dbfc6dc0 feat(01-02): design initial database schema migration
- 23 tables covering venue settings, chip sets, blind structures, payout structures,
  buy-in configs, tournament templates, tournaments, players, tables, seating,
  transactions, bubble prizes, audit trail, and operators
- All financial columns use INTEGER (int64 cents, never REAL/FLOAT)
- Audit trail append-only enforced by SQLite triggers (reject UPDATE except undone_by, reject DELETE)
- All tournament-specific tables reference tournament_id for multi-tournament support
- Comprehensive indexes on foreign keys and common query patterns
- Players table with UUID PK for cross-venue portability

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:31:01 +01:00
aa07c0270d wip: 01-tournament-engine paused at security feedback (1/7 applied)
Applied security fix 1 (no default admin PIN in prod, first-run setup).
Fixes 2-7 remaining: WS auth, HTTP hardening, audit triggers, JWT
validation, NATS subject validation, CSV safety.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 03:17:46 +01:00
21ff95068e docs(01): create Phase 1 plans (A-N) with research and feedback
14 plans in 6 waves covering all 68 requirements for the Tournament
Engine phase. Includes research (go-libsql, NATS JetStream, Svelte 5
runes, ICM complexity), plan verification (2 iterations), and user
feedback (hand-for-hand UX, SEAT-06 reword, re-entry semantics,
integration test, DKK defaults, JWT 7-day expiry, clock tap safety).

Wave structure:
  1: A (scaffold), B (schema)
  2: C (auth/audit), D (clock), E (templates), J (frontend scaffold)
  3: F (financial), H (seating), M (layout shell)
  4: G (player management)
  5: I (tournament lifecycle)
  6: K (overview/financials), L (players), N (tables/more)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 02:58:22 +01:00
5cdd7b0fa7 docs(01): research phase domain 2026-03-01 02:10:18 +01:00
0030d4d2c2 docs(01): capture phase context 2026-03-01 01:59:26 +01:00
aa38a14cb4 docs: save roadmap feedback for next session 2026-02-28 16:11:21 +01:00
19a66014e8 docs: apply requirements feedback (8 items — late reg, balancing confirm, sync templates, PIN rate limit, backup/recovery, display memory, CMS scope) 2026-02-28 16:08:56 +01:00
b5b799cbc8 docs: create roadmap (11 phases) 2026-02-28 16:08:33 +01:00
c846f8edd9 docs: define v1 requirements 2026-02-28 16:03:29 +01:00
ff6ff29af3 docs: address PROJECT.md gaps (platform identity, virtual Leaf, regional organizer, custom domains, business model, dealer portability) 2026-02-28 16:01:09 +01:00
27ee0a5813 docs: complete project research 2026-02-28 15:59:25 +01:00
aa48e52780 chore: update depth to comprehensive 2026-02-28 15:47:28 +01:00
f0d2f16877 docs: initialize project 2026-02-28 15:47:28 +01:00
49c837b0e1 chore: add project config 2026-02-28 15:45:53 +01:00
a254f79bd2 Initial docs/project description including financial models 2026-02-28 15:37:21 +01:00