@sema-agent/settings-schema 36.0.0 → 37.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/conformance/VERSION +1 -1
  3. package/conformance/cases/c03-literal-dotted-top-key/expected.json +3 -6
  4. package/conformance/cases/c10-record-key-secret-redacted-twice/expected.json +1 -2
  5. package/conformance/cases/c23-mixed-validity-models/expected.json +2 -4
  6. package/conformance/cases/c24-valid-entries-with-unknown-keys/expected.json +1 -2
  7. package/conformance/cases/c25-published-roundtrip-zero-warnings/expected.json +2 -4
  8. package/conformance/cases/c30-version-triple-a-first/expected.json +2 -4
  9. package/conformance/cases/c31-version-triple-b-changed/expected.json +2 -4
  10. package/conformance/cases/c32-version-triple-a-restored/expected.json +2 -4
  11. package/conformance/cases/c40-s712-identity-only-what-reads-out/expected.json +1 -2
  12. package/conformance/cases/c41-s792-encoded-pem-identity/expected.json +1 -2
  13. package/conformance/cases/c42-s792-unknown-key-secret-redacted/expected.json +3 -6
  14. package/conformance/cases/c43-s792-form-and-deep-encoded-pem/expected.json +1 -2
  15. package/conformance/cases/c44-s792-utf8-escape-glued-token/expected.json +1 -2
  16. package/conformance/cases/c45-s792-identity-bounds-and-decode-depth/expected.json +1 -2
  17. package/conformance/cases/c47-s811-roles-key-url-userinfo-withheld/expected.json +1 -2
  18. package/conformance/cases/c48-s935-model-headers-transported/expected.json +2 -4
  19. package/conformance/cases/c49-s935-model-headers-secret-entry-dropped/expected.json +1 -2
  20. package/conformance/cases/c69-deep-encoded-token-past-every-reading/expected.json +1 -2
  21. package/conformance/cases/c70-rewritten-token-in-front-of-encoded-pem-header/expected.json +1 -2
  22. package/conformance/cases/c72-dangling-reference-write-seat-refuses/expected.json +1 -2
  23. package/conformance/cases/c97-roles-own-proto-key-entry-dropped/expected.json +1 -2
  24. package/conformance/cases/cc03-model-compat-unknown-subkey/expected.json +2 -4
  25. package/conformance/cases/cli01-model-name-nfc-vs-nfd/expected.json +1 -2
  26. package/conformance/cases/cli02-control-and-zero-width-chars/expected.json +1 -2
  27. package/conformance/cases/cli05-long-and-prefix-colliding-names/expected.json +6 -12
  28. package/conformance/cases/t01-absent-domain-key-not-null/expected.json +1 -2
  29. package/conformance/cases/t03-prototype-name-key-not-swallowed/expected.json +1 -2
  30. package/dist/types.d.ts +3 -3
  31. package/dist/types.js +6 -2
  32. package/llms-full.txt +1 -1
  33. package/llms.txt +1 -1
  34. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,139 @@
8
8
 
9
9
  ## Unreleased
10
10
 
