@sema-agent/settings-schema 27.2.0 → 29.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/CHANGELOG.md +753 -0
  2. package/README.md +88 -12
  3. package/conformance/VERSION +1 -1
  4. package/conformance/cases/c01-entry-salvage-then-typo/expected.json +1 -1
  5. package/conformance/cases/c02-hosts-clamp-stacked/expected.json +1 -1
  6. package/conformance/cases/c03-literal-dotted-top-key/expected.json +1 -1
  7. package/conformance/cases/c04-all-bad-collection-not-salvaged/expected.json +1 -1
  8. package/conformance/cases/c07-hooks-is-not-a-config-domain/expected.json +1 -1
  9. package/conformance/cases/c08-limits-unknown-carried-64/expected.json +1 -1
  10. package/conformance/cases/c09-limits-unknown-carried-65/expected.json +1 -1
  11. package/conformance/cases/c10-record-key-secret-redacted-twice/expected.json +1 -1
  12. package/conformance/cases/c11-unicode-unknown-keys/expected.json +1 -1
  13. package/conformance/cases/c12-prototype-name-top-keys/expected.json +1 -1
  14. package/conformance/cases/c13-models-field-null/expected.json +1 -1
  15. package/conformance/cases/c14-models-field-empty-array/expected.json +1 -1
  16. package/conformance/cases/c15-models-field-number/expected.json +1 -1
  17. package/conformance/cases/c18-wire-envelope-not-an-object/expected.json +1 -1
  18. package/conformance/cases/c19-wire-envelope-no-version/expected.json +1 -1
  19. package/conformance/cases/c21-governance-empty-object-wins/expected.json +1 -1
  20. package/conformance/cases/c23-mixed-validity-models/expected.json +1 -1
  21. package/conformance/cases/c24-valid-entries-with-unknown-keys/expected.json +1 -1
  22. package/conformance/cases/c25-published-roundtrip-zero-warnings/expected.json +1 -1
  23. package/conformance/cases/c26-hosts-array-1024/expected.json +1 -1
  24. package/conformance/cases/c27-hosts-array-1025/expected.json +1 -1
  25. package/conformance/cases/c28-large-document-over-1mb/expected.json +1 -1
  26. package/conformance/cases/c29-salvage-then-domain-refine-fails/expected.json +1 -1
  27. package/conformance/cases/c30-version-triple-a-first/expected.json +1 -1
  28. package/conformance/cases/c31-version-triple-b-changed/expected.json +1 -1
  29. package/conformance/cases/c32-version-triple-a-restored/expected.json +1 -1
  30. package/conformance/cases/c33-limits-nested-carried-key/expected.json +1 -1
  31. package/conformance/cases/c34-skills-content-vs-manifest/expected.json +1 -1
  32. package/conformance/cases/c36-skills-entry-without-content/expected.json +1 -1
  33. package/conformance/cases/c38-remote-exec-is-a-non-domain-file/expected.json +1 -1
  34. package/conformance/cases/c39-hidden-file-in-config-d/expected.json +1 -1
  35. package/conformance/cases/c40-s712-identity-only-what-reads-out/expected.json +1 -1
  36. package/conformance/cases/c41-s792-encoded-pem-identity/expected.json +1 -1
  37. package/conformance/cases/c42-s792-unknown-key-secret-redacted/expected.json +1 -1
  38. package/conformance/cases/c43-s792-form-and-deep-encoded-pem/expected.json +1 -1
  39. package/conformance/cases/c44-s792-utf8-escape-glued-token/expected.json +1 -1
  40. package/conformance/cases/c45-s792-identity-bounds-and-decode-depth/expected.json +1 -1
  41. package/conformance/cases/c46-s811-host-name-url-userinfo-withheld/expected.json +1 -1
  42. package/conformance/cases/c47-s811-roles-key-url-userinfo-withheld/expected.json +1 -1
  43. package/conformance/cases/c48-s935-model-headers-transported/expected.json +1 -1
  44. package/conformance/cases/c49-s935-model-headers-secret-entry-dropped/expected.json +1 -1
  45. package/conformance/cases/c50-s784-lane-host-legal/expected.json +1 -1
  46. package/conformance/cases/c51-s784-lane-e2b-legal/expected.json +1 -1
  47. package/conformance/cases/c52-s784-lane-k8s-legal/expected.json +1 -1
  48. package/conformance/cases/c53-s784-lane-ssh-legal/expected.json +1 -1
  49. package/conformance/cases/c54-s784-lane-adb-legal/expected.json +1 -1
  50. package/conformance/cases/c55-s784-lane-local-docker-legal/expected.json +1 -1
  51. package/conformance/cases/c56-s784-lane-device-legal/expected.json +1 -1
  52. package/conformance/cases/c57-s784-g1-enabled-no-lane/expected.json +1 -1
  53. package/conformance/cases/c58-s784-g2-multitenant-host/expected.json +1 -1
  54. package/conformance/cases/c59-s784-g3-k8s-missing-image/expected.json +1 -1
  55. package/conformance/cases/c60-s784-g3-e2b-missing-key/expected.json +1 -1
  56. package/conformance/cases/c61-s784-g3-other-lane-key/expected.json +1 -1
  57. package/conformance/cases/c62-s784-g7a-session-tidb/expected.json +1 -1
  58. package/conformance/cases/c63-s784-host-two-replicas/expected.json +1 -1
  59. package/conformance/cases/c64-s784-multitenant-local-store/expected.json +1 -1
  60. package/conformance/cases/c65-s784-pg-without-db/expected.json +1 -1
  61. package/conformance/cases/c66-s784-memory-backend-mismatch/expected.json +1 -1
  62. package/conformance/cases/c67-s784-retired-field-loud/expected.json +1 -1
  63. package/conformance/cases/c68-s784-device-local-store/expected.json +1 -1
  64. package/conformance/cases/c69-deep-encoded-token-past-every-reading/expected.json +1 -1
  65. package/conformance/cases/c70-rewritten-token-in-front-of-encoded-pem-header/expected.json +1 -1
  66. package/conformance/cases/c71-one-scanner-write-reads-display-forms/expected.json +1 -1
  67. package/conformance/cases/c72-dangling-reference-write-seat-refuses/expected.json +1 -1
  68. package/conformance/cases/c73-projects-extended-registration-reads/expected.json +1 -1
  69. package/conformance/cases/c74-projects-over-bound-refused/expected.json +3 -72
  70. package/conformance/cases/c75-projects-patch-remote-uniqueness/expected.json +3 -72
  71. package/conformance/cases/c76-projects-entry-salvage-nested/expected.json +1 -1
  72. package/conformance/cases/c77-prompts-center-artifact-carried/expected.json +1 -1
  73. package/conformance/cases/c78-prompts-empty-bindings-refused/expected.json +1 -1
  74. package/conformance/cases/c79-prompts-bad-worker-artifact-not-salvaged/expected.json +1 -1
  75. package/conformance/cases/c80-prompts-wire-v2-verbatim/expected.json +1 -1
  76. package/conformance/cases/c81-prompts-declaration-bindings-refused/expected.json +1 -1
  77. package/conformance/cases/c82-prompts-v1-catalog-refused/expected.json +1 -1
  78. package/conformance/cases/c83-prompts-bad-overlay-not-salvaged/expected.json +1 -1
  79. package/conformance/cases/c84-sandbox-git-block-carried-verbatim/expected.json +1 -1
  80. package/conformance/cases/c85-sandbox-git-refused-block-still-carried/expected.json +1 -1
  81. package/conformance/cases/c86-a2a-peers-legal/expected.json +1 -1
  82. package/conformance/cases/c87-a2a-credential-refs-not-partially-salvaged/expected.json +1 -1
  83. package/conformance/cases/c88-projects-content-attestation-carried/expected.json +1 -1
  84. package/conformance/cases/c89-projects-content-attestation-malformed/expected.json +1 -1
  85. package/conformance/cases/c90-mcp-assertion-credential-carried/expected.json +143 -0
  86. package/conformance/cases/c90-mcp-assertion-credential-carried/input.json +30 -0
  87. package/conformance/cases/c90-mcp-assertion-credential-carried/meta.json +6 -0
  88. package/conformance/cases/c91-mcp-assertion-header-retired-entry-dropped/expected.json +105 -0
  89. package/conformance/cases/c91-mcp-assertion-header-retired-entry-dropped/input.json +27 -0
  90. package/conformance/cases/c91-mcp-assertion-header-retired-entry-dropped/meta.json +6 -0
  91. package/conformance/cases/c92-mcp-principal-header-with-assertion-dropped/expected.json +105 -0
  92. package/conformance/cases/c92-mcp-principal-header-with-assertion-dropped/input.json +31 -0
  93. package/conformance/cases/c92-mcp-principal-header-with-assertion-dropped/meta.json +6 -0
  94. package/conformance/cases/c93-mcp-header-refs-with-credentials-dropped/expected.json +105 -0
  95. package/conformance/cases/c93-mcp-header-refs-with-credentials-dropped/input.json +33 -0
  96. package/conformance/cases/c93-mcp-header-refs-with-credentials-dropped/meta.json +6 -0
  97. package/conformance/cases/c94-mcp-credentials-env-kind-dropped/expected.json +105 -0
  98. package/conformance/cases/c94-mcp-credentials-env-kind-dropped/input.json +32 -0
  99. package/conformance/cases/c94-mcp-credentials-env-kind-dropped/meta.json +6 -0
  100. package/conformance/cases/c95-mcp-credentials-audience-not-connector-id-dropped/expected.json +105 -0
  101. package/conformance/cases/c95-mcp-credentials-audience-not-connector-id-dropped/input.json +30 -0
  102. package/conformance/cases/c95-mcp-credentials-audience-not-connector-id-dropped/meta.json +6 -0
  103. package/conformance/cases/c96-mcp-credentials-extra-member-dropped/expected.json +105 -0
  104. package/conformance/cases/c96-mcp-credentials-extra-member-dropped/input.json +31 -0
  105. package/conformance/cases/c96-mcp-credentials-extra-member-dropped/meta.json +6 -0
  106. package/conformance/cases/cc01-mcp-toolfaces-non-object/expected.json +1 -1
  107. package/conformance/cases/cc02-mcp-source-key-is-transported/expected.json +1 -1
  108. package/conformance/cases/cc03-model-compat-unknown-subkey/expected.json +1 -1
  109. package/conformance/cases/cli01-model-name-nfc-vs-nfd/expected.json +1 -1
  110. package/conformance/cases/cli02-control-and-zero-width-chars/expected.json +1 -1
  111. package/conformance/cases/cli03-credential-pasted-into-unknown-key/expected.json +1 -1
  112. package/conformance/cases/cli04-env-value-with-newline/expected.json +1 -1
  113. package/conformance/cases/cli05-long-and-prefix-colliding-names/expected.json +1 -1
  114. package/conformance/cases/t01-absent-domain-key-not-null/expected.json +1 -1
  115. package/conformance/cases/t03-prototype-name-key-not-swallowed/expected.json +1 -1
  116. package/conformance/cases/t04-secret-literal-never-in-warning-value/expected.json +1 -1
  117. package/conformance/cases/z01-every-domain-empty-object/expected.json +1 -1
  118. package/conformance/cases/z02-every-domain-unknown-key/expected.json +1 -1
  119. package/dist/api/auth-bridge.js +4 -3
  120. package/dist/api/auth.js +6 -5
  121. package/dist/api/credentials.js +14 -15
  122. package/dist/api/lifecycle-events.d.ts +266 -0
  123. package/dist/api/lifecycle-events.js +169 -0
  124. package/dist/api/pull-token.js +2 -1
  125. package/dist/api/scopes.js +5 -4
  126. package/dist/api/wire-scalars.d.ts +13 -0
  127. package/dist/api/wire-scalars.js +15 -0
  128. package/dist/atomic-write.d.ts +4 -0
  129. package/dist/atomic-write.js +26 -3
  130. package/dist/center-refs.js +3 -2
  131. package/dist/config-d-file.d.ts +1 -1
  132. package/dist/config-dir-io.d.ts +1 -1
  133. package/dist/config-dir-io.js +3 -2
  134. package/dist/config-document-refusal.d.ts +5 -5
  135. package/dist/config-document-refusal.js +2 -1
  136. package/dist/config-fns.d.ts +5 -5
  137. package/dist/config-fns.js +17 -16
  138. package/dist/config-root-documents.d.ts +1 -1
  139. package/dist/config-root-documents.js +4 -3
  140. package/dist/config-root-node.d.ts +1 -1
  141. package/dist/config-root-node.js +5 -3
  142. package/dist/conformance/corpus.d.ts +1 -1
  143. package/dist/conformance/derive.d.ts +16 -8
  144. package/dist/conformance/derive.js +41 -24
  145. package/dist/conformance/index.d.ts +1 -1
  146. package/dist/conformance/index.js +1 -1
  147. package/dist/conformance/run.js +8 -9
  148. package/dist/conformance/types.js +4 -3
  149. package/dist/connector-authorize-url.d.ts +23 -0
  150. package/dist/connector-authorize-url.js +129 -0
  151. package/dist/connector-id.d.ts +23 -0
  152. package/dist/connector-id.js +27 -0
  153. package/dist/cross-domain.js +6 -5
  154. package/dist/cross-session.js +3 -2
  155. package/dist/deep-freeze.d.ts +26 -0
  156. package/dist/deep-freeze.js +69 -0
  157. package/dist/default-model.js +2 -1
  158. package/dist/device-relay.d.ts +1 -1
  159. package/dist/device-relay.js +1 -1
  160. package/dist/env-model-table.js +2 -1
  161. package/dist/execution-lane-index.d.ts +1 -1
  162. package/dist/execution-lane-index.js +5 -4
  163. package/dist/execution-lanes.d.ts +2 -2
  164. package/dist/execution-lanes.js +18 -17
  165. package/dist/file-edit.d.ts +44 -0
  166. package/dist/file-edit.js +70 -1
  167. package/dist/file-store.d.ts +12 -7
  168. package/dist/file-store.js +72 -59
  169. package/dist/fleet.js +14 -13
  170. package/dist/hooks-config.d.ts +12 -12
  171. package/dist/hooks-config.js +16 -15
  172. package/dist/hooks.d.ts +20 -10
  173. package/dist/hooks.js +30 -19
  174. package/dist/http-hook-allowlists.js +2 -1
  175. package/dist/index.d.ts +4 -0
  176. package/dist/index.js +6 -2
  177. package/dist/mcp-entry-credential.d.ts +47 -0
  178. package/dist/mcp-entry-credential.js +73 -0
  179. package/dist/mcp-request-entry.d.ts +32 -13
  180. package/dist/mcp-request-entry.js +106 -59
  181. package/dist/mcp-server-policy.js +3 -2
  182. package/dist/migration-receipt.d.ts +3 -3
  183. package/dist/migration-receipt.js +4 -3
  184. package/dist/one-time-migrations.d.ts +2 -2
  185. package/dist/one-time-migrations.js +75 -57
  186. package/dist/own-key-read.d.ts +3 -1
  187. package/dist/plain-json-object.d.ts +6 -3
  188. package/dist/plain-json-object.js +6 -3
  189. package/dist/portable-domains.d.ts +18 -12
  190. package/dist/portable-domains.js +21 -15
  191. package/dist/reserved-member-name.d.ts +1 -1
  192. package/dist/reserved-member-name.js +3 -2
  193. package/dist/resolve-roster.js +3 -2
  194. package/dist/retired-envs.js +3 -6
  195. package/dist/retired-role-words.d.ts +1 -1
  196. package/dist/retired-role-words.js +4 -6
  197. package/dist/safety-merge-spec.d.ts +11 -4
  198. package/dist/safety-merge-spec.js +5 -4
  199. package/dist/scheduler-store-node.d.ts +5 -2
  200. package/dist/scheduler-store-node.js +8 -5
  201. package/dist/secret-scan.js +1 -1
  202. package/dist/settings-sources.js +6 -5
  203. package/dist/settings-units.js +3 -2
  204. package/dist/sha256.d.ts +5 -0
  205. package/dist/sha256.js +7 -0
  206. package/dist/skills-manifest.js +2 -2
  207. package/dist/types.d.ts +89 -19
  208. package/dist/types.js +57 -65
  209. package/dist/ui-language.js +4 -3
  210. package/dist/url-credential.js +4 -3
  211. package/dist/url-shape.d.ts +1 -1
  212. package/dist/url-shape.js +5 -4
  213. package/dist/web-admin-credential.js +2 -1
  214. package/dist/web-admin-env.d.ts +1 -1
  215. package/dist/web-admin-env.js +4 -3
  216. package/docs/API-SURFACE.md +47 -7
  217. package/docs/CONFORMANCE.md +6 -4
  218. package/docs/CONSUMER-INTEGRATION.md +131 -6
  219. package/llms-full.txt +46 -24
  220. package/llms.txt +27 -13
  221. package/package.json +3 -2
