@sema-agent/server 7.52.1 → 7.54.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 (342) hide show
  1. package/USAGE.md +7 -1
  2. package/dist/adoption/plan.d.ts +3 -3
  3. package/dist/adoption/quiesce.d.ts +1 -1
  4. package/dist/adoption/sql.d.ts +2 -2
  5. package/dist/adoption/wire.d.ts +1 -1
  6. package/dist/approval-ask-machine.d.ts +2 -2
  7. package/dist/approval-card.d.ts +18 -18
  8. package/dist/approval-deny-reasons.d.ts +1 -1
  9. package/dist/approval-hmac.d.ts +2 -2
  10. package/dist/approval-reconciler.d.ts +14 -14
  11. package/dist/approval.d.ts +2 -2
  12. package/dist/audit.d.ts +4 -4
  13. package/dist/auth-keys.d.ts +6 -6
  14. package/dist/bench/l8/artifact.d.ts +6 -1
  15. package/dist/bench/l8/artifact.js +2 -27
  16. package/dist/bench/l8/escape.d.ts +3 -3
  17. package/dist/bench/l8/index.d.ts +1 -1
  18. package/dist/bench/s1/arms.d.ts +3 -3
  19. package/dist/bench/s1/oracle.d.ts +2 -2
  20. package/dist/bench/s1/reviewer.d.ts +1 -1
  21. package/dist/bench/s1/row.d.ts +5 -5
  22. package/dist/bench/s1/runner-ctx.d.ts +3 -3
  23. package/dist/boot/config-center.d.ts +14 -7
  24. package/dist/boot/config-center.js +4 -2
  25. package/dist/boot/coordinators.d.ts +4 -4
  26. package/dist/boot/crash-last.d.ts +1 -1
  27. package/dist/boot/device-lane.d.ts +3 -3
  28. package/dist/boot/engine-lease.d.ts +4 -4
  29. package/dist/boot/governance-seams.d.ts +5 -5
  30. package/dist/boot/leader.d.ts +5 -5
  31. package/dist/boot/leader.js +2 -0
  32. package/dist/boot/limit-sync.d.ts +1 -1
  33. package/dist/boot/memory-boundary.d.ts +5 -5
  34. package/dist/boot/memory-consolidation.d.ts +8 -2
  35. package/dist/boot/memory-consolidation.js +1 -0
  36. package/dist/boot/org-memory.d.ts +5 -5
  37. package/dist/boot/parked-revive-gate.d.ts +6 -6
  38. package/dist/boot/permission-rules-audit.d.ts +2 -2
  39. package/dist/boot/reapers.d.ts +8 -8
  40. package/dist/boot/resolve-spec.d.ts +4 -4
  41. package/dist/boot/resolve-spec.js +1 -3
  42. package/dist/boot/retention-lane.d.ts +1 -1
  43. package/dist/boot/runner-deps.d.ts +53 -27
  44. package/dist/boot/runner-deps.js +16 -9
  45. package/dist/boot/runtime-caps.d.ts +4 -4
  46. package/dist/boot/session-faces.d.ts +1 -1
  47. package/dist/boot/shutdown.d.ts +10 -10
  48. package/dist/boot/shutdown.js +1 -1
  49. package/dist/boot/side-query-lane.d.ts +14 -14
  50. package/dist/boot/stores.js +5 -0
  51. package/dist/boot/task-list-lane.d.ts +3 -3
  52. package/dist/boot/webfetch-summarize-lane.d.ts +9 -9
  53. package/dist/boot/workflow-orchestration.d.ts +1 -1
  54. package/dist/bounded-session-map.d.ts +1 -1
  55. package/dist/brain.d.ts +3 -3
  56. package/dist/budget.d.ts +3 -3
  57. package/dist/canonical-json.d.ts +53 -0
  58. package/dist/canonical-json.js +48 -0
  59. package/dist/capabilities/center-prompts.d.ts +13 -13
  60. package/dist/capabilities/collab-workflows.d.ts +1 -1
  61. package/dist/capabilities/hands-lane.d.ts +4 -4
  62. package/dist/capabilities/memory-notice.d.ts +4 -4
  63. package/dist/capabilities/prompt.d.ts +2 -2
  64. package/dist/capabilities/sandbox-file-send.d.ts +2 -2
  65. package/dist/capabilities/scenarios.d.ts +16 -16
  66. package/dist/capabilities/skills.d.ts +1 -1
  67. package/dist/capabilities/team.d.ts +13 -12
  68. package/dist/capabilities/tool-defer.d.ts +6 -6
  69. package/dist/config-catalog.d.ts +139 -0
  70. package/dist/config-catalog.js +556 -0
  71. package/dist/config-center/apply-effective.d.ts +42 -30
  72. package/dist/config-center/apply-effective.js +69 -62
  73. package/dist/config-center/apply-ledger.d.ts +6 -6
  74. package/dist/config-center/effective-keys.d.ts +30 -0
  75. package/dist/config-center/effective-keys.js +49 -0
  76. package/dist/config-center/facade.d.ts +6 -5
  77. package/dist/config-center/facade.js +1 -1
  78. package/dist/config-center/hot-keys-registry.d.ts +2 -2
  79. package/dist/config-center/http-client.d.ts +5 -5
  80. package/dist/config-center/mcp-revocation.d.ts +6 -4
  81. package/dist/config-center/mcp-revocation.js +2 -12
  82. package/dist/config-center/restart-signal.d.ts +11 -1
  83. package/dist/config-center/restart-signal.js +4 -10
  84. package/dist/config-center/skills-mcp.d.ts +2 -2
  85. package/dist/config-center/stage-limits.d.ts +3 -3
  86. package/dist/config-center/types.d.ts +42 -59
  87. package/dist/config-invariants.d.ts +1 -1
  88. package/dist/config-lkg.js +7 -1
  89. package/dist/config-provider.d.ts +2 -2
  90. package/dist/config-provider.js +1 -1
  91. package/dist/config-types.d.ts +140 -132
  92. package/dist/config.d.ts +22 -22
  93. package/dist/config.js +2 -1
  94. package/dist/degenerate-instrument.d.ts +1 -1
  95. package/dist/deployment-governance.d.ts +13 -13
  96. package/dist/device-enrollment.d.ts +5 -3
  97. package/dist/device-store.d.ts +17 -3
  98. package/dist/device-store.js +2 -0
  99. package/dist/device-ws-hub.d.ts +10 -5
  100. package/dist/device-ws-hub.js +25 -5
  101. package/dist/device-ws-protocol.d.ts +3 -3
  102. package/dist/digest-form.d.ts +1 -1
  103. package/dist/elicitation.d.ts +1 -1
  104. package/dist/env-facts.d.ts +7 -7
  105. package/dist/execution-lane-caps.d.ts +5 -5
  106. package/dist/fleet/fleet-bus.d.ts +53 -53
  107. package/dist/fleet/fleet-reconciler.d.ts +2 -2
  108. package/dist/fleet/fleet-terminal-window.d.ts +1 -1
  109. package/dist/fleet/subagent-tail-bus.d.ts +3 -3
  110. package/dist/fleet-client.d.ts +3 -3
  111. package/dist/fleet-lease.d.ts +1 -1
  112. package/dist/hooks/branch-transcript.d.ts +2 -2
  113. package/dist/hooks/cc-agent-hook-prompt.d.ts +2 -2
  114. package/dist/hooks/cc-stop-prompt.d.ts +2 -2
  115. package/dist/hooks/hook-llm.d.ts +1 -1
  116. package/dist/hooks/hook-runner.d.ts +5 -5
  117. package/dist/http/active-run-conflict.d.ts +31 -33
  118. package/dist/http/active-run-conflict.js +4 -2
  119. package/dist/http/route-ctx.d.ts +22 -22
  120. package/dist/http/routes/a2a-serve.d.ts +2 -2
  121. package/dist/http/routes/admin-config-refresh.d.ts +1 -1
  122. package/dist/http/routes/admin-drain.d.ts +4 -4
  123. package/dist/http/routes/admin-memory-optout.d.ts +5 -5
  124. package/dist/http/routes/adoption.d.ts +1 -1
  125. package/dist/http/routes/agents-roster.d.ts +1 -1
  126. package/dist/http/routes/approvals-assistant.d.ts +6 -6
  127. package/dist/http/routes/approvals-assistant.js +4 -1
  128. package/dist/http/routes/capabilities.d.ts +1 -1
  129. package/dist/http/routes/capabilities.js +1 -0
  130. package/dist/http/routes/config-catalog.d.ts +28 -0
  131. package/dist/http/routes/config-catalog.js +42 -0
  132. package/dist/http/routes/diagnostics.d.ts +2 -2
  133. package/dist/http/routes/fleet.d.ts +1 -1
  134. package/dist/http/routes/images.d.ts +1 -1
  135. package/dist/http/routes/leader.d.ts +1 -1
  136. package/dist/http/routes/memory-bundle.d.ts +4 -4
  137. package/dist/http/routes/memory-compliance.d.ts +7 -7
  138. package/dist/http/routes/memory-consolidation.d.ts +1 -1
  139. package/dist/http/routes/memory-origin.d.ts +9 -9
  140. package/dist/http/routes/memory-policy.d.ts +3 -3
  141. package/dist/http/routes/notify-wake.d.ts +1 -1
  142. package/dist/http/routes/observability.d.ts +1 -1
  143. package/dist/http/routes/retention-ops.d.ts +1 -1
  144. package/dist/http/routes/rules.d.ts +3 -3
  145. package/dist/http/routes/run-memory-capture.d.ts +1 -1
  146. package/dist/http/routes/runs.d.ts +3 -3
  147. package/dist/http/routes/runs.js +12 -17
  148. package/dist/http/routes/session-sync.d.ts +2 -2
  149. package/dist/http/routes/sessions-list.d.ts +1 -1
  150. package/dist/http/routes/sessions.d.ts +9 -1
  151. package/dist/http/routes/sessions.js +60 -0
  152. package/dist/http/routes/shared-memory.d.ts +1 -1
  153. package/dist/http/routes/side-query.d.ts +1 -1
  154. package/dist/http/routes/tasks.d.ts +1 -1
  155. package/dist/http/routes/trace-usage.d.ts +1 -1
  156. package/dist/http/routes/workflows.d.ts +1 -1
  157. package/dist/http/run-meta.d.ts +1 -1
  158. package/dist/http/send.d.ts +6 -6
  159. package/dist/http/server.d.ts +84 -67
  160. package/dist/http/server.js +39 -10
  161. package/dist/http/sse-lifecycle.d.ts +1 -1
  162. package/dist/http/sse-log.d.ts +6 -6
  163. package/dist/http/verify-rounds.d.ts +3 -3
  164. package/dist/http/wire-gate.d.ts +2 -2
  165. package/dist/http/wire-types.d.ts +57 -38
  166. package/dist/key-resolver.d.ts +1 -1
  167. package/dist/leader/diffout.d.ts +2 -2
  168. package/dist/leader/diffup.d.ts +1 -1
  169. package/dist/leader/endpoint.d.ts +1 -1
  170. package/dist/leader/fanout.d.ts +6 -6
  171. package/dist/leader/grader-env-factory.d.ts +1 -1
  172. package/dist/leader/leader.d.ts +12 -12
  173. package/dist/leader/merge.d.ts +3 -3
  174. package/dist/leader/planner.d.ts +5 -5
  175. package/dist/leader/repair-oracle.d.ts +1 -1
  176. package/dist/leader/wire.d.ts +21 -9
  177. package/dist/leader/wire.js +6 -5
  178. package/dist/lsp/manager.d.ts +2 -2
  179. package/dist/lsp/types.d.ts +1 -1
  180. package/dist/lsp/ws-transport.d.ts +2 -2
  181. package/dist/main.js +12 -2
  182. package/dist/mcp-content-origin.d.ts +1 -1
  183. package/dist/memory-bundle-engine.d.ts +5 -3
  184. package/dist/memory-bundle-engine.js +2 -2
  185. package/dist/memory-operator-faces.d.ts +41 -11
  186. package/dist/memory-operator-faces.js +12 -0
  187. package/dist/memory-origin-fence.d.ts +1 -1
  188. package/dist/memory-origin-fence.js +2 -13
  189. package/dist/memory-posture.d.ts +6 -6
  190. package/dist/memory-scope.d.ts +7 -7
  191. package/dist/model-select.d.ts +5 -5
  192. package/dist/observability/cost-quota.d.ts +6 -6
  193. package/dist/observability/cost-taxonomy.d.ts +2 -2
  194. package/dist/observability/fail-open.d.ts +17 -5
  195. package/dist/observability/fail-open.js +16 -4
  196. package/dist/observability/metrics.d.ts +1 -1
  197. package/dist/observability/prompt-manifest.d.ts +8 -8
  198. package/dist/observability/rate-limit.d.ts +2 -2
  199. package/dist/observability/secret-env-scrub.d.ts +1 -1
  200. package/dist/observability/tool-trace.d.ts +1 -1
  201. package/dist/orchestration/hardened-vm-runner.d.ts +6 -6
  202. package/dist/orchestration/hardened-vm-worker-runner.d.ts +1 -1
  203. package/dist/orchestration/subagent-steer.d.ts +3 -3
  204. package/dist/orchestration/workflow-agent-steer.d.ts +1 -1
  205. package/dist/orchestration/workflow-completion-inbox.d.ts +6 -6
  206. package/dist/orchestration/workflow-notify-journal.d.ts +6 -6
  207. package/dist/parent-watch.d.ts +1 -1
  208. package/dist/parked-decide.d.ts +11 -11
  209. package/dist/plan-cache-probe.d.ts +1 -1
  210. package/dist/plugins/adoption-log-sql.d.ts +4 -4
  211. package/dist/plugins/approval-ask-store-memory.d.ts +1 -1
  212. package/dist/plugins/approval-ask-store-memory.js +12 -0
  213. package/dist/plugins/approval-ask-store-sql.d.ts +39 -17
  214. package/dist/plugins/approval-ask-store-sql.js +23 -6
  215. package/dist/plugins/approval-payload-fingerprint.d.ts +23 -0
  216. package/dist/plugins/approval-payload-fingerprint.js +23 -0
  217. package/dist/plugins/background-agent-store-sql.d.ts +8 -8
  218. package/dist/plugins/background-shell-support.d.ts +12 -12
  219. package/dist/plugins/blob-backend.d.ts +3 -3
  220. package/dist/plugins/breaker-state-sql.d.ts +3 -3
  221. package/dist/plugins/caching-session-store.d.ts +6 -6
  222. package/dist/plugins/checkpoint-store-sql.d.ts +162 -66
  223. package/dist/plugins/checkpoint-store-sql.js +76 -33
  224. package/dist/plugins/device-store-sql.d.ts +4 -3
  225. package/dist/plugins/e2b-orphan-reclaim.d.ts +3 -3
  226. package/dist/plugins/file-history-store-sql.d.ts +9 -8
  227. package/dist/plugins/file-run-store.d.ts +27 -27
  228. package/dist/plugins/fork-routing-session-store.d.ts +9 -9
  229. package/dist/plugins/image-bake-store-sql.d.ts +1 -1
  230. package/dist/plugins/image-index-sql.d.ts +2 -2
  231. package/dist/plugins/k8s-bg-scripts.d.ts +1 -1
  232. package/dist/plugins/k8s-exec-protocol.d.ts +1 -1
  233. package/dist/plugins/leader-run-store-sql.d.ts +1 -1
  234. package/dist/plugins/local-checkpoint-store.d.ts +26 -17
  235. package/dist/plugins/local-checkpoint-store.js +21 -11
  236. package/dist/plugins/local-session-store.d.ts +5 -5
  237. package/dist/plugins/mailbox-store-sql.d.ts +6 -6
  238. package/dist/plugins/memory-embedder-fingerprint.d.ts +2 -2
  239. package/dist/plugins/memory-engine-pg.d.ts +1 -1
  240. package/dist/plugins/memory-engine-tidb.d.ts +1 -1
  241. package/dist/plugins/memory-key-guards.d.ts +3 -3
  242. package/dist/plugins/memory-optout-grant-store-sql.d.ts +10 -10
  243. package/dist/plugins/memory-origin-law.d.ts +13 -13
  244. package/dist/plugins/memory-run-store.d.ts +12 -12
  245. package/dist/plugins/outcome-ledger-sql.d.ts +3 -3
  246. package/dist/plugins/permission-rule-store-file.d.ts +3 -3
  247. package/dist/plugins/permission-rule-store-sql.d.ts +38 -33
  248. package/dist/plugins/permission-rule-store-sql.js +7 -12
  249. package/dist/plugins/pg-cost-quota.d.ts +2 -2
  250. package/dist/plugins/pg-pool.d.ts +29 -2
  251. package/dist/plugins/pg-pool.js +50 -2
  252. package/dist/plugins/pg-query.d.ts +1 -1
  253. package/dist/plugins/pg-rate-limiter.d.ts +2 -2
  254. package/dist/plugins/pg-session-storage.d.ts +9 -9
  255. package/dist/plugins/remote-env-adb.d.ts +1 -1
  256. package/dist/plugins/remote-env-device.d.ts +6 -4
  257. package/dist/plugins/remote-env-device.js +4 -1
  258. package/dist/plugins/remote-env-e2b.d.ts +11 -11
  259. package/dist/plugins/remote-env-file-error.d.ts +2 -2
  260. package/dist/plugins/remote-env-host.d.ts +10 -10
  261. package/dist/plugins/remote-env-k8s.d.ts +7 -7
  262. package/dist/plugins/remote-env-local-docker.d.ts +1 -1
  263. package/dist/plugins/remote-env-ssh.d.ts +9 -9
  264. package/dist/plugins/remote-scratchpad.d.ts +1 -1
  265. package/dist/plugins/resume-anchor-store-sql.d.ts +1 -1
  266. package/dist/plugins/retention-lane-store-sql.d.ts +2 -2
  267. package/dist/plugins/retention-store-sql.d.ts +11 -11
  268. package/dist/plugins/roster-store-sql.d.ts +6 -8
  269. package/dist/plugins/run-store-sql.d.ts +12 -12
  270. package/dist/plugins/scheduler-support.d.ts +1 -1
  271. package/dist/plugins/send-user-file.d.ts +1 -1
  272. package/dist/plugins/session-capture-record-store-sql.d.ts +99 -0
  273. package/dist/plugins/session-capture-record-store-sql.js +110 -0
  274. package/dist/plugins/session-placement.d.ts +1 -1
  275. package/dist/plugins/session-policy-store-sql.d.ts +2 -2
  276. package/dist/plugins/session-store.d.ts +3 -3
  277. package/dist/plugins/shared-memory-store-sql.d.ts +5 -5
  278. package/dist/plugins/sql-driver.d.ts +7 -7
  279. package/dist/plugins/sql-errors.d.ts +2 -2
  280. package/dist/plugins/sql-escape.d.ts +1 -1
  281. package/dist/plugins/sql-row-helpers.d.ts +1 -1
  282. package/dist/plugins/store-backend.d.ts +32 -19
  283. package/dist/plugins/store-backend.js +5 -1
  284. package/dist/plugins/store-contracts.d.ts +9 -9
  285. package/dist/plugins/task-list-store-sql.d.ts +3 -3
  286. package/dist/plugins/tidb-cost-quota.d.ts +3 -3
  287. package/dist/plugins/tidb-pool.d.ts +13 -0
  288. package/dist/plugins/tidb-pool.js +9 -0
  289. package/dist/plugins/tidb-rate-limiter.d.ts +2 -2
  290. package/dist/plugins/tidb-session-storage.d.ts +2 -2
  291. package/dist/plugins/tidb-session-store.d.ts +11 -11
  292. package/dist/plugins/tool-result-store-sql.d.ts +8 -8
  293. package/dist/plugins/usage-window-store-sql.d.ts +3 -3
  294. package/dist/plugins/web-search.d.ts +7 -7
  295. package/dist/plugins/workflow-journal-store-sql.d.ts +6 -6
  296. package/dist/plugins/workflow-run-store-sql.d.ts +1 -1
  297. package/dist/plugins/write-behind-counter.d.ts +6 -6
  298. package/dist/principal-jwt.d.ts +2 -2
  299. package/dist/project-memory.d.ts +1 -1
  300. package/dist/prompts-domain-validate.d.ts +8 -8
  301. package/dist/question.d.ts +3 -3
  302. package/dist/resource-suspend.d.ts +4 -4
  303. package/dist/resource-window.d.ts +3 -3
  304. package/dist/router/route-orchestration.d.ts +1 -1
  305. package/dist/rules-consent.d.ts +48 -40
  306. package/dist/run-local.d.ts +5 -5
  307. package/dist/runs.d.ts +19 -19
  308. package/dist/runtime-caps-resolver.d.ts +6 -6
  309. package/dist/runtime-governance.d.ts +11 -7
  310. package/dist/runtime-governance.js +23 -1
  311. package/dist/security.d.ts +13 -13
  312. package/dist/session-leaf-bus.d.ts +1 -1
  313. package/dist/session-sync-content.d.ts +4 -4
  314. package/dist/session-sync-kernel.d.ts +2 -2
  315. package/dist/session-sync.d.ts +13 -13
  316. package/dist/session-titler.d.ts +1 -1
  317. package/dist/session-watch.d.ts +3 -3
  318. package/dist/shared-memory-scope-authorizer.d.ts +4 -4
  319. package/dist/sighup-idle.d.ts +1 -1
  320. package/dist/spec-fields.d.ts +20 -20
  321. package/dist/ssh-host-key.d.ts +5 -5
  322. package/dist/store-live-probe.d.ts +2 -2
  323. package/dist/task-cwd.d.ts +11 -11
  324. package/dist/task-mcp.d.ts +5 -5
  325. package/dist/task-settings.d.ts +35 -35
  326. package/dist/task-workflow.d.ts +3 -3
  327. package/dist/text-bidi.d.ts +1 -1
  328. package/dist/tool-approval.d.ts +186 -182
  329. package/dist/tool-approval.js +247 -120
  330. package/dist/trace/core-keyset-guard.d.ts +19 -5
  331. package/dist/trace/engine-notice-wire.d.ts +7 -7
  332. package/dist/trace/engine-notice-wire.js +2 -0
  333. package/dist/trace/injection-tier.d.ts +11 -21
  334. package/dist/trace/injection-tier.js +3 -4
  335. package/dist/trace/ledger-events.d.ts +3 -3
  336. package/dist/trace/ledger-sink.d.ts +7 -7
  337. package/dist/trace/project.d.ts +31 -30
  338. package/dist/trace/project.js +1 -0
  339. package/dist/turn-activity.d.ts +4 -4
  340. package/dist/usage-analytics.d.ts +1 -1
  341. package/dist/wall-clock-jump-guard.d.ts +3 -3
  342. package/package.json +6 -6