11
+ ## 37.0.0 — 2026-11-29 — major:目录条目 `ModelEntry.tier` 去 `.default("standard")` —— 没写 `tier` 的条目解析后没有 `tier`(缺席 = 未声明,读腿不补、写腿不落盘;型面 `ModelTier` → `ModelTier | undefined`;三词闭集与坏值整条拒不变);一致性语料 27 例重录;导出面零增删
12
+
13
+ ### ⚠️ BREAKING(默认值变更):目录条目 `ModelEntry.tier` 去 `.default("standard")` —— 缺席就是未声明
14
+
15
+ > 档位(按发版纪律「默认值变更」属 **major**):同一份配置解析出不同结果 —— 没写 `tier` 的目录条目,解析结果里自此没有 `tier`(此前被铸成 `"standard"`);
16
+ > 型面 `ModelEntry["tier"]` 由 `ModelTier` 变 `ModelTier | undefined`(连带 `ModelsConfig` / `EffectiveConfig` / `EffectiveWire` 里的 `models.models[]`)。三词闭集
17
+ > `cheap` / `standard` / `premium` 与坏值整条拒不变,不加新词,不收 `null`。导出面零增删。
18
+ > 钉:`test/model-tier-absent-37.0.0.test.ts`(新:解析 · 型面 · 七条读腿 · 写腿与盘上字节 · 三词与坏值负控)· `test/atomic-salvage-18.0.0.test.ts`(17.2.0 基线 24 行的视图面读数按本裁定逐行登记,基线文件不动)·
19
+ > `test/model-headers-6.4.0.test.ts`(「不带 headers 的条目零变化」那一格的五只 `stableHash` 金样重录;另加一条断言:给每条条目注回 `tier: "standard"` 复现此前五值 —— 哈希变化只因 `tier` 不再物化)·
20
+ > 一致性语料 27 例重录(差 = 每条没写 `tier` 的条目少一行 `"tier": "standard"`,别无他差)。
21
+
22
+ **规则**:目录条目的 `tier` 缺席就是未声明;搬运保留缺席;按 `tier` 挑模型时,指定了 tier 的查询只认声明了同一个词的条目,不指定 tier 的查询不按它筛。
23
+ 本包是声明层:不替任何读者把「没写」读成某一档;挑模型的语义在引擎的选择器(按 `Model.params.tier` 严格同值),本包不复刻、不改它。
24
+
25
+ **为什么**:同一条没声明档位的模型,从服务端环境变量两槽(`MODEL_ID` / `MODEL_CHEAP_ID`)装出来时没有 tier(不进任何指定档);一经本包任何一条读腿
26
+ (`readEffectiveWire` / `buildEffective` / `parseDomainSalvaged` / `loadLocalConfig` / `FileConfigStore`)或写腿(`validateDomain` / `writeDomainFile` 一族)就成了
27
+ `standard`(进 standard 档,可能挤掉原来的赢家)。终端把环境变量两槽物化进本地 `config.d/models.json`、或上传到管理台时都不写 `tier` —— 这一条模型搬了一次家,
28
+ `{ select: { tier: "standard" } }` 的答案就变了。本包凭空添了一件条目没说过的事实,写腿还把它落进了存储字节。
29
+
30
+ **破坏面一览**:
31
+
32
+ | 件 | 改前 → 改后 | 消费方怎么改 | 已存数据 |
33
+ |---|---|---|---|
34
+ | `ModelEntry.tier` 解析结果(运行期) | 没写 `tier` ⇒ `tier: "standard"` → 没写 `tier` ⇒ 结果里没有 `tier` 键;写了三词之一 ⇒ 原样(改前改后同) | 读解析结果的 `tier` 要处理 `undefined`;往下游投影(如铸成引擎 `Model.params`)时缺席就省键,不写 `tier: undefined`、不自补缺省 | 见下「已存数据」 |
35
+ | `ModelEntry["tier"]` 型面(编译期) | `ModelTier` → `ModelTier \| undefined` | 按必有值读的点 tsc 红一次 = 通知;补缺席分支 | 无 |
36
+ | 写腿落盘(`writeDomainFile` / `writeDomainFileIf` / `writeBundle` 等经本包解析再写的口) | 没写 `tier` 的条目被写成带 `"tier": "standard"` 的字节 → 原样不写 | 无 | 本版之前经这些口写过的文件里已有 `"tier": "standard"`,本版不改写它 |
37
+ | 消费方由本包 schema 生成的 JSON Schema(如管理台的配置 schema 接口;本包不出这份投影) | `models[].tier` 带 `"default": "standard"` → 不再带缺省 | 跟着重出;把它当表单用的,「未声明」是界面占位,不进 JSON | 无 |
38
+
39
+ **已存数据**:显式写着的 `tier` 原样保留(包括本版之前经写腿或管理台写核落进存储的 `"tier": "standard"` —— 本版不撤它,也不声称它是用户自己选的)。
40
+ 存储里没写 `tier` 的条目自此按未声明读。不提供一次性迁移:「没写」在旧读法与新读法下字节相同,本地 `config.d/models.json` 里手写省键的与终端从环境变量物化的也分不出来,
41
+ 任何自动补写都会误改其中一类。需要某条目继续被 `{ select: { tier: "standard" } }` 选中的部署,在那一条上显式写 `"tier": "standard"`,或把那个角色改成按名绑定(`{ model: "<名>" }`)。
42
+
43
+ **升级前自检**(在换入提货本版的服务端之前做;本地 `config.d/models.json` 与中心存储的文档都要查):
44
+ 1. `validateDomain("models", 文档)` **拦不住**这一类 —— 省掉 `tier` 是合法形,两版都受理。要按下面两步人工查。
45
+ 2. 找出所有写成 `{ select: { tier: "standard" } }` 的角色:全局 `models.roles` 与每一份 `rosters[].roles`(两处是同一张角色表,都能写 `{ select }`)。
46
+ 3. 对每一个这样的角色,确认目录里至少有一条**启用、可服务**的条目**显式**写着 `"tier": "standard"`,而且它就是你要它选中的那一条(或那几条)。
47
+ 没有 ⇒ 在要选中的条目上写 `"tier": "standard"`,或把角色改成按名绑定 / 档位绑定。有、但另有没写 `tier` 的条目原本也靠缺省参选 ⇒ 那些条目自此不参选,要它们参选就同样补写。
48
+
49
+ **三问**:
50
+ - **谁需要**:靠环境变量两槽起服、再由终端把这两条模型物化到本地目录或上传到管理台的部署 —— 要求条目的档位声明在搬运中不变,搬家前后同一查询选到同一模型。
51
+ - **谁受伤**:依赖「没写 tier ⇒ standard」的目录(角色写成 `{ select: { tier: "standard" } }`)。没写 `tier` 的条目自此不进 standard 档的候选;后续怎么走归各读者(引擎的角色回落链、服务端的拒法),
52
+ 本包不判。按各仓读码,已知三类结局(详见「各消费方」):
53
+ 1. **响亮拒**:`default` 角色无匹配、又没有档位绑定接住 ⇒ 服务端模型面组拒(热更新留上一代),起服时没有可用的上一份或环境变量缺省则拒起;记忆整理角色的整条回落链(`consolidate` → `summarize`)都选不到模型、
54
+ 又没有 flash 档绑定,且显式开启了整理驱动 ⇒ 服务端拒起。
55
+ 2. **整理静默转关**:同上整理链选不到模型、整理驱动没设 ⇒ 整理阀门派生为关,原先派生为开的部署升级后转关(不再自动整理)。
56
+ 3. **静默改选**:目录里另有显式 standard 条目时,没写 `tier` 的条目静默退出候选,standard 查询可能改选到另一条(价格可能不同);`summarize` / `subagent` / `verifier` / `classifier`
57
+ 等角色无匹配时不拒,沿各自的回落链改选,可能落到主模型。
58
+ 读解析结果、按 `tier` 必有值写代码的消费方 tsc 红一次。
59
+ - **补偿**:升级前照上面「升级前自检」三步查;在要被 standard 档选中的条目上显式写 `"tier": "standard"`,或把角色改成按名绑定 / 档位绑定;读者侧把缺席当「未声明」处理(不补缺省、投影时省键)。
60
+
61
+ **三类单列**:
62
+ - **偏离参照**:无(引擎选择器的严格同值筛是行为参照,本版不改它;本版改的是本包自己此前替读者补的缺省)。
63
+ - **安全放宽**:无(未声明不被当成通配、不被读成任何一档;没有任何条目因本版多进一个指定档;坏值整条拒不变)。
64
+ - **硬破坏**:有 —— 输出型面 `tier` 可缺席;同一份没写 `tier` 的配置解析结果不同。消费方读解析结果时要处理 `undefined`。
65
+
66
+ **滚动次序**(避免新旧版本混跑时一边省键、一边拒收):
67
+ 1. **先**升级会把读口结果与线上原文逐键比对的读者 —— 旧版读口会给省键的条目补出 `tier`,它们会把「读出了线上没有的键」当成坏载荷拒收整份有效配置。管理台仓里的编排器(orchestrator)对 `models` 域做这一比对,
68
+ 它必须**先于**管理台换入本版。
69
+ 2. 服务端换入本版(它的两半:目录条目铸成引擎模型时缺席省键;拒句给出「显式写 standard / 按名绑定」两条出路)。**之前先做「升级前自检」**。
70
+ 走管理台写核的中心存储:与管理台谁先谁后都不出拒收 —— 旧管理台写进存储的是显式 standard,新服务端照显式读;新管理台省键而服务端还旧,服务端照旧补 standard(行为同今天,只是还没保真)。
71
+ 本地 `config.d/models.json` 部署(以及不经本包写腿落库的文档)本来就可以省 `tier`:**单换服务端这一步**就会带出「谁受伤」里的三类结局,没有别的仓先后可以挡。
72
+ 3. 管理台最后换入本版(编辑器加「未声明」、新建与连接向导不再预填 standard、写核不再补值)。**整条写读链都换入本版之后**,缺席才一路保真;混跑期间不另设兼容读法。
73
+
74
+ **各消费方**(服务端、管理台〔含编排器〕、终端、引擎的读点取自本版设计与两轮证伪复核对各仓源码的读码,本包没有在各仓上跑过;client-core / sdk 为推断;动作栏是给各仓的建议,由各仓自己定):
75
+
76
+ | 消费方 | 读点 | 动作 |
77
+ |---|---|---|
78
+ | sema-server(服务端) | 目录条目经 `ModelEntry.safeParse` 判形后铸成引擎 `Model`,当前无条件写 `params.tier`;两只指纹各读一处:模型面热换装指纹读每条启用的**目录条目**(含顶层 `tier`),记忆整理座的重启指纹读**焊死的整理座**那一只引擎 `Model`(含 `params.tier`)及它的回落链条目;一致性语料在服务端的两条生产读腿(本地目录读腿与远端有效配置读腿)上对拍 | 提货本版:铸点缺席省键(不写 `tier: undefined`);撤掉「目录缺 tier ⇒ 补 standard ⇒ standard 选择命中」的承诺 —— 两只终形钉、钉上的块头注与行注、两处源码注释一并改,换成缺席拒 / 显式 standard 落地两格;`default` 角色写 `{ select: { tier: "standard" } }` 而无匹配、又无档位绑定时,模型面以 `config.default_model_missing` 组拒(热更新留上一代,起服无可用缺省则拒起),拒句补「显式写 standard / 按名绑定」;两条生产读腿的一致性对拍随本版重录的金样对齐。指纹的连带:存量快照里任一启用条目由显式 standard 变省键 ⇒ 请求一次模型面热换装;只有整理座选中的那一条(或它的回落链条目)这样变,整理座指纹才变 —— 没有焊死的整理座、或变的是别的条目,它不变;是否为整理座这一变签出一次重启由服务端裁定并写进它的升级说明 |
79
+ | web-admin(管理台) | 写核与发布构建经本包解析(当前补 standard 落库);展示页已按「`tier` 可能不是串」守卫;编辑表单把缺席显示成 standard;两处新建写者显式写 standard;配置 schema 接口导出本包的 JSON Schema;自己的一致性适配器跑发布往返腿(落行 → 发布 → 读发布快照),自持的语料里有一例金样带被补出的 `"tier": "standard"` | 提货本版(在编排器之后):编辑器增「未声明」项、选它即删键;新建与连接向导未选档时省键;配置 schema 接口跟着重出(`tier` 不再带缺省);自持语料里带补出 `tier` 的金样重录、发布往返腿随本版金样对齐;补写核 / 发布 / 个人配置读回的省键钉与显式 standard 正例 |
80
+ | web-admin 仓的编排器(orchestrator) | 直接调 `readEffectiveWire`,把 `models` 域的读出结果与线上原文逐键比对,读出原文没有的键即拒收整份有效配置、冻在上一份 | **先于管理台**提货本版;补一格「省 `tier` 的 `/effective` 往返照收」 |
81
+ | cli(终端) | 环境变量两槽的虚拟池首次物化进本地目录、上传到管理台时都不写 `tier`,已有显式 `tier` 原样搬;目录受理只看解析成没成,不读 `tier` 的值 | 提货本版;零代码动作即保留两条搬运的省键行为;补首次物化 / 再编辑 / 上传三处的保真钉,不新增缺省或来源探测 |
82
+ | sema-core(引擎) | 选择器按 `Model.params.tier` 严格同值,条件在场无匹配返回无候选;角色解析在无候选后走各角色自己的回落链 —— `consolidate` 只回落到 `summarize`、不回落到 `default` | 零代码动作(不依赖本包补 tier)。影响面:整理角色要**整条回落链**都选不到模型才算没有整理座 —— `consolidate` 先按自己的写法选,选不到再走 `summarize`;只有两者都选不到(例如两者都写成 `{ select: { tier: "standard" } }` 而目录里没有显式 standard 条目,或 `consolidate` 这样写而 `summarize` 没写)、又没有 flash 档绑定时才是。`summarize` 另有按名绑定等能选到的写法时,整理照常落到它。没有整理座时:服务端在显式开启整理驱动时拒起(`config.env_invalid`);驱动未设时阀门派生为关,原先派生为开的部署转关。`classifier` 等其余角色按各自回落链改选或回落,不是一律拒跑 |
83
+ | client-core / sdk | 不读 `ModelEntry.tier`(推断) | 零代码动作;随依赖范围提货 |
84
+ | test | 黑盒判据 | 见下 |
85
+
86
+ **黑盒判据**(K99 – K102;装上本版、只调公开导出):
87
+ - K99:`ModelEntry.parse({ name: "m", id: "m-id" })` 的结果没有 `tier` 自有键;同一条目经 `readEffectiveWire({ version: 1, models: { models: [它] } })`、`buildEffective`、`loadLocalConfig`(本地 `config.d/models.json`)读出,条目都没有 `tier` 键,零告警。36.0.0 上同一调用读出 `tier: "standard"`。
88
+ - K100:`writeDomainFile(root, "models", { models: [{ name: "m", id: "m-id" }] })` 之后,盘上 `config.d/models.json` 的那条条目没有 `tier` 键。36.0.0 上写成 `"tier": "standard"`。
89
+ - K101:`tier` 写 `"cheap"` / `"standard"` / `"premium"` 的条目经上述各读腿原样交出该词(`"standard"` 是自有键)。
90
+ - K102:`tier` 写 `"none"` / `null` / `"Standard"` / `""` / `1` / `{}` 的条目:`ModelEntry.safeParse` 不过;`validateDomain` 不过,`writeDomainFile` 抛且不落盘(`config.d/models.json` 不出现)。
91
+ 视图面读腿(`readEffectiveWire` / `buildEffective` / `parseDomainSalvaged` / `loadLocalConfig`)的判据**前提**:坏条目有一条合法的兄弟、坏条目没有被 `roles` / `atMention.only` / `tierGroups` 按名引用、文档其余部分合法 ——
92
+ 此时逐条丢并报 `entry-dropped`(`reasonCode: "entry-schema-invalid"`)、兄弟条目幸存。坏条目被按名引用(丢掉它会留下悬空引用)或没有幸存兄弟时走既有的级联与零幸存者律,与 36.0.0 同:
93
+ `readEffectiveWire` / `buildEffective` 把整个 `models` 域退成缺省、只报 `domain-defaulted`,`parseDomainSalvaged` 抛 —— 这不是本版的回归。
94
+
95
+ **已知限制(本节说明的边界)**:
96
+ - 整理驱动没设时不只是「静默转关」:阀门派生为关、而 `MEMORY_CONSOLIDATION_INTERVAL_SEC` 或 `MEMORY_CONSOLIDATION_SCOPES` 仍配着 ⇒ 服务端以 `config.env_invalid` 拒起。上文「整理静默转关」只对这两项都没配的部署成立。
97
+ - 判「服务端有没有整理座」看的是服务端把环境变量角色底与目录 `roles` 逐键合并之后的角色表:目录里没写 `summarize` 时,环境变量角色底仍给它一个模型(有便宜槽指便宜槽,没有指主模型),整理照常有座。上文「`consolidate` 这样写而 `summarize` 没写」的例子要在合并之后 `summarize` 也选不到模型时才成立。
98
+ - 「没有焊死的整理座、或变的是别的条目,整理座指纹不变」不是绝对:服务端每次刷新都重算整理阀门与当前选座,派生阀门又取决于整理座是不是主模型。别的条目由显式 standard 变省键而让 `default` 改选时,整理座与主模型的关系可能随之变,阀门读数跟着变,整理那一片仍可能报出变化。
99
+ - 「升级前自检」第 3 步不保证穷尽:设了 `rosters[].models` 的名册会把一个 worker 可见的目录收窄成子集,`{ select }` 还可以同时带 `needs` 等别的条件、引擎一并筛 —— 全局目录里有显式 standard 的可服务条目,不保证某个 worker 看得到它、也不保证它满足全部条件。要逐 worker 对比升级前后该角色的候选与赢家;同时带别的条件、`select.tier` 为 `"standard"` 的选择器也要查。
100
+ - K102 的「`config.d/models.json` 不出现」只对还没有这个文件的新根成立;已有这个文件时,坏值拒写、原文件字节不变。
101
+
102
+ **导出面**:新增 0、删除 0;型变了的既有导出 = `ModelEntry` 及含它的型(`ModelsConfig`、`DomainConfig`、`EffectiveConfig`、`EffectiveWire` 等,`tier` 成可选)。
103
+
104
+ **自 v36.0.0 起运行期代码有改动的公开导出(机器重算;上界 —— 可达 ≠ 一定变,不可达 ⇒ 一定不变;本版新增的导出不入表)**
105
+
106
+ ```text
107
+ DOMAINS [., ./types]
108
+ DOMAIN_SCHEMAS [., ./types]
109
+ FileConfigStore [./node]
110
+ ModelEntry [., ./types]
111
+ ModelsConfig [., ./types]
112
+ NON_LOCAL_READ_DOMAINS [./conformance]
113
+ buildEffective [., ./config-fns]
114
+ changedWriteFields [., ./config-fns]
115
+ deriveLocalExpectation [./conformance]
116
+ deriveWireExpectation [./conformance]
117
+ domainFilePath [./node]
118
+ emptyEffective [., ./config-fns]
119
+ foreignKeysOf [./conformance]
120
+ isDomainName [., ./types]
121
+ loadLocalConfig [./node]
122
+ loadRemoteExec [./node]
123
+ migrateConfigDirectory [./node]
124
+ migrateConfigDocuments [./node]
125
+ migrateEffectiveSnapshot [./one-time-migrations]
126
+ parseDomain [., ./config-fns]
127
+ parseDomainLoud [., ./config-fns]
128
+ parseDomainSalvaged [., ./config-fns]
129
+ planEnvModelTableWrite [.]
130
+ readBundle [./node]
131
+ readConfigDFileReadingSync [./node]
132
+ readEffectiveWire [., ./config-fns]
133
+ remoteExecPath [./node]
134
+ resolveLegExpectation [./conformance]
135
+ runConformance [./conformance]
136
+ salvageEntries [., ./config-fns]
137
+ validateDomain [./node]
138
+ writeBundle [./node]
139
+ writeDomainFile [./node]
140
+ writeDomainFileIf [./node]
141
+ writeRemoteExec [./node]
142
+ ```
143
+
11
144
  ## 36.0.0 — 2026-11-29 — major:墓碑表 `RETIRED_ENVS` 尾插十八只编排车道退役环境变量名(`LEADER_*` 十六只、`MINIO_BUCKET`、`MODEL_ROUTER_ID`,全部 `removed` 族,表长 44 → 62:部署 env 设着非空值起服即拒,`workers[].env` / `workers[].secretEnv` 双槽写面、视图面、逐行读口与 SS-M12 行终判同拒)· 两条既有墓碑理由改写为过去时(`LEADER_CONFLICT_ROUNDS` 保留 7.83.0、`UNATTENDED_PERMISSION_MODE` 保留 server 7.109.0 与 `run-local` 现役事实并标退 leader 腿);导出面与公开型面零增删
