Sprint 12: monetization — plan entitlements, usage API, landing page, licensing channels - #30
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
planIdSchema(free|growth|scale|enterprise),usageQuerySchema/usageResponseSchema, newmau_limit_exceedederror code (all flow into the generated OpenAPI doc)PLANStable + pureevaluateUsage();AuthContext.plan(null= self-hosted/unmetered)planenumeration on the project content type, carried on config-planeverify-key(contentTypes.d.ts regenerated)null, never fails auth (an un-migrated CMS keeps verifying keys)PgUsageStore.getUsage/isUserActiveread models over the existing MAU/usage tablesGET /v1/usage(sk-only;?month=YYYY-MMhistory for billing reconciliation; plan standing always evaluated against live-env MAU — test is free).USAGE_ENFORCEMENT=off|warn|blockgate onPOST /v1/events:warndefault (over-limit →x-promocean-usageheader),block402s 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 setDemand capture
apps/www: static landing + pricing page (single file, no build), deployed by the newpages.ymlworkflow (GitHub Pages — set repo Pages source to "GitHub Actions")COMMERCIAL-LICENSE.md(linked from LICENSING.md): dual-licensing channel for the GPL platformFUNDING.yml(activates on Sponsors enrollment), README pointersTests
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.mdPhase 0: enable Pages, enroll Sponsors, then the Phase 1 deploy prompt.🤖 Generated with Claude Code