@@ -0,0 +1,105 @@
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
+ "elicitation": false,
32
+ "enabled": true,
33
+ "name": "plain",
34
+ "rosters": [],
35
+ "scenarios": [],
36
+ "transport": {
37
+ "kind": "http",
38
+ "url": "https://mcp.example.com/plain"
39
+ }
40
+ }
41
+ ]
42
+ },
43
+ "models": {
44
+ "atMention": {
45
+ "mode": "all"
46
+ },
47
+ "models": [],
48
+ "roles": {},
49
+ "tierGroups": []
50
+ },
51
+ "plugins": {
52
+ "plugins": []
53
+ },
54
+ "projects": {
55
+ "projects": {}
56
+ },
57
+ "prompts": {},
58
+ "rosters": {
59
+ "rosters": []
60
+ },
61
+ "scenarios": {
62
+ "scenarios": []
63
+ },
64
+ "skills": {
65
+ "skills": []
66
+ },
67
+ "systems": {
68
+ "systems": []
69
+ },
70
+ "workers": {
71
+ "workers": []
72
+ }
73
+ },
74
+ "warnings": [
75
+ {
76
+ "domain": "mcp",
77
+ "identity": {
78
+ "name": "dotted"
79
+ },
80
+ "kind": "entry-dropped",
81
+ "path": [
82
+ "servers",
83
+ 0
84
+ ],
85
+ "reasonCode": "entry-schema-invalid"
86
+ }
87
+ ],
88
+ "metadata": {
89
+ "version": 29,
90
+ "updatedAt": "2026-11-15T00:00:00.000Z"
91
+ }
92
+ },
93
+ "strictWrite": {
94
+ "outcome": "rejected",
95
+ "stage": "validate",
96
+ "why": "拒:audience 过连接器 id 判官(1–63 个小写字母 / 数字 / -,首尾字母或数字)。"
97
+ },
98
+ "wire": {
99
+ "derive": true
100
+ },
101
+ "localRoot": {
102
+ "derive": true,
103
+ "localVersion": 655412274511892
104
+ }
105
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "meta": {
3
+ "version": 29,
4
+ "updatedAt": "2026-11-15T00:00:00.000Z"
5
+ },
6
+ "domains": {
7
+ "mcp": {
8
+ "servers": [
9
+ {
10
+ "name": "dotted",
11
+ "transport": {
12
+ "kind": "http",
13
+ "url": "https://mcp.example.com/connector",
14
+ "credentials": {
15
+ "kind": "assertion",
16
+ "audience": "a.b"
17
+ }
18
+ }
19
+ },
20
+ {
21
+ "name": "plain",
22
+ "transport": {
23
+ "kind": "http",
24
+ "url": "https://mcp.example.com/plain"
25
+ }
26
+ }
27
+ ]
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "contributor": "contract",
3
+ "claim": "断言臂的 `audience` 不是连接器 id(`a.b`:DNS label 不收点)⇒ 拒:读腿整条丢、兄弟存活;严写整份拒。打的是:读者只判 audience 是非空串(拼错的 id 让断言发往一个不存在的受众,调用时才失败)。",
4
+ "firstRedOn": [],
5
+ "note": "firstRedOn 为空:historical 阶梯不覆盖 29.0.0 的新键;对 28.0.0 这一条的读数不同(`transport.credentials` 在那一版不是条目的键 / `assertionHeader` 在那一版受理),那一版不在入库的真跑证据里。"
6
+ }
@@ -0,0 +1,105 @@
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
+ "elicitation": false,
32
+ "enabled": true,
33
+ "name": "plain",
34
+ "rosters": [],
35
+ "scenarios": [],
36
+ "transport": {
37
+ "kind": "http",
38
+ "url": "https://mcp.example.com/plain"
39
+ }
40
+ }
41
+ ]
42
+ },
43
+ "models": {
44
+ "atMention": {
45
+ "mode": "all"
46
+ },
47
+ "models": [],
48
+ "roles": {},
49
+ "tierGroups": []
50
+ },
51
+ "plugins": {
52
+ "plugins": []
53
+ },
54
+ "projects": {
55
+ "projects": {}
56
+ },
57
+ "prompts": {},
58
+ "rosters": {
59
+ "rosters": []
60
+ },
61
+ "scenarios": {
62
+ "scenarios": []
63
+ },
64
+ "skills": {
65
+ "skills": []
66
+ },
67
+ "systems": {
68
+ "systems": []
69
+ },
70
+ "workers": {
71
+ "workers": []
72
+ }
73
+ },
74
+ "warnings": [
75
+ {
76
+ "domain": "mcp",
77
+ "identity": {
78
+ "name": "extra"
79
+ },
80
+ "kind": "entry-dropped",
81
+ "path": [
82
+ "servers",
83
+ 0
84
+ ],
85
+ "reasonCode": "entry-schema-invalid"
86
+ }
87
+ ],
88
+ "metadata": {
89
+ "version": 29,
90
+ "updatedAt": "2026-11-15T00:00:00.000Z"
91
+ }
92
+ },
93
+ "strictWrite": {
94
+ "outcome": "rejected",
95
+ "stage": "validate",
96
+ "why": "拒:引用的读法只经原语包 readCredentialRef,多余成员是它的 extra_field。"
97
+ },
98
+ "wire": {
99
+ "derive": true
100
+ },
101
+ "localRoot": {
102
+ "derive": true,
103
+ "localVersion": 1984804257573732
104
+ }
105
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "meta": {
3
+ "version": 29,
4
+ "updatedAt": "2026-11-15T00:00:00.000Z"
5
+ },
6
+ "domains": {
7
+ "mcp": {
8
+ "servers": [
9
+ {
10
+ "name": "extra",
11
+ "transport": {
12
+ "kind": "http",
13
+ "url": "https://mcp.example.com/connector",
14
+ "credentials": {
15
+ "kind": "assertion",
16
+ "audience": "gitea",
17
+ "header": "x-assertion"
18
+ }
19
+ }
20
+ },
21
+ {
22
+ "name": "plain",
23
+ "transport": {
24
+ "kind": "http",
25
+ "url": "https://mcp.example.com/plain"
26
+ }
27
+ }
28
+ ]
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "contributor": "contract",
3
+ "claim": "断言臂带一只它没有的成员(`header`)⇒ 原语包的问题理由(多余成员)拒:读腿整条丢、兄弟存活;严写整份拒。打的是:读者自带一份宽读法(只看 kind 与 audience),多余成员被静默剥掉 —— 写进去的头名不生效且无声。",
4
+ "firstRedOn": [],
5
+ "note": "firstRedOn 为空:historical 阶梯不覆盖 29.0.0 的新键;对 28.0.0 这一条的读数不同(`transport.credentials` 在那一版不是条目的键 / `assertionHeader` 在那一版受理),那一版不在入库的真跑证据里。"
6
+ }
@@ -164,6 +164,6 @@
164
164
  },
