Skip to content

Commit 944f187

Browse files
committed
refactor(v5.0): rename project to environment throughout codebase
1 parent 06ad57f commit 944f187

125 files changed

Lines changed: 1745 additions & 2021 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
"@objectstack/cli": major
3+
"@objectstack/runtime": major
4+
"@objectstack/rest": major
5+
"@objectstack/client": major
6+
"@objectstack/spec": major
7+
"@objectstack/metadata": major
8+
"@objectstack/platform-objects": major
9+
---
10+
11+
# v5.0 — `project``environment` hard rename
12+
13+
The runtime concept previously called **"project"** (per-tenant business
14+
workspace; Org → **Project** → Branch hierarchy; per-project ObjectKernel,
15+
per-project DB, per-project artifact) is now uniformly called
16+
**"environment"**.
17+
18+
This is a **hard rename with no aliases, deprecation shims, or compatibility
19+
layer**. Upgrade requires a coordinated update of CLI, runtime, server, and any
20+
clients calling the REST API.
21+
22+
> Note: "project" in the npm / monorepo sense (the framework itself, `package.json`,
23+
> tsconfig project references, vitest `projects` config) is **unchanged**.
24+
25+
## Breaking changes
26+
27+
### CLI
28+
29+
- Flags renamed:
30+
- `--project` / `-p``--environment` / `-e` (`os publish`, `os rollback`)
31+
- `--project-id``--environment-id` (`os dev`)
32+
- Default local env id: `proj_local``env_local`.
33+
- Env var: `OS_PROJECT_ID``OS_ENVIRONMENT_ID`.
34+
- Command group renamed: `os projects ...``os environments ...`
35+
(`bind`, `create`, `list`, `show`, `switch`).
36+
- Persisted auth-config key: `activeProjectId``activeEnvironmentId`.
37+
38+
### HTTP / REST
39+
40+
- Scoped routes: `/api/v1/projects/:projectId/...``/api/v1/environments/:environmentId/...`.
41+
- Cloud control-plane routes: `/api/v1/cloud/projects/...``/api/v1/cloud/environments/...`
42+
(including `/cloud/environments/:id/artifact`, `/cloud/environments/:id/metadata`,
43+
`/cloud/environments/:id/credentials/rotate`, etc.).
44+
- Header: `X-Project-Id` (and lowercase `x-project-id`) → `X-Environment-Id`
45+
(`x-environment-id`).
46+
- Route param name in handlers: `req.params.projectId``req.params.environmentId`.
47+
- Hostname-routing and tenant-resolution code-paths use `environmentId` end-to-end.
48+
49+
### Runtime / spec
50+
51+
- Exported symbols (no aliases):
52+
- `createSystemProjectPlugin``createSystemEnvironmentPlugin`
53+
- `SYSTEM_PROJECT_ID``SYSTEM_ENVIRONMENT_ID`
54+
- `ProjectArtifactSchema``EnvironmentArtifactSchema`
55+
- `PROJECT_ARTIFACT_SCHEMA_VERSION``ENVIRONMENT_ARTIFACT_SCHEMA_VERSION`
56+
- `ObjectOSProjectPlugin``ObjectOSEnvironmentPlugin`
57+
- `createSingleProjectPlugin``createSingleEnvironmentPlugin`
58+
- Plugin identifier strings:
59+
- `com.objectstack.runtime.objectos-project``objectos-environment`
60+
- `com.objectstack.studio.single-project``single-environment`
61+
- `com.objectstack.multi-project``multi-environment`
62+
- `com.objectstack.runtime.system-project``system-environment`
63+
- Provisioning hook: `provisionSystemProject``provisionSystemEnvironment`.
64+
65+
### Database / schemas
66+
67+
- Column renames on `sys_metadata` and `sys_metadata_history`:
68+
`project_id``environment_id`.
69+
- Column renames on `sys_activity`: `project_id``environment_id` (plus index).
70+
- Object renames in platform-objects metadata: `sys_project``sys_environment`
71+
(lookup targets), `sys_project_member``sys_environment_member`,
72+
`sys_project_credential``sys_environment_credential`.
73+
- Auth-context field: `active_project_id``active_environment_id`.
74+
- JSON schemas under `packages/spec/json-schema/system/`:
75+
`ProjectArtifact*.json``EnvironmentArtifact*.json` (regenerated at build).
76+
77+
### Automatic forward migration
78+
79+
A new migration `migrateProjectIdToEnvironmentId`
80+
(`packages/metadata/src/migrations/migrate-project-id-to-environment-id.ts`)
81+
auto-runs from `DatabaseLoader.ensureSchema()` on bootstrap and rewrites any
82+
existing `project_id` column on `sys_metadata` / `sys_metadata_history` to
83+
`environment_id` (idempotent, best-effort). Existing rows are preserved.
84+
85+
The legacy reverse migration `migrateEnvIdToProjectId` is retained verbatim
86+
for historical / disaster-recovery use; it is **not** auto-run.
87+
88+
## Migration guide
89+
90+
```diff
91+
-os publish --project proj_xyz
92+
+os publish --environment env_xyz
93+
94+
-curl -H "X-Project-Id: env_xyz" https://api.example.com/api/v1/data/customer
95+
+curl -H "X-Environment-Id: env_xyz" https://api.example.com/api/v1/data/customer
96+
97+
-OS_PROJECT_ID=env_xyz os dev
98+
+OS_ENVIRONMENT_ID=env_xyz os dev
99+
100+
-import { createSystemProjectPlugin, SYSTEM_PROJECT_ID } from "@objectstack/runtime";
101+
+import { createSystemEnvironmentPlugin, SYSTEM_ENVIRONMENT_ID } from "@objectstack/runtime";
102+
103+
-import { ProjectArtifactSchema } from "@objectstack/spec";
104+
+import { EnvironmentArtifactSchema } from "@objectstack/spec";
105+
```
106+
107+
If you maintain a Cloud control-plane deployment, the `cloud` repository must
108+
be updated in lockstep to pick up the new plugin identifier strings
109+
(`single-environment`, `multi-environment`, `objectos-environment`).

