Skip to content

test(v3): claim-validation for booking invariants and S7-API-1 - #10

Merged
cursor[bot] merged 25 commits into
mainfrom
cursor/v3-claim-tests-7f53
Oct 10, 2026
Merged

cursor[bot] merged 25 commits into
mainfrom
cursor/v3-claim-tests-7f53

Conversation

@granzer69

@granzer69 granzer69 commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Merges the V3 ticket engine stack and verification lab into main.

V3 engine

  • Worker split — dedicated worker command for persist consumer; API serve path separated
  • Redis streams — booking events, consumer groups, readyz pending gate
  • PEL reclaim & recovery — pending message reclaim, shutdown drain, persist recovery integration tests
  • DLQ — failed persist messages routed to dead-letter stream with tests
  • Reconcile — read-only reconcile CLI with Redis/MySQL drift checks
  • Security baseline (Slice 7) — constant-time API key auth on /book; claim tests for S7-API-1 and booking invariants (INV-1–3, INV-6)

Verification lab

  • Go runner (verilab), claims scenarios, loadgen, metrics/SSE hub
  • Vite/React console under verification-lab/web
  • CI: go test ./... (includes lab packages), integration tests, npm build for lab UI

Test plan

go test ./...
go test -race ./...
go test ./verification-lab/...
go test -tags=integration ./integration/...   # needs MySQL + Redis
cd verification-lab/web && npm ci && npm run build

Follow-ups (post-merge)

  • Lane 2: P1–P7 gates + evidence via lab runners
  • Benchmarks (15k / high inventory) and failure lab (INV-4/7)
Open in Web Open in Cursor 

cursoragent and others added 25 commits October 5, 2026 12:10
- Serve mode no longer runs consumer.Run; add go run . worker
- Wire worker in Compose, Makefile dev, CI, and integration harness
- Add TestServeDoesNotStartConsumer and TestWorkerCommandStartsConsumer
- Document serve-only does not persist to MySQL

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
001 creates a non-unique idx_tickets_user_id; 002 must replace it so CI seed does not fail with duplicate key name.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Add periodic XAUTOCLAIM and pending-0 replay in the persist consumer,
graceful shutdown with inflight drain and group pending logging on SIGTERM,
plus unit and integration tests for reclaim and crash recovery.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Drop non-unique idx_tickets_user_id before creating the unique index so CI
seed succeeds on a fresh MySQL. After max delivery attempts, failed persist
messages move to bookings.dlq and are acked off the main stream.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Distinct consumer names via env/HOSTNAME, parallel persist handlers,
role-based MySQL pool limits, and /readyz 503 when group pending is too high.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Replay path checks hash:user before enqueueing persist catch-up.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
…4d' into cursor/v3-phase2-pel-reclaim-77e4

# Conflicts:
#	migrations/002_ticket_state.sql

Co-authored-by: granzer69 <148038889+granzer69@users.noreply.github.com>
V3 phases 2–4: reclaim, DLQ, scale-out, CI migration fix
…ery test

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Replace mutation-capable reconcile with internal/reconcile read-only report:
inventory (in-flight aware), ownership, duplicates, stream PEL/DLQ.
Exit 0/1/2; unit and integration tests; docs update.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Remove global persist worker from CI; persist integration tests run their
own consumers. Use NULL for unassigned tickets under UNIQUE(user_id).
Align ensureTicketsTable with migration schema.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Use synchronous ProcessMessageSync in TestPersistDLQ instead of Run loop.
Remove early sqlDB.Close during background consumers; unique consumer names.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
- Add one-user-one-ticket and one-ticket-one-winner allocator tests
- Add API key scope and idempotent booking with key HTTP tests
- Add book-to-MySQL persist path test via consumer
- Extend V3_SECURITY_PROOF S7-API-1 procedure

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Add verification-lab Go API/runner/claims/loadgen packages and Vite UI.
Fix race detector issues in claims HTTP client and runner report reads.
Extend CI with npm build for verification-lab/web.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Add gates preset to POST /api/runs, subprocess go test execution per
registry mapping, live /readyz and missing API key probes, and UI to
run all gates or individual P1-P7 with evidence export.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Add benchmark-smoke, exhaustion (5k mini + 100k), and saturated-15k lab
profiles with extra.benchmark export (RPS, latency percentiles including
p99, queue/mysql deltas). Wire RunControl UI and loadgen p99.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Implement failure-lab scenarios (worker pending probe, restart inventory
test, DLQ read-only, reconcile CLI) behind confirm_fault on POST
/api/runs. Add catalog endpoint and Failure lab panel in the web UI.

Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
Co-authored-by: Ribhu S <granzer69@users.noreply.github.com>
@granzer69
granzer69 marked this pull request as ready for review October 10, 2026 06:53
@cursor
cursor Bot merged commit 58f7c64 into main Oct 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants