…act (#15855)
## Why this is needed
Enterprise workspaces exist in production (cloud#6873 provisioned the
plan rows, cloud#6874 published the tier in the contract), but the
frontend cannot represent them: the tier label renders nothing and a
lapsed Enterprise workspace is classified as an ordinary no-subscription
state, exposing the personal subscribe upsell to a sales-managed
customer. The prior attempt (#15403) blocked on deriving this from
`tier`/`plan_slug` string-sniffing because the generated enum could not
carry `ENTERPRISE`. It can now — this PR consumes it as a typed contract
value, no hand-declared or inferred types anywhere.
## Stack — merge order
1. #15838 — tier guard (makes main tolerate unknown tiers)
2. #15813 — ingest-types regeneration (bot-generated, brings
`ENTERPRISE` into the union)
3. **this PR** — typed Enterprise rendering
This branch is stacked on both, so the diff shown against `main`
includes their commits until they merge; the ENTERPRISE handling itself
is the single commit `e7c9ca9` (139 lines, 9 files).
## Root cause
`deriveBillingPolicyState` had no representation for a workspace-level,
sales-managed tier: active-or-lapsed Enterprise fell through to either
the Team branch (never — `isTeamPlan` is false for it) or the generic
`WithoutActiveSubscription`, whose capabilities row upsells self-serve
subscribe. The tier label map simply had no `ENTERPRISE` entry, and
cloud sends lowercase plan slugs (`enterprise_monthly`) that the
uppercase-keyed matcher missed.
## How it changes
- `deriveBillingPolicyState`: typed `input.tier === 'ENTERPRISE'` branch
— active → `{Cloud,Local}AndTeam` (existing team policy), lapsed → new
`{Cloud,Local}EnterpriseWithoutActiveSubscription` state.
- `getBillingPolicyCapabilities`: rows for the new states —
`topUpAccess: 'allowed'`, `showsSubscribeUpsellUI: false`. Sales-managed
reactivation goes through sales, so unlike the lapsed self-serve Team
state it neither withholds top-up nor upsells. This matches the
server-side capability resolver, which resolves
`can_subscribe_self_serve=false` while leaving `can_top_up` open for
Enterprise (verified by executing cloud's resolver during the cloud#7223
review).
- `useWorkspaceTierLabel`: `ENTERPRISE → 'enterprise'` label key;
plan-slug matching now uppercases first so cloud's lowercase slugs
resolve.
- Locale: `subscription.tiers.enterprise.name`.
These policy rows live in the client-side layer that the capabilities
migration stack (#15802–#15675) later deletes in favor of
server-resolved `can_*` values — at which point only the label mapping
survives. That is the intended end state; this PR is the bridge that
makes Enterprise render correctly until then.
## Regression guarantee
- **Characterization matrix**: a new test pins all 28 pre-ENTERPRISE
input combinations (7 tiers × canAccess × isTeamPlan) in both
distributions. The identical matrix was executed against `main`'s
implementation — 28/28 pass — proving every non-ENTERPRISE input
produces byte-identical output before and after.
- **Exhaustive capabilities table**: the per-state test enumerates every
`BillingPolicyState` kind; adding a state without a row is a compile
error, and every pre-existing row is unchanged.
- 26 test files / 380 tests green across
`src/platform/cloud/subscription` and the tier-label suite; `pnpm
typecheck` green against the regenerated types.
- Unknown-future-tier behavior from #15838 retained and re-pinned with a
non-ENTERPRISE exemplar.
## AS-IS / TO-BE
- AS-IS: Enterprise workspace shows no tier label; lapsed Enterprise
sees personal subscribe/upgrade upsell.
- TO-BE: "Enterprise" label renders from the typed tier (including from
`enterprise_monthly`/`enterprise_annual` plan slugs); lapsed Enterprise
keeps top-up but never sees self-serve upsell.
UI screenshots require an Enterprise-provisioned cloud workspace; the
rendered-behavior coverage here is the unit matrix plus the full
Playwright suite on CI. Real-app captures can be added once a staging
Enterprise workspace is available.
---------
Co-authored-by: dante01yoon <6510430+dante01yoon@users.noreply.github.com>
Co-authored-by: Wei Hai <wei@comfy.org>
Co-authored-by: GitHub Action <action@github.com>
Automated Ingest API Type Update
This PR updates the Ingest API TypeScript types and Zod schemas from the latest cloud OpenAPI specification.
These types cover the FE-facing ingest API (workspaces, billing, secrets, assets, tasks, etc.).
Cloud's internal / machine-to-machine surface —
x-internaloperations and the/admin/,/api/internal/,/api/webhooks/rails — is stripped before generation(BE-2669), so it is not code-generated into this public package.