@sema-agent/settings-schema 26.1.0 → 27.1.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.
- package/CHANGELOG.md +204 -0
- package/README.md +21 -2
- package/conformance/VERSION +1 -1
- package/dist/fleet.d.ts +19 -7
- package/dist/fleet.js +18 -6
- package/dist/retired-envs.js +4 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.js +14 -0
- package/docs/CONSUMER-INTEGRATION.md +44 -1
- package/llms-full.txt +6 -2
- package/llms.txt +5 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,210 @@
|
|
|
8
8
|
|
|
9
9
|
## Unreleased
|
|
10
10
|
|
|
11
|
+
## 27.1.0 — 2026-11-11 — minor:模型面组拒码闭集 `MODEL_PLANE_REFUSAL_CODES` 尾插一只泛词 `config.model_catalog_refused`(服务端采纳候选模型目录之前交引擎的目录门过了一遍、引擎拒了)
|
|
12
|
+
|
|
13
|
+
> 档位(按发版纪律):**minor** —— 发版纪律「词表加词 = minor」:公开闭集 `MODEL_PLANE_REFUSAL_CODES` **尾插**一词(已发五词的次序不动),无导出新增、无导出删除、无校验变化;读数变化只有一处:`readModelRefusals` 对 `plane` 是新词 `config.model_catalog_refused` 的体,此前(≤ 27.0.0)把它当集外码收窄成缺席,自此读出来(集外词照旧丢)。
|
|
14
|
+
> 先例:14.8.0 —— 同一只闭集尾插两码(`config.catalog_replaces_env_models` 与已退役的那一码)、同判 minor,档位句把「对组拒码穷举的读者提货时编译红」写作提货成本、不是 major。
|
|
15
|
+
> 持 `Record<ModelPlaneRefusalCode, …>` / 带 `never` 兜底的穷举 `switch` 的消费方提货本版编译红一次(补一臂 / 一行)—— 提货成本,不是 major(发版纪律「新键 / 新导出 / 词表加词 = minor」那一条的原话口径)。
|
|
16
|
+
|
|
17
|
+
### 病
|
|
18
|
+
|
|
19
|
+
服务端要在**采纳一份候选模型目录之前**,把它交给引擎的目录门过一遍:引擎拒了,这份候选就不落地,在服的一代照服务。这件事需要一只稳定的机读词,让运维与控制台在 `GET /health` / 心跳的 `modelRefusals.plane` 上读到「为什么这份目录没落地」。
|
|
20
|
+
闭集里没有这一档的词:`config.default_model_missing` 说的是**座位级**(候选里解不出缺省模型),拿它充数会把「目录里的链词不在目录」「条目缺必需成员」一律说成「没有缺省模型」;而为引擎目录门的每一条不变量各加一词,闭集就成了引擎判据的第二份抄本,引擎每多判一条,本包就得跟着发一版。
|
|
21
|
+
|
|
22
|
+
### 律(一条)
|
|
23
|
+
|
|
24
|
+
**一个事实一只判官**:目录能不能过引擎的门,只有**引擎的目录门**判。本包与服务端都不判、不复述它的判据 —— 这只词只说「引擎拒了」,拒的细节是引擎自己的码与句,由服务端原样带出,不在这个词里(`modelRefusals` 的 wire 形只有「名 → 码」,本来也装不下句子)。所以它是**一只泛词**:不随引擎的目录门将来多判什么而加词。
|
|
25
|
+
|
|
26
|
+
### 词
|
|
27
|
+
|
|
28
|
+
`src/fleet.ts` 的闭集 `MODEL_PLANE_REFUSAL_CODES` 尾上多一词,六词同序:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
config.default_model_missing
|
|
32
|
+
config.model_refused_name_minted
|
|
33
|
+
config.model_route_endpoint_missing
|
|
34
|
+
config.gateway_fallback_without_primary
|
|
35
|
+
config.catalog_replaces_env_models
|
|
36
|
+
config.model_catalog_refused ← 本版
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- **意思**:服务端在采纳一份候选模型目录之前交引擎的目录门过了一遍,引擎拒了(链上的词不在目录 / 指自己 / 重复 / 超跳数、条目缺必需成员 …)—— 这一组(模型面)被拒,在服的一代照服务;拒的细节 = 引擎自己的码与句,由服务端原样带出。
|
|
40
|
+
- **泛词**:判的是引擎、细节在引擎自己的码与句里,所以这只词不随引擎目录门将来多判什么而加词。
|
|
41
|
+
- **拼法**:照既有五词的命名律(`config.` 前缀 + 小写下划线;模型面的词以 `model_` 起头,目录相关的词带 `catalog`)。
|
|
42
|
+
- **与 `config.default_model_missing` 的分界**(逐词注里同写):后者 = 候选里解不出缺省模型(**座位级**);本词 = 目录本身过不了引擎的门(**目录级**)。一个候选恰一个组拒判决,铸哪个词是铸码一方的事,本包不排序。
|
|
43
|
+
- **谁铸**:铸码一方是服务端(本包只定名与含义,不验证服务端是否已铸;按本包钉的引擎版本读它不在引擎的组拒码表里,本包不验证引擎行为 —— 闭集头注因此把「前四词镜像引擎的组拒码表、后两词由本包定名」写成两段)。不另设常量:一个词一个来源,就是闭集数组里那一个字面量。
|
|
44
|
+
- **不改的**:`ModelRefusalsWire`(码仍是开放串)、`InstanceAnnouncement.modelRefusals` 的降级律(形坏降缺席、集外码照过)、`readModelRefusals` 的收窄律(集外码丢、丢到空 ⇒ `undefined`)—— 本版只是闭集多认一词。
|
|
45
|
+
|
|
46
|
+
### 导出面
|
|
47
|
+
|
|
48
|
+
- **新增 / 删除导出**:无。包根与 `./fleet` 的导出名集同 v27.0.0(`docs/API-SURFACE.md` 零 diff)。
|
|
49
|
+
- **类型面**:`ModelPlaneRefusalCode` 的联合多一个成员,`ModelRefusalsSignal["plane"]` 随之(穷举消费方编译红一次,见三问)。
|
|
50
|
+
- **运行期读数变**:`MODEL_PLANE_REFUSAL_CODES` / `ModelPlaneRefusalCode.options` 多一词;`readModelRefusals` 对 `plane` 是该词的体由「没说」变读出。其余导出的答案逐位不变;符合性语料零 diff(`conformance/VERSION` 抬到本版,语料内容不动)。
|
|
51
|
+
|
|
52
|
+
### 三问
|
|
53
|
+
|
|
54
|
+
- **谁需要**:服务端 —— 要在采纳前拦住一份引擎会拒的目录,并给运维 / 控制台一只稳定的机读词(而不是挪用座位级的 `config.default_model_missing`,也不是把引擎的句子塞进诊断键);读 `/health.modelRefusals` 渲染「为什么目录没落地」的管理面 / 三端。
|
|
55
|
+
- **谁受伤**:对这只闭集做穷举(`Record<ModelPlaneRefusalCode, …>` / 带 `never` 兜底的 `switch`)的消费方 —— 提货本版编译红一次,补一臂 / 一行。没提货本版的读方照旧把新词读成「没说」(诊断键的失败方向:版本错位不会拖垮心跳,存行照存 wire 形,升级后同一行读出新词)。
|
|
56
|
+
- **补偿**:不适用(加性,没有人的既有读数变坏)。读方提货前不渲染这一档拒因,升级包版本即得。
|
|
57
|
+
|
|
58
|
+
### 各消费方
|
|
59
|
+
|
|
60
|
+
| 消费方 | 读点 | 动作 |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| server | 采纳候选模型目录之前交引擎目录门 · 铸组拒码 | 请托的读法:铸码一方是服务端,拟自 7.153.0 起铸这只码(服务端的排期,本包不验证);拒的细节(引擎自己的码与句)原样带出;不在服务端再判一遍引擎的门 |
|
|
63
|
+
| web-admin | 渲染模型面拒因的表(按码穷举) | 表多一行 `config.model_catalog_refused`;`config.default_model_missing` 那行不动,两行别混(座位级 / 目录级) |
|
|
64
|
+
| cli | 按码分流的地方(若有) | 多一词;未知词的既有兜底读法不变(读口丢集外码 = 没说) |
|
|
65
|
+
| client-core | 按码分流的地方(若有) | 同上;没有这样的读点则零改动 |
|
|
66
|
+
| sdk | 契约套件 | 零代码改动;语料不变 |
|
|
67
|
+
| test | 黑盒判据 | 见下「黑盒判据」 |
|
|
68
|
+
|
|
69
|
+
### 黑盒判据(从包的导出面可执行,不引用内部实现)
|
|
70
|
+
|
|
71
|
+
- **G1 闭集**:`MODEL_PLANE_REFUSAL_CODES` 恰是六词,前五词与 v27.0.0 逐字同序,第六词(尾)是 `"config.model_catalog_refused"`;`ModelPlaneRefusalCode.options` 与它同序同词;`ModelPlaneRefusalCode.safeParse("config.model_catalog_refused").success` 为真。
|
|
72
|
+
- **G2 读口**:`readModelRefusals({ modelRefusals: { entries: {}, plane: "config.model_catalog_refused" } })` 等于 `{ entries: {}, plane: "config.model_catalog_refused" }`(此前为 `undefined`);同一个词放在 `entries` 的值上 ⇒ 那一条被丢;别的集外 plane 词(含该词的前缀 / 大写形)⇒ 照旧 `undefined`;`InstanceAnnouncement.parse` 带这个 `plane` 的公告成功,且 `readModelRefusals(公告)` 与读 `/health` 体同答。
|
|
73
|
+
- **G3 导出面零增删**:包根与 `./fleet` 的导出名集同 v27.0.0;不存在为该词另设的常量。
|
|
74
|
+
- **G4 文书同在**:随包的 `README.md` · `docs/CONSUMER-INTEGRATION.md` · `llms.txt` · `llms-full.txt` 里凡列这只闭集的每一处都含该词(计数写六、新词在尾);`src/fleet.ts` 的闭集逐词注写明它与 `config.default_model_missing` 的分界(座位级 / 目录级)与「判的是引擎」。
|
|
75
|
+
|
|
76
|
+
### 钉
|
|
77
|
+
|
|
78
|
+
`test/model-catalog-refused-27.1.0.test.ts`(闭集逐词同序、恰多一词、序在尾,期望字面是抄来的、不从实现派生;`z.enum` 同序同词;词形守命名律、不重复、与条目拒因码闭集不相交;不另设常量、包根与 `./fleet` 同一只数组;类型联合恰六词 ·
|
|
79
|
+
读口:新词作 `plane` 读得出(只有 `plane` / 带条目拒因两种体)、心跳公告与 `/health` 体同答、新词放在 `entries` 的值上仍是集外、别的集外词(含前缀 / 大写形)照旧丢 ·
|
|
80
|
+
穷举消费两头:运行期 —— 以闭集型为键的 `Record` 键集恰 = 闭集、带 `never` 兜底的 `switch` 每词有臂;编译期 —— 把真源 `src/fleet.ts` 变异一刀(尾上多一词 / 删掉新词)再重编这只文件,诊断点名那个词,外加未变异对照零诊断 ·
|
|
81
|
+
文书逐处:`src/fleet.ts` 逐词注(新词、座位级 / 目录级分界、判官是引擎、泛词)、README 码表与「新面」一条、消费接入档「模型拒因」一条与 §27 与档头索引、`llms.txt` 计数、`llms-full.txt` 清单 · 版本文件四处同版 · 本节节头 / 档位句 / 各节 / 三问 / 各消费方表 / 黑盒判据 G1–G4 / 受影响导出表在场 / 无占位符 · 随包文字不带流程编号 · 已发节(27.0.0 及以下)与 tag `v27.0.0` 上逐字节相同)。
|
|
82
|
+
随表改的既有钉:`model-refusals-6.2.0`(六词与联合型)· `summarize-code-retired-16.0.0`(五词前缀不动)· `env-model-table-plan-14.8.0`(顶替确认那一词在第五位、尾是新词)· `major-27.0.0-docs`(「`## Unreleased` 为空」改读到下一个版本节为止)· `docs-hygiene`(消费接入档点名的服务端版本 7.153.0 进外部版本白名单)。
|
|
83
|
+
红先:只放这份新钉、源码还是 v27.0.0 的读数时,24 格红;其余 4 格对 v27.0.0 的源码本来就成立、同绿(词形命名律、不另设常量、类型联合〔只在类型检查期咬〕、已发节字节)。
|
|
84
|
+
变异(每刀都红):闭集去掉新词 · 新词挪到首位 · 尾上多一个别的词 · 新词拼错一个字母 · 读口收窄只认前五词 · 另设一只常量导出 · 逐词注去掉分界 · 逐词注去掉「判官是引擎」· README 码表漏新词 · README「新面」仍写尾 · README 升级指引不指 §27 · 消费接入档拒因条目仍写五码 · §27 少一行消费方 · 档头索引不指 §27 · `llms.txt` 计数仍写 5 · `llms-full.txt` 清单漏新词 · `llms.txt` 删本版行 · 节头档位词改 major · 档位句不点名先例 · 受影响导出表漏 `readModelRefusals` · 已发 27.0.0 节被改一个字 · 三问删一格 · 消费方表删一行 · `conformance/VERSION` / `package-lock.json` / `llms-full.txt` 版本行各退回 27.0.0 · 新词注混入票号 · 升级指引混入裁定号 · 「钉」一节留着占位符。
|
|
85
|
+
|
|
86
|
+
**自 v27.0.0 起运行期代码有改动的公开导出(机器重算;上界 —— 可达 ≠ 一定变,不可达 ⇒ 一定不变;本版新增的导出不入表)**
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
MODEL_PLANE_REFUSAL_CODES [., ./fleet]
|
|
90
|
+
ModelPlaneRefusalCode [., ./fleet]
|
|
91
|
+
readModelRefusals [., ./fleet]
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 27.0.0 — 2026-11-11 — major:目录条目 `ModelEntry.fallbacks`(引擎每模型回落链的声明位;**只判形**,坏形整条拒)· 墓碑表加 `MODEL_DEGRADE_ON`(`replaced` → `MODEL_FALLBACK_ON`)与 `MODEL_DEGRADE_REACTIVE`(`removed`):设了即拒启
|
|
95
|
+
|
|
96
|
+
> 档位(按发版纪律):**major** —— 校验收紧、同一份文档 / 同一份部署配置解析出不同结果,下面两条各有读数:
|
|
97
|
+
> ① **`fallbacks` 的坏形整条拒**:目录条目上的 `fallbacks` 此前是契约外的键 —— 文档面(`validateDomain` / `writeDomainFile` / `getDomain` / `parseDomain`)**剥键后受理**(`fallbacks: "x"` 这类坏形的条目照收、键被剥),视图面(`buildEffective` / `readEffectiveWire` / `loadLocalConfig` / `FileConfigStore.getEffective`)把带这个键的条目**一律整条丢**(`entry-dropped`,`reasonCode: "entry-unknown-key"`,不论值合不合形);自此坏形的条目在文档面整份拒、在视图面仍丢但丢弃词改为 `entry-schema-invalid`,合形的在两面都装上。
|
|
98
|
+
> ② **两行墓碑**:部署 env 里留着 `MODEL_DEGRADE_ON` / `MODEL_DEGRADE_REACTIVE`(任何显式值)由起服变拒启(墓碑表只增不减,每加一行都是校验收紧)。
|
|
99
|
+
> 新可选键本身是 minor(发版纪律「新键 = minor」);本版判 major 的依据是上面两条读数变化,不是新键本身。无导出删除、无导出新增(`ModelEntry` 的推断型多一个可选成员,`RETIRED_ENVS` 多两行数据)。
|
|
100
|
+
|
|
101
|
+
### 病
|
|
102
|
+
|
|
103
|
+
引擎的目录条目有了每模型回落链(`RunnerDeps.models.<名>.fallbacks`),整只 Brain 的「一个 env 开关 + 一个全局目标」式反应式降级壳随之退场。`ModelEntry` 没有这一席:部署在目录条目上写 `fallbacks`,视图面把它当未知键整条丢(模型不见了),文档面悄悄剥掉(写了没到);墓碑表也没有旧壳那两只 env 的行,留着它们的部署升级后被悄悄忽略 —— 运维以为壳还在生效。
|
|
104
|
+
|
|
105
|
+
### 律(一条)
|
|
106
|
+
|
|
107
|
+
**一个事实一只判官**:`fallbacks` 里的词在不在目录、指不指自己、重不重复、链有几跳 —— 这些只有**引擎的目录门**判(引擎自 7.67.0 起在收取目录时判:链词在展开档位之后的目录上解、链是平的、词不在目录 / 指自己 / 重复 / 超跳数一律拒,拒句点名 `RunnerDeps.models.<名>.fallbacks`;本包只承载声明,不验证引擎行为)。本包只判「是不是非空串数组」这一件事(形),不判有效性:再判一遍就是第二只判官,两边迟早对同一条链各说各话。
|
|
108
|
+
|
|
109
|
+
### BREAKING ① `ModelEntry.fallbacks?: string[]`
|
|
110
|
+
|
|
111
|
+
- **席位**:`z.array(z.string().min(1)).optional()`,放在 `thinkingLevelMap` 之后。三态同 `reasoning` / `vision`:**缺席** = 未声明(本包不铸键);**`[]`** = 声明了、没有链(引擎读作「无链」);**非空数组** = 按跳序的链,逐字交出(本包不排序、不去重、不截断)。
|
|
112
|
+
- **坏形整条拒、不剥键、不折默认**(与同族先例 `thinkingLevelMap` 同一条律,不另立):非数组(串 / 数 / 布尔 / 对象)· `null` · 元素不是非空串(数 / `null` / 空串 / 数组 / 对象)⇒ 这一条目不过。严写面(写入席、`parseDomainLoud`、`validateDomain` / `writeDomainFile`、`getDomain` / 导出)整份拒;读腿逐条丢并报 `entry-dropped`(`reasonCode: "entry-schema-invalid"`),兄弟条目照装;它被 `roles` / `atMention.only` / `tierGroups` 引用、或是唯一一条时走既有的级联 / 零幸存者律(整个 `models` 域 `domain-defaulted`,只发这一种告警)—— 与任何别的坏目录条目同答,本版不改那条律。
|
|
113
|
+
- **不判有效性**:目录里没有的词 · 指自己 · 重复 · 超过引擎允许的跳数 ⇒ 本包**照收、原样交出**;跨域引用判官(`refIntegrityIssues`)不把 `fallbacks` 当引用。词可以是档位词 / 别名(在引擎的展开目录上解);链是**平**的,一跳自己的 `fallbacks` 不被走(这两句是引擎自 7.67.0 起的读法,本包不验证)。
|
|
114
|
+
- 不进 `PARSE_TRANSPARENT_KEYS`(本包对它的形有主张);不是 env 腿的键(env 腿没有按成员声明的位置,与 `thinkingLevelMap` 同)。
|
|
115
|
+
|
|
116
|
+
### BREAKING ② 墓碑表加两行
|
|
117
|
+
|
|
118
|
+
`RETIRED_ENVS` 表尾多两行(判据只问键在不在场:**任何显式值都拒,空串 = 未设**;拒启句由唯一铸点 `retiredEnvRefusal` 铸,带拒启码 `config.env_key_retired`、点名键与理由、**从不回显值**;目录 wire `retired[]` 与 worker 规格 `env` / `secretEnv` 写闸同表派生、零代码改动):
|
|
119
|
+
|
|
120
|
+
- `["MODEL_DEGRADE_ON", "MODEL_FALLBACK_ON", "replaced", <理由>]` —— 门词旋钮有现名、但**值语义变了**:`budget` 不再是门词;`network` / `auth` / `stream_torn` 是新词;作用面由「整只 Brain 的一个目标」变成「每条目录链」。拒句点名 `MODEL_FALLBACK_ON` 与「别照抄旧值」。
|
|
121
|
+
- `["MODEL_DEGRADE_REACTIVE", <理由>, "removed"]` —— 整只 Brain 的反应式降级壳删除,没有可 rename 的目标;出路写在理由里:在目录条目上声明 `fallbacks`,决定何时跳的门词是 `MODEL_FALLBACK_ON`。
|
|
122
|
+
- **门词的词表与语义归引擎的回落门与服务端对 `MODEL_FALLBACK_ON` 的拆词**,本包只登记墓碑与理由句:理由句里「`budget` 不再是门词、`network` / `auth` / `stream_torn` 是新词」是引擎回落门的现状读法(以提货该门的引擎版本的说明为准)。
|
|
123
|
+
- **不进表**:`MODEL_DEGRADE_TO` / `MODEL_DEGRADE_AT_COST_FRACTION` / `MODEL_DEGRADE_TO_VISION` 仍是活旋钮(近预算降级线);`MODEL_FALLBACK_ON` 是现名(链只有一跳,去向不能是另一个已退役的名字)。
|
|
124
|
+
- **进表的判据**(表头注那一条):没有带着本表的引擎还读这个名 —— 服务端停读这两个键与提货本版**同一发版**;更早的引擎内带更早的契约,看不见这两行。
|
|
125
|
+
|
|
126
|
+
### 导出面
|
|
127
|
+
|
|
128
|
+
- **新增 / 删除导出**:无。**运行期读数变**:`ModelEntry`(及含它的 `ModelsConfig` / `DOMAIN_SCHEMAS` 的 `models` 域)对带 `fallbacks` 的条目的读数 —— 见 BREAKING ①;`RETIRED_ENVS` 多两行、`buildRetiredEnvWire()` 的投影随表多两项、`retiredEnvRefusal` 对这两个名答拒句。
|
|
129
|
+
- **类型面**:`ModelEntry` 多可选成员 `fallbacks?: string[]`(加性;对 `ModelEntry` 的 `keyof` 写穷举表的消费方会编译红,补一列)。
|
|
130
|
+
|
|
131
|
+
### 三问
|
|
132
|
+
|
|
133
|
+
- **谁需要**:① 中心目录部署 —— 主模型限流 / 5xx 时落到便宜模型继续服务,链是目录数据而不是一个全局 env 目标;② 多账户部署 —— 回落跳在别的账户 / 网关,带自己的钥匙声明;③ 自托管部署 —— 首个 token 迟迟不来时换一只模型。没有这一席,这些链只能写在引擎的嵌入面上,经目录下发的部署声明不了。
|
|
134
|
+
- **谁受伤**:① env 里留着 `MODEL_DEGRADE_REACTIVE` / `MODEL_DEGRADE_ON`(任何显式值)的部署 —— 提货本版的服务端由「起服照旧、整只 Brain 降级」变成**拒启**,拒句点名键(这是预期:壳已删除,留着它们等于以为它还在生效);② 目录条目已经带着 `fallbacks` 的文档 —— 此前视图面把那条目整条丢(模型在消费方不可用),自此合形的**装上**(链随条目到达,消费方按自己的版本读它),写坏的仍丢(词改 `entry-schema-invalid`);③ 文档面写过坏形 `fallbacks` 的存量文档 —— 此前剥键受理,自此整份拒(`validateDomain` / `writeDomainFile` / `getDomain` / 导出),坏条目被 `roles` / `atMention.only` / `tierGroups` 引用或是唯一一条时,读腿整个 `models` 域退缺省;④ 对 `ModelEntry` 的 `keyof` 写穷举表的代码 —— 编译红(补一列)。
|
|
135
|
+
- **补偿**:① 删掉 env 里两个旧键;要保留「某模型失败落到另一只」的行为 ⇒ 在该模型的目录条目上写 `fallbacks`,门词设 `MODEL_FALLBACK_ON`(拒句已点名,别照抄旧值);② 升级前对存着的 `models` 文档(含存下来要续跑的、中心名册草稿)自查 `fallbacks`:每个值必须是非空串数组(或整个键删掉);③ 只想保留近预算降级的部署:`MODEL_DEGRADE_TO` / `MODEL_DEGRADE_AT_COST_FRACTION` / `MODEL_DEGRADE_TO_VISION` 不动。
|
|
136
|
+
|
|
137
|
+
### 给消费方的迁移句(BREAKING)
|
|
138
|
+
|
|
139
|
+
提货本版:① 把「留着 `MODEL_DEGRADE_ON` / `MODEL_DEGRADE_REACTIVE` 的部署」的升级指引写成「删这两个键 → 回落链写进目录条目 `fallbacks` → 门词用 `MODEL_FALLBACK_ON`」,不要写成「改个名字」(`MODEL_DEGRADE_ON` 是 `replaced`:值语义变了);② 自己停读这两个键与提货本版同一发版;③ 渲染 `retired[]` 的一方会多看到两行(一行带 `replacement` + `reason`,一行只带 `reason`);④ 目录编辑面要承运 `fallbacks`,只产合形(非空串数组),别把空串当「没有」写出去。
|
|
140
|
+
|
|
141
|
+
### 各消费方
|
|
142
|
+
|
|
143
|
+
| 消费方 | 读点 | 动作 |
|
|
144
|
+
|---|---|---|
|
|
145
|
+
| server | 起服墓碑拒启 · 目录条目的投影 · 引擎目录门(链词的唯一判官) | 同一发版停读两只旧键;墓碑拒启格由「预期红」翻成常规格;目录 wire `retired[]` 多两项;链的有效性(词在不在目录 / 自指 / 重复 / 跳数 / 停用)继续只由引擎目录门判,不在本包 |
|
|
146
|
+
| web-admin | 目录编辑面 · `retired[]` 渲染 | 可选:表单承运 `fallbacks`(只产非空串数组);`retired[]` 多两行照常渲染;写坏的条目自此会被拒 / 丢 |
|
|
147
|
+
| cli | 手列环境变量目录的旧键 | 删去这两个旧键;不读新席位也不受影响 |
|
|
148
|
+
| client-core / sdk | 无直接读点 | 零代码改动;契约语料不变(语料零 diff) |
|
|
149
|
+
| test | 黑盒判据 | 见下「黑盒判据」 |
|
|
150
|
+
|
|
151
|
+
### 黑盒判据(从包的导出面可执行,不引用内部实现)
|
|
152
|
+
|
|
153
|
+
- **G1 合形照收**:`ModelEntry.parse({ name: "a", id: "x", fallbacks: ["b"] }).fallbacks` 等于 `["b"]`;`fallbacks: []` 装上的仍是 `[]`;缺席时结果里没有 `fallbacks` 这个键。
|
|
154
|
+
- **G2 坏形整条拒**:`fallbacks` 取 `"b"` · `null` · `[1]` · `[""]` · `[["b"]]` 之一 ⇒ `ModelEntry.safeParse` 失败、问题坐标在 `fallbacks`;同一条目放进 `models` 文档:`validateDomain("models", …)` 不过;`buildEffective` / `readEffectiveWire` 丢它并报一条 `entry-dropped`(`reasonCode: "entry-schema-invalid"`),兄弟条目照装。
|
|
155
|
+
- **G3 不判有效性**:`fallbacks: ["no-such-model"]` · `["a"]`(指自己)· `["b", "b"]` · 四个以上的词 ⇒ 全部照收、原样交出,零告警。
|
|
156
|
+
- **G4 墓碑**:`retiredEnvRefusal({ MODEL_DEGRADE_ON: "rate_limit" })` 的句子含 `[config.env_key_retired]`、`MODEL_DEGRADE_ON`、`MODEL_FALLBACK_ON` 与「do not copy the old value across unread」,不含值 `rate_limit`;`retiredEnvRefusal({ MODEL_DEGRADE_REACTIVE: "true" })` 的句子含键名与 `declare \`fallbacks\` on the catalog entry`,不含值;空串 = 未设 ⇒ 返回 `undefined`;`MODEL_DEGRADE_TO` / `MODEL_FALLBACK_ON` 在场 ⇒ 返回 `undefined`。
|
|
157
|
+
- **G5 投影**:`buildRetiredEnvWire()` 恰多两项:`{ name: "MODEL_DEGRADE_ON", kind: "replaced", replacement: "MODEL_FALLBACK_ON", reason }` 与 `{ name: "MODEL_DEGRADE_REACTIVE", kind: "removed", reason }`(后者没有 `replacement` 键),按表序在尾。
|
|
158
|
+
|
|
159
|
+
### 钉
|
|
160
|
+
|
|
161
|
+
`test/model-fallbacks-27.0.0.test.ts`(合形 / 三态 / 坏形整条拒 / 不判有效性 / 不铸键 / 内容哈希区分 `[]` 与缺席与链序 / 每条读写口:正控、坏形逐条丢并带词 `entry-schema-invalid`、零幸存者与引用级联与「缺 id」同答、写腿不落盘)·
|
|
162
|
+
`test/retired-env-model-degrade-27.0.0.test.ts`(两行逐字 / 表尾次序 / 链一跳 / 活旋钮不进表 / 拒句逐字且不回显值 / 两名同在场的族序 / 空串 = 未设 / `retired[]` 两种形 / worker 规格写闸)·
|
|
163
|
+
既有行数与行集钉(`retired-envs-11.0.0` / `retired-envs-previous-generation-11.2.0`)各加两行。
|
|
164
|
+
红先:在 26.1.0 的源上跑这两个文件,33 个红(`fallbacks` 23 / 墓碑 10)、7 个守住格同绿。
|
|
165
|
+
变异(每刀都红):去掉席位 · 元素放宽成 `z.string()` · 去掉 `.optional()` · 加 `.nonempty()` · 加 `.max(3)` · 去重 transform · `.default([])` · `.nullable()` · 坏形折成缺席 · 目录里判词在不在 · 判指自己;表里删任一行 · REACTIVE 改成 `replaced` · 两行换序 · 理由句去掉 `network` · 理由句去掉出路 · 多一行 `MODEL_DEGRADE_TO` · 多一行 `MODEL_FALLBACK_ON` · 空串当在场。
|
|
166
|
+
|
|
167
|
+
**自 v26.1.0 起运行期代码有改动的公开导出(机器重算;上界 —— 可达 ≠ 一定变,不可达 ⇒ 一定不变;本版新增的导出不入表)**
|
|
168
|
+
|
|
169
|
+
```text
|
|
170
|
+
DOMAINS [., ./types]
|
|
171
|
+
DOMAIN_SCHEMAS [., ./types]
|
|
172
|
+
FileConfigStore [./node]
|
|
173
|
+
ModelEntry [., ./types]
|
|
174
|
+
ModelsConfig [., ./types]
|
|
175
|
+
NON_PORTABLE_DOMAINS [./conformance]
|
|
176
|
+
RETIRED_ENVS [.]
|
|
177
|
+
WorkerSpec [., ./types]
|
|
178
|
+
WorkersConfig [., ./types]
|
|
179
|
+
buildEffective [., ./config-fns]
|
|
180
|
+
buildRetiredEnvWire [.]
|
|
181
|
+
changedWriteFields [., ./config-fns]
|
|
182
|
+
deriveLocalExpectation [./conformance]
|
|
183
|
+
deriveWireExpectation [./conformance]
|
|
184
|
+
domainFilePath [./node]
|
|
185
|
+
emptyEffective [., ./config-fns]
|
|
186
|
+
foreignKeysOf [./conformance]
|
|
187
|
+
isDomainName [., ./types]
|
|
188
|
+
loadLocalConfig [./node]
|
|
189
|
+
loadRemoteExec [./node]
|
|
190
|
+
migrateConfigDirectory [./node]
|
|
191
|
+
migrateConfigDocuments [./node]
|
|
192
|
+
migrateEffectiveSnapshot [./one-time-migrations]
|
|
193
|
+
migrateEnvModelsDecision [./node]
|
|
194
|
+
migrateStoredDocuments [./one-time-migrations]
|
|
195
|
+
parseDomain [., ./config-fns]
|
|
196
|
+
parseDomainLoud [., ./config-fns]
|
|
197
|
+
parseDomainSalvaged [., ./config-fns]
|
|
198
|
+
planEnvModelTableWrite [.]
|
|
199
|
+
readBundle [./node]
|
|
200
|
+
readConfigDFileReadingSync [./node]
|
|
201
|
+
readEffectiveWire [., ./config-fns]
|
|
202
|
+
readWorkersRows [.]
|
|
203
|
+
remoteExecPath [./node]
|
|
204
|
+
resolveLegExpectation [./conformance]
|
|
205
|
+
retiredEnvRefusal [.]
|
|
206
|
+
runConformance [./conformance]
|
|
207
|
+
salvageEntries [., ./config-fns]
|
|
208
|
+
validateDomain [./node]
|
|
209
|
+
writeBundle [./node]
|
|
210
|
+
writeDomainFile [./node]
|
|
211
|
+
writeRemoteExec [./node]
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
|
|
11
215
|
## 26.1.0 — 2026-11-11 — minor:引擎属主钩子事件的**逐员起始契约版本**成了导出的数据(`ENGINE_OWNED_HOOK_EVENT_SINCE`)· 一只读者 `engineOwnsHookEventAt(event, contractVersion)`
|
|
12
216
|
|
|
13
217
|
> 档位(按发版纪律):**minor** —— 只加导出(包根与 `./hooks` 子路径各三名:两个值、一个型);无导出删除、无闭集缩小、无校验变化、无读数变化:`ENGINE_OWNED_HOOK_EVENTS` 的元组型与成员顺序(已发的型面)、`HOOK_EVENT_OWNER` 的读数、`HooksConfig` / `classifyHooksConfig` 对任何设置文档的读数都逐字不变。
|
package/README.md
CHANGED
|
@@ -47,6 +47,24 @@ therefore shows only `zod`. Node built-ins only (`node:crypto`, `node:fs`).
|
|
|
47
47
|
> zod 3, nested inside every zod-4 host). The move to zod 4 did not change what any schema accepts or produces —
|
|
48
48
|
> the conformance corpus reads byte-identically on both — only the wording of validation errors (see CHANGELOG 11.0.0).
|
|
49
49
|
|
|
50
|
+
## 升级指引:27.0.x → 27.1.0(minor,加性:模型面组拒码闭集 `MODEL_PLANE_REFUSAL_CODES` 尾插一只泛词 `config.model_catalog_refused`)
|
|
51
|
+
|
|
52
|
+
只在闭集尾上多一词,零校验变化、不加不删导出名 —— 不读这只闭集的消费方零动作可升(读数详情、三问、各消费方表见 CHANGELOG 27.1.0 与 `docs/CONSUMER-INTEGRATION.md` §27)。
|
|
53
|
+
1. **词的意思**:服务端在**采纳一份候选模型目录之前**把它交给引擎的目录门过了一遍,引擎拒了 —— 这一组(模型面)被拒、在服的一代照服务。**判的是引擎,本包与服务端都不判**;拒的细节是引擎自己的码与句,不在这个词里。它是一只**泛词**:不随引擎目录门将来多判什么而加词。
|
|
54
|
+
与 `config.default_model_missing` 的分界:后者 = 候选里解不出缺省模型(座位级);本词 = 目录本身过不了引擎的门(目录级)。
|
|
55
|
+
2. **读数变化(只有一处)**:`readModelRefusals` 对 `plane` 是这只新词的体,此前(≤ 27.0.0)把它当集外码收窄成缺席,自此读出来。集外词照旧丢。
|
|
56
|
+
3. **动作**:对 `ModelPlaneRefusalCode` / `MODEL_PLANE_REFUSAL_CODES` 写穷举(`Record<ModelPlaneRefusalCode, …>` / 带 `never` 兜底的 `switch`)的地方**编译红一次**(提货成本,不是 major):补一臂 / 一行。没升级本包的读方仍把新词读成「没说」(版本错位不会拖垮心跳)。
|
|
57
|
+
|
|
58
|
+
## 升级指引:26.1.x → 27.0.0(BREAKING:目录条目 `fallbacks` 的坏形整条拒 · 墓碑表加 `MODEL_DEGRADE_ON`(`replaced`)与 `MODEL_DEGRADE_REACTIVE`(`removed`))
|
|
59
|
+
|
|
60
|
+
两处**不加性**的边(读数逐条、三问、各消费方改法见 CHANGELOG 27.0.0 与 `docs/CONSUMER-INTEGRATION.md` §26):
|
|
61
|
+
1. **目录条目多一个可选席 `fallbacks?: string[]`**(引擎每模型回落链的声明位,按跳序):缺席 = 未声明(本包不铸键),`[]` = 声明了、没有链;**本包只判形**(非空串数组),词在不在目录 · 指自己 · 重复 · 超几跳一概不判 —— 唯一的判官是引擎的目录门。
|
|
62
|
+
- **读数变化(不加性)**:此前目录条目上的 `fallbacks` 是契约外的键 —— 视图面(`buildEffective` / `readEffectiveWire` / `loadLocalConfig` / `FileConfigStore.getEffective`)把带它的条目一律整条丢(`entry-unknown-key`),文档面(`validateDomain` / `writeDomainFile` / `getDomain` / `parseDomain`)剥键受理;自此合形的装上,
|
|
63
|
+
**坏形(非数组 · `null` · 元素不是非空串)的条目整条被拒** —— 文档面整份拒,读口逐条丢并报 `entry-dropped`(`reasonCode: "entry-schema-invalid"`;被 `roles` / `atMention.only` / `tierGroups` 引用或是唯一一条时走既有的级联 / 零幸存者律,整个 `models` 域 `domain-defaulted`)。没写这个键的条目零变化。
|
|
64
|
+
- **动作**:升级前对存着的 `models` 文档(含存下来要续跑的、中心名册草稿)自查 `fallbacks`:每个值必须是非空串数组,或把整个键删掉。对 `ModelEntry` 的 `keyof` 写穷举表的地方编译红(多一个可选键):补一列。
|
|
65
|
+
2. **墓碑表 `RETIRED_ENVS` 加两行**:`MODEL_DEGRADE_ON`(`replaced` → `MODEL_FALLBACK_ON`:门词的值语义变了 —— `budget` 不再是门词,`network` / `auth` / `stream_torn` 是新词,作用面由整只 Brain 的一个目标变成每条目录链,别照抄旧值)与 `MODEL_DEGRADE_REACTIVE`(`removed`:整只 Brain 的反应式降级壳删除,出路是在目录条目上声明 `fallbacks`)。
|
|
66
|
+
部署 env 里留着它们(任何值)⇒ 提货本版的引擎拒启,拒句点名键、不回显值;空串 = 未设。近预算降级线的 `MODEL_DEGRADE_TO` / `MODEL_DEGRADE_AT_COST_FRACTION` / `MODEL_DEGRADE_TO_VISION` 仍是活旋钮,不在表里。
|
|
67
|
+
|
|
50
68
|
## 升级指引:26.0.x → 26.1.0(minor,加性:引擎属主钩子事件的逐员起始契约版本 `ENGINE_OWNED_HOOK_EVENT_SINCE` + 一只读者 `engineOwnsHookEventAt`)
|
|
51
69
|
|
|
52
70
|
只加导出(包根与 `./hooks` 子路径各三名:值 `ENGINE_OWNED_HOOK_EVENT_SINCE` / `engineOwnsHookEventAt`,型 `EngineOwnedHookEvent`),零校验变化、零读数变化 —— 零动作可升。
|
|
@@ -709,7 +727,7 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
709
727
|
identity) and `enabledEntryCount(doc)`. The env model table read once — `readEnvModelSlots` / `envModelTableDeclared` (`MODEL_ID` present and non-empty) /
|
|
710
728
|
`buildEnvModelBaseline` — and the writer's plan `planEnvModelTableWrite({ env, target, decision, candidate, intent? })` (receipt by upstream id with landings
|
|
711
729
|
`{name, id}`, `confirmKey` = the receipt's sorted JSON) with its one sentence `envModelTableWriteRefusal(plan)`. Group-refusal codes
|
|
712
|
-
`CATALOG_REPLACES_ENV_MODELS_CODE` (
|
|
730
|
+
`CATALOG_REPLACES_ENV_MODELS_CODE` (the fifth entry of `MODEL_PLANE_REFUSAL_CODES`; the summarize code next to it was retired in 16.0.0 —
|
|
713
731
|
a role seat naming an entry the catalog does not serve reads as unset and falls back, so no reading refuses a model plane for it).
|
|
714
732
|
- **Session web link** (`web-admin-session-url.ts`, main barrel): `webAdminSessionUrl(webBaseUrl, { worker, sessionId })` — the ONE
|
|
715
733
|
template for a web-admin session link, `<webBaseUrl>/chat?agent=<worker>&session=<sessionId>`: both parts required (a link with only
|
|
@@ -875,7 +893,8 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
875
893
|
unchanged); `readModelRefusals(body)` reads either exit and narrows to `ModelRefusalsSignal` — the codes are CLOSED
|
|
876
894
|
sets owned here, `MODEL_ENTRY_REFUSAL_CODES` (`config.model_no_brain`, `config.model_entry_invalid`) and
|
|
877
895
|
`MODEL_PLANE_REFUSAL_CODES` (`config.default_model_missing`, `config.model_refused_name_minted`,
|
|
878
|
-
`config.model_route_endpoint_missing`, `config.gateway_fallback_without_primary`, `config.catalog_replaces_env_models
|
|
896
|
+
`config.model_route_endpoint_missing`, `config.gateway_fallback_without_primary`, `config.catalog_replaces_env_models`,
|
|
897
|
+
`config.model_catalog_refused` — 27.1.0; the server handed the candidate to the engine's catalog gate before adopting it and the engine refused it), and a code this package version
|
|
879
898
|
does not know is dropped ("not said"). It is a diagnostic key, so its failure direction is "not said": an unknown
|
|
880
899
|
code or a shape violation on the heartbeat never fails the announcement (the key drops to absent). Present ⇔ at
|
|
881
900
|
least one reportable refusal; absence is read by the announced `version` — an engine that predates the key never
|
package/conformance/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
27.1.0
|
package/dist/fleet.d.ts
CHANGED
|
@@ -156,10 +156,10 @@ export type RestartSignal = z.infer<typeof RestartSignal>;
|
|
|
156
156
|
* `config.model_no_brain` — the entry's provider rides a brain this host has not mounted;
|
|
157
157
|
* `config.model_entry_invalid` — the entry does not match the `ModelEntry` shape (dropped by the read, or re-judged at
|
|
158
158
|
* the engine's own second boundary).
|
|
159
|
-
* - {@link MODEL_PLANE_REFUSAL_CODES} — why the model plane of
|
|
160
|
-
* (the
|
|
159
|
+
* - {@link MODEL_PLANE_REFUSAL_CODES} — why the model plane of a candidate catalog was refused AS A GROUP
|
|
160
|
+
* (the model plane in service keeps serving). The first four words mirror the engine's group-refusal code TABLE as a
|
|
161
161
|
* whole family — never picked by which invariant is reachable on the hot path today (reachability moves, the table
|
|
162
|
-
* does not):
|
|
162
|
+
* does not); the last two are named HERE, for a refusing side other than that table:
|
|
163
163
|
* `config.default_model_missing` — the candidate has no default model;
|
|
164
164
|
* `config.model_refused_name_minted` — a refused entry's name would be re-minted onto another entry by the
|
|
165
165
|
* tier / alias expansion (or the dropped-entry carrier cannot prove it would not be);
|
|
@@ -167,10 +167,20 @@ export type RestartSignal = z.infer<typeof RestartSignal>;
|
|
|
167
167
|
* `config.gateway_fallback_without_primary` — fallback gateways are declared without a primary;
|
|
168
168
|
* `config.catalog_replaces_env_models` ({@link CATALOG_REPLACES_ENV_MODELS_CODE}) — on the LOCAL config leg, a candidate that
|
|
169
169
|
* manages the model plane would replace a declared env model table (`MODEL_ID` …) while the config root's decision document
|
|
170
|
-
* (`config.env-models.json`, read by `readEnvModelsDecision`) does not say `replaced` — the env models keep serving
|
|
170
|
+
* (`config.env-models.json`, read by `readEnvModelsDecision`) does not say `replaced` — the env models keep serving;
|
|
171
|
+
* `config.model_catalog_refused` — before adopting a candidate model catalog the server handed it to the engine's catalog gate
|
|
172
|
+
* and the engine refused it (a fallback word that is not in the catalog / points at its own entry / repeats / is past the hop limit,
|
|
173
|
+
* an entry missing a required member, …): the candidate does not land, the generation in service keeps serving. The JUDGE is the
|
|
174
|
+
* engine — neither this package nor the server re-judges — and the detail of the refusal, the engine's own code and sentence, is the
|
|
175
|
+
* engine's: it rides outside this word, relayed by the server verbatim. This is one generic word: it does not split into more words
|
|
176
|
+
* when the engine's catalog gate learns to refuse more. Boundary with `config.default_model_missing`: that word is SEAT-level (the
|
|
177
|
+
* candidate has no default model to resolve); this one is CATALOG-level (the catalog itself does not pass the engine's catalog gate).
|
|
171
178
|
* Source (engine): the first two in `src/model-entry-refusal.ts`, the next two in `src/model-route-endpoint.ts:40,42`
|
|
172
179
|
* (invariant `model-route-endpoint`, judged by the model-plane stage in `src/config-center/apply-effective.ts:664-665`); the
|
|
173
|
-
* last
|
|
180
|
+
* last two are named HERE first (each is a contract word: this package names it and the refusing side mints it; neither is in the
|
|
181
|
+
* engine's group-refusal table as read in the engine version this package pins, and the package does not verify engine behaviour —
|
|
182
|
+
* `config.catalog_replaces_env_models` has an exported constant for the engine to read, the engine does not mint it today;
|
|
183
|
+
* `config.model_catalog_refused` is for the server to mint, relaying the engine's verdict under it).
|
|
174
184
|
* 16.0.0 retired `config.summarize_model_missing` (and its constant) from this set: a role seat naming an entry the catalog does not serve
|
|
175
185
|
* reads as unset (it falls back down the role chain and the engine says so once) — no reading refuses a model plane for it, so it was never
|
|
176
186
|
* an engine group refusal. A reader still holding it gets it dropped by {@link readModelRefusals} like any code outside the set.
|
|
@@ -183,13 +193,14 @@ export declare const ModelEntryRefusalCode: z.ZodEnum<{
|
|
|
183
193
|
export type ModelEntryRefusalCode = z.infer<typeof ModelEntryRefusalCode>;
|
|
184
194
|
/** The env-model-table confirmation gate's group-refusal code (see {@link MODEL_PLANE_REFUSAL_CODES}). */
|
|
185
195
|
export declare const CATALOG_REPLACES_ENV_MODELS_CODE: "config.catalog_replaces_env_models";
|
|
186
|
-
export declare const MODEL_PLANE_REFUSAL_CODES: readonly ["config.default_model_missing", "config.model_refused_name_minted", "config.model_route_endpoint_missing", "config.gateway_fallback_without_primary", "config.catalog_replaces_env_models"];
|
|
196
|
+
export declare const MODEL_PLANE_REFUSAL_CODES: readonly ["config.default_model_missing", "config.model_refused_name_minted", "config.model_route_endpoint_missing", "config.gateway_fallback_without_primary", "config.catalog_replaces_env_models", "config.model_catalog_refused"];
|
|
187
197
|
export declare const ModelPlaneRefusalCode: z.ZodEnum<{
|
|
188
198
|
"config.catalog_replaces_env_models": "config.catalog_replaces_env_models";
|
|
189
199
|
"config.default_model_missing": "config.default_model_missing";
|
|
190
200
|
"config.model_refused_name_minted": "config.model_refused_name_minted";
|
|
191
201
|
"config.model_route_endpoint_missing": "config.model_route_endpoint_missing";
|
|
192
202
|
"config.gateway_fallback_without_primary": "config.gateway_fallback_without_primary";
|
|
203
|
+
"config.model_catalog_refused": "config.model_catalog_refused";
|
|
193
204
|
}>;
|
|
194
205
|
export type ModelPlaneRefusalCode = z.infer<typeof ModelPlaneRefusalCode>;
|
|
195
206
|
/**
|
|
@@ -221,7 +232,8 @@ export type ModelPlaneRefusalCode = z.infer<typeof ModelPlaneRefusalCode>;
|
|
|
221
232
|
* - `plane` — present ⇔ the model plane of the latest catalog the engine was handed was refused as a group (the engine
|
|
222
233
|
* keeps serving the model plane it had); ONE code, never a list — one candidate has exactly one group verdict (the
|
|
223
234
|
* engine judges the group invariants in a fixed order and stops at the first that fails; a refusal from the Runner
|
|
224
|
-
* swap step carries no code and is outside this signal
|
|
235
|
+
* swap step carries no code and is outside this signal; under `config.model_catalog_refused` the verdict is the engine's
|
|
236
|
+
* catalog gate's, relayed by the server — see {@link MODEL_PLANE_REFUSAL_CODES}).
|
|
225
237
|
* - `entries` and `plane` describe the same latest candidate catalog — the one the engine was handed last; with `plane`
|
|
226
238
|
* present, that is the refused candidate (its per-entry verdicts are usually why it has no default). The engine does
|
|
227
239
|
* not swap its own refusal table while the group stays refused (its selection channels still refuse by the previous
|
package/dist/fleet.js
CHANGED
|
@@ -224,10 +224,10 @@ function readSignalBody(body, pick, schema) {
|
|
|
224
224
|
* `config.model_no_brain` — the entry's provider rides a brain this host has not mounted;
|
|
225
225
|
* `config.model_entry_invalid` — the entry does not match the `ModelEntry` shape (dropped by the read, or re-judged at
|
|
226
226
|
* the engine's own second boundary).
|
|
227
|
-
* - {@link MODEL_PLANE_REFUSAL_CODES} — why the model plane of
|
|
228
|
-
* (the
|
|
227
|
+
* - {@link MODEL_PLANE_REFUSAL_CODES} — why the model plane of a candidate catalog was refused AS A GROUP
|
|
228
|
+
* (the model plane in service keeps serving). The first four words mirror the engine's group-refusal code TABLE as a
|
|
229
229
|
* whole family — never picked by which invariant is reachable on the hot path today (reachability moves, the table
|
|
230
|
-
* does not):
|
|
230
|
+
* does not); the last two are named HERE, for a refusing side other than that table:
|
|
231
231
|
* `config.default_model_missing` — the candidate has no default model;
|
|
232
232
|
* `config.model_refused_name_minted` — a refused entry's name would be re-minted onto another entry by the
|
|
233
233
|
* tier / alias expansion (or the dropped-entry carrier cannot prove it would not be);
|
|
@@ -235,10 +235,20 @@ function readSignalBody(body, pick, schema) {
|
|
|
235
235
|
* `config.gateway_fallback_without_primary` — fallback gateways are declared without a primary;
|
|
236
236
|
* `config.catalog_replaces_env_models` ({@link CATALOG_REPLACES_ENV_MODELS_CODE}) — on the LOCAL config leg, a candidate that
|
|
237
237
|
* manages the model plane would replace a declared env model table (`MODEL_ID` …) while the config root's decision document
|
|
238
|
-
* (`config.env-models.json`, read by `readEnvModelsDecision`) does not say `replaced` — the env models keep serving
|
|
238
|
+
* (`config.env-models.json`, read by `readEnvModelsDecision`) does not say `replaced` — the env models keep serving;
|
|
239
|
+
* `config.model_catalog_refused` — before adopting a candidate model catalog the server handed it to the engine's catalog gate
|
|
240
|
+
* and the engine refused it (a fallback word that is not in the catalog / points at its own entry / repeats / is past the hop limit,
|
|
241
|
+
* an entry missing a required member, …): the candidate does not land, the generation in service keeps serving. The JUDGE is the
|
|
242
|
+
* engine — neither this package nor the server re-judges — and the detail of the refusal, the engine's own code and sentence, is the
|
|
243
|
+
* engine's: it rides outside this word, relayed by the server verbatim. This is one generic word: it does not split into more words
|
|
244
|
+
* when the engine's catalog gate learns to refuse more. Boundary with `config.default_model_missing`: that word is SEAT-level (the
|
|
245
|
+
* candidate has no default model to resolve); this one is CATALOG-level (the catalog itself does not pass the engine's catalog gate).
|
|
239
246
|
* Source (engine): the first two in `src/model-entry-refusal.ts`, the next two in `src/model-route-endpoint.ts:40,42`
|
|
240
247
|
* (invariant `model-route-endpoint`, judged by the model-plane stage in `src/config-center/apply-effective.ts:664-665`); the
|
|
241
|
-
* last
|
|
248
|
+
* last two are named HERE first (each is a contract word: this package names it and the refusing side mints it; neither is in the
|
|
249
|
+
* engine's group-refusal table as read in the engine version this package pins, and the package does not verify engine behaviour —
|
|
250
|
+
* `config.catalog_replaces_env_models` has an exported constant for the engine to read, the engine does not mint it today;
|
|
251
|
+
* `config.model_catalog_refused` is for the server to mint, relaying the engine's verdict under it).
|
|
242
252
|
* 16.0.0 retired `config.summarize_model_missing` (and its constant) from this set: a role seat naming an entry the catalog does not serve
|
|
243
253
|
* reads as unset (it falls back down the role chain and the engine says so once) — no reading refuses a model plane for it, so it was never
|
|
244
254
|
* an engine group refusal. A reader still holding it gets it dropped by {@link readModelRefusals} like any code outside the set.
|
|
@@ -253,6 +263,7 @@ export const MODEL_PLANE_REFUSAL_CODES = [
|
|
|
253
263
|
"config.model_route_endpoint_missing",
|
|
254
264
|
"config.gateway_fallback_without_primary",
|
|
255
265
|
CATALOG_REPLACES_ENV_MODELS_CODE,
|
|
266
|
+
"config.model_catalog_refused",
|
|
256
267
|
];
|
|
257
268
|
export const ModelPlaneRefusalCode = z.enum(MODEL_PLANE_REFUSAL_CODES);
|
|
258
269
|
/**
|
|
@@ -284,7 +295,8 @@ export const ModelPlaneRefusalCode = z.enum(MODEL_PLANE_REFUSAL_CODES);
|
|
|
284
295
|
* - `plane` — present ⇔ the model plane of the latest catalog the engine was handed was refused as a group (the engine
|
|
285
296
|
* keeps serving the model plane it had); ONE code, never a list — one candidate has exactly one group verdict (the
|
|
286
297
|
* engine judges the group invariants in a fixed order and stops at the first that fails; a refusal from the Runner
|
|
287
|
-
* swap step carries no code and is outside this signal
|
|
298
|
+
* swap step carries no code and is outside this signal; under `config.model_catalog_refused` the verdict is the engine's
|
|
299
|
+
* catalog gate's, relayed by the server — see {@link MODEL_PLANE_REFUSAL_CODES}).
|
|
288
300
|
* - `entries` and `plane` describe the same latest candidate catalog — the one the engine was handed last; with `plane`
|
|
289
301
|
* present, that is the refused candidate (its per-entry verdicts are usually why it has no default). The engine does
|
|
290
302
|
* not swap its own refusal table while the group stays refused (its selection channels still refuse by the previous
|
package/dist/retired-envs.js
CHANGED
|
@@ -81,6 +81,10 @@ export const RETIRED_ENVS = [
|
|
|
81
81
|
["LSP_ENABLED", "the sandbox-lane LSP bridge was removed (e2b / k8s lanes mount no LSP); unset it — the host lane's switch is LSP_HOST_ENABLED", "removed"],
|
|
82
82
|
// 呈卡协议的回退开关:审批卡只有一种帧族之后,它「关」那一档(回退发旧族卡)不存在了 —— 没有可关的东西,也没有可 rename 的目标。任何显式值都拒。
|
|
83
83
|
["STREAM_APPROVAL_ENABLED", "the approval-card fallback switch was retired: approval cards have a single frame family, so its off position (falling back to the legacy card frames) no longer exists and there is nothing left to switch", "removed"],
|
|
84
|
+
// 整只 Brain 的反应式降级壳整只删除:回落链是目录数据(`ModelEntry.fallbacks`),不再是「一个 env 开关 + 一个全局目标」。门词旋钮有现名、但值语义变了(`budget` 出表,新增三词,作用面由一个目标变成每条目录链)⇒ replaced;
|
|
85
|
+
// 壳的总开关没有可 rename 的目标(出路是在目录条目上声明链,不是换个 env 名)⇒ removed。近预算降级线的三个旋钮(`MODEL_DEGRADE_TO` / `_AT_COST_FRACTION` / `_TO_VISION`)仍是活旋钮,不在本表。
|
|
86
|
+
["MODEL_DEGRADE_ON", "MODEL_FALLBACK_ON", "replaced", "the gate words moved to the engine's per-model fallback chain: budget is no longer a gate word, network / auth / stream_torn are new, and the gate now applies to every catalog chain instead of one whole-Brain target"],
|
|
87
|
+
["MODEL_DEGRADE_REACTIVE", "the env-driven whole-Brain reactive degrade shell was retired: declare `fallbacks` on the catalog entry (models.models[].fallbacks) — a fallback chain is catalog data now; the gate words that decide when a hop is taken are MODEL_FALLBACK_ON", "removed"],
|
|
84
88
|
];
|
|
85
89
|
// 冻结:拿到导出的人改不了拒启判据(读拒句的与投影 wire 的是同一个数组对象)。
|
|
86
90
|
for (const row of RETIRED_ENVS)
|
package/dist/types.d.ts
CHANGED
|
@@ -211,6 +211,7 @@ export declare const ModelEntry: z.ZodObject<{
|
|
|
211
211
|
xhigh: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
212
212
|
max: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
213
|
}, z.core.$strict>>;
|
|
214
|
+
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
214
215
|
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
215
216
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
216
217
|
autoCompactTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -333,6 +334,7 @@ export declare const ModelsConfig: z.ZodObject<{
|
|
|
333
334
|
xhigh: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
334
335
|
max: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
335
336
|
}, z.core.$strict>>;
|
|
337
|
+
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
336
338
|
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
337
339
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
338
340
|
autoCompactTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2435,6 +2437,7 @@ export declare const DOMAIN_SCHEMAS: {
|
|
|
2435
2437
|
xhigh: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2436
2438
|
max: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2437
2439
|
}, z.core.$strict>>;
|
|
2440
|
+
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2438
2441
|
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
2439
2442
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
2440
2443
|
autoCompactTokens: z.ZodOptional<z.ZodNumber>;
|
package/dist/types.js
CHANGED
|
@@ -516,6 +516,20 @@ export const ModelEntry = z.object({
|
|
|
516
516
|
* face's rule for a closed vocabulary, unlike `compat`'s parse-transparent carry. What each value means on the wire is the reading
|
|
517
517
|
* consumer's call; this package only carries the declaration. */
|
|
518
518
|
thinkingLevelMap: ModelThinkingLevelMap.optional(),
|
|
519
|
+
/** This model's fallback chain — the engine's per-model `fallbacks` (`RunnerDeps.models.<name>.fallbacks`): the names of the catalog entries
|
|
520
|
+
* (or tier words / aliases, which the engine resolves against its own expanded catalog) a call falls back to, in hop order, when this model
|
|
521
|
+
* cannot serve it. THREE-STATE like the capability bits above: ABSENT = not declared (this package never mints the key), `[]` = declared, no
|
|
522
|
+
* chain (the engine reads it as "no chain").
|
|
523
|
+
*
|
|
524
|
+
* **This package judges the FORM only: an array of non-empty strings.** A bad form refuses the WHOLE entry — a string, `null`, an object, an
|
|
525
|
+
* empty-string element, a non-string element: nothing is stripped and nothing is defaulted (the strict write face refuses the document; the read
|
|
526
|
+
* legs drop the entry with `entry-dropped` / `entry-schema-invalid` under the same cascade as any other bad entry — the entry is referenced by
|
|
527
|
+
* `roles` / `atMention` / `tierGroups`, or is the only one ⇒ the whole `models` domain defaults), the same law as {@link ModelEntry}`.thinkingLevelMap`.
|
|
528
|
+
* Whether a word names a catalog entry, whether it points at the entry itself, repeats, or makes the chain longer than the engine allows is NOT
|
|
529
|
+
* judged here: the engine's catalog gate is the ONE judge of that (its refusal names `RunnerDeps.models.<name>.fallbacks`), and a second judge
|
|
530
|
+
* in this package would be a second source of the same fact. The chain is FLAT: a hop's own `fallbacks` is not followed (that is how the engine's catalog door reads a chain since core 7.67.0; this package only carries the declaration and does not verify engine behavior). Not an env-leg key: the
|
|
531
|
+
* env leg has no per-member seat in the catalog, so a chain is declared in the catalog document. */
|
|
532
|
+
fallbacks: z.array(z.string().min(1)).optional(),
|
|
519
533
|
contextWindow: INTEGER.positive().optional(),
|
|
520
534
|
maxTokens: INTEGER.positive().optional(),
|
|
521
535
|
/** Auto-compaction trigger threshold (tokens) for this model — web-admin 显式下发时本地 FileConfigStore
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
> **25.0.0** 的写权限读口(只有一只 `writeRoleFor`,逐字段角色表 `DOMAIN_FIELD_WRITE_ROLE`,`domainWriteRole` 删)与能力读数两态(`CapabilityReading` 删 `undeclared`)在 §23。
|
|
22
22
|
> **25.1.0** 的项目登记内容证明键(`contentAttestedAt`,写角色 publisher,读方只问在不在;盖章要在读方升级之后)在 §24。
|
|
23
23
|
> **26.0.0** 的 `PermissionDenied` 属主改判 engine(锁步次序)、`models[].headers` 容器必须是对象、一致性门账本的 `kind: "posture"`、墓碑表的 `STREAM_APPROVAL_ENABLED` 在 §25。
|
|
24
|
+
> **27.0.0** 的目录条目 `ModelEntry.fallbacks`(引擎每模型回落链的声明位,只判形、坏形整条拒)与墓碑表的 `MODEL_DEGRADE_ON`(`replaced`)/ `MODEL_DEGRADE_REACTIVE`(`removed`)在 §26。
|
|
25
|
+
> **27.1.0** 的模型面组拒码闭集尾插一只泛词 `config.model_catalog_refused`(服务端采纳候选目录之前交引擎目录门、引擎拒了;加性,持穷举表的消费方编译红一次)在 §27。
|
|
24
26
|
|
|
25
27
|
---
|
|
26
28
|
|
|
@@ -262,13 +264,15 @@ server 直接拒启,不是静默降级。上一代 `SEMA_REGISTRY_*` 八名(`URL
|
|
|
262
264
|
同一只读口**:`readModelRefusals(body)`,`body` 传 `/health` 体或已 parse 的公告都行(它只读 `modelRefusals` 键);别直接
|
|
263
265
|
读公告上的字段 —— 字段是 wire 形 `ModelRefusalsWire`(码是开放串),读口才按本包闭集收窄成 `ModelRefusalsSignal`。
|
|
264
266
|
形 = `{ entries: { <条目名>: <码> }, plane?: <组拒码> }`,**名 → 码就是全部**:不带上游 id / provider / 坏字段 / 拒因句
|
|
265
|
-
(那些留在引擎日志里)。码是本包的**闭集**(`MODEL_ENTRY_REFUSAL_CODES` 两码 / `MODEL_PLANE_REFUSAL_CODES`
|
|
267
|
+
(那些留在引擎日志里)。码是本包的**闭集**(`MODEL_ENTRY_REFUSAL_CODES` 两码 / `MODEL_PLANE_REFUSAL_CODES` 六码,各有
|
|
266
268
|
`z.enum` 与型)—— 渲染按码穷举 `switch`,别手抄词表。**集外码 = 没说**:本包版本不认识的码,读口把那一条(或 `plane`)
|
|
267
269
|
丢掉,丢到空就回 `undefined`;心跳照收、存行照存 wire 形(web-admin 升级本包后同一行读出新码)—— 版本错位不会拖垮心跳。心跳上
|
|
268
270
|
`modelRefusals` 形坏(比如空信号)同样只降为缺席,不拒整条心跳。web-admin 若要给形坏留痕,自己对**请求原体**的 `modelRefusals`
|
|
269
271
|
字段(`InstanceAnnouncement.parse` 之前 —— parse 之后形坏的值已降为 `undefined`)`ModelRefusalsWire.safeParse`,读法口不替它记。`plane` 在场 = 引擎把最新交给它的那份目录的模型面整组拒了
|
|
270
272
|
(它继续服务上一代;一个候选恰一个组拒判决),`entries` 照旧逐条、说的是**同一份**(没落地的)候选 —— 组拒期间这台实例的
|
|
271
273
|
选择通道仍按上一代的拒因执行,所以 `entries` 此时是「这份新目录落不了地的逐条原因」,不是「此刻点这些名会被拒」。
|
|
274
|
+
组拒码里两个词别混:`config.default_model_missing` = 候选里解不出缺省模型(**座位级**);`config.model_catalog_refused`(27.1.0 起)= 服务端采纳候选之前交引擎的目录门过了一遍、
|
|
275
|
+
引擎拒了(**目录级**;泛词,判的是引擎,拒的细节 = 引擎自己的码与句,不在这个词里),见 §27。
|
|
272
276
|
**读版本,不读缺席**:键缺席本身不说「无拒」—— 更早的引擎从不发此键(缺席 = **不可知**)。读方看公告上已有的 `version`,
|
|
273
277
|
引擎版本 ≥ 首发此键的那一版(见 CHANGELOG 6.2.0 节)才把缺席读成「没有可报的拒」;`readModelRefusals` 只答键、不替你判版本。
|
|
274
278
|
别把老引擎渲染成「全部可用」。「可报」的边界:载不住 / 秘密形 / 不是标识符(6.3.0 起:不在 `DISCLOSABLE_IDENTITY_RE` 白名单闭形里,见 §2)的条目名不上报
|
|
@@ -876,3 +880,42 @@ fleet 成员对中心公告的可达地址(`FLEET_ADVERTISE_ADDRESS`,中心往
|
|
|
876
880
|
| sdk | 契约套件 · 事件集说明 | 零代码改动;「引擎属主九个」的说明句改十 |
|
|
877
881
|
| test | 黑盒判据 | 见 CHANGELOG 26.0.0「黑盒判据」G1–G4 |
|
|
878
882
|
|
|
883
|
+
|
|
884
|
+
## 26. 目录条目的 `fallbacks`(只判形)· 墓碑 `MODEL_DEGRADE_ON` / `MODEL_DEGRADE_REACTIVE`(27.0.0 起)—— server、web-admin、cli、client-core、sdk、test 各自的读法
|
|
885
|
+
|
|
886
|
+
**`ModelEntry.fallbacks?: string[]`**(引擎每模型回落链 `RunnerDeps.models.<名>.fallbacks` 的声明位):按跳序的非空串数组;缺席 = 未声明(本包不铸键),`[]` = 声明了、没有链(引擎读作「无链」)。**本包只判形**:非数组 / `null` / 元素不是非空串 ⇒ 条目整条拒、不剥键(严写面与文档面整份拒;读腿逐条丢,`entry-dropped` / `entry-schema-invalid`,被 `roles` / `atMention.only` / `tierGroups` 引用或是唯一一条 ⇒ 既有级联 / 零幸存者律,整个 `models` 域 `domain-defaulted`),与 `thinkingLevelMap` 同律(§19)。
|
|
887
|
+
**不判有效性**:词在不在目录、指自己、重复、超几跳 —— 一概不判,唯一的判官是引擎目录门(拒句点名 `RunnerDeps.models.<名>.fallbacks`);跨域引用判官也不把它当引用。词可以是档位词 / 别名(在引擎的展开目录上解);链是平的,一跳自己的 `fallbacks` 不被走(引擎自 7.67.0 起的读法,本包不验证)。不是 env 腿的键。
|
|
888
|
+
**读数变**(27.0.0 的 major 依据):此前带这个键的条目,视图面一律整条丢(`entry-unknown-key`),文档面剥键受理;自此合形的两面都装上,坏形文档面整份拒、视图面丢但词改 `entry-schema-invalid`。
|
|
889
|
+
|
|
890
|
+
**墓碑**:`RETIRED_ENVS` 表尾两行。`MODEL_DEGRADE_ON`(`replaced` → `MODEL_FALLBACK_ON`:门词值语义变了 —— `budget` 不再是门词,`network` / `auth` / `stream_torn` 是新词,作用面由整只 Brain 的一个目标变成每条目录链,别照抄旧值);`MODEL_DEGRADE_REACTIVE`(`removed`:整只 Brain 的反应式降级壳删除,出路 = 在目录条目上声明 `fallbacks`)。任何显式值都拒、空串 = 未设;拒句点名键、不回显值;目录 wire `retired[]`(`replaced` 行带 `replacement` + `reason`,`removed` 行只带 `reason`)与 worker 规格写闸随表。`MODEL_DEGRADE_TO` / `MODEL_DEGRADE_AT_COST_FRACTION` / `MODEL_DEGRADE_TO_VISION` 仍是活旋钮,不在表里。进表的判据:没有带着本表的引擎还读这个名 —— 服务端停读这两个键与提货本版同一发版。
|
|
891
|
+
|
|
892
|
+
**谁受伤**:① env 留着这两个键的部署 —— 提货本版的服务端拒启(预期);② 目录条目里已有 `fallbacks` 的文档 —— 合形的此前被丢、自此装上,写坏的文档面此前被剥键受理、自此整份拒。补偿:删 env 键 → 回落链写进目录条目 `fallbacks` → 门词用 `MODEL_FALLBACK_ON`;升级前自查存着的 `models` 文档里每个 `fallbacks` 是非空串数组。
|
|
893
|
+
|
|
894
|
+
| 消费方 | 读点 | 动作 |
|
|
895
|
+
|---|---|---|
|
|
896
|
+
| server | 起服墓碑拒启 · 目录条目投影 · 引擎目录门 | 同一发版停读两只旧键,墓碑拒启格翻成常规格;`retired[]` 多两项;链的有效性只由引擎目录门判 |
|
|
897
|
+
| web-admin | 目录编辑面 · `retired[]` 渲染 | 可选:表单承运 `fallbacks`(只产非空串数组,别把空串当「没有」);`retired[]` 多两行照常渲染 |
|
|
898
|
+
| cli | 手列环境变量目录的旧键 | 删去这两个旧键 |
|
|
899
|
+
| client-core / sdk | 无直接读点 | 零代码改动;语料不变 |
|
|
900
|
+
| test | 黑盒判据 | 见 `CHANGELOG.md` 27.0.0「黑盒判据」G1–G5 |
|
|
901
|
+
|
|
902
|
+
## 27. 模型面组拒码的泛词 `config.model_catalog_refused`(27.1.0 起,minor)—— server、web-admin、cli、client-core、sdk、test 各自的读法
|
|
903
|
+
|
|
904
|
+
**词**:`MODEL_PLANE_REFUSAL_CODES`(「模型拒因」那一条)尾插 `config.model_catalog_refused`,闭集由五词变六词,已发五词的次序不动。
|
|
905
|
+
**意思**:服务端在**采纳一份候选模型目录之前**把它交给引擎的目录门过了一遍,引擎拒了(链上的词不在目录 / 指自己 / 重复 / 超跳数、条目缺必需成员 …)—— 这一组(模型面)被拒,在服的一代照服务。
|
|
906
|
+
**判的是引擎,本包与服务端都不判**:拒的细节 = 引擎自己的码与句,由服务端原样带出,不在这个词里,也不在 `/health` / 心跳的 `modelRefusals` 这只形里(那只形只有「名 → 码」)。它是一只**泛词**:引擎的目录门将来多判什么,这个词不跟着加词。
|
|
907
|
+
**与 `config.default_model_missing` 的分界**:后者 = 候选里解不出缺省模型(**座位级**);本词 = 目录本身过不了引擎的门(**目录级**)。一个候选恰一个组拒判决,铸哪个词是铸码一方的事,本包不排序。
|
|
908
|
+
**读数变**(27.1.0 的唯一一处):`readModelRefusals` 对 `plane` 是这只新词的体,≤ 27.0.0 把它当集外码收窄成缺席,自此读出 `{ entries, plane: "config.model_catalog_refused" }`;集外词照旧丢。无校验变化、无导出增删。
|
|
909
|
+
|
|
910
|
+
**档位依据**:发版纪律「词表加词 = minor」(闭集尾插);先例 14.8.0 —— 同一只闭集尾插两码、同判 minor,「对组拒码穷举的读者提货时编译红」记作提货成本。
|
|
911
|
+
|
|
912
|
+
**谁受伤**:对 `ModelPlaneRefusalCode` / `MODEL_PLANE_REFUSAL_CODES` 写穷举(`Record<ModelPlaneRefusalCode, …>` / 带 `never` 兜底的 `switch`)的读方 —— 提货本版编译红一次,补一臂 / 一行;没提货的读方把新词读成「没说」(诊断键的失败方向,版本错位不会拖垮心跳)。补偿:不适用(加性)。
|
|
913
|
+
|
|
914
|
+
| 消费方 | 读点 | 动作 |
|
|
915
|
+
|---|---|---|
|
|
916
|
+
| server | 采纳候选模型目录之前交引擎目录门 · 铸组拒码 | 请托的读法:铸码一方是服务端,拟自 7.153.0 起铸这只码(服务端的排期,本包不验证);拒的细节(引擎自己的码与句)原样带出;不在服务端再判一遍引擎的门 |
|
|
917
|
+
| web-admin | 渲染模型面拒因的表(按码穷举) | 多一行 `config.model_catalog_refused`;已有的 `config.default_model_missing` 行不动,两行别混(座位级 / 目录级) |
|
|
918
|
+
| cli | 按码分流的地方(若有) | 多一词;未知词的既有兜底读法(读口丢集外码 = 没说)不变 |
|
|
919
|
+
| client-core | 按码分流的地方(若有) | 同上;没有这样的读点则零改动 |
|
|
920
|
+
| sdk | 契约套件 | 零代码改动;语料不变(语料零 diff) |
|
|
921
|
+
| test | 黑盒判据 | 见 `CHANGELOG.md` 27.1.0「黑盒判据」G1–G4 |
|
package/llms-full.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
llms-full.txt — 自包含全文 · 消费方(使用者)视角 · @sema-agent/settings-schema
|
|
3
|
-
重写日期: 2026-11-11 | 包版本:
|
|
3
|
+
重写日期: 2026-11-11 | 包版本: 27.1.0
|
|
4
4
|
生成方式: 无生成脚本——按当前树 src/*.ts 导出面 + package.json + README/CHANGELOG 手写事实版。
|
|
5
5
|
证据约定: 每条"它怎么工作"的断言附 (文件: 符号) 坐标,刻意不用行号(行号逐版腐烂;符号名由
|
|
6
6
|
typecheck 与 test/package-surface.test.ts、test/docs-hygiene.test.ts 等常驻门钉住)。无证据推断显式标【推断】。
|
|
@@ -108,6 +108,8 @@ registry:公网 npmjs,无需私有 registry 配置。
|
|
|
108
108
|
--- 6.4.0:`ModelEntry.headers?`(无默认,缺席不铸键)——部署 ↔ 供应商的 per-model 附加请求头,例 `{"anthropic-beta":"context-1m-2025-08-07"}`(开 1M 上下文);头名闭集白名单 × 读它的线路 × 值形的判据**唯一属主是 sema-server**(坏声明 ⇒ 该条目整条不可用,不是丢头照常),本包不复述那张表。修前(≤6.3.0)每条读腿都剥它并报 `unknown-keys-dropped`。6.4.0–25.x 它登记为解析透明键;**26.0.0 起它是自由形对象键,与 `extraBody` 同一只判官**:容器必须是纯 JSON 对象(串 / 数组 / 数 / 布尔 / `null` ⇒ 条目拒,句子 `headers must be a plain JSON object`,不回显值;严写面整份拒,读腿上 `models` 逐条丢、那一条目 `entry-dropped` / `entry-schema-invalid`),对象里的名与值照旧逐字过,再过与 `compat`/`extraBody` 共用的 `vetFreeFormJson` 安全判据 ---
|
|
109
109
|
--- 20.0.0:`ModelEntry.thinkingLevelMap?`(引擎 `Model.thinkingLevelMap` 的声明位;键闭集 = 词表 `MODEL_THINKING_LEVEL_WORDS` 七词 `off`/`minimal`/`low`/`medium`/`high`/`xhigh`/`max`,型 `ModelThinkingLevel`,席位 schema `ModelThinkingLevelMap` 从词表铸键并 `.strict()`;全可选;值 = 非空串〔供应商在该档上的取值〕或 `null`〔该档在这个模型上不支持〕;缺席 = 未声明,本包不补 `{}`,`{}` = 声明了、没有覆盖)——
|
|
110
110
|
坏形整条目拒、不剥键、不折默认:未知键〔含大小写变体〕/ 非对象〔含整张表写 `null`、数组〕/ 空串值 / 非串非 `null` 值 ⇒ 读口逐条丢并报 `entry-dropped`(同域未被引用的其余条目照常;被 `roles` / `atMention.only` / `tierGroups` 引用的条目坏形 ⇒ 既有级联律,整个 `models` 域 `domain-defaulted`、目录退空、兄弟条目一并丢;一条好条目都不剩〔含它是唯一一条〕走既有的零幸存者律:只发 `domain-defaulted`、`models` 退成空目录),文档面〔`getDomain` / 导出〕整域抛,写口拒;此前该键被当未知键剥掉。本包只承载与判形,串的内容归读它的消费方。与引擎 `ModelThinkingLevel` 的两向锚在漂移门 ⑫(编译期;引擎加词只在 `npm run typecheck` 红)。
|
|
111
|
+
--- 27.0.0:`ModelEntry.fallbacks?`(引擎每模型回落链 `RunnerDeps.models.<名>.fallbacks` 的声明位;`z.array(z.string().min(1)).optional()`,按跳序;缺席 = 未声明,本包不铸键,`[]` = 声明了、没有链〔引擎读作「无链」〕;不是 env 腿的键)——
|
|
112
|
+
**本包只判形**:非数组 / `null` / 元素不是非空串 ⇒ 整条目拒、不剥键、不折默认(严写面与文档面整份拒;读口逐条丢并报 `entry-dropped` / `entry-schema-invalid`,被 `roles` / `atMention.only` / `tierGroups` 引用或是唯一一条 ⇒ 既有级联 / 零幸存者律,与 `thinkingLevelMap` 坏形同答)。词在不在目录、指自己、重复、超几跳 —— 一概不判:唯一的判官是引擎目录门(拒句点名 `RunnerDeps.models.<名>.fallbacks`),本包再判一遍就是第二只判官。词可以是档位词 / 别名(在引擎的展开目录上解);链是平的,一跳自己的 `fallbacks` 不被走(引擎自 7.67.0 起的读法,本包不验证)。修前(26.1.0):视图面把带这个键的条目当未知键一律整条丢(`entry-unknown-key`),文档面剥键受理;自此合形的装上、坏形整条拒。
|
|
111
113
|
· rosters:`RosterEntry[]`(`primaryModel`/`cheapModel` 标记角色;`ROSTER_PRIMARY_ROLES`/`ROSTER_CHEAP_ROLES`)。
|
|
112
114
|
· skills:`SkillSpec[]`(content 全文;wire 转 manifest 见 §4.5)。
|
|
113
115
|
--- 14.4.0:`SkillSpec.allowedTools?` / `disallowedTools?`(`string[]`,元素非空串;与引擎本地 `.sema/skills` 清单同名同形)—— 逐条按作者所写承运:不去重 / 不排序 / 不判拼写(本包只判「非空字符串」);缺席 = 键不出现,在场 = 整只数组交给消费方的判官(`[]` 与缺席是两种承运形,读成什么由判官定;引擎本地目录把空名单读作未声明);manifest 由 `SkillSpec` 派生,两键自动随到 `/effective` 的 `skills[]`;读腿:24.0.0 起两只名单是一个值(与 `scenarios` / `rosters` / MCP `allowTools` 同一条律),且 `skills` 不逐条丢、读档 throw —— 名单里坏一个元素 ⇒ 整域读不进、读抛,两腿同读(14.4.0–23.0.0:坏元素被逐元素剔、`disallowedTools` 被截短、技能照装)。
|
|
@@ -432,7 +434,8 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
|
|
|
432
434
|
`ModelRefusalsSignal` = `{ entries: Record<条目名, ModelEntryRefusalCode>, plane?: ModelPlaneRefusalCode }`;值只码(不带上游
|
|
433
435
|
id / provider / 坏字段键 / 句子);码闭集真源在本包:`MODEL_ENTRY_REFUSAL_CODES`(`config.model_no_brain` /
|
|
434
436
|
`config.model_entry_invalid`)、`MODEL_PLANE_REFUSAL_CODES`(`config.default_model_missing` / `config.model_refused_name_minted` /
|
|
435
|
-
`config.model_route_endpoint_missing` / `config.gateway_fallback_without_primary` / `config.catalog_replaces_env_models`;16.0.0 退役 summarize 那一码),各配 z.enum + 型;
|
|
437
|
+
`config.model_route_endpoint_missing` / `config.gateway_fallback_without_primary` / `config.catalog_replaces_env_models` / `config.model_catalog_refused`;16.0.0 退役 summarize 那一码),各配 z.enum + 型;
|
|
438
|
+
27.1.0 additive:`MODEL_PLANE_REFUSAL_CODES` 尾插最后一词 `config.model_catalog_refused`(泛词:服务端采纳候选模型目录之前交引擎的目录门过了一遍、引擎拒了 —— 目录级,这一组被拒、在服的一代照服务;判的是引擎,本包与服务端都不判,拒的细节是引擎自己的码与句、在这个词之外;不随引擎目录门将来多判什么而加词;与座位级的 `config.default_model_missing`〔候选里解不出缺省模型〕有分界)——不加不删导出名、零校验变化;`readModelRefusals` 对 `plane` 是新词的体由「没说」变读出,集外词照旧丢;持 `Record<ModelPlaneRefusalCode, …>` / 穷举 `switch` 的消费方提货编译红一次(提货成本,不是 major;先例 14.8.0);
|
|
436
439
|
`readModelRefusals(body)` 一只读口两出口(`/health` 体或已 parse 的公告,与 `readEngineSignal` 同一只私有读口)先判形再按
|
|
437
440
|
闭集收窄,集外码丢、丢到空 ⇒ `undefined`,只答键不判版本;心跳键 `InstanceAnnouncement.modelRefusals` =
|
|
438
441
|
`ModelRefusalsWire.optional().catch(undefined)` —— 集外码照过、形坏降为缺席,诊断键永不拖垮心跳;`/health` 一侧 `InstanceHealth`
|
|
@@ -529,6 +532,7 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
|
|
|
529
532
|
—— 旧名在场即拒启,替代名设没设都一样(空串 = 未设);永久,不设到期;链只有一跳(去向恒是现名)。拒启句唯一铸点
|
|
530
533
|
`retiredEnvRefusal(env)`(纯,读传入的 env;码 `RETIRED_ENV_REFUSAL_CODE` = `config.env_key_retired`;只点名键不回显值);
|
|
531
534
|
目录 wire 投影 `buildRetiredEnvWire()`。引擎起服 / 壳起本机引擎 / web-admin 渲染 worker env 判同一张表。
|
|
535
|
+
27.0.0 起表尾两行:`MODEL_DEGRADE_ON`(replaced → `MODEL_FALLBACK_ON`:门词的值语义变了,`budget` 不再是门词、`network` / `auth` / `stream_torn` 是新词、作用面由整只 Brain 的一个目标变成每条目录链)与 `MODEL_DEGRADE_REACTIVE`(removed:整只 Brain 的反应式降级壳删除,出路是在目录条目上声明 `fallbacks`);近预算降级线的 `MODEL_DEGRADE_TO` / `MODEL_DEGRADE_AT_COST_FRACTION` / `MODEL_DEGRADE_TO_VISION` 仍是活旋钮,不在表里。
|
|
532
536
|
|
|
533
537
|
--- 4.10c 沙箱 git 凭据平面(src/sandbox-git.ts + src/api/credentials.ts,主 barrel,不开子路径;14.7.0) ---
|
|
534
538
|
- 沙箱里的 git 用成员本人的凭据:数据面向 web-admin 的凭据取值口按 run 身份申领句柄、凭句柄兑换。本包只有形与词表,零 IO。
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
3
|
-
重写日期: 2026-11-11 | 包版本:
|
|
3
|
+
重写日期: 2026-11-11 | 包版本: 27.1.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 相等、
|
|
@@ -28,6 +28,7 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
28
28
|
改写存量的一次性迁移 26.0.0 到期删了,出路是手写到 governance / limits)。(src/types.ts: `DOMAIN_SCHEMAS`)
|
|
29
29
|
- **目录条目的 `thinkingLevelMap?`**(20.0.0,引擎 `Model.thinkingLevelMap` 的声明位):键闭集 `MODEL_THINKING_LEVEL_WORDS`(`off` `minimal` `low` `medium` `high` `xhigh` `max`,型 `ModelThinkingLevel`,席位 schema `ModelThinkingLevelMap`),全可选;
|
|
30
30
|
值 = 非空串(供应商在该档上的取值)或 `null`(该档在这个模型上不支持);缺席 = 未声明,本包不补 `{}`。坏形(未知键 · 非对象 · 空串值 · 非串非 `null` 值)**整条目拒** —— 读口逐条丢并报 `entry-dropped`(未被引用的其余条目照常;**被 `roles` / `atMention.only` / `tierGroups` 引用的条目坏形 ⇒ 既有级联律,整个 `models` 域 `domain-defaulted`、目录退空**;一条好条目都不剩时走既有的零幸存者律:只发 `domain-defaulted`),不剥键、不折默认。与引擎联合的两向锚在漂移门(编译期)。(src/types.ts: `ModelEntry` / `MODEL_THINKING_LEVEL_WORDS`)
|
|
31
|
+
- **目录条目的 `fallbacks?`**(27.0.0,引擎每模型回落链 `RunnerDeps.models.<名>.fallbacks` 的声明位):非空串数组,按跳序;缺席 = 未声明(本包不铸键),`[]` = 声明了、没有链(引擎读作「无链」)。**本包只判形**:坏形(非数组 · `null` · 元素不是非空串)**整条目拒、不剥键** —— 读口逐条丢并报 `entry-dropped`(`entry-schema-invalid`;级联与零幸存者律同上),严写面整份拒;词在不在目录 · 指自己 · 重复 · 超几跳一概不判,唯一的判官是引擎的目录门。词可以是档位词 / 别名(在引擎的展开目录上解);链是平的,一跳自己的 `fallbacks` 不被走(引擎自 7.67.0 起的读法,本包不验证)。不是 env 腿的键。(src/types.ts: `ModelEntry`)
|
|
31
32
|
- **域内坏条目逐条丢**(2.0.0):一条写坏的目录条目只丢它自己,同域其余条目照常生效,并逐条发
|
|
32
33
|
`entry-dropped` 点名(坐标形见下条;6.1.0 起可带 `identity?: { name?, id?, enabled? }` = 被丢条目原文里
|
|
33
34
|
读得出的身份,类型不对 / `isDisclosableIdentity` 说不可披露 ⇒ 不带该键;6.3.0 起身份须是白名单闭形
|
|
@@ -146,7 +147,7 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
146
147
|
- **fleet 契约**(drain / 实例发现 / 派发策略 / 配额租约 / 用量上报;6.1.0 起重启信号 `RestartSignal` 定义一次,
|
|
147
148
|
11.0.0 起它是引擎状态,两出口只在 `engineSignal` 里读(`readEngineSignal(body)?.restart`;平铺 `restart` 是方言、不读,平铺读口已删),在场 ⇔ 需要重启;
|
|
148
149
|
6.2.0 起模型拒因同法定义一次:wire 形 `ModelRefusalsWire` = `{ entries: 名 → 码, plane?: 组拒码 }`(码是开放串),
|
|
149
|
-
`readModelRefusals(body)` 一只读口读两出口并按闭集 `MODEL_ENTRY_REFUSAL_CODES`(2)/ `MODEL_PLANE_REFUSAL_CODES`(
|
|
150
|
+
`readModelRefusals(body)` 一只读口读两出口并按闭集 `MODEL_ENTRY_REFUSAL_CODES`(2)/ `MODEL_PLANE_REFUSAL_CODES`(6)收窄成
|
|
150
151
|
`ModelRefusalsSignal`,集外码 = 没说;心跳 `InstanceAnnouncement.modelRefusals?` 上形坏 / 集外码都不拖垮心跳;缺席读 `version`,
|
|
151
152
|
老引擎缺席 = 不可知;8.1.0 additive:`RestartSignal.withheld?`、引擎自铸信号的闭形 `EngineSignal` + `readEngineSignal(health)`
|
|
152
153
|
(`undefined` = 没有这只信号,不是就绪)、服务租约 API 型 `ServingLeaseRequest` / `ServingLeaseResponse`(`granted` / `denied` / `unknown` 三词闭集,
|
|
@@ -159,6 +160,8 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
159
160
|
`isReadyForTraffic` / `isRoutable` 是它们的布尔形;没有信号(旧引擎)= `no-engine-signal`,不可路由;平铺方言(`/health` 的布尔对 + 心跳上与信号同名的平铺键)26.0.0 删,还带它们的体照收、判官不读;
|
|
160
161
|
8.3.0 additive:env 名常量 `FLEET_SCOPE_ENV`(`"FLEET_SCOPE"`,成员所属租户 scope,渲染器写、引擎读;缺席 = 默认 scope `GLOBAL_SCOPE`;进保留 env 名表);
|
|
161
162
|
14.7.0 additive:公告地址 env 名常量 `FLEET_ADVERTISE_ADDRESS_ENV`(`"FLEET_ADVERTISE_ADDRESS"`)+「后面要拼路径的基址」座位的禁用成分集 `PATH_BASE_URL_FORBIDDEN_PARTS`(`userinfo` / `query` / `fragment`)+ 判官 `pathBaseUrlFlaws(url)`(= `httpUrlFlaws` 配这一集;判展开之后的值;`webAdminSessionUrl` 也读它);
|
|
163
|
+
27.1.0 additive:模型面组拒码闭集 `MODEL_PLANE_REFUSAL_CODES` 尾插一只泛词 `config.model_catalog_refused`(服务端采纳候选目录之前交引擎的目录门过了一遍、引擎拒了:目录级;判的是引擎,本包与服务端都不判,拒的细节是引擎自己的码与句;与座位级的 `config.default_model_missing` 有分界)—— 不加不删导出名,零校验变化;`readModelRefusals` 对 `plane` 是新词的体由「没说」变读出;持穷举表的消费方提货编译红一次;
|
|
164
|
+
27.0.0 BREAKING:目录条目多可选席 `fallbacks`(只判形,坏形整条拒 —— 严写面此前剥键受理的坏形自此整份拒;视图面此前带它的条目一律整条丢〔`entry-unknown-key`〕,自此合形的装上、坏形丢但词改 `entry-schema-invalid`)· 墓碑表 `RETIRED_ENVS` 加 `MODEL_DEGRADE_ON`(replaced → `MODEL_FALLBACK_ON`:门词值语义变了)与 `MODEL_DEGRADE_REACTIVE`(removed:整只 Brain 的反应式降级壳删除,出路 = 在目录条目上声明 `fallbacks`),设了即拒启,拒句点名键不回显值;近预算降级线的三个旋钮仍是活旋钮、不在表里;
|
|
162
165
|
26.1.0 additive:引擎属主钩子事件的逐员起始契约版本 `ENGINE_OWNED_HOOK_EVENT_SINCE`(`Readonly<Record<EngineOwnedHookEvent, string>>`,冻结;`PermissionDenied` = 26.0.0,其余九员 = 1.0.0;键集恰 = `ENGINE_OWNED_HOOK_EVENTS`,加员漏填 ⇒ 编译红)+ 唯一读者 `engineOwnsHookEventAt(event, contractVersion): boolean`(交引擎 ⟺ 属主表说 engine ∧ 对端契约版本 ≥ 该员起始版本;坏版本串抛 `TypeError`)+ 型 `EngineOwnedHookEvent`;包根与 `./hooks` 各三名,零校验变化;
|
|
163
166
|
26.0.0 BREAKING:`ENGINE_OWNED_HOOK_EVENTS` 十员(尾插 `PermissionDenied`,`HOOK_EVENT_OWNER.PermissionDenied` = engine:一次工具调用被引擎的工具门拒,发生在工具执行链里;
|
|
164
167
|
按属主分流的消费方锁步改 —— 服务端补站对位,客户端核心重生成属主表与终端客户端座位改组同一个客户端发版;本包的配置校验不读属主表)·
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/settings-schema",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.1.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",
|