Status: Accepted (v4 — supersedes v3) — API-surface vocabulary boundary recorded 2026-08-27 (#12473): the v5.0 project → environment rename stops at the CLI's user-facing vocabulary; three API surfaces keep project deliberately (see the addendum). D1 retired by execution (2026-08-28, #12867 — see the second addendum): D2 fired on the maintainer's 2026-08-28 ruling; all three of those surfaces are renamed to environment / environments with no aliases, authored and parked for one coordinated release. Read the first addendum's D1 as history — the boundary it draws no longer exists.
Versions of this number: v2 · v3 · v4, current — one decision revised twice; the number is shared only by its own revisions (AGENTS.md Prime Directive 13). A version is cited as ADR-0006 v4 in prose or, stem-qualified, as ADR-0006-project-environment-split.v4.
Date: 2026-05-20 (v4)
Deciders: ObjectStack Protocol Architects
Supersedes: v1 (strict tree), v2 (siblings + sys_deployment join), v3 (siblings + deferred dev-workspace sys_project)
Builds on: ADR-0002 (Environment-Per-Database Isolation), ADR-0003 (Package as First-Class Citizen)
Consumers: @objectstack/service-tenant, @objectstack/service-cloud, @objectstack/spec/cloud, @objectstack/cli, the Console cloud_control app
v4 revision note — v3 kept
sys_projectreserved as a future dev-workspace concept (Phase 5 Builder UX). When we started drafting the Phase 5 schema we realised that the responsibilities we were about to hand tosys_projectare already covered bysys_package/sys_package_version/sys_package_installation(ADR-0003). Introducing a parallel "Project + Branch + Revision" stack would create two competing version-management trees in the control plane, exactly the drift this ADR family exists to eliminate.v4 therefore deletes the dev-workspace Project concept entirely. There is no
sys_project*table. There is nosys_environment_revisiontable in the target state — both are subsumed by the existing package three-tier (identity / immutable version / per-env installation).The local dev workspace continues to exist — but as local files + git, not as a server-side table. A
objectstack publishfrom any working copy is just "create a newsys_package_versionfor the implicit package that represents this code base".
After v3 we attempted to scope the Phase 5 dev-workspace schema and immediately hit overlap:
| Need | v3 plan (sys_project*) |
What already exists (sys_package*) |
|---|---|---|
| Code identity + namespace | sys_project (slug, owner_org) |
sys_package (manifest_id, owner_org, visibility) |
| Immutable version snapshots | sys_project_revision (commit_id, checksum, storage_key) |
sys_package_version (semver, checksum, storage_key, status) |
| Per-env deployment | (would have needed sys_deployment) |
sys_package_installation (env × package × version) |
| Cross-env promotion | (would have needed a join) | INSERT INTO sys_package_installation … SELECT … FROM staging-env |
| Marketplace distribution | n/a | visibility = 'marketplace', is_starter |
| Dependency declaration | n/a | sys_package_version.manifest_json deps |
Every Project responsibility maps 1:1 onto an existing Package row. The
only "missing" capability — git-style branches (parallel main / staging
/ feature heads) — can be expressed today with semver prereleases
(1.2.3-staging.4) and elevated to a real sys_package_channel mechanism
later when CI demands it.
Meanwhile the CLI publish path currently writes a third revision table
(sys_environment_revision, introduced transitionally during v3 cleanup).
That table holds nothing sys_package_version couldn't hold, but it
locks the runtime to a single-package-per-env assumption and prevents
Marketplace and user code from sharing one mental model.
The platform is still pre-launch; the same one-shot-wipe window v3 used remains open.
-
Drop the dev-workspace
sys_projectconcept. There is no Project table, no Project Branch table, no Project Revision table in the target state. The local working copy on a developer's machine is the "workspace" — versioned by git, not by a control-plane row. -
All code distribution flows through Package. Whether the source is a user-authored repo, a starter template, or a third-party marketplace submission, it ends up as a
sys_package(identity), one or moresys_package_versionrows (immutable snapshots), and zero-or-moresys_package_installationrows (per-env activation). -
sys_environment_revisionis transitional. Today the CLI publish path writes this table to keep things compiling. It will be removed once the CLI publish path is rewritten to call the package version create + installation upsert endpoints (Phase B below). -
Persona model collapses to one path. "Consumer" and "Builder" personas in v3 both ultimately install a
sys_package_versioninto asys_environment. The difference is which package they install (marketplace vs. their own), not which schema they touch.
Organization (account root — billing, members, SSO realm)
├── Environment (1..N — runtime container)
│ ├── hostname, database_url, plan, quota, status
│ └── installations → sys_package_installation
│ (env × package × version)
│
└── Package (0..N — code identity, Marketplace or private)
├── manifest_id, owner_org, visibility, is_starter
└── versions → sys_package_version
(immutable artifact snapshots, semver)
No FK between Environment and Package. They meet only at
sys_package_installation.
| Flow | What the user does | What writes to the DB |
|---|---|---|
| Install from Marketplace | Browse → pick package → choose env | INSERT sys_package_installation (env, package, version) |
objectstack publish (CLI) |
Local code → build → publish |
(a) ensure sys_package for this code base; (b) INSERT sys_package_version with new artifact; (c) upsert sys_package_installation pointing the env at the new version |
| Promote staging → prod | objectstack promote --from staging --to prod |
INSERT sys_package_installation for prod using staging's package_version_id (zero re-upload) |
| Rollback | objectstack rollback --env prod --to <ver> |
UPDATE sys_package_installation … SET package_version_id = <old> |
A user's repo is associated with a package the first time publish runs
against a given control plane. The package's manifest_id defaults to
local.<org_slug>.<project_slug> (overridable in objectstack.config.ts).
Subsequent publishes from the same repo create new sys_package_version
rows under that package.
This means user code, starter templates, and Marketplace apps are
indistinguishable to the runtime — they all resolve to a
sys_package_installation row at load time.
Today: encode the channel in the semver prerelease tag.
| Channel | Example version | Resolves on env via |
|---|---|---|
| stable | 1.4.0 |
package_version_id pin |
| staging | 1.4.0-staging.7 |
installation upgrade |
| PR preview | 1.4.0-pr.123.2 |
ephemeral env + installation |
Later: introduce sys_package_channel ({package_id, name, head_version_id})
plus sys_package_installation.tracking (pinned | channel_head) to
get CI-style "always run staging branch HEAD" without a Project table.
Unchanged from v3. The Cloudflare Worker resolves
<slug>.objectos.app → sys_environment.id. Runtime loads each
installed package's current version via sys_package_installation.
Unchanged surface area, simpler mental model:
Environments ← runtime targets
Packages ← code you own + Marketplace browser (one tab, filtered)
Members
Billing
There is no separate "Projects" tab. A power user inspecting "what's installed where" goes through Packages → version history → installations.
- One version-management spine. Marketplace apps, starter templates, and user code share the same three tables. Operators learn one model.
- Smaller schema. No
sys_project, nosys_project_branch, nosys_project_revision, nosys_environment_revision, nosys_deployment. The control plane keepssys_environment+sys_package*and nothing else for the deploy story. - Promote / rollback are SQL on
sys_package_installation. Same property v3 advertised, now also true for user code. - CLI publish and Marketplace install converge. A single set of permissions, audit events, and Studio screens covers both paths.
- Dev workspace = local files + git. We don't compete with git for branch / revision UX in the control plane.
- Two paths today don't converge yet. The CLI still writes
sys_environment_revision; until Phase B lands, "what version is running in prod" requires looking at two tables. Transitional. - No server-side branches today. Teams that want CI-driven
staging↔prodchannels must encode it in semver prereleases untilsys_package_channelships. @objectstack/spec/cloudAPI surface change.ProjectSchema,ProjectBranchSchema,ProjectRevisionSchemaare removed. No downstream consumers in production yet.
sys_package_version.published_from_project_id(introduced in v3) is removed as a field — provenance lives insys_package_version.metadataif needed.ProjectArtifactSchema(packages/spec/src/cloud/project-artifact.zod.ts— Path note, 2026-09: the follow-up rename this paragraph anticipates happened; the file ispackages/spec/src/cloud/environment-artifact.zod.tstoday, renamed by944f18758, 2026-05-24) is the envelope returned byGET /cloud/projects/:id/artifact. The route name is kept for BC; the response shape continues to wrap the compiledObjectStackDefinitionSchema. The "Project" in the schema name is historical and will be renamed toEnvironmentArtifactin a follow-up.
| Phase | Scope | Status |
|---|---|---|
| A — Drop Project from the protocol | Remove packages/spec/src/cloud/project.zod.ts (since removed, as this phase prescribes — d4eed33ab); update index.ts; trim Project tests from environment.test.ts; mark sys_environment_revision as @deprecated transitional |
✅ This commit |
| B — Rewire CLI publish onto Package | objectstack publish resolves implicit sys_package; calls POST /cloud/packages/:id/versions; upserts sys_package_installation. Old /cloud/projects/:envId/metadata becomes a thin BC shim that internally walks the new path. |
Next |
| C — Split CLI commands | objectstack push (version only) + objectstack deploy (installation upsert) + objectstack promote + objectstack rollback. publish stays as a push && deploy alias. |
Next+1 |
| D — Remove transitional revision table | After Phase B is shipping and verified: drop sys_environment_revision schema, delete _DEPRECATED route handlers, wipe table from any seeded control planes. |
After C |
E — sys_package_channel (optional) |
Only if real CI need surfaces. Adds named channels + tracking mode to installations. | Deferred |
There is no "Phase 5 Builder UX" anymore — Builder is just "you own private packages now", and the existing Packages UI covers it.
Pre-launch: drop tables, rebuild. Same one-shot wipe v3 used.
Post-launch (forward-looking, if v4 lands after launch):
- Read each
sys_environment_revisionrow. - Ensure an implicit
sys_packageexists for the env's owner org. - For each revision: insert
sys_package_version(semver =0.<idx>.0, storage_key copied verbatim, checksum copied verbatim). - Insert
sys_package_installationfor the env's current revision. - Drop
sys_environment_revision.
The script lives in @objectstack/service-tenant's migration folder
when needed.
manifest_iddefault for local code.local.<org_slug>.<project_slug>collides if two projects share a slug. Resolution: include a 6-hex suffix on first publish, persist it inobjectstack.config.ts.- Visibility default for CLI-created packages.
private(owner org only) — consistent withsys_package.visibilitydefault. Explicitobjectstack package publish --marketplaceflow to escalate. Resolved (2026-09-30, #20892):org. A new package is visible to every environment of its owner organization by default, notprivate. Re-publishing without--visibilityleaves an existing package's visibility unchanged, and listing on the public marketplace remains an explicit choice. - Multi-package envs in Studio. The current "Environment detail" page assumes one artifact. Phase B+ updates it to list installations and show per-package versions.
- ADR-0002 — Environment-Per-Database Isolation
- ADR-0003 — Package as First-Class Citizen
- v3 (archived as the immediate predecessor):
0006-project-environment-split.md(this file's prior version, retained in git history) - Power Platform: Solution → Environment model (same shape, different names)
- Salesforce: Unlocked Package → Org model (no "Project" table either)
- npm + lockfile: identity + immutable version + installation pointer
Recorded 2026-08-30 (#12747); the decision itself is v5.0's. This section
writes down a decision that was made and enforced platform-wide but never
stated, and it is written here because this record is where the rest of the
repository sends a reader who asks why the platform says environment. It
therefore states its reasons directly, rather than citing back the instruction
file that cites this record.
What was renamed. The tenancy noun project became environment on every
surface the platform owns. Measured on main, 2026-08-30:
| Surface | Spelling today |
|---|---|
| CLI command group | packages/cli/src/commands/environments/ — list, show, create, switch, bind; there is no projects group |
| Control-plane routes | /api/v1/cloud/environments |
| Request header | X-Environment-Id (read in packages/rest/src/rest-server.ts) |
| Environment variable | OS_ENVIRONMENT_ID (read in packages/runtime, service-job, cloud-connection) |
Afterwards project keeps exactly one meaning here: the npm/monorepo sense — a
checkout, a workspace, a package.json — which is the sense the v4 body above
unifies onto Package.
No alias was kept, and that half is the load-bearing one. There is no
OS_PROJECT_ID and no X-Project-Id in the tree, and ADR-0087's conversion
registry — the declared home for any tolerated legacy spelling — carries no
entry translating project to environment. Since a tolerated alias would have
to be declared there, the empty registry is positive evidence that none was
tolerated, not merely evidence that nobody recorded one.
Why no alias. Three reasons, none of which expires with the price:
- One word per concept, or the vocabulary becomes a guess per call site. An alias makes both spellings correct, so every reader and every code generator has to pick one, and a wrong pick typechecks. This is D3's argument below applied one level up: a split vocabulary is worse than a uniformly old one, because the reader cannot tell which half is the mistake.
- A compatibility spelling outlives the reason for it. It is cheap only while it is understood as temporary. Nothing schedules its removal, each new consumer learns it as a legitimate second form, and the mapping between the two spellings becomes a permanent seam that every consumer reimplements.
- The window was open, and it does not reopen at this price. The Context above records the condition the rename was taken under — "The platform is still pre-launch; the same one-shot-wipe window v3 used remains open." Taken then, the rename cost one coordinated edit; taken later it would cost a deprecation cycle plus the alias it exists to avoid. The startup-stage posture is to spend that window rather than bank a migration: no gradualism, no dual-spelling interval, no single release carrying both.
What this section does not claim. Not that the string project is absent
from the tree — it remains correct in the npm/monorepo sense, in domain fixtures
modelling a customer's own project object, and in the API identifiers the two
addenda below adjudicate. The claim is the narrower, checkable one: on the
surfaces tabled above the platform emits a single spelling, and no declared
alias accepts the other.
Addendum (2026-08-27, #12473) — the rename stops at the CLI's user-facing vocabulary: three API surfaces keep project deliberately
Provenance. Maintainer ruling on #12473, 2026-08-27, adjudicated in the PM decision-inbox batch, accepting that card's option 3 — verbatim, untranslated: 「其他同意」. The ruling names this addendum as the deliverable and names nothing else: no code change rides it, because on this question not touching the code is the decision.
Why the boundary is written here rather than left implicit. The v5.0 breaking
rename project → environment — AGENTS.md, top of file: "No aliases. See
ADR-0006. 'Project' now only means the npm/monorepo sense." — was carried
through the CLI in three passes: the command name (#10967), the entity noun in
every string os environments prints (#12153), and the comment axis (#12432).
Each pass correctly fenced the API surface out of its own scope, and none could
close the question, so the same seam produced a fourth card (#12464) and then a
decision card, inside one week. An unwritten boundary is re-litigated by whoever
next reads the two spellings side by side — human or agent — and the cost of
option 3 is exactly this section. If you arrived here from such a sighting: it is
deliberate, it is below, and the way to change it is D2, not a PR.
RETIRED 2026-08-28 (#12867, by execution of D2 — see the second addendum at the end of this file). All three surfaces below are renamed; none of them retains
projectany more. This section is kept unedited because it is the record of why they were retained through 2026-08-27 and of what the retention cost, and because D2 was drafted against these exact phrases. Read it in the past tense.
Identified by quoted phrase, not line number. The card that ordered this
addendum anchored one of the three to a line number, and that anchor was already
stale when the addendum was written; the phrases below were measured on main
on 2026-08-27.
-
The SDK method namespace — the
projectsblock on the@objectstack/clientclient class (packages/client/src/index.ts), reached by callers asclient.projects.list,client.projects.get,client.projects.create,client.projects.update,client.projects.delete,client.projects.activateand the remaining methods of that block, including the environment-scopedprojects.packagesmethods nested inside it. Note what is already renamed underneath it: every method in the block calls/api/v1/cloud/environments. The namespace identifier is the onlyprojectspelling left on that face — and it is a published method name, so renaming it breaks every caller, while an alias is precisely what this rename does not get. -
The control-plane response fields — the response envelope keys
projectandprojectsthat the/api/v1/cloud/environmentsendpoints return. What this repository can measure is the consumer side, and this addendum claims nothing beyond it: the SDK declares the unwrapped shapes ({ projects: any[]; total: number }on list,{ project: any; database: any }on create,{ project: any }on update), and the CLI readsres?.projects ?? []inpackages/cli/src/commands/environments/list.tsandres?.projectin the siblingcreate.tsandshow.ts. The producer is the cloud control plane inobjectstack-ai/cloud, which is not this repository: these fields cannot be renamed from here at all, which is why the rename of this surface is a cross-repo coordination, not a local edit. -
The SDK JSDoc that travels with them — the sentence "Provision a new project. Delegates to
ProjectProvisioningService.provisionProjecton the server.", on thecreatemethod of that same namespace. It is retained by the same ruling and for a reason of its own: it names a server-side class that is part of the contract in point 2, so renaming the sentence alone would make the comment describe the running system less accurately, not more. Editing it is executing option 2 below, which is permanently declined.
⇒ A PR that "tidies" any of these three is not a cleanup. Under Prime Directive 13 it reverses a recorded decision, and the route for that is D2 — not a changeset, and not a drive-by rename.
Option 1 is to rename both halves together — the SDK method namespace to
environments and the wire fields to environment / environments — with no
aliases, as a breaking major coordinated with objectstack-ai/cloud, carrying a
migration entry. That is the option consistent with the no-alias rename, and it
remains the direction of travel: the target-state vocabulary has one word for
this concept, and it is environment.
It is pre-registered to reopen at the next planned SDK/protocol breaking
major. What defers it is not that the drift is acceptable forever, but that
today it would buy a zero-pull cross-repo breaking change: no user is blocked by
the project spelling, and the only measured cost of the drift so far is
internal — the card stream this addendum exists to stop. At the next such major
the coordination is already being paid for, and the rename rides with it.
To whoever plans that major: this entry is your trigger. Reopen #12473's option 1, coordinate the producer change with the cloud repository, and retire this addendum's D1 in the same release rather than adding an alias to soften it. The standing startup-stage retirement rule does not force this earlier — it governs deprecated-alias retirements, not a zero-pull cross-repo major.
Option 2 is to rename the SDK namespace to environments while the wire fields
stay project / projects. It is the cheapest-looking move on the board and it
is refused permanently, for three reasons that do not expire with the price:
- The two halves of one contract would say different things. The SDK would
teach
environment; the payload it hands back would sayproject. A contract that contradicts itself across a single call is worse than one that is uniformly out of date, because the reader cannot tell which half is the mistake. - The mapping layer becomes permanent. The CLI's translation between the two spellings exists today as an artifact of an unfinished rename, and it is cheap only while it is understood as temporary. Half-renaming promotes it to a load-bearing, permanently-maintained seam that every future consumer must reimplement.
- It is the worst shape for AI authors — the axis this project weighs explicitly. An agent that reads the SDK learns one vocabulary, an agent that reads a response payload learns another, and every generated call site has to infer which side of the mapping it is standing on. Uniform-but-old is learnable; split-brain is a guess per call site, and a wrong guess typechecks.
A prohibition without a reason gets stepped over by the next author who finds it inconvenient. The reason is above; if it is ever wrong, the reversal is a new ruling, not a rename PR.
No code, no schema, no route, no changeset. The three surfaces in D1 are correct
as they stand today, and the correct action on them is none. The CLI's
user-facing vocabulary stays fully renamed — os environments, its printed
nouns, and its comments are all environment, and nothing here reopens them.
Nothing here touches the objectstack-ai/cloud producer either.
The question is this record's own: where the boundary between the two senses of "project" sits, and which surfaces the v5.0 rename reaches. A separate ADR would put the boundary in one file and the rename it bounds in another, so the reader who follows AGENTS.md's "See ADR-0006" would arrive at the record that does not carry the answer — the exact failure this addendum was ordered to fix.
Addendum (2026-08-28, #12867) — D2 fired: D1 is retired by execution, and all three surfaces now say environment
Provenance. Maintainer ruling in live PM chat, 2026-08-28, recorded verbatim and untranslated on the epic card #12865: 「作为 epic 卡,处理所有相关任务和开发」. That instruction satisfies the restart clause D2 was pre-registered under — D2 declares itself "pre-registered to reopen at the next planned SDK/protocol breaking major" — and opens the window. D2 is therefore no longer deferred: it executed.
What this section is. D2's closing instruction to whoever planned that major was to "retire this addendum's D1 in the same release rather than adding an alias to soften it." This is that retirement, and it is the record half only — the code half is the two pull requests named under the landing constraint below.
Cited by quoted phrase, not line number, on the discipline D1 set for itself after its own predecessor's line-number anchor went stale. Each quotation below is D1's; each "now" is what the executing PRs author.
-
The SDK method namespace. D1 retained "the
projectsblock on the@objectstack/clientclient class", reached asclient.projects.list,client.projects.getand the rest of that block, "including the environment-scopedprojects.packagesmethods nested inside it". Now: the block isenvironments; every method moves with it, and the nested package methods are reached asclient.environments.packages.*. No alias — no deprecated forwarder, no compatibility getter, nothing. That is the standing rule D1 itself quoted from AGENTS.md ("No aliases. See ADR-0006."), and softening the retirement with an alias would have removed the boundary while keeping the drift it existed to fence. -
The control-plane response fields. D1 retained "the response envelope keys
projectandprojectsthat the/api/v1/cloud/environmentsendpoints return", noting carefully that the producer "is the cloud control plane inobjectstack-ai/cloud, which is not this repository". Now: the producer half renames them at eight emission sites — five inpackages/service-cloud/src/routes/environment-crud.ts, three inpackages/service-cloud/src/routes/environment-lifecycle.ts— so every payload key becomesenvironment/environments, with no dual-key emission and no compatibility window. The consumer side in this repository follows in the same release: the SDK's declared unwrap shapes, and the CLI readers D1 named (res?.projects ?? []inpackages/cli/src/commands/environments/list.ts,res?.projectin the siblingcreate.tsandshow.ts).A correction D1 could not have made, surfaced by executing it. D1 quoted the SDK's declared create shape as "
{ project: any; database: any }on create", and said plainly that the consumer side was all this repository could measure. Measured against the control plane while executing the rename, that declaration turned out not to be merely pre-rename but false: the routecreateactually reaches has never emitted aprojectkey, and emits nodatabasekey either — callers were typed to expect a field the server never sends, so reading it was a runtime error the types promised could not happen. The rename therefore corrects the shape to{ environment: any }instead of transliterating it. This is the standing cost of a contract whose two halves live in repositories that never compile against each other, and it is the sharpest argument on record for why the halves must land together. -
The SDK JSDoc that travels with them. D1 retained the sentence "Provision a new project. Delegates to
ProjectProvisioningService.provisionProjecton the server.", reasoning that "it names a server-side class that is part of the contract in point 2, so renaming the sentence alone would make the comment describe the running system less accurately, not more." Now: the sentence names the endpoint — "Provision a new environment —POST /api/v1/cloud/environments." — because the premise of that reasoning did not survive measurement. The named class has zero hits in the cloud repository'spackages/service-cloud(measured 2026-08-28 while executing the rename; a repo-wide grep at this addendum's writing found none either). It was renamed or removed there and this docblock rotted in silence, because no gate in this repository compiles against that implementation. The endpoint is the one identifier the method itself constructs, so it is the only one an in-repo reader can verify. D1's intent — the comment must describe the running system truthfully — is what is preserved here; its chosen instrument was pointing at something that was no longer there.
Option 2, the SDK-only half-rename, remains permanently declined on the three reasons D3 gives, none of which this execution weakens. What executed is Option 1: both halves, together, in one release. If either pull request below lands without the other, the result is D3 by accident — the exact shape D3 refuses — which is why the pairing is a landing constraint and not a preference.
This addendum records authored and parked work, not released work. Both halves exist as open draft pull requests held for the maintainer's coordinated window:
- SDK half (#12866) — PR #12885: the namespace, the unwrap shapes, the JSDoc, and the CLI consumers.
- Producer half (
objectstack-ai/cloud#1691) — cloud PR #1692: the eight response-key emission sites.
This addendum rides that same window. Merging it while either rename PR is still parked would leave the record claiming a retirement the code has not performed — the failure mode an ADR is worst at recovering from, because the next reader trusts the record over the code. Governed surface: draft only, human merge, never auto-merge.
The CLI's user-facing vocabulary, already fully renamed and explicitly left
alone by the first addendum. The v4 body above — the Environment / Package
model, the phasing, the migration — is untouched: this retires a vocabulary
boundary, it does not change the model. D3's prohibition stands. One
project-spelled SDK surface outside D1's three is being adjudicated separately
on #12882, and
this addendum takes no position on it.
The same reason the first addendum gave, now applied to its own retirement: a reader who follows AGENTS.md's "See ADR-0006" has to land on the record that carries the current answer. Filing the retirement as a separate ADR would recreate precisely the split the first addendum was ordered to fix — the boundary in one record and the fact that the boundary is gone in another — and the reader who found only the first would act on a rule that no longer holds.