Deployment state machine
The 19 deployment states, 9 polled and 7 requiring attention, with UI labels and source locations.
State sets
The deployment state machine has 19 states in two sets: 9 polled and 7 requiring attention. The sets may overlap.
| State | UI label | Polled | Attention | Source |
|---|---|---|---|---|
PREPARED | 待提交 | — | — | src/client/state/deployment.mjs:1 |
UPLOADING | 上传运行包 | — | — | src/client/state/deployment.mjs:1 |
UPLOAD_UNKNOWN | 上传结果待核对 | — | ⚠️ | src/client/state/deployment.mjs:1 |
UPLOADED | 已上传 | — | — | src/client/state/deployment.mjs:1 |
CREATING | 创建中 | — | — | src/client/state/deployment.mjs:1 |
CREATE_UNKNOWN | 创建结果待核对 | — | ⚠️ | src/client/state/deployment.mjs:1 |
PROVISIONING | 准备实例 | ✅ | — | src/client/state/deployment.mjs:1 |
CONFIGURING | 配置访问令牌 | ✅ | — | src/client/state/deployment.mjs:1 |
TOKEN_PENDING | 等待配置生效 | ✅ | ⚠️ | src/client/state/deployment.mjs:1 |
STARTING | 启动中 | ✅ | — | src/client/state/deployment.mjs:1 |
UPDATING | 切换版本 · 等待入口确认 | ✅ | — | src/client/state/deployment.mjs:1 |
UPDATE_UNKNOWN | 更新结果待核对 | ✅ | ⚠️ | src/client/state/deployment.mjs:1 |
READY | 就绪 | — | — | src/client/state/deployment.mjs:1 |
AVAILABLE_UPDATING | 入口可用 · 平台更新中 | ✅ | — | src/client/state/deployment.mjs:1 |
ACTION_REQUIRED | 需要处理 | — | ⚠️ | src/client/state/deployment.mjs:1 |
FAILED | 失败 | — | ⚠️ | src/client/state/deployment.mjs:1 |
DELETING | 删除中 | ✅ | — | src/client/state/deployment.mjs:1 |
DELETE_UNKNOWN | 删除结果待核对 | ✅ | ⚠️ | src/client/state/deployment.mjs:1 |
DELETED | 已删除 | — | — | src/client/state/deployment.mjs:1 |
"Polled" means the client keeps refreshing; "attention" means the UI must offer an action instead of spinning. UI labels are the product's own Chinese copy and are kept verbatim.
All three constants are single-line definitions in src/client/state/deployment.mjs: DEPLOYMENT_LABELS (line 1), DEPLOYMENT_POLL_STATES (line 3) and DEPLOYMENT_ATTENTION_STATES (line 5), which is why every Source cell points at the same place.
Polled states
These states mean the platform is still working; the client may safely keep polling:
| State | UI label |
|---|---|
UPDATING | 切换版本 · 等待入口确认 |
UPDATE_UNKNOWN | 更新结果待核对 |
PROVISIONING | 准备实例 |
CONFIGURING | 配置访问令牌 |
TOKEN_PENDING | 等待配置生效 |
STARTING | 启动中 |
AVAILABLE_UPDATING | 入口可用 · 平台更新中 |
DELETING | 删除中 |
DELETE_UNKNOWN | 删除结果待核对 |
Attention states
These states mean the outcome is unknown or needs a human; more polling will not change them:
| State | UI label |
|---|---|
CREATE_UNKNOWN | 创建结果待核对 |
UPLOAD_UNKNOWN | 上传结果待核对 |
UPDATE_UNKNOWN | 更新结果待核对 |
DELETE_UNKNOWN | 删除结果待核对 |
ACTION_REQUIRED | 需要处理 |
FAILED | 失败 |
TOKEN_PENDING | 等待配置生效 |
Unknown is not failed
A *_UNKNOWN state means the last request has an unknown outcome. Reconcile against the cloud side before retrying or rolling back; a blind retry can create a second resource.
Happy path
PREPARED → UPLOADING → UPLOADED → CREATING → PROVISIONING → CONFIGURING
→ TOKEN_PENDING → STARTING → READY
READY → UPDATING → AVAILABLE_UPDATING → READY
any state → FAILED | ACTION_REQUIRED
any state → DELETING → DELETEDOnly two branches leave the happy path: failure and deletion. Every *_UNKNOWN state is an interrupted step on the happy path, not a separate branch.
Version and compatibility
| Item | Value | Notes |
|---|---|---|
| States | 19 | A new state must land here and in the client |
| Polled states | 9 | DEPLOYMENT_POLL_STATES |
| Attention states | 7 | DEPLOYMENT_ATTENTION_STATES |
| UI labels | Hardcoded Chinese copy | See src/client/state/deployment.mjs |
Developer entry points
| Item | Source |
|---|---|
| Deployment states | src/client/state/deployment.mjs |
| Deployment client | src/studio-deployments.mjs |
| Deployment versions | src/deployment-versions.mjs |
| Deployment rollouts | src/deployment-rollouts.mjs |
Related tests:
| Test file | Location |
|---|---|
| studio-deployments.test.mjs | tests/studio-deployments.test.mjs |