feat(cli,client)!: drop os environments create --template and the template_id body field (#3731) - #3738
Merged
Merged
Conversation
…template_id` body field (#3731) The CLI advertised `--template` as "Built-in template id (e.g. crm, todo, blank)" and forwarded it as `template_id` on `projects.create()`. Nothing consumes it: `template_id`/`templateId` appears in zero non-test files in the `cloud` repo, `sys_environment` has no such column, and the create route whitelists what it reads (displayName, organizationId, isDefault, hostname, metadata, environmentType) — `template_id` is not in the list. The blank/crm/todo registry the flag named was the `apps/server` `createTemplatesRoutePlugin` snapshot, removed when the control plane moved to cloud; the flag outlived it. So it was accepted, transmitted, and dropped — no seeding, no error, no stored trace. Worse than the 404 its listing counterpart returned (#3702): a 404 tells the caller something is wrong, a silently ignored flag reports success. That is the "never advertise a capability the runtime doesn't deliver" corollary of Prime Directive #10. Starter content comes from the App Marketplace instead — `sys_package` rows with `is_starter = true`, installed via `projects.packages.install`, which is what the console already does. NOT the same `--template` as `os init` / `create-objectstack` (app/plugin/empty scaffolds); those are local scaffolding and are untouched. No doc references `os environments create --template`, so nothing to sweep. Closes #3731 Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 18 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3731. Sibling of #3702 / #3730 — the same dead concept, other half.
What was wrong
#3702removedprojects.listTemplates()because nothing mounted its route. The writing half survived, and it fails worse:packages/cli/src/commands/environments/create.tsadvertised--templateas "Built-in template id (e.g.crm,todo,blank)" and forwarded it astemplate_id.packages/client/src/index.tsdeclaredtemplate_id?: stringon theprojects.create()body.Nothing reads it:
template_id/templateIdappears in zero non-test.tsfiles incloud.sys_environmenthas no such column — the value is not even stored.environment-lifecycle.ts):displayName/display_name,organizationId/organization_id,isDefault,hostname,metadata,environmentType/environment_type— then hardcodesdriver: 'turso',plan: FREE_PLAN,storageLimitMb: 1024,visibility: 'private'.template_idis not in the list.sys_package.object.tsstates the position: there "is no separate 'template' concept";apps/cloud/objectstack.config.ts: "No built-in environment templates: every environment is provisioned empty."The
blank/crm/todoregistry the flag named was theapps/servercreateTemplatesRoutePluginsnapshot (CHANGELOG ~L1143), removed when the control plane moved tocloud. The flag outlived the registry by an entire architecture.So
os env create --name X --template crmwas accepted, sent, and dropped — no seeding, no error, no trace. Worse than the 404 its listing counterpart returned: a 404 tells the caller something is wrong; a silently ignored flag reports success. That is the "never advertise a capability the runtime doesn't deliver" corollary of Prime Directive #10.Migration
os environments create --template <id>→ drop the flag; it never did anything. Starter content comes from the App Marketplace: create the environment, then install the package (sys_packagerows withis_starter = true—client.projects.packages.install(envId, { packageId })), which is what the console already does. TypeScript now rejectstemplate_idonprojects.create(), which is the point — the field was being discarded on the wire.Not the same
--templateasos init/create-objectstack(app/plugin/emptyscaffolds). Those are local scaffolding, alive, and untouched — including every doc that mentions them. No doc referencesos environments create --template, so there was nothing to sweep.Verification
packages/cli— 62 files / 642 tests pass;packages/client— 13 / 175 pass.pnpm build71/71 with dts on;packages/client/dist/index.d.tsno longer carries the property (the one remaining hit is the tombstone comment).--templateis gone fromenvironments create --help, andos environments create --org x --name y --template crmnow exits withError: Nonexistent flag: --templateinstead of silently "succeeding".Found on the way, filed separately
The audit that produced this found that
template_idis not the only unread field in that body — see #3739 for the full table (clone_from_environment_idunread,is_defaultsent in a dialect the handler does not accept,env_typelikewise,slug/region/project_type/is_systemnever read,driver/plan/storage_limit_mboverridden by policy while typed as settable). That one needs decisions, not just a trim, and both route-level guards are blind to it because they compare URLs, not request bodies.🤖 Generated with Claude Code