165
165
  "localRoot": {
166
166
  "derive": true,
167
- "localVersion": 3253988119103129
167
+ "localVersion": 4267660658714555
168
168
  }
169
169
  }
@@ -110,6 +110,6 @@
110
110
  },
111
111
  "localRoot": {
112
112
  "derive": true,
113
- "localVersion": 3591318400132154
113
+ "localVersion": 1200408595634124
114
114
  }
115
115
  }
@@ -119,6 +119,6 @@
119
119
  },
120
120
  "localRoot": {
121
121
  "derive": true,
122
- "localVersion": 1663867526020649
122
+ "localVersion": 4466775970461005
123
123
  }
124
124
  }
@@ -115,6 +115,6 @@
115
115
  },
116
116
  "localRoot": {
117
117
  "derive": true,
118
- "localVersion": 2654544430240950
118
+ "localVersion": 3664693981791291
119
119
  }
120
120
  }
@@ -128,6 +128,6 @@
128
128
  },
129
129
  "localRoot": {
130
130
  "derive": true,
131
- "localVersion": 3769852229872529
131
+ "localVersion": 3285496553040059
132
132
  }
133
133
  }
@@ -109,6 +109,6 @@
109
109
  },
110
110
  "localRoot": {
111
111
  "derive": true,
112
- "localVersion": 1531100058823047
112
+ "localVersion": 3780573944953703
113
113
  }