ARCHITECTURE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# ObjectStack Architecture
22

3+
> **v5.0 (2026): `project``environment`.** The runtime concept formerly called *Project* (per-tenant business workspace; Org/Project/Branch hierarchy) is now called *Environment* throughout the codebase: CLI flags (`--environment`/`-e`), HTTP paths (`/api/v1/environments/:environmentId/...`), headers (`X-Environment-Id`), env vars (`OS_ENVIRONMENT_ID`), exported symbols (`createSystemEnvironmentPlugin`, `SYSTEM_ENVIRONMENT_ID`), DB columns (`environment_id`), and JSON schemas (`EnvironmentArtifact`) all use the new term with no aliases or deprecation shims. The word "project" elsewhere in this document still refers to the npm/monorepo sense (i.e., the framework as a software project). See `.changeset/v5-project-to-environment-rename.md` for the full breaking-change list and ADR-0006 for the rationale.
4+
5+
36
> **Architecture Document** - Updated January 2026
47
>
58
> This document provides a comprehensive overview of ObjectStack's microkernel architecture, package distribution, and design principles.

CLAUDE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# ObjectStack — CLAUDE.md
22

3+
> **v5.0 (2026): `project``environment`.** The runtime concept formerly called *Project* (per-tenant business workspace; Org/Project/Branch hierarchy) is now called *Environment* throughout the codebase: CLI flags (`--environment`/`-e`), HTTP paths (`/api/v1/environments/:environmentId/...`), headers (`X-Environment-Id`), env vars (`OS_ENVIRONMENT_ID`), exported symbols (`createSystemEnvironmentPlugin`, `SYSTEM_ENVIRONMENT_ID`), DB columns (`environment_id`), and JSON schemas (`EnvironmentArtifact`) all use the new term with no aliases or deprecation shims. The word "project" elsewhere in this document still refers to the npm/monorepo sense (i.e., the framework as a software project). See `.changeset/v5-project-to-environment-rename.md` for the full breaking-change list and ADR-0006 for the rationale.
4+
5+
36
> **Last synced with `.github/copilot-instructions.md`:** 2026-04-16
47
>
58
> This file is the **Claude Code** primary instruction file for ObjectStack development.
@@ -42,7 +45,7 @@ You are the **Chief Protocol Architect** for the ObjectStack ecosystem.
4245
This is a **metadata-driven low-code platform** monorepo (pnpm + Turborepo).
4346
Mission: Build the "Post-SaaS Operating System" — an open-core, local-first ecosystem that virtualizes data and unifies business logic through metadata protocols.
4447

45-
> **North Star:** Every architecture decision must align with [`content/docs/concepts/north-star.mdx`](content/docs/concepts/north-star.mdx). That document defines the **product shape** (Studio dashboard · Org/Project/Branch hierarchy · per-project ObjectOS · compiled app artifacts) and the honest Built/Drift/Missing ledger. Read it before proposing structural changes. If a change doesn't advance §7 Built, shrink Drift, unlock Missing, or answer an Open Question — it probably shouldn't ship.
48+
> **North Star:** Every architecture decision must align with [`content/docs/concepts/north-star.mdx`](content/docs/concepts/north-star.mdx). That document defines the **product shape** (Studio dashboard · Org/Environment/Branch hierarchy · per-environment ObjectOS · compiled app artifacts) and the honest Built/Drift/Missing ledger. Read it before proposing structural changes. If a change doesn't advance §7 Built, shrink Drift, unlock Missing, or answer an Open Question — it probably shouldn't ship.
4649
4750
---
4851

RELEASE_NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release Notes
22

