Skip to content

Sprint 12: monetization — plan entitlements, usage API, landing page, licensing channels - #30

Merged
hynding merged 2 commits into
mainfrom
sprint-12-monetization
Aug 21, 2026
Merged

Sprint 12: monetization — plan entitlements, usage API, landing page, licensing channels#30
hynding merged 2 commits into
mainfrom
sprint-12-monetization

Conversation

@hynding

@hynding hynding commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Turns the code-complete platform into a billable one, plus the demand-capture surface. Design spec: docs/superpowers/specs/2026-08-20-sprint-12-monetization-design.md. Execution playbook with follow-up prompts: docs/monetization/PLAYBOOK.md.

Plan entitlements + usage metering (the metering→billing bridge)

  • contracts: planIdSchema (free|growth|scale|enterprise), usageQuerySchema/usageResponseSchema, new mau_limit_exceeded error code (all flow into the generated OpenAPI doc)
  • core: PLANS table + pure evaluateUsage(); AuthContext.plan (null = self-hosted/unmetered)
  • cms: optional plan enumeration on the project content type, carried on config-plane verify-key (contentTypes.d.ts regenerated)
  • adapter-strapi: plan parsed fail-open — junk/absent value degrades to null, never fails auth (an un-migrated CMS keeps verifying keys)
  • adapter-db: PgUsageStore.getUsage/isUserActive read models over the existing MAU/usage tables
  • api: GET /v1/usage (sk-only; ?month=YYYY-MM history for billing reconciliation; plan standing always evaluated against live-env MAU — test is free). USAGE_ENFORCEMENT=off|warn|block gate on POST /v1/events: warn default (over-limit → x-promocean-usage header), block 402s only users not already active this month (never locks out an active user mid-month), fails open on store errors, zero overhead when no plan is set

Demand capture

  • apps/www: static landing + pricing page (single file, no build), deployed by the new pages.yml workflow (GitHub Pages — set repo Pages source to "GitHub Actions")
  • COMMERCIAL-LICENSE.md (linked from LICENSING.md): dual-licensing channel for the GPL platform
  • Cloud-waitlist issue template, FUNDING.yml (activates on Sponsors enrollment), README pointers

Tests

All suites green: api 200 (12 new), core 132 (8 new), adapter-db 85 (4 new), adapter-strapi 55 (3 new). Also fixed pre-existing date-rot in timed-events.test.ts (fixtures hardcoded July/Aug 2026 windows that the calendar passed on 2026-08-20 — clocks now pinned with fake timers).

Changeset included for @promocean/contracts (minor).

After merging

Work docs/monetization/PLAYBOOK.md Phase 0: enable Pages, enroll Sponsors, then the Phase 1 deploy prompt.

🤖 Generated with Claude Code

hynding and others added 2 commits August 20, 2026 17:29
…g bridge

- contracts: planIdSchema, usage query/response schemas, mau_limit_exceeded error code
- core: PLANS table + pure evaluateUsage(); AuthContext.plan (null = self-hosted/unmetered)
- cms: optional project.plan enumeration, carried on config-plane verify-key
- adapter-strapi: plan parsed fail-open (junk/absent -> null, never failed auth)
- adapter-db: PgUsageStore.getUsage/isUserActive read models
- api: GET /v1/usage (sk only, ?month= history for billing reconciliation);
  USAGE_ENFORCEMENT=off|warn|block gate on POST /v1/events — warn default,
  block never locks out users already active in the month; fails open on
  store errors; zero overhead when no plan is set
- tests: 12 new api tests, 8 core, 4 adapter-db, 3 adapter-strapi; fixed
  date-rotted timed-events fixtures by pinning fake clocks
- docs: README plans section + /v1/usage row; monetization design spec

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ensing, waitlist, monetization playbook

- apps/www: static landing + pricing page (dark, single-file, no build step),
  deployed via .github/workflows/pages.yml (GitHub Pages, workflow_dispatch or
  push to main touching apps/www)
- COMMERCIAL-LICENSE.md: dual-licensing channel for the GPL platform; linked
  from LICENSING.md and the page
- .github/ISSUE_TEMPLATE/cloud-waitlist.md: zero-infrastructure cloud waitlist
- .github/FUNDING.yml: GitHub Sponsors pointer (activates on enrollment)
- README: cloud waitlist + commercial license pointers
- docs/monetization/PLAYBOOK.md: sequenced phases 0-6 from merged code to first
  dollar, with ready-to-paste follow-up prompts (deploy, Stripe, self-serve,
  launch, first customers) and a decision log

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hynding
hynding merged commit 7835ea2 into main Aug 21, 2026
2 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.

1 participant