114
114
  }
@@ -152,6 +152,6 @@
152
152
  },
153
153
  "localRoot": {
154
154
  "derive": true,
155
- "localVersion": 1531100058823047
155
+ "localVersion": 3780573944953703
156
156
  }
157
157
  }
@@ -151,6 +151,6 @@
151
151
  },
152
152
  "localRoot": {
153
153
  "derive": true,
154
- "localVersion": 3555569200054848
154
+ "localVersion": 432549882094985
155
155
  }
156
156
  }
@@ -94,6 +94,6 @@
94
94
  },
95
95
  "localRoot": {
96
96
  "derive": true,
97
- "localVersion": 1409565868890479
97
+ "localVersion": 2196375952326078
98
98
  }
99
99
  }
@@ -127,6 +127,6 @@
127
127
  },
128
128
  "localRoot": {
129
129
  "derive": true,
130
- "localVersion": 3557208461559525
130
+ "localVersion": 2374461280151333
131
131
  }
132
132
  }
@@ -80,6 +80,6 @@
80
80
  },
81
81
  "localRoot": {
82
82
  "derive": true,
83
- "localVersion": 3944259292559843
83
+ "localVersion": 1993028062000773
84
84
  }
85
85
  }
@@ -134,6 +134,6 @@
134
134
  },