12
145
 
13
146
  > 档位(按发版纪律「破坏性变更必 bump major」—— 校验收紧与墓碑表加行):**major** —— ① 墓碑表新增十八只 `removed` 族退役环境变量名(运行期:部署 env 仍设着其中任一非空值的在提货本版的服务端起服即拒;同一份在 `workers[].env` 写成非空串或在 `workers[].secretEnv` 以其为映射键的 `workers` 文档,在写面、视图面、逐行读口与 SS-M12 行终判中由上一版受理变拒);② 两条既有墓碑行(`LEADER_CONFLICT_ROUNDS`、`UNATTENDED_PERMISSION_MODE`)理由句改写,对旧现役现在时文字逐字比对的消费方测试会红一次。导出面零增删(`docs/API-SURFACE.md` 不动),公开类型面不变。
@@ -1 +1 @@
1
- 36.0.0
1
+ 37.0.0
@@ -40,8 +40,7 @@
40
40
  "id": "m0-id",
41
41
  "name": "m0",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {},
@@ -114,8 +113,7 @@
114
113
  "id": "m0-id",
115
114
  "name": "m0",
116
115
  "provider": "openai",
117
- "quotaWeight": 1,
118
- "tier": "standard"
116
+ "quotaWeight": 1
119
117
  },
