@sema-agent/settings-schema 22.0.0 → 23.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.
- package/CHANGELOG.md +104 -0
- package/README.md +7 -1
- package/conformance/VERSION +1 -1
- package/dist/config-fns.d.ts +22 -7
- package/dist/config-fns.js +38 -23
- package/docs/CONSUMER-INTEGRATION.md +14 -1
- package/llms-full.txt +2 -2
- package/llms.txt +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,110 @@
|
|
|
8
8
|
|
|
9
9
|
## Unreleased
|
|
10
10
|
|
|
11
|
+
## 23.0.0 — 2026-11-06 — major:条目缺席会**放宽**可达面的两个域 —— `scenarios`(条目覆盖内建场景名)与 `plugins`(来源引用承运可执行面,hooks 守卫随引用走)—— 移出逐条丢弃集(`DOMAIN_ENTRY_SALVAGE` 判 `"none"`):它们的坏形条目自此整域读不进,不再只丢那一条;条目体内的未知键回到剥键 + `unknown-keys-dropped`;整域读不进之后的读档由 `"default"` 改 `"throw"`(`DOMAIN_READ_FALLBACK`)
|
|
12
|
+
|
|
13
|
+
> 档位(按发版纪律):**major** —— 校验收紧(同一份文档在视图面读出的生效配置会变:`scenarios` / `plugins` 里一条坏形条目由「丢那一条、兄弟照装」变「整域读不进、读档 throw」;条目体内的未知键由「条目丢」变「剥键装上 + 点名」)· 读档表 `DOMAIN_READ_FALLBACK` 两行值变(`"default"` → `"throw"`)。
|
|
14
|
+
> 22.0.0 的「带未知键的条目整条丢」用在条目缺席会放宽的域上是放宽(见下)。本版对这两个域:条目体内的未知键回到 21.0.0 的读数(剥键 + 点名);坏形条目比 21.0.0 更严 —— 21.0.0 丢那一条(同样让内建 / 守卫缺席,12.3.0 起就是这样),本版整域读不进。同一个类,一版收。
|
|
15
|
+
|
|
16
|
+
### 律(一条)
|
|
17
|
+
|
|
18
|
+
`DOMAIN_ENTRY_SALVAGE` 只许「**条目缺席只会收窄可达面**」的域取 `"salvage"`;条目缺席会**放宽**可达面的域 —— 条目是限制 / 守卫,或是覆盖内建同名物的声明(缺席 ⇒ 内建复活)—— 取 `"none"`:任何条目问题都让整域读不进,
|
|
19
|
+
与 `rosters` `workers` `governance` `entitlement` `execution` `prompts` `limits` 七个老 `"none"` 域同形。判法写在表里每一行的尾注(闭集:加一个域 = 加一行判)。
|
|
20
|
+
**`"none"` 不等于抛**:整域读不进之后是默认化还是抛,是另一张表 `DOMAIN_READ_FALLBACK` 的问题。这两个域的条目缺席会放宽,整域缺省成空域同样会放宽(空 `scenarios` ⇒ 覆盖过的内建场景全部回位;空 `plugins` ⇒ 引用承运的 hooks 守卫全缺席),
|
|
21
|
+
而且是对每一个没有候选门的读方放宽 —— 一条坏条目会让**全部**覆盖消失,比丢一条更宽。所以本版同时把这两个域的读档判成 `"throw"`(与 `rosters` `governance` 同形:fail-static 在上一份好配置)。
|
|
22
|
+
|
|
23
|
+
为什么:22.0.0 的「逐条丢弃域里带未知键的条目整条丢」对**收紧域**是放宽。`scenarios` 的条目覆盖内建场景名、收窄它的工具面;那一条带一个拼错 / 前瞻的键 ⇒ 条目丢 ⇒ 同名内建场景(更宽的工具面)复活。
|
|
24
|
+
21.0.0 下同一输入是 `unknown-keys-dropped`(读方把它当整份候选失败、保住上一份好配置),22.0.0 下变成「条目丢 + 候选照收」。`plugins` 同理:一条引用承运的是可执行面(命令 / hooks / MCP),
|
|
25
|
+
其中 hooks 可以是守卫(`PreToolUse` / `PermissionRequest`,见 `./hooks-config`),引用丢 ⇒ 守卫随之缺席。
|
|
26
|
+
|
|
27
|
+
### 十域判定表(22.0.0 的十个逐条丢弃域,逐域读 schema 与消费语义的结论;十七行每行尾都有判注,逐字在 `DOMAIN_ENTRY_SALVAGE`)
|
|
28
|
+
|
|
29
|
+
| 域 | 判 | 条目缺席会怎样 |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| `models` | 留 `salvage` | 条目 = 一个目录模型(及 `roles` 里的一个角色覆盖);缺席 = 少一个模型 / 一个角色回落到缺省 —— 选路变了,可达面没变。被引用的模型缺席 ⇒ 引用悬空 ⇒ 整域缺省(既有律)(见「已知限制」) |
|
|
32
|
+
| `skills` | 留 `salvage` | 条目 = 一份下发的技能(含它的工具 allow / deny 名单);缺席 = 少一份技能 —— 有已知缺口(见「已知限制」) |
|
|
33
|
+
| `mcp` | 留 `salvage` | 条目 = 一台工具源;缺席 = 该台不挂载 —— 有已知缺口:名字不再被部署占位(见「已知限制」) |
|
|
34
|
+
| `plugins` | **收 `none`** | 条目 = 可执行面的来源引用,hooks(含守卫)随引用走;缺席 = 守卫缺席 = 放宽 |
|
|
35
|
+
| `scenarios` | **收 `none`** | 条目 = 覆盖内建场景名的工具面声明;缺席 = 同名内建(更宽的工具面)复活 = 放宽 |
|
|
36
|
+
| `systems` | 留 `salvage` | 条目 = 一个外部系统的凭据与可调 worker 名单(授权);缺席 = 少一份授权 |
|
|
37
|
+
| `collab` | 留 `salvage` | 条目 = 一个协作模板(预算闸随模板走);缺席 = 少一个可选模板,已有的闸一个不松 |
|
|
38
|
+
| `hosts` | 留 `salvage` | 条目 = 一个排布目标;缺席 = 少一个目标(待批 / drain / 停用的条目缺席同样不可排) |
|
|
39
|
+
| `projects` | 留 `salvage` | 条目 = 一条项目登记(加性登记簿,不是准入门);缺席 = 少一份默认记忆 scope 的种子(消费方查表 miss 不 fail) |
|
|
40
|
+
| `a2a` | 留 `salvage` | 条目 = 一个出站对端;缺席 = 少一个对端(凭据引用整体原子,见 `ATOMIC_SALVAGE`;名字占位同 `mcp`,见「已知限制」) |
|
|
41
|
+
|
|
42
|
+
`hooks` 不是 `DOMAIN_ENTRY_SALVAGE` 里的域:hook 条目由 `classifyHooksConfig`(`./hooks-config`)自带的守卫感知判官处置 —— 带守卫记号的坏块让整份文档被拒,不在逐条丢弃表的射程内,本版不动。
|
|
43
|
+
|
|
44
|
+
### 读数变化(逐条,视图面 = `parseDomainSalvaged` / `buildEffective` / `readEffectiveWire` / `FileConfigStore.getEffective` / `loadLocalConfig`)
|
|
45
|
+
|
|
46
|
+
1. **`scenarios` / `plugins` 里不合 schema 的条目 ⇒ 整域读不进,读档 throw**:`parseDomainSalvaged` 抛;`buildEffective` / `readEffectiveWire` / `FileConfigStore.getEffective` / `loadLocalConfig` 都**抛**(原错:脱敏的 `ZodError`,点名坏条目的坐标与 issue),
|
|
47
|
+
不再读出空域 + `domain-defaulted`;**零条 `entry-dropped`**,好兄弟也随之不在(整域一个结论)。此前:只丢那一条,兄弟照装。
|
|
48
|
+
2. **这两个域条目体内的未知键 ⇒ 条目照装、键被剥、`unknown-keys-dropped` 点名条目体内的键**,零 `entry-dropped`、不再有 `entry-unknown-key`。这是 21.0.0 的读数,也是七个老 `"none"` 域一直的读数。
|
|
49
|
+
3. **不变**:另外八个逐条丢弃域(`models` `skills` `mcp` `systems` `collab` `hosts` `projects` `a2a`)与线上 skills 清单一字不变(22.0.0 的律原样:带未知键的条目整条丢,词 `entry-unknown-key`);文档面一字不变;`DROPPED_ENTRY_REASON_CODES` 不变。
|
|
50
|
+
4. 空域对这两个域**不是** fail-closed(空 `scenarios` ⇒ 内建全部回位;空 `plugins` ⇒ 引用承运的 hooks 一并缺席),所以它们的读档是 `"throw"` 而不是 `"default"`;`unknown-keys-dropped`(条目体内的未知键,条目照装、键被剥)仍是告警,
|
|
51
|
+
对这两个域它是读方的**拒绝信号**,不是可以照装的告警(server 把它折进候选门)。读档变化只影响整域读不进的那一臂:读好文档的路径一字不动。
|
|
52
|
+
|
|
53
|
+
### 三问
|
|
54
|
+
|
|
55
|
+
- **谁需要**:用 `scenarios` 覆盖内建场景名来收窄工具面的部署;用 `plugins` 引用承运守卫 hooks 的部署 —— 条目上一个拼错 / 前瞻的键不再静默撤掉覆盖 / 守卫。
|
|
56
|
+
- **谁受伤**:这两个域里有一条坏形条目(此前只丢那一条)的部署:现在整域读不进、读档 throw。真消费方(server)对 throw 档的域本来就 fail-static(候选被拒、上一份好配置继续服务);
|
|
57
|
+
**本地读腿(经 `FileConfigStore` / `loadLocalConfig` 读盘的一侧,含引擎本地车道与嵌入方)从「读出空域 + `domain-defaulted`」变成「抛」** —— 起服 / 读盘遇到一份坏 `scenarios.json` / `plugins.json` 现在是响亮失败,不再是静默少掉全部覆盖 / 引用。
|
|
58
|
+
- **补偿**:抛出的 `ZodError` 点名坏条目的坐标与 issue;**删掉那条(或改对)即回**,不需要迁移。升级前自查:对存量文档跑 `parseDomainLoud("scenarios" | "plugins", 文档, onWarning)` ——
|
|
59
|
+
抛了就是升级后会整域读不进的文档;`unknown-keys-dropped` 里第一段是集合字段、第二段是下标的坐标,就是升级后「剥键装上 + 点名」的条目。
|
|
60
|
+
|
|
61
|
+
### 导出面
|
|
62
|
+
|
|
63
|
+
无新导出、无删除、无签名变化。`DOMAIN_ENTRY_SALVAGE` 的值变了两行(`scenarios` / `plugins`:`"salvage"` → `"none"`),`DOMAIN_READ_FALLBACK` 的值变了同样两行(`"default"` → `"throw"`);两张都是 `as const` 字面表:
|
|
64
|
+
对 `DOMAIN_ENTRY_SALVAGE.scenarios === "salvage"` / `DOMAIN_READ_FALLBACK.scenarios === "default"` 这类字面比较编译红(类型无交集),是应得的通知。
|
|
65
|
+
|
|
66
|
+
### 各消费方
|
|
67
|
+
|
|
68
|
+
| 消费方 | 读点 | 动作 |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| server | 两张表在本包,读侧零码改:这两个域读档 throw ⇒ 远端 `readEffectiveWire` 与本地 `FileConfigStore` 对 throw 档的域本来就是整包抛、调用方整包 catch 回落 env / 上一份好配置(与 `governance` 同形);`unknown-keys-dropped` 照旧折进候选门(`scope: "domain"`);`entry-dropped` 的目录载体只收 `models` | 提货即得;三格钉:`scenarios` 条目带未知键 ⇒ 候选被拒、内建场景不复活 · `scenarios` / `plugins` 条目坏形 ⇒ 读抛、不是空域 · `models` 条目带未知键 ⇒ 仍条目丢(22.0.0 的律) |
|
|
71
|
+
| sdk | 不读这两张表 | 零改动;行为变更点名:`scenarios` / `plugins` 条目坏 ⇒ 该域整域读不进、读档 throw(经 `readEffectiveWire` 读 wire 的一侧同抛) |
|
|
72
|
+
| cli | 对包读口的直接读点只有 `parseDomainSalvaged`(models 目录验收)与 `readConfigDFileReadingSync`(collab),都不碰 `scenarios` / `plugins`(逐处 grep 核过);生效配置由引擎的本地读腿(`FileConfigStore`)读 | **点名 cli**:行为变更不落在 cli 自己的码上;经引擎本地读腿读这两个域的路径从「空域 + `domain-defaulted`」变成抛 —— 起本机引擎前自查 `config.d/scenarios.json` / `plugins.json` 有没有坏条目 |
|
|
73
|
+
| web-admin | 诊断口 `salvageEntries(DOMAIN_SCHEMAS.<域>, raw, "<域>")` 与视图面读 | 零改动;行为变更点名:`scenarios` / `plugins` 条目坏 ⇒ 视图面该域整域读不进、读档 throw(诊断口本身不读这两张表,条目级诊断照旧) |
|
|
74
|
+
| client-core | 没有对 `buildEffective` / `loadLocalConfig` / `FileConfigStore` / `readEffectiveWire` 的直接调用(逐处 grep 核过) | **点名 client-core**:零改动;不再收到这两个域的 `domain-defaulted`(该告警只由读档 `"default"` 的域铸) |
|
|
75
|
+
|
|
76
|
+
### 耐久数据面
|
|
77
|
+
|
|
78
|
+
不配一次性迁移:存下来的文档一字不改,变的是视图面对它的读法;出路只有一条 —— 删掉(或改对)那条坏条目 / 那个未知键。
|
|
79
|
+
|
|
80
|
+
### 已知限制与 24.0.0 收口承诺
|
|
81
|
+
|
|
82
|
+
下面几条是上面判定表里仍判 `salvage` 的行上、已知的「缺席并非只收窄」的缺口。**22.0.0 就是这样,本版未收;其中由未知键触发的几条相对 21.0.0 是 22.0.0 引入的。**
|
|
83
|
+
|
|
84
|
+
- **`skills` —— 24.0.0 收口(承诺,不是披露即止)**:条目被丢后同名出厂技能回位(server 把中心技能按名字覆盖在出厂技能之上;出厂技能自带的 allow 名单随之回来,中心条目上的 deny 名单随之不在);
|
|
85
|
+
技能 `disallowedTools` 名单里的坏元素被逐元素剔掉(名单被截短,技能带着更短的拒绝名单存活;引擎对同一份未剔的名单会拒启用 —— 14.4.0 加这两个名单起就是这样,逐元素抢救自 12.3.0,`test/skill-tool-lists-14.4.0.test.ts` 的 🚧 钉已登记)。
|
|
86
|
+
本版不翻 `skills` 的原因:线上 skills 清单的读法是本包里单列的一臂(`readSkillsManifest`),**不读 `DOMAIN_ENTRY_SALVAGE`** —— 只翻表行会形成新的双源(域读腿 `none`、wire 腿仍 `salvage`)。
|
|
87
|
+
24.0.0 把这一臂改成问表、`skills` 改判 `"none"`,并随纯值名单抢救律的收口(名单里有坏元素 ⇒ 整条技能被丢)一起收掉上面两条;一致性语料里带 skills 的金样届时一并重新加冕。
|
|
88
|
+
- **`mcp` / `a2a`**:条目被丢后名字不再被部署占位 —— server 把「部署声明过的名字」对请求侧注入关闭,本包逐条丢掉的条目对 server 不可见,名字因此可被请求侧同名补上;
|
|
89
|
+
仅在请求侧注入被放行的车道上成立(单用户 host 车道、未锁),那里的调用方就是运维本人,没有越过主体边界(`a2a` 在 server 里本来只占已挂载对端的名字)。判 P3,留 `salvage`。
|
|
90
|
+
- **`models`**:`roles` 里一个角色覆盖被丢后,该角色回落到缺省模型 —— 选路变了,不是工具 / 授权的可达面;留 `salvage`。
|
|
91
|
+
|
|
92
|
+
### 钉
|
|
93
|
+
|
|
94
|
+
`test/tightening-domains-23.0.0.test.ts`(16 格:`scenarios` 带未知键 ⇒ 条目照装 + `unknown-keys-dropped`,四条读口同读 · `scenarios` 不合 schema ⇒ 整域读不进、读档 throw(parseDomainSalvaged / buildEffective / readEffectiveWire / loadLocalConfig 都抛),三条读口同读 ·
|
|
95
|
+
`plugins` 两格 · 读档两格(`scenarios` / `plugins` 坏条目 ⇒ `loadLocalConfig` 抛,红先:改前读出空域)与读档表钉 · 负控:`models` 条目带未知键仍丢、坏形仍丢 · 表的闭集钉(salvage 八域 / none 九域)与「十七行每行带判注」钉)· 随表翻面的老格逐格注明 23.0.0:`entry-unknown-key-22.0.0`(none 档名单)· `projects-12.3.0`(逐域设计表与 none 档负控各多 `scenarios` / `plugins` 一行)· `private-key-anywhere-10.0.0`(插件源里已有私钥串:由「丢那一条」变「plugins 读档 throw,拒句不带私钥体」)。
|
|
96
|
+
变异:把 `scenarios` 改回 `"salvage"` ⇒ ①② 与闭集钉红;把 `plugins` 改回 `"salvage"` ⇒ plugins 两格与闭集钉红;把 `scenarios` / `plugins` 的读档改回 `"default"` ⇒ 读档格与 ② ④ 的抛格红;删掉(或写错档)任一行的判注 ⇒ 判注钉红。
|
|
97
|
+
|
|
98
|
+
**自 v22.0.0 起运行期代码有改动的公开导出(机器重算;上界 —— 可达 ≠ 一定变,不可达 ⇒ 一定不变;本版新增的导出不入表)**
|
|
99
|
+
|
|
100
|
+
```text
|
|
101
|
+
DOMAIN_ENTRY_SALVAGE [., ./config-fns]
|
|
102
|
+
DOMAIN_READ_FALLBACK [., ./config-fns]
|
|
103
|
+
FileConfigStore [./node]
|
|
104
|
+
buildEffective [., ./config-fns]
|
|
105
|
+
emptyEffective [., ./config-fns]
|
|
106
|
+
loadLocalConfig [./node]
|
|
107
|
+
parseDomainSalvaged [., ./config-fns]
|
|
108
|
+
planEnvModelTableWrite [.]
|
|
109
|
+
readEffectiveWire [., ./config-fns]
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
读数真变的是视图面那一组(`buildEffective` / `parseDomainSalvaged` / `readEffectiveWire` / `FileConfigStore` 的生效读 / `loadLocalConfig` / `planEnvModelTableWrite` 的候选视图)与 `DOMAIN_ENTRY_SALVAGE` / `DOMAIN_READ_FALLBACK` 的各两行值;
|
|
113
|
+
`emptyEffective`(空文档上没有条目)是可达性上界:JSON 文档上读数逐字不变。
|
|
114
|
+
|
|
11
115
|
## 22.0.0 — 2026-11-06 — major:逐条丢弃域里**条目体内带未知键的条目**自此整条丢(新词 `entry-unknown-key`;此前剥键照装)· `salvageEntries` 第三个参数 `domain` 必填
|
|
12
116
|
|
|
13
117
|
> 档位(按发版纪律):**major** —— 校验收紧(同一份文档在视图面读出的生效配置会变:带未知键的条目由「剥键照装」变「整条丢」)· 闭集加词(`DroppedEntryReasonCode` 尾插 `entry-unknown-key`)· 公开函数签名不加性(`salvageEntries` 多一个必填参数)。
|
package/README.md
CHANGED
|
@@ -47,11 +47,17 @@ 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
|
+
## 升级指引:22.0.x → 23.0.0(BREAKING:`scenarios` / `plugins` 移出逐条丢弃集 —— 条目缺席会放宽的域,坏形条目自此整域读不进、读档 throw,不再只丢那一条)
|
|
51
|
+
|
|
52
|
+
一处**不加性**的边(这两个域的读法;十域判定表、三问与逐条细节见 CHANGELOG 23.0.0):`DOMAIN_ENTRY_SALVAGE` 里 `scenarios`(条目覆盖内建场景名,缺席 ⇒ 同名内建复活)与 `plugins`(来源引用承运 hooks 守卫,缺席 ⇒ 守卫缺席)由 `"salvage"` 改 `"none"`:
|
|
53
|
+
这两个域里一条坏形条目 ⇒ 整域读不进(`parseDomainSalvaged` 抛),同时 `DOMAIN_READ_FALLBACK` 里这两个域由 `"default"` 改 `"throw"`:`buildEffective` / `readEffectiveWire` / `loadLocalConfig` 都**抛**,不再读出空域 + `domain-defaulted`(空 `scenarios` = 内建场景全部回位,空 `plugins` = hooks 守卫全缺席,都不是 fail-closed);条目体内的未知键回到剥键 + `unknown-keys-dropped`,读方对它仍要当拒绝信号。**读盘 / 起服的调用点要有这一类抛的处置**(经引擎本地读腿读盘的 cli 一侧、client-core 点名:二者自己的码不直接读这两个域,见 CHANGELOG 消费方表)。
|
|
54
|
+
另外八个逐条丢弃域(`models` `skills` `mcp` `systems` `collab` `hosts` `projects` `a2a`)一字不变;出路:删掉(或改对)那条坏条目 / 那个未知键,不配一次性迁移。各消费方读点见 `docs/CONSUMER-INTEGRATION.md`:§21 末「23.0.0 起」段。
|
|
55
|
+
|
|
50
56
|
## 升级指引:21.0.x → 22.0.0(BREAKING:逐条丢弃域里条目体内带未知键的条目自此整条丢 —— 新词 `entry-unknown-key`;`salvageEntries` 第三个参数 `domain` 必填)
|
|
51
57
|
|
|
52
58
|
两处**不加性**的边(读法收紧 · 公开函数签名),外加闭集加词(三问与逐条细节见 CHANGELOG 22.0.0):
|
|
53
59
|
|
|
54
|
-
1. **带未知键的条目整条丢**(视图面:`buildEffective` / `parseDomainSalvaged` / `readEffectiveWire` / `FileConfigStore` 的生效读 / `loadLocalConfig`):在逐条丢弃域(`DOMAIN_ENTRY_SALVAGE` 判 `"salvage"`:`models` `skills` `mcp` `plugins` `scenarios` `systems` `collab` `hosts` `projects` `a2a`,外加线上的 skills
|
|
60
|
+
1. **带未知键的条目整条丢**(视图面:`buildEffective` / `parseDomainSalvaged` / `readEffectiveWire` / `FileConfigStore` 的生效读 / `loadLocalConfig`):在逐条丢弃域(`DOMAIN_ENTRY_SALVAGE` 判 `"salvage"`:`models` `skills` `mcp` `plugins` `scenarios` `systems` `collab` `hosts` `projects` `a2a`,外加线上的 skills 清单;**23.0.0 起 `plugins` / `scenarios` 不在其中**,见上一节)里,
|
|
55
61
|
一条条目(数组元素 / Record 值,递归到条目体内的嵌套集合)体内有键被 schema 剥掉 ⇒ 它是坏条目:丢它自己、`entry-dropped` 点名(坐标 · 身份 · `reasonCode: "entry-unknown-key"`;`error` 里每个持键层一条 `unrecognized_keys`,坐标相对条目)、其余条目照常。
|
|
56
62
|
`EXTENSION_NAMESPACES` 登记的键不算(models 条目上壳写的 `sema*`)。
|
|
57
63
|
- **读数变化(不加性)**:此前剥键照装 + `unknown-keys-dropped` 点名条目体内的坐标;自此那一条不装,条目体内的键不再出现在 `unknown-keys-dropped` 里(一事一告警)。
|
package/conformance/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
23.0.0
|
package/dist/config-fns.d.ts
CHANGED
|
@@ -551,8 +551,12 @@ export declare function parseDomainSalvaged<K extends DomainName>(domain: K, raw
|
|
|
551
551
|
* `"throw"` = keep fail-loud (defaulting would LOOSEN gates or destructively apply — worse than an outage,
|
|
552
552
|
* consumers fail-static on last-good). A `satisfies Record<DomainName,…>` forces every FUTURE domain to make
|
|
553
553
|
* this call explicitly (compile error until it's classified). Per-domain rationale:
|
|
554
|
-
* - models/skills/mcp/
|
|
554
|
+
* - models/skills/mcp/systems/collab: additive capability catalogs — empty = the
|
|
555
555
|
* capability disappears (fail-closed), no gate is lost.
|
|
556
|
+
* - scenarios: THROW (23.0.0) — an empty `scenarios` revives every built-in scenario an entry overrode, widening the tool surface of each;
|
|
557
|
+
* defaulting would hand that to every reader that has no candidate gate. {@link DOMAIN_ENTRY_SALVAGE} judges the domain `"none"` for the same
|
|
558
|
+
* reason, and a `"none"` domain that then defaulted would be the same loosening one level up (one bad entry ⇒ ALL overrides gone).
|
|
559
|
+
* - plugins: THROW (23.0.0) — an empty `plugins` drops the hooks (guards among them) the references carried; same reasoning as `scenarios`.
|
|
556
560
|
* - hosts: empty host registry = no auto-placement targets (availability-only); self-registration re-lands
|
|
557
561
|
* entries as approved:false = 待批 (fail-closed).
|
|
558
562
|
* - rosters: THROW — a lost roster makes resolveEffectiveForWorker fall back to the FULL models catalog
|
|
@@ -576,8 +580,8 @@ export declare const DOMAIN_READ_FALLBACK: {
|
|
|
576
580
|
readonly rosters: "throw";
|
|
577
581
|
readonly skills: "default";
|
|
578
582
|
readonly mcp: "default";
|
|
579
|
-
readonly plugins: "
|
|
580
|
-
readonly scenarios: "
|
|
583
|
+
readonly plugins: "throw";
|
|
584
|
+
readonly scenarios: "throw";
|
|
581
585
|
readonly systems: "default";
|
|
582
586
|
readonly collab: "default";
|
|
583
587
|
readonly workers: "throw";
|
|
@@ -601,6 +605,7 @@ export declare const DOMAIN_READ_FALLBACK: {
|
|
|
601
605
|
* (domain top level, a top-level plain object field) is still stripped and named (`unknown-keys-dropped`).
|
|
602
606
|
* `"none"` = never drop a single entry: the first bad entry makes the whole domain unreadable. An unknown key inside an entry of such a
|
|
603
607
|
* domain is stripped and named, as before 22.0.0 — those domains drop nothing, so the strip warning is the reader's signal.
|
|
608
|
+
* (23.0.0: `scenarios` and `plugins` joined the seven — their entries' absence widens; see the judgment below.)
|
|
604
609
|
* A `satisfies Record<DomainName,…>` forces every FUTURE domain to answer this explicitly (compile error until classified).
|
|
605
610
|
*
|
|
606
611
|
* **View face only.** The document face never salvages: `parseDomain` / `validateDomain` / `writeDomainFile` judge the whole
|
|
@@ -609,12 +614,22 @@ export declare const DOMAIN_READ_FALLBACK: {
|
|
|
609
614
|
* it back would turn every dropped entry into a deletion — read-modify-write faces read the stored document with the document face.
|
|
610
615
|
*
|
|
611
616
|
* Per-domain rationale:
|
|
612
|
-
* -
|
|
617
|
+
* - **The judgment (23.0.0)**: `"salvage"` is for a domain whose entry's ABSENCE can only NARROW what is reachable. A domain whose entry's
|
|
618
|
+
* absence WIDENS — the entry is a restriction, a guard, or an override of a built-in of the same name (its absence revives the built-in) — is `"none"`:
|
|
619
|
+
* dropping the entry would be the same loosening as stripping its key. The judgment is written on the row (a trailing comment, closed set: a new
|
|
620
|
+
* domain adds its row AND its judgment).
|
|
621
|
+
* - models/skills/mcp/systems/collab: capability / content catalogs and grants — a dropped entry is
|
|
613
622
|
* one capability gone (fail-closed). Inside a surviving entry the same holds: the nested collections these entries carry
|
|
614
623
|
* are allowlists / scopings (`allowTools`, `scenarios`, `rosters`, `callsWorkers`, …) where one entry fewer only NARROWS,
|
|
615
624
|
* and the zero-survivor law (never mint an empty collection — several of these read "empty = all") holds at every level.
|
|
625
|
+
* - scenarios: NONE (23.0.0) — an entry names the tool surface of a scenario, and may carry the name of a built-in scenario (then it OVERRIDES
|
|
626
|
+
* it, narrowing its tool surface). A dropped entry revives the built-in with its wider surface: the loosening 22.0.0's rule made out of a
|
|
627
|
+
* misspelt or forward-looking key.
|
|
628
|
+
* - plugins: NONE (23.0.0) — an entry is the source reference of an executable surface (commands / hooks / MCP); its hooks may be guards
|
|
629
|
+
* (`PreToolUse` / `PermissionRequest`, see `./hooks-config`). A dropped reference takes the guard with it.
|
|
616
630
|
* - hosts: a dropped host is one placement target fewer; a dropped label makes a host match fewer `placement.requires`.
|
|
617
|
-
* - projects: SALVAGE — a registration absent from the ledger
|
|
631
|
+
* - projects: SALVAGE — a registration absent from the ledger is one project fewer (the pinned consumer reads a lookup miss as "no
|
|
632
|
+
* default-scope seed", not as a refused admission: the ledger is an additive registry, not a gate). Throwing the
|
|
618
633
|
* whole domain stops EVERY project of the scope, which protects nothing: one stored registration that a later, tighter
|
|
619
634
|
* schema refuses (12.2.1's UNC judgement on `contextItems[].value`) must not take the scope's other projects with it.
|
|
620
635
|
* Its whenUnreadable stance stays `"throw"` (a ledger that cannot be read at all is never defaulted — see
|
|
@@ -639,8 +654,8 @@ export declare const DOMAIN_ENTRY_SALVAGE: {
|
|
|
639
654
|
readonly rosters: "none";
|
|
640
655
|
readonly skills: "salvage";
|
|
641
656
|
readonly mcp: "salvage";
|
|
642
|
-
readonly plugins: "
|
|
643
|
-
readonly scenarios: "
|
|
657
|
+
readonly plugins: "none";
|
|
658
|
+
readonly scenarios: "none";
|
|
644
659
|
readonly systems: "salvage";
|
|
645
660
|
readonly collab: "salvage";
|
|
646
661
|
readonly workers: "none";
|
package/dist/config-fns.js
CHANGED
|
@@ -1176,8 +1176,12 @@ function announceUnknownKeys(domain, raw, parsed, emit) {
|
|
|
1176
1176
|
* `"throw"` = keep fail-loud (defaulting would LOOSEN gates or destructively apply — worse than an outage,
|
|
1177
1177
|
* consumers fail-static on last-good). A `satisfies Record<DomainName,…>` forces every FUTURE domain to make
|
|
1178
1178
|
* this call explicitly (compile error until it's classified). Per-domain rationale:
|
|
1179
|
-
* - models/skills/mcp/
|
|
1179
|
+
* - models/skills/mcp/systems/collab: additive capability catalogs — empty = the
|
|
1180
1180
|
* capability disappears (fail-closed), no gate is lost.
|
|
1181
|
+
* - scenarios: THROW (23.0.0) — an empty `scenarios` revives every built-in scenario an entry overrode, widening the tool surface of each;
|
|
1182
|
+
* defaulting would hand that to every reader that has no candidate gate. {@link DOMAIN_ENTRY_SALVAGE} judges the domain `"none"` for the same
|
|
1183
|
+
* reason, and a `"none"` domain that then defaulted would be the same loosening one level up (one bad entry ⇒ ALL overrides gone).
|
|
1184
|
+
* - plugins: THROW (23.0.0) — an empty `plugins` drops the hooks (guards among them) the references carried; same reasoning as `scenarios`.
|
|
1181
1185
|
* - hosts: empty host registry = no auto-placement targets (availability-only); self-registration re-lands
|
|
1182
1186
|
* entries as approved:false = 待批 (fail-closed).
|
|
1183
1187
|
* - rosters: THROW — a lost roster makes resolveEffectiveForWorker fall back to the FULL models catalog
|
|
@@ -1201,8 +1205,8 @@ export const DOMAIN_READ_FALLBACK = {
|
|
|
1201
1205
|
rosters: "throw",
|
|
1202
1206
|
skills: "default",
|
|
1203
1207
|
mcp: "default",
|
|
1204
|
-
plugins: "
|
|
1205
|
-
scenarios: "
|
|
1208
|
+
plugins: "throw", // 23.0.0:空 plugins = 引用承运的 hooks(守卫)全缺席,不是 fail-closed;与 DOMAIN_ENTRY_SALVAGE 的 none 同一理由
|
|
1209
|
+
scenarios: "throw", // 23.0.0:空 scenarios = 覆盖过的内建场景全部回位(更宽的工具面),不是 fail-closed;与 DOMAIN_ENTRY_SALVAGE 的 none 同一理由
|
|
1206
1210
|
systems: "default",
|
|
1207
1211
|
collab: "default",
|
|
1208
1212
|
workers: "throw",
|
|
@@ -1211,7 +1215,7 @@ export const DOMAIN_READ_FALLBACK = {
|
|
|
1211
1215
|
entitlement: "throw",
|
|
1212
1216
|
execution: "throw",
|
|
1213
1217
|
projects: "throw",
|
|
1214
|
-
// prompts:内容域
|
|
1218
|
+
// prompts:内容域 ——坏形→空默认 `{}`(=「不管提示词」:不下发中心层,引擎用内置);fail-closed 由 PUBLISH_MODE
|
|
1215
1219
|
// 发布闸承担,default 不扩权。14.0.0 起墓碑键(`bindings` / `catalog`)也走这一档(读不出 ⇒ 缺省 + domain-defaulted 点名 SS-M10)。
|
|
1216
1220
|
prompts: "default",
|
|
1217
1221
|
// limits(0.19.0):THROW —— 本域是成本 / 限流天花板的唯一发布位(11.0.0 起 runtime 域retired)。坏形
|
|
@@ -1232,6 +1236,7 @@ export const DOMAIN_READ_FALLBACK = {
|
|
|
1232
1236
|
* (domain top level, a top-level plain object field) is still stripped and named (`unknown-keys-dropped`).
|
|
1233
1237
|
* `"none"` = never drop a single entry: the first bad entry makes the whole domain unreadable. An unknown key inside an entry of such a
|
|
1234
1238
|
* domain is stripped and named, as before 22.0.0 — those domains drop nothing, so the strip warning is the reader's signal.
|
|
1239
|
+
* (23.0.0: `scenarios` and `plugins` joined the seven — their entries' absence widens; see the judgment below.)
|
|
1235
1240
|
* A `satisfies Record<DomainName,…>` forces every FUTURE domain to answer this explicitly (compile error until classified).
|
|
1236
1241
|
*
|
|
1237
1242
|
* **View face only.** The document face never salvages: `parseDomain` / `validateDomain` / `writeDomainFile` judge the whole
|
|
@@ -1240,12 +1245,22 @@ export const DOMAIN_READ_FALLBACK = {
|
|
|
1240
1245
|
* it back would turn every dropped entry into a deletion — read-modify-write faces read the stored document with the document face.
|
|
1241
1246
|
*
|
|
1242
1247
|
* Per-domain rationale:
|
|
1243
|
-
* -
|
|
1248
|
+
* - **The judgment (23.0.0)**: `"salvage"` is for a domain whose entry's ABSENCE can only NARROW what is reachable. A domain whose entry's
|
|
1249
|
+
* absence WIDENS — the entry is a restriction, a guard, or an override of a built-in of the same name (its absence revives the built-in) — is `"none"`:
|
|
1250
|
+
* dropping the entry would be the same loosening as stripping its key. The judgment is written on the row (a trailing comment, closed set: a new
|
|
1251
|
+
* domain adds its row AND its judgment).
|
|
1252
|
+
* - models/skills/mcp/systems/collab: capability / content catalogs and grants — a dropped entry is
|
|
1244
1253
|
* one capability gone (fail-closed). Inside a surviving entry the same holds: the nested collections these entries carry
|
|
1245
1254
|
* are allowlists / scopings (`allowTools`, `scenarios`, `rosters`, `callsWorkers`, …) where one entry fewer only NARROWS,
|
|
1246
1255
|
* and the zero-survivor law (never mint an empty collection — several of these read "empty = all") holds at every level.
|
|
1256
|
+
* - scenarios: NONE (23.0.0) — an entry names the tool surface of a scenario, and may carry the name of a built-in scenario (then it OVERRIDES
|
|
1257
|
+
* it, narrowing its tool surface). A dropped entry revives the built-in with its wider surface: the loosening 22.0.0's rule made out of a
|
|
1258
|
+
* misspelt or forward-looking key.
|
|
1259
|
+
* - plugins: NONE (23.0.0) — an entry is the source reference of an executable surface (commands / hooks / MCP); its hooks may be guards
|
|
1260
|
+
* (`PreToolUse` / `PermissionRequest`, see `./hooks-config`). A dropped reference takes the guard with it.
|
|
1247
1261
|
* - hosts: a dropped host is one placement target fewer; a dropped label makes a host match fewer `placement.requires`.
|
|
1248
|
-
* - projects: SALVAGE — a registration absent from the ledger
|
|
1262
|
+
* - projects: SALVAGE — a registration absent from the ledger is one project fewer (the pinned consumer reads a lookup miss as "no
|
|
1263
|
+
* default-scope seed", not as a refused admission: the ledger is an additive registry, not a gate). Throwing the
|
|
1249
1264
|
* whole domain stops EVERY project of the scope, which protects nothing: one stored registration that a later, tighter
|
|
1250
1265
|
* schema refuses (12.2.1's UNC judgement on `contextItems[].value`) must not take the scope's other projects with it.
|
|
1251
1266
|
* Its whenUnreadable stance stays `"throw"` (a ledger that cannot be read at all is never defaulted — see
|
|
@@ -1266,23 +1281,23 @@ export const DOMAIN_READ_FALLBACK = {
|
|
|
1266
1281
|
* credential references (`headerRefs`) are in {@link ATOMIC_SALVAGE}: a bad reference drops the whole peer, never the reference
|
|
1267
1282
|
* alone (a peer kept with half of its credentials is the wrong failure direction). */
|
|
1268
1283
|
export const DOMAIN_ENTRY_SALVAGE = {
|
|
1269
|
-
models: "salvage",
|
|
1270
|
-
rosters: "none",
|
|
1271
|
-
skills: "salvage",
|
|
1272
|
-
mcp: "salvage",
|
|
1273
|
-
plugins: "
|
|
1274
|
-
scenarios: "
|
|
1275
|
-
systems: "salvage",
|
|
1276
|
-
collab: "salvage",
|
|
1277
|
-
workers: "none",
|
|
1278
|
-
hosts: "salvage",
|
|
1279
|
-
governance: "none",
|
|
1280
|
-
entitlement: "none",
|
|
1281
|
-
execution: "none",
|
|
1282
|
-
projects: "salvage",
|
|
1283
|
-
prompts: "none",
|
|
1284
|
-
limits: "none",
|
|
1285
|
-
a2a: "salvage",
|
|
1284
|
+
models: "salvage", // 留:条目 = 一个目录模型(及 `roles` 里的一个角色覆盖);缺席 = 少一个模型 / 一个角色回落到缺省 —— 选路变了,可达面没变(被引用的模型缺席 ⇒ 引用悬空 ⇒ 整域缺省,既有律)
|
|
1285
|
+
rosters: "none", // 收:条目 = 一台 worker 的模型名册;缺席 ⇒ 该 worker 回落到整份目录 = 放宽
|
|
1286
|
+
skills: "salvage", // 留:条目 = 一份下发的技能(含它的工具 allow / deny 名单);缺席 = 少一份技能 —— 已知缺口:同名出厂技能回位、deny 名单坏元素被逐元素剔,收口承诺见 CHANGELOG 已知限制与收口承诺
|
|
1287
|
+
mcp: "salvage", // 留:条目 = 一台工具源;缺席 = 该台不挂载 —— 已知缺口:名字不再被部署占位(请求侧同名注入只在放开的单用户车道),见 CHANGELOG 已知限制
|
|
1288
|
+
plugins: "none", // 收:条目 = 可执行面的来源引用,hooks(含 PreToolUse / PermissionRequest 守卫)随引用走;缺席 = 守卫缺席 = 放宽
|
|
1289
|
+
scenarios: "none", // 收:条目 = 覆盖内建场景名的工具面声明;缺席 = 同名内建(更宽的工具面)复活 = 放宽
|
|
1290
|
+
systems: "salvage", // 留:条目 = 一个外部系统的凭据与可调 worker 名单(授权);缺席 = 少一份授权
|
|
1291
|
+
collab: "salvage", // 留:条目 = 一个协作模板(预算闸随模板走);缺席 = 少一个可选模板,已有的闸一个不松
|
|
1292
|
+
workers: "none", // 收:条目 = 一台 worker 的声明;缺席 = 「不再声明」,对账器会把它撤下(破坏性),它的名册绑定也一并消失
|
|
1293
|
+
hosts: "salvage", // 留:条目 = 一个排布目标;缺席 = 少一个目标(待批 / drain / 停用的条目缺席同样不可排)
|
|
1294
|
+
governance: "none", // 收:条目 = 命令策略行 / 审批要求;缺席 = 护栏静默消失 = 放宽
|
|
1295
|
+
entitlement: "none", // 收:条目 = 档 / 主体 / 绑定 / 预算组;缺席 = 谁能做什么变了(限制、配额、预算成员随条目走)
|
|
1296
|
+
execution: "none", // 收:条目 = 执行车道 / 公钥登记;缺席 = 执行授权的面变了
|
|
1297
|
+
projects: "salvage", // 留:条目 = 一条项目登记(加性登记簿,不是准入门);缺席 = 少一份默认记忆 scope 的种子(消费方查表 miss 不 fail)
|
|
1298
|
+
prompts: "none", // 收:条目受 digest 约束;缺席 = digest 不再成立,或范围文本替换掉某台 worker 的 artifact(是替换不是收窄)
|
|
1299
|
+
limits: "none", // 收:条目 = 已发布上限的一行;缺席 = 发布的天花板变了(本域是这些上限的唯一发布位)
|
|
1300
|
+
a2a: "salvage", // 留:条目 = 一个出站对端;缺席 = 少一个对端(凭据引用整体原子,见 ATOMIC_SALVAGE;名字占位同 mcp,见 CHANGELOG 已知限制)
|
|
1286
1301
|
};
|
|
1287
1302
|
/**
|
|
1288
1303
|
* Merge every domain into the effective config a consumer pulls. Shared by all store impls.
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
> **20.0.0** 的 hook 条目余下四个 CC 键(`rewakeMessage` / `rewakeSummary` / `cloud` / `continueOnBlock`)与词闭集 `HOOK_CLOUD_WORDS` 同在 §18;**20.0.0** 的目录条目 `thinkingLevelMap`(词表 `MODEL_THINKING_LEVEL_WORDS`)与运行期导出 `HOOK_ENTRY_FIELDS` 在 §19;**20.0.0** 的线上读口承运表 `WIRE_CARRIED_DOMAINS`(`EffectiveWire.a2a` 可选:缺席不再补空名册)在 §20。
|
|
17
17
|
> **21.0.0** 的墓碑表 `RETIRED_ENVS` 加 `LSP_ENABLED`(`removed` 族:设了即拒,写闸收紧;出路 = 撤掉它,host 车道的开关是另一个键 `LSP_HOST_ENABLED`)同在 §17 末「21.0.0 起」段。
|
|
18
18
|
> **22.0.0** 的逐条丢弃域里条目体内带未知键的条目整条丢(新词 `entry-unknown-key`;此前剥键照装)与 `salvageEntries` 必填的第三个参数 `domain` 在 §21。
|
|
19
|
+
> **23.0.0** 的 `scenarios` / `plugins` 移出逐条丢弃集(条目缺席会放宽的域:坏形条目整域读不进,条目体内的未知键回到剥键 + 点名)在 §21 末「23.0.0 起」段。
|
|
19
20
|
|
|
20
21
|
---
|
|
21
22
|
|
|
@@ -744,7 +745,7 @@ fleet 成员对中心公告的可达地址(`FLEET_ADVERTISE_ADDRESS`,中心往
|
|
|
744
745
|
零幸存者 ⇒ 整域档位(`DOMAIN_READ_FALLBACK`;`projects` 抛),被引用的那一条 ⇒ 引用悬空 ⇒ 整域退缺省。持键层不在条目体内的未知键照旧 `unknown-keys-dropped`。
|
|
745
746
|
- **一事一告警**:条目体内的未知键只经 `entry-dropped` 说一次;`unknown-keys-dropped` 里只剩条目外的坐标。别再从 `unknown-keys-dropped` 的坐标里推「哪一条坏了」—— 那件事由 `entry-dropped` 回答。
|
|
746
747
|
- **`error`**:被丢条目的 `error` 是脱敏的 `ZodError`,每个持键层一条 `unrecognized_keys` issue(坐标相对条目,`keys` 点名被剥的键,秘密形 / 超长的键名是 `[redacted-secret]`)。要给人看「哪个键」读它;机读的「为什么」读 `reasonCode`。
|
|
747
|
-
-
|
|
748
|
+
- **不在本律内**:不逐条丢的域(22.0.0 时是七个;23.0.0 起另有 `scenarios` / `plugins`,见本节末)(条目体内的未知键照旧剥键 + 点名);文档面(写入席、导出、读改写的「现状」—— 照旧剥键受理,一条条目都不丢);承运(`.passthrough()`)的键。
|
|
748
749
|
- **`salvageEntries(schema, raw, domain)`**:第三个参数必填(哪个域的扩展命名空间生效);不是域名 ⇒ `TypeError`。
|
|
749
750
|
|
|
750
751
|
| 消费方 | 读点 | 动作 |
|
|
@@ -754,3 +755,15 @@ fleet 成员对中心公告的可达地址(`FLEET_ADVERTISE_ADDRESS`,中心往
|
|
|
754
755
|
| cli | 目录尾注的原因词表(开集:表外词渲 `unknown reason`)· 读 `droppedEntries` 的形 | 形不变;可选补 `entry-unknown-key` 的屏上话。壳写在 models 条目上的 `sema*` 是登记的扩展命名空间,不受影响 |
|
|
755
756
|
| web-admin | 诊断口直接调 `salvageEntries(DOMAIN_SCHEMAS.projects, raw)` · 读 `droppedEntries` / `entry-dropped` 的形 | 形不变;两参调用编译红 —— 补 `"projects"`。补上之后诊断与视图面同读:带未知键的登记以 `entry-unknown-key` 列出;零幸存者时一条不丢,照旧落到「整份读不进」那一臂 |
|
|
756
757
|
| client-core | 原样消费告警 / 目录读口 | 无编译改动;多一个会出现的词 |
|
|
758
|
+
|
|
759
|
+
**23.0.0 起(`scenarios` / `plugins` 移出逐条丢弃集)**:上面的律只对 `DOMAIN_ENTRY_SALVAGE` 判 `"salvage"` 的八个域成立(`models` `skills` `mcp` `systems` `collab` `hosts` `projects` `a2a`)。
|
|
760
|
+
`DOMAIN_ENTRY_SALVAGE` 只许「条目缺席只会收窄可达面」的域取 `"salvage"`;`scenarios`(条目覆盖内建场景名、收窄工具面,丢条目 = 同名内建复活)与 `plugins`(来源引用承运可执行面,其中 hooks 可以是守卫,丢引用 = 守卫缺席)条目缺席会放宽,判 `"none"`。判注逐行写在表里。
|
|
761
|
+
|
|
762
|
+
- **这两个域的读法**:条目不合 schema ⇒ 整域读不进(`parseDomainSalvaged` 抛,零 `entry-dropped`);**读档 `DOMAIN_READ_FALLBACK` 是 `"throw"`**(23.0.0 起,此前 `"default"`)⇒ `buildEffective` / `readEffectiveWire` / `FileConfigStore.getEffective` / `loadLocalConfig` 都抛;条目体内的未知键 ⇒ 条目照装、键被剥、`unknown-keys-dropped` 点名(与七个老 `"none"` 域同形)。
|
|
763
|
+
- **读方要做的**:空 `scenarios` / 空 `plugins` 不是 fail-closed —— 前者让内建场景全部回位,后者让引用承运的 hooks 一并缺席,所以这两个域整域读不进时**抛**而不是读出空域。读盘 / 起服的调用点要有这一类抛的处置(`governance` 等 throw 档域的坏形本来就走同一条处置)。`unknown-keys-dropped` 对这两个域仍是**拒绝信号**:该拒这份候选、保住上一份好配置,而不是把剥过键的条目应用上去。
|
|
764
|
+
|
|
765
|
+
| 消费方 | 读点 | 动作 |
|
|
766
|
+
|---|---|---|
|
|
767
|
+
| server | 读档 throw ⇒ 远端 `readEffectiveWire` / 本地读腿整包抛、调用方整包 catch 回落 env / 上一份好配置(与 `governance` 同形);`unknown-keys-dropped` 折进候选门(`scope: "domain"`);`entry-dropped` 的目录载体只收 `models` | 读侧零码改(两张表在本包);提货后补三格钉:`scenarios` 条目带未知键 ⇒ 候选被拒、内建场景不复活 · `scenarios` / `plugins` 条目坏形 ⇒ 读抛、不是空域 · `models` 条目带未知键 ⇒ 仍条目丢 |
|
|
768
|
+
| sdk / web-admin | 不读这两张表 | 零改动;行为变更点名:`scenarios` / `plugins` 条目坏 ⇒ 该域整域读不进、读档 throw |
|
|
769
|
+
| cli / client-core | 对 `buildEffective` / `loadLocalConfig` / `readEffectiveWire` 没有直接调用(逐处 grep 核过:cli 只直接读 `parseDomainSalvaged`(models)与 `readConfigDFileReadingSync`(collab));生效配置由引擎本地读腿(`FileConfigStore`)读 | **点名 cli、client-core**:零代码改动;经引擎本地读腿读这两个域的路径从「空域 + `domain-defaulted`」变成**抛**,起本机引擎前自查 `config.d/scenarios.json` / `plugins.json` |
|
package/llms-full.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
llms-full.txt — 自包含全文 · 消费方(使用者)视角 · @sema-agent/settings-schema
|
|
3
|
-
重写日期: 2026-11-06 | 包版本:
|
|
3
|
+
重写日期: 2026-11-06 | 包版本: 23.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 等常驻门钉住)。无证据推断显式标【推断】。
|
|
@@ -191,7 +191,7 @@ registry:公网 npmjs,无需私有 registry 配置。
|
|
|
191
191
|
两侧剥掉它 —— 旧版铸不出,不计旧版行为红;10.1.0 起另带 `reasonCode?` = 为什么丢的机读闭集词(`DROPPED_ENTRY_REASON_CODES`:
|
|
192
192
|
`entry-schema-invalid` 条目 / Record 值没过自己的 schema · `entry-key-invalid` Record 键没过键 schema · `entry-unreadable`
|
|
193
193
|
判的过程抛了 · `entry-unknown-key` 条目体内有键被剥(22.0.0:逐条丢弃域的视图面里,**条目好坏一条判据** = 过自己的 schema 且体内没有键被剥,
|
|
194
|
-
带未知键的条目整条丢、不再剥键照装;条目外的未知键照旧 `unknown-keys-dropped
|
|
194
|
+
带未知键的条目整条丢、不再剥键照装;条目外的未知键照旧 `unknown-keys-dropped`;九个不逐条丢的域(七个老 none 域 + 23.0.0 起的 `scenarios` / `plugins`)与文档面不变。**收紧域不逐条丢**(23.0.0):`DOMAIN_ENTRY_SALVAGE` 只许「条目缺席只会收窄可达面」的域取 `salvage`;条目缺席会放宽的域 —— `scenarios`(条目覆盖内建场景名,丢条目 = 内建复活)与 `plugins`(来源引用承运 hooks 守卫,丢引用 = 守卫缺席)—— 取 `none`:坏形条目 ⇒ 整域读不进(这两域的读档 `DOMAIN_READ_FALLBACK` 也判 `throw`,不读出空域),条目体内的未知键 ⇒ 剥键 + `unknown-keys-dropped`;判注逐行写在表里。);词与丢弃点一一对应、无 other 兜底;本包铸的每条都带,键可选只为不让手工构造该联合的消费方编译红;`DroppedEntry.reasonCode`
|
|
195
195
|
同源;同样进投影、同样被 historical 归一器剥掉))。(11.0.0:读侧两只兼容臂的告警 `legacy-governance-lifted` / `hosts-grandfathered`
|
|
196
196
|
随臂删,闭集五员 —— 旧形由 `./one-time-migrations` 的一次性迁移改写,读侧遇旧形响亮拒。)未知键告警的 `keys` 有界(告警载荷上界),超界时带 `truncatedFrom` =
|
|
197
197
|
截断前的真实总数;背后的两只扫描 11.0.0 起模块私有,公开原语只有 `parseDomainLoud`(上界本身也私有)。告警的 `kind` 闭集 `WARNING_KINDS` 与**派生**投影
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
3
|
-
重写日期: 2026-11-06 | 包版本:
|
|
3
|
+
重写日期: 2026-11-06 | 包版本: 23.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 相等、
|
|
@@ -39,7 +39,8 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
39
39
|
`parseDomainLoud`:写入席、导出、`getDomain`)永不抢救;视图面(`parseDomainSalvaged` / `buildEffective`)按表抢救 —— 两函数共用同一只内部体
|
|
40
40
|
(严 parse + 未知键告警),条目体内没有未知键的文档上逐字同值同告警。抢救按 schema 递归到幸存条目体内的集合(坐标以父路径为前缀:
|
|
41
41
|
`["projects", <id>, "contextItems", 1]`;零幸存者律每层成立)。**条目好坏一条判据**(22.0.0):过自己的 schema 且体内没有键被剥(扩展命名空间的键不算)——
|
|
42
|
-
逐条丢弃域的视图面里带未知键的条目整条丢(`entry-unknown-key`,不再剥键照装),条目外的未知键照旧 `unknown-keys-dropped
|
|
42
|
+
逐条丢弃域的视图面里带未知键的条目整条丢(`entry-unknown-key`,不再剥键照装),条目外的未知键照旧 `unknown-keys-dropped`;九个不逐条丢的域(七个老 none 域 + 23.0.0 起的 `scenarios` / `plugins`)与文档面不变。
|
|
43
|
+
**收紧域不逐条丢**(23.0.0):`DOMAIN_ENTRY_SALVAGE` 只许「条目缺席只会收窄可达面」的域取 `salvage`;条目缺席会放宽的域 —— `scenarios`(条目覆盖内建场景名,丢条目 = 内建复活)与 `plugins`(来源引用承运 hooks 守卫,丢引用 = 守卫缺席)—— 取 `none`:坏形条目 ⇒ 整域读不进(这两域的读档 `DOMAIN_READ_FALLBACK` 也判 `throw`,不读出空域),条目体内的未知键 ⇒ 剥键 + `unknown-keys-dropped`;判注逐行写在表里。
|
|
43
44
|
`salvageEntries(schema, raw, domain)` 第三参数必填。(src/config-fns.ts: `salvageEntries` / `parseDomainSalvaged` / `DOMAIN_ENTRY_SALVAGE`)
|
|
44
45
|
- **告警坐标是结构化段**(3.0.0 BREAKING):`ConfigPath = readonly (string | number)[]` —— 字符串段 = 对象键
|
|
45
46
|
(逐字,含 `.` 也逐字),数字段 = 数组下标。点号串是有损编码(字面叫 `models.1.k` 的顶层键与 `models[1].k`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/settings-schema",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.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",
|