@sema-agent/settings-schema 30.0.0 → 30.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 CHANGED
@@ -8,6 +8,106 @@
8
8
 
9
9
  ## Unreleased
10
10
 
11
+ ## 30.1.0 — 2026-11-17 — minor:层准入表 `SAFETY_MERGE_SPEC` 尾插整段类目 `webSearch`(联网搜索设置段)—— 没被信任的工作区自己带的设置文件(项目层 / 本地层)里的这一段整段不参与,准入与 `mcpServers` / `hooks` 同形(整键、地板 project)
12
+
13
+ > 档位(按发版纪律):**minor** —— 「新键 / 新导出 / 词表加词 = minor」:公开表 `SAFETY_MERGE_SPEC` **尾插**一键 `webSearch`,`SafetyMergeCategory` 的联合尾上随之多一员;30.0.0 的 18 个类目的行与次序一字不动;其余闭集(`MIN_TRUST_WORDS` · `TIGHTEN_VERDICTS` · `LAYER_ADMISSION_VERDICTS` · `SETTINGS_SOURCES` · `MemberDirection` · `SETTINGS_UNITS`)不动;导出只增不删(包根新增这一段的键常量 `WEB_SEARCH_SECTION_KEYS` 与它的型 `WebSearchSectionKey`,见「导出面」);判官 `layerAdmission` 的代码不动。
14
+ > 先例:14.2.0 尾插 `killSwitches`,同判 minor。对 `SafetyMergeCategory` 写穷举(`Record<SafetyMergeCategory, …>` / 带 `never` 兜底的 `switch`)或钉表尾次序的消费方提货本版红一次(补一臂 / 改一行)—— 提货成本,不是 major。
15
+ > 另有一形**不是**编译红:用 JS、或用 `Partial<Record<SafetyMergeCategory, …>>` 写自己的表,再遍历 `Object.keys(SAFETY_MERGE_SPEC)` 去查自己表的消费方,会在**运行期**遇到一个自己表里没有的类目 `webSearch`(查出 `undefined`,tsc 不报)。补法:遍历自己的表,或先核自己的表认得表上的每个类目。发版纪律里尾插的例外只点了编译红;这一形这里如实写出。**复审异议留档**:发版复审的两条腿都指出,发版纪律的两句对这一形字面上相撞 ——「能让按上一版契约写的消费方在运行期变红 ⇒ major」与「新键 / 词表加词 / 枚举尾插新词 = minor」;其中一条腿按前一句读,认为本版应判 major。本版按后一句发(它点名的就是尾插这一种改动);纪律条文把「遍历词表的消费方在运行期遇到新词」这一形写进去的改写另立票,在下一个大版本落。
16
+
17
+ ### 病
18
+
19
+ 联网搜索设置段 `webSearch`(选供应方、端点、钥匙引用、结果条数等;段**里面**的键与形不由本包定义)决定检索请求发往哪里。层准入表上没有它的行:`layerAdmission(…, "webSearch")` 抛 RangeError(未知类目)。于是「一个没被信任的工作区自己带的设置文件,能不能把联网搜索指到别的地址」没有上游答案 —— 读这张表的宿主要么自己判(各写一份 = 两个读者答同一个问题,答案可以不同),要么不判(取优先级最高的那一层的整段:工作区的项目层压过用户层,检索词随之发到工作区指定的地址)。
20
+
21
+ ### 律(一条)
22
+
23
+ **一行,不是一组特例**:同为「把请求指向别处」的段 —— `mcpServers`(服务器地址)、`hooks`(http 钩子地址)—— 在表上是整键类目、地板 `project`;联网搜索段在准入上同形(合并形与失败方向各按自己的:三行彼此本来就不同)。判官的律不变(地板先判;仓库可控层在工作区读数不是 `accepted` 时只收 `direction: "tighten"` 的成员;写给另一个工具的项目层只读收紧方向),这一行的答全由它推出,本版不加判官代码。
24
+
25
+ ### 行
26
+
27
+ ```ts
28
+ webSearch: {
29
+ mergeShape: "replace", minTrust: "project", tighten: { rule: "none" }, enforcement: "resolver", fail: "closed",
30
+ seam: "settings.webSearch (one section, taken whole from one layer) → request settings.webSearch",
31
+ },
32
+ ```
33
+
34
+ (源码里 `seam` 的两处键读自 `WEB_SEARCH_SECTION_KEYS`,值就是上面这一串。)
35
+
36
+ `layerAdmission(源, 工作区读数, "webSearch")` 的答(由现行律推出,逐格与 `mcpServers` / `hooks` 同):
37
+
38
+ | 源 \ 工作区读数 | `accepted` | `declined` | `no_trust_step` |
39
+ |---|---|---|---|
40
+ | `userSettings` · `flagSettings` · `policySettings` | `admitted` | `admitted` | `admitted` |
41
+ | `projectSettings` · `localSettings` | `admitted` | `trust_withheld` | `trust_withheld` |
42
+ | `foreignProjectSettings` | `tighten_only` | `tighten_only` | `tighten_only` |
43
+
44
+ - **整段**(`replace`,不拆成员):一层的段整段取用,不由两层拼成 —— 段里写的端点与钥匙引用出自同一层(宿主再到哪里取钥匙是宿主的契约,不是这一行的)。没被准入的一层整段不参与,不与别的层合并;生效的是准入的各层里优先级最高的那一层的段。
45
+ - **地板 `project`**:与 `mcpServers` / `hooks` 一致;受信工作区的项目层 / 本地层照常可写。
46
+ - **失败即关**(`fail: "closed"`):段里有钥匙引用,而表头只给非秘密键的类目开 fail-open。
47
+ - **不带 `coreAxis`**:值域不是引擎的。
48
+ - **不进 `SETTINGS_UNITS`**:单元行要一个读法词,而本包没有这一段的形读法,把它收进本包是另一个设计问题;问准入按类目名整段问。两处源码头注(`src/safety-merge-spec.ts` · `src/settings-units.ts`)由「http 钩子名单是唯一例外」改为举例点名这两段(不是全部清单:表上还有别的行没有单元)。
49
+ - **键常量 `WEB_SEARCH_SECTION_KEYS`**(新,包根;模块 `src/web-search-section.ts`):这一段在设置文档里的键 = `["webSearch"]`,深冻结,与另两份不在单元表里的契约的键常量 `HTTP_HOOK_ALLOWLIST_KEYS` / `MCP_SERVER_LIST_KEYS` 同形。每把键也是管它的类目名,读者拿键直接问 `layerAdmission`,不另记「键 → 类目」。按「单元表 + 表外键常量」给每个设置键标本包归属的读者加读这一只,`webSearch` 才标得出来;单元表头注那一段改成指向它(与 http 钩子那段同一种说法:要这一段的键就读这只常量,不读单元表)。这把键在本包 `src/` 的代码行里有两处拼写:这只常量,和层准入表上的类目名(表键;两者同名由钉 P1 / P7 绑住,不是结构上的保证);`seam` 读常量。把表键也改成读常量另立票(下一版)。三份表外契约要不要并进单元表是 30.0.0 就有的设计题,不在本版。
50
+ - **逐键不取**(非指向性的键 —— 例如结果条数 —— 在未受信层照常参与):现行律里未受信的仓库层唯一的放行口是 `direction: "tighten"`,条数不是收紧,写成 tighten 就是数据说错;成员行的值类只有 `boolPole` / `list` 两种,数值成员没有值类(`resolveMemberTighten` 对它抛);一段由两层拼成也正是「端点出自一层、钥匙出自另一层」的那种形。代价如实写在三问里。
51
+ - **`seam` 一格只说本包掌握的事**:设置文档里的这一段整段取自一层 → 请求面那一段。服务端拿请求里的这一段做什么(怎么判形、在哪种部署上由它造检索后端)是服务端的行为,不写进本包的行 —— 写在 `docs/CONSUMER-INTEGRATION.md` §37,标明以服务端的文书为准;服务端改了它,本包这一行不会跟着变假。
52
+ - **`env` 块那一问不在本版**:用户层 `env` 块里联网搜索钥匙槽的名字随宿主注进引擎进程环境 —— 要挡,但不在层准入表里挡(层准入答「哪一层可信到能写」,用户层本来就全信任;问题是钥匙进错了进程),挡在宿主组引擎进程环境的那一处(桌面 / 终端各一处,归各自的仓);本包不加表、不加行。
53
+
54
+ ### 导出面
55
+
56
+ - **新增导出**(包根,不开子路径):`WEB_SEARCH_SECTION_KEYS`(值)· `WebSearchSectionKey`(型);`docs/API-SURFACE.md` 随之重生成。**删除**:无。
57
+ - **类型面**:`SafetyMergeCategory` 的联合尾上多一员 `"webSearch"`;`SafetyMergeMember<"webSearch">` 是 `never`(按成员问它 = 编译错)。
58
+ - **运行期读数变**:`SAFETY_MERGE_SPEC` 表尾多一键;`layerAdmission(源, 读数, "webSearch")` 由抛 RangeError 变成答上表;`membersOf("webSearch")` 由抛变 `[]`;`memberAdmission` / `memberMinTrust` / `memberTighten` 以 `"webSearch"` 加任何成员名问、与带成员名的 `layerAdmission` 仍抛,句子由「unknown category」变成「has no member-level admission」;两处「unknown category」拒句里列出的类目名单尾上多 `webSearch`。其余导出对既有输入的答案逐位不变。
59
+
60
+ ### 三问
61
+
62
+ - **谁需要**:读层准入表的消费方 —— client-core(共用库入口取联网搜索段)、cli(终端在壳里自判这一段 —— 读自终端源码,未跑;有了这一行,壳与共用库可以读同一处)、web-admin(读这张表的管理面);以及在没被信任的工作区里用联网搜索的人(消费方按这一行取段之后,工作区自己带的设置文件不能再把检索词改送到别的地址;这一行本身不改变任何宿主的行为)。
63
+ - **谁受伤**:靠工作区设置文件(项目层 / 本地层)改检索端点或供应方的既有用法 —— 消费方按这一行取段之后,工作区没被信任时整段不生效(连结果条数也不生效);没有信任步骤的宿主(读数 `no_trust_step`)上,项目层 / 本地层的这一段一直不生效。对 `SafetyMergeCategory` 写穷举或钉表尾次序的消费方提货红一次。
64
+ - **补偿**:信任这个工作区(读数变 `accepted` 即恢复),或把这段设置放到用户层。被挡掉的这一段是那一层没读的一处写入,按本包现成那条单行披露(码 `settings.layer_parts_unread`,铸点 `buildLayerPartsUnreadNotice`)的契约并进它的未读名单 —— 是现成那一条,不是新通告;设置的生效视图里放判官的原词(`trust_withheld` / `tighten_only`)作哪一层没被采用的机读成因。这一段的地板是 `project`,没有哪个源低于它,所以每一处被挡都出自「只读收紧方向」的层,都进那一行。
65
+
66
+ ### 各消费方
67
+
68
+ | 消费方 | 读点 | 动作 |
69
+ |---|---|---|
70
+ | client-core | 联网搜索判决取段的那一处(取优先级最高那一层的整段,不问层准入)· 构建期从本包抄来的层准入表〔读自共用库源码,未跑〕 | 请托的读法(共用库的排期,本包不验证):开发依赖抬到本版、重生成抄本;取段改成「写了段且 `layerAdmission(层, 读数, "webSearch") === "admitted"` 的优先级最高那一层」,没被准入的层整段不参与、判官原词进机读成因;钥匙槽仍只读赢的那一层自己的;取这一段时的键改读 `WEB_SEARCH_SECTION_KEYS`(今天共用库里手写 `'webSearch'` 两处〔读自共用库本机工作树的源码,未跑〕) |
71
+ | cli | 壳里「工作区未受信时整段不收工作区两源」的那道闸 · 设置手册投影里「按单元表 + 表外键常量标本包归属」的那张常量清单(今天只列 `HTTP_HOOK_ALLOWLIST_KEYS` / `MCP_SERVER_LIST_KEYS`)〔都读自终端源码,未跑〕 | 请托的读法:共用库按这一行取段、并把赢的那一层交给取钥匙的回调(或仓库可控层赢时不调它)之后,壳闸可退,与共用库读同一处;这一行不进 `SETTINGS_UNITS`,单元投影零编译面;常量清单加 `WEB_SEARCH_SECTION_KEYS` 一行,`webSearch` 才不被标成没有归属 |
72
+ | web-admin | 钉表尾次序的测试(`httpHookAllowlists` 之后只有 `killSwitches`)〔读自管理面工作树的测试,未跑〕 | 提货即红 = 通知:改判「之后再多 `webSearch`」;产品码若有对 `SafetyMergeCategory` 的穷举映射,补一行 |
73
+ | server | 产品码不穷举类目〔读自服务端主干的源码,未跑〕;服务端拿请求里这一段做什么见 `docs/CONSUMER-INTEGRATION.md` §37(以服务端的文书为准) | 零产品码改动 |
74
+ | sdk | 契约套件 | 零代码改动;符合性语料不变 |
75
+ | test | 黑盒判据 | 见下「黑盒判据」 |
76
+
77
+ ### 黑盒判据(从包的导出面可执行,不引用内部实现)
78
+
79
+ - **G1 行**:`SAFETY_MERGE_SPEC.webSearch` 深等于上面那一行(六个键,没有 `coreAxis` / `members`);`Object.keys(SAFETY_MERGE_SPEC)` 恰是 30.0.0 的 18 个类目同序、尾上再加 `"webSearch"`;`MergeCategorySpec.safeParse(SAFETY_MERGE_SPEC.webSearch).success` 为真。
80
+ - **G2 判官**:`layerAdmission(源, 读数, "webSearch")` 对六个源 × 三种读数逐格等于上表,且逐格等于 `layerAdmission(源, 读数, "mcpServers")`。
81
+ - **G3 没有成员问法**:`membersOf("webSearch")` 是 `[]`;`layerAdmission("projectSettings", "declined", "webSearch", "maxResults")` 抛 RangeError,句中含 `has no member-level admission`。
82
+ - **G4 不进单元表**:`SETTINGS_UNITS` 仍是十行,没有一行的 `category` 是 `"webSearch"`。
83
+ - **G5 其余不动**:30.0.0 的 18 行逐字深等于 v30.0.0 的同名行;`MIN_TRUST_WORDS` / `TIGHTEN_VERDICTS` / `LAYER_ADMISSION_VERDICTS` / `SETTINGS_SOURCES` 与 v30.0.0 同。
84
+ - **G6 键常量**:包根导出 `WEB_SEARCH_SECTION_KEYS`,深等于 `["webSearch"]`,`Object.isFrozen` 为真、`push` 抛 `TypeError`;它的每一把键 `k` 都满足 `Object.hasOwn(SAFETY_MERGE_SPEC, k)`。
85
+ - **G7 被挡掉的段进现成那条披露**:`buildLayerPartsUnreadNotice({ source: "projectSettings", workspace: "declined", file: "f", parts: ["webSearch"] }).line` 是 `f: read for restrictions only (this workspace is not trusted) — not read: webSearch`;`source` 换成 `foreignProjectSettings`(任一读数)时括号里是 `it is written for another tool`;对六个源 × 三种读数,`layerAdmission(源, 读数, "webSearch")` 从不答 `below_trust_floor`。
86
+
87
+ ### 钉
88
+
89
+ `test/web-search-admission-30.1.0.test.ts`(22 格 · P1 行形逐字〔期望字面是抄写的,不从实现派生;严格相等 + 键集恰六键,值为 undefined 的多余键也红〕· 无成员、成员型是 `never` · `webSearch` 紧跟在 `killSwitches` 之后(只钉相邻;整张表的键序只由 `kill-switches-14.2.0` 一处钉;这只文件里那一格的标题仍写「表尾」,随下一版改)· `seam` 以键常量的键开头、不出现服务端的词 · P2 项目 / 本地层 × 未受信的两种读数 ⇒ `trust_withheld` · P3 受信 ⇒ `admitted`、用户 / flag / 托管层 × 三种读数 ⇒ `admitted` · P4 按成员问抛「没有成员级准入」、写给另一个工具的层 ⇒ `tighten_only` · P5 六个源 × 三种读数与 `mcpServers` / `hooks` 逐格同答 · P6 不进单元表 · P7 键常量:值〔抄写〕/ 包根导出 / 深冻结 · 与另两只表外键常量同形且互不相交 · 每把键都是类目名(类型上也是:拿键直接问 `layerAdmission` 才过编译)· 照终端设置手册投影那种「单元表 + 表外键常量」的读法标得出 `webSearch`(只读另两只常量时标不出)· src 的代码行里这把键作为串字面只写在 `src/web-search-section.ts` 一处(扫的是引号里的字面与 `settings.webSearch`;表键那一处拼写不在这一格的扫描里)· P8 每个不准入这一段的源 × 读数都是「只读收紧方向」的层、现成铸点 `buildLayerPartsUnreadNotice` 收下并点名这一段、没有低于地板的答 · D 文书:本节〔在 30.0.0 之上、minor、三问三格、`env` 一句、键常量、披露那一句不再说「不需要新的通告」、档位段的运行期那一句、不带服务端那半句〕· 两处源码头注(单元表头注指向键常量)· README 安全合并表一条与升级指引的运行期那一句 · 两份 llms · 消费接入档 §37 的消费方行、键常量、披露、服务端那半句〔标明以服务端的文书为准〕)。
90
+ 随表改的既有钉:`kill-switches-14.2.0`(「`killSwitches` 是最后一个」改判「其后只多 `webSearch`」,它之前的类目序一格不动)。`safety-merge-spec` 的冻结 1.0.0 / 1.1.0 schema 两只循环不改、自动覆盖这一行(尾插的类目经 1.1.0 schema 原样读出)。
91
+ 红先(第一稿):只放这份新钉的第一稿(14 格)、源码还是 30.0.0 的读数时,14 格里 13 格红(红因 = `layerAdmission(…, "webSearch")` 抛「unknown category」),1 格同绿(P6:30.0.0 的单元表本来就没有它);`kill-switches-14.2.0` 的表尾那一格红。
92
+ 红先(复审之后的修:键常量 · `seam` 只留本包的半句 · 新钉只钉表尾两员 · 披露与档位两句):改好的钉放到修之前的源码与文书上,21 格里 10 格红(P1 行形与 `seam` 两格 · P7 四格 · P8 · D 三格;红因 = 键常量不存在 / `seam` 还带服务端那半句 / 文书还没有那几句),11 格同绿(其中「表尾两员」修之前就成立);之后补的「代码行里这把键只写在一处」一格由下面的变异「`seam` 改回手写字面」证红。
93
+ 变异(24 刀,每刀都红、存活 0;第一遍 23 刀全红,复审补出一刀 —— 行上加 `coreAxis: undefined` 在宽松相等下存活,P1 改成严格相等 + 键集之后同一刀转红):地板改 `session`(只有 P1 行形格红 —— 所以行形必须钉字面)/ `global` / `managed` / `task`(`task` 由 `safety-merge-spec` 的冻结 1.0.0 与 1.1.0 两格逮)· 加成员 `maxResults` · 合并形改 `overrideByName` · `fail` 改 `open` · `seam` 改成「只有单用户车道」· 加 `coreAxis` · 行挪到 `killSwitches` 之前 · 删行 · 判官去掉「读数不是 accepted」的条件 / 去掉「仓库可控」的条件 / 把 `no_trust_step` 读成 accepted · 单元表加一行 `webSearch` · 头注写回「唯一例外」/ 单元表头注不点名 `webSearch` · 本节三问去掉补偿 / 去掉 `env` 一句 / 节头档位改 major · §37 少 web-admin 行 · README 安全合并表一条不点名 · `llms.txt` 不点名。
94
+ 修的那一轮另 14 刀,每刀都红、存活 0:行挪到表中间(新钉的表尾格与 `kill-switches-14.2.0` 的表尾格同红)· 键常量的值改成 `web_search` · 键常量不冻结 · 包根不导出键常量 · `seam` 写回服务端那半句 · `seam` 改回手写字面(值不变,只有「只写在一处」那一格红)· 地板改 `global`(被挡的写入落到那条披露之外,P8 红)· 单元表头注不再指向键常量 · §37 写回「不需要新的通告」/ 去掉「以服务端的文书为准」· README 升级指引 / 本节档位段去掉运行期那一句 · 本节不点名键常量 · 本节三问的补偿格写回旧句。
95
+
96
+ **自 v30.0.0 起运行期代码有改动的公开导出(机器重算;上界 —— 可达 ≠ 一定变,不可达 ⇒ 一定不变;本版新增的导出不入表)**
97
+
98
+ ```text
99
+ SAFETY_MERGE_SPEC [., ./safety-merge-spec]
100
+ httpHookEnvVarsAllowed [.]
101
+ httpHookUrlVerdict [.]
102
+ layerAdmission [.]
103
+ memberAdmission [., ./safety-merge-spec]
104
+ memberMinTrust [., ./safety-merge-spec]
105
+ memberTighten [., ./safety-merge-spec]
106
+ membersOf [., ./safety-merge-spec]
107
+ readSettingsUnit [.]
108
+ unitTighten [.]
109
+ ```
110
+
11
111
  ## 30.0.0 — 2026-11-17 — major:到期删码一次性迁移 SS-M10(prompts 两轴 `bindings` / `catalog`;窗 2026-11-16 已关)—— 闭集 `ONE_TIME_MIGRATION_IDS` / `OneTimeMigrationId` 收窄、迁移步删、存量旧形写面拒且读面整域缺省并点名(不再有迁移替它改写)· 读腿告警 `unread-config-file` 的原因词 `non-portable-domain` 改名 `not-a-local-read-domain`(闭集里一员的字面换了)