120
118
  {
121
119
  "api": "openai-completions",
@@ -124,8 +122,7 @@
124
122
  "id": "m1-id",
125
123
  "name": "m1",
126
124
  "provider": "openai",
127
- "quotaWeight": 1,
128
- "tier": "standard"
125
+ "quotaWeight": 1
129
126
  }
130
127
  ],
131
128
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "m0-id",
41
41
  "name": "m0",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {
@@ -40,8 +40,7 @@
40
40
  "id": "keep-a-id",
41
41
  "name": "keep-a",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  },
46
45
  {
47
46
  "api": "openai-completions",
@@ -50,8 +49,7 @@
50
49
  "id": "keep-b-id",
51
50
  "name": "keep-b",
52
51
  "provider": "openai",
53
- "quotaWeight": 1,
54
- "tier": "standard"
52
+ "quotaWeight": 1
55
53
  }
56
54
  ],
57
55
  "roles": {},
@@ -85,8 +85,7 @@
85
85
  "id": "m0-id",
86
86
  "name": "m0",
87
87
  "provider": "openai",
88
- "quotaWeight": 1,
89
- "tier": "standard"
88
+ "quotaWeight": 1
90
89
  }
91
90
  ],
92
91
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "m0-id",
41
41
  "name": "m0",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {
@@ -95,8 +94,7 @@
95
94
  "id": "m0-id",
96
95
  "name": "m0",
97
96
  "provider": "openai",
98
- "quotaWeight": 1,
99
- "tier": "standard"
97
+ "quotaWeight": 1
100
98
  }