135
135
  "localRoot": {
136
136
  "derive": true,
137
- "localVersion": 3006809479574243
137
+ "localVersion": 1465296500197193
138
138
  }
139
139
  }
@@ -428,6 +428,6 @@
428
428
  },
429
429
  "localRoot": {
430
430
  "derive": true,
431
- "localVersion": 1287865876181806
431
+ "localVersion": 2724380248522476
432
432
  }
433
433
  }
@@ -78,11 +78,12 @@ import { z } from "zod";
78
78
  import { INTEGER } from "../integer.js";
79
79
  import { inspect, orWhenUninspectable, ownJsonOrThrow, ownOrThrow } from "../own-key-read.js";
80
80
  import { isJsonArray } from "../plain-json-object.js";
81
+ import { deepFreeze } from "../deep-freeze.js";
81
82
  // ── constants ────────────────────────────────────────────────────────────────────────────────────────────
82
83
  /** The web-admin JWKS endpoint, relative to the web-admin origin (shipped; public by design, RFC 7517 §5). */
83
84
  export const WEB_ADMIN_JWKS_PATH = "/api/auth/sso/jwks";
84
85
  /** R1 — the ONLY acceptable JWS algorithms. */
85
- export const AUTH_BRIDGE_ALGS = ["RS256"];
86
+ export const AUTH_BRIDGE_ALGS = deepFreeze(["RS256"]);
86
87
  /** R5 — default tolerated clock skew (seconds) on exp/nbf. */
