CellSpec 核心字段

wesgine CellSpec 中核心元数据字段的声明式配置。


ID

Cell 的唯一标识符。


Timezone

时区声明:

spec := wesgine.CellSpec{
    Timezone: "Asia/Shanghai",
}

Locale

区域设置:

spec := wesgine.CellSpec{
    Locale: "zh-CN",
}

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 的字段


存储

存储没有声明面:

CellSpec.Storage 与 BootParams.StorageBackend 已删除(ADR-390)。


默认治理

未声明 Governance → DefaultGovernance() = ModeOpen。

不 fail-loud,也没有 ErrGovernanceRequired。