101
99
  ],
102
100
  "roles": {
@@ -40,8 +40,7 @@
40
40
  "id": "v-a-id",
41
41
  "name": "v-a",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {},
@@ -91,8 +90,7 @@
91
90
  "id": "v-a-id",
92
91
  "name": "v-a",
93
92
  "provider": "openai",
94
- "quotaWeight": 1,
95
- "tier": "standard"
93
+ "quotaWeight": 1
96
94
  }
97
95
  ],
98
96
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "v-b-id",
41
41
  "name": "v-b",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {},
@@ -91,8 +90,7 @@
91
90
  "id": "v-b-id",
92
91
  "name": "v-b",
93
92
  "provider": "openai",
94
- "quotaWeight": 1,
95
- "tier": "standard"
93
+ "quotaWeight": 1
96
94
  }
97
95
  ],
98
96
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "v-a-id",
41
41
  "name": "v-a",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {},
@@ -91,8 +90,7 @@
91
90
  "id": "v-a-id",
92
91
  "name": "v-a",
93
92
  "provider": "openai",
94
- "quotaWeight": 1,
95
- "tier": "standard"
93
+ "quotaWeight": 1
96
94
  }
97
95
  ],
98
96
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "keep-id",
41
41
  "name": "keep",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {
@@ -40,8 +40,7 @@
40
40
  "id": "keep-id",
41
41
  "name": "keep",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {
@@ -43,8 +43,7 @@
43
43
  "id": "sibling-id",
44
44
  "name": "sibling",
45
45
  "provider": "openai",
46
- "quotaWeight": 1,
47
- "tier": "standard"
46
+ "quotaWeight": 1
48
47
  }
49
48
  ],
