@sema-agent/settings-schema 25.0.0 → 25.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,122 @@
8
8
 
9
9
  ## Unreleased
10
10
 
11
+ ## 25.1.0 — 2026-11-09 — minor:项目登记多一个可选键 `contentAttestedAt`(内容证明时刻),写角色 = publisher
12
+
13
+ > 档位(按发版纪律):**minor** —— 新键(登记形多一个可选键)· 逐字段角色表多一行;无导出删除、无闭集缩小、无读数变化(存下来的文档一字不改读)。
14
+ > 类型与角色是加性的;**数据面不是**:盖了章的文档,低于 25.1.0 的读方视图面读不了(见「耐久数据面」),盖章要在读方就位之后。
15
+
16
+ ### 律(一条)
17
+
18
+ **规则集只加一键,不加判官**:本包只定这个键的**形**(RFC 3339 时刻,与 `archivedAt` 读同一只 `RFC3339_DATE_TIME`,不另写一份时刻判)与**角色**(`DOMAIN_FIELD_WRITE_ROLE.projects.fields.contentAttestedAt` = `publisher`,与它担保的 `goal` / `notes` / `contextItems` 同档:editor 改不动、也伪造不了)。
19
+ 谁在什么时候盖章是**写口**的规则,读方只问「这个键在不在」—— 本包没有「这个章可不可信」的函数,也不比较章与内容谁新谁旧。
20
+
21
+ ### 键的意思
22
+
23
+ `ProjectRegistration.contentAttestedAt?: string`:中心写口在一次**按 `writeRoleFor("projects", changedWriteFields("projects", 库里的文档, 要存的文档))` 判过内容字段**的写之后,盖在这条登记上的时刻。
24
+
25
+ - **在场** = 这条登记里的 `goal` / `notes` / `contextItems` 过了那一道(25.0.0 起这三个字段只有 publisher 写得动)。
26
+ - **缺席** = 旧登记,或没经过带章写口的登记 —— 其中包括 25.0.0 之前 editor 写下的内容(25.0.0 的抬权只约束此后的写,不追认存量,这正是要这个键的原因)。读方应把缺席读成「没有证明」,不是「证明为空」。
27
+ - 值是 RFC 3339 `date-time`(秒必备,`Z` 或 `±hh:mm` 偏移;写口写 UTC `Z`),**逐字承运**:不规范化成 `Z`、不补缺、不给没有章的登记造章。形坏(`"yesterday"`、空串、只有日期、缺秒、缺偏移、数字、`null` …)⇒ 校验拒,错误路径指向该键。
28
+ - **PATCH 形不收它**(`ProjectRegistrationPatch` 是严格对象,与 `registeredBy` / `registeredAt` 同款:章由写口盖,请求体盖不了)。`applyProjectPatch` 不动登记上已有的章 —— 改了内容的 PATCH 之后重盖章是写口的下一步(见下表 web-admin 一行)。
29
+
30
+ ### 读数变化(逐条)
31
+
32
+ 1. `ProjectRegistration` / `ProjectsConfig` / `parseDomain` / `parseDomainLoud` / `parseDomainSalvaged` / `buildEffective` / `readEffectiveWire` / `FileConfigStore.getDomain`:带 `contentAttestedAt` 的登记**保留**该键(此前:文档面把它当未知键剥掉,视图面把整条登记当「带未知键」丢掉);不带键的登记读数一格不变(不长出键、零告警)。
33
+ 2. 形坏的章:文档面与写入席**拒**(整份,路径 `["projects", <projectId>, "contentAttestedAt"]`);视图面那一条登记不进 effective(`entry-dropped` / `entry-schema-invalid`,路径点到该登记),别的登记不受牵连;它是唯一一条时零幸存者 ⇒ 整份视图面读抛(与唯一一条坏形登记同读,无告警)—— 坏章从不读成「在」。
34
+ 3. `writeRoleFor("projects", ["contentAttestedAt"])` = `publisher`(此前:字段名不在表里 ⇒ `RangeError`)。`changedWriteFields("projects", before, after)`:章被加上 / 改值 / 撕掉、或一条新登记带着章,差里都含 `contentAttestedAt` ⇒ 整笔要 publisher;重发没改的章、键序不同 ⇒ 没改。校验器拒的文档(含形坏的章)照旧按全字段算。
35
+ 4. `DOMAIN_FIELD_WRITE_ROLE.projects.fields` 被抬到 publisher 的恰是 `goal` / `notes` / `contextItems` / `contentAttestedAt` 四个,其余仍是 editor;表在类型上穷举(登记形多一个键而没给角色 ⇒ 编译红,本键即这条规则的第一次用上)。
36
+
37
+ ### 三问
38
+
39
+ - **谁需要**:用项目上下文注入的部署(`goal` / `notes` 进系统提示、`contextItems` 的 folder / file 条目进任务工作区)的读方 —— 想只信「经过中心写口按字段角色判过」的内容,又要把 25.0.0 之前 editor 写下的存量内容分出来。没有这个键,存量与新写在 effective 里长得一模一样。
40
+ - **谁受伤**:类型 / 角色这一侧无人 —— 可选键、editor 本来就改不动新键、存下来的文档一字不变。数据这一侧:**读方低于 25.1.0 时,带章的文档读不了**(它的视图面把带未知键的登记整条丢,唯一一条时整份生效配置抛;文档面把键剥掉,写回即抹掉章)。所以受伤的只可能是「写口先盖了章、读方还没升」的那段时间。
41
+ - **补偿**:盖章顺序 —— 读方(server、web-admin 自己的读法、其它读 `projects` 视图面的消费方)先升到 25.1.0,写口再开始盖章;写口的盖章开关在 web-admin 一侧,本包没有可调的旋钮。读方没升就遇到章时不是静默:还有别的登记幸存时视图面发 `entry-dropped` / `entry-unknown-key` 告警点名那一条登记,章所在的登记是唯一一条时整份生效配置抛、错误句点名未知键 `contentAttestedAt`。
42
+
43
+ ### 导出面
44
+
45
+ - **新增**:无(`contentAttestedAt` 是登记形上的一个键,不是导出)。`ProjectRegistration` 的类型与 zod 形多一个可选键;`DOMAIN_FIELD_WRITE_ROLE` 的值多一行。
46
+ - **删除 / 类型缩窄 / 读法变**:无。
47
+ - 值不变:`PROJECT_LIMITS`、`ProjectRegistrationPatch` 的键集、`DOMAIN_WRITE_ROLE`、`DEFAULT_DOMAIN_WRITE_ROLE`。
48
+
49
+ ### 各消费方
50
+
51
+ | 消费方 | 读点 | 动作 |
52
+ |---|---|---|
53
+ | server | `projects` 视图面(`buildEffective` / `readEffectiveWire` 与 last-known-good 文件)· 项目上下文继承 | 升到 25.1.0 后才会读到章;只读「在不在」(`contentAttestedAt !== undefined`),不判角色(角色住中心),缺席 = 不继承该登记的 `goal` / `notes` / `contextItems`(fail-closed 在读方);不要在升级前等章 |
54
+ | web-admin | 项目写口(整域 PUT / PATCH / 铸造 / 批量 / 导入 / 回滚)· 项目页 · 自己的读法 | **读法先升**到 25.1.0,**盖章后开**。盖章条件:这一笔**确实写了** `goal` / `notes` / `contextItems`(`changedWriteFields` 的差里有它们),且 `writeRoleFor("projects", 差)` 判为 publisher 并通过 —— 通过之后,在要存的文档里把该登记的 `contentAttestedAt` 设为写入时刻(UTC `Z`);editor 的写不盖、不改、不撕(改不动:要 publisher)。PATCH 的请求体不收章,盖在 `applyProjectPatch` 之后、存之前的整文档里。存量内容补章 = publisher 的一次显式「确认内容」写(内容原样重存并带章,差里只有 `contentAttestedAt`,要 publisher);**不要**在没有内容变动的无关写(改名、换颜色)上顺手盖章 —— 那会把 editor 写下的存量内容盖成已证明 |
55
+ | cli | 无直接读点 | **点名 cli**:零改动 |
56
+ | client-core | 无直接读点 | **点名 client-core**:零改动 |
57
+ | sdk | 契约套件按发出的包字节跑一致性语料 | 零代码改动;语料多 2 条(`c88` `c89`),同版对拍;消费方的适配器低于 25.1.0 时这两条会红(它们读不了章),这正是语料的用处 |
58
+ | test | 黑盒判据 | 新格:editor 经整域 PUT / 铸造加章 / 改章 / 撕章或带章登记 ⇒ 403,publisher 过;PATCH 请求体带 `contentAttestedAt` ⇒ 400(任何角色:PATCH 形不收它);只改名字 / 颜色 ⇒ 过且章原样在;形坏的章 ⇒ 400 且路径指向该键;低于 25.1.0 的读方遇章 ⇒ 告警点名那一条登记(唯一一条时读抛、错误句点名该键) |
59
+
60
+ ### 耐久数据面
61
+
62
+ 不配一次性迁移:存下来的 `projects` 文档一字不改,新键缺席即旧登记。**章一旦写进文档,低于 25.1.0 的读方就读不了那份文档的视图面**(带未知键的登记整条丢并发 `entry-dropped` 告警,唯一一条时整份生效配置抛、错误句点名未知键 `contentAttestedAt`、没有告警;读的是 `buildEffective` / `readEffectiveWire` / `parseDomainSalvaged` 这一族;`FileConfigStore.getEffective` 与 `loadLocalConfig` 不读 `projects`(非便携域),不在其内)—— 这是 22.0.0 起「带未知键的条目整条丢」的既有律在新键上的后果,不是本版新增的读法。
63
+ 文档面(`parseDomainLoud`、`FileConfigStore.getDomain`、写入席)在低版本上是把章剥掉:一个低版本读方「读—改—写」整份文档会抹掉章(缺席 ⇒ 读方当作没有证明,fail-closed,但证明丢了,要 publisher 再盖一次)。所以顺序是硬的:读方先升,写口后盖。
64
+
65
+ ### 已知限制
66
+
67
+ - **本包不判「谁盖」**:章的完整性靠写口 —— 写口若被攻破或写错(例如在没有内容变动的写上也盖),章就证明不了什么。本包能做的只有一件:章的每一次增删改在差里都算 `contentAttestedAt`,所以所有走 `changedWriteFields` 的门都要 publisher。直接写库、绕过各门的路径不在本包的射程内。
68
+ - **章是时刻,不是摘要**:它不绑定内容,也不比较章与内容谁新。内容之后又被一条不经写口各门的路径改了,旧章还在;因此判据只有「所有写内容的门都问 `changedWriteFields`」这一条(25.0.0 已立)。
69
+ - **`registeredAt` 的判官不是这个键的判官**:`registeredAt` 只判非空串(它是写口盖的审计时刻,存量里可能不是 RFC 3339,收紧它会让存量登记读不进),所以本键没有「与 `registeredAt` 同一只判官」可借,用的是 `archivedAt` 的那一只 RFC 3339 判官;`registeredAt` 不动。
70
+ - **不支持章的版本**:没有「证明版本」字段、没有第二个键;要换证明的含义,是一次新的契约变更。
71
+
72
+ ### 钉
73
+
74
+ `test/project-content-attestation-25.1.0.test.ts`(42 格:a 负控 —— 无键的登记解析 / 经三种读法读出都不长出键、零告警,PATCH 形不收它 · a2 —— `applyProjectPatch` 对带章的 patch 任何角色都失败、问题点名该键 · b —— 带章保留并原样经 `buildEffective` / `parseDomain` / `parseDomainLoud` / `readEffectiveWire` 与序列化往返、`applyProjectPatch` 带过已有的章、类型面 `string | undefined` · c —— 合法形 `Z` / 小数秒 / `±hh:mm` 受理、十四种形坏值各自拒且路径指向该键(登记形与整域文档两种坐标)、与 `archivedAt` 逐串同结论(同一只判官)、视图面坏章的那一条不进 effective · c2 —— 唯一一条登记的章形坏 ⇒ 零幸存者 ⇒ 视图面读抛 · d —— `writeRoleFor` = publisher、负控(身份字段仍 editor)、表里被抬的恰四个、整域 PUT 盖章 / 改章 / 撕章 / 铸造带章都要 publisher、editor 的正当写不受影响、形坏的章按全字段 · e —— 版本五处、文书写到这个键、盖章顺序在每份随包文书里写明、本版新写的文书里每一处 `changedWriteFields` 调用都带域名第一参、角色表的属性路径写全(`.fields.`)、键只声明一次)。
75
+ `conformance/cases/c88-projects-content-attestation-carried`(带 `Z` 章 / 无章的存量 / 带小数秒与数字偏移的章,逐字承运)· `c89-projects-content-attestation-malformed`(坏章的那一条读腿丢、严写腿整份拒)。
76
+ `test/field-write-role-25.0.0.test.ts` 的「被抬的字段」一格随本版翻面(内容三字段 + 内容证明键)。
77
+ 红先:基 v25.0.0 上 42 格 34 红(其余 8 格是负控、类型面与「新文书」守卫 —— 后者对基上没有的文字天然绿,红在写错的草稿上)。
78
+ 变异(19 条,杀 19):角色改回 editor · 角色过抬到 admin · 表行删掉 · 身份字段 `displayName` 过抬 · 登记形的键删掉 · 判官换成 `registeredAt` 那只「非空串」· 判官换成只看日期的正则 · 键改必填 · 缺席时塞缺省值 · 读出时规范化成 UTC 毫秒形 · 键加进 PATCH 形 · 坏章被吞成缺席;文书侧:CHANGELOG / README 丢键名、llms.txt / CONSUMER-INTEGRATION 丢「读方先升」、package.json 版本不抬、`changedWriteFields` 示例丢掉域名参数、角色表属性路径丢掉 `.fields.` —— 每一条对应格都红(语料类变异同时让 `conformance-self` 的「全语料全绿」红)。
79
+
80
+ **自 v25.0.0 起运行期代码有改动的公开导出(机器重算;上界 —— 可达 ≠ 一定变,不可达 ⇒ 一定不变;本版新增的导出不入表)**
81
+
82
+ ```text
83
+ DOMAINS [., ./types]
84
+ DOMAIN_FIELD_WRITE_ROLE [., ./config-fns]
85
+ DOMAIN_SCHEMAS [., ./types]
86
+ FileConfigStore [./node]
87
+ NON_PORTABLE_DOMAINS [./conformance]
88
+ ProjectRegistration [., ./types]
89
+ ProjectsConfig [., ./types]
90
+ applyProjectPatch [., ./types]
91
+ buildEffective [., ./config-fns]
92
+ changedWriteFields [., ./config-fns]
93
+ deriveLocalExpectation [./conformance]
94
+ deriveWireExpectation [./conformance]
95
+ domainFilePath [./node]
96
+ emptyEffective [., ./config-fns]
97
+ foreignKeysOf [./conformance]
98
+ isDomainName [., ./types]
99
+ loadLocalConfig [./node]
100
+ loadRemoteExec [./node]
101
+ migrateConfigDirectory [./node]
102
+ migrateConfigDocuments [./node]
103
+ migrateEffectiveSnapshot [./one-time-migrations]
104
+ migrateEnvModelsDecision [./node]
105
+ migrateStoredDocuments [./one-time-migrations]
106
+ parseDomain [., ./config-fns]
107
+ parseDomainLoud [., ./config-fns]
108
+ parseDomainSalvaged [., ./config-fns]
109
+ planEnvModelTableWrite [.]
110
+ readBundle [./node]
111
+ readConfigDFileReadingSync [./node]
112
+ readEffectiveWire [., ./config-fns]
113
+ remoteExecPath [./node]
114
+ resolveLegExpectation [./conformance]
115
+ runConformance [./conformance]
116
+ salvageEntries [., ./config-fns]
117
+ urlSeatPatterns [./one-time-migrations]
118
+ validateDomain [./node]
119
+ writeBundle [./node]
120
+ writeDomainFile [./node]
121
+ writeRemoteExec [./node]
122
+ writeRoleFor [., ./config-fns]
123
+ ```
124
+
125
+ 读数真变的是 `ProjectRegistration`(多一个可选键)与 `DOMAIN_FIELD_WRITE_ROLE`(多一行);表里其余是经它们可达的读写口,既有的读数对不带章的文档逐字不变(钉 a)。
126
+
11
127
  ## 25.0.0 — 2026-11-09 — major:写权限按字段抬权(读口只有一只 `writeRoleFor`,`domainWriteRole` 删;`projects` 的 `goal` / `contextItems` / `notes` 要 publisher)· 能力读数两态(`CapabilityReading` 删 `undeclared`,「读得出」要显式的 `capabilities` 对象,位交自有属性副本)
