@@ -57,6 +57,7 @@ REND_BILLING_FEATURE_STORAGE_720P=storage_720p_second_months
5757REND_BILLING_FEATURE_STORAGE_1080P=storage_1080p_second_months
5858REND_BILLING_FEATURE_STORAGE_2K=storage_2k_second_months
5959REND_BILLING_FEATURE_STORAGE_4K=storage_4k_second_months
60+ REND_AUTUMN_USAGE_CREDIT_FEATURE_ID=rend_usage_credits
6061```
6162
6263The Autumn dev/sandbox catalog should include:
@@ -69,6 +70,51 @@ The Autumn dev/sandbox catalog should include:
6970Overages should be billed by Autumn/Stripe. Rend does not hardcode plan prices
7071except display fallback copy.
7172
73+ The public V1 production plan IDs must be:
74+
75+ ``` sh
76+ REND_AUTUMN_PLAN_PAYG_ID=pay_as_you_go
77+ REND_AUTUMN_PLAN_BUILDER_ID=builder
78+ REND_AUTUMN_PLAN_SCALE_ID=scale
79+ REND_AUTUMN_PLAN_ENTERPRISE_ID=enterprise
80+ ```
81+
82+ ` rend_usage_credits ` is the Autumn credit-system feature attached to those
83+ plans. It is not a Stripe object managed by Rend.
84+
85+ ## Sandbox and Live Separation
86+
87+ Sandbox and production Autumn keys must never be loaded into the same runtime as
88+ the active ` AUTUMN_SECRET_KEY ` . The production launch gate requires the live
89+ Autumn key to come from ` .env.production.local ` , and the key must be visibly
90+ marked as live. The sandbox parity input should be a separate env file, usually
91+ ` .env.local ` , containing a visibly marked test/sandbox Autumn key.
92+
93+ Read-only parity check:
94+
95+ ``` sh
96+ bun run billing:autumn-parity -- \
97+ --sandbox-env-file .env.local \
98+ --production-env-file .env.production.local
99+ ```
100+
101+ This fetches only the required Autumn features and plans, compares production to
102+ sandbox, verifies the credit-system schema and plan attachments, and writes a
103+ redacted artifact under ` .rend/launch/ ` . It does not copy customers,
104+ subscriptions, or Stripe objects.
105+
106+ If production parity fails because live Autumn catalog objects are missing,
107+ upsert the catalog through Autumn with the explicit mutation flag:
108+
109+ ``` sh
110+ node scripts/with-root-env.mjs --profile production --env-file .env.production.local \
111+ node scripts/setup-autumn-billing.mjs --plans --mux-basic-rates --allow-production-mutation
112+ ```
113+
114+ This command may create or update Autumn products/plans and the Stripe live
115+ objects Autumn manages for them. It must not be replaced with manual Stripe
116+ product or price creation.
117+
72118Use the setup helper to upsert the required feature IDs:
73119
74120``` sh
@@ -177,3 +223,37 @@ POST /internal/operator/billing/delivery-sync
177223Use the dashboard operator billing panel to inspect customer sync status and
178224manually resync an organization. Operators must not mutate plan state directly
179225in Rend; plan/product changes should go through Autumn.
226+
227+ ## Production Dry Run
228+
229+ Run the production dry run only after parity and the production launch gate pass:
230+
231+ ``` sh
232+ bun run launch:gate -- --mode production-check --autumn-sandbox-env-file .env.local
233+
234+ bun run launch:production-dry-run -- \
235+ --allow-production-mutation \
236+ --acknowledge-real-charge \
237+ --plan-id pay_as_you_go
238+ ```
239+
240+ Before running it, deploy or restart the production API on the current build and
241+ confirm migrations through ` 0011_billing_storage_spans.sql ` are applied. The dry
242+ run intentionally fails if upload does not create the ` upload_gate ` billing
243+ event or if storage/delivery usage does not track through Autumn.
244+
245+ ` --acknowledge-real-charge ` is required for every production dry run because
246+ tracked usage can create live Autumn/Stripe billing artifacts even on
247+ ` pay_as_you_go ` . Document the intended plan and expected charge before running
248+ it. The dry run creates or syncs the internal customer
249+ ` Rend Internal Production Dry Run ` , attaches the requested Autumn plan, creates a
250+ scoped live API key, uploads a synthetic fixture through the public API, waits
251+ for playable media, verifies upload check plus delivery/storage usage tracking,
252+ verifies checkout/portal URL creation, verifies public embed/watch playback
253+ through the edge, deletes the asset, revokes the generated API key, and writes a
254+ redacted artifact under ` .rend/launch/ ` .
255+
256+ The dry run intentionally leaves the Autumn customer, plan relationship,
257+ balances, usage, and Autumn-generated Stripe objects visible for dashboard
258+ inspection. It must not be used to create structural Stripe products or prices
259+ outside Autumn.
0 commit comments