50
49
  "roles": {},
@@ -133,8 +132,7 @@
133
132
  "id": "keep-id",
134
133
  "name": "keep",
135
134
  "provider": "openai",
136
- "quotaWeight": 1,
137
- "tier": "standard"
135
+ "quotaWeight": 1
138
136
  },
139
137
  {
140
138
  "api": "openai-completions",
@@ -143,8 +141,7 @@
143
141
  "id": "sibling-id",
144
142
  "name": "sibling",
145
143
  "provider": "openai",
146
- "quotaWeight": 1,
147
- "tier": "standard"
144
+ "quotaWeight": 1
148
145
  }
149
146
  ],
150
147
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "keep-id",
41
41
  "name": "keep",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {
@@ -40,8 +40,7 @@
40
40
  "id": "keep-id",
41
41
  "name": "keep",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {
@@ -63,8 +63,7 @@
63
63
  "id": "keep-id",
64
64
  "name": "keep",
65
65
  "provider": "openai",
66
- "quotaWeight": 1,
67
- "tier": "standard"
66
+ "quotaWeight": 1
68
67
  }
69
68
  ],
70
69
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "keep-id",
41
41
  "name": "keep",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {
@@ -43,8 +43,7 @@
43
43
  "id": "claude-x",
44
44
  "name": "claude-1m",
45
45
  "provider": "anthropic",
46
- "quotaWeight": 1,
47
- "tier": "standard"
46
+ "quotaWeight": 1
48
47
  },
