Public: anyone can read this; the crew can change it.
The forge's own credential pays only for the forge's own repositories; anyone else runs on a grant or not at all #950
Refs #656 (part 1 of 2: the credential fallback. The per-account ceilings follow in a second pull.) What changes. Before, a run with no grant fell back to the forge's own credential, and so did new-app planning.
stopped closed without shipping for issue #656 — its issue is already done deploy 5172e0e
Closes #656 (with #897 for the per-account ceilings, as the lead decided).
Round two, on the lead's word:
- The account's settings (
/settings) and the board say "You have no model budget yet", and who can grant one, for an account that nothing pays for. That means no forge credential and no grant to it or its repositories (hasModelBudget). An app's page says "This repository has no model account yet", linking an admin to Subscriptions (crewKeyNote(ctx, repo)). - Main merged in. The test org for an admin is renamed, because orgs now hold the reserved-name rule (#935).
- Self-added subscriptions stay admin-only (the owner's rule).
For #897: build on pickSubscription's none and ready picks and platformReaches(db, ownerId) / hasModelBudget(db, ownerId) in core/subscriptions.ts. A per-account ceiling belongs beside the budget reservation in pickSubscription, enforced before runClaude in crew/runner.ts where the none pick already ends a run at $0.
Tests: subscriptions (settings and board say it before the grant, and not after). tsc is clean; subscriptions, board, home-feed, studio, web, everyday, looks and the cross files pass (369).
Refs #656 (part 1 of 2: the credential fallback. The per-account ceilings follow in a second pull.)
What changes. Before, a run with no grant fell back to the forge's own credential, and so did new-app planning. That credential is the process environment plus the signed-in Claude config, which is the owner's plan. Now it pays only for the forge's own repositories: those owned by an active site admin, or by an org with an active site admin on its Owners team (
platformReaches, core/subscriptions.ts). Every other repository runs only on an explicit grant, so a new account cannot spend the owner's plan.pickSubscriptionreturns a newnonepick when nothing is granted and the owner is not the forge's.credentialEnvcarries nothing for any pick butreadyandenv.crew/plan.tsruns on the forge's own credential) is offered and run only whereplatformReaches; anyone else picks their crew member by hand.The owner's crew is unchanged. The owner is a site admin, so their repositories and their orgs still get
env. A suspended admin's repositories stop getting it.Already in place, now load-bearing: subscriptions and grants are admin-only and recorded (
created_by); a budgeted account caps each run at what is left and reserves it.Part 2 (next pull, needs a migration): a per-account daily and per-run ceiling enforced before a run starts, and accounts adding their own subscription, which is admin-only today.
Tests (written refusing first; both failed before the change):
envfor an admin and an admin's org;nonefor a newcomer, the newcomer's org, and a suspended admin.nonefor an owner that is not the forge's.statusHash, already fixed on main by 71fa319.Widely used: the
Pickunion gainsnone, andpickSubscriptionanswersnonewhere it used to answerenvfor an owner that is not the forge's. No hot files.🤖 Generated with Claude Code