Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .changeset/tenant-plan-dual-source-c16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
"@objectstack/spec": major
---

BREAKING(spec): 删除 `@objectstack/spec/system` 的整个 tenant-provisioning 家族(`TenantPlan(Schema)` / `TenantRegion(Schema)` / `TenantProvisioningStatus(Enum)` / `ProvisioningStep(Schema)` / `TenantProvisioningRequest(Schema)` / `TenantProvisioningResult(Schema)`)及 `@objectstack/spec/contracts` 的 `IProvisioningService` / `ITenantRouter` / `ResolvedTenantContext` —— `TenantPlan(Schema)` 现在全包唯一地指 `@objectstack/spec/cloud` 的 5 值声明 (#4739, #4535 C16)

`TenantPlan` + `TenantPlanSchema` 过去被两个入口导出,但**不是同一个声明**,拿到哪个词表只取决于 import 路径 —— #4411 陷阱:

| 入口 | 声明位置 | 词表 | 状态 |
|:--|:--|:--|:--|
| `@objectstack/spec/cloud`(**不变,唯一真源**) | `cloud/tenant.zod.ts` | `free / starter / pro / enterprise / custom`(5 值) | **活**:嵌入 `EnvironmentSchema.plan`、`TenantContextSchema.plan`、`ProvisionTenantRequestSchema.plan`,cloud 仓 service-tenant 经这些 schema 实际消费 |
| `@objectstack/spec/system`(**本次删除**) | `system/provisioning.zod.ts` | `free / pro / enterprise`(3 值子集) | **declared-only**:仅嵌入 `TenantProvisioningRequest/Result`,该 provisioning 协议三仓(objectstack / cloud / objectui)零实现零调用 |

system 侧不是孤立的一个枚举,而是一整套从未实现的 provisioning 协议:`TenantProvisioningRequest/Result` 加上 `contracts` 里的 `IProvisioningService` / `ITenantRouter` 契约,import 语句级三仓实测**零实现、零调用、零 importer**(cloud 仓 `service-tenant` 的 `TenantProvisioningService` 是重名的本地类,消费的是 `@objectstack/spec/cloud` 的 `ProvisionTenantRequest`,与被删家族无关)。它已被 cloud 入口的 `Provision*` 家族整体取代,故按维护者裁决(#4739,路线 B)删除 system 侧全家族,cloud 侧一字未动。

## FROM → TO

```ts
// FROM —— 编译期起将以 TS2305 失败(实测三仓零命中,预期无人受影响)
import { TenantPlanSchema, type TenantPlan } from '@objectstack/spec/system';
// TO —— 唯一声明(注意词表从 3 值子集变为 5 值全集:多出 starter / custom)
import { TenantPlanSchema, type TenantPlan } from '@objectstack/spec/cloud';
```

```ts
// FROM —— TS2305
import type { TenantProvisioningRequest, TenantProvisioningResult } from '@objectstack/spec/system';
import type { IProvisioningService, ITenantRouter, ResolvedTenantContext } from '@objectstack/spec/contracts';
// TO —— 活的 provisioning 协议在 cloud 入口
import type { ProvisionTenantRequest, ProvisionTenantResponse, TenantContext } from '@objectstack/spec/cloud';
```

- `TenantRegion(Schema)` / `TenantProvisioningStatus(Enum)` / `ProvisioningStep(Schema)`:无同名替代物。region 与 step 追踪从未接入任何运行时;租户生命周期状态的活表面是 `@objectstack/spec/cloud` 的 `TenantDatabaseStatusSchema` 与 `EnvironmentSchema.status`。
- 类型收窄注意:改从 `./cloud` import 后,`TenantPlan` 联合类型从 3 值**变宽**为 5 值 —— 对 plan 做穷举 switch 的代码要补 `starter` / `custom` 两个分支(这正是双源曾经隐藏的漂移)。

## 定级理由(逐条自证,未照抄前例)

定 **major**,因为这是**已发布导出名的移除**:外部对上述 15 个导出名(`./system` 12 个 + `./contracts` 3 个)的 import 会以 TS2305 编译失败(与 C14 / C6 同形)。

同时它是**零元数据迁移**:

- 被删 6 个 def(`system/ProvisioningStep` / `system/TenantPlan` / `system/TenantProvisioningRequest` / `system/TenantProvisioningResult` / `system/TenantProvisioningStatusEnum` / `system/TenantRegion`)均不从 `BUILTIN_METADATA_TYPE_SCHEMAS` 元数据根可达 —— #4650 门禁对 `authorable-surface.json` 被删 21 行的实跑判定是三组「def no longer emitted by this build」自证路径(输出见 PR),**无 tombstone、无 ADR-0087 conversion / migration**(`spec-changes.json` / upgrade-guide 两 gate 零变化)。
- 已存 `sys_metadata` 数据、运行时校验行为全部不受影响;`cloud/tenant.zod.ts` 与 `system/tenant.zod.ts`(`system/Tenant` 行级租户记录,自带内联枚举、不引用被删文件)一字未动。
- JSON Schema 产物中上述 6 个 def 停止发布(`json-schema.manifest.json` 同步删键,#2978 蓄意移除通道)。

## 基线 12 → 10

`dual-source-exports.baseline.json` 删掉 `TenantPlan — [./cloud (type)] ≠ [./system (type)]` 与 `TenantPlanSchema — [./cloud (const)] ≠ [./system (const)]` 两行,其余行一字未动。
1 change: 0 additions & 1 deletion content/docs/references/cloud/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"environment-package",
"package",
"package-version",
"provisioning",
"template-manifest",
"---Marketplace & Distribution---",
"app-store",
Expand Down
32 changes: 0 additions & 32 deletions content/docs/references/cloud/provisioning.mdx

This file was deleted.

17 changes: 15 additions & 2 deletions content/docs/references/cloud/tenant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Design decisions:
## TypeScript Usage

```typescript
import { PackageInstallationSchema, PackageInstallationStatusSchema, ProvisionTenantRequestSchema, ProvisionTenantResponseSchema, TenantContextSchema, TenantDatabaseSchema, TenantDatabaseStatusSchema, TenantIdentificationSourceSchema, TenantRoutingConfigSchema } from '@objectstack/spec/cloud';
import type { PackageInstallation, PackageInstallationStatus, ProvisionTenantRequest, ProvisionTenantResponse, TenantContext, TenantDatabase, TenantDatabaseStatus, TenantIdentificationSource, TenantRoutingConfig } from '@objectstack/spec/cloud';
import { PackageInstallationSchema, PackageInstallationStatusSchema, ProvisionTenantRequestSchema, ProvisionTenantResponseSchema, TenantContextSchema, TenantDatabaseSchema, TenantDatabaseStatusSchema, TenantIdentificationSourceSchema, TenantPlanSchema, TenantRoutingConfigSchema } from '@objectstack/spec/cloud';
import type { PackageInstallation, PackageInstallationStatus, ProvisionTenantRequest, ProvisionTenantResponse, TenantContext, TenantDatabase, TenantDatabaseStatus, TenantIdentificationSource, TenantPlan, TenantRoutingConfig } from '@objectstack/spec/cloud';

// Validate data
const result = PackageInstallationSchema.parse(data);
Expand Down Expand Up @@ -161,6 +161,19 @@ const result = PackageInstallationSchema.parse(data);
* `default`


---

## TenantPlan

### Allowed Values

* `free`
* `starter`
* `pro`
* `enterprise`
* `custom`


---

## TenantRoutingConfig
Expand Down
1 change: 0 additions & 1 deletion content/docs/references/system/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ This section contains all protocol schemas for the system layer of ObjectStack.
<Card href="/docs/references/system/migration" title="Migration" description="Source: packages/spec/src/system/migration.zod.ts" />
<Card href="/docs/references/system/notification" title="Notification" description="Source: packages/spec/src/system/notification.zod.ts" />
<Card href="/docs/references/system/object-storage" title="Object Storage" description="Source: packages/spec/src/system/object-storage.zod.ts" />
<Card href="/docs/references/system/provisioning" title="Provisioning" description="Source: packages/spec/src/system/provisioning.zod.ts" />
<Card href="/docs/references/system/registry-config" title="Registry Config" description="Source: packages/spec/src/system/registry-config.zod.ts" />
<Card href="/docs/references/system/search-engine" title="Search Engine" description="Source: packages/spec/src/system/search-engine.zod.ts" />
<Card href="/docs/references/system/security-context" title="Security Context" description="Source: packages/spec/src/system/security-context.zod.ts" />
Expand Down
1 change: 0 additions & 1 deletion content/docs/references/system/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"environment-artifact",
"license",
"migration",
"provisioning",
"registry-config",
"settings-client",
"settings-manifest",
Expand Down
142 changes: 0 additions & 142 deletions content/docs/references/system/provisioning.mdx

This file was deleted.

15 changes: 0 additions & 15 deletions packages/spec/api-surface.json
Original file line number Diff line number Diff line change
Expand Up @@ -1162,8 +1162,6 @@
"PlanSchema (const)",
"PresignedUrlConfig (type)",
"PresignedUrlConfigSchema (const)",
"ProvisioningStep (type)",
"ProvisioningStepSchema (const)",
"PushNotification (type)",
"PushNotificationSchema (const)",
"QueueConfig (type)",
Expand Down Expand Up @@ -1324,18 +1322,8 @@
"TenantIsolationConfig (type)",
"TenantIsolationConfigSchema (const)",
"TenantIsolationLevel (type)",
"TenantPlan (type)",
"TenantPlanSchema (const)",
"TenantProvisioningRequest (type)",
"TenantProvisioningRequestSchema (const)",
"TenantProvisioningResult (type)",
"TenantProvisioningResultSchema (const)",
"TenantProvisioningStatus (type)",
"TenantProvisioningStatusEnum (const)",
"TenantQuota (type)",
"TenantQuotaSchema (const)",
"TenantRegion (type)",
"TenantRegionSchema (const)",
"TenantSchema (const)",
"TenantSecurityPolicy (type)",
"TenantSecurityPolicyInput (type)",
Expand Down Expand Up @@ -3752,7 +3740,6 @@
"IPackageService (interface)",
"IPluginLifecycleEvents (interface)",
"IPluginValidator (interface)",
"IProvisioningService (interface)",
"IPubSub (interface)",
"IQueueService (interface)",
"IRealtimeService (interface)",
Expand All @@ -3772,7 +3759,6 @@
"IStartupOrchestrator (interface)",
"IStorageService (interface)",
"ITeamGraphService (interface)",
"ITenantRouter (interface)",
"ImportObjectOpts (interface)",
"ImportObjectResult (interface)",
"InboxListResult (interface)",
Expand Down Expand Up @@ -3853,7 +3839,6 @@
"ReportSchedule (interface)",
"ResolveDependenciesInput (interface)",
"ResolveShareLinkResult (interface)",
"ResolvedTenantContext (interface)",
"ResumeSignal (interface)",
"RlsMembershipContext (interface)",
"RollbackInput (interface)",
Expand Down
21 changes: 0 additions & 21 deletions packages/spec/authorable-surface.json
Original file line number Diff line number Diff line change
Expand Up @@ -6569,12 +6569,6 @@
"system/PresignedUrlConfig:operation",
"system/PresignedUrlConfig:responseContentDisposition",
"system/PresignedUrlConfig:responseContentType",
"system/ProvisioningStep:completedAt",
"system/ProvisioningStep:durationMs",
"system/ProvisioningStep:error",
"system/ProvisioningStep:name",
"system/ProvisioningStep:startedAt",
"system/ProvisioningStep:status",
"system/PushNotification:actions",
"system/PushNotification:badge",
"system/PushNotification:body",
Expand Down Expand Up @@ -6887,21 +6881,6 @@
"system/TenantConnectionConfig:authToken",
"system/TenantConnectionConfig:group",
"system/TenantConnectionConfig:url",
"system/TenantProvisioningRequest:adminEmail",
"system/TenantProvisioningRequest:displayName",
"system/TenantProvisioningRequest:metadata",
"system/TenantProvisioningRequest:orgId",
"system/TenantProvisioningRequest:plan",
"system/TenantProvisioningRequest:region",
"system/TenantProvisioningResult:connectionUrl",
"system/TenantProvisioningResult:error",
"system/TenantProvisioningResult:plan",
"system/TenantProvisioningResult:provisionedAt",
"system/TenantProvisioningResult:region",
"system/TenantProvisioningResult:status",
"system/TenantProvisioningResult:steps",
"system/TenantProvisioningResult:tenantId",
"system/TenantProvisioningResult:totalDurationMs",
"system/TenantQuota:apiRateLimit",
"system/TenantQuota:maxDeploymentsPerDay",
"system/TenantQuota:maxObjects",
Expand Down
1 change: 0 additions & 1 deletion packages/spec/docs-import-surface.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
"system/ServiceConfig — no type export",
"system/ServiceCriticality — no type export",
"system/ServiceStatus — no type export",
"system/TenantProvisioningStatusEnum — no type export",
"ui/AIChatWindowProps — no type export",
"ui/ActionType — no type export",
"ui/BreakpointColumnMap — no type export",
Expand Down
4 changes: 1 addition & 3 deletions packages/spec/dual-source-exports.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"EnvironmentArtifactInput — [./cloud (type)] ≠ [./system (type)]",
"EnvironmentArtifactSchema — [./cloud (const)] ≠ [./system (const)]",
"PackageDependency — [./cloud (type)] ≠ [./kernel (type)]",
"PackageDependencySchema — [./cloud (const)] ≠ [./kernel (const)]",
"TenantPlan — [./cloud (type)] ≠ [./system (type)]",
"TenantPlanSchema — [./cloud (const)] ≠ [./system (const)]"
"PackageDependencySchema — [./cloud (const)] ≠ [./kernel (const)]"
]
}
Loading
Loading