botwir3 Mechanic
Build Gate
The server-side authorization check that verifies a user has remaining builds before allowing a strategy compile.
The build gate runs before every compile in the builder. It checks the user's profile: do they have an active membership or workshop subscription? How many builds have they used since their last payment? Is the count under the limit?
Factory members get 3 builds per month. Workshop subscribers get the number matching their band (10, 25, 50, 100, or 500). The counter resets when the subscription renews — Stripe fires an invoice.paid event, which creates a new purchase record, advancing the counter anchor.
The build gate is a server-side RPC (build_gate in the database). The builder calls it before compile. If the response is authorized: false, the builder shows the reason and links to pricing. If authorized: true, the compile proceeds.