3+
> **v5.0 (2026): `project``environment`.** The runtime concept formerly called *Project* (per-tenant business workspace; Org/Project/Branch hierarchy) is now called *Environment* throughout the codebase: CLI flags (`--environment`/`-e`), HTTP paths (`/api/v1/environments/:environmentId/...`), headers (`X-Environment-Id`), env vars (`OS_ENVIRONMENT_ID`), exported symbols (`createSystemEnvironmentPlugin`, `SYSTEM_ENVIRONMENT_ID`), DB columns (`environment_id`), and JSON schemas (`EnvironmentArtifact`) all use the new term with no aliases or deprecation shims. The word "project" elsewhere in this document still refers to the npm/monorepo sense (i.e., the framework as a software project). See `.changeset/v5-project-to-environment-rename.md` for the full breaking-change list and ADR-0006 for the rationale.
4+
5+
36
## v4.0.4 — Release Readiness: Documentation Alignment _(in progress)_
47

58
### 🎯 Purpose

content/docs/references/api/rest-server.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ const result = BatchEndpointsConfig.parse(data);
189189
| **enableUi** | `boolean` || Enable UI API endpoints (Views, Menus, Layouts) |
190190
| **enableBatch** | `boolean` || Enable batch operation endpoints |
191191
| **enableDiscovery** | `boolean` || Enable API discovery endpoint |
192+
| **enableOpenApi** | `boolean` || Enable OpenAPI 3.1 spec & docs viewer endpoints |
192193
| **enableProjectScoping** | `boolean` || Enable project-scoped routing for data/meta/AI APIs |
193194
| **projectResolution** | `Enum<'required' \| 'optional' \| 'auto'>` || Project ID resolution strategy |
194195
| **requireAuth** | `boolean` || Reject anonymous requests on /data/* with HTTP 401 |

content/docs/references/cloud/project-artifact.mdx renamed to content/docs/references/cloud/environment-artifact.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Project Artifact
3-
description: Project Artifact protocol schemas
2+
title: Environment Artifact
3+
description: Environment Artifact protocol schemas
44
---
55

66
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */}
77

88
# Project Artifact Envelope (M1)
99

10-
Describes the response shape of `GET /api/v1/cloud/projects/:projectId/artifact`
10+
Describes the response shape of `GET /api/v1/cloud/environments/:environmentId/artifact`
1111

1212
— the assembled artifact ObjectOS pulls from the control plane.
1313

@@ -20,7 +20,7 @@ This envelope wraps the compiled `ObjectStackDefinitionSchema` produced by
2020
(`commitId`, `checksum`).
2121

2222
<Callout type="info">
23-
**Source:** `packages/spec/src/cloud/project-artifact.zod.ts`
23+
**Source:** `packages/spec/src/cloud/environment-artifact.zod.ts`
2424
</Callout>
2525

2626
## TypeScript Usage

content/docs/references/cloud/environment.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ data lives in each environment's own database — those data-plane DBs hold
2323

2424
no system tables.
2525

26-
See ADR-0006 v4: `sys_project` was renamed to `sys_environment`; the
26+
See ADR-0006 v4: `sys_environment` was renamed to `sys_environment`; the
2727

2828
separate dev-workspace `Project` concept introduced in v3 has been
2929

content/docs/references/cloud/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ This section contains all protocol schemas for the cloud layer of ObjectStack.
99
<Card href="/docs/references/cloud/app-store" title="App Store" description="Source: packages/spec/src/cloud/app-store.zod.ts" />
1010
<Card href="/docs/references/cloud/developer-portal" title="Developer Portal" description="Source: packages/spec/src/cloud/developer-portal.zod.ts" />
1111
<Card href="/docs/references/cloud/environment" title="Environment" description="Source: packages/spec/src/cloud/environment.zod.ts" />
12+
<Card href="/docs/references/cloud/environment-artifact" title="Environment Artifact" description="Source: packages/spec/src/cloud/environment-artifact.zod.ts" />
1213
<Card href="/docs/references/cloud/environment-package" title="Environment Package" description="Source: packages/spec/src/cloud/environment-package.zod.ts" />
1314
<Card href="/docs/references/cloud/marketplace" title="Marketplace" description="Source: packages/spec/src/cloud/marketplace.zod.ts" />
1415
<Card href="/docs/references/cloud/marketplace-admin" title="Marketplace Admin" description="Source: packages/spec/src/cloud/marketplace-admin.zod.ts" />
1516
<Card href="/docs/references/cloud/package" title="Package" description="Source: packages/spec/src/cloud/package.zod.ts" />
1617
<Card href="/docs/references/cloud/package-version" title="Package Version" description="Source: packages/spec/src/cloud/package-version.zod.ts" />
17-
<Card href="/docs/references/cloud/project-artifact" title="Project Artifact" description="Source: packages/spec/src/cloud/project-artifact.zod.ts" />
1818
<Card href="/docs/references/cloud/tenant" title="Tenant" description="Source: packages/spec/src/cloud/tenant.zod.ts" />
1919
</Cards>

content/docs/references/cloud/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"app-store",
55
"developer-portal",
66
"environment",
7+
"environment-artifact",
78
"environment-package",
89
"marketplace",
910
"marketplace-admin",
1011
"package",
1112
"package-version",
1213
"plugin-security",
13-
"project-artifact",
1414
"provisioning",
1515
"tenant"
1616
]

0 commit comments

Comments
 (0)