Skip to content

Sprint 3: timed events + lifecycle webhooks - #9

Merged
hynding merged 13 commits into
mainfrom
sprint-3-timed-events
Jul 7, 2026
Merged

Sprint 3: timed events + lifecycle webhooks#9
hynding merged 13 commits into
mainfrom
sprint-3-timed-events

Conversation

@hynding

@hynding hynding commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the Sprint 3 plan (docs/superpowers/plans/2026-07-07-sprint-3-timed-events.md): the TimedEvent primitive — Promocean's market differentiator — plus the webhook system.

  • Core: draft → scheduled → live → ending_soon → ended lifecycle computed on read (no cron for correctness), max-wins activeMultiplier (clamped at achievement targets), offer-to-event attachment (fail-closed), webhook ports
  • Adapter-db: DB-enforced exactly-once transition claims + dead-letter table
  • CMS: TimedEvent + WebhookEndpoint content types (secret lifecycle, private: true), three config-plane endpoints, live-seeded "Double Progress Weekend" (×2)
  • API: multipliers wired into ingestion (fail-open to ×1 — config outages never block writes), event-gated offers, GET /v1/events/live with server-computed countdowns
  • Webhooks: HMAC-signed dispatcher (exact-raw-body signing, per-endpoint isolation, retries with 10s fetch timeout, dead-lettering), lifecycle scheduler with ordered claim-before-fire backfill, and the unlock webhooks deferred since Sprint 1
  • SDK/Widgets/Demo: getLiveEvents(), <EventCountdown /> (wall-clock recompute), demo integration
  • E2e: new timed-event spec (countdown visible + one lesson click → 2/10 under the live ×2 event); the achievement spec's assertion updated accordingly

Test plan

  • 33 API tests (incl. HMAC byte-verification and scheduler exactly-once), workspace 30/30 green
  • All 3 Playwright specs passed live — the timed-event green run is Sprint 3's definition of done
  • CI runs the full suite on a fresh seeded DB — watch the checks

Review notes

Ten tasks through implement → review → fix → re-review, plus a final whole-branch review (verdict: ready with fixes; applied in 3f6e1b5 and re-approved: webhook fetch timeout, orphan-event guard, private secret field, multiplier docs). Follow-ups: #8 (webhook delivery hardening: redelivery/retention/shutdown/replay/SSRF), #4 and #3 extended with Sprint 3 scope notes.

🤖 Generated with Claude Code

hynding and others added 13 commits July 6, 2026 22:41
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ts endpoint

Wire activeMultiplier into POST /v1/events (fail-open to 1 on config-plane
error), activeEventIds into GET /v1/placements/:slug/offer (fail-closed to
an empty set), and add GET /v1/events/live mapping timedEventState to
scheduled/live/ending_soon with countdowns. Also fixes a latent break in
offers.test.ts's fixture (missing timedEventId) exposed once the offer
route started passing a real active-events set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… webhooks

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ate secret, multiplier docs)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hynding
hynding merged commit 2ced718 into main Jul 7, 2026
2 checks passed
@hynding
hynding deleted the sprint-3-timed-events branch July 7, 2026 16:14
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.

1 participant