49
48
  {
50
49
  "api": "openai-completions",
@@ -53,8 +52,7 @@
53
52
  "id": "plain-id",
54
53
  "name": "plain",
55
54
  "provider": "openai",
56
- "quotaWeight": 1,
57
- "tier": "standard"
55
+ "quotaWeight": 1
58
56
  }
59
57
  ],
60
58
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "gw-id",
41
41
  "name": "gw",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "keep-id",
41
41
  "name": "keep",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {
@@ -40,8 +40,7 @@
40
40
  "id": "keep-id",
41
41
  "name": "keep",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {
@@ -40,8 +40,7 @@
40
40
  "id": "m1-id",
41
41
  "name": "m1",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "keep-id",
41
41
  "name": "keep",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {
@@ -44,8 +44,7 @@
44
44
  "id": "m0-id",
45
45
  "name": "m0",
46
46
  "provider": "openai",
47
- "quotaWeight": 1,
48
- "tier": "standard"
47
+ "quotaWeight": 1
49
48
  }
50
49
  ],
51
50
  "roles": {},
@@ -99,8 +98,7 @@
99
98
  "id": "m0-id",
100
99
  "name": "m0",
101
100
  "provider": "openai",
102
- "quotaWeight": 1,
103
- "tier": "standard"
101
+ "quotaWeight": 1
104
102
  }
105
103
  ],
106
104
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "ascii-ok-id",
41
41
  "name": "ascii-ok",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  }
46
45
  ],
47
46
  "roles": {},
@@ -53,8 +53,7 @@
53
53
  "id": "ok-name-id",
54
54
  "name": "ok-name",
55
55
  "provider": "openai",
56
- "quotaWeight": 1,
57
- "tier": "standard"
56
+ "quotaWeight": 1
58
57
  }
59
58
  ],
60
59
  "roles": {},
@@ -40,8 +40,7 @@
40
40
  "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-id",
41
41
  "name": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
42
42
  "provider": "openai",
43
- "quotaWeight": 1,
44
- "tier": "standard"
43
+ "quotaWeight": 1
45
44
  },
46
45
  {
47
46
  "api": "openai-completions",
@@ -50,8 +49,7 @@
50
49
  "id": "prefix-shared-name-aaaa-id",
51
50
  "name": "prefix-shared-name-aaaa",
52
51
  "provider": "openai",
53
- "quotaWeight": 1,
54
- "tier": "standard"
52
+ "quotaWeight": 1
55
53
  },
56
54
  {
57
55
  "api": "openai-completions",
@@ -60,8 +58,7 @@
60
58
  "id": "prefix-shared-name-aaab-id",
61
59
  "name": "prefix-shared-name-aaab",
62
60
  "provider": "openai",
63
- "quotaWeight": 1,
64
- "tier": "standard"
61
+ "quotaWeight": 1
65
62
  }
66
63
  ],
67
64
  "roles": {},
@@ -111,8 +108,7 @@
111
108
  "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-id",
112
109
  "name": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
113
110
  "provider": "openai",
114
- "quotaWeight": 1,
115
- "tier": "standard"
111
+ "quotaWeight": 1
116
112
  },
117
113
  {
118
114
  "api": "openai-completions",
@@ -121,8 +117,7 @@
121
117
  "id": "prefix-shared-name-aaaa-id",
122
118
  "name": "prefix-shared-name-aaaa",
123
119
  "provider": "openai",
124
- "quotaWeight": 1,
125
- "tier": "standard"
120
+ "quotaWeight": 1
126
121
  },
127
122
  {
128
123
  "api": "openai-completions",
@@ -131,8 +126,7 @@
131
126
  "id": "prefix-shared-name-aaab-id",
132
127
  "name": "prefix-shared-name-aaab",
133
128
  "provider": "openai",
134
- "quotaWeight": 1,
135
- "tier": "standard"
129
+ "quotaWeight": 1
136
130
  }
137
131
  ],
138
132
  "roles": {},
@@ -48,8 +48,7 @@
48
48
  "id": "m0-id",
49
49
  "name": "m0",
50
50
  "provider": "openai",
51
- "quotaWeight": 1,
52
- "tier": "standard"
51
+ "quotaWeight": 1
53
52
  }
54
53
  ],
55
54
  "roles": {},
@@ -85,8 +85,7 @@
85
85
  "id": "m0-id",
86
86
  "name": "m0",
87
87
  "provider": "openai",
88
- "quotaWeight": 1,
89
- "tier": "standard"
88
+ "quotaWeight": 1
90
89
  }
91
90
  ],
92
91
  "roles": {},
package/dist/types.d.ts CHANGED
@@ -197,7 +197,7 @@ export declare const ModelEntry: z.ZodObject<{
197
197
  alg: z.ZodLiteral<"libsodium-sealedbox-x25519">;
198
198
  setAt: z.ZodOptional<z.ZodString>;
199
199
  }, z.core.$strip>>;