12
128
 
13
129
  > 档位(按发版纪律):**major** —— 公开导出删除(`domainWriteRole`)· 闭集缩小(`CapabilityReading` 删一臂)· 写权限收紧(同一次写,`projects` 的内容字段 editor 由过变拒)。两项各自独立,放在一版里发:消费方升级时一起过一遍写口与心跳读口。
package/README.md CHANGED
@@ -47,6 +47,13 @@ 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
+ ## 升级指引:25.0.x → 25.1.0(minor,加性:项目登记多一个可选键 `contentAttestedAt` —— 内容证明时刻,写角色 publisher)
51
+
52
+ `ProjectRegistration` 多一个可选键 **`contentAttestedAt`**(RFC 3339 时刻,与 `archivedAt` 同一只判官):中心写口在一次按 `writeRoleFor("projects", changedWriteFields("projects", 库里的文档, 要存的文档))` 判过 `goal` / `notes` / `contextItems` 的写之后盖的章。
53
+ 读方只问「在不在」:在场 = 内容过了那一道,缺席 = 旧登记 / 没经过带章写口(含 25.0.0 之前 editor 写下的存量内容)。`DOMAIN_FIELD_WRITE_ROLE.projects.fields.contentAttestedAt` = `publisher`(editor 改不动也伪造不了);PATCH 形不收它。
54
+ 本包只定形与角色,不判「谁盖」。类型与角色是加性的,**数据面要排顺序**:低于 25.1.0 的读方遇到带章的文档,视图面把那条登记当「带未知键」丢掉(唯一一条时整份生效配置抛)—— 读方先升到 25.1.0,写口再开始盖章。
55
+ 读数变化、三问、各消费方动作与已知限制见 CHANGELOG 25.1.0 与 `docs/CONSUMER-INTEGRATION.md` §24;不配一次性迁移。
56
+
50
57
  ## 升级指引:24.0.x → 25.0.0(BREAKING:写权限读口只有一只 `writeRoleFor`,`projects` 的 `goal` / `contextItems` / `notes` 要 publisher,`domainWriteRole` 删 · 能力读数两态,`CapabilityReading` 删 `undeclared`)
