provisionProductionEnvironment reads the POST /cloud/environments success payload as a FLAT object, but the control plane nests the row under environment — so id and hostname are always undefined.
Found while implementing the ADR-0006 D2 producer-half rename in the cloud repo (objectstack-ai/cloud#1691). Not caused by that rename — this mismatch is on a handler that rename does not touch. Filed unassigned for triage; no fix attempted here.
Measured
packages/app-shell/src/console/organizations/provisionEnvironment.ts declares
ProvisionedEnvironment as { id?: string; hostname?: string; alreadyProvisioned?: boolean }, with id documented as "Environment id (control-plane sys_environment row), when this call minted it";
- and returns
body.data directly as that type, after a deliberately strict envelope check that only verifies data is an object.
The producer is packages/service-cloud/src/routes/environment-lifecycle.ts in objectstack-ai/cloud, which registers POST /cloud/environments and answers 201 with
ok({ environment: result.environment, warnings: result.warnings, durationMs: result.durationMs, ...(hostnameAssignment ? { hostnameAssignment } : {}) })
So data.id and data.hostname do not exist on the wire; the row is one level down, under data.environment. The cloud repo's own tests agree — apps/cloud/test/billing-order-flow.test.ts and production-flow.test.ts read body.data.environment.id.
Why it is quiet
Both fields are optional on the type and the whole call is best-effort by contract (a 403/409 resolves to alreadyProvisioned: true, a genuine failure is swallowed by the caller and the onboarding gate provisions lazily). So nothing throws — the function just reports a successful provision whose id and hostname are undefined, which is the exact "successful provision carrying no env at all" outcome the strict envelope check in that file was written to prevent. The check catches a missing data, not a data of the wrong shape.
Note for whoever picks this up
The cloud control plane is mid-rename under ADR-0006 D2 (epic objectstack-ai/objectstack#12865): response payload keys project / projects become environment / environments on the OTHER control-plane routes. POST /cloud/environments is not part of that rename — it has always answered environment — so a fix here is stable against that work rather than racing it.
Generated by Claude Code
provisionProductionEnvironmentreads thePOST /cloud/environmentssuccess payload as a FLAT object, but the control plane nests the row underenvironment— soidandhostnameare alwaysundefined.Found while implementing the ADR-0006 D2 producer-half rename in the cloud repo (objectstack-ai/cloud#1691). Not caused by that rename — this mismatch is on a handler that rename does not touch. Filed unassigned for triage; no fix attempted here.
Measured
packages/app-shell/src/console/organizations/provisionEnvironment.tsdeclaresProvisionedEnvironmentas{ id?: string; hostname?: string; alreadyProvisioned?: boolean }, withiddocumented as "Environment id (control-planesys_environmentrow), when this call minted it";body.datadirectly as that type, after a deliberately strict envelope check that only verifiesdatais an object.The producer is
packages/service-cloud/src/routes/environment-lifecycle.tsin objectstack-ai/cloud, which registersPOST /cloud/environmentsand answers 201 withSo
data.idanddata.hostnamedo not exist on the wire; the row is one level down, underdata.environment. The cloud repo's own tests agree —apps/cloud/test/billing-order-flow.test.tsandproduction-flow.test.tsreadbody.data.environment.id.Why it is quiet
Both fields are optional on the type and the whole call is best-effort by contract (a 403/409 resolves to
alreadyProvisioned: true, a genuine failure is swallowed by the caller and the onboarding gate provisions lazily). So nothing throws — the function just reports a successful provision whoseidandhostnameareundefined, which is the exact "successful provision carrying no env at all" outcome the strict envelope check in that file was written to prevent. The check catches a missingdata, not adataof the wrong shape.Note for whoever picks this up
The cloud control plane is mid-rename under ADR-0006 D2 (epic objectstack-ai/objectstack#12865): response payload keys
project/projectsbecomeenvironment/environmentson the OTHER control-plane routes.POST /cloud/environmentsis not part of that rename — it has always answeredenvironment— so a fix here is stable against that work rather than racing it.Generated by Claude Code