Skip to content

Commit 776d64c

Browse files
hotlongclaude
andauthored
feat(spec)!: drop the @objectstack/spec/cloud subpath — control-plane contracts leave, the package format moves to @objectstack/spec/marketplace (#17372)
* feat(spec)!: drop the `./cloud` subpath — control-plane contracts leave, package format moves to `./marketplace` WIP for the step-3 card of the cloud-contracts chain: the cloud control plane's own contracts (environment, environment-package, tenant, developer-portal, marketplace-admin, app-store) leave `@objectstack/spec`; the package & marketplace format relocates to `src/marketplace/` and is published as `@objectstack/spec/marketplace`; `EnvironmentType` is re-declared in `api/discovery.zod.ts`; `packages/metadata` reads the environment-artifact envelope from `@objectstack/spec/system`. Claude-Session: https://claude.ai/code/session_f95e3874-e532-4748-a921-044aa2752a2b Co-authored-by: Claude <noreply@anthropic.com> * feat(spec)!: regenerate the artifacts for the `./cloud` retirement and carry defaults through def renames - `gen:schema` / `check:generated --fix` output: `cloud.json` shards leave, `marketplace.json` shards arrive, `api.json` gains `EnvironmentType`, the reference docs move to `content/docs/references/marketplace/`. - `scripts/lib/authorable-defaults.ts`: `carryDefaultsThroughRenames` — the #4666 defaults ratchet carried the baseline's KEY set through RENAMED_DEFS but not its DEFAULTS, so a declared category move read as 22 `(none) -> value (added)` flips; both halves are carried now, with the discrimination pinned in `authorable-defaults.test.ts`. - `./marketplace` publishes without a `browser` condition: its bundles link no `pg-connection-string` (the poisoned members were the deleted `environment` / `tenant` modules); `browser-reachable-entries.json` lists it as unjudged. - Count pins that describe the corpus move with it: 811 -> 782 isomorphic aliases, 37 -> 31 level-1 openers, description floor 140 -> 130. - `unemitted-schemas.baseline.json` drops the `Cloud.EnvironmentArtifactSchema` duplicate of the surviving `System.` row. Claude-Session: https://claude.ai/code/session_f95e3874-e532-4748-a921-044aa2752a2b Co-authored-by: Claude <noreply@anthropic.com> * docs: the subpath and namespace enumerations name `marketplace`, not the deleted `cloud` Contract-review patch round 1 of the cloud-subpath retirement PR. No gate reads a hand-written docs enumeration of `@objectstack/spec`'s subpaths, so three published pages kept advertising `cloud` after the exports-map entry left, and none listed `marketplace`: - `content/docs/deployment/troubleshooting.mdx` "Available subpaths" — now the `./*` entries of `packages/spec/package.json`'s `exports` map, in its order (16 entries, `meta-spelling` included), and the sentence names that source so the next editor derives it rather than retypes it. - `content/docs/plugins/packages.mdx` — the 15-namespace list. - `content/docs/getting-started/glossary.mdx` — the 15-namespace list, the layers table (its namespaces column, and `tenants` -> `packages` in the purpose column beside it), the `### Cloud Protocol` entry (now `### Marketplace Protocol`: the package & marketplace format), and the Tenant entry, which named `cloud/tenant.zod.ts` as the schema's home. Controlled sweep of `content/docs/**` after the edit: zero import-shaped `@objectstack/spec/cloud` (same-shape controls: 131 `spec/data`, 8 `spec/marketplace`), zero namespace lists naming Cloud (control: 4 naming Marketplace), zero `cloud/*.zod.ts` source paths (control: 8 `marketplace/*`). The two remaining `spec/cloud` mentions are historical ("left with", "re-exported until"). `concepts/architecture.mdx`'s six-card conceptual layering still carries a "Cloud Protocol" card; that is a framing question for the maintainer and is reported, not edited. Claude-Session: https://claude.ai/code/session_f95e3874-e532-4748-a921-044aa2752a2b Co-authored-by: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2bafbfd commit 776d64c

173 files changed

Lines changed: 2040 additions & 6755 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: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
"@objectstack/spec": minor
3+
"@objectstack/cli": patch
4+
"@objectstack/metadata": patch
5+
---
6+
7+
feat(spec)!: the `@objectstack/spec/cloud` subpath is removed — the cloud control plane's contracts leave the open-source spec, and the package & marketplace format moves to `@objectstack/spec/marketplace` (#16325)
8+
9+
<!-- adr-0087: registered cloud-subpath-retired -->
10+
11+
**BREAKING** — a published subpath export of `@objectstack/spec` is deleted, with no
12+
alias and no deprecation window (maintainer, 2026-08-27, verbatim: 「项目在创业阶段,
13+
用户也很少,短期不考虑渐进。」). Shipped as `minor` under the repo's launch-window
14+
convention, in which `major` is refused by `check-changeset-no-major` and breaking-ness
15+
is carried by this banner plus the ADR-0087 disposition; the hand-migration prescription
16+
is registered under protocol major 18 as `cloud-subpath-retired`.
17+
18+
## What moved, and why
19+
20+
Maintainer direction (2026-09-06, verbatim): 「我一直觉得 cloud 的协议应该放在云端,没必要开源」,
21+
ruled option B "cut by owner" on #16325 (director batch #62, 2026-09-07, 「同意」).
22+
`packages/spec/src/cloud/` held two families with different owners:
23+
24+
- **The cloud control plane's own contracts**`environment.zod`, `environment-package.zod`,
25+
`tenant.zod`, `developer-portal.zod`, `marketplace-admin.zod`, `app-store.zod` (62 JSON-Schema
26+
defs, 2087 lines). Their producer and every consumer live in the closed cloud repo; the
27+
open-source tree read exactly one type from them. They are gone from `@objectstack/spec`:
28+
`environment` and `tenant` are re-declared in the cloud repo (objectstack-ai/cloud#2037), and
29+
the other four are deleted outright — zero consumers in any repo (#16526, ruled A). All of it
30+
is recoverable from git history at `d5d8d50db`.
31+
- **The package & marketplace format**`package.zod`, `package-version.zod`, `marketplace.zod`,
32+
`package-l10n`, `template-manifest.zod` (30 defs, 1400 lines). A package author needs it and the
33+
open-source CLI's `os package publish` speaks it, so it STAYS, relocated to `src/marketplace/`
34+
and published as `@objectstack/spec/marketplace`. Every def, key and JSON Schema is
35+
byte-identical under the new `$id` category (`RENAMED_DEFS`, 32 entries; nothing left the
36+
author-facing contract).
37+
38+
## FROM → TO
39+
40+
| you wrote | write instead |
41+
|:--|:--|
42+
| `import { PackageSchema, CreatePackageRequestSchema, … } from '@objectstack/spec/cloud'` | `… from '@objectstack/spec/marketplace'` — same symbols, same shapes |
43+
| `import { EnvironmentArtifactSchema } from '@objectstack/spec/cloud'` | `… from '@objectstack/spec/system'` (it was only ever a re-export of that declaration) |
44+
| `import type { EnvironmentType } from '@objectstack/spec/cloud'` | `… from '@objectstack/spec/api'` (re-declared beside the discovery fold table that reads it) |
45+
| `import { EnvironmentSchema, TenantPlanSchema, ProvisionEnvironmentRequestSchema, … } from '@objectstack/spec/cloud'` | no open-source replacement — these are the cloud repo's own declarations now |
46+
| `/docs/references/cloud/<page>` | `/docs/references/marketplace/<page>` for the format pages (redirected); the control-plane pages have no successor |
47+
48+
Why the mis-binding hazard closes with this: `client.environments.*` keeps its erased `any`
49+
deliberately (#11925/#12036), and the camelCase `Environment` row used to be the obvious-looking
50+
binding for it — it compiled and read `undefined` at runtime against the snake_case wire. That
51+
type no longer exists in the open-source package, so the wrong binding is structurally
52+
impossible rather than warned about in a docblock.
53+
54+
`@objectstack/cli` and `@objectstack/metadata` change only an import path (`marketplace` and
55+
`system` respectively); no behaviour moves.

apps/docs/redirects.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,20 @@ export const docsRedirects = [
128128
['/docs/guides/metadata', '/docs/concepts/metadata-driven'],
129129
['/docs/guides/solutions', '/docs'],
130130
['/docs/guides/cheatsheets', '/docs/getting-started/quick-reference'],
131+
// `content/docs/references/cloud/` retired with the `@objectstack/spec/cloud`
132+
// subpath (#16325). The package & marketplace format pages moved to
133+
// `references/marketplace/`; the environment-artifact page documents the
134+
// `system/` declaration it only ever re-exported; the cloud control plane's
135+
// own contract pages (environment, environment-package, tenant,
136+
// developer-portal, marketplace-admin, app-store) have no successor page —
137+
// section index, same as the cloud-artifact-api entry above.
138+
['/docs/references/cloud/marketplace', '/docs/references/marketplace/marketplace'],
139+
['/docs/references/cloud/package', '/docs/references/marketplace/package'],
140+
['/docs/references/cloud/package-version', '/docs/references/marketplace/package-version'],
141+
['/docs/references/cloud/template-manifest', '/docs/references/marketplace/template-manifest'],
142+
['/docs/references/cloud/environment-artifact', '/docs/references/system/environment-artifact'],
131143
// folder moves (wildcards — keep after exact entries)
144+
['/docs/references/cloud/:path*', '/docs/references'],
132145
['/docs/guides/runtime-services/:path*', '/docs/kernel/runtime-services/:path*'],
133146
['/docs/guides/contracts/:path*', '/docs/kernel/contracts/:path*'],
134147
// ObjectOS layer-name retirement: the System Protocol section is now "kernel"

content/docs/concepts/north-star.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ validated against `ObjectStackDefinitionSchema`). When published to Cloud it is
6262
wrapped in the immutable environment artifact envelope defined by
6363
`EnvironmentArtifactSchema` in
6464
`packages/spec/src/system/environment-artifact.zod.ts` (the single
65-
declaration; `@objectstack/spec/cloud` re-exports it).
65+
declaration, published on `@objectstack/spec/system`).
6666

6767
The artifact contains:
6868

content/docs/deployment/troubleshooting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ import { FieldSchema } from '@objectstack/spec/data';
344344
import { ErrorResponseSchema } from '@objectstack/spec/api';
345345
```
346346

347-
Available subpaths: `data`, `api`, `ui`, `system`, `kernel`, `ai`, `automation`, `contracts`, `integration`, `security`, `studio`, `cloud`, `qa`, `identity`, `shared`.
347+
Available subpaths (the `./*` entries of the package's `exports` map, in its order): `data`, `system`, `kernel`, `ai`, `automation`, `api`, `ui`, `contracts`, `integration`, `security`, `studio`, `marketplace`, `qa`, `identity`, `shared`, `meta-spelling`.
348348

349349
---
350350

content/docs/getting-started/glossary.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To navigate the ObjectStack ecosystem effectively, it is helpful to understand t
1111
The umbrella term for the entire suite of protocols and reference implementations. It is organized into **15 protocol namespaces** grouped into three architectural layers.
1212

1313
### Protocol Namespace
14-
A logical grouping of related schemas and types defined with Zod. ObjectStack has 15 protocol namespaces: Data, UI, System, Automation, AI, API, Identity, Security, Kernel, Cloud, QA, Contracts, Integration, Studio, and Shared.
14+
A logical grouping of related schemas and types defined with Zod. ObjectStack has 15 protocol namespaces: Data, UI, System, Automation, AI, API, Identity, Security, Kernel, Marketplace, QA, Contracts, Integration, Studio, and Shared.
1515

1616
---
1717

@@ -22,7 +22,7 @@ The 15 namespaces collapse into three top-level layers:
2222
| Layer | Also called | Namespaces it includes | Purpose |
2323
| :--- | :--- | :--- | :--- |
2424
| **ObjectQL** | Data Layer | Data | Objects, fields, queries, relations, validation, data access |
25-
| **Kernel** | Control Layer / System Layer (formerly named "ObjectOS") | Kernel, System, Automation, AI, API, Identity, Security, Cloud, Integration, Studio, QA, Contracts, Shared | Runtime, permissions, automation, plugins, tenants, agent tools, artifact loading |
25+
| **Kernel** | Control Layer / System Layer (formerly named "ObjectOS") | Kernel, System, Automation, AI, API, Identity, Security, Marketplace, Integration, Studio, QA, Contracts, Shared | Runtime, permissions, automation, plugins, packages, agent tools, artifact loading |
2626
| **ObjectUI** | View Layer | UI | Apps, views, dashboards, actions, presentation metadata |
2727

2828
Older docs and talks used **ObjectOS** as the name of this control layer. That name now refers exclusively to the commercial ObjectOS runtime environment ([docs.objectos.ai](https://docs.objectos.ai)); the open control layer is called the **Kernel**, described by the System/Kernel/AI/API protocol namespaces below.
@@ -58,8 +58,8 @@ User, organization, and position schemas for identity management.
5858
### Security Protocol
5959
RBAC, permissions, policy, and access-control schemas.
6060

61-
### Cloud Protocol
62-
Multi-tenant cloud, deployment, environment, and package distribution schemas.
61+
### Marketplace Protocol
62+
The package & marketplace format: package identity and translations, immutable package versions, marketplace listing / submission / install shapes, and the template manifest — what a package author publishes and what the marketplace answers with. The cloud control plane's own contracts (environments, tenants, deployment) are not an open-source protocol; they live in the cloud repo.
6363

6464
### QA Protocol
6565
Test, validation, and quality-assurance schemas.
@@ -172,7 +172,7 @@ A map within the UI Runtime that links a string identifier (e.g., `"chart.bar"`)
172172
## Governance
173173

174174
### Tenant (Space / Workspace)
175-
A logical isolation unit in the Cloud Protocol for multi-tenancy, modeled by the `tenant` schema (`cloud/tenant.zod.ts`). A single ObjectStack instance can host multiple tenants. Data is segregated by tenant isolation strategies. "Space" and "Workspace" are informal aliases for the same concept.
175+
A logical isolation unit for multi-tenancy. Its `tenant` schema is a cloud control-plane contract declared in the cloud repo — it left `@objectstack/spec` with the `./cloud` subpath — so it is not one of the open-source protocol namespaces above. A single ObjectStack instance can host multiple tenants. Data is segregated by tenant isolation strategies. "Space" and "Workspace" are informal aliases for the same concept.
176176

177177
### FLS (Field-Level Security)
178178
A granular permission model (Security Protocol) where access control is applied to individual fields (columns), not just the whole object (row).

content/docs/getting-started/quick-reference.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,18 @@ User identity, organizations, and position management.
182182
| **[Position](/docs/references/identity/position)** | `position.zod.ts` | Position | Permission-set distribution (岗位, ADR-0090) |
183183
| **[SCIM](/docs/references/identity/scim)** | `scim.zod.ts` | SCIMUser, SCIMGroup | SCIM 2.0 provisioning |
184184

185-
## Cloud Protocol (3 of 11 schemas)
185+
## Marketplace Protocol (2 of 4 schemas)
186186

187-
Environments, marketplace, licensing, and multi-tenancy.
187+
The package & marketplace format — what a package author publishes and what the
188+
marketplace answers with. (The cloud control plane's own contracts — environments,
189+
tenants, the developer portal, marketplace administration — are not an open-source
190+
protocol; they left `@objectstack/spec` with the `./cloud` subpath and live in the
191+
cloud repo beside their producer.)
188192

189193
| Protocol | Source File | Key Schemas | Purpose |
190194
|:---------|:-----------|:------------|:--------|
191-
| **[Environment](/docs/references/cloud/environment)** | `environment.zod.ts` | Environment, EnvironmentType | Deployment environments |
192-
| **[Marketplace](/docs/references/cloud/marketplace)** | `marketplace.zod.ts` | MarketplaceListing, PackageSubmission | Plugin marketplace |
193-
| **[Tenant](/docs/references/cloud/tenant)** | `tenant.zod.ts` | Tenant | Multi-tenancy isolation |
195+
| **[Package](/docs/references/marketplace/package)** | `package.zod.ts` | Package, CreatePackageRequest, PackageTranslations | Package identity and listing text |
196+
| **[Marketplace](/docs/references/marketplace/marketplace)** | `marketplace.zod.ts` | MarketplaceListing, PackageSubmission | Plugin marketplace |
194197

195198
## Integration Protocol (1 of 1 schema)
196199

content/docs/permissions/system-context.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,17 @@ is left open deliberately rather than hidden — see
4747

4848
## Which `isSystem` this page is about
4949

50-
Four unrelated declarations share the identifier. **This page documents only the
50+
Three unrelated declarations share the identifier. **This page documents only the
5151
first.** The others are ordinary metadata fields on a stored document and have
52-
nothing to do with elevation.
52+
nothing to do with elevation. (A fourth, `Environment.isSystem` — a
53+
platform-infrastructure environment, not user data — left this repo with the
54+
`@objectstack/spec/cloud` subpath in #16325 and is declared in the cloud repo.)
5355

5456
| Declaration | What it is | This page? |
5557
|:---|:---|:---:|
5658
| `ExecutionContext.isSystem``packages/spec/src/kernel/execution-context.zod.ts#isSystem` | The elevation flag on an operation's context ||
5759
| `Object.isSystem``packages/spec/src/data/object.zod.ts#isSystem` | Marks a **system object** (protected from deletion; defaults its org-wide sharing to `public` when no `sharingModel` is set) ||
5860
| `EmailTemplate.isSystem``packages/spec/src/system/email-template.zod.ts#isSystem` | Built-in template; tenants may override but should not delete ||
59-
| `Environment.isSystem``packages/spec/src/cloud/environment.zod.ts#isSystem` | Platform-infrastructure environment, not user data ||
6061

6162
The collision is a genuine hazard rather than a naming nit: `Object.isSystem`
6263
changes an object's **default sharing**, and `ExecutionContext.isSystem` changes
@@ -382,10 +383,10 @@ test files certifies nothing. ⛔ Do not re-add them to `DECLARED_COUNTS` — a
382383
self-test case in the gate refuses that by name. Re-measure them with
383384
`node scripts/isystem-census.mjs` when you want them current, and move the date.
384385

385-
**What the enforced declarations row counts.** Not the four field declarations
386-
above — those are four *distinct fields* that happen to share a name, and only
386+
**What the enforced declarations row counts.** Not the three field declarations
387+
above — those are three *distinct fields* that happen to share a name, and only
387388
the first is elevation. This row counts every position where the parser puts the
388-
identifier in a **declaring** slot: those four, plus the structural type literals
389+
identifier in a **declaring** slot: those three, plus the structural type literals
389390
that restate `ExecutionContext.isSystem`'s shape inline rather than importing it
390391
(`{ isSystem: true; tenantId?: string }`, `context?: { isSystem?: boolean }`, and
391392
the `get isSystem()` accessor on the engine's context wrapper). A restatement is

content/docs/plugins/packages.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ObjectStack is organized into **72 package manifests** across multiple categorie
2424
**The Constitution** — Protocol schemas, types, and constants for the entire ObjectStack ecosystem.
2525

2626
- **Purpose**: Zod-first schema definitions for all 15 protocol domains
27-
- **Exports**: Builder functions (`defineStack`, `defineView`, `defineApp`, `defineFlow`, `defineAgent`, `defineTool`, `defineSkill`) from the root entry, plus `ObjectSchema.create()` for objects from the `@objectstack/spec/data` subpath. Protocol namespaces (Data, UI, System, Automation, AI, API, Identity, Security, Kernel, Cloud, QA, Contracts, Integration, Studio, Shared) are not re-exported from the top-level entry for tree-shaking reasons — import them from subpaths such as `@objectstack/spec/data` and `@objectstack/spec/ui`.
27+
- **Exports**: Builder functions (`defineStack`, `defineView`, `defineApp`, `defineFlow`, `defineAgent`, `defineTool`, `defineSkill`) from the root entry, plus `ObjectSchema.create()` for objects from the `@objectstack/spec/data` subpath. Protocol namespaces (Data, UI, System, Automation, AI, API, Identity, Security, Kernel, Marketplace, QA, Contracts, Integration, Studio, Shared) are not re-exported from the top-level entry for tree-shaking reasons — import them from subpaths such as `@objectstack/spec/data` and `@objectstack/spec/ui`.
2828
- **When to use**: Import types, schemas, and builder functions when authoring metadata.
2929
- **Documentation**: [Protocol Reference](/docs/references)
3030

content/docs/references/api/discovery.mdx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ description: Discovery protocol schemas
1212
## TypeScript Usage
1313

1414
```typescript
15-
import { ApiRoutesSchema, CapabilityDescriptorSchema, DiscoverySchema, DiscoveryEnvironmentSchema, RouteHealthEntrySchema, RouteHealthReportSchema, ServiceInfoSchema, ServiceSelfInfoSchema, ServiceStatus, WellKnownCapabilitiesSchema } from '@objectstack/spec/api';
16-
import type { ApiRoutes, CapabilityDescriptor, DiscoveryEnvironment, RouteHealthEntry, RouteHealthReport, ServiceInfo, ServiceSelfInfo, ServiceStatus, WellKnownCapabilities } from '@objectstack/spec/api';
15+
import { ApiRoutesSchema, CapabilityDescriptorSchema, DiscoverySchema, DiscoveryEnvironmentSchema, EnvironmentTypeSchema, RouteHealthEntrySchema, RouteHealthReportSchema, ServiceInfoSchema, ServiceSelfInfoSchema, ServiceStatus, WellKnownCapabilitiesSchema } from '@objectstack/spec/api';
16+
import type { ApiRoutes, CapabilityDescriptor, DiscoveryEnvironment, EnvironmentType, RouteHealthEntry, RouteHealthReport, ServiceInfo, ServiceSelfInfo, ServiceStatus, WellKnownCapabilities } from '@objectstack/spec/api';
1717

1818
// Validate data
1919
const result = ApiRoutesSchema.parse(data);
@@ -161,6 +161,23 @@ Deployment posture a discovery response advertises. Deliberately three coarse bu
161161
* `development`
162162

163163

164+
---
165+
166+
## EnvironmentType
167+
168+
Environment categorical tag (prod/sandbox/dev/test/…)
169+
170+
### Allowed Values
171+
172+
* `production`
173+
* `sandbox`
174+
* `development`
175+
* `test`
176+
* `staging`
177+
* `preview`
178+
* `trial`
179+
180+
164181
---
165182

166183
## RouteHealthEntry

0 commit comments

Comments
 (0)