51
58
 
52
59
  两处**不加性**的边(律、读数逐条、三问与各消费方改法见 CHANGELOG 25.0.0 与 `docs/CONSUMER-INTEGRATION.md` §23):
@@ -1 +1 @@
1
- 25.0.0
1
+ 25.1.0
@@ -0,0 +1,185 @@
1
+ {
2
+ "domains": {
3
+ "outcome": "effective",
4
+ "effective": {
5
+ "a2a": {
6
+ "peers": []
7
+ },
8
+ "collab": {
9
+ "templates": []
10
+ },
11
+ "entitlement": {
12
+ "budgetGroups": [],
13
+ "groupBindings": [],
14
+ "subjects": [],
15
+ "tiers": []
16
+ },
17
+ "execution": {
18
+ "allowedLanes": [
19
+ "host"
20
+ ],
21
+ "required": false
22
+ },
23
+ "governance": {},
24
+ "hosts": {
25
+ "hosts": []
26
+ },
27
+ "limits": {},
28
+ "mcp": {
29
+ "servers": []
30
+ },
31
+ "models": {
32
+ "atMention": {
33
+ "mode": "all"
34
+ },
35
+ "models": [],
36
+ "roles": {},
37
+ "tierGroups": []
38
+ },
39
+ "plugins": {
40
+ "plugins": []
41
+ },
42
+ "projects": {
43
+ "projects": {
44
+ "01890a5d-ac96-774b-bcce-b302099a8101": {
45
+ "contentAttestedAt": "2026-11-09T01:02:03Z",
46
+ "contextItems": [
47
+ {
48
+ "kind": "folder",
49
+ "value": "/home/alice/webapp"
50
+ },
51
+ {
52
+ "kind": "note",
53
+ "value": "release gates first"
54
+ }
55
+ ],
56
+ "defaultScopes": [
57
+ "proj"
58
+ ],
59
+ "displayName": "stamped",
60
+ "gitRemotes": [
61
+ "example.com/acme/stamped"
62
+ ],
63
+ "goal": "ship the project object",
64
+ "notes": "free notes",
65
+ "registeredAt": "2026-10-01T00:00:00.000Z",
66
+ "registeredBy": "alice"
67
+ },
68
+ "01890a5d-ac96-774b-bcce-b302099a8102": {
69
+ "defaultScopes": [
70
+ "proj"
71
+ ],
72
+ "displayName": "legacy",
73
+ "gitRemotes": [],
74
+ "goal": "written before any stamp existed",
75
+ "registeredAt": "2026-10-01T00:00:00.000Z",
76
+ "registeredBy": "alice"
77
+ },
78
+ "01890a5d-ac96-774b-bcce-b302099a8103": {
79
+ "contentAttestedAt": "2026-11-09T09:02:03.250+08:00",
80
+ "defaultScopes": [
81
+ "proj"
82
+ ],
83
+ "displayName": "offset-stamped",
84
+ "gitRemotes": [
85
+ "example.com/acme/offset"
86
+ ],
87
+ "goal": "stamped in another zone",
88
+ "registeredAt": "2026-10-01T00:00:00.000Z",
89
+ "registeredBy": "alice"
90
+ }
91
+ }
92
+ },
93
+ "prompts": {},
94
+ "rosters": {
95
+ "rosters": []
96
+ },
97
+ "scenarios": {
98
+ "scenarios": []
99
+ },
100
+ "skills": {
101
+ "skills": []
102
+ },
103
+ "systems": {
104
+ "systems": []
105
+ },
106
+ "workers": {
107
+ "workers": []
108
+ }
109
+ },
110
+ "warnings": [],
111
+ "metadata": {
112
+ "version": 18,
113
+ "updatedAt": "2026-11-09T00:00:00.000Z"
114
+ }
115
+ },
116
+ "strictWrite": {
117
+ "outcome": "effective",
118
+ "effective": {
119
+ "projects": {
120
+ "projects": {
121
+ "01890a5d-ac96-774b-bcce-b302099a8101": {
122
+ "contentAttestedAt": "2026-11-09T01:02:03Z",
123
+ "contextItems": [
124
+ {
125
+ "kind": "folder",
126
+ "value": "/home/alice/webapp"
127
+ },
128
+ {
129
+ "kind": "note",
130
+ "value": "release gates first"
131
+ }
132
+ ],
133
+ "defaultScopes": [
134
+ "proj"
135
+ ],
136
+ "displayName": "stamped",
137
+ "gitRemotes": [
138
+ "example.com/acme/stamped"
139
+ ],
140
+ "goal": "ship the project object",
141
+ "notes": "free notes",
142
+ "registeredAt": "2026-10-01T00:00:00.000Z",
143
+ "registeredBy": "alice"
144
+ },
145
+ "01890a5d-ac96-774b-bcce-b302099a8102": {
146
+ "defaultScopes": [
147
+ "proj"
148
+ ],
149
+ "displayName": "legacy",
150
+ "gitRemotes": [],
151
+ "goal": "written before any stamp existed",
152
+ "registeredAt": "2026-10-01T00:00:00.000Z",
153
+ "registeredBy": "alice"
154
+ },
155
+ "01890a5d-ac96-774b-bcce-b302099a8103": {
156
+ "contentAttestedAt": "2026-11-09T09:02:03.250+08:00",
157
+ "defaultScopes": [
158
+ "proj"
159
+ ],
160
+ "displayName": "offset-stamped",
161
+ "gitRemotes": [
162
+ "example.com/acme/offset"
163
+ ],
164
+ "goal": "stamped in another zone",
165
+ "registeredAt": "2026-10-01T00:00:00.000Z",
166
+ "registeredBy": "alice"
167
+ }
168
+ }
169
+ }
170
+ },
171
+ "warnings": [],
172
+ "metadata": {
173
+ "version": 18,
174
+ "updatedAt": "2026-11-09T00:00:00.000Z"
175
+ },
176
+ "why": "受理:章是登记形的合法可选键,形过 RFC 3339 date-time;严写腿与读腿同答。"
177
+ },
178
+ "wire": {
179
+ "derive": true
180
+ },
181
+ "localRoot": {
182
+ "derive": true,
183
+ "localVersion": 1531100058823047
184
+ }
185
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "meta": {
3
+ "version": 18,
4
+ "updatedAt": "2026-11-09T00:00:00.000Z"
5
+ },
6
+ "domains": {
7
+ "projects": {
8
+ "projects": {
9
+ "01890a5d-ac96-774b-bcce-b302099a8101": {
10
+ "displayName": "stamped",
11
+ "gitRemotes": [
12
+ "example.com/acme/stamped"
13
+ ],
14
+ "defaultScopes": [
15
+ "proj"
16
+ ],
17
+ "registeredBy": "alice",
18
+ "registeredAt": "2026-10-01T00:00:00.000Z",
19
+ "goal": "ship the project object",
20
+ "notes": "free notes",
21
+ "contextItems": [
22
+ {
23
+ "kind": "folder",
24
+ "value": "/home/alice/webapp"
25
+ },
26
+ {
27
+ "kind": "note",
28
+ "value": "release gates first"
29
+ }
30
+ ],
31
+ "contentAttestedAt": "2026-11-09T01:02:03Z"
32
+ },
33
+ "01890a5d-ac96-774b-bcce-b302099a8102": {
34
+ "displayName": "legacy",
35
+ "gitRemotes": [],
36
+ "defaultScopes": [
37
+ "proj"
38
+ ],
39
+ "registeredBy": "alice",
40
+ "registeredAt": "2026-10-01T00:00:00.000Z",
41
+ "goal": "written before any stamp existed"
42
+ },
43
+ "01890a5d-ac96-774b-bcce-b302099a8103": {
44
+ "displayName": "offset-stamped",
45
+ "gitRemotes": [
46
+ "example.com/acme/offset"
47
+ ],
48
+ "defaultScopes": [
49
+ "proj"
50
+ ],
51
+ "registeredBy": "alice",
52
+ "registeredAt": "2026-10-01T00:00:00.000Z",
53
+ "goal": "stamped in another zone",
54
+ "contentAttestedAt": "2026-11-09T09:02:03.250+08:00"
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "contributor": "contract",
3
+ "claim": "项目登记的内容证明键 contentAttestedAt(25.1.0,additive):三条登记 —— 一条带 Z 形的章、一条不带(存量登记)、一条带小数秒 + 数字偏移的章。读腿与严写腿都原样收,章逐字到 effective(不规范化成 Z、不补缺、不给没有章的那条造章),零告警。打的是三种读法分歧:读方按 25.0.0 的形把章当未知键(25.0.0 的视图面把带它的整条登记丢掉、唯一一条时整份抛)/ 把章剥掉而下游分不出存量与新写 / 把章规范化或给缺席的登记补一个。",
4
+ "firstRedOn": [],
5
+ "note": "firstRedOn 为空:historical 阶梯(≤ 2.1.0)不覆盖 25.1.0 的新键;对 25.0.0 这一条会红(视图面丢带章的登记),那一版不在入库的真跑证据里。"
6
+ }
@@ -0,0 +1,104 @@
1
+ {
2
+ "domains": {
3
+ "outcome": "effective",
4
+ "effective": {
5
+ "a2a": {
6
+ "peers": []
7
+ },
8
+ "collab": {
9
+ "templates": []
10
+ },
11
+ "entitlement": {
12
+ "budgetGroups": [],
13
+ "groupBindings": [],
14
+ "subjects": [],
15
+ "tiers": []
16
+ },
17
+ "execution": {
18
+ "allowedLanes": [
19
+ "host"
20
+ ],
21
+ "required": false
22
+ },
23
+ "governance": {},
24
+ "hosts": {
25
+ "hosts": []
26
+ },
27
+ "limits": {},
28
+ "mcp": {
29
+ "servers": []
30
+ },
31
+ "models": {
32
+ "atMention": {
33
+ "mode": "all"
34
+ },
35
+ "models": [],
36
+ "roles": {},
37
+ "tierGroups": []
38
+ },
39
+ "plugins": {
40
+ "plugins": []
41
+ },
42
+ "projects": {
43
+ "projects": {
44
+ "01890a5d-ac96-774b-bcce-b302099a8101": {
45
+ "contentAttestedAt": "2026-11-09T01:02:03Z",
46
+ "defaultScopes": [
47
+ "proj"
48
+ ],
49
+ "displayName": "stamped",
50
+ "gitRemotes": [
51
+ "example.com/acme/stamped"
52
+ ],
53
+ "goal": "ship the project object",
54
+ "registeredAt": "2026-10-01T00:00:00.000Z",
55
+ "registeredBy": "alice"
56
+ }
57
+ }
58
+ },
59
+ "prompts": {},
60
+ "rosters": {
61
+ "rosters": []
62
+ },
63
+ "scenarios": {
64
+ "scenarios": []
65
+ },
66
+ "skills": {
67
+ "skills": []
68
+ },
69
+ "systems": {
70
+ "systems": []
71
+ },
72
+ "workers": {
73
+ "workers": []
74
+ }
75
+ },
76
+ "warnings": [
77
+ {
78
+ "domain": "projects",
79
+ "kind": "entry-dropped",
80
+ "path": [
81
+ "projects",
82
+ "01890a5d-ac96-774b-bcce-b302099a8102"
83
+ ],
84
+ "reasonCode": "entry-schema-invalid"
85
+ }
86
+ ],
87
+ "metadata": {
88
+ "version": 18,
89
+ "updatedAt": "2026-11-09T00:00:00.000Z"
90
+ }
91
+ },
92
+ "strictWrite": {
93
+ "outcome": "rejected",
94
+ "stage": "validate",
95
+ "why": "拒:读腿要丢一条才读得进的文档,写入席整份拒 —— 写入席不替运维删他的条目(写路径永不抢救)。"
96
+ },
97
+ "wire": {
98
+ "derive": true
99
+ },
100
+ "localRoot": {
101
+ "derive": true,
102
+ "localVersion": 1531100058823047
103
+ }
104
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "meta": {
3
+ "version": 18,
4
+ "updatedAt": "2026-11-09T00:00:00.000Z"
5
+ },
6
+ "domains": {
7
+ "projects": {
8
+ "projects": {
9
+ "01890a5d-ac96-774b-bcce-b302099a8101": {
10
+ "displayName": "stamped",
11
+ "gitRemotes": [
12
+ "example.com/acme/stamped"
13
+ ],
14
+ "defaultScopes": [
15
+ "proj"
16
+ ],
17
+ "registeredBy": "alice",
18
+ "registeredAt": "2026-10-01T00:00:00.000Z",
19
+ "goal": "ship the project object",
20
+ "contentAttestedAt": "2026-11-09T01:02:03Z"
21
+ },
22
+ "01890a5d-ac96-774b-bcce-b302099a8102": {
23
+ "displayName": "bad-stamp",
24
+ "gitRemotes": [
25
+ "example.com/acme/bad"
26
+ ],
27
+ "defaultScopes": [
28
+ "proj"
29
+ ],
30
+ "registeredBy": "alice",
31
+ "registeredAt": "2026-10-01T00:00:00.000Z",
32
+ "goal": "stamp is not a time",
33
+ "contentAttestedAt": "yesterday"
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "contributor": "contract",
3
+ "claim": "内容证明键形坏(\"yesterday\",不是 RFC 3339 date-time)的登记:读腿把那一条丢掉(entry-dropped,路径点到该登记),带合法章的那条照常在;严写腿整份拒。打的是两种读法分歧:章按 registeredAt 的「非空串」形收下(\"yesterday\" 读成「在场」,下游把没经过写口的内容当已证明)/ 坏章被静默剥掉而登记还在(读方看见一条「没有章」的登记,分不出是存量还是坏写)。",
4
+ "firstRedOn": [],
5
+ "note": "firstRedOn 为空:historical 阶梯(≤ 2.1.0)不覆盖 25.1.0 的新键;对 25.0.0 这一条读腿同样会丢这条登记(未知键),但原因不同,那一版不在入库的真跑证据里。"
6
+ }
@@ -211,7 +211,10 @@ export const DOMAIN_WRITE_ROLE = {
211
211
  * to the agent — `goal` and `notes` ride into the system prompt, `contextItems` carries folder / file entries the task's workspace and
212
212
  * attachments are built from — the same injection surface as `prompts`, so they need `publisher`. `registeredBy` / `registeredAt` are stamped
213
213
  * by the write port on registration; whether a caller may rewrite them is that port's rule, not a role (raising them would also block an
214
- * editor from registering a project at all).
214
+ * editor from registering a project at all). `contentAttestedAt` is the stamp of the opposite kind: the port puts it on a registration after a
215
+ * write it judged with {@link writeRoleFor}, as proof that the content fields passed that judgement. A caller who could set, change or tear it
216
+ * could forge the proof or hide the lack of one, so it needs `publisher` — the same as the fields it vouches for; an editor registers a project
217
+ * (no content, no stamp) and renames it without touching the stamp.
215
218
  */
216
219
  const PROJECT_FIELD_WRITE_ROLE = {
217
220
  displayName: "editor",
@@ -223,6 +226,7 @@ const PROJECT_FIELD_WRITE_ROLE = {
223
226
  goal: "publisher",
224
227
  contextItems: "publisher",
225
228
  archivedAt: "editor",
229
+ contentAttestedAt: "publisher",
226
230
  icon: "editor",
227
231
  color: "editor",
228
232
  };
package/dist/types.d.ts CHANGED
@@ -1191,6 +1191,7 @@ export declare const ProjectRegistration: z.ZodObject<{
1191
1191
  value: z.ZodString;
1192
1192
  }, z.core.$strip>], "kind">>>;
1193
1193
  archivedAt: z.ZodOptional<z.ZodISODateTime>;
1194
+ contentAttestedAt: z.ZodOptional<z.ZodISODateTime>;
1194
1195
  icon: z.ZodOptional<z.ZodString>;
1195
1196
  color: z.ZodOptional<z.ZodString>;
1196
1197
  }, z.core.$strip>;
@@ -1215,12 +1216,13 @@ export declare const ProjectsConfig: z.ZodObject<{
1215
1216
  value: z.ZodString;
1216
1217
  }, z.core.$strip>], "kind">>>;
1217
1218
  archivedAt: z.ZodOptional<z.ZodISODateTime>;
1219
+ contentAttestedAt: z.ZodOptional<z.ZodISODateTime>;
1218
1220
  icon: z.ZodOptional<z.ZodString>;
1219
1221
  color: z.ZodOptional<z.ZodString>;
1220
1222
  }, z.core.$strip>>>;
1221
1223
  }, z.core.$strip>;
1222
1224
  export type ProjectsConfig = z.infer<typeof ProjectsConfig>;
1223
- /** The PATCH form of one registration: every key a PATCH may change, all optional; `registeredBy` / `registeredAt` (and any key
1225
+ /** The PATCH form of one registration: every key a PATCH may change, all optional; `registeredBy` / `registeredAt` / `contentAttestedAt` (and any key
1224
1226
  * the registration does not have) are refused (`.strict()`). An optional key given `null` is cleared (merge-patch: `archivedAt: null`
1225
1227
  * un-archives). Each field is the registration's own schema — one bound, one shape. */
1226
1228
  export declare const ProjectRegistrationPatch: z.ZodObject<{
@@ -1247,7 +1249,7 @@ export type ProjectRegistrationPatch = z.infer<typeof ProjectRegistrationPatch>;
1247
1249
  /**
1248
1250
  * Apply a PATCH to one registration and judge the whole document with **the same** {@link ProjectsConfig} (the same remote-uniqueness rule a
1249
1251
  * full write meets — a PATCH has no rule of its own). The patch is judged here by {@link ProjectRegistrationPatch} first — whatever the caller
1250
- * did before (a request body handed over as is cannot rewrite `registeredBy` / `registeredAt` or carry an unknown key) — and only its parsed
1252
+ * did before (a request body handed over as is cannot rewrite `registeredBy` / `registeredAt` / `contentAttestedAt` or carry an unknown key) — and only its parsed
1251
1253
  * keys are merged. The patched project is judged LAST, so a remote another project already holds is refused on the patched project and the
1252
1254
  * sentence names the holder, whatever the document's key order; a successful result keeps the document's key order. Every issue path is a
1253
1255
  * document coordinate (`["projects", <projectId>, …]`), the patch's own included. `projectId` must be registered (the caller answers "no such
@@ -3024,6 +3026,7 @@ export declare const DOMAIN_SCHEMAS: {
3024
3026
  value: z.ZodString;
3025
3027
  }, z.core.$strip>], "kind">>>;
3026
3028
  archivedAt: z.ZodOptional<z.ZodISODateTime>;
3029
+ contentAttestedAt: z.ZodOptional<z.ZodISODateTime>;
3027
3030
  icon: z.ZodOptional<z.ZodString>;
3028
3031
  color: z.ZodOptional<z.ZodString>;
3029
3032
  }, z.core.$strip>>>;
package/dist/types.js CHANGED
@@ -1599,6 +1599,10 @@ export const ProjectRegistration = z.object({
1599
1599
  contextItems: ProjectContextItems.optional(),
1600
1600
  /** 归档时刻(RFC 3339)。在场 = 已归档;没有硬删(会话行引用项目)。 */
1601
1601
  archivedAt: RFC3339_DATE_TIME.optional(),
1602
+ /** 内容证明时刻(RFC 3339,与 `archivedAt` 同一只判官):中心写口在一次按 `writeRoleFor('projects', …)` 判过 `goal` / `notes` / `contextItems` 的写之后盖的章。
1603
+ * 在场 = 这条登记的内容过了那一道;缺席 = 旧登记 / 没经过带章的写口(此前 editor 写下的内容也是这一种)。本包只定形与角色(`DOMAIN_FIELD_WRITE_ROLE.projects.fields.contentAttestedAt` =
1604
+ * publisher:editor 改不动也伪造不了);谁在何时盖章是写口的规则,读方只问「在不在」,不判角色。PATCH 形不收它(章由写口盖,与 `registeredBy` / `registeredAt` 同款)。 */
1605
+ contentAttestedAt: RFC3339_DATE_TIME.optional(),
1602
1606
  /** 图标 token({@link PROJECT_ICON_REGEX})。 */
1603
1607
  icon: ProjectIcon.optional(),
1604
1608
  /** 颜色({@link PROJECT_COLOR_REGEX})。 */
@@ -1625,7 +1629,7 @@ export const ProjectsConfig = z
1625
1629
  projects: z.record(z.string().regex(PROJECT_ID_REGEX, "projectId must be a lowercase canonical UUID"), ProjectRegistration).prefault({}),
1626
1630
  })
1627
1631
  .superRefine(remoteUniquenessIssues);
1628
- /** The PATCH form of one registration: every key a PATCH may change, all optional; `registeredBy` / `registeredAt` (and any key
1632
+ /** The PATCH form of one registration: every key a PATCH may change, all optional; `registeredBy` / `registeredAt` / `contentAttestedAt` (and any key
1629
1633
  * the registration does not have) are refused (`.strict()`). An optional key given `null` is cleared (merge-patch: `archivedAt: null`
1630
1634
  * un-archives). Each field is the registration's own schema — one bound, one shape. */
1631
1635
  export const ProjectRegistrationPatch = z
@@ -1644,7 +1648,7 @@ export const ProjectRegistrationPatch = z
1644
1648
  /**
1645
1649
  * Apply a PATCH to one registration and judge the whole document with **the same** {@link ProjectsConfig} (the same remote-uniqueness rule a
1646
1650
  * full write meets — a PATCH has no rule of its own). The patch is judged here by {@link ProjectRegistrationPatch} first — whatever the caller
1647
- * did before (a request body handed over as is cannot rewrite `registeredBy` / `registeredAt` or carry an unknown key) — and only its parsed
1651
+ * did before (a request body handed over as is cannot rewrite `registeredBy` / `registeredAt` / `contentAttestedAt` or carry an unknown key) — and only its parsed
1648
1652
  * keys are merged. The patched project is judged LAST, so a remote another project already holds is refused on the patched project and the
1649
1653
  * sentence names the holder, whatever the document's key order; a successful result keeps the document's key order. Every issue path is a
1650
1654
  * document coordinate (`["projects", <projectId>, …]`), the patch's own included. `projectId` must be registered (the caller answers "no such
@@ -19,6 +19,7 @@
19
19
  > **23.0.0** 的 `scenarios` / `plugins` 移出逐条丢弃集(条目缺席会放宽的域:坏形条目整域读不进,条目体内的未知键回到剥键 + 点名)在 §21 末「23.0.0 起」段。
20
20
  > **24.0.0** 的 `skills` 移出逐条丢弃集(读档 throw)、wire 上的 skills 清单与域文档同一只判官、「一张值名单是一个值」与 `ATOMIC_SALVAGE` 删除在 §22。
21
21
  > **25.0.0** 的写权限读口(只有一只 `writeRoleFor`,逐字段角色表 `DOMAIN_FIELD_WRITE_ROLE`,`domainWriteRole` 删)与能力读数两态(`CapabilityReading` 删 `undeclared`)在 §23。
22
+ > **25.1.0** 的项目登记内容证明键(`contentAttestedAt`,写角色 publisher,读方只问在不在;盖章要在读方升级之后)在 §24。
22
23
 
23
24
  ---
24
25
 
@@ -799,6 +800,7 @@ fleet 成员对中心公告的可达地址(`FLEET_ADVERTISE_ADDRESS`,中心往
799
800
  读它的代码编译红,旧调用 `domainWriteRole(d)` 写成 `writeRoleFor(d, [])`(没有字段 = 只问底,读数一格不变——「某角色在这个域里到底能不能写点什么」就是这一问)。
800
801
  - **今天有逐字段行的域只有 `projects`**(条目在文档的 `projects` 键下):`goal` / `contextItems`(folder / file / note 条目)/ `notes` = **publisher**(它们要进系统提示与任务工作区,与 `prompts` 同级的注入面);
801
802
  `displayName` / `gitRemotes` / `defaultScopes` / `archivedAt` / `icon` / `color` / `registeredBy` / `registeredAt` = editor(登记簿的身份索引不整域抬)。表在类型上穷举:登记形多一个键而没给角色 ⇒ 编译红。
803
+ 25.1.0 起登记多一个键 `contentAttestedAt`(内容证明时刻),它与它担保的三个字段同档 = **publisher**,于是被抬的是四个字段,见 §24。
802
804
  `registeredBy` / `registeredAt` 留 editor 是因为登记时由写口盖章(抬了,editor 就连登记都登不了);谁能改写已登记的这两个值是写口自己的规则,角色表答不了「不许改」。
803
805
  - **「这次写改了哪些字段」只问 `changedWriteFields(domain, before, after)`**:表里的字段,在**任一条目**上从库里的文档 `before` 到要存的文档 `after` 值有差(新增、删除、值不同),按表的次序、各一次;整条登记新增 / 删除 = 它带的每个字段都算;重发没改的字段、键序不同 = 没改。
804
806
  `before` 缺席(该域还没有文档)传 `undefined`(缺席的唯一写法)。**整域 PUT**传库里的文档与提交的文档;**PATCH** 传库里的文档与 `applyProjectPatch` 返回的整文档;**铸造 / 认领**传库里的文档与带上新条目的整文档;
@@ -822,3 +824,28 @@ fleet 成员对中心公告的可达地址(`FLEET_ADVERTISE_ADDRESS`,中心往
822
824
  | client-core | 无直接调用 | **点名 client-core**:零改动 |
823
825
  | sdk | 契约套件的一致性语料不含这两处读法 | 零改动 |
824
826
  | test | 黑盒判据 | 新格:editor 改项目 `goal` / `contextItems` / `notes`(PUT、PATCH、登记时带内容)⇒ 403,改 `displayName` / 颜色 ⇒ 过;publisher 都过 · 心跳答 `{}` 的网关后面的成员 ⇒ 不因这一拍答复解围栏 |
827
+
828
+ ## 24. 项目登记的内容证明键 `contentAttestedAt`(25.1.0 起,minor)—— server、web-admin、cli、client-core、sdk、test 各自的读法
829
+
830
+ ### 24.1 这个键是什么
831
+
832
+ - **形**:`ProjectRegistration.contentAttestedAt?: string`,RFC 3339 `date-time`(秒必备,`Z` 或 `±hh:mm`),判官与 `archivedAt` 是同一只(`RFC3339_DATE_TIME`)。逐字承运:不规范化成 `Z`、不补缺、不给没有章的登记造章。形坏 ⇒ 校验拒,路径指向该键;视图面那一条登记不进 effective(`entry-dropped` / `entry-schema-invalid`),别的登记不受牵连;它是唯一一条时零幸存者 ⇒ 整份视图面读抛(无告警)。
833
+ - **意思**:中心写口在一次按 `writeRoleFor("projects", changedWriteFields("projects", 库里的文档, 要存的文档))` 判过内容字段(`goal` / `notes` / `contextItems`)的写之后,盖在这条登记上的时刻。**在场** = 内容过了那一道;**缺席** = 旧登记 / 没经过带章写口的登记(含 25.0.0 之前 editor 写下的存量内容 —— 25.0.0 的抬权不追认存量)。
834
+ - **角色**:`DOMAIN_FIELD_WRITE_ROLE.projects.fields.contentAttestedAt` = `publisher`,与它担保的字段同档:editor 加不上、改不了、撕不掉(整域 PUT / 铸造带章 / 改章 / 撕章,差里都含它 ⇒ 整笔要 publisher);只改名字 / 颜色的 editor 写,章原样在。
835
+ - **PATCH 形不收它**(`ProjectRegistrationPatch` 严格对象,与 `registeredBy` / `registeredAt` 同款),`applyProjectPatch` 不动登记上已有的章。本包**不判「谁盖」**,也不比较章与内容谁新 —— 写口盖章,读方读「在不在」。
836
+
837
+ ### 24.2 盖章顺序(硬的)
838
+
839
+ - 章一旦写进文档,**低于 25.1.0 的读方读不了那份文档的视图面**:带未知键的登记整条丢(22.0.0 起的既有律),唯一一条时整份生效配置抛;文档面把章剥掉,低版本读方「读—改—写」整份文档会抹掉章。
840
+ - 所以:**读方先升到 25.1.0(server、web-admin 自己的读法、其它读 `projects` 视图面的消费方),写口再开始盖章**。读方没升就遇到章时不是静默:还有别的登记幸存时视图面发 `entry-dropped` / `entry-unknown-key` 告警点名那一条登记,章所在的登记是唯一一条时整份生效配置抛、错误句点名未知键 `contentAttestedAt`(没有告警)。`loadLocalConfig` 不读 `projects`(非便携域),不在受影响的读口里。
841
+
842
+ ### 24.3 各消费方
843
+
844
+ | 消费方 | 读点 | 动作 |
845
+ |---|---|---|
846
+ | server | `projects` 视图面(`buildEffective` / `readEffectiveWire` 与 last-known-good 文件)· 项目上下文继承 | 升到 25.1.0 后才读得到章;只读「在不在」(`contentAttestedAt !== undefined`),不判角色(角色住中心);缺席 = 不继承该登记的 `goal` / `notes` / `contextItems`(fail-closed 在读方) |
847
+ | web-admin | 项目写口(整域 PUT / PATCH / 铸造 / 批量 / 导入 / 回滚)· 项目页 · 自己的读法 | 读法先升、盖章后开。**盖章条件**:这一笔确实写了 `goal` / `notes` / `contextItems`(`changedWriteFields` 的差里有它们),且 `writeRoleFor("projects", 差)` 判为 publisher 并通过 —— 之后在要存的文档里把该登记的 `contentAttestedAt` 设为写入时刻(UTC `Z`)。editor 的写不盖、不改、不撕。PATCH 的请求体不收章:盖在 `applyProjectPatch` 之后、存之前的整文档里。存量内容补章 = publisher 的一次显式「确认内容」写(内容原样重存并带章,差里只有 `contentAttestedAt`);**不要**在没有内容变动的无关写(改名、换颜色)上顺手盖章 —— 那会把 editor 写下的存量内容盖成已证明 |
848
+ | cli | 无直接读点 | **点名 cli**:零改动 |
849
+ | client-core | 无直接读点 | **点名 client-core**:零改动 |
850
+ | sdk | 契约套件按发出的包字节跑一致性语料 | 零代码改动;语料多 2 条(`c88` `c89`),同版对拍 |
851
+ | test | 黑盒判据 | 新格:editor 经整域 PUT / 铸造加章 / 改章 / 撕章或带章登记 ⇒ 403,publisher 过;PATCH 请求体带 `contentAttestedAt` ⇒ 400(任何角色:PATCH 形不收它);只改名字 / 颜色 ⇒ 过且章原样在;形坏的章 ⇒ 400 且路径指向该键;低于 25.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-09 | 包版本: 25.0.0
3
+ 重写日期: 2026-11-09 | 包版本: 25.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 等常驻门钉住)。无证据推断显式标【推断】。
@@ -143,7 +143,8 @@ registry:公网 npmjs,无需私有 registry 配置。
143
143
  未知键;能力面宽读;orgMemory 单独由 `PrincipalOrgMemoryWire` 校验)。
144
144
  · execution:执行车道策略 —— `sessionMirror`(org 默认镜像目标)+ `publicKeys`(`ExecutionPublicKey`
145
145
  sealed-box 公钥登记,`workerId?` 多 worker 选钥)。
146
- · projects:项目身份登记簿(`ProjectRegistration`,`PROJECT_ID_REGEX` 宽读严写;租户身份数据,不便携)。
146
+ · projects:项目身份登记簿(`ProjectRegistration`,`PROJECT_ID_REGEX` 宽读严写;租户身份数据,不便携)。25.1.0 起登记多一个可选键 `contentAttestedAt`(RFC 3339 时刻,与 `archivedAt` 同一只判官;
147
+ 中心写口在判过 `goal` / `notes` / `contextItems` 的写之后盖的「内容证明」章,读方只问在不在,缺席 = 旧登记 / 没经过带章写口;写角色 publisher;PATCH 形不收;(src/types.ts: ProjectRegistration, ProjectRegistrationPatch))。
147
148
  · prompts(14.0.0 单轴):只装引擎当期 schema 的中心 artifact。存储 `PromptsConfig = { artifact?, workers? }`(artifact 的身份
148
149
  `{payload, artifactDigest}`,`workers.<名>` 整份取代 scope 那份;`bindings` / `catalog` 是墓碑,存量经 SS-M10);下发 `EffectivePromptsWire =
149
150
  { schemaVersion: 2, artifact }`;唯一选择读法 `promptArtifactFor(prompts, worker | null)`。v3 结构镜像 `PromptArtifact` / `PublishedPromptArtifact` /
@@ -241,7 +242,7 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
241
242
  - 角色助手:`UserRole`(viewer<editor<publisher<admin)、`ROLE_RANK`/`USER_ROLES`、`roleAtLeast`、`isRole`、
242
243
  写权限读口只有一只 `writeRoleFor(domain, changedFields)`(25.0.0 起取代 `domainWriteRole`;= 底与被改字段角色的最高者;`[]` = 只问底):
243
244
  底(默认 editor;skills/mcp/plugins/scenarios/systems/entitlement/prompts/a2a = publisher)在 `DOMAIN_WRITE_ROLE`,逐字段角色在 `DOMAIN_FIELD_WRITE_ROLE`
244
- (今天只有 `projects`:`goal` / `contextItems` / `notes` = publisher,其余登记字段 editor;字段名不在表里 ⇒ RangeError);
245
+ (今天只有 `projects`:`goal` / `contextItems` / `notes` 与它们的内容证明键 `contentAttestedAt`(25.1.0 起)= publisher,其余登记字段 editor;字段名不在表里 ⇒ RangeError);
245
246
  「这次写改了哪些字段」问 `changedWriteFields(domain, before, after)`(同一张表;两份文档都经 `parseDomain` 读,校验器拒的 / 读不出的按全字段算;(src/config-fns.ts: writeRoleFor, changedWriteFields, DOMAIN_FIELD_WRITE_ROLE))。
246
247
  - 纯数据类型:`User`、`UserAuth`、`PublishedSnapshot`、`PendingPublish`、`ApprovePublishResult`、
247
248
  `CasWriteResult`、`WorkerLifecycleRecord`;错误脱敏 `redactSecrets` / `sanitizeZodError`;
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  <!--
2
2
  llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
3
- 重写日期: 2026-11-09 | 包版本: 25.0.0
3
+ 重写日期: 2026-11-09 | 包版本: 25.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 相等、
@@ -159,6 +159,7 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
159
159
  `isReadyForTraffic` / `isRoutable` 是它们的布尔形;没有信号(旧引擎)= `no-engine-signal`,不可路由;布尔对 `draining` / `drainingSince` 标 `@deprecated`、本包零读点、退役已登记;
160
160
  8.3.0 additive:env 名常量 `FLEET_SCOPE_ENV`(`"FLEET_SCOPE"`,成员所属租户 scope,渲染器写、引擎读;缺席 = 默认 scope `GLOBAL_SCOPE`;进保留 env 名表);
161
161
  14.7.0 additive:公告地址 env 名常量 `FLEET_ADVERTISE_ADDRESS_ENV`(`"FLEET_ADVERTISE_ADDRESS"`)+「后面要拼路径的基址」座位的禁用成分集 `PATH_BASE_URL_FORBIDDEN_PARTS`(`userinfo` / `query` / `fragment`)+ 判官 `pathBaseUrlFlaws(url)`(= `httpUrlFlaws` 配这一集;判展开之后的值;`webAdminSessionUrl` 也读它);
162
+ 25.1.0 additive:项目登记多一个可选键 `contentAttestedAt`(内容证明时刻,RFC 3339,写口盖章;写角色 publisher,`DOMAIN_FIELD_WRITE_ROLE.projects` 多一行;PATCH 形不收;读方只问在不在);盖了章的文档,低于 25.1.0 的读方视图面读不了,读方先升、写口后盖;
162
163
  25.0.0 BREAKING:写权限读口只有一只 `writeRoleFor(domain, changedFields)`(`domainWriteRole` 删;`projects` 的 `goal` / `contextItems` / `notes` 变动要 publisher,逐字段角色表 `DOMAIN_FIELD_WRITE_ROLE`、改了哪些字段问 `changedWriteFields`);`CapabilityReading` 删 `undeclared`(没有 `capabilities` 键的答复 = `unreadable` / `capabilities-absent`,不是读数);
163
164
  9.0.0 BREAKING:`readCenterCapabilities` 删,换读器 `readCapabilityReading(reply): CapabilityReading`(9.0.0 时三态,25.0.0 起 `declared` | `unreadable`;键在场而形坏 ≠ 没宣告)、`EngineSignal.configTargetVersion` / `configAppliedVersion` 由串改数)、**scheduler-store 契约**(自唤醒
164
165
  存储形 + node 绑定)、**auth / auth-bridge / scopes / wire** 契约(RFC 8628 设备流、RS256 JWKS 鉴权桥、
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/settings-schema",
3
- "version": "25.0.0",
3
+ "version": "25.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",