CellSpec 核心字段
wesgine CellSpec 中核心元数据字段的声明式配置。
ID
Cell 的唯一标识符。
- 标记
wesgine:"immutable" - 创建后不可变
- 不同产品的 ID 命名规范不同:
- wesclaw:
"main" - wescode:
"ws-{hash}"(workspace 路径确定性派生) - wescraft:
"personal"或"team-{id}" - teleclaw:
"dept-{id}"
- wesclaw:
Timezone
时区声明:
spec := wesgine.CellSpec{
Timezone: "Asia/Shanghai",
}
- 标记
wesgine:"immutable" - 创建后不可变
- 影响 Cron 调度、时间显示
Locale
区域设置:
spec := wesgine.CellSpec{
Locale: "zh-CN",
}
- 标记
wesgine:"mutable" - 运行时可修改
- 影响 Agent 语言偏好
CellSpec 分层
CellSpec 通过 Go struct embedding 分层(cellspec.go):
type CellSpec struct {
ID string
CellCoreSpec // Timezone / Locale / Compliance / Governance / ...
CellAdapterSpec // Channels / Email / MCPs / Cron / ...
CellSchedulingSpec // Quotas / CycleDetect / FaultPolicy / ...
CellPortableSpec // Export/Import 打包行为
}
嵌入保持向后兼容(spec.Timezone 等价 spec.CellCoreSpec.Timezone)。
字段可变性标签
| 标签 | 含义 |
|---|---|
wesgine:"immutable" | 创建后不可变 |
wesgine:"mutable" | 运行时可修改 |
wesgine:"restricted" | 限制修改条件 |
SpecPatch
运行时更新 CellSpec 的子集:
PATCH /admin/cells/{id}
hyp.Cells().UpdateSpec(ctx, cellID, SpecPatch{
Locale: ptr("en-US"),
Quotas: &newQuotas,
})
不可 Patch 的字段
ID(immutable)Timezone(immutable)Cron(种子声明,运行时走cell.Cron()管理)Email(种子声明,运行时走cell.Email()管理)
存储
存储没有声明面:
- 路径由引擎从
(DataDir, ID)推出 - 三层 SQLite(meta.db / state.db / sessions.db)
- 表内无 cell_id / owner_id
CellSpec.Storage 与 BootParams.StorageBackend 已删除(ADR-390)。
默认治理
未声明 Governance → DefaultGovernance() = ModeOpen。
不 fail-loud,也没有 ErrGovernanceRequired。