200
- tier: z.ZodDefault<z.ZodEnum<{
200
+ tier: z.ZodOptional<z.ZodEnum<{
201
201
  cheap: "cheap";
202
202
  standard: "standard";
203
203
  premium: "premium";
@@ -330,7 +330,7 @@ export declare const ModelsConfig: z.ZodObject<{
330
330
  alg: z.ZodLiteral<"libsodium-sealedbox-x25519">;
331
331
  setAt: z.ZodOptional<z.ZodString>;
332
332
  }, z.core.$strip>>;
333
- tier: z.ZodDefault<z.ZodEnum<{
333
+ tier: z.ZodOptional<z.ZodEnum<{
334
334
  cheap: "cheap";
335
335
  standard: "standard";
336
336
  premium: "premium";
@@ -2704,7 +2704,7 @@ export declare const DOMAIN_SCHEMAS: {
2704
2704
  alg: z.ZodLiteral<"libsodium-sealedbox-x25519">;
2705
2705
  setAt: z.ZodOptional<z.ZodString>;
2706
2706
  }, z.core.$strip>>;
2707
- tier: z.ZodDefault<z.ZodEnum<{
2707
+ tier: z.ZodOptional<z.ZodEnum<{
2708
2708
  cheap: "cheap";
2709
2709
  standard: "standard";
2710
2710
  premium: "premium";
package/dist/types.js CHANGED
@@ -492,8 +492,12 @@ export const ModelEntry = z.object({
492
492
  * **二选一**(11.0.0):一个模型的钥匙只有一种写法 —— `sealedApiKey` 与 `apiKeyEnv` 同设 ⇒ 本条目被拒(读写同一只判据,见本
493
493
  * schema 的 superRefine)。切换写法的写者负责清掉另一字段;还带着双设的存量条目读侧逐条丢(`entry-dropped`)、写侧拒。ABSENT = 未托管(纯 env-NAME 现状)。 */
494
494
  sealedApiKey: SealedApiKey.optional(),
495
- /** Price/capability tier — fuels core 1.25 `selectModel({ tier })` role resolution. */
496
- tier: ModelTier.default("standard"),
495
+ /** Price/capability tier — fuels core 1.25 `selectModel({ tier })` role resolution. ABSENT = not declared: this package never fills it in
496
+ * (the parse result has no `tier` key, and no write leg puts one on disk). The engine's selector reads the declaration strictly — a
497
+ * `{ select: { tier } }` query matches only entries that declare that same word, so an undeclared entry is in no named tier, and a query
498
+ * that names no tier does not filter on it. A deployment that relies on an entry being picked by `{ select: { tier: "standard" } }`
499
+ * writes `tier: "standard"` on it (or binds the role by name). A word outside the closed set ({@link ModelTier}) refuses the entry. */
500
+ tier: ModelTier.optional(),
497
501
  /** Capability bits are THREE-STATE: `true` = declared capable, `false` = declared not capable, ABSENT =
498
502
  * not declared — the reader applies its own default (the engine reads it through one predicate). This package never fills an
499
503
  * absent bit in: reading "not written" as "not capable" is a default only a reader may choose. */
package/llms-full.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  <!--
2
2
  llms-full.txt — 自包含全文 · 消费方(使用者)视角 · @sema-agent/settings-schema
3
- 重写日期: 2026-11-29 | 包版本: 36.0.0
3
+ 重写日期: 2026-11-29 | 包版本: 37.0.0
4
4
  生成方式: 无生成脚本——按当前树 src/*.ts 导出面 + package.json + README/CHANGELOG 手写事实版。
5
5
  证据约定: 每条"它怎么工作"的断言附 (文件: 符号) 坐标,刻意不用行号(行号逐版腐烂;符号名由
6
6
  typecheck 与 test/package-surface.test.ts、test/docs-hygiene.test.ts 等常驻门钉住)。无证据推断显式标【推断】。
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  <!--
2
2
  llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
3
- 重写日期: 2026-11-28 | 包版本: 36.0.0
3
+ 重写日期: 2026-11-28 | 包版本: 37.0.0
4
4
  生成方式: 无生成脚本——按当前树的 src/*.ts 导出面 + package.json + README/CHANGELOG 手写事实版;
5
5
  每条断言附证据坐标(文件:符号),刻意不用行号(行号随每版腐烂,符号名由 typecheck/test 钉住)。
6
6
  刷新触发: package.json 版号变更(test/docs-hygiene.test.ts D 组钉「包版本:」与 package.json 相等、
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/settings-schema",
3
- "version": "36.0.0",
3
+ "version": "37.0.0",
4
4
  "description": "Sema settings schema — pure config contract (zod domains + effective-config + roster resolution + ref-integrity + remoteExec) shared by sema-web-admin, sema-server, and the TOC desktop/CLI. One source of truth. (Renamed at 1.0.0 from @sema-agent/registry-core — name and docs only, no behavior change; note the range moves 0.19.0 -> 1.0.0, so a dependency must become ^1.0.0. The old names @sema-agent/registry-core <=0.19.0 and @sema-ai/registry-core remain published, frozen, for migration.)",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",