12
112
 
13
113
  > 本节三条。
package/README.md CHANGED
@@ -49,6 +49,14 @@ only (`node:crypto`, `node:fs`). The machine gate is `test/runtime-dependencies-
49
49
  > zod 3, nested inside every zod-4 host). The move to zod 4 did not change what any schema accepts or produces —
50
50
  > the conformance corpus reads byte-identically on both — only the wording of validation errors (see CHANGELOG 11.0.0).
51
51
 
52
+ ## 升级指引:30.0.x → 30.1.0(minor,加性:层准入表 `SAFETY_MERGE_SPEC` 尾插整段类目 `webSearch`(联网搜索设置段))
53
+
54
+ 只在表尾多一行,已有 18 行与次序一字不动;导出只增不删(包根加这一段的键常量 `WEB_SEARCH_SECTION_KEYS` 与型 `WebSearchSectionKey`)—— 不读这张表的消费方零动作可升(行、判官答表、三问、各消费方表见 CHANGELOG 30.1.0 与 `docs/CONSUMER-INTEGRATION.md` §37)。
55
+ 1. **这一行**:整键类目、地板 `project`、`replace`(一层的段整段取用)、`fail: "closed"`、没有成员 —— 准入与 `mcpServers` / `hooks` 同形(整键、地板 project;合并形与失败方向各按自己的)。`layerAdmission(源, 读数, "webSearch")`:项目层 / 本地层在读数不是 `accepted` 时 `trust_withheld`(整段不参与,连结果条数也不读),受信时 `admitted`;用户 / flag / 托管层 `admitted`;写给另一个工具的项目层 `tighten_only`。
56
+ 2. **取联网搜索段的消费方**:按这一行取段 —— 写了段且被准入的层里优先级最高的那一层的整段生效,没被准入的层整段不参与(不与别的层合并)。工作区没被信任时靠项目层 / 本地层配搜索的用户,补偿是信任这个工作区或把段放到用户层。
57
+ 3. **动作**:对 `SafetyMergeCategory` 写穷举(`Record<SafetyMergeCategory, …>` / 带 `never` 兜底的 `switch`)或钉表尾次序的地方**红一次**(提货成本,不是 major):补一臂 / 改一行。另有一形不是编译红:用 JS、或用 `Partial<Record<…>>` 写自己的表,再遍历 `Object.keys(SAFETY_MERGE_SPEC)` 去查它的消费方,会在**运行期**遇到一个自己表里没有的类目 `webSearch`(查出 `undefined`,tsc 不报)—— 遍历自己的表,或先核自己的表认得表上的每个类目。
58
+ 4. **这一段的键**:读 `WEB_SEARCH_SECTION_KEYS`(今天 = `["webSearch"]`,与类目名同字),不自己写字面;按「单元表 + 表外键常量」给设置键标本包归属的读者,把它与 `HTTP_HOOK_ALLOWLIST_KEYS` / `MCP_SERVER_LIST_KEYS` 并列加进常量清单。被挡掉的这一段并进现成那条单行披露(`buildLayerPartsUnreadNotice`)的未读名单,不是新通告。
59
+
52
60
  ## 升级指引:29.0.x → 30.0.0(BREAKING:一次性迁移 SS-M10〔prompts 两轴 `bindings` / `catalog`〕窗关删码 · 闭集 `ONE_TIME_MIGRATION_IDS` / `OneTimeMigrationId` 收窄 · 读腿告警 `unread-config-file` 的原因词 `non-portable-domain` 改名 `not-a-local-read-domain`)
53
61
 
54
62
  存储文档里没有 `prompts.bindings` / `prompts.catalog`、代码里也不引用 id `"SS-M10"`(闭集收窄:引用它的代码编译红,第 4 条)、也不按字面比较或穷举读腿告警 `unread-config-file` 的 `why`(第 5 条)的部署,零动作可升(读数详情、三问、各消费方表与黑盒判据见 CHANGELOG 30.0.0 与 `docs/CONSUMER-INTEGRATION.md` §35 / §36)。
@@ -680,6 +688,16 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
680
688
  query sits at the row floor `global`, and the merge is boolStricter (one layer's ON beats every layer's OFF). The table has no managed-only floor
681
689
  for them (`permissionMode`'s seam no longer says so): a consumer that stamped one locally retires it onto this row, so its judge and its
682
690
  resolver read the same row.
691
+ **30.1.0** appends the web search section's row, `webSearch` (the section picks where searches go — provider, endpoint, key
692
+ reference): a whole-key category at the `project` floor, `replace` (one layer's section is taken whole, never assembled from two layers),
693
+ `fail: "closed"`, no members — admitted the same way as `mcpServers` / `hooks` (whole key, `project` floor; the merge shape and fail
694
+ mode are each row's own). `layerAdmission(source, workspace, "webSearch")` answers from
695
+ the existing law: a project / local layer in a workspace that is not `accepted` ⇒ `trust_withheld` (the whole section does not take part;
696
+ accepting the workspace, or moving the section to the user layer, restores it — a result count in that layer is not read either);
697
+ accepted ⇒ `admitted`; user / flag / policy ⇒ `admitted`; another tool's project files ⇒ `tighten_only`. It is not a `SETTINGS_UNITS` row
698
+ (this package has no reading of the section's shape); the section's settings-document key is published as `WEB_SEARCH_SECTION_KEYS`
699
+ (`["webSearch"]`, the same shape as `HTTP_HOOK_ALLOWLIST_KEYS` / `MCP_SERVER_LIST_KEYS`; each key is also its category's name). The row
700
+ changes no host by itself: a consumer that picks the section has to ask `layerAdmission` for it.
683
701
  The ladder's words are a runtime value, the pure-data table `MIN_TRUST_WORDS` (`["local", "session", "project", "global", "managed", "task"]`): `MinTrust` (the
684
702
  zod enum) is derived from it, and `trustRank` / `isAtLeast` read nothing else — apart from the JavaScript built-ins `RangeError` / `String`, the body of
685
703
  `trustRank` names `MIN_TRUST_WORDS` and `isAtLeast` names `trustRank`, so a consumer that copies the pair whole (a closure with no import, only globals
@@ -1 +1 @@
1
- 30.0.0
1
+ 30.1.0
package/dist/index.d.ts CHANGED
@@ -45,6 +45,7 @@ export * from "./settings-sources.js";
45
45
  export * from "./url-pattern.js";
46
46
  export * from "./http-hook-allowlists.js";
47
47
  export * from "./mcp-server-policy.js";
48
+ export * from "./web-search-section.js";
48
49
  export * from "./ui-language.js";
49
50
  export * from "./control-and-bidi.js";
50
51
  export * from "./mcp-request-entry.js";
package/dist/index.js CHANGED
@@ -45,6 +45,7 @@ export * from "./settings-sources.js"; // settings SOURCES (merge order) + SETTI
45
45
  export * from "./url-pattern.js"; // 13.0.0 (S-1597): THE URL-list pattern judge, two exits — urlAllowPatternMatches (⊆ upstream g9, four holes closed) / urlDenyPatternMatches (⊇ upstream ∪ whole-string glob), pure/browser-safe
46
46
  export * from "./http-hook-allowlists.js"; // 13.0.0 (U3): allowedHttpHookUrls / httpHookAllowedEnvVars — one layer reader + httpHookUrlVerdict / httpHookEnvVarsAllowed (admitted layers INTERSECT; SAFETY_MERGE_SPEC.httpHookAllowlists), pure/browser-safe
47
47
  export * from "./mcp-server-policy.js"; // 13.0.0 (U6): mcpServerPolicyVerdict → McpPolicyBlock{name, list, rule, target, written, sources} (structure, no sentence; target judged expanded, echoed only as written), pure/browser-safe
48
+ export * from "./web-search-section.js"; // 30.1.0: WEB_SEARCH_SECTION_KEYS — the web search section's settings-document key (each key is also its category's name: SAFETY_MERGE_SPEC.webSearch), pure/browser-safe
48
49
  export * from "./ui-language.js"; // 13.0.0 (S-1592): the UI-language settings fragment (semaUiLanguage, en | zh, category ui, user settings) + readUiLanguage, pure/browser-safe
49
50
  export * from "./control-and-bidi.js"; // the one-line echo strip set (C0 + DEL + the 12 Bidi_Control code points) — CONTROL_AND_BIDI_CHARS (the class, as regex source text) + stripControlAndBidi / hasControlOrBidi, pure/browser-safe
50
51
  export * from "./mcp-request-entry.js"; // 14.0.0: the request-plane MCP entry judges (isUsableWireName / isContentOriginWord / readRequestMcpTransport + the value-shape describers; 29.0.0: the request keys it refuses by name, MCP_REQUEST_KEY_REFUSALS) — one reading for the service legs and the shell pre-check, pure/browser-safe
@@ -7,9 +7,10 @@
7
7
  * import). The settings-document UNIT table — which keys of a settings file carry a merge contract, where each sits,
8
8
  * which category below it maps into, and how its raw value reads — is published by this package too, as
9
9
  * `SETTINGS_UNITS` (`./settings-units.ts`, 14.6.0): a consumer reads it instead of keeping a key→category map of its
10
- * own for those ten units (the http-hook allowlist keys are the one exception: `./http-hook-allowlists` keys and reads them
11
- * itself, with its own malformed-value reading — see the `./settings-units` header). THIS file is the category spec every unit
12
- * cites — no second copy of the law.
10
+ * own for those ten units. Not every row here has a unit: for example the http-hook allowlist keys (`./http-hook-allowlists` keys and
11
+ * reads them itself, with its own malformed-value reading) and the `webSearch` section (30.1.0; its key is published by
12
+ * `./web-search-section` as `WEB_SEARCH_SECTION_KEYS`, and this package has no reading of its shape) — see the `./settings-units`
13
+ * header. THIS file is the category spec every unit cites — no second copy of the law.
13
14
  *
14
15
  * Per-category behavior is fully determined by `mergeShape` + `minTrust` + `tighten` + `enforcement` + `fail` — and,
15
16
  * for a MEMBERIZED category (one that declares `members`, 1.1.0), by its member rows: each member's own floor and
@@ -649,6 +650,16 @@ export declare const SAFETY_MERGE_SPEC: {
649
650
  };
650
651
  };
651
652
  };
653
+ readonly webSearch: {
654
+ readonly mergeShape: "replace";
655
+ readonly minTrust: "project";
656
+ readonly tighten: {
657
+ readonly rule: "none";
658
+ };
659
+ readonly enforcement: "resolver";
660
+ readonly fail: "closed";
661
+ readonly seam: "settings.webSearch (one section, taken whole from one layer) → request settings.webSearch";
662
+ };
652
663
  };
653
664
  export type SafetyMergeCategory = keyof typeof SAFETY_MERGE_SPEC;
654
665
  /** The members a category declares, as a CLOSED SET TYPE: `"allow" | "deny" | "ask"` for `permissions`, `never` for
@@ -7,9 +7,10 @@
7
7
  * import). The settings-document UNIT table — which keys of a settings file carry a merge contract, where each sits,
8
8
  * which category below it maps into, and how its raw value reads — is published by this package too, as
9
9
  * `SETTINGS_UNITS` (`./settings-units.ts`, 14.6.0): a consumer reads it instead of keeping a key→category map of its
10
- * own for those ten units (the http-hook allowlist keys are the one exception: `./http-hook-allowlists` keys and reads them
11
- * itself, with its own malformed-value reading — see the `./settings-units` header). THIS file is the category spec every unit
12
- * cites — no second copy of the law.
10
+ * own for those ten units. Not every row here has a unit: for example the http-hook allowlist keys (`./http-hook-allowlists` keys and
11
+ * reads them itself, with its own malformed-value reading) and the `webSearch` section (30.1.0; its key is published by
12
+ * `./web-search-section` as `WEB_SEARCH_SECTION_KEYS`, and this package has no reading of its shape) — see the `./settings-units`
13
+ * header. THIS file is the category spec every unit cites — no second copy of the law.
13
14
  *
14
15
  * Per-category behavior is fully determined by `mergeShape` + `minTrust` + `tighten` + `enforcement` + `fail` — and,
15
16
  * for a MEMBERIZED category (one that declares `members`, 1.1.0), by its member rows: each member's own floor and
@@ -69,6 +70,7 @@ import { MAX_HASH_DEPTH, stableStringify } from "./hash.js";
69
70
  import { captureStringArray, dataDescriptor, isAccessorDescriptor, isolatedObject } from "./own-key-read.js";
70
71
  import { jsonShapeOf } from "./plain-json-object.js";
71
72
  import { deepFreeze } from "./deep-freeze.js";
73
+ import { WEB_SEARCH_SECTION_KEYS } from "./web-search-section.js";
72
74
  /** How values from different layers/principals combine for a category. */
73
75
  export const MergeShape = z.enum(["denyFirst", "replace", "runAll", "overrideByName", "concat"]);
74
76
  /** The trust-tier VOCABULARY as a RUNTIME VALUE — the ONE source of the ladder's words, in the same form as
@@ -460,6 +462,25 @@ export const SAFETY_MERGE_SPEC = deepFreeze({
460
462
  disableAutoMode: { direction: "tighten", minTrust: "global", boolPole: { strict: true, minTrust: "local" } },
461
463
  },
462
464
  },
465
+ // 30.1.0 — the web search section `webSearch` (provider / endpoint / key reference / result count / instance parameters). It points
466
+ // searches somewhere else, the same kind of key as `mcpServers` (server addresses) and `hooks` (http hook URLs), so it is admitted the same
467
+ // way: a WHOLE-KEY category at the project floor — no members, no direction (its merge shape and fail mode are its own, below; theirs
468
+ // differ from each other too). What `layerAdmission` answers follows from the existing law
469
+ // with no new code: a repository layer (project / local) in a workspace that is not `accepted` ⇒ `trust_withheld` (the whole section does
470
+ // not take part; accepting the workspace admits it); accepted ⇒ `admitted`; user / flag / policy ⇒ `admitted`; another tool's project files
471
+ // ⇒ `tighten_only`. `replace`: one layer's section is taken whole, never assembled from two layers (the endpoint and the key reference written
472
+ // in it come from that one layer; where a host then looks the key up is that host's contract, not this row's). `fail: "closed"`: the section
473
+ // carries a key reference (the header above limits fail-open to non-secret keys).
474
+ // DELIBERATELY not per-key (a harmless key such as the result count admitted from an untrusted layer): an untrusted repository layer's one
475
+ // admission outlet is `direction: "tighten"`, a result count is not a tightening, and a member row has no numeric value class.
476
+ // No `coreAxis` (the value domain is not the engine's). Not in `SETTINGS_UNITS` (see that file's "NOT in this table"); the section's
477
+ // settings-document key is `WEB_SEARCH_SECTION_KEYS` (`./web-search-section`), and the seam reads it from there. The seam says only what
478
+ // this package holds — where the section comes from and where it lands; what a consumer of the request then does with it is that
479
+ // consumer's contract, documented on its side.
480
+ webSearch: {
481
+ mergeShape: "replace", minTrust: "project", tighten: { rule: "none" }, enforcement: "resolver", fail: "closed",
482
+ seam: `settings.${WEB_SEARCH_SECTION_KEYS[0]} (one section, taken whole from one layer) → request settings.${WEB_SEARCH_SECTION_KEYS[0]}`,
483
+ },
463
484
  });
464
485
  /** Own-property table lookup. The category union is compile-time only; a JavaScript or deserialized caller can
465
486
  * hand in `"__proto__"` / `"constructor"` / `"toString"`, which a bare index resolves through Object.prototype
@@ -11,6 +11,10 @@
11
11
  * `malformed` mark (the failure direction is "no hook may run"), while a unit reading answers `unreadable`. Folding the two tables
12
12
  * into one is a design question (which reading is right), not a drive-by — until it is settled a consumer that wants the allowlist
13
13
  * layers reads that module, not this table.
14
+ * Nor the web search section (30.1.0, the `webSearch` category of {@link SAFETY_MERGE_SPEC}): a unit row needs a reading word, and this
15
+ * package has no reading of the section's shape — taking one in is a design question of its own, not a drive-by. Its key is published by
16
+ * `./web-search-section` (`WEB_SEARCH_SECTION_KEYS`); a consumer that wants the section's key reads that constant, not this table, and asks
17
+ * admission about the section whole, by that key — it is also the category name (`layerAdmission(source, workspace, "webSearch")`).
14
18
  *
15
19
  * How a unit is addressed (`reads`):
16
20
  * · `whole` — the unit's value is one value under its category: compared by the category's `tighten`
@@ -0,0 +1,3 @@
1
+ /** The section's key in a settings document (closed set, top level; each key is also its category's name in `SAFETY_MERGE_SPEC`). */
2
+ export declare const WEB_SEARCH_SECTION_KEYS: readonly ["webSearch"];
3
+ export type WebSearchSectionKey = (typeof WEB_SEARCH_SECTION_KEYS)[number];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The web search section (30.1.0) — the settings-document key of the section that picks where searches go (provider, endpoint, key
3
+ * reference, result count, …). Pure data, browser-safe.
4
+ *
5
+ * Its merge law and admission floor are one row, `SAFETY_MERGE_SPEC.webSearch` (`./safety-merge-spec`); this module publishes the
6
+ * section's KEY, the way `HTTP_HOOK_ALLOWLIST_KEYS` (`./http-hook-allowlists`) and `MCP_SERVER_LIST_KEYS` (`./mcp-server-policy`) publish
7
+ * the keys of the other contracts that are not `SETTINGS_UNITS` rows. A consumer that labels each settings key with what this package says
8
+ * about it reads the unit table plus these key constants — the section's key is not spelled out anywhere else in this package (the row's
9
+ * `seam` reads it from here).
10
+ *
11
+ * Every key here is also the name of the category that governs it, so a reader asks admission with the key itself:
12
+ * `layerAdmission(source, workspace, key)` — the section whole, never one of its members (the category has none).
13
+ * Not here: the section's own keys and shape. This package has no reading of them.
14
+ */
15
+ import { deepFreeze } from "./deep-freeze.js";
16
+ /** The section's key in a settings document (closed set, top level; each key is also its category's name in `SAFETY_MERGE_SPEC`). */
17
+ export const WEB_SEARCH_SECTION_KEYS = deepFreeze(["webSearch"]);
@@ -4,9 +4,9 @@
4
4
  > 每次全量重算并逐名比对 —— 加 / 删 / 改形一个导出而不重生成本档 ⇒ 红。导出面的每次变动因此以本档的 diff 出现在评审里。
5
5
  > 形:`value` = 运行期拿得到的值;`type` = 只在类型层;`value+type` = 同名的值与类型(zod schema 与它推出的类型)。
6
6
 
7
- 子路径 24 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计 1562 个(同名在多条子路径上各计一次)。
7
+ 子路径 24 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计 1564 个(同名在多条子路径上各计一次)。
8
8
 
9
- ## `.`(831)
9
+ ## `.`(833)
10
10
 
11
11
  - `A2aConfig` — value+type
12
12
  - `A2aPeerSpec` — value+type
@@ -626,6 +626,7 @@
626
626
  - `WEB_ADMIN_CREDENTIAL_ENVELOPE_KIND` — value
627
627
  - `WEB_ADMIN_ENV` — value
628
628
  - `WEB_ADMIN_JWKS_PATH` — value
629
+ - `WEB_SEARCH_SECTION_KEYS` — value
629
630
  - `WIRE_CARRIED_DOMAINS` — value
630
631
  - `WORKER_NAME` — value
631
632
  - `WORKER_PULL_TOKEN` — value
@@ -642,6 +643,7 @@
642
643
  - `WebAdminJwk` — value+type
643
644
  - `WebAdminJwks` — value+type
644
645
  - `WebAdminSessionTarget` — type
646
+ - `WebSearchSectionKey` — type
645
647
  - `WireCarriedDomain` — type
646
648
  - `WorkerCondition` — value+type
647
649
  - `WorkerLifecycle` — value+type
@@ -27,6 +27,7 @@
27
27
  > **28.0.0** 的闭集导出深冻结(对它们的原地改写由静默成功变抛 `TypeError`)与十五个导出的类型收窄成只读在 §29。
28
28
  > **29.0.0** 的本地读取域集 `LOCAL_READ_DOMAINS`(便携域集 + `projects`,与便携域集拆成两只常量;文件店自此读 `config.d/projects.json`)、带条件的域文件写器 `writeDomainFileIf`、内容摘要铸点 `contentDigest` 与 `NON_PORTABLE_DOMAINS` 的删除在 §30;同版的用户生命周期事件 wire 型在 §31;请求面记录带坐标读口 `readRequestStringRecord`、派生积木件 `deriveWireExpectation` 自守护栏与调度店首写目录 0o700 在 §32;MCP http 条目的凭据引用(`transport.assertionHeader` 退役)在 §33;钩子环境置空原因 `unset` 与配置根读口的结局表(`getVersion()` 与 `read()` 同一个版本)在 §34。
29
29
  > **30.0.0** 的一次性迁移 SS-M10 到期删码(闭集 `OneTimeMigrationId` 收窄、迁移步删、存量旧形写面拒读面缺省并点名)在 §35;同版读腿告警 `unread-config-file` 的原因词改名(`why` 的第二员换字面,含义不变)在 §36。
30
+ > **30.1.0** 的层准入表尾插整段类目 `webSearch`(联网搜索设置段:地板 project、整段取用、无成员;未受信工作区的项目 / 本地层整段不参与)与这一段的键常量 `WEB_SEARCH_SECTION_KEYS` 在 §37。
30
31
 
31
32
  ---
32
33
 
@@ -1107,3 +1108,33 @@ fleet 成员对中心公告的可达地址(`FLEET_ADVERTISE_ADDRESS`,中心往
1107
1108
  | client-core | 零读点 | 零代码改动 |
1108
1109
  | sdk | 契约套件读本包符合性语料(c57 – c68 的本地腿金样换字);源码 grep 零命中 | 语料随包同版;套件里若有自己铸这条告警的适配器,同换字面 |
1109
1110
  | test | 黑盒判据 | 见 `CHANGELOG.md` 30.0.0「黑盒判据」 |
1111
+
1112
+ ## 37. 层准入表的联网搜索段 `webSearch`(30.1.0 起,minor)—— client-core、cli、web-admin、server、sdk、test 各自的读法
1113
+
1114
+ **这一行**:`SAFETY_MERGE_SPEC.webSearch` = `{ mergeShape: "replace", minTrust: "project", tighten: { rule: "none" }, enforcement: "resolver", fail: "closed", seam }`,没有 `members`、没有 `coreAxis`,在表尾(`killSwitches` 之后)。准入与同为「把请求指向别处」的 `mcpServers` / `hooks` 同形(整键、地板 project;合并形与失败方向各按自己的);不进 `SETTINGS_UNITS`(本包没有这一段的形读法;问准入按类目名整段问)。这一行本身不改变任何宿主:取段的消费方要问 `layerAdmission` 才生效。
1115
+ **这一段的键**:包根常量 `WEB_SEARCH_SECTION_KEYS`(今天 = `["webSearch"]`,深冻结;型 `WebSearchSectionKey`)发布这一段在设置文档里的键,与另两份不在单元表里的契约的键常量 `HTTP_HOOK_ALLOWLIST_KEYS` / `MCP_SERVER_LIST_KEYS` 同形。每把键也是管它的类目名,拿键直接问 `layerAdmission`。要这一段的键就读这只常量(不读单元表,也不自己写字面);按「单元表 + 表外键常量」给每个设置键标本包归属的读者,把它加进自己的常量清单。行的 `seam` 里的键也读它。
1116
+ **怎么问**:整段问 —— `layerAdmission(源, 工作区读数, "webSearch")`,不带成员名(带成员名抛 RangeError:这一类目没有成员级准入)。答由现行律推出:
1117
+
1118
+ | 源 \ 工作区读数 | `accepted` | `declined` | `no_trust_step` |
1119
+ |---|---|---|---|
1120
+ | `userSettings` · `flagSettings` · `policySettings` | `admitted` | `admitted` | `admitted` |
1121
+ | `projectSettings` · `localSettings` | `admitted` | `trust_withheld` | `trust_withheld` |
1122
+ | `foreignProjectSettings` | `tighten_only` | `tighten_only` | `tighten_only` |
1123
+
1124
+ **取段的律**(消费方一侧):写了这一段、且被准入的层里,优先级最高的那一层的段整段生效;没被准入的层整段不参与(不与别的层合并,不拿它的结果条数或端点补到别的层上)。
1125
+ **被挡掉的这一段怎么披露**:它是那一层没读的一处写入,按本包现成那条单行披露(码 `settings.layer_parts_unread`,铸点 `buildLayerPartsUnreadNotice`)的契约,并进那一行的未读名单 —— 名字是这一段在文件里的键(`WEB_SEARCH_SECTION_KEYS` 里的那一把);原因照那只铸点:未受信工作区的项目 / 本地层写 `this workspace is not trusted`,写给另一个工具的层写 `it is written for another tool`。这是现成那一条,不是新通告。这一段的地板是 `project`,没有哪个源低于它,所以每一处被挡都出自「只读收紧方向」的层(铸点收它、不抛),都进那一行。另外,设置的生效视图里放判官的原词(`trust_withheld` / `tighten_only`)作哪一层没被采用的机读成因。
1126
+ 段里的端点与钥匙引用出自同一层 —— 宿主再到哪里取钥匙(例如注入的取钥匙回调)是宿主自己的契约,这一行管不到:回调若不知道是哪一层赢的,仍可能把别的层的钥匙配给赢的那一层的端点。
1127
+ **不在这一行里的**:用户层 `env` 块里联网搜索钥匙槽的名字随宿主进引擎进程环境 —— 挡在宿主组引擎进程环境的那一处(桌面 / 终端各一处),不在层准入表里。
1128
+ **服务端拿请求里的这一段做什么**(服务端今天的行为,以服务端的文书为准 —— 服务端 wire 契约里 `settings.webSearch` 子层那一节;不是本包的契约,本包的行与 `seam` 不写它,本包也没有钉看着它):受理面对每条车道都判这一段的形;每请求的联网搜索后端只在不是多租户的部署上由它造。〔读自服务端主干的源码,未跑〕
1129
+ **档位依据**:发版纪律「新键 / 新导出 / 词表加词 = minor」:表尾插一键,`SafetyMergeCategory` 尾上多一员;已有 18 行与次序一字不动;导出只增不删(包根加 `WEB_SEARCH_SECTION_KEYS` / `WebSearchSectionKey`)。先例 14.2.0 尾插 `killSwitches`,同判 minor。遍历 `Object.keys(SAFETY_MERGE_SPEC)` 再查自己表的消费方(JS / `Partial<Record<…>>`)会在**运行期**遇到新类目 `webSearch`,不是编译红 —— 补法:遍历自己的表,或先核自己的表认得表上的每个类目。
1130
+
1131
+ **谁受伤**:靠工作区设置文件(项目层 / 本地层)改检索端点或供应方的既有用法 —— 消费方按这一行取段之后,工作区没被信任时整段不生效(结果条数也不生效);没有信任步骤的宿主(`no_trust_step`)上项目层 / 本地层的段一直不生效;对 `SafetyMergeCategory` 穷举或钉表尾次序的代码提货红一次。**补偿**:信任这个工作区(`accepted` 即恢复),或把段放到用户层。
1132
+
1133
+ | 消费方 | 读点 | 动作 |
1134
+ |---|---|---|
1135
+ | client-core | 联网搜索判决取段的那一处(取优先级最高那一层的整段,不问层准入)· 构建期从本包抄来的层准入表〔读自共用库源码,未跑〕 | 请托的读法(共用库的排期,本包不验证):开发依赖抬到 30.1.0、重生成抄本;取段按上面「取段的律」改,判官原词进机读成因,被挡掉的段并进现成那条单行披露;取这一段时的键改读 `WEB_SEARCH_SECTION_KEYS`(今天手写 `'webSearch'` 两处〔读自共用库本机工作树的源码,未跑〕);取钥匙回调把赢的那一层带上(或仓库可控层赢时不调它)是共用库自己的契约 |
1136
+ | cli | 壳里「工作区未受信时整段不收工作区两源」的那道闸 · 设置手册投影里「按单元表 + 表外键常量标本包归属」的常量清单(今天只列另两只)〔都读自终端源码,未跑〕 | 共用库按这一行取段、且取钥匙回调知道赢的是哪一层之后,壳闸可退(与共用库读同一处);这一行不进 `SETTINGS_UNITS`,单元投影零编译面;常量清单加 `WEB_SEARCH_SECTION_KEYS` 一行,`webSearch` 才标得出归属 |
1137
+ | web-admin | 钉表尾次序的测试(`httpHookAllowlists` 之后只有 `killSwitches`)〔取自本机 web-admin 工作树的 grep,未跑〕 | 提货即红 = 通知:改判「之后再多 `webSearch`」;产品码若对 `SafetyMergeCategory` 穷举,补一行 |
1138
+ | server | 产品码不穷举类目〔读自服务端主干的源码,未跑〕;拿请求里的这一段做什么见上「服务端拿请求里的这一段做什么」 | 零产品码改动 |
1139
+ | sdk | 契约套件 | 零代码改动;符合性语料不变 |
1140
+ | test | 黑盒判据 | 见 `CHANGELOG.md` 30.1.0「黑盒判据」 |
package/llms-full.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  <!--
2
2
  llms-full.txt — 自包含全文 · 消费方(使用者)视角 · @sema-agent/settings-schema
3
- 重写日期: 2026-11-17 | 包版本: 30.0.0
3
+ 重写日期: 2026-11-17 | 包版本: 30.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 等常驻门钉住)。无证据推断显式标【推断】。
@@ -421,6 +421,11 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
421
421
  开 = `boolPole{strict:true, minTrust:"local"}`(任一设置文件层可写),关 / 非布尔 / 不带值 = 行地板 global(= 类目地板;不认 boolPole 的旧消费方两极都不收 = fail-closed);
422
422
  合并 replace + boolStricter(strict:true)⇒ 一层的开胜过所有层的关;gate / closed。表上没有「关停位只许托管层」的地板(`permissionMode` 的 seam 不再这么写),
423
423
  判官与 resolver 同读这一行。与 CC 2.1.296 限制性键表同形(`permissions.disableBypassPermissionsMode` restrictive `"disable"`;消费方把 `"disable"` 读成开)。
424
+ - 30.1.0 尾插整键类目 `webSearch`(联网搜索设置段:选供应方、端点、钥匙引用、结果条数等;段里面的键与形不由本包定义):replace(一层的段整段取用,不由两层拼成)/ project /
425
+ none / resolver / closed,无成员、无 coreAxis —— 准入与同为「指向别处」的 `mcpServers` / `hooks` 同形(整键、地板 project;合并形与失败方向各按自己的),判官律不变、零新代码:项目 / 本地层 × 非 accepted ⇒ `trust_withheld`(整段不参与,
426
+ 结果条数也不读;接受工作区或把段放到用户层即恢复),accepted ⇒ admitted,用户 / flag / 托管层 ⇒ admitted,foreignProjectSettings ⇒ `tighten_only`;按成员问它抛 RangeError。
427
+ 不进 `SETTINGS_UNITS`(本包没有这一段的形读法);这一段在设置文档里的键由 `WEB_SEARCH_SECTION_KEYS`(src/web-search-section.ts;`["webSearch"]`,深冻结,与 `HTTP_HOOK_ALLOWLIST_KEYS` / `MCP_SERVER_LIST_KEYS` 同形,每把键也是类目名)发布,行的 seam 也读它。
428
+ 这一行本身不改变任何宿主:取段的消费方要问 `layerAdmission` 才生效;被挡掉的段并进现成那条单行披露 `buildLayerPartsUnreadNotice` 的未读名单。`SafetyMergeCategory` 随之加宽 —— 持穷举表 / 钉表尾次序的消费方提货红一次 = 通知;遍历 `Object.keys(SAFETY_MERGE_SPEC)` 再查自己表的消费方运行期遇到新类目(不是编译红)。
424
429
 
425
430
  --- 4.8 fleet 契约(主 barrel / `./fleet`) ---
426
431
  - drain 协议(`DRAIN_PHASES`/`DrainSnapshot`/`drainVerdict`/`DEFAULT_DRAIN_GRACE_MS`);实例发现
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  <!--
2
2
  llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
3
- 重写日期: 2026-11-17 | 包版本: 30.0.0
3
+ 重写日期: 2026-11-17 | 包版本: 30.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 相等、
@@ -116,6 +116,7 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
116
116
  (src/cross-session.ts: `CrossSessionSettings` / `readCrossSessionInbound` / `readDialogExpiry`)
117
117
  - **安全合并表** `SAFETY_MERGE_SPEC` + 信任阶梯 `trustRank` / `isAtLeast`(词表来源 = 纯常量 `MIN_TRUST_WORDS`,闭包零 zod)+ 成员级准入 `memberAdmission`;关停位 `disableBypassPermissionsMode` / `disableAutoMode`
118
118
  = 类目 `killSwitches`(尾插):任一层可收紧、不放宽 —— 开 = tighten@local(任一设置文件层),关 / 非布尔 / 不带值 = 行地板 global,合并 boolStricter;没有「只许托管层」的地板。
119
+ 30.1.0:联网搜索设置段 = 尾插整键类目 `webSearch`(地板 project、replace 整段取用、fail closed、无成员,准入与 `mcpServers` / `hooks` 同形)—— 项目 / 本地层在工作区未受信时 `trust_withheld`(整段不参与),受信 / 用户 / flag / 托管层 `admitted`;不进 `SETTINGS_UNITS`;这一段的键 = 常量 `WEB_SEARCH_SECTION_KEYS`(src/web-search-section.ts)。
119
120
  14.6.0:唯一比较器 `tightenVerdict(rule, existing, candidate)`(判词闭集 `TIGHTEN_VERDICTS`;只认序不认拼写,域外 / 缺席 ⇒ `unreadable`;`TightenRule` 尾插无参 `setUnion` / `numericLower`);
120
121
  成员比较器 `memberTighten` 由成员行值类座推出(`MemberAdmission.list` / `boolPole`,每行恰一);settings 单元表 `SETTINGS_UNITS` + `unitTighten` + `readSettingsUnit`(单元读法,表外一切 `unreadable`)。
121
122
  (src/safety-merge-spec.ts · src/settings-units.ts)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/settings-schema",
3
- "version": "30.0.0",
3
+ "version": "30.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",