@@ -1,3 +1,4 @@
1
+ import { stableStringify } from "./restart-signal.js";
1
2
  export function createMcpRevocationLedger(onChange) {
2
3
  let baseline;
3
4
  let seen;
@@ -40,19 +41,8 @@ export function enabledMcpEntries(mcp) {
40
41
  const out = new Map();
41
42
  for (const s of mcp.servers) {
42
43
  if (s.enabled !== false)
43
- out.set(s.name, fingerprintOf(s));
44
+ out.set(s.name, stableStringify(s));
44
45
  }
45
46
  return out;
46
47
  }
47
- function fingerprintOf(v) {
48
- if (v === null || typeof v !== "object")
49
- return JSON.stringify(v) ?? "null";
50
- if (Array.isArray(v))
51
- return `[${v.map(fingerprintOf).join(",")}]`;
52
- const obj = v;
53
- return `{${Object.keys(obj)
54
- .sort()
55
- .map((k) => `${JSON.stringify(k)}:${fingerprintOf(obj[k])}`)
56
- .join(",")}}`;
57
- }
58
48
  //# sourceMappingURL=mcp-revocation.js.map
@@ -12,7 +12,7 @@ export interface RestartSliceCtx {
12
12
  * 所以它们的变化不该产生 restart 理由 —— 否则 center 改一个本机用不上的键,整片 fleet 会为一次
13
13
  * 对自己毫无影响的发布滚动重启一遍。缺席 = 没有 env 覆盖 ⇒ 整域都算数(与旧行为一致)。 */
14
14
  readFaceEnvHeld?: readonly ("face" | "denyPatterns" | "denyBuiltinTiers" | "denyBuiltinExclude")[];
15
- /** #324(core 5.50 design/338):撤销台账腿已接线(`RunnerDeps.mcpRevocations` 席在场且 refresh 拍在喂)。
15
+ /** [ref](core 5.50 [ref]):撤销台账腿已接线(`RunnerDeps.mcpRevocations` 席在场且 refresh 拍在喂)。
16
16
  * true ⇒ mcp 片的**纯删除向**(current 的 enabled 集是 boot 集的逐字子集)不再签 restart —— 删除已被
17
17
  * 台账即时承接(core 每次 dispatch 前探 isRevoked),再签就是为一个已生效的变更滚动重启 fleet。
18
18
  * 新增/改址/域整体出现或消失仍签(新 mount / 改址只能 restart 才生效)。缺席/false = 旧语义照签
@@ -31,6 +31,16 @@ export interface RestartSignal {
31
31
  /** Epoch ms when this restart first became required (stable across refreshes while `reasons` is unchanged). */
32
32
  since: number;
33
33
  }
34
+ /** Canonical, key-sorted JSON (array order preserved) so two semantically-equal effective slices fingerprint
35
+ * identically regardless of object key order from the center serializer.
36
+ *
37
+ * ⚠️ [ref](2026-08-31)如实登记:这**不是** `src/canonical-json.ts#canonicalJson`(core 逐字港,全仓单源)——
38
+ * 两者在 JSON 形输入上逐字节相同(golden 交叉读数已证),但本函数把 `undefined` 值键**保留为 `"k":null`**,
39
+ * 共享件按 `JSON.stringify` 语义**省略**。restart 指纹的输入是进程内构造的切片对象(zod 解析产物 + rest 展开/
40
+ * 挑字段),`{k: undefined}` 形原则上可达,而它与 `{}` 是否同指纹 = 本轴上的**行为**(多签/少签一次 fleet 滚动
41
+ * 重启),不是序列化器的私事 ⇒ 语义不恒等不合并;字节钉 test/canonical-json-golden.test.ts,K→O 统一另立件
42
+ * 走三问。导出只为 mcp-revocation 同源改调(两处此前各持一份逐字相同的复刻)与 golden 直钉,不是公共 API。 */
43
+ export declare function stableStringify(v: unknown): string;
34
44
  /** Restart-to-apply slices that DIFFER between this process's BOOT config and a freshly-pulled one. Empty =
35
45
  * nothing baked-at-boot changed (only hot-apply slices moved, or nothing) → no restart needed. An orchestrator
36
46
  * can auto rolling-restart on a non-empty result WITHOUT a restart loop, because the comparison is always
@@ -1,7 +1,7 @@
1
1
  import { resolveActiveTiers } from "@sema-agent/settings-schema";
2
- import { RUNTIME_GATE_KEYS, HOT_RUNTIME_GATE_KEYS, runtimeGatePresent, resolveDefaultModelName } from "./apply-effective.js";
2
+ import { resolveDefaultModelName } from "./apply-effective.js";
3
3
  const RESTART_SLICES = ["skills", "mcp", "a2a", "scenarios", "runtime-gates", "models-tiers", "degrade-route", "read-face"];
4
- function stableStringify(v) {
4
+ export function stableStringify(v) {
5
5
  if (v === null || typeof v !== "object")
6
6
  return JSON.stringify(v) ?? "null";
7
7
  if (Array.isArray(v))
@@ -38,14 +38,8 @@ function restartSliceValue(eff, slice, ctx) {
38
38
  case "scenarios":
39
39
  return enabledOnly(eff.scenarios?.scenarios);
40
40
  case "runtime-gates": {
41
- const rt = eff.runtime;
42
- if (!rt)
43
- return null;
44
- const present = {};
45
- for (const k of RUNTIME_GATE_KEYS)
46
- if (!HOT_RUNTIME_GATE_KEYS.has(k) && runtimeGatePresent(rt, k))
47
- present[k] = rt[k];
48
- return Object.keys(present).length ? present : null;
41
+ const ar = eff.governance?.approvalRequire;
42
+ return Array.isArray(ar) ? { approvalRequire: ar } : null;
49
43
  }
50
44
  case "models-tiers": {
51
45
  const active = eff.models ? resolveActiveTiers(eff.models) : undefined;
@@ -4,7 +4,7 @@ import type { Logger } from "../observability/logger.js";
4
4
  import type { LoadedSkill } from "../capabilities/skills.js";
5
5
  import type { CenterA2aPeer, CenterMcpServer, CenterSkillManifest } from "./types.js";
6
6
  /**
7
- * Merge center skills OVER the image baseline (design/41-sibling B1; `sema-registry docs/MCP-SKILLS.md`). Load order =
7
+ * Merge center skills OVER the image baseline ([ref]-sibling B1; `sema-registry docs/MCP-SKILLS.md`). Load order =
8
8
  * `loadSkills(SKILLS_DIR)` baseline → center skills lazily fetched by hash and overlaid BY NAME (center
9
9
  * wins on a clash → can override a built-in; guarded center-side by publisher RBAC + the publish gate).
10
10
  * `enabled:false` is skipped. Content is verified + cached by hash (same hash fetched once). A skill whose
@@ -28,7 +28,7 @@ export declare function resolveMcpServers(mcp: {
28
28
  servers: CenterMcpServer[];
29
29
  }, logger?: Logger): ScopedMcpServer[];
30
30
  /** The MCP servers applicable to a scenario: tagged with it, or untagged (global). undefined when none.
31
- * #342:alias 窗撤销,单键命中(同 `skillsForScenario`)。 */
31
+ * [ref]:alias 窗撤销,单键命中(同 `skillsForScenario`)。 */
32
32
  export declare function mcpForScenario(servers: ScopedMcpServer[] | undefined, scenario: string): McpServerSpec[] | undefined;
33
33
  /**
34
34
  * DESIGN-269 §2.1 —— resolve center A2A peers (`/effective.a2a`) into core `A2aServerSpec`s + the scenarios
@@ -1,12 +1,12 @@
1
1
  /**
2
- * #322 批1 —— limitsHttp 组的 **stage 半场**(design/322 手法 A′ + B 簇1)。
2
+ * [ref] 批1 —— limitsHttp 组的 **stage 半场**([ref] 手法 A′ + B 簇1)。
3
3
  *
4
4
  * 形与 `stageApprovalRequire` 同族:一切可抛/可判的事在 stage 做,commit 段只剩纯赋值。三条本域纪律:
5
5
  *
6
6
  * 1. **非粘**(applyRuntimeHot 的 NON-STICKY 同源):每次 apply 都从 **env 基线**重算 `present ? center : baseline`
7
7
  * ——center 撤键 ⇒ 回 env 底。「缺席=保上一个 center 值」会把一次已经撤回的限额永久冻在进程里。
8
- * 2. **整批原子**(design/322 §0③ + §4 混批零变异):本域任一键坏值/任一跨键不变量不过 ⇒ **整批拒**,
9
- * 合法键也不落地,旧值继续服务,拒因响亮点名键(#123 法)。半应用一个限额面 = 运营看到的数字与真门
8
+ * 2. **整批原子**([ref] §0③ + §4 混批零变异):本域任一键坏值/任一跨键不变量不过 ⇒ **整批拒**,
9
+ * 合法键也不落地,旧值继续服务,拒因响亮点名键([ref] 法)。半应用一个限额面 = 运营看到的数字与真门
10
10
  * 不是同一代,比整批拒糟得多。
11
11
  * 3. **判据单源**:跨键不变量走 `config-invariants.ts` 的同一张表(boot 与 stage 同表);数值下限走
12
12
  * config.ts 导出的同一组 floor 常量(env 腿夹取、center 腿拒——**判据阈值同源,处置刻意不同**:
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * config-center wire types — the config-center `/api/config/effective` payload shapes (`CenterModel`,
3
- * `CenterTeam`, `CenterSkillManifest`, `CenterMcpServer`, `EffectiveConfig`) plus the per-principal
3
+ * `CenterSkillManifest`, `CenterMcpServer`, `CenterA2aPeer`, `EffectiveConfig`) plus the per-principal
4
4
  * execution/session-mirror ruling shapes riding the caps view (`ExecutionRuling`/`SessionMirrorRuling`).
5
- * Pure type/interface declarations — no runtime logic. Split out of `facade.ts` (design/158 A13,
5
+ * Pure type/interface declarations — no runtime logic. Split out of `facade.ts` ([ref] A13,
6
6
  * internal-lossless: the facade re-exports every symbol below unchanged).
7
7
  */
8
8
  import type { ToolContentOrigin } from "@sema-agent/core";
@@ -30,11 +30,11 @@ export interface CenterModel {
30
30
  vision?: boolean;
31
31
  contextWindow?: number;
32
32
  maxTokens?: number;
33
- /** [818]① 1M dual-window (core 1.289 `Model.autoCompactTokens`): an EXPLICIT roster value wins the
33
+ /** [ref]① 1M dual-window (core 1.289 `Model.autoCompactTokens`): an EXPLICIT roster value wins the
34
34
  * contextWindow derivation in toModel (applyAutoCompactWindow). Declared on the type face (codex F5) so the
35
35
  * config-provider local-lane projection carries it — toModel keeps its structural read for older shapes. */
36
36
  autoCompactTokens?: number;
37
- /** design/123 D2 (core 1.226): chars ≈ 1 token for this model's tokenizer, feeding every structural
37
+ /** [ref] D2 (core 1.226): chars ≈ 1 token for this model's tokenizer, feeding every structural
38
38
  * (non-usage-anchored) token estimate. CJK-heavy models should declare 2–3; absent → env default → core 4. */
39
39
  charsPerToken?: number;
40
40
  cost?: {
@@ -47,7 +47,7 @@ export interface CenterModel {
47
47
  * 记账时固化进 UsageEntry.{weightedTokens,quotaWeightAtUse} 与 lease weightedTokens 轴;改倍率只影响
48
48
  * 此后记账,不回算窗口内历史(registry types.d.ts 同句契约)。 */
49
49
  quotaWeight?: number;
50
- /** design/111 L2②: per-model declarative thinking config (center roster). defaultThinking = this model's DEFAULT
50
+ /** [ref] L2②: per-model declarative thinking config (center roster). defaultThinking = this model's DEFAULT
51
51
  * tier (resolution chain spec.thinking ?? role.thinking ?? model.defaultThinking); reasoningEffortLevels (openai
52
52
  * endpoints) = tiers the endpoint accepts. Validated against core's ThinkingLevel in toModel; "off" is dropped. */
53
53
  defaultThinking?: string;
@@ -58,10 +58,10 @@ export interface CenterModel {
58
58
  * the ONLY way to keep per-model tuning that lived in env (`MODEL_FREQUENCY_PENALTY` etc.) — see the
59
59
  * review-gw heterogeneous-roster migration. MUST be static per published version (prompt-cache prefix). */
60
60
  extraBody?: Record<string, unknown>;
61
- /** registry-core 0.10.13 ([1002]/[998]⑤c): per-model behavior-slot mitigation sentences, mirrors core
61
+ /** registry-core 0.10.13 ([ref]/[ref]⑤c): per-model behavior-slot mitigation sentences, mirrors core
62
62
  * `Model.promptGuidance` (core 1.303+ assembles them into the volatile tail's per-model position).
63
63
  * Same category as `extraBody`: logical model metadata, carried verbatim — without this projection the
64
- * configured sentences parse fine in registry-core but never reach the assembly face ([1028]① 排雷:
64
+ * configured sentences parse fine in registry-core but never reach the assembly face ([ref]① 排雷:
65
65
  * the missing leg made every promptGuidance pilot a false control). */
66
66
  promptGuidance?: string[];
67
67
  enabled?: boolean;
@@ -71,24 +71,6 @@ export type CenterRoleTarget = {
71
71
  } | {
72
72
  select: unknown;
73
73
  };
74
- export interface CenterTeam {
75
- name: string;
76
- members: {
77
- role: string;
78
- modelRole?: string;
79
- model?: string;
80
- systemPrompt?: string;
81
- }[];
82
- rounds: number;
83
- synthesizer?: {
84
- role: string;
85
- modelRole?: string;
86
- systemPrompt?: string;
87
- };
88
- scenario?: string;
89
- maxTranscriptTokens?: number;
90
- enabled?: boolean;
91
- }
92
74
  /** Skill MANIFEST entry (content is NOT inline — fetched by hash; see `fetchSkillContent`). */
93
75
  export interface CenterSkillManifest {
94
76
  name: string;
@@ -109,7 +91,7 @@ export interface CenterMcpServer {
109
91
  * loop unless an operator explicitly opts it in. */
110
92
  elicitation?: boolean;
111
93
  /**
112
- * design/378(core 5.60.0)—— 声明**这台 server 的整套工具**带回来的内容属于哪一类,映射到
94
+ * [ref](core 5.60.0)—— 声明**这台 server 的整套工具**带回来的内容属于哪一类,映射到
113
95
  * `McpServerSpec.contentOrigin`。`"local"` / `"execution"` ⇒ 这台 server 的调用不再给本会话记忆打
114
96
  * 「已接触外来内容」标(`execution` 仍留在 `execIsExternalContent` 那只旋钮的射程内);`"external"` 是
115
97
  * 显式 PIN,而**PIN 不是空操作** —— 它会取消 `trustedTools` 对这台 server 的按名豁免。
@@ -121,9 +103,13 @@ export interface CenterMcpServer {
121
103
  * 所以它的家在 center 下发这条腿;请求腿那半场的门与结构性兑现见 `task-mcp.ts`
122
104
  * 的 `assertRequestMcpContentOrigin` 顶注。
123
105
  *
124
- * ⚠️ **本地 `config.d` 腿今天到不了这里**(如实登记,别读成「两条腿都通」):那条腿的原料形是
125
- * registry-core zod schema,未知键被 strip;等 registry-core 补上同名可选键,
126
- * `config-provider.ts` 的映射再加一行即可(远端 `/effective.mcp` 腿是直读 JSON,今天就通)。
106
+ * ⚠️ **两条腿今天都到不了这里**([ref]③ / [ref]③ / [ref],2026-08-31 双绊线实测更正 —— 本注旧版那句
107
+ * 「远端 /effective.mcp 腿是直读 JSON,今天就通」**不成立**,doc-rot):settings-schema(原 registry-core)
108
+ * `McpServerSpec` 是默认 strip 的 zod object 且没有 `contentOrigin` 可选键,本地腿在 FileConfigStore 的
109
+ * `parseDomainLoud(DOMAIN_SCHEMAS.mcp)`、远端腿在消费端边界 `readEffectiveWire`([ref] 裁B)**各被剥一次**。
110
+ * 修在 sema-settings-schema(补同名可选枚举键 + 发包),本仓提货后 `config-provider.ts` 的映射加一行即通;
111
+ * 两条 `it.fails` 绊线(test/config-center-wire-read.test.ts + test/config-provider.test.ts)在上游到货时
112
+ * 自动翻红逼销账。
127
113
  */
128
114
  contentOrigin?: ToolContentOrigin;
129
115
  transport: {
@@ -132,7 +118,7 @@ export interface CenterMcpServer {
132
118
  args?: string[];
133
119
  envRefs?: Record<string, string>;
134
120
  }
135
- /** `principalHeader` (design/62): the header name into which the runner injects the task's authenticated
121
+ /** `principalHeader` ([ref]): the header name into which the runner injects the task's authenticated
136
122
  * end-user principal per-task, so a consumer MCP (e.g. oa-mcp) can enforce per-user RBAC. Not a ref — a
137
123
  * literal header name. The runner fills the value (never the model). */
138
124
  | {
@@ -159,14 +145,14 @@ export interface CenterA2aPeer {
159
145
  /** env-NAME refs (header-name → ENV_NAME) resolved from THIS service's env at boot. A peer with ANY
160
146
  * unset ref is SKIPPED wholesale (fail-safe — never dial a peer half-credentialed). */
161
147
  headerRefs?: Record<string, string>;
162
- /** design/62, same contract as the MCP side: the header name the runner injects the task's authenticated
148
+ /** [ref], same contract as the MCP side: the header name the runner injects the task's authenticated
163
149
  * end-user principal into. Not a ref — a literal header NAME (the runner fills the value, never the model). */
164
150
  principalHeader?: string;
165
151
  /** Optional allowlist of the peer's skill ids to mount (others are not mounted). */
166
152
  allowSkills?: string[];
167
153
  }
168
154
  /**
169
- * #A4([4147] 窗三件批 件1;[4073]/[4083] 承诺件)—— READ 容纳面的 center 下发形(`CenterA2aPeer` 的
155
+ * #A4([ref] 窗三件批 件1;[ref]/[ref] 承诺件)—— READ 容纳面的 center 下发形(`CenterA2aPeer` 的
170
156
  * 同族:一个 additive 顶层域,server 声明它才不会被静默丢弃)。四个成员逐一对应部署 env 的四键
171
157
  * (`READ_FACE` / `READ_DENY_PATTERNS` / `READ_DENY_BUILTIN_TIERS` / `READ_DENY_BUILTIN_EXCLUDE`),
172
158
  * 消费半场 = `config-center/read-face.ts` `applyCenterReadFace`。
@@ -192,11 +178,11 @@ export interface CenterReadFace {
192
178
  denyBuiltinExclude?: string[];
193
179
  }
194
180
  /**
195
- * #322 批1 的 wire 面(`EffectiveConfig.limits`)。**全 optional**:缺席 = 本域不管这一键 ⇒ 该键回 env
181
+ * [ref] 批1 的 wire 面(`EffectiveConfig.limits`)。**全 optional**:缺席 = 本域不管这一键 ⇒ 该键回 env
196
182
  * 基线(非粘,applyRuntimeHot 的 NON-STICKY 同族纪律 —— 「缺席=保上一个 center 值」会把撤回的治理永久冻住)。
197
183
  *
198
184
  * 🔴 类型是**到货 JSON 的声明**,不是运行时保证(local 腿的 eff 来自原始 JSON):每个键在 stage 侧都
199
- * 逐个验型验域,坏值 ⇒ 整批拒 + 旧值继续服务(#123 响亮拒)。
185
+ * 逐个验型验域,坏值 ⇒ 整批拒 + 旧值继续服务([ref] 响亮拒)。
200
186
  */
201
187
  export interface EffectiveLimits {
202
188
  /** 每 principal 每分钟请求上限;**0 = 关**(关断哨兵,不是缺席)。 */
@@ -234,7 +220,7 @@ export interface EffectiveLimits {
234
220
  export interface EffectiveConfig {
235
221
  version: number;
236
222
  updatedAt: string;
237
- /** [2373]B-6:default/tierGroups/activeTierGroup 收进类型面(registry-core 0.13.0 已声明,
223
+ /** [ref]B-6:default/tierGroups/activeTierGroup 收进类型面(registry-core 0.13.0 已声明,
238
224
  * types.d.ts:641/679/724)——此前 wire 面靠「JSON verbatim + 消费方结构读」逃逸,投影/消费两侧
239
225
  * 各自 as 宽铸。tierGroups 上游是 ZodDefault(合规 center 恒发),但本类型描述的是**到货 JSON**
240
226
  * (含非合规/旧存量 center),故仍标 optional——消费方 resolveActiveTiers 自身容缺。 */
@@ -246,14 +232,8 @@ export interface EffectiveConfig {
246
232
  tierGroups?: unknown;
247
233
  activeTierGroup?: string;
248
234
  };
249
- /** OPTIONAL since registry-core 0.7 deleted the teams domain: a 0.7+ center /effective payload
250
- * has NO teams key (collab is its successor). Absent/empty registerTeams resets to BUILTIN_TEAMS (the
251
- * permanent builtin base). */
252
- teams?: {
253
- teams: CenterTeam[];
254
- };
255
- /** registry-core 0.7 collab domain (teams' successor) — consumed by the slice-① read-only
256
- * projection (projectCollabToTeams → registerTeams). Both lanes carry it: the remote worker /effective view
235
+ /** registry-core 0.7 collab domain (teams' successor) consumed by the slice-1.5 projection
236
+ * (projectCollabToWorkflows registerCollabWorkflows). Both lanes carry it: the remote worker /effective view
257
237
  * ships collab, and local FileConfigStore reads config.d/collab.json (PORTABLE_DOMAINS includes collab). */
258
238
  collab?: {
259
239
  templates: CollabTemplateWire[];
@@ -281,25 +261,26 @@ export interface EffectiveConfig {
281
261
  enabled?: boolean;
282
262
  }>;
283
263
  };
284
- /** Fleet governance/limit gates (phase-2, center SERVICE-INTEGRATION「Runtime 治理/限额闸」). All restart-to-apply,
285
- * non-secret, all center `.optional()` (center `f95438a`): absent = unmanaged → keep env; present (incl. an
286
- * explicit 0/[] = "publish OFF") = override. Consumption precedence is in `applyRuntimeGates`. */
264
+ /** `runtime` = **限额残余五键**,与 settings-schema `RuntimeConfig` 的键集逐字相等([ref] 件3 对账门
265
+ * test/settings-schema-consumption-gates.test.ts dist `RuntimeConfig.shape` 钉集合等式)。全部 center
266
+ * `.optional()`(center `f95438a`):缺席 = 不管 → 保 env;在场(含显式 0 = "publish OFF")= 覆盖。
267
+ * [ref] 批1 起五键全是**热**键(属主 stage-limits,boot+refresh 双腿);`limits` 域是它们的继任发布位
268
+ * (两处同现 ⇒ limits 赢,见 {@link EffectiveConfig.limits})。
269
+ *
270
+ * 🔴 治理三件(autonomy / commandPolicy / approvalRequire)**不在这里**([ref] 件3 退役键清除):它们自
271
+ * settings-schema 0.6 起住 `governance` 域,0.7.1 撤了 runtime 位的双写镜像;此后 `RuntimeConfig` 是 strip
272
+ * 的 zod object,两条腿(远端 `readEffectiveWire` / 本地 FileConfigStore→`buildEffective`)都把旧位 strip
273
+ * 掉、由 `legacyGovernanceFromRuntime` 抬进 governance ⇒ 本仓在 runtime 位上读它们的每一行都是死码。
274
+ * 旧类型面上留着这三键,让 `runtime-gates` 重启片一直读着一个生产上恒缺席的位(审批闸收紧静默不生效)。 */
287
275
  runtime?: {
288
276
  rateLimitPerMin?: number;
289
- approvalRequire?: string[];
290
277
  maxTaskCostUsd?: number;
291
278
  maxTaskTokens?: number;
292
279
  maxPrincipalCostUsd?: number;
293
280
  costQuotaWindowSec?: number;
294
- /** Runtime governance second baton (center §10): autonomy mode + per-command rules. UNLIKE the 6 gates above,
295
- * these are per-request HOT (read live in resolveSpec, not baked into boot middleware) → applied on boot AND
296
- * refresh by `applyRuntimeHot` (NOT in RUNTIME_GATE_KEYS / restart-to-apply). Same presence rule (undefined =
297
- * unmanaged → keep). */
298
- autonomy?: Autonomy;
299
- commandPolicy?: CommandRule[];
300
281
  };
301
282
  /**
302
- * #322 批1 —— **limitsHttp 组的热更新发布域**(design/322 §6 批1)。
283
+ * [ref] 批1 —— **limitsHttp 组的热更新发布域**([ref] §6 批1)。
303
284
  *
304
285
  * 🔴 为什么是**新顶层域**而不是往 `runtime` 里加键(亲验,不是推测):registry-core 的 `RuntimeConfig`
305
286
  * 是 zod `"strip"` 对象,`runtime` 里的未知键在**两条腿上都会被静默剥掉**(local 腿实测
@@ -320,21 +301,23 @@ export interface EffectiveConfig {
320
301
  limits?: EffectiveLimits;
321
302
  /** 142-S4(registry-core 0.10.0 第 15 域):center 项目登记簿。wire 面 verbatim JSON —
322
303
  * registry-core `ProjectsConfig` 的形状是 `{projects: Record<projectId, ProjectRegistration>}`(skills/mcp
323
- * 同款域包裹)。[2373]B-8:裸 Record 联合臂随 apply-effective 的宽读一起删(0.13.0 只有包裹形,
304
+ * 同款域包裹)。[ref]B-8:裸 Record 联合臂随 apply-effective 的宽读一起删(0.13.0 只有包裹形,
324
305
  * 裸形无 producer)。消费=applyEffective → config.projects(displayName/gitRemotes/defaultScopes
325
306
  * 三个 runtime 字段;审计字段不进 ServiceConfig)。 */
326
307
  projects?: {
327
308
  projects?: Record<string, unknown>;
328
309
  };
329
- /** registry-core 0.6:治理三件(autonomy/commandPolicy/approvalRequire)拆新 governance 域=真值;
330
- * 过渡期 effective 在 runtime 位双写镜像。读取优先 governance 新位、runtime 旧位 fallback(顺序契约:
331
- * 消费端先切换、确认后 center 才撤双写,治理闸零 fail-open 窗口)。 */
310
+ /** settings-schema 0.6 起治理三件(autonomy/commandPolicy/approvalRequire)的**唯一**承运域(0.7.1
311
+ * runtime 位双写镜像;顺序契约当年已走完:消费端先切、center 再撤)。键集与 schema `GovernanceConfig.shape`
312
+ * 逐字相等([ref] 件3 对账门钉)。消费:autonomy/commandPolicy 逐请求热(`stageRuntimeHot`,boot+refresh);
313
+ * approvalRequire boot-baked(`stageApprovalGate`,refresh 不写)⇒ 变更由 `runtime-gates` 重启片通告。
314
+ * 同一 presence 规则(undefined = 不管 → 保 env / 回基线)。 */
332
315
  governance?: {
333
316
  autonomy?: Autonomy;
334
317
  commandPolicy?: CommandRule[];
335
318
  approvalRequire?: string[];
336
319
  };
337
- /** plugins 域(registry-core 0.5 additive;契约冻结 [1361]②/[1362]/[1366]①,消费半场 2026-07-28
320
+ /** plugins 域(registry-core 0.5 additive;契约冻结 [ref]②/[ref]/[ref]①,消费半场 2026-07-28
338
321
  * 开工车):center 只存"插件从哪来"(PluginSpec 引用,永不承载可执行字节);worker 半场在
339
322
  * capabilities/center-plugins.ts `applyCenterPlugins`(https-only+ALLOW_HOSTS 纵深复验/sha 钉扎/
340
323
  * 隔离 clone/LKG/撞名让位)。此前本 interface 无此键 ⇒ wire 上的 plugins 被 server 静默丢弃。 */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * #322 —— **跨键不变量的单源表**(design/322 §2 A′,codex 设计审 F2)。
2
+ * [ref] —— **跨键不变量的单源表**([ref] §2 A′,codex 设计审 F2)。
3
3
  *
4
4
  * 病灶:boot 期的跨域不变量(拒启 throw)散在 `config.ts` 的装配尾与 `main.ts` 的开头。把配置改热之后,
5
5
  * 每一条都变成一个**热路径上的漏检**:一次发布可以在运行期造出 boot 期会当场拒启的姿态(无鉴权写面被
@@ -47,7 +47,7 @@ export async function loadLkg(path, worker) {
47
47
  const eff = p.effective;
48
48
  if (typeof eff.version !== "number")
49
49
  return { reason: "bad effective.version" };
50
- for (const [domain, arrayKey] of [["models", "models"], ["teams", "teams"], ["skills", "skills"], ["mcp", "servers"], ["scenarios", "scenarios"], ["runtime", null]]) {
50
+ for (const [domain, arrayKey] of [["models", "models"], ["skills", "skills"], ["mcp", "servers"], ["scenarios", "scenarios"], ["runtime", null]]) {
51
51
  const v = eff[domain];
52
52
  if (v === undefined)
53
53
  continue;
@@ -59,6 +59,12 @@ export async function loadLkg(path, worker) {
59
59
  return { reason: `bad effective.${domain}.${arrayKey}` };
60
60
  }
61
61
  }
62
+ {
63
+ const rt = eff.runtime;
64
+ if (rt && (rt.autonomy !== undefined || rt.commandPolicy !== undefined || rt.approvalRequire !== undefined)) {
65
+ return { reason: "legacy runtime governance keys (pre-0.7.1 mirror shape; no contract producer since LKG shipped) — refusing rather than silently dropping governance" };
66
+ }
67
+ }
62
68
  const promptsRaw = p.effective.prompts;
63
69
  if (promptsRaw !== undefined && !validatePromptsDomain(promptsRaw).ok)
64
70
  return { reason: "prompts face fails re-validation" };
@@ -3,7 +3,7 @@ import { type EffectiveConfig as AgentConfigEffective } from "@sema-agent/settin
3
3
  import { fetchEffective as remoteFetchEffective, fetchSkillContent as remoteFetchSkillContent, type EffectiveConfig } from "./config-center/facade.js";
4
4
  /** Result of a `fetchEffective` — EXACTLY the config-center's return: the effective config + its etag, or
5
5
  * `null` for "unchanged" (remote 304; local: the version matched the caller's prior etag).
6
- * `domainErrors`([898] registry-core 0.10.12 tolerant seam,local lane only):catalog 域坏文件不再
6
+ * `domainErrors`([ref] registry-core 0.10.12 tolerant seam,local lane only):catalog 域坏文件不再
7
7
  * 连坐全包回落 env——坏域按该域 schema default 落+错误单列,好域照常生效;caller(main.ts)对每条打
8
8
  * per-domain warn 点名坏域。gate 域(governance/rosters/…)坏文件 tolerant 仍 throw(READ 容错不放宽
9
9
  * gate fail-loud,registry-core 半场精化)——那条路走既有的整包 catch。 */
@@ -101,7 +101,7 @@ export declare class LocalConfigProvider implements ConfigProvider {
101
101
  #private;
102
102
  readonly kind: "local";
103
103
  private readonly store;
104
- /** [875]b 可观测性:config_loaded 日志要能回答「到底读的哪个目录」——复验实录:只设 LOCAL_DATA_ROOT 时
104
+ /** [ref]b 可观测性:config_loaded 日志要能回答「到底读的哪个目录」——复验实录:只设 LOCAL_DATA_ROOT 时
105
105
  * config.d 静默读不到且 0 模型无告警(CONFIG_LOCAL_DIR 才是本 lane 的选目录旋钮)。 */
106
106
  readonly root: string;
107
107
  constructor(root: string, store?: FileConfigStore);
@@ -126,8 +126,8 @@ export function mapToServiceEffective(eff, version) {
126
126
  ...(eff.models.tierGroups !== undefined ? { tierGroups: eff.models.tierGroups } : {}),
127
127
  ...(eff.models.activeTierGroup !== undefined ? { activeTierGroup: eff.models.activeTierGroup } : {}),
128
128
  },
129
- teams: { teams: [] },
130
129
  ...(eff.collab?.templates?.length ? { collab: { templates: eff.collab.templates } } : {}),
130
+ ...(eff.plugins?.plugins?.length ? { plugins: { plugins: eff.plugins.plugins } } : {}),
131
131
  skills: {
132
132
  skills: (eff.skills.skills ?? []).map((s) => ({
133
133
  name: s.name,