87
88
  export const DEFAULT_CLOCK_SKEW_SEC = 60;
88
89
  /** R3 — default minimum seconds between FORCED (kid-miss) JWKS refetches. */
@@ -141,7 +142,7 @@ export const VerifierConfig = z.object({
141
142
  });
142
143
  // ── verification outcome ─────────────────────────────────────────────────────────────────────────────────
143
144
  /** R9 failure classification — for logs/metrics/tests; the HTTP surface stays a generic 401. */
144
- export const AUTH_BRIDGE_ERROR_CODES = [
145
+ export const AUTH_BRIDGE_ERROR_CODES = deepFreeze([
145
146
  /** exp in the past / nbf in the future (beyond clockSkewSec) — R5. */
146
147
  "expired",
147
148
  /** signature does not verify against any acceptable key, or kid unknown after the R3 refresh path. */
@@ -152,7 +153,7 @@ export const AUTH_BRIDGE_ERROR_CODES = [
152
153
  "jwks_unavailable",
153
154
  /** not a JWT / disallowed alg (R1) / missing sub (R6) / aud mismatch (R7) / claim shape garbage. */
154
155
  "malformed",
155
- ];
156
+ ]);
156
157
  /** R9 success output — what the verifier middleware hands the existing principal pipeline. */
157
158
  export const VerifiedIdentity = z.object({
158
159
  /** = token `sub`. Feeds x-agent-principal / owner semantics / costQuota / entitlement keying verbatim. */
package/dist/api/auth.js CHANGED
@@ -37,17 +37,18 @@
37
37
  */
38
38
  import { z } from "zod";
39
39
  import { INTEGER } from "../integer.js";
40
+ import { deepFreeze } from "../deep-freeze.js";
40
41
  // ── endpoint paths + protocol constants (shipped values) ─────────────────────────────────────────────────
41
42
  // 3.0.0(S-321):这些常量与纯函数 2026-07-27 曾被拆去 `./api/wire` 子路径(给「零依赖客户端运行时直取」
42
43
  // 留的门),四个消费仓自始至终零 import —— 死出口连同它的拆分一起删,常量回到它们的契约原处。
43
44
  /** The five auth endpoints, relative to web-admin origin. */
44
- export const AUTH_V1_PATHS = {
45
+ export const AUTH_V1_PATHS = deepFreeze({
45
46
  deviceCode: "/api/v1/auth/device/code",
46
47
  deviceToken: "/api/v1/auth/device/token",
47
48
  deviceApprove: "/api/v1/auth/device/approve",
48
49
  tokenRefresh: "/api/v1/auth/token/refresh",
49
50
  logout: "/api/v1/auth/logout",
50
- };
51
+ });
51
52
  /** The RFC 8628 grant_type the device token endpoint requires. */
52
53
  export const DEVICE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
53
54
  /** Minimum seconds between token-endpoint polls (RFC 8628 `interval`); polling faster → `slow_down`. */
@@ -59,7 +60,7 @@ export const ACCESS_TOKEN_TTL_SECONDS = 60 * 60;
59
60
  /** Refresh-grant lifetime (seconds) — 30d SLIDING: every rotation opens a fresh 30d window. */
60
61
  export const REFRESH_TOKEN_TTL_SECONDS = 30 * 24 * 60 * 60;
61
62
  /** Every error code the /api/v1/auth/* endpoints answer (HTTP 400 unless noted). */
62
- export const OAUTH_ERROR_CODES = [
63
+ export const OAUTH_ERROR_CODES = deepFreeze([
63
64
  /** device/token: the user has not approved (or denied) the handshake yet — keep polling. */
64
65
  "authorization_pending",
65
66
  /** device/token: polling faster than `interval` — RFC 8628 §3.5: ADD 5 seconds to the interval. */
@@ -77,11 +78,11 @@ export const OAUTH_ERROR_CODES = [
77
78
  "invalid_grant",
78
79
  /** SSO not configured on web-admin (HTTP 503) — a deployment problem, not a client one. */
79
80
  "server_error",
80
- ];
81
+ ]);
81
82
  /** Handshake states a consent-screen lookup can see. (`approved` rows vanish once exchanged/consumed.)
82
83
  * `denied` is contract-reserved for an explicit deny button (pairs with the `access_denied` poll error);
83
84
  * the shipped M1 store carries pending|approved only — adding deny later is implementation, not schema. */
84
- export const DEVICE_AUTH_STATUSES = ["pending", "approved", "denied"];
85
+ export const DEVICE_AUTH_STATUSES = deepFreeze(["pending", "approved", "denied"]);
85
86
  // ── auth: pure client-side helpers(api/auth.ts 原件)────────────────────────────────────────────────────
86
87
  /**
87
88
  * Canonicalize a human-typed user code to the wire shape "XXXX-XXXX": uppercase, dashes/spaces optional.
@@ -21,17 +21,18 @@
21
21
  * 解析出的值里不会带着谁多塞的秘密。`secret` 是应答里唯一的秘密位;`credentialId` / `version` / `auditId` 是不带值的审计位。
22
22
  */
23
23
  import { z } from "zod";
24
- import { INTEGER } from "../integer.js";
25
24
  import { buildQuotedIssue } from "../quoted-issue.js";
26
25
  import { SANDBOX_GIT_MAX_ORIGINS, SandboxGitOrigin, SandboxGitOriginList } from "../sandbox-git.js";
27
- import { PRINCIPAL_MAX_LENGTH, PrincipalIncarnation } from "./auth-bridge.js";
26
+ import { PrincipalIncarnation } from "./auth-bridge.js";
27
+ import { NonEmptyString, PrincipalString, SafeCount } from "./wire-scalars.js";
28
+ import { deepFreeze } from "../deep-freeze.js";
28
29
  // ── 逐 origin 判定序表 ─────────────────────────────────────────────────────────────────────────────────────────────
29
30
  /**
30
31
  * 逐 origin 判定序表(11 行,序即判定序)。每行 `{ state, reason? }`:命中这一行的 origin 的应答是这个状态与这个原因。
31
32
  * 条件(各行什么事实命中)见 `docs/CONSUMER-INTEGRATION.md` 的判定序表;`active` 是兜底行(行 `active` 且刷新不成问题),没有原因。
32
33
  * 加一行 / 改序都是改契约:状态词、原因词、应答臂的原因值域、类型全部随这一张表走。
33
34
  */
34
- export const SANDBOX_GIT_ORIGIN_VERDICTS = [
35
+ export const SANDBOX_GIT_ORIGIN_VERDICTS = deepFreeze([
35
36
  { state: "insecure_transport", reason: "not_https" },
36
37
  { state: "not_offered", reason: "not_in_registry" },
37
38
  { state: "not_connected", reason: "no_row" },
@@ -43,25 +44,23 @@ export const SANDBOX_GIT_ORIGIN_VERDICTS = [
43
44
  { state: "needs_reauth", reason: "refresh_rejected" },
44
45
  { state: "temporarily_unavailable", reason: "refresh_unavailable" },
45
46
  { state: "active" },
46
- ];
47
+ ]);
47
48
  /** 状态词表:判定序表里状态首次出现的次序。 */
48
- export const SANDBOX_GIT_ORIGIN_STATES = [...new Set(SANDBOX_GIT_ORIGIN_VERDICTS.map((v) => v.state))];
49
+ export const SANDBOX_GIT_ORIGIN_STATES = deepFreeze([...new Set(SANDBOX_GIT_ORIGIN_VERDICTS.map((v) => v.state))]);
49
50
  /** 原因词表:判定序表里原因出现的次序(= 判定序)。 */
50
- export const SANDBOX_GIT_ORIGIN_REASONS = SANDBOX_GIT_ORIGIN_VERDICTS.flatMap((v) => ("reason" in v ? [v.reason] : []));
51
+ export const SANDBOX_GIT_ORIGIN_REASONS = deepFreeze(SANDBOX_GIT_ORIGIN_VERDICTS.flatMap((v) => ("reason" in v ? [v.reason] : [])));
51
52
  /** 判定序表里某个状态下的原因词,按表序。 */
52
53
  function reasonsOf(state) {
53
54
  return SANDBOX_GIT_ORIGIN_VERDICTS.flatMap((v) => (v.state === state && "reason" in v ? [v.reason] : []));
54
55
  }
55
56
  // ── 公共字段 ───────────────────────────────────────────────────────────────────────────────────────────────────────
56
- /** 本模块里每个数值位(毫秒时刻、凭据行版本)的形:非负安全整数 —— 包内的整数判据 + 安全整数上界;浮点、负数、超出安全整数的都不是。 */
57
- const SafeCount = INTEGER.nonnegative().max(Number.MAX_SAFE_INTEGER);
58
- const NonEmptyString = z.string().min(1);
57
+ // 本模块里的数值位(毫秒时刻、凭据行版本)、非空串与主体名的形来自包内私有叶子 `./wire-scalars`(与 `api/lifecycle-events` 共用一份,不各抄一遍)。
59
58
  /**
60
- * 请求与应答都带的「这是谁的 run」字段:主体(长度界同令牌 `sub` 的界,{@link PRINCIPAL_MAX_LENGTH})、化身号({@link PrincipalIncarnation},与令牌 `sub_inc` 同一只 schema)、
59
+ * 请求与应答都带的「这是谁的 run」字段:主体(长度界同令牌 `sub` 的界,`PRINCIPAL_MAX_LENGTH`,见 `./api/auth-bridge`)、化身号({@link PrincipalIncarnation},与令牌 `sub_inc` 同一只 schema)、
61
60
  * scope(非空串 —— 与 `readTokenScope` 读 token 声明的规则同一条,不另立 slug 规则)。应答里这三键是**回显**,等不等于请求由收方核。
62
61
  */
63
62
  const RunIdentity = {
64
- principal: z.string().min(1).max(PRINCIPAL_MAX_LENGTH),
63
+ principal: PrincipalString,
65
64
  principalInc: PrincipalIncarnation,
66
65
  scope: NonEmptyString,
67
66
  };
@@ -120,12 +119,12 @@ export const SandboxGitCredentialAnswer = z.object({
120
119
  });
121
120
  // ── 整次拒答 ───────────────────────────────────────────────────────────────────────────────────────────────────────
122
121
  /** `permanence` 两词:`terminal` = 不按定时重试;`transient` = 退避重试。 */
123
- export const SANDBOX_GIT_PERMANENCE = ["terminal", "transient"];
122
+ export const SANDBOX_GIT_PERMANENCE = deepFreeze(["terminal", "transient"]);
124
123
  /**
125
124
  * 整次拒答词 → 它的 HTTP 状态集(中心答这个词时用其一)与 `permanence`。**一个错误词的 permanence 是固定的**,拒体里再带一份只为让收方不必查表 ——
126
125
  * 两处不一致就是畸形应答({@link SandboxGitCredentialRefusal} 拒)。收方怎么处置某个词(例如哪些 terminal 可由用户动作恢复)是收方的状态机,不在这里。
127
126
  */
128
- export const SANDBOX_GIT_REFUSALS = {
127
+ export const SANDBOX_GIT_REFUSALS = deepFreeze({
129
128
  caller_not_admitted: { statuses: [401, 403], permanence: "terminal" },
130
129
  scope_mismatch: { statuses: [403], permanence: "terminal" },
131
130
  incarnation_mismatch: { statuses: [403], permanence: "terminal" },
@@ -136,9 +135,9 @@ export const SANDBOX_GIT_REFUSALS = {
136
135
  vault_frozen: { statuses: [503], permanence: "terminal" },
137
136
  handle_invalid: { statuses: [401], permanence: "transient" },
138
137
  vault_unavailable: { statuses: [503], permanence: "transient" },
139
- };
138
+ });
140
139
  /** 整次拒答词表(运行期;表的键,按表序)。 */
141
- export const SANDBOX_GIT_REFUSAL_ERRORS = Object.keys(SANDBOX_GIT_REFUSALS);
140
+ export const SANDBOX_GIT_REFUSAL_ERRORS = deepFreeze(Object.keys(SANDBOX_GIT_REFUSALS));
142
141
  /** 整次拒答的体:`{ error, permanence, message }`。`message` 是中心的诊断句(收方不据它判,可为空串)。 */
143
142
  export const SandboxGitCredentialRefusal = z
144
143
  .object({