@sema-agent/server 7.137.0 → 7.139.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 (328) hide show
  1. package/MIGRATION.md +600 -142
  2. package/README.md +7 -3
  3. package/README.zh-CN.md +6 -3
  4. package/USAGE.md +132 -41
  5. package/deploy/sema-up/README.md +1 -1
  6. package/deploy/sema-up/lib/lanes.json +3 -2
  7. package/dist/adoption/wire.d.ts +3 -3
  8. package/dist/approval-card.d.ts +23 -16
  9. package/dist/approval-card.js +1 -0
  10. package/dist/audit.js +1 -0
  11. package/dist/background-agent-name.d.ts +5 -0
  12. package/dist/background-agent-name.js +5 -0
  13. package/dist/bench/s1/arms.d.ts +1 -1
  14. package/dist/bench/s1/arms.js +1 -3
  15. package/dist/bench/s1/run-firm.js +2 -2
  16. package/dist/boot/budget-tracing.d.ts +1 -12
  17. package/dist/boot/deployment-mods.d.ts +46 -16
  18. package/dist/boot/deployment-mods.js +82 -6
  19. package/dist/boot/device-lane.d.ts +8 -3
  20. package/dist/boot/device-lane.js +7 -2
  21. package/dist/boot/execution-env.d.ts +4 -2
  22. package/dist/boot/execution-env.js +16 -24
  23. package/dist/boot/execution-lane.d.ts +1 -1
  24. package/dist/boot/governance-seams.d.ts +12 -18
  25. package/dist/boot/governance-seams.js +10 -24
  26. package/dist/boot/leader.d.ts +3 -0
  27. package/dist/boot/leader.js +1 -0
  28. package/dist/boot/memory-consolidation.js +2 -2
  29. package/dist/boot/org-delivery.js +15 -2
  30. package/dist/boot/resolve-spec.d.ts +4 -1
  31. package/dist/boot/resolve-spec.js +29 -19
  32. package/dist/boot/retention-lane.d.ts +14 -8
  33. package/dist/boot/retention-lane.js +2 -8
  34. package/dist/boot/runner-deps.d.ts +10 -4
  35. package/dist/boot/runner-deps.js +2 -0
  36. package/dist/boot/session-faces.d.ts +0 -3
  37. package/dist/boot/session-faces.js +15 -8
  38. package/dist/boot/stage-02-web-admin-pull.js +2 -2
  39. package/dist/boot/stage-04-stores.d.ts +1 -12
  40. package/dist/boot/stage-05-execution-env.d.ts +3 -12
  41. package/dist/boot/stage-05-execution-env.js +8 -5
  42. package/dist/boot/stage-06-runners.d.ts +3 -12
  43. package/dist/boot/stage-06-runners.js +5 -3
  44. package/dist/boot/stage-07-capability-layer.d.ts +3 -12
  45. package/dist/boot/stage-07-capability-layer.js +2 -2
  46. package/dist/boot/stage-08-reapers.d.ts +3 -12
  47. package/dist/boot/stage-09-leader.d.ts +3 -12
  48. package/dist/boot/stage-09-leader.js +2 -3
  49. package/dist/boot/stage-10-http-server.d.ts +3 -12
  50. package/dist/boot/stage-10-http-server.js +5 -3
  51. package/dist/boot/stores.js +4 -4
  52. package/dist/boot/web-admin.d.ts +5 -2
  53. package/dist/boot/web-admin.js +5 -5
  54. package/dist/brain.js +5 -5
  55. package/dist/budget.d.ts +17 -15
  56. package/dist/budget.js +2 -2
  57. package/dist/capabilities/mcp-probe.d.ts +36 -11
  58. package/dist/capabilities/mcp-probe.js +44 -5
  59. package/dist/capabilities/scenarios.d.ts +1 -1
  60. package/dist/capability-facts.d.ts +21 -7
  61. package/dist/capability-facts.js +13 -3
  62. package/dist/checkpoint-identity.d.ts +13 -6
  63. package/dist/config-catalog.js +14 -8
  64. package/dist/config-invariants.d.ts +23 -3
  65. package/dist/config-invariants.js +42 -0
  66. package/dist/config-provider.d.ts +19 -24
  67. package/dist/config-provider.js +27 -12
  68. package/dist/config-types.d.ts +25 -12
  69. package/dist/config.d.ts +33 -0
  70. package/dist/config.js +52 -20
  71. package/dist/delegated-session-owner.d.ts +2 -2
  72. package/dist/deployment-shape.d.ts +7 -7
  73. package/dist/device-enrollment.d.ts +41 -2
  74. package/dist/device-enrollment.js +27 -12
  75. package/dist/device-store.d.ts +58 -85
  76. package/dist/device-store.js +19 -49
  77. package/dist/device-ws-hub.js +2 -1
  78. package/dist/env-name-allowlist-knobs.d.ts +5 -4
  79. package/dist/exec-cut.d.ts +60 -0
  80. package/dist/exec-cut.js +36 -0
  81. package/dist/execution-lane-caps.d.ts +19 -0
  82. package/dist/execution-lane-caps.js +10 -0
  83. package/dist/execution-placement.d.ts +259 -0
  84. package/dist/execution-placement.js +199 -0
  85. package/dist/field-conflict.d.ts +3 -2
  86. package/dist/field-conflict.js +1 -0
  87. package/dist/gate-settlement.d.ts +71 -0
  88. package/dist/gate-settlement.js +40 -0
  89. package/dist/hooks/classic-stations.d.ts +1 -0
  90. package/dist/hooks/classic-stations.js +1 -0
  91. package/dist/hooks/command-spawn.d.ts +2 -2
  92. package/dist/hooks/hook-runner.js +14 -14
  93. package/dist/hosted-posture.d.ts +2 -2
  94. package/dist/http/admission.js +10 -19
  95. package/dist/http/checkpoint-ctx.d.ts +21 -12
  96. package/dist/http/checkpoint-ctx.js +4 -2
  97. package/dist/http/claimed-run.d.ts +1 -1
  98. package/dist/http/dispatch.d.ts +4 -0
  99. package/dist/http/dispatch.js +3 -0
  100. package/dist/http/durable-run-leg.js +12 -6
  101. package/dist/http/execution-context.d.ts +218 -0
  102. package/dist/http/execution-context.js +330 -0
  103. package/dist/http/memory-compliance-failure-reply.js +3 -0
  104. package/dist/http/resume-legs.d.ts +5 -11
  105. package/dist/http/resume-legs.js +179 -104
  106. package/dist/http/route-ctx.d.ts +44 -59
  107. package/dist/http/route-ctx.js +2 -5
  108. package/dist/http/routes/a2a-serve.js +10 -4
  109. package/dist/http/routes/agents-roster.d.ts +1 -1
  110. package/dist/http/routes/agents-roster.js +5 -1
  111. package/dist/http/routes/approvals-assistant.js +6 -6
  112. package/dist/http/routes/background.d.ts +29 -1
  113. package/dist/http/routes/background.js +29 -2
  114. package/dist/http/routes/capabilities.js +12 -10
  115. package/dist/http/routes/devices.d.ts +13 -19
  116. package/dist/http/routes/devices.js +21 -26
  117. package/dist/http/routes/mcp-reconnect.d.ts +3 -2
  118. package/dist/http/routes/mcp-reconnect.js +7 -5
  119. package/dist/http/routes/memory-consolidation.d.ts +1 -1
  120. package/dist/http/routes/memory-origin.d.ts +1 -1
  121. package/dist/http/routes/rules.js +3 -3
  122. package/dist/http/routes/runs.js +11 -7
  123. package/dist/http/routes/session-sync.js +110 -15
  124. package/dist/http/routes/sessions.d.ts +6 -0
  125. package/dist/http/routes/sessions.js +119 -13
  126. package/dist/http/routes/side-query.d.ts +12 -4
  127. package/dist/http/routes/side-query.js +6 -8
  128. package/dist/http/routes/tasks.js +800 -782
  129. package/dist/http/server.d.ts +61 -39
  130. package/dist/http/server.js +11 -0
  131. package/dist/http/session-inherit-env.d.ts +3 -4
  132. package/dist/http/session-inherit-env.js +1 -1
  133. package/dist/http/wire-types.d.ts +22 -18
  134. package/dist/identity-source.d.ts +1 -1
  135. package/dist/index.d.ts +3 -0
  136. package/dist/index.js +1 -0
  137. package/dist/leader/wire.d.ts +7 -0
  138. package/dist/leader/wire.js +5 -4
  139. package/dist/mcp-assertion-header.d.ts +51 -40
  140. package/dist/mcp-assertion-header.js +10 -11
  141. package/dist/mcp-authorization-face.d.ts +27 -0
  142. package/dist/mcp-authorization-face.js +15 -0
  143. package/dist/memory-operator-faces.d.ts +13 -4
  144. package/dist/memory-operator-faces.js +1 -17
  145. package/dist/memory-sync-client.d.ts +53 -14
  146. package/dist/memory-sync-client.js +187 -92
  147. package/dist/memory-sync.d.ts +1 -1
  148. package/dist/memory-sync.js +3 -2
  149. package/dist/model-route-gap.d.ts +6 -22
  150. package/dist/model-route-gap.js +7 -5
  151. package/dist/mods-declaration.d.ts +110 -0
  152. package/dist/mods-declaration.js +109 -0
  153. package/dist/observability/cost-taxonomy.d.ts +2 -2
  154. package/dist/observability/err-text.d.ts +5 -0
  155. package/dist/observability/err-text.js +9 -0
  156. package/dist/observability/fail-open.d.ts +17 -1
  157. package/dist/observability/fail-open.js +17 -1
  158. package/dist/observability/run-terminal.js +0 -1
  159. package/dist/observability/secret-env-scrub.d.ts +1 -1
  160. package/dist/observability/secret-env-scrub.js +1 -1
  161. package/dist/orchestration/workflow-notify-journal.js +4 -4
  162. package/dist/org-memory-admission.d.ts +4 -3
  163. package/dist/org-memory-admission.js +6 -6
  164. package/dist/parked-decide.d.ts +49 -11
  165. package/dist/parked-decide.js +25 -26
  166. package/dist/parked-revive-surface.d.ts +12 -15
  167. package/dist/parked-revive-surface.js +3 -6
  168. package/dist/peer-seat.d.ts +156 -0
  169. package/dist/peer-seat.js +273 -0
  170. package/dist/permission-rule-vocab.d.ts +7 -7
  171. package/dist/permission-rule-vocab.js +3 -3
  172. package/dist/plain-string-record.d.ts +38 -0
  173. package/dist/plain-string-record.js +38 -0
  174. package/dist/plugins/approval-ask-store-file.d.ts +7 -0
  175. package/dist/plugins/approval-ask-store-file.js +11 -0
  176. package/dist/plugins/approval-ask-store-memory.d.ts +6 -0
  177. package/dist/plugins/approval-ask-store-memory.js +12 -0
  178. package/dist/plugins/approval-ask-store-sql.d.ts +22 -5
  179. package/dist/plugins/approval-ask-store-sql.js +30 -12
  180. package/dist/plugins/background-agent-store-sql.js +6 -3
  181. package/dist/plugins/caching-session-store.d.ts +11 -2
  182. package/dist/plugins/caching-session-store.js +15 -3
  183. package/dist/plugins/checkpoint-store-sql.d.ts +21 -25
  184. package/dist/plugins/checkpoint-store-sql.js +13 -15
  185. package/dist/plugins/device-store-sql.d.ts +25 -51
  186. package/dist/plugins/device-store-sql.js +49 -103
  187. package/dist/plugins/execution-placement-sql.d.ts +151 -0
  188. package/dist/plugins/execution-placement-sql.js +223 -0
  189. package/dist/plugins/file-history-store-sql.d.ts +7 -6
  190. package/dist/plugins/file-history-store-sql.js +8 -7
  191. package/dist/plugins/file-run-store.d.ts +6 -1
  192. package/dist/plugins/file-run-store.js +4 -0
  193. package/dist/plugins/fork-routing-session-store.d.ts +6 -0
  194. package/dist/plugins/fork-routing-session-store.js +16 -0
  195. package/dist/plugins/k8s-pod-reaper.d.ts +2 -8
  196. package/dist/plugins/k8s-pod-reaper.js +3 -3
  197. package/dist/plugins/local-checkpoint-store.d.ts +1 -11
  198. package/dist/plugins/local-checkpoint-store.js +0 -1
  199. package/dist/plugins/local-session-store.d.ts +183 -45
  200. package/dist/plugins/local-session-store.js +412 -105
  201. package/dist/plugins/mailbox-store-sql.d.ts +11 -3
  202. package/dist/plugins/mailbox-store-sql.js +103 -15
  203. package/dist/plugins/memory-key-guards.d.ts +4 -0
  204. package/dist/plugins/memory-key-guards.js +1 -0
  205. package/dist/plugins/memory-run-store.d.ts +1 -1
  206. package/dist/plugins/memory-sync-store-pg.d.ts +16 -5
  207. package/dist/plugins/memory-sync-store-tidb.d.ts +3 -3
  208. package/dist/plugins/one-time-migrations.d.ts +117 -6
  209. package/dist/plugins/one-time-migrations.js +383 -14
  210. package/dist/plugins/outcome-ledger-sql.d.ts +2 -2
  211. package/dist/plugins/permission-rule-store-sql.d.ts +13 -15
  212. package/dist/plugins/permission-rule-store-sql.js +34 -29
  213. package/dist/plugins/pg-pool.d.ts +7 -3
  214. package/dist/plugins/pg-session-storage.d.ts +41 -22
  215. package/dist/plugins/pg-session-storage.js +136 -55
  216. package/dist/plugins/remote-env-adb.d.ts +22 -4
  217. package/dist/plugins/remote-env-adb.js +70 -62
  218. package/dist/plugins/remote-env-device.d.ts +32 -12
  219. package/dist/plugins/remote-env-device.js +18 -17
  220. package/dist/plugins/remote-env-e2b.d.ts +19 -3
  221. package/dist/plugins/remote-env-e2b.js +41 -42
  222. package/dist/plugins/remote-env-file-error.d.ts +2 -0
  223. package/dist/plugins/remote-env-file-error.js +1 -1
  224. package/dist/plugins/remote-env-host.d.ts +23 -8
  225. package/dist/plugins/remote-env-host.js +66 -70
  226. package/dist/plugins/remote-env-k8s.d.ts +13 -16
  227. package/dist/plugins/remote-env-k8s.js +61 -54
  228. package/dist/plugins/remote-env-local-docker.d.ts +30 -5
  229. package/dist/plugins/remote-env-local-docker.js +46 -59
  230. package/dist/plugins/remote-env-ssh.d.ts +18 -4
  231. package/dist/plugins/remote-env-ssh.js +72 -56
  232. package/dist/plugins/remote-shell.d.ts +100 -3
  233. package/dist/plugins/remote-shell.js +166 -2
  234. package/dist/plugins/retention-store-sql.d.ts +23 -8
  235. package/dist/plugins/retention-store-sql.js +13 -1
  236. package/dist/plugins/run-store-sql.d.ts +13 -3
  237. package/dist/plugins/run-store-sql.js +5 -0
  238. package/dist/plugins/schema-consistency.d.ts +15 -5
  239. package/dist/plugins/schema-consistency.js +14 -8
  240. package/dist/plugins/schema-drift-sentence.d.ts +27 -0
  241. package/dist/plugins/schema-drift-sentence.js +38 -0
  242. package/dist/plugins/session-fork.d.ts +63 -12
  243. package/dist/plugins/session-fork.js +38 -21
  244. package/dist/plugins/session-ownership.d.ts +7 -0
  245. package/dist/plugins/session-ownership.js +5 -0
  246. package/dist/plugins/session-row-sql.d.ts +22 -0
  247. package/dist/plugins/session-row-sql.js +81 -0
  248. package/dist/plugins/session-store.d.ts +1 -1
  249. package/dist/plugins/session-workspace-cell.d.ts +17 -0
  250. package/dist/plugins/session-workspace-cell.js +38 -0
  251. package/dist/plugins/store-backend.d.ts +1 -1
  252. package/dist/plugins/store-backend.js +26 -14
  253. package/dist/plugins/store-contracts.d.ts +25 -5
  254. package/dist/plugins/tidb-pool.d.ts +12 -7
  255. package/dist/plugins/tidb-pool.js +15 -3
  256. package/dist/plugins/tidb-session-store.d.ts +74 -28
  257. package/dist/plugins/tidb-session-store.js +132 -53
  258. package/dist/plugins/tool-result-store-sql.d.ts +16 -8
  259. package/dist/plugins/tool-result-store-sql.js +26 -17
  260. package/dist/plugins/worktree-isolation.d.ts +3 -2
  261. package/dist/plugins/worktree-isolation.js +1 -7
  262. package/dist/project-identity.d.ts +1 -14
  263. package/dist/project-identity.js +0 -4
  264. package/dist/project-memory.d.ts +9 -15
  265. package/dist/project-memory.js +5 -4
  266. package/dist/request-key-closure.js +1 -1
  267. package/dist/request-value-closure.d.ts +6 -7
  268. package/dist/request-value-closure.js +1 -3
  269. package/dist/rules-consent.js +6 -4
  270. package/dist/run-local.d.ts +6 -0
  271. package/dist/run-local.js +36 -26
  272. package/dist/runs.d.ts +9 -2
  273. package/dist/runs.js +9 -2
  274. package/dist/sandbox-git-plane.d.ts +2 -2
  275. package/dist/security.d.ts +38 -12
  276. package/dist/security.js +8 -2
  277. package/dist/server-secret-env.d.ts +15 -8
  278. package/dist/server-secret-env.js +4 -2
  279. package/dist/session-children-retire.d.ts +27 -9
  280. package/dist/session-children-retire.js +9 -5
  281. package/dist/session-incarnation.d.ts +19 -10
  282. package/dist/session-incarnation.js +5 -3
  283. package/dist/session-row.d.ts +114 -5
  284. package/dist/session-row.js +55 -5
  285. package/dist/session-titler.d.ts +2 -2
  286. package/dist/session-workspace.d.ts +130 -0
  287. package/dist/session-workspace.js +83 -0
  288. package/dist/spec-fields.d.ts +1 -1
  289. package/dist/standing-answer-grant.d.ts +2 -13
  290. package/dist/standing-answer-grant.js +0 -7
  291. package/dist/task-a2a.d.ts +44 -14
  292. package/dist/task-a2a.js +46 -20
  293. package/dist/task-cwd.d.ts +6 -1
  294. package/dist/task-mcp.d.ts +33 -20
  295. package/dist/task-mcp.js +46 -22
  296. package/dist/tool-approval.d.ts +38 -8
  297. package/dist/tool-approval.js +57 -13
  298. package/dist/trace/core-keyset-guard.d.ts +33 -18
  299. package/dist/trace/engine-notice-wire.d.ts +1 -1
  300. package/dist/trace/engine-notice-wire.js +2 -0
  301. package/dist/trace/exit-seat.d.ts +20 -1
  302. package/dist/trace/exit-seat.js +3 -0
  303. package/dist/trace/extension-call-face.d.ts +33 -0
  304. package/dist/trace/extension-call-face.js +39 -0
  305. package/dist/trace/project.d.ts +26 -7
  306. package/dist/trace/project.js +30 -3
  307. package/dist/trace/redact.js +42 -13
  308. package/dist/trace/self-minted-wire.d.ts +240 -12
  309. package/dist/trace/self-minted-wire.js +100 -4
  310. package/dist/trace/wire-projection-faces.d.ts +6 -6
  311. package/dist/trace/wire-projection-faces.js +6 -5
  312. package/dist/url-refusal.d.ts +1 -1
  313. package/dist/user-authored-text.d.ts +2 -2
  314. package/dist/user-authored-text.js +16 -1
  315. package/dist/web-admin-client/apply-effective.d.ts +17 -3
  316. package/dist/web-admin-client/apply-effective.js +20 -10
  317. package/dist/web-admin-client/center-request.d.ts +3 -2
  318. package/dist/web-admin-client/center-request.js +2 -3
  319. package/dist/web-admin-client/skills-mcp.d.ts +8 -4
  320. package/dist/web-admin-client/skills-mcp.js +32 -18
  321. package/dist/web-admin-client/types.d.ts +11 -0
  322. package/package.json +3 -3
  323. package/wire-changes/server@7.138.0.json +446 -0
  324. package/wire-changes/server@7.139.0.json +348 -0
  325. package/dist/http/device-placement.d.ts +0 -175
  326. package/dist/http/device-placement.js +0 -145
  327. package/dist/http/mcp-remote-text.d.ts +0 -5
  328. package/dist/http/mcp-remote-text.js +0 -7
@@ -39,6 +39,7 @@ export const SELF_MINTED_WIRE = {
39
39
  at: "POST /v1/sessions/:id/memory/erase(已分类拒 errorCode → HTTP 状态)",
40
40
  members: {
41
41
  "config.memory_erasure_request": { attr: 400, since: "7.52.0" },
42
+ "config.memory_erasure_scope": { attr: 400, since: "7.138.0" },
42
43
  "memory.target_outside_store": { attr: 409, since: "7.101.0" },
43
44
  "memory.scope_home_not_directory": { attr: 409, since: "7.118.0" },
44
45
  "memory.erasure_evidence_unavailable": { attr: 409, since: "7.108.0" },
@@ -220,6 +221,70 @@ export const SELF_MINTED_WIRE = {
220
221
  unknown: { attr: "-", since: "7.121.0" },
221
222
  },
222
223
  },
224
+ healthModsKey: {
225
+ at: "GET /health mods",
226
+ members: {
227
+ deploymentPackages: { attr: "present-iff deployment mod packages loaded at boot", since: "7.138.0" },
228
+ },
229
+ },
230
+ modelsRowKey: {
231
+ at: "GET /v1/models models[] 行键(<键> → 在场律)",
232
+ members: {
233
+ supportsThinkingOff: { attr: "always", since: "7.138.0" },
234
+ },
235
+ },
236
+ sessionBackgroundRowKey: {
237
+ at: "GET /v1/sessions/:id/background rows[] 行键(<键> → 在场律)",
238
+ members: {
239
+ sessionId: { attr: "present-iff background agent row bound to a child session", since: "7.139.0" },
240
+ },
241
+ },
242
+ sessionsListRowKey: {
243
+ at: "GET /v1/sessions sessions[] 行键 = PATCH /v1/sessions/:id 200 体 = 409 conflict.session_row_changed currentRow(<键> → 在场律)",
244
+ members: {
245
+ rowTag: { attr: "present-iff the row can be written conditionally (the store has the row write primitive and the row carries an incarnation)", since: "7.139.0" },
246
+ },
247
+ },
248
+ toolEndGateDispositionKey: {
249
+ at: "tool_end gate.disposition 键(<臂>#<键> → 在场律)",
250
+ members: {
251
+ "denied#extension": { attr: "present-iff hook-layer denial by a named extension", since: "7.138.0" },
252
+ },
253
+ },
254
+ sideQueryBodyKey: {
255
+ at: "POST /v1/side-query 200 体键(<键> → 在场律)",
256
+ members: {
257
+ account: { attr: "always", since: "7.138.0" },
258
+ },
259
+ },
260
+ sideQueryErrorKind: {
261
+ at: "POST /v1/side-query 200 体 errorKind 的值(失败时在场;引擎的词逐字过境)",
262
+ members: {
263
+ image_unprocessable: { attr: "-", since: "7.138.0" },
264
+ },
265
+ },
266
+ mcpAuthorizationKey: {
267
+ at: "MCP 授权记录 authorization 的出现面(<面>#<键> → 在场律)",
268
+ members: {
269
+ "wiring_manifest.mcp[]#authorization": { attr: "present-iff errorCode unauthorized", since: "7.138.0" },
270
+ "POST /v1/sessions/:id/mcp/reconnect#status.authorization": { attr: "present-iff errorCode unauthorized", since: "7.138.0" },
271
+ "GET /v1/sessions/:id/mcp#servers[].authorization": { attr: "present-iff server unauthorized (this face carries no errorCode)", since: "7.138.0" },
272
+ },
273
+ },
274
+ wiringModProvenance: {
275
+ at: "wiring_manifest mods[].provenance",
276
+ members: {
277
+ server: { attr: "-", since: "7.138.0" },
278
+ operator: { attr: "-", since: "7.138.0" },
279
+ },
280
+ },
281
+ extensionRequesterSeat: {
282
+ at: "审批开卡帧上的 requestedBy(<帧>#requestedBy → 在场律)",
283
+ members: {
284
+ "tool_approval#requestedBy": { attr: "present-iff extension-initiated call", since: "7.138.0" },
285
+ "approval_request#requestedBy": { attr: "present-iff extension-initiated call", since: "7.138.0" },
286
+ },
287
+ },
223
288
  fieldConflictKind: {
224
289
  at: "400 request.field_conflict detail.kind",
225
290
  members: {
@@ -230,6 +295,7 @@ export const SELF_MINTED_WIRE = {
230
295
  file_history_restore: { attr: "-", since: "7.133.0" },
231
296
  skills_disabled: { attr: "-", since: "7.133.0" },
232
297
  existing_session: { attr: "-", since: "7.133.0" },
298
+ fork_target: { attr: "-", since: "7.139.0" },
233
299
  scratchpad_root: { attr: "-", since: "7.133.0" },
234
300
  ask_answer: { attr: "-", since: "7.133.0" },
235
301
  policy_person_ask: { attr: "-", since: "7.133.0" },
@@ -388,12 +454,17 @@ export const SELF_MINTED_WIRE = {
388
454
  "POST /v1/tasks|/v1/tasks/stream|/v1/runs#限制侧名内带 *(agents[i].denyTools)": { attr: 200, since: "7.137.0" },
389
455
  "POST /v1/assistant/tasks/:id/plan_review#checkpointId_not_current(体带的门身份不是该会话此刻待决的 plan 门;体 approval_stale + currentPending { checkpointId }?;不落决断、零状态改动)": { attr: 409, since: "7.137.0" },
390
456
  "POST /v1/assistant/tasks/:id/plan_review#checkpointId_current(体带当前门的身份;受理形与不带键同)": { attr: 200, since: "7.137.0" },
457
+ "POST /v1/tasks|/v1/tasks/stream|/v1/runs#rewindFiles(新提交;体 request.body_shape + unknownKeys [rewindFiles])": { attr: 400, since: "7.139.0" },
458
+ "POST /v1/side-query#uncoded_error_with_preflight_prefix(没有引擎码、英文开头与前缀表同形的错误;体 internal.error)": { attr: 500, since: "7.139.0" },
459
+ "PATCH /v1/sessions/:id#mirror_row(只读镜像行上的写,带不带 expectedRowTag;体 conflict.session_mirror + forkPath)": { attr: 409, since: "7.139.0" },
460
+ "PATCH /v1/sessions/:id#owner_changed_after_gate(门那一读之后同一会话的属主被改;体 not_found.session)": { attr: 404, since: "7.139.0" },
461
+ "PATCH /v1/sessions/:id#expectedRowTag_stale(行已不在那只标签上;体 conflict.session_row_changed + currentRow)": { attr: 409, since: "7.139.0" },
462
+ "PATCH /v1/sessions/:id#expectedRowTag_current(行仍在那只标签上;体 = 列表行)": { attr: 200, since: "7.139.0" },
391
463
  },
392
464
  },
393
465
  refusalSentenceForm: {
394
466
  at: "拒体 message 的句型(<码>#<座> → 句型骨架;码 / 状态 / 机读位不变)",
395
467
  members: {
396
- "409 decide.row_unrevivable#no_agent_name": { attr: "ends: deny it to close the card (the agent then ends as failed)", since: "7.136.0" },
397
468
  "409 decide.row_unrevivable#no_root_anchor": { attr: "ends: deny it to close the card (the agent then ends as failed)", since: "7.136.0" },
398
469
  "400 request.field_invalid#mcpServers.over_cap(受理口 · POST /v1/capabilities/mcp/probe 同句)": { attr: "head: <field> has <count> entries — at most <cap> are accepted", since: "7.136.0" },
399
470
  "400 request.field_invalid#a2aPeers.over_cap": { attr: "tail: 声明列表拒绝骨架的句尾(与 mcpServers 共用 request-declaration-refusal)", since: "7.136.0" },
@@ -419,6 +490,10 @@ export const SELF_MINTED_WIRE = {
419
490
  "400 request.field_invalid#plan_review.checkpointId.not_non_empty_string": { attr: "checkpointId must be a non-empty string (the identity of the plan gate you decided on: …)", since: "7.137.0" },
420
491
  "400 request.field_invalid#plan_review.checkpointId.too_large": { attr: "checkpointId too large (max <n> chars)", since: "7.137.0" },
421
492
  "400 request.body_shape#/decide.checkpointId(落 unsupportedKeys)": { attr: "unsupported (a body field of POST /v1/assistant/tasks/:id/plan_review — send it there, this door never reads it): checkpointId", since: "7.137.0" },
493
+ "400 request.body_shape#PATCH /v1/sessions/:id": { attr: "the body must be a JSON object carrying at least one of `title` and `pinned` (and, optionally, `expectedRowTag`), and nothing else", since: "7.139.0" },
494
+ "400 request.field_invalid#PATCH /v1/sessions/:id.expectedRowTag": { attr: "expectedRowTag must be the `rowTag` string a session list row carries (43 characters: letters, digits, `-` and `_`)", since: "7.139.0" },
495
+ "409 conflict.session_mirror#PATCH /v1/sessions/:id": { attr: "this session is a read-only mirror of a session whose writer is elsewhere — it cannot be renamed or pinned here; fork it (forkPath) to continue here; nothing was written", since: "7.139.0" },
496
+ "409 conflict.session_row_changed#PATCH /v1/sessions/:id": { attr: "the session row changed since the rowTag you sent was read — nothing was written; currentRow is the row as it stands now: decide again, then send its rowTag", since: "7.139.0" },
422
497
  },
423
498
  },
424
499
  decisionBodyKey: {
@@ -427,6 +502,14 @@ export const SELF_MINTED_WIRE = {
427
502
  "POST /v1/assistant/tasks/:id/plan_review#checkpointId": { attr: "optional;non-empty-string≤128;not-current⇒409 approval_stale;direct-door:signed-envelope-ext", since: "7.137.0" },
428
503
  },
429
504
  },
505
+ sessionRowWriteKey: {
506
+ at: "PATCH /v1/sessions/:id 体受理键与 409 拒体键(<面>#<键> → 读法 / 在场律;只登本版新增的)",
507
+ members: {
508
+ "body#expectedRowTag": { attr: "optional;43×[A-Za-z0-9_-] else 400 request.field_invalid;alone 400 request.body_shape;stale⇒409 conflict.session_row_changed", since: "7.139.0" },
509
+ "409 conflict.session_row_changed#currentRow": { attr: "always", since: "7.139.0" },
510
+ "409 conflict.session_mirror#forkPath": { attr: "always", since: "7.139.0" },
511
+ },
512
+ },
430
513
  approvalStaleBodyKey: {
431
514
  at: "409 approval_stale 拒体(<端点>#<键> → 在场律)",
432
515
  members: {
@@ -442,6 +525,13 @@ export const SELF_MINTED_WIRE = {
442
525
  toolCallId: { attr: "present-iff", since: "7.41.0" },
443
526
  },
444
527
  },
528
+ settlementEvidenceKey: {
529
+ at: "回决门族 200 体的结清证据(<键> → 在场律;五个执行 / 回放边界由一只铸函数铸)",
530
+ members: {
531
+ checkpointId: { attr: "present-iff", since: "7.138.0" },
532
+ decisionCommitted: { attr: "present-iff", since: "7.138.0" },
533
+ },
534
+ },
445
535
  approvalEnvelopeExtKey: {
446
536
  at: "直连门证明 HMAC 信封第 6 位扩展对象的键(<键> → 用它的门)",
447
537
  members: {
@@ -493,9 +583,15 @@ export const SELF_MINTED_WIRE = {
493
583
  "GET /v1/config/catalog#rows[WORKSPACE_SNAPSHOT_BUCKET].semantics": { attr: "boot-checks-bucket;runtime-latest-no-such-bucket-fails-run", since: "7.136.0" },
494
584
  "GET /v1/config/catalog#rows[WORKSPACE_SNAPSHOT_PREFIX].semantics": { attr: "multi-segment-prefix;bad-segment-refuses-boot", since: "7.136.0" },
495
585
  "GET /v1/config/catalog#rows[WORKSPACE_SNAPSHOT_PREFIX].derivedDefaultNote": { attr: "absent=>kata", since: "7.136.0" },
496
- "GET /v1/config/catalog#rows[K8S_SANDBOX_ENV].semantics": { attr: "values-only-in-the-pod-own-secret;role-needs-secrets-create;denied-refuses-boot", since: "7.137.0" },
497
- "GET /v1/sessions/:id/mcp#servers[].error": { attr: "redactSecrets-outside-engine-marks+truncate:200", since: "7.137.0" },
498
- "POST /v1/sessions/:id/mcp/reconnect#reason|status.error|listingIncomplete.error": { attr: "redactSecrets-outside-engine-marks+truncate:200", since: "7.137.0" },
586
+ "GET /v1/config/catalog#rows[K8S_SANDBOX_ENV].semantics": { attr: "values-only-in-the-pod-own-secret;role-needs-secrets-create;denied-refuses-boot;own-credential-name-refuses-boot", since: "7.139.0" },
587
+ "GET /v1/config/catalog#rows[K8S_NAMESPACE].semantics": { attr: "required-no-default;absent-or-blank-refuses-boot", since: "7.139.0" },
588
+ "GET /v1/config/catalog#rows[E2B_SANDBOX_ENV].semantics": { attr: "own-credential-name-refuses-boot", since: "7.139.0" },
589
+ "GET /v1/config/catalog#rows[DOCKER_SANDBOX_ENV].semantics": { attr: "own-credential-name-refuses-boot", since: "7.139.0" },
590
+ "GET /v1/config/catalog#rows[CONFIG_PROVIDER].semantics": { attr: "remote-without-center-url-refuses-boot", since: "7.139.0" },
591
+ "GET /v1/config/catalog#rows[RETENTION_MODE].semantics": { attr: "enforce-without-horizon-or-cadence-refuses-boot", since: "7.139.0" },
592
+ "GET /v1/config/catalog#rows[RETENTION_SWEEP_INTERVAL_SEC].semantics": { attr: "cadence-without-horizon-refuses-boot", since: "7.139.0" },
593
+ "GET /v1/sessions/:id/mcp#servers[].error": { attr: "exit-seat:mcp-remote-text(engine-mark=masked-value)+truncate:200", since: "7.138.0" },
594
+ "POST /v1/sessions/:id/mcp/reconnect#reason|status.error|listingIncomplete.error": { attr: "exit-seat:mcp-remote-text(engine-mark=masked-value)+truncate:200", since: "7.138.0" },
499
595
  "GET /v1/config/catalog#rows[MODEL_VISION].semantics": { attr: "names-engine-notice:model.capability_downgraded", since: "7.137.0" },
500
596
  "GET /v1/config/catalog#rows[MODEL_VISION].derivedDefaultNote": { attr: "names-engine-notice:model.capability_downgraded", since: "7.137.0" },
501
597
  "GET /v1/config/catalog#rows[MODEL_CHEAP_VISION].semantics": { attr: "names-engine-notice:model.capability_downgraded", since: "7.137.0" },
@@ -100,7 +100,7 @@ export type DeclaredKey = ManifestShape & {
100
100
  */
101
101
  export declare const FRAME_ENVELOPE_KEYS: readonly ["type", "sourceTaskId", "bgAgentId"];
102
102
  /** 探针文件要从 `@sema-agent/core` 具名导入的类型(`coreType` 表达式里用到的全部名字)。 */
103
- export declare const WIRE_PROJECTION_CORE_IMPORTS: readonly ["TaskEvent", "TaskNotificationPayload", "WiringManifest", "EngineNotice", "MemoryImportReport", "OriginClearanceRow", "OriginClearanceEvent", "MemoryEntryOrigin", "TraceEvent", "PromptManifestIdentity", "PromptIdentityLayers", "PromptManifestSelectors", "PromptManifestSection", "PromptChainLink", "SupersededOverlay", "ToolDisclosureManifest"];
103
+ export declare const WIRE_PROJECTION_CORE_IMPORTS: readonly ["TaskEvent", "BrainStatus", "TaskNotificationPayload", "WiringManifest", "EngineNotice", "MemoryImportReport", "OriginClearanceRow", "OriginClearanceEvent", "MemoryEntryOrigin", "TraceEvent", "PromptManifestIdentity", "PromptIdentityLayers", "PromptManifestSelectors", "PromptManifestSection", "PromptChainLink", "SupersededOverlay", "ToolDisclosureManifest"];
104
104
  /**
105
105
  * `wiring_manifest` 的 **operator 面多投的那几段**(`wiringManifestOperatorEventData` 在租户形之上加的段)。
106
106
  * operator 行的 `excluded` = 租户行减本常量(派生);四段各自的受众裁定在 `core-keyset-guard.ts` ⑥b。
@@ -129,13 +129,13 @@ export declare const WIRE_PROJECTION_FACES: {
129
129
  readonly tool_start: {
130
130
  readonly projector: "toolStartEventData";
131
131
  readonly coreType: string;
132
- readonly excluded: readonly ["requestedBy"];
132
+ readonly excluded: readonly [];
133
133
  readonly minted: readonly [];
134
134
  };
135
135
  readonly tool_end: {
136
136
  readonly projector: "toolEndEventData";
137
137
  readonly coreType: string;
138
- readonly excluded: readonly ["requestedBy", "answeredBy"];
138
+ readonly excluded: readonly [];
139
139
  readonly minted: readonly [];
140
140
  };
141
141
  readonly tool_progress: {
@@ -171,12 +171,12 @@ export declare const WIRE_PROJECTION_FACES: {
171
171
  readonly workspace_changed: {
172
172
  readonly projector: "workspaceChangedEventData";
173
173
  readonly coreType: string;
174
- readonly excluded: readonly [];
174
+ readonly excluded: readonly ["root", "remote", "entered", "project"];
175
175
  readonly minted: readonly [];
176
176
  };
177
177
  readonly status: {
178
178
  readonly projector: "brainStatusEventData";
179
- readonly coreType: string;
179
+ readonly coreType: `BrainStatus & ${string}`;
180
180
  readonly excluded: readonly [];
181
181
  readonly minted: readonly [];
182
182
  };
@@ -213,7 +213,7 @@ export declare const WIRE_PROJECTION_FACES: {
213
213
  readonly human_input: {
214
214
  readonly projector: "humanInputEventData";
215
215
  readonly coreType: string;
216
- readonly excluded: readonly ["principal"];
216
+ readonly excluded: readonly ["principal", "runOrigin"];
217
217
  readonly minted: readonly [];
218
218
  };
219
219
  readonly task_notification: {
@@ -1,6 +1,7 @@
1
1
  export const FRAME_ENVELOPE_KEYS = ["type", "sourceTaskId", "bgAgentId"];
2
2
  export const WIRE_PROJECTION_CORE_IMPORTS = [
3
3
  "TaskEvent",
4
+ "BrainStatus",
4
5
  "TaskNotificationPayload",
5
6
  "WiringManifest",
6
7
  "EngineNotice",
@@ -26,21 +27,21 @@ function withoutSections(all, drop) {
26
27
  export const WIRE_PROJECTION_FACES = {
27
28
  task_progress: { projector: "taskProgressEventData", coreType: arm("task_progress"), excluded: [], minted: [] },
28
29
  task_started: { projector: "taskStartedEventData", coreType: arm("task_started"), excluded: [], minted: [] },
29
- tool_start: { projector: "toolStartEventData", coreType: arm("tool_start"), excluded: ["requestedBy"], minted: [] },
30
- tool_end: { projector: "toolEndEventData", coreType: arm("tool_end"), excluded: ["requestedBy", "answeredBy"], minted: [] },
30
+ tool_start: { projector: "toolStartEventData", coreType: arm("tool_start"), excluded: [], minted: [] },
31
+ tool_end: { projector: "toolEndEventData", coreType: arm("tool_end"), excluded: [], minted: [] },
31
32
  tool_progress: { projector: "toolProgressEventData", coreType: arm("tool_progress"), excluded: [], minted: [] },
32
33
  tool_disclosure: { projector: "toolDisclosureEventData", coreType: arm("tool_disclosure"), excluded: [], minted: [] },
33
34
  tool_roster_delta: { projector: "toolRosterDeltaEventData", coreType: arm("tool_roster_delta"), excluded: [], minted: [] },
34
35
  diagnostics: { projector: "diagnosticsEventData", coreType: arm("diagnostics"), excluded: [], minted: [] },
35
36
  steering_injected: { projector: "steeringInjectedEventData", coreType: arm("steering_injected"), excluded: [], minted: [] },
36
- workspace_changed: { projector: "workspaceChangedEventData", coreType: arm("workspace_changed"), excluded: [], minted: [] },
37
- status: { projector: "brainStatusEventData", coreType: arm("status"), excluded: [], minted: [] },
37
+ workspace_changed: { projector: "workspaceChangedEventData", coreType: arm("workspace_changed"), excluded: ["root", "remote", "entered", "project"], minted: [] },
38
+ status: { projector: "brainStatusEventData", coreType: `BrainStatus & ${arm("status")}`, excluded: [], minted: [] },
38
39
  compacted: { projector: "compactedEventData", coreType: arm("compacted"), excluded: [], minted: [] },
39
40
  context_usage: { projector: "contextUsageEventData", coreType: arm("context_usage"), excluded: [], minted: [] },
40
41
  turn_end: { projector: "turnEndEventData", coreType: arm("turn_end"), excluded: [], minted: [] },
41
42
  compaction_outcome: { projector: "compactionOutcomeEventData", coreType: arm("compaction_outcome"), excluded: [], minted: [] },
42
43
  compaction_started: { projector: "compactionStartedEventData", coreType: arm("compaction_started"), excluded: [], minted: [] },
43
- human_input: { projector: "humanInputEventData", coreType: arm("human_input"), excluded: ["principal"], minted: [] },
44
+ human_input: { projector: "humanInputEventData", coreType: arm("human_input"), excluded: ["principal", "runOrigin"], minted: [] },
44
45
  task_notification: {
45
46
  projector: "taskNotificationEventData",
46
47
  coreType: `TaskNotificationPayload & ${arm("task_notification")}`,
@@ -12,7 +12,7 @@
12
12
  * 拒句从源头不含解析记号 —— 判官只给规则词,值只经本模块的展示律出现。
13
13
  *
14
14
  * ## 读者
15
- * 中心基址三席 + 公告地址 + 请求期 `centerFetch`(`web-admin-client/center-request.ts` `pathBaseUrlRefusal`:禁 userinfo / query / fragment)·
15
+ * 中心基址三席 + 公告地址 + 记忆同步中心基址 `MEMORY_SYNC_URL` + 请求期 `centerFetch`(`web-admin-client/center-request.ts` `pathBaseUrlRefusal`:禁 userinfo / query / fragment)·
16
16
  * 续签 issuer(只问形)· 模型路由三键(`model-route-url.ts`:禁 userinfo / fragment,query 照收)· `MEMORY_EMBEDDER_ENDPOINT` 与
17
17
  * `A2A_SERVE_URL`(禁 userinfo)· `SANDBOX_PKG_SOURCE=custom` 六只地址(形 + 带凭据,后者的判官是契约包根的 `findUrlCredential`,拒句经 {@link buildUrlCredentialRefusal})。
18
18
  * 「scheme 只有判官与展示铸点读」由 `test/config-url-display-safe.test.ts` 的读者普查门钉住。
@@ -1,5 +1,5 @@
1
- /** 非用户正文块的闭集标签(引擎 / 壳注入)。加一个标签 = 改这里一处:下面的正则由本表生成。 */
2
- export declare const INJECTED_BLOCK_TAGS: readonly ["system-reminder", "task-notification", "attachment"];
1
+ /** 非用户正文块的闭集标签(引擎 / 壳注入)。加一个标签 = 改这里一处:下面的正则由本表生成(分支组的序 = 本表的序)。 */
2
+ export declare const INJECTED_BLOCK_TAGS: readonly ["system-reminder", "task-notification", "attachment", "command-name", "command-message", "command-args", "local-command-stdout", "local-command-stderr", "local-command-caveat", "bash-input", "bash-stdout", "bash-stderr", "bash-exit-code", "user-memory-input"];
3
3
  /**
4
4
  * 注入块的唯一一只正则(由 {@link INJECTED_BLOCK_TAGS} 生成)。**只配 `String.prototype.replace` 使用**(带 `g`,
5
5
  * `lastIndex` 有状态,拿去 `.test` / `.exec` 会读到上一次的位置)。
@@ -1,5 +1,20 @@
1
1
  import { redactSecrets } from "./trace/redact.js";
2
- export const INJECTED_BLOCK_TAGS = ["system-reminder", "task-notification", "attachment"];
2
+ export const INJECTED_BLOCK_TAGS = [
3
+ "system-reminder",
4
+ "task-notification",
5
+ "attachment",
6
+ "command-name",
7
+ "command-message",
8
+ "command-args",
9
+ "local-command-stdout",
10
+ "local-command-stderr",
11
+ "local-command-caveat",
12
+ "bash-input",
13
+ "bash-stdout",
14
+ "bash-stderr",
15
+ "bash-exit-code",
16
+ "user-memory-input",
17
+ ];
3
18
  export const INJECTED_BLOCK_RE = new RegExp(`<(${INJECTED_BLOCK_TAGS.join("|")})(?:\\s(?:[^<>"']|"[^"<]*"|'[^'<]*')*?)?(?:\\/>|>[\\s\\S]*?(?:<\\/\\1>|$))\\s*`, "g");
4
19
  export function stripInjectedBlocks(text) {
5
20
  return text.replace(INJECTED_BLOCK_RE, "");
@@ -94,9 +94,11 @@ export declare function withModelPlaneOf<E extends EffectiveConfig>(target: E, s
94
94
  */
95
95
  export declare function fullyLandedForLkg(read: ConfigCandidateRead, report: ApplyReport | undefined): boolean;
96
96
  /**
97
- * [ref]:组拒码 → 铸它的那条模型面不变量 —— **以码为键**(组拒码闭集的属主是 settings-schema `MODEL_PLANE_REFUSAL_CODES`;那边加一个码
98
- * ⇒ 本表缺键 ⇒ 本仓 tsc 红)。模型面 stage 的组拒按**码**铸(码是判决那刻的数据),不变量 id 由本表派生 —— 一个 id 两个码
99
- * (`model-route-endpoint`)时码不可能从 id 反推,反过来查才是全函数。
97
+ * [ref]:组拒码 → 铸它的那条模型面不变量 —— **以码为键**。组拒码闭集的属主是 settings-schema `MODEL_PLANE_REFUSAL_CODES`,每个码恰有**一个铸码方**,
98
+ * 分两本账(下面两个表 + 三道编译门;那边加一个码而这两本都没收 ⇒ 本仓 tsc 红):
99
+ * · 本表 = **本仓模型面 stage 自己铸**的码 → 铸它的不变量。模型面 stage 的组拒按**码**铸(码是判决那刻的数据),不变量 id 由本表派生 —— 一个 id 两个码
100
+ * (`model-route-endpoint`)时码不可能从 id 反推,反过来查才是全函数;
101
+ * · {@link ENGINE_MINTED_PLANE_REFUSAL_CODES} = 契约包出码、执法者是本仓但**今天未执法**的码(名字里的 ENGINE 沿契约包的词义 = worker,即本仓),本仓 stage 现在不铸。
100
102
  */
101
103
  export declare const PLANE_REFUSAL_INVARIANT_OF: {
102
104
  readonly "config.default_model_missing": "default-model-resolvable";
@@ -104,6 +106,18 @@ export declare const PLANE_REFUSAL_INVARIANT_OF: {
104
106
  readonly "config.model_route_endpoint_missing": "model-route-endpoint";
105
107
  readonly "config.gateway_fallback_without_primary": "model-route-endpoint";
106
108
  };
109
+ /**
110
+ * 契约包出码、执法者是本仓但今天**未执法**的两只组拒码:本地配置腿上「管模型面的目录会顶替已声明的 env 表、决定不是 `replaced`」那道闸,与「每个任务都要解的 summarize 落不到可服务条目」的不变量。
111
+ *
112
+ * 词义:settings-schema 发布说明里的「engine / 引擎一侧」指**本仓(worker)**,不是 `@sema-agent/core` —— 这两码要的全部输入(本地配置腿、env 表、模型面 stage 与组拒口)只在本仓,core 里没有读
113
+ * `MODEL_ID` / `config.d` 的地方、也没有组拒码。(契约包自己有几处把同一个词写成 core 7.58.0,那是它的叫法错。)所以本仓 stage 现在没有对应的不变量、不铸这两个码,不是因为「归引擎」,而是**还没做**,两码各自候什么:
114
+ * · `CATALOG_REPLACES_ENV_MODELS_CODE`:执法是一整组跨仓件 —— 开机迁移 SS-M11(铸决定文档)· 本地腿每拍读决定(读数身份进候选的 etag)· 目录信任判官走根级文档 · 命令行 / 桌面 / 客户端核心三个写者先接契约包的计划助手;
115
+ * 候设计票。在那之前,候选目录管着模型面而 env 表也声明了时,仍照旧由目录服务(与升级前逐位同)。
116
+ * · `SUMMARIZE_MODEL_MISSING_CODE`:码的前提是「summarize 落不到可服务条目 ⇒ 采纳后每个任务都被拒」,而本仓所钉 core 7.59.0 起非严格座位(summarize 在内)点名目录里没有的词时读作未设、沿自己的回落链走
117
+ * (summarize 的链是 → default,即回落缺省模型)并通告 `model.role_defaulted`;链上没有可解的模型才拒 —— 前提与所钉 core 相抵,候上游(settings-schema / core)重定义或退役这个码;在那之前 summarize 角色绑到不可用条目时仍是角色绑定那一行 warn(`ROLE_BINDING_UNAVAILABLE_HINT`),不是组拒。
118
+ * 两码开始被铸之后,它们进 `/health.modelRefusals.plane` 的座位是**另案设计**(现在没有座:见 `model-plane-face.ts` 对「装配期被引擎整份拒收」的披露),不在这张表里偷铸一个不变量替它占位。
119
+ */
120
+ export declare const ENGINE_MINTED_PLANE_REFUSAL_CODES: readonly ["config.catalog_replaces_env_models", "config.summarize_model_missing"];
107
121
  /**
108
122
  * [ref] —— **「无中心配置」档的候选**:中心凭证换人时,server 把在用的中心配置降到这一档({@link applyEffective} 吃它,和吃任何候选走同一条 stage → swap → commit)。
109
123
  * 它的意思是「**撤回**中心配置」—— 中心下发的每个热面回 env 底:
@@ -1,8 +1,8 @@
1
- import { expandTiers, resolveTaskModel as coreResolveTaskModel } from "@sema-agent/core";
2
- import { WEB_ADMIN_ENV, narrowAtMention, resolveActiveTiers, resolveCatalogDefaultModel } from "@sema-agent/settings-schema";
1
+ import { expandTiers, modelOriginOf, resolveTaskModel as coreResolveTaskModel } from "@sema-agent/core";
2
+ import { CATALOG_REPLACES_ENV_MODELS_CODE, SUMMARIZE_MODEL_MISSING_CODE, WEB_ADMIN_ENV, narrowAtMention, resolveActiveTiers, resolveCatalogDefaultModel } from "@sema-agent/settings-schema";
3
3
  import { modelKeyPoison } from "../key-resolver.js";
4
4
  import { buildEnvModelIdNotServedNotice, mintCapabilityKeys, readAtMention, servedModelTableLeg } from "../model-select.js";
5
- import { applyAutoCompactWindow, buildModelCostKey, parseAutonomy, unmatchableToolNamesRefusal } from "../config.js";
5
+ import { applyAutoCompactWindow, buildModelCostKey, ownCredentialHitsInForce, parseAutonomy, unmatchableToolNamesRefusal } from "../config.js";
6
6
  import { NAME_TABLE_BEHAVIOR } from "../namespaced-rule-name.js";
7
7
  import { buildModelCompat, readModelCompat } from "../model-compat.js";
8
8
  import { buildModelHeadersKey } from "../model-entry-headers.js";
@@ -118,7 +118,7 @@ export function applyEffective(config, eff, logger, opts) {
118
118
  }
119
119
  const mp = staged.modelPlaneGroup.stages.models;
120
120
  if (mp !== undefined) {
121
- declareCandidateWithheldEnv(mp.modelApiKeyEnv, staged.version);
121
+ declareCandidateWithheldEnv(config, mp.modelApiKeyEnv, staged.version);
122
122
  if (opts.swapPlane !== undefined) {
123
123
  try {
124
124
  opts.swapPlane({ models: mp.models, tiers: mp.activeTiers });
@@ -171,17 +171,25 @@ export function applyEffective(config, eff, logger, opts) {
171
171
  logger?.info("web_admin_projects", { projects: Object.keys(staged.projects) });
172
172
  return true;
173
173
  }
174
- function declareCandidateWithheldEnv(modelApiKeyEnv, version) {
174
+ function declareCandidateWithheldEnv(seats, modelApiKeyEnv, version) {
175
+ const entries = Object.entries(modelApiKeyEnv)
176
+ .map(([model, envName]) => `${model}→${envName}`)
177
+ .join(", ");
175
178
  try {
176
179
  declareServerWithheldEnv(modelApiKeyEnv);
177
180
  }
178
181
  catch (err) {
179
- const entries = Object.entries(modelApiKeyEnv)
180
- .map(([model, envName]) => `${model}→${envName}`)
181
- .join(", ");
182
182
  throw new Error(`model catalog (effective v${version}): a model entry's apiKeyEnv names a variable the engine cannot withhold from model-driven shells — ` +
183
183
  `the candidate is refused whole and the current generation keeps serving; fix that entry's apiKeyEnv (entries: ${entries}). Engine: ${err instanceof Error ? err.message : String(err)}`);
184
184
  }
185
+ const handedOn = ownCredentialHitsInForce(seats);
186
+ if (handedOn.length === 0)
187
+ return;
188
+ withdrawServerWithheldEnv();
189
+ throw new Error(`model catalog (effective v${version}): a model entry's apiKeyEnv names a variable a name-list env knob hands on — ` +
190
+ handedOn.map((h) => `env ${h.knob} hands on ${h.name}, which this candidate makes ${h.problem}`).join("; ") +
191
+ `; or point that entry's apiKeyEnv at a variable no name list hands on. The name lists are read at boot (changing one takes a restart); ` +
192
+ `the candidate is refused whole and the current generation keeps serving (entries: ${entries}).`);
185
193
  }
186
194
  function commitStaged(config, staged) {
187
195
  const mp = staged.modelPlaneGroup.stages.models;
@@ -240,13 +248,14 @@ export const PLANE_REFUSAL_INVARIANT_OF = {
240
248
  "config.model_route_endpoint_missing": "model-route-endpoint",
241
249
  "config.gateway_fallback_without_primary": "model-route-endpoint",
242
250
  };
251
+ export const ENGINE_MINTED_PLANE_REFUSAL_CODES = [CATALOG_REPLACES_ENV_MODELS_CODE, SUMMARIZE_MODEL_MISSING_CODE];
243
252
  function modelPlaneGroupReport(group) {
244
253
  return {
245
254
  applied: MODEL_PLANE_DOMAINS.flatMap((d) => (group.stages[d] !== undefined ? MODEL_PLANE_SURFACES[d] : [])),
246
255
  ...(group.rejected !== undefined ? { rejected: { keys: group.rejected.keys, reason: group.rejected.reason } } : {}),
247
256
  };
248
257
  }
249
- const ROLE_BINDING_UNAVAILABLE_HINT = "tasks resolving this role fail: alias/tier expansion cannot mint this name; the engine refuses it loud — bind the role to a usable model, or make the entry usable (see the entry's own warn)";
258
+ const ROLE_BINDING_UNAVAILABLE_HINT = "alias/tier expansion cannot mint this name, so the engine does not hold it: a strict seat (default, classifier) refuses the task loud; any other role reads as unset and falls back along its own chain with a model.role_defaulted notice (refused only when nothing on that chain resolves) — bind the role to a usable model, or make the entry usable (see the entry's own warn)";
250
259
  export const NO_CENTER_EFFECTIVE = deepFreeze({ version: 0, updatedAt: "", models: { models: [], roles: {} }, mcp: { servers: [] } });
251
260
  export const isNoCenterEffective = (eff) => eff === NO_CENTER_EFFECTIVE;
252
261
  function deepFreeze(v) {
@@ -636,7 +645,8 @@ function engineDefaultOfSelect(select, models, activeTiers) {
636
645
  catch (err) {
637
646
  return { unresolved: err instanceof Error ? err.message : String(err) };
638
647
  }
639
- const name = Object.keys(models).find((n) => models[n] === picked);
648
+ const origin = modelOriginOf(picked);
649
+ const name = Object.keys(models).find((n) => models[n] === origin);
640
650
  return name !== undefined ? { name } : { unresolved: "the engine picked a model object that is not an entry of the usable catalog" };
641
651
  }
642
652
  export function logEffectiveDiff(config, eff, logger) {
@@ -82,8 +82,9 @@ export interface CenterRequestInit {
82
82
  }
83
83
  /**
84
84
  * 「后面要拼路径的基址」的拒句 —— 中心基址三席(`SEMA_WEB_ADMIN_URL` / `SEMA_WEB_ADMIN_LIVE_URL` / `SEMA_WEB_ADMIN_WEB_URL`)与本实例的
85
- * 公告地址(`FLEET_ADVERTISE_ADDRESS`,中心往它后面拼 `/v1/...`)同读。判官是 settings-schema 的 `httpUrlFlaws`(层级式 http(s) URL;Node 的 fetch
86
- * 认 `file://` / `data:`,配错的地址不许变成读本地文件),本函数只声明这一席禁哪几件({@link PATH_BASE_FORBIDS})。起服时 `config.ts` 判
85
+ * 公告地址(`FLEET_ADVERTISE_ADDRESS`,中心往它后面拼 `/v1/...`)同读。判官是 settings-schema 的 `pathBaseUrlFlaws`(14.7.0 起:这一座位的禁用集
86
+ * userinfo / query / fragment 与判官都在契约包,= `httpUrlFlaws` 配那一集;层级式 http(s) URL,Node 的 fetch 认 `file://` / `data:`,配错的地址不许变成
87
+ * 读本地文件),本仓零禁用集副本,编排器渲染公告地址 env 的一方调的是同一只。起服时 `config.ts` 判
87
88
  * (拒启),请求期 {@link centerFetch} 对同一份基址再判一次(自拼 `ServiceConfig` 的嵌入方也吃同一条规则)。合格 ⇒ `undefined`;否则交回
88
89
  * `<subject> <规则词>; got "<展示面安全形>"` —— 拒句里没有从值里解析出来的任何记号(scheme / userinfo / 主机名),捕获点照原样落日志即可。
89
90
  */
@@ -2,7 +2,7 @@ import settingsSchemaPackage from "@sema-agent/settings-schema/package.json" wit
2
2
  import { AUTH_V1_PATHS } from "@sema-agent/settings-schema/api/auth";
3
3
  import { FLEET_LIVE_PATHS, FLEET_PATHS } from "@sema-agent/settings-schema/fleet";
4
4
  import { CenterCredentialUnavailableError } from "../center-credential.js";
5
- import { WEB_ADMIN_ENV, httpUrlFlaws } from "@sema-agent/settings-schema";
5
+ import { WEB_ADMIN_ENV, httpUrlFlaws, pathBaseUrlFlaws } from "@sema-agent/settings-schema";
6
6
  import { buildHttpUrlRefusal } from "../url-refusal.js";
7
7
  import { egressRedirectRefusal } from "../egress-redirect.js";
8
8
  export const SCHEMA_MAJOR_HEADER = "x-sema-schema-major";
@@ -82,9 +82,8 @@ async function sendToCenter(fix, url, wire) {
82
82
  throw new CenterRedirectRefusedError(res.status, `web-admin center request: ${refusal}`);
83
83
  return res;
84
84
  }
85
- const PATH_BASE_FORBIDS = ["userinfo", "query", "fragment"];
86
85
  export function pathBaseUrlRefusal(subject, raw) {
87
- const flaws = httpUrlFlaws(raw, PATH_BASE_FORBIDS);
86
+ const flaws = pathBaseUrlFlaws(raw);
88
87
  return flaws.length === 0 ? undefined : buildHttpUrlRefusal(subject, raw, flaws);
89
88
  }
90
89
  function assertPathBaseUrl(raw, what) {
@@ -1,6 +1,7 @@
1
1
  import { type A2aServerSpec, type McpServerSpec, type SkillSpec } from "@sema-agent/core";
2
2
  import type { CenterMcp, ScopedA2aPeer } from "../config-types.js";
3
3
  import type { Logger } from "../observability/logger.js";
4
+ import { type PeerDesk, type PeerLease } from "../peer-seat.js";
4
5
  import type { LoadedSkill } from "../capabilities/skills.js";
5
6
  import type { ConfigProvider } from "../config-provider.js";
6
7
  import type { CenterA2aPeer, CenterMcpServer, CenterSkillManifest } from "./types.js";
@@ -53,14 +54,16 @@ export declare function applySkillsManifest(baseline: LoadedSkill[], manifest: {
53
54
  }, bodies: SkillBodySource, logger?: Logger): Promise<LoadedSkill[]>;
54
55
  /**
55
56
  * Resolve center MCP servers (`/effective.mcp`) into core `McpServerSpec`s + the scenarios each applies to.
56
- * env-NAME refs → real values from THIS service's env (secret boundary unchanged); a server with any missing
57
+ * env-NAME refs → real values from THIS service's env (secret boundary unchanged), registered on `desk` under `rosterLease`
58
+ * (the desk's one minting point `mintDeclaration`, called only for an entry that mounts — after every judge below has passed, so a skipped
59
+ * entry never holds a registration): the spec carries the minted reference, never the values. A server with any missing
57
60
  * ref is skipped (`resolveRefs` → null). `enabled:false` skipped. A server whose `toolFaces` / `toolAxes` declaration is
58
61
  * malformed is skipped whole (both are trust-root declarations — the engine's `readToolFaces` / `readMcpToolAxes` judge them). Restart-to-apply
59
62
  * (filtered per scenario in `resolveSpec` via `mcpForScenario`).
60
63
  */
61
64
  export declare function resolveMcpServers(mcp: {
62
65
  servers: CenterMcpServer[];
63
- }, logger?: Logger): CenterMcp;
66
+ }, desk: Pick<PeerDesk, "declare">, rosterLease: PeerLease, logger?: Logger): CenterMcp;
64
67
  /** The MCP servers applicable to a scenario: tagged with it, or untagged (global). undefined when none.
65
68
  * [ref]:alias 窗撤销,单键命中(同 `skillsForScenario`)。 */
66
69
  export declare function mcpForScenario(center: CenterMcp | undefined, scenario: string): McpServerSpec[] | undefined;
@@ -68,7 +71,8 @@ export declare function mcpForScenario(center: CenterMcp | undefined, scenario:
68
71
  * DESIGN-269 §2.1 —— resolve center A2A peers (`/effective.a2a`) into core `A2aServerSpec`s + the scenarios
69
72
  * each applies to. Exact sibling of {@link resolveMcpServers}, same three rules:
70
73
  * · header-NAME refs → real values from THIS service's env (the secret boundary is unchanged — the center
71
- * never holds the bearer). A peer with ANY missing ref is SKIPPED wholesale (`resolveRefs` → null):
74
+ * never holds the bearer), registered on `desk` under `rosterLease` (`mintDeclaration`, only for a peer that mounts); the spec carries the minted
75
+ * reference, never the values. A peer with ANY missing ref is SKIPPED wholesale (`resolveRefs` → null):
72
76
  * dialing a remote AGENT with half the credentials is the wrong failure direction.
73
77
  * · `enabled:false` skipped.
74
78
  * · restart-to-apply (filtered per scenario in `resolveSpec` via {@link a2aForScenario}).
@@ -83,7 +87,7 @@ export declare function mcpForScenario(center: CenterMcp | undefined, scenario:
83
87
  */
84
88
  export declare function resolveA2aPeers(a2a: {
85
89
  peers: CenterA2aPeer[];
86
- }, logger?: Logger): ScopedA2aPeer[];
90
+ }, desk: Pick<PeerDesk, "declare">, rosterLease: PeerLease, logger?: Logger): ScopedA2aPeer[];
87
91
  /** The A2A peers applicable to a scenario: tagged with it, or untagged (global). undefined when none.
88
92
  * Twin of {@link mcpForScenario} — `undefined` (not `[]`) is load-bearing: an empty array would put an
89
93
  * `a2a: []` key on the spec, i.e. "this deployment declares an empty peer set", where absence means
@@ -1,8 +1,9 @@
1
1
  import { readMcpSourceLabel } from "../mcp-source-label.js";
2
2
  import { skillContentHash } from "@sema-agent/settings-schema";
3
- import { readMcpToolAxes, readToolFaces } from "@sema-agent/core";
3
+ import { judgeSessionMetaKey, readMcpToolAxes, readToolFaces } from "@sema-agent/core";
4
4
  import { MCP_CONTENT_ORIGINS, describeBadContentOrigin, describeBadWireName, isContentOriginWord, isUsableWireName } from "@sema-agent/settings-schema";
5
- import { noteMcpAssertionHeaderNotSent, sentMcpAssertionHeaderMember, withholdsMcpAssertionHeader } from "../mcp-assertion-header.js";
5
+ import { noteMcpAssertionHeaderNotSent, withholdsMcpAssertionHeader } from "../mcp-assertion-header.js";
6
+ import { mintDeclaration, peerSentence } from "../peer-seat.js";
6
7
  import { SHA256_HEX_RE } from "../digest-form.js";
7
8
  export function skillToolListsOf(source) {
8
9
  return {
@@ -115,7 +116,7 @@ function resolveRefs(refs, server, kind, logger, event = "web_admin_mcp_env_miss
115
116
  }
116
117
  return out;
117
118
  }
118
- export function resolveMcpServers(mcp, logger) {
119
+ export function resolveMcpServers(mcp, desk, rosterLease, logger) {
119
120
  const out = [];
120
121
  const reservedNames = (mcp.servers ?? []).map((s) => s.name);
121
122
  for (const s of mcp.servers ?? []) {
@@ -147,7 +148,7 @@ export function resolveMcpServers(mcp, logger) {
147
148
  if (!facesRead.ok) {
148
149
  logger?.warn("web_admin_mcp_tool_faces_invalid", {
149
150
  server: s.name,
150
- problem: facesRead.problem,
151
+ problem: peerSentence(facesRead.problem),
151
152
  note: "server SKIPPED — a toolFaces overlay is a NARROWING declaration (its pathTarget is what the sensitive-path / write fences read); mounting the server without it would silently drop the protection you declared. Fix the entry and republish.",
152
153
  });
153
154
  continue;
@@ -157,20 +158,32 @@ export function resolveMcpServers(mcp, logger) {
157
158
  if (!axesRead.ok) {
158
159
  logger?.warn("web_admin_mcp_tool_axes_invalid", {
159
160
  server: s.name,
160
- problem: axesRead.problem,
161
+ problem: peerSentence(axesRead.problem),
161
162
  note: "server SKIPPED — a toolAxes declaration is a TRUST-ROOT declaration (it can lower an effect so a call skips the approval fence, or raise one); mounting the server without it, or with a half of it, would silently change what you declared. Fix the entry and republish.",
162
163
  });
163
164
  continue;
164
165
  }
165
166
  const toolAxes = axesRead.toolAxes === undefined ? {} : { toolAxes: axesRead.toolAxes };
167
+ const metaKey = judgeSessionMetaKey(s.sessionMetaKey);
168
+ if ("problem" in metaKey) {
169
+ logger?.warn("web_admin_mcp_session_meta_key_invalid", {
170
+ server: s.name,
171
+ problem: peerSentence(metaKey.problem),
172
+ note: "server SKIPPED — its sessionMetaKey cannot ride (the engine's judge refused it); mounting the server without the key would silently drop the session id it declared it needs. Fix the entry and republish.",
173
+ });
174
+ continue;
175
+ }
176
+ const sessionMetaKey = metaKey.key === undefined ? {} : { sessionMetaKey: metaKey.key };
177
+ const startupTimeout = s.startupTimeoutMs === undefined ? {} : { startupTimeoutMs: s.startupTimeoutMs };
166
178
  if (s.transport.kind === "stdio") {
167
179
  const env = resolveRefs(s.transport.envRefs, s.name, "env", logger);
168
180
  if (env === null)
169
181
  continue;
170
- out.push({
171
- scenarios: s.scenarios ?? [],
172
- spec: { name: s.name, transport: { kind: "stdio", command: s.transport.command, args: s.transport.args, ...(Object.keys(env).length ? { env } : {}) }, ...allow, ...elicit, ...contentOrigin, ...source, ...toolFaces, ...toolAxes },
173
- });
182
+ const draft = {
183
+ spec: { name: s.name, transport: { kind: "stdio", command: s.transport.command, args: s.transport.args }, ...allow, ...elicit, ...contentOrigin, ...source, ...toolFaces, ...toolAxes, ...sessionMetaKey, ...startupTimeout },
184
+ pieces: env,
185
+ };
186
+ out.push({ scenarios: s.scenarios ?? [], spec: mintDeclaration(desk, draft, rosterLease) });
174
187
  }
175
188
  else {
176
189
  const headers = resolveRefs(s.transport.headerRefs, s.name, "header", logger);
@@ -178,10 +191,11 @@ export function resolveMcpServers(mcp, logger) {
178
191
  continue;
179
192
  if (withholdsMcpAssertionHeader(s.transport.assertionHeader))
180
193
  noteMcpAssertionHeaderNotSent(logger, s.name);
181
- out.push({
182
- scenarios: s.scenarios ?? [],
183
- spec: { name: s.name, transport: { kind: "http", url: s.transport.url, ...(Object.keys(headers).length ? { headers } : {}), ...(s.transport.principalHeader ? { principalHeader: s.transport.principalHeader } : {}), ...sentMcpAssertionHeaderMember(s.transport.assertionHeader) }, ...allow, ...elicit, ...contentOrigin, ...source, ...toolFaces, ...toolAxes },
184
- });
194
+ const draft = {
195
+ spec: { name: s.name, transport: { kind: "http", url: s.transport.url, ...(s.transport.principalHeader ? { principalHeader: s.transport.principalHeader } : {}) }, ...allow, ...elicit, ...contentOrigin, ...source, ...toolFaces, ...toolAxes, ...sessionMetaKey, ...startupTimeout },
196
+ pieces: headers,
197
+ };
198
+ out.push({ scenarios: s.scenarios ?? [], spec: mintDeclaration(desk, draft, rosterLease) });
185
199
  }
186
200
  }
187
201
  if (out.length > 0)
@@ -195,7 +209,7 @@ export function mcpForScenario(center, scenario) {
195
209
  const hit = servers.filter((s) => s.scenarios.length === 0 || s.scenarios.includes(scenario)).map((s) => s.spec);
196
210
  return hit.length > 0 ? hit : undefined;
197
211
  }
198
- export function resolveA2aPeers(a2a, logger) {
212
+ export function resolveA2aPeers(a2a, desk, rosterLease, logger) {
199
213
  const out = [];
200
214
  for (const p of a2a.peers ?? []) {
201
215
  if (p.enabled === false)
@@ -210,17 +224,17 @@ export function resolveA2aPeers(a2a, logger) {
210
224
  const headers = resolveRefs(p.headerRefs, p.name, "header", logger, "web_admin_a2a_env_missing", "skipping this A2A peer — referenced env var is unset in this service");
211
225
  if (headers === null)
212
226
  continue;
213
- out.push({
214
- scenarios: p.scenarios ?? [],
227
+ const draft = {
215
228
  spec: {
216
229
  name: p.name,
217
230
  url: p.url,
218
231
  ...(p.cardUrl ? { cardUrl: p.cardUrl } : {}),
219
- ...(Object.keys(headers).length ? { headers } : {}),
220
232
  ...(p.principalHeader ? { principalHeader: p.principalHeader } : {}),
221
233
  ...(p.allowSkills && p.allowSkills.length > 0 ? { allowSkills: p.allowSkills } : {}),
222
234
  },
223
- });
235
+ pieces: headers,
236
+ };
237
+ out.push({ scenarios: p.scenarios ?? [], spec: mintDeclaration(desk, draft, rosterLease) });
224
238
  }
225
239
  if (out.length > 0)
226
240
  logger?.info("web_admin_a2a", { peers: out.map((p) => p.spec.name) });