@sema-agent/server 7.52.0 → 7.53.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/USAGE.md +22 -5
  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 +2 -0
  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/device-lane.js +2 -0
  29. package/dist/boot/engine-lease.d.ts +4 -4
  30. package/dist/boot/governance-seams.d.ts +5 -5
  31. package/dist/boot/leader.d.ts +5 -5
  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/retention-lane.d.ts +1 -1
  42. package/dist/boot/runner-deps.d.ts +33 -27
  43. package/dist/boot/runner-deps.js +2 -1
  44. package/dist/boot/runtime-caps.d.ts +4 -4
  45. package/dist/boot/session-faces.d.ts +1 -1
  46. package/dist/boot/shutdown.d.ts +10 -10
  47. package/dist/boot/side-query-lane.d.ts +14 -14
  48. package/dist/boot/stores.js +5 -0
  49. package/dist/boot/task-list-lane.d.ts +3 -3
  50. package/dist/boot/webfetch-summarize-lane.d.ts +9 -9
  51. package/dist/boot/workflow-orchestration.d.ts +1 -1
  52. package/dist/bounded-session-map.d.ts +1 -1
  53. package/dist/brain.d.ts +3 -3
  54. package/dist/budget.d.ts +3 -3
  55. package/dist/canonical-json.d.ts +53 -0
  56. package/dist/canonical-json.js +48 -0
  57. package/dist/capabilities/center-prompts.d.ts +13 -13
  58. package/dist/capabilities/collab-workflows.d.ts +1 -1
  59. package/dist/capabilities/hands-lane.d.ts +4 -4
  60. package/dist/capabilities/memory-notice.d.ts +4 -4
  61. package/dist/capabilities/prompt.d.ts +2 -2
  62. package/dist/capabilities/sandbox-file-send.d.ts +2 -2
  63. package/dist/capabilities/scenarios.d.ts +16 -16
  64. package/dist/capabilities/skills.d.ts +1 -1
  65. package/dist/capabilities/team.d.ts +3 -3
  66. package/dist/capabilities/tool-defer.d.ts +6 -6
  67. package/dist/config-catalog.d.ts +139 -0
  68. package/dist/config-catalog.js +556 -0
  69. package/dist/config-center/apply-effective.d.ts +20 -7
  70. package/dist/config-center/apply-effective.js +45 -0
  71. package/dist/config-center/apply-ledger.d.ts +6 -6
  72. package/dist/config-center/facade.d.ts +3 -2
  73. package/dist/config-center/hot-keys-registry.d.ts +2 -2
  74. package/dist/config-center/http-client.d.ts +5 -5
  75. package/dist/config-center/mcp-revocation.d.ts +6 -4
  76. package/dist/config-center/mcp-revocation.js +2 -12
  77. package/dist/config-center/restart-signal.d.ts +11 -1
  78. package/dist/config-center/restart-signal.js +1 -1
  79. package/dist/config-center/skills-mcp.d.ts +2 -2
  80. package/dist/config-center/stage-limits.d.ts +3 -3
  81. package/dist/config-center/types.d.ts +23 -19
  82. package/dist/config-invariants.d.ts +1 -1
  83. package/dist/config-provider.d.ts +2 -2
  84. package/dist/config-types.d.ts +157 -134
  85. package/dist/config.d.ts +32 -24
  86. package/dist/config.js +48 -6
  87. package/dist/degenerate-instrument.d.ts +1 -1
  88. package/dist/deployment-governance.d.ts +13 -13
  89. package/dist/device-store.d.ts +2 -2
  90. package/dist/device-ws-hub.d.ts +6 -4
  91. package/dist/device-ws-hub.js +9 -3
  92. package/dist/device-ws-protocol.d.ts +3 -3
  93. package/dist/digest-form.d.ts +1 -1
  94. package/dist/elicitation.d.ts +1 -1
  95. package/dist/env-facts.d.ts +7 -7
  96. package/dist/execution-lane-caps.d.ts +5 -5
  97. package/dist/fleet/fleet-bus.d.ts +56 -53
  98. package/dist/fleet/fleet-reconciler.d.ts +2 -2
  99. package/dist/fleet/fleet-terminal-window.d.ts +1 -1
  100. package/dist/fleet/subagent-tail-bus.d.ts +3 -3
  101. package/dist/fleet-client.d.ts +3 -3
  102. package/dist/fleet-lease.d.ts +1 -1
  103. package/dist/hooks/branch-transcript.d.ts +2 -2
  104. package/dist/hooks/cc-agent-hook-prompt.d.ts +2 -2
  105. package/dist/hooks/cc-stop-prompt.d.ts +2 -2
  106. package/dist/hooks/hook-llm.d.ts +1 -1
  107. package/dist/hooks/hook-runner.d.ts +12 -5
  108. package/dist/http/active-run-conflict.d.ts +31 -33
  109. package/dist/http/active-run-conflict.js +4 -2
  110. package/dist/http/route-ctx.d.ts +23 -21
  111. package/dist/http/routes/a2a-serve.d.ts +2 -2
  112. package/dist/http/routes/admin-config-refresh.d.ts +1 -1
  113. package/dist/http/routes/admin-drain.d.ts +4 -4
  114. package/dist/http/routes/admin-memory-optout.d.ts +5 -5
  115. package/dist/http/routes/adoption.d.ts +1 -1
  116. package/dist/http/routes/agents-roster.d.ts +1 -1
  117. package/dist/http/routes/approvals-assistant.d.ts +6 -6
  118. package/dist/http/routes/approvals-assistant.js +4 -1
  119. package/dist/http/routes/capabilities.d.ts +1 -1
  120. package/dist/http/routes/capabilities.js +1 -0
  121. package/dist/http/routes/config-catalog.d.ts +28 -0
  122. package/dist/http/routes/config-catalog.js +42 -0
  123. package/dist/http/routes/diagnostics.d.ts +2 -2
  124. package/dist/http/routes/fleet.d.ts +1 -1
  125. package/dist/http/routes/images.d.ts +1 -1
  126. package/dist/http/routes/leader.d.ts +1 -1
  127. package/dist/http/routes/memory-bundle.d.ts +4 -4
  128. package/dist/http/routes/memory-bundle.js +2 -3
  129. package/dist/http/routes/memory-compliance.d.ts +7 -7
  130. package/dist/http/routes/memory-consolidation.d.ts +1 -1
  131. package/dist/http/routes/memory-origin.d.ts +9 -9
  132. package/dist/http/routes/memory-policy.d.ts +3 -3
  133. package/dist/http/routes/notify-wake.d.ts +1 -1
  134. package/dist/http/routes/observability.d.ts +1 -1
  135. package/dist/http/routes/retention-ops.d.ts +1 -1
  136. package/dist/http/routes/rules.d.ts +3 -3
  137. package/dist/http/routes/run-memory-capture.d.ts +1 -1
  138. package/dist/http/routes/runs.d.ts +3 -3
  139. package/dist/http/routes/runs.js +12 -17
  140. package/dist/http/routes/session-sync.d.ts +2 -2
  141. package/dist/http/routes/sessions-list.d.ts +1 -1
  142. package/dist/http/routes/sessions.d.ts +9 -1
  143. package/dist/http/routes/sessions.js +61 -1
  144. package/dist/http/routes/shared-memory.d.ts +1 -1
  145. package/dist/http/routes/side-query.d.ts +1 -1
  146. package/dist/http/routes/tasks.d.ts +1 -1
  147. package/dist/http/routes/trace-usage.d.ts +1 -1
  148. package/dist/http/routes/workflows.d.ts +1 -1
  149. package/dist/http/run-meta.d.ts +1 -1
  150. package/dist/http/send.d.ts +6 -6
  151. package/dist/http/server.d.ts +84 -67
  152. package/dist/http/server.js +25 -12
  153. package/dist/http/sse-lifecycle.d.ts +1 -1
  154. package/dist/http/sse-log.d.ts +6 -6
  155. package/dist/http/verify-rounds.d.ts +3 -3
  156. package/dist/http/wire-gate.d.ts +2 -2
  157. package/dist/http/wire-types.d.ts +38 -38
  158. package/dist/key-resolver.d.ts +1 -1
  159. package/dist/leader/diffout.d.ts +2 -2
  160. package/dist/leader/diffup.d.ts +1 -1
  161. package/dist/leader/endpoint.d.ts +1 -1
  162. package/dist/leader/fanout.d.ts +6 -6
  163. package/dist/leader/grader-env-factory.d.ts +1 -1
  164. package/dist/leader/leader.d.ts +12 -12
  165. package/dist/leader/merge.d.ts +3 -3
  166. package/dist/leader/planner.d.ts +5 -5
  167. package/dist/leader/repair-oracle.d.ts +1 -1
  168. package/dist/leader/wire.d.ts +9 -9
  169. package/dist/lsp/manager.d.ts +2 -2
  170. package/dist/lsp/types.d.ts +1 -1
  171. package/dist/lsp/ws-transport.d.ts +2 -2
  172. package/dist/main.js +13 -2
  173. package/dist/mcp-content-origin.d.ts +1 -1
  174. package/dist/memory-bundle-engine.d.ts +5 -3
  175. package/dist/memory-bundle-engine.js +2 -2
  176. package/dist/memory-operator-faces.d.ts +41 -11
  177. package/dist/memory-operator-faces.js +12 -0
  178. package/dist/memory-origin-fence.d.ts +20 -35
  179. package/dist/memory-origin-fence.js +41 -1
  180. package/dist/memory-posture.d.ts +6 -6
  181. package/dist/memory-scope.d.ts +7 -7
  182. package/dist/model-select.d.ts +5 -5
  183. package/dist/observability/cost-quota.d.ts +6 -6
  184. package/dist/observability/cost-taxonomy.d.ts +2 -2
  185. package/dist/observability/fail-open.d.ts +1 -5
  186. package/dist/observability/fail-open.js +0 -4
  187. package/dist/observability/metrics.d.ts +1 -1
  188. package/dist/observability/prompt-manifest.d.ts +8 -8
  189. package/dist/observability/rate-limit.d.ts +2 -2
  190. package/dist/observability/secret-env-scrub.d.ts +1 -1
  191. package/dist/observability/tool-trace.d.ts +1 -1
  192. package/dist/orchestration/hardened-vm-runner.d.ts +6 -6
  193. package/dist/orchestration/hardened-vm-worker-runner.d.ts +1 -1
  194. package/dist/orchestration/subagent-steer.d.ts +3 -3
  195. package/dist/orchestration/workflow-agent-steer.d.ts +1 -1
  196. package/dist/orchestration/workflow-completion-inbox.d.ts +6 -6
  197. package/dist/orchestration/workflow-notify-journal.d.ts +6 -6
  198. package/dist/parent-watch.d.ts +1 -1
  199. package/dist/parked-decide.d.ts +11 -11
  200. package/dist/plan-cache-probe.d.ts +1 -1
  201. package/dist/plugins/adoption-log-sql.d.ts +4 -4
  202. package/dist/plugins/approval-ask-store-memory.d.ts +1 -1
  203. package/dist/plugins/approval-ask-store-memory.js +12 -0
  204. package/dist/plugins/approval-ask-store-sql.d.ts +39 -17
  205. package/dist/plugins/approval-ask-store-sql.js +23 -6
  206. package/dist/plugins/approval-payload-fingerprint.d.ts +23 -0
  207. package/dist/plugins/approval-payload-fingerprint.js +23 -0
  208. package/dist/plugins/background-agent-store-sql.d.ts +8 -8
  209. package/dist/plugins/background-shell-support.d.ts +12 -12
  210. package/dist/plugins/blob-backend.d.ts +3 -3
  211. package/dist/plugins/breaker-state-sql.d.ts +3 -3
  212. package/dist/plugins/caching-session-store.d.ts +6 -6
  213. package/dist/plugins/checkpoint-store-sql.d.ts +162 -66
  214. package/dist/plugins/checkpoint-store-sql.js +76 -33
  215. package/dist/plugins/device-store-sql.d.ts +4 -3
  216. package/dist/plugins/e2b-orphan-reclaim.d.ts +3 -3
  217. package/dist/plugins/file-history-store-sql.d.ts +9 -8
  218. package/dist/plugins/file-run-store.d.ts +27 -27
  219. package/dist/plugins/fork-routing-session-store.d.ts +9 -9
  220. package/dist/plugins/image-bake-store-sql.d.ts +1 -1
  221. package/dist/plugins/image-index-sql.d.ts +2 -2
  222. package/dist/plugins/k8s-bg-scripts.d.ts +1 -1
  223. package/dist/plugins/k8s-exec-protocol.d.ts +1 -1
  224. package/dist/plugins/leader-run-store-sql.d.ts +1 -1
  225. package/dist/plugins/local-checkpoint-store.d.ts +26 -17
  226. package/dist/plugins/local-checkpoint-store.js +21 -11
  227. package/dist/plugins/local-session-store.d.ts +5 -5
  228. package/dist/plugins/mailbox-store-sql.d.ts +6 -6
  229. package/dist/plugins/memory-embedder-fingerprint.d.ts +2 -2
  230. package/dist/plugins/memory-engine-pg.d.ts +1 -1
  231. package/dist/plugins/memory-engine-tidb.d.ts +1 -1
  232. package/dist/plugins/memory-key-guards.d.ts +3 -3
  233. package/dist/plugins/memory-optout-grant-store-sql.d.ts +10 -10
  234. package/dist/plugins/memory-origin-law.d.ts +13 -13
  235. package/dist/plugins/memory-run-store.d.ts +12 -12
  236. package/dist/plugins/outcome-ledger-sql.d.ts +3 -3
  237. package/dist/plugins/permission-rule-store-file.d.ts +3 -3
  238. package/dist/plugins/permission-rule-store-sql.d.ts +38 -33
  239. package/dist/plugins/permission-rule-store-sql.js +7 -12
  240. package/dist/plugins/pg-cost-quota.d.ts +2 -2
  241. package/dist/plugins/pg-pool.js +5 -0
  242. package/dist/plugins/pg-query.d.ts +1 -1
  243. package/dist/plugins/pg-rate-limiter.d.ts +2 -2
  244. package/dist/plugins/pg-session-storage.d.ts +9 -9
  245. package/dist/plugins/remote-env-adb.d.ts +1 -1
  246. package/dist/plugins/remote-env-device.d.ts +2 -2
  247. package/dist/plugins/remote-env-e2b.d.ts +11 -11
  248. package/dist/plugins/remote-env-file-error.d.ts +2 -2
  249. package/dist/plugins/remote-env-host.d.ts +10 -10
  250. package/dist/plugins/remote-env-k8s.d.ts +7 -7
  251. package/dist/plugins/remote-env-local-docker.d.ts +1 -1
  252. package/dist/plugins/remote-env-ssh.d.ts +9 -9
  253. package/dist/plugins/remote-scratchpad.d.ts +1 -1
  254. package/dist/plugins/resume-anchor-store-sql.d.ts +1 -1
  255. package/dist/plugins/retention-lane-store-sql.d.ts +2 -2
  256. package/dist/plugins/retention-store-sql.d.ts +11 -11
  257. package/dist/plugins/roster-store-sql.d.ts +5 -5
  258. package/dist/plugins/run-store-sql.d.ts +12 -12
  259. package/dist/plugins/scheduler-support.d.ts +1 -1
  260. package/dist/plugins/send-user-file.d.ts +1 -1
  261. package/dist/plugins/session-capture-record-store-sql.d.ts +99 -0
  262. package/dist/plugins/session-capture-record-store-sql.js +110 -0
  263. package/dist/plugins/session-placement.d.ts +1 -1
  264. package/dist/plugins/session-policy-store-sql.d.ts +2 -2
  265. package/dist/plugins/session-store.d.ts +3 -3
  266. package/dist/plugins/shared-memory-store-sql.d.ts +5 -5
  267. package/dist/plugins/sql-driver.d.ts +7 -7
  268. package/dist/plugins/sql-errors.d.ts +2 -2
  269. package/dist/plugins/sql-escape.d.ts +1 -1
  270. package/dist/plugins/sql-row-helpers.d.ts +1 -1
  271. package/dist/plugins/store-backend.d.ts +32 -19
  272. package/dist/plugins/store-backend.js +4 -0
  273. package/dist/plugins/store-contracts.d.ts +9 -9
  274. package/dist/plugins/task-list-store-sql.d.ts +3 -3
  275. package/dist/plugins/tidb-cost-quota.d.ts +3 -3
  276. package/dist/plugins/tidb-pool.js +9 -0
  277. package/dist/plugins/tidb-rate-limiter.d.ts +2 -2
  278. package/dist/plugins/tidb-session-storage.d.ts +2 -2
  279. package/dist/plugins/tidb-session-store.d.ts +11 -11
  280. package/dist/plugins/tool-result-store-sql.d.ts +8 -8
  281. package/dist/plugins/usage-window-store-sql.d.ts +3 -3
  282. package/dist/plugins/web-search.d.ts +7 -7
  283. package/dist/plugins/workflow-journal-store-sql.d.ts +6 -6
  284. package/dist/plugins/workflow-run-store-sql.d.ts +1 -1
  285. package/dist/plugins/write-behind-counter.d.ts +6 -6
  286. package/dist/principal-jwt.d.ts +2 -2
  287. package/dist/project-memory.d.ts +1 -1
  288. package/dist/prompts-domain-validate.d.ts +8 -8
  289. package/dist/question.d.ts +3 -3
  290. package/dist/resource-suspend.d.ts +4 -4
  291. package/dist/resource-window.d.ts +3 -3
  292. package/dist/router/route-orchestration.d.ts +1 -1
  293. package/dist/rules-consent.d.ts +48 -40
  294. package/dist/run-local.d.ts +5 -5
  295. package/dist/run-local.js +28 -4
  296. package/dist/runs.d.ts +19 -19
  297. package/dist/runtime-caps-resolver.d.ts +6 -6
  298. package/dist/runtime-governance.d.ts +7 -7
  299. package/dist/security.d.ts +13 -13
  300. package/dist/session-leaf-bus.d.ts +1 -1
  301. package/dist/session-sync-content.d.ts +4 -4
  302. package/dist/session-sync-kernel.d.ts +2 -2
  303. package/dist/session-sync.d.ts +13 -13
  304. package/dist/session-titler.d.ts +1 -1
  305. package/dist/session-watch.d.ts +3 -3
  306. package/dist/shared-memory-scope-authorizer.d.ts +4 -4
  307. package/dist/sighup-idle.d.ts +1 -1
  308. package/dist/spec-fields.d.ts +20 -20
  309. package/dist/ssh-host-key.d.ts +5 -5
  310. package/dist/store-live-probe.d.ts +2 -2
  311. package/dist/task-cwd.d.ts +11 -11
  312. package/dist/task-mcp.d.ts +5 -5
  313. package/dist/task-settings.d.ts +35 -35
  314. package/dist/task-workflow.d.ts +3 -3
  315. package/dist/text-bidi.d.ts +1 -1
  316. package/dist/tool-approval.d.ts +171 -160
  317. package/dist/tool-approval.js +33 -28
  318. package/dist/trace/core-keyset-guard.d.ts +21 -7
  319. package/dist/trace/engine-notice-wire.d.ts +6 -6
  320. package/dist/trace/injection-tier.d.ts +2 -2
  321. package/dist/trace/ledger-events.d.ts +3 -3
  322. package/dist/trace/ledger-sink.d.ts +7 -7
  323. package/dist/trace/project.d.ts +35 -30
  324. package/dist/trace/project.js +9 -0
  325. package/dist/turn-activity.d.ts +4 -4
  326. package/dist/usage-analytics.d.ts +1 -1
  327. package/dist/wall-clock-jump-guard.d.ts +3 -3
  328. package/package.json +6 -6
@@ -10,7 +10,7 @@ import type { EffectiveConfig } from "./types.js";
10
10
  * reference captured at boot, so mutating it (vs reassigning) updates both with no split, no Runner rebuild. */
11
11
  export declare function mutateInPlace<V>(target: Record<string, V>, source: Record<string, V>): void;
12
12
  /**
13
- * #233 / A-002.8 —— 无法解读的名单条目的**代表元**。
13
+ * [ref] / [ref] —— 无法解读的名单条目的**代表元**。
14
14
  *
15
15
  * 为什么需要它(codex 复审 R1 真 finding):把坏条目**丢掉**会让 `[7, null]` 这种「在场但一条都读不
16
16
  * 懂」的名单塌成**空数组**,而空数组在消费端的语义恰恰是「治理关闭 = 全放行」—— 一个表达"我要限制"
@@ -23,14 +23,14 @@ export declare function mutateInPlace<V>(target: Record<string, V>, source: Reco
23
23
  * 🔴 只活在内存判定面:不进 wire(`/v1/models` 只发布尔)、不进日志(warn 打的是原始坏值的类型标记)。
24
24
  */
25
25
  export declare const UNPARSABLE_AT_MODEL_ALLOWLIST_ENTRY = "\0<unparsable-at-model-allowlist-entry>";
26
- /** 返回值=是否 COMMIT(false 两臂:[2283]③ 世代序 CAS 拒绝 / 5.49 swapPlane 换装拒绝——两臂都在
26
+ /** 返回值=是否 COMMIT(false 两臂:[ref]③ 世代序 CAS 拒绝 / 5.49 swapPlane 换装拒绝——两臂都在
27
27
  * commit 之前,活配置零触碰)。caller 收到 false 必须把**同一世代的旁路消费**(prompts 采用/pricing/
28
28
  * keyResolver/etag 推进/LKG 落盘)一并跳过——否则 applyEffective 拒了主面、旁路却半应用同一个被拒
29
29
  * 世代,混合世代从侧门回来。首次 apply(live 未登记)恒 true。 */
30
- /** #322:一次 apply 的**世代账载荷**(post-commit 发,[2283]② —— commit 段仍是零回调零发射)。 */
30
+ /** [ref]:一次 apply 的**世代账载荷**(post-commit 发,[ref]② —— commit 段仍是零回调零发射)。 */
31
31
  export interface ApplyReport {
32
32
  readonly version: number;
33
- /** #325:本候选的收货序数(= opts.generation 原样带回;世代账按它记拒收,身份标仍是 version)。 */
33
+ /** [ref]:本候选的收货序数(= opts.generation 原样带回;世代账按它记拒收,身份标仍是 version)。 */
34
34
  readonly ordinal?: number;
35
35
  readonly limits: {
36
36
  /** 本世代真正换了值的键。 */
@@ -87,7 +87,7 @@ export declare function applyEffective(config: ServiceConfig, eff: EffectiveConf
87
87
  export declare const RUNTIME_GATE_KEYS: readonly ["rateLimitPerMin", "approvalRequire", "maxTaskCostUsd", "maxTaskTokens", "maxPrincipalCostUsd", "costQuotaWindowSec"];
88
88
  export type RuntimeGateKey = (typeof RUNTIME_GATE_KEYS)[number];
89
89
  /**
90
- * #322 批1:六闸里**已转热**的五个(限额族)——它们的属主是 `stage-limits.ts`(boot+refresh 双腿),
90
+ * [ref] 批1:六闸里**已转热**的五个(限额族)——它们的属主是 `stage-limits.ts`(boot+refresh 双腿),
91
91
  * 所以 boot-only 的闸车道不再写它们,`runtime-gates` 重启片也不再为它们铸重启理由(键是热的却还要求重启
92
92
  * = 白白滚动重启整片 fleet)。剩下的 `approvalRequire` 仍是 restart-to-apply,归批2。
93
93
  */
@@ -95,13 +95,26 @@ export declare const HOT_RUNTIME_GATE_KEYS: ReadonlySet<string>;
95
95
  /** Uniform presence rule (center f95438a): a gate is "managed" when the field is present — any number (incl. 0),
96
96
  * or an array for approvalRequire. Sole guard: costQuotaWindowSec must be > 0 (a 0 window is nonsensical — core
97
97
  * divides by it; center's `.positive()` already enforces, belt-and-suspenders here). */
98
+ /**
99
+ * DESIGN-278 §5 S2([ref])—— center 这份 effective **当前在管**哪些 `ServiceConfig` 键(配置目录端点
100
+ * `GET /v1/config/catalog` 判 `effectiveLane` 的 center 半场)。
101
+ *
102
+ * 判据与各消费腿**同源**,不自铸第二份:
103
+ * · limits 域 = `hasOwnProperty`(stage-limits 的 published 判据逐字——present 含显式 0);
104
+ * · 六闸 legacy 位 = {@link runtimeGatePresent}(旧位 presence 规则的唯一属主);
105
+ * · governance/runtime 热二件 + approvalRequire = 键在场(applyRuntimeHot 的 non-sticky 判据同门);
106
+ * · readFace 域成员 = 键在场(read-face.ts 的逐键 env-wins 合成看的就是成员在场性);
107
+ * · models 面 = 有启用行(markRosterLanded 同判据);atModelAllowlist 单列(整表重算键)。
108
+ * 纯投影零副作用;`undefined` eff(还没拉到 / 纯 env 形)⇒ 空集。
109
+ */
110
+ export declare function centerManagedConfigKeys(eff: EffectiveConfig | undefined): ReadonlySet<string>;
98
111
  export declare function runtimeGatePresent(rt: NonNullable<EffectiveConfig["runtime"]>, key: RuntimeGateKey): boolean;
99
112
  export declare function applyRuntimeGates(config: ServiceConfig, rt: EffectiveConfig["runtime"], logger?: Logger): void;
100
113
  export declare function applyRuntimeHot(config: ServiceConfig, rt: EffectiveConfig["runtime"], logger?: Logger): void;
101
114
  /**
102
- * [865]① 显式默认解析——applyEffective 与 dry-run(logEffectiveDiff.wouldDefaultModel)共用的单源。优先级
115
+ * [ref]① 显式默认解析——applyEffective 与 dry-run(logEffectiveDiff.wouldDefaultModel)共用的单源。优先级
103
116
  * (显式源指向不在目录/未启用的名 ⇒ onDangling 回调后落下一级,绝不静默指错模型):
104
- * 1) eff.models.default 结构键 —— ✅ 既得路径([874] registry-core 0.10.11 落 `default?: string` schema
117
+ * 1) eff.models.default 结构键 —— ✅ 既得路径([ref] registry-core 0.10.11 落 `default?: string` schema
105
118
  * 键+per-worker /effective 直通;本地 lane 由 config-provider mapToServiceEffective 直通)。写面悬空 ref
106
119
  * 由 registry-core superRefine fail-loud;存量/未经 schema 路径仍走本函数的 warn 降级(双层姿势与
107
120
  * activeTierGroup 同构)。(1.200-1.202 期间此级恒空=当时如实的前行 seam,codex H2 注记已兑现。)
@@ -322,6 +322,51 @@ function stageEffective(config, eff, logger, opts) {
322
322
  }
323
323
  export const RUNTIME_GATE_KEYS = ["rateLimitPerMin", "approvalRequire", "maxTaskCostUsd", "maxTaskTokens", "maxPrincipalCostUsd", "costQuotaWindowSec"];
324
324
  export const HOT_RUNTIME_GATE_KEYS = new Set(BATCH1_LIMIT_KEYS);
325
+ export function centerManagedConfigKeys(eff) {
326
+ const out = new Set();
327
+ if (!eff)
328
+ return out;
329
+ const limits = eff.limits;
330
+ if (limits) {
331
+ for (const k of BATCH1_LIMIT_KEYS)
332
+ if (Object.prototype.hasOwnProperty.call(limits, k))
333
+ out.add(k);
334
+ }
335
+ const rt = eff.runtime;
336
+ if (rt) {
337
+ for (const k of RUNTIME_GATE_KEYS)
338
+ if (runtimeGatePresent(rt, k))
339
+ out.add(k);
340
+ if (rt.autonomy !== undefined)
341
+ out.add("autonomy");
342
+ if (rt.commandPolicy !== undefined)
343
+ out.add("commandPolicy");
344
+ }
345
+ if (eff.governance) {
346
+ if (eff.governance.autonomy !== undefined)
347
+ out.add("autonomy");
348
+ if (eff.governance.commandPolicy !== undefined)
349
+ out.add("commandPolicy");
350
+ if (eff.governance.approvalRequire !== undefined)
351
+ out.add("approvalRequire");
352
+ }
353
+ const rf = eff.readFace;
354
+ if (rf !== undefined && rf !== null && typeof rf === "object") {
355
+ if (rf.face !== undefined)
356
+ out.add("readFace");
357
+ if (rf.denyPatterns !== undefined)
358
+ out.add("readDenyPatterns");
359
+ if (rf.denyBuiltinTiers !== undefined)
360
+ out.add("readDenyBuiltinTiers");
361
+ if (rf.denyBuiltinExclude !== undefined)
362
+ out.add("readDenyBuiltinExclude");
363
+ }
364
+ if ((eff.models?.models ?? []).some((m) => m.enabled !== false))
365
+ out.add("models");
366
+ if (eff.models?.atModelAllowlist !== undefined)
367
+ out.add("atModelAllowlist");
368
+ return out;
369
+ }
325
370
  export function runtimeGatePresent(rt, key) {
326
371
  const v = rt[key];
327
372
  if (key === "approvalRequire")
@@ -1,11 +1,11 @@
1
1
  /**
2
- * #322 —— **世代账**(design/322 §2 世代账,codex 设计审 F4)。
2
+ * [ref] —— **世代账**([ref] §2 世代账,codex 设计审 F4)。
3
3
  *
4
4
  * 身份标 = 上游 `EffectiveConfig.version`,**刻意不造跨进程 epoch**(codex F4 语义不变):
5
5
  * · 同版本幂等重放(etag 未推进的下一拍)不该伪增世代;
6
6
  * · 双副本对账「是不是同一代」必须能跨进程判 —— 同 source version = 同一代。
7
7
  *
8
- * 🔴 #325(test [4809],[4810] 阻断裁定):**序轴与身份标分离**。source version 在
8
+ * 🔴 [ref](test [ref],[ref] 阻断裁定):**序轴与身份标分离**。source version 在
9
9
  * `CONFIG_PROVIDER=local` 下是 registry-core file-store 的内容哈希(u53,上游契约只承诺
10
10
  * 「同 files ⇒ 同 number」,从未承诺序)——把它当序数消费,哈希更小的合法新代会被永久
11
11
  * 静默忽略且本账双盲(target/applied 都不动)。修后:**推进判断吃收货处铸的进程内单调
@@ -13,7 +13,7 @@
13
13
  * `version` 只做对账身份标——configTargetVersion 语义从「max(见过)」变为「**最后**见过的
14
14
  * 源代」(remote 单调腿二者等价;local 腿这才是真相)。
15
15
  *
16
- * 读面两个:`/health` 的三键(target / applied / 失败持续时长;#325 起 additive 补
16
+ * 读面两个:`/health` 的三键(target / applied / 失败持续时长;[ref] 起 additive 补
17
17
  * targetOrdinal/appliedOrdinal 两键=推进/停滞的机器判据)给编排器判「这个副本要不要摘」;
18
18
  * 诊断端点的 `configApply` 段给运维看**按组**的细节(哪一组停在哪一代、上一次为什么被拒)。
19
19
  *
@@ -42,9 +42,9 @@ export interface ConfigApplyLedgerView {
42
42
  readonly configTargetVersion: number;
43
43
  /** 最后一次成功 commit 的源版本(身份标)。 */
44
44
  readonly configAppliedVersion: number;
45
- /** #325:target 的收货序数(进程内单调)——「见过多少代」的推进判据,哈希方向免疫。 */
45
+ /** [ref]:target 的收货序数(进程内单调)——「见过多少代」的推进判据,哈希方向免疫。 */
46
46
  readonly configTargetOrdinal: number;
47
- /** #325:applied 的收货序数。targetOrdinal 推进而这里停滞 = 「改了没生效」的机器判据。 */
47
+ /** [ref]:applied 的收货序数。targetOrdinal 推进而这里停滞 = 「改了没生效」的机器判据。 */
48
48
  readonly configAppliedOrdinal: number;
49
49
  /** target≠applied 的**持续**时长(ms);收敛时键缺席(健康面不制造噪音)。 */
50
50
  readonly configApplyStaleMs?: number;
@@ -53,7 +53,7 @@ export interface ConfigApplyLedgerView {
53
53
  /** applyEffective 的 post-commit 报告(见 apply-effective.ts `ApplyReport`)。 */
54
54
  export interface ConfigApplyReport {
55
55
  readonly version: number;
56
- /** #325:本候选的收货序数(applyEffective opts.generation 原样带回;缺席=version 兼容臂)。 */
56
+ /** [ref]:本候选的收货序数(applyEffective opts.generation 原样带回;缺席=version 兼容臂)。 */
57
57
  readonly ordinal?: number;
58
58
  readonly limits: {
59
59
  readonly applied: readonly string[];
@@ -4,7 +4,8 @@
4
4
  * "universal internal schema → translate at the boundary" pattern, with our security boundary kept:
5
5
  *
6
6
  * (name history: this module tracks the control plane's product name, which has changed over time
7
- * — registry → sema-web → planned sema-admin. The module itself keeps a neutral, product-name-free
7
+ * — registry → sema-web → sema-web-admin (2026-08-26 repo/product rename; an earlier revision of
8
+ * this note listed "planned sema-admin" as the next step). The module itself keeps a neutral, product-name-free
8
9
  * identifier ("config-center") and does not chase the rename.)
9
10
  *
10
11
  * - the CENTER owns the LOGICAL config: the model roster (names/capabilities/tier), the role map,
@@ -32,7 +33,7 @@
32
33
  * gateway silently on the rate-limit path.
33
34
  * - skills/mcp/scenarios/runtime-gates — restart-to-apply by construction (baked into the boot wiring).
34
35
  *
35
- * (design/158 A13, internal-lossless) This module is now a FACADE: the implementation lives
36
+ * ([ref] A13, internal-lossless) This module is now a FACADE: the implementation lives
36
37
  * alongside it in `src/config-center/` split by responsibility group (HTTP client / EffectiveConfig
37
38
  * application / restart-signal detection / skills+MCP consumption). Every symbol below is
38
39
  * re-exported UNCHANGED — existing `from ".../config-center/facade.js"` imports need zero changes
@@ -1,5 +1,5 @@
1
1
  /**
2
- * #322 —— **热键登记表**(design/322 §4 机器门)。
2
+ * [ref] —— **热键登记表**([ref] §4 机器门)。
3
3
  *
4
4
  * 一个键「是不是热的」在本仓有三个互相独立的说法:①代码里真的接了写入面;②测试里真的有黑盒断言;
5
5
  * ③文档里对运维的承诺。三者任一漂了,受害者都是运维(改了配置,不知道该不该重启)。本表是**闭集单源**:
@@ -12,7 +12,7 @@
12
12
  * 但没接线」的条目正是本表要消灭的那种谎。
13
13
  */
14
14
  import type { ServiceConfigFlat, ServiceConfigGroups } from "../config-types.js";
15
- /** 换代手法(design/322 §2):A′=写入面接线(消费侧本就现读);B=值换代座位(对象已建、值被冻住)。 */
15
+ /** 换代手法([ref] §2):A′=写入面接线(消费侧本就现读);B=值换代座位(对象已建、值被冻住)。 */
16
16
  export type HotKeyForm = "A-prime" | "B-setter";
17
17
  /** 三断言的用例 ID —— 与 test/config-hot 的参数化生成规则(`HK-<key>-<kind>`)逐字一致。 */
18
18
  export interface HotKeyCases {
@@ -2,7 +2,7 @@ import { type EntitlementRuntimeCaps } from "@sema-agent/settings-schema";
2
2
  import type { ScenarioRuling } from "../capabilities/scenarios.js";
3
3
  import type { EffectiveConfig, ExecutionRuling } from "./types.js";
4
4
  /** GET the effective config (Bearer + ETag). null = 304 (unchanged). Throws on transport/HTTP error, and on a
5
- * payload that is not an effective config at all(非对象 / version 非有限数 / gate 域坏形——[2281] 裁B)。
5
+ * payload that is not an effective config at all(非对象 / version 非有限数 / gate 域坏形——[ref] 裁B)。
6
6
  * `domainErrors`:坏 catalog 域(schema default 已落)逐域单列——与本地腿 `FetchEffectiveResult` 同键同义,
7
7
  * boot/refresh 的候选门直接消费。 */
8
8
  export declare function fetchEffective(baseUrl: string, token: string, etag: string | undefined, fetchImpl?: typeof fetch, worker?: string): Promise<{
@@ -14,7 +14,7 @@ export declare function fetchEffective(baseUrl: string, token: string, etag: str
14
14
  }>;
15
15
  } | null>;
16
16
  /**
17
- * design/99 §K (core 1.157 `RunnerDeps.runtimeCapsResolver`) — GET the PER-PRINCIPAL runtime
17
+ * [ref] §K (core 1.157 `RunnerDeps.runtimeCapsResolver`) — GET the PER-PRINCIPAL runtime
18
18
  * ENTITLEMENTS the engine enforces server-side, from center's `GET /api/config/effective?principal=&worker=`.
19
19
  * Center pre-resolves the tighten-only intersection (fleet defaults ∩ tier ⊕ roles + overrides) and returns a
20
20
  * `runtimeCaps` block — the service passes it through verbatim (no further tightening, per center's ruling).
@@ -42,7 +42,7 @@ export declare function fetchPrincipalCaps(baseUrl: string, token: string, princ
42
42
  etag?: string;
43
43
  } | null>;
44
44
  /**
45
- * design/170 件A —— 读 `?principal=` 响应里的 org 记忆解析段(org 目录腿的取数口)。
45
+ * [ref] 件A —— 读 `?principal=` 响应里的 org 记忆解析段(org 目录腿的取数口)。
46
46
  *
47
47
  * 🔬 **为什么不复用 {@link fetchPrincipalCaps}**(复审车 D-2 修):C3「两张表失败域互不干扰」是在档
48
48
  * 裁定,registry-core 的 `PrincipalCapsWire` 也正是为此把 org 段留成 `unknown`(「在本 schema 里校验
@@ -75,10 +75,10 @@ export declare class ConfigCenterHttpError extends Error {
75
75
  * the legacy `applyCenterSkills` path keeps treating every throw as "skip this skill, keep baseline".
76
76
  */
77
77
  export declare function fetchSkillContent(baseUrl: string, token: string, contentHash: string, fetchImpl?: typeof fetch): Promise<string>;
78
- /** [985]b / [1285]① — §9.4 by-digest 补拉二函(fetchSkillContent 同姿势:HTTP+Bearer+8s 超时+
78
+ /** [ref]b / [ref]① — §9.4 by-digest 补拉二函(fetchSkillContent 同姿势:HTTP+Bearer+8s 超时+
79
79
  * 消费侧自证)。artifact=envelope JSON(验真=调用方过 core verifyPromptArtifact,canonical 重算——
80
80
  * 本函数只做传输与形读,不超范围解释);blob=段文本 raw-byte(sha256 逐位自证,fetchSkillContent 同款)。
81
- * digest 参数收带前缀/裸 hex 两形([1285] 参数口径)。 */
81
+ * digest 参数收带前缀/裸 hex 两形([ref] 参数口径)。 */
82
82
  export declare function fetchPromptArtifact(baseUrl: string, token: string, artifactDigest: string, fetchImpl?: typeof fetch): Promise<unknown>;
83
83
  export declare function fetchPromptBlob(baseUrl: string, token: string, contentDigest: string, fetchImpl?: typeof fetch): Promise<string>;
84
84
  //# sourceMappingURL=http-client.d.ts.map
@@ -1,11 +1,11 @@
1
1
  /**
2
- * #324(core 5.50 design/338 提货件)—— mid-turn MCP 撤销台账:`RunnerDeps.mcpRevocations` 席的宿主实现。
2
+ * [ref](core 5.50 [ref] 提货件)—— mid-turn MCP 撤销台账:`RunnerDeps.mcpRevocations` 席的宿主实现。
3
3
  *
4
4
  * 语义(与 core 契约对表,types.d.ts `RunnerDeps.mcpRevocations` 注):
5
5
  * · 权威单点在宿主 —— core 每次 MCP dispatch 前**同步**探 `isRevoked(serverName)`,从不缓存答案。
6
6
  * · 本台账记「中心**曾发布为 enabled、后从 enabled 集移除**」的服务器名。MCP mount 是 boot-baked
7
7
  * (`resolveMcpServers` 只在启动期跑),所以**删除向**在 5.50 前只能等 restart 才生效——这正是
8
- * design/338 要消的窗:治理面最要紧的动作(撤销一条对外通道)现在即时生效,restart 信号的
8
+ * [ref] 要消的窗:治理面最要紧的动作(撤销一条对外通道)现在即时生效,restart 信号的
9
9
  * 删除向豁免见 `restart-signal.ts` 的 mcp 特判(`mcpRevocationLive` 前提,fail-closed:席没接线
10
10
  * 的部署保持旧的 restart 语义)。
11
11
  * · **重现恢复是指纹判,不是名字判**(codex F1,confirmed):被撤的名字回到 enabled 集时,只有当
@@ -46,8 +46,10 @@ export declare function createMcpRevocationLedger(onChange?: (ev: {
46
46
  }) => void): McpRevocationLedger;
47
47
  /** 一拍 EffectiveConfig 的 ENABLED MCP 服务器条目表(`resolveMcpServers` 同判据:`enabled !== false`;
48
48
  * 值=整条目的 key 排序 JSON 指纹,Map 插入序=发布序);mcp 域缺席 ⇒ `null`(台账不动)。
49
- * 指纹口径与 restart-signal 的 stableStringify 同精神(key 序归一),但**刻意独立实现**:两处指纹
50
- * 只在各自域内自比,不跨域比对,无同源约束。 */
49
+ * 指纹序列化器 = restart-signal 的 `stableStringify`([ref] 2026-08-31 起同源:此前本文件持一份**逐字相同**的
50
+ * 私有复刻 `fingerprintOf`,两份在全部输入上字节恒等,合并零行为差,golden 钉 test/canonical-json-golden.test.ts)。
51
+ * 两处指纹仍只在各自域内自比、不跨域比对——同源只是去掉一份多余的复刻,不引入跨域约束;也**不**改用
52
+ * `src/canonical-json.ts`(undefined 值键语义不同,见 restart-signal.ts 该函数顶注)。 */
51
53
  export declare function enabledMcpEntries(mcp: {
52
54
  servers: Array<{
53
55
  name: string;
@@ -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
2
  import { RUNTIME_GATE_KEYS, HOT_RUNTIME_GATE_KEYS, runtimeGatePresent, 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))
@@ -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 腿拒——**判据阈值同源,处置刻意不同**:
@@ -2,7 +2,7 @@
2
2
  * config-center wire types — the config-center `/api/config/effective` payload shapes (`CenterModel`,
3
3
  * `CenterTeam`, `CenterSkillManifest`, `CenterMcpServer`, `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;
@@ -109,7 +109,7 @@ export interface CenterMcpServer {
109
109
  * loop unless an operator explicitly opts it in. */
110
110
  elicitation?: boolean;
111
111
  /**
112
- * design/378(core 5.60.0)—— 声明**这台 server 的整套工具**带回来的内容属于哪一类,映射到
112
+ * [ref](core 5.60.0)—— 声明**这台 server 的整套工具**带回来的内容属于哪一类,映射到
113
113
  * `McpServerSpec.contentOrigin`。`"local"` / `"execution"` ⇒ 这台 server 的调用不再给本会话记忆打
114
114
  * 「已接触外来内容」标(`execution` 仍留在 `execIsExternalContent` 那只旋钮的射程内);`"external"` 是
115
115
  * 显式 PIN,而**PIN 不是空操作** —— 它会取消 `trustedTools` 对这台 server 的按名豁免。
@@ -121,9 +121,13 @@ export interface CenterMcpServer {
121
121
  * 所以它的家在 center 下发这条腿;请求腿那半场的门与结构性兑现见 `task-mcp.ts`
122
122
  * 的 `assertRequestMcpContentOrigin` 顶注。
123
123
  *
124
- * ⚠️ **本地 `config.d` 腿今天到不了这里**(如实登记,别读成「两条腿都通」):那条腿的原料形是
125
- * registry-core zod schema,未知键被 strip;等 registry-core 补上同名可选键,
126
- * `config-provider.ts` 的映射再加一行即可(远端 `/effective.mcp` 腿是直读 JSON,今天就通)。
124
+ * ⚠️ **两条腿今天都到不了这里**([ref]③ / [ref]③ / [ref],2026-08-31 双绊线实测更正 —— 本注旧版那句
125
+ * 「远端 /effective.mcp 腿是直读 JSON,今天就通」**不成立**,doc-rot):settings-schema(原 registry-core)
126
+ * `McpServerSpec` 是默认 strip 的 zod object 且没有 `contentOrigin` 可选键,本地腿在 FileConfigStore 的
127
+ * `parseDomainLoud(DOMAIN_SCHEMAS.mcp)`、远端腿在消费端边界 `readEffectiveWire`([ref] 裁B)**各被剥一次**。
128
+ * 修在 sema-settings-schema(补同名可选枚举键 + 发包),本仓提货后 `config-provider.ts` 的映射加一行即通;
129
+ * 两条 `it.fails` 绊线(test/config-center-wire-read.test.ts + test/config-provider.test.ts)在上游到货时
130
+ * 自动翻红逼销账。
127
131
  */
128
132
  contentOrigin?: ToolContentOrigin;
129
133
  transport: {
@@ -132,7 +136,7 @@ export interface CenterMcpServer {
132
136
  args?: string[];
133
137
  envRefs?: Record<string, string>;
134
138
  }
135
- /** `principalHeader` (design/62): the header name into which the runner injects the task's authenticated
139
+ /** `principalHeader` ([ref]): the header name into which the runner injects the task's authenticated
136
140
  * end-user principal per-task, so a consumer MCP (e.g. oa-mcp) can enforce per-user RBAC. Not a ref — a
137
141
  * literal header name. The runner fills the value (never the model). */
138
142
  | {
@@ -159,14 +163,14 @@ export interface CenterA2aPeer {
159
163
  /** env-NAME refs (header-name → ENV_NAME) resolved from THIS service's env at boot. A peer with ANY
160
164
  * unset ref is SKIPPED wholesale (fail-safe — never dial a peer half-credentialed). */
161
165
  headerRefs?: Record<string, string>;
162
- /** design/62, same contract as the MCP side: the header name the runner injects the task's authenticated
166
+ /** [ref], same contract as the MCP side: the header name the runner injects the task's authenticated
163
167
  * end-user principal into. Not a ref — a literal header NAME (the runner fills the value, never the model). */
164
168
  principalHeader?: string;
165
169
  /** Optional allowlist of the peer's skill ids to mount (others are not mounted). */
166
170
  allowSkills?: string[];
167
171
  }
168
172
  /**
169
- * #A4([4147] 窗三件批 件1;[4073]/[4083] 承诺件)—— READ 容纳面的 center 下发形(`CenterA2aPeer` 的
173
+ * #A4([ref] 窗三件批 件1;[ref]/[ref] 承诺件)—— READ 容纳面的 center 下发形(`CenterA2aPeer` 的
170
174
  * 同族:一个 additive 顶层域,server 声明它才不会被静默丢弃)。四个成员逐一对应部署 env 的四键
171
175
  * (`READ_FACE` / `READ_DENY_PATTERNS` / `READ_DENY_BUILTIN_TIERS` / `READ_DENY_BUILTIN_EXCLUDE`),
172
176
  * 消费半场 = `config-center/read-face.ts` `applyCenterReadFace`。
@@ -192,11 +196,11 @@ export interface CenterReadFace {
192
196
  denyBuiltinExclude?: string[];
193
197
  }
194
198
  /**
195
- * #322 批1 的 wire 面(`EffectiveConfig.limits`)。**全 optional**:缺席 = 本域不管这一键 ⇒ 该键回 env
199
+ * [ref] 批1 的 wire 面(`EffectiveConfig.limits`)。**全 optional**:缺席 = 本域不管这一键 ⇒ 该键回 env
196
200
  * 基线(非粘,applyRuntimeHot 的 NON-STICKY 同族纪律 —— 「缺席=保上一个 center 值」会把撤回的治理永久冻住)。
197
201
  *
198
202
  * 🔴 类型是**到货 JSON 的声明**,不是运行时保证(local 腿的 eff 来自原始 JSON):每个键在 stage 侧都
199
- * 逐个验型验域,坏值 ⇒ 整批拒 + 旧值继续服务(#123 响亮拒)。
203
+ * 逐个验型验域,坏值 ⇒ 整批拒 + 旧值继续服务([ref] 响亮拒)。
200
204
  */
201
205
  export interface EffectiveLimits {
202
206
  /** 每 principal 每分钟请求上限;**0 = 关**(关断哨兵,不是缺席)。 */
@@ -234,7 +238,7 @@ export interface EffectiveLimits {
234
238
  export interface EffectiveConfig {
235
239
  version: number;
236
240
  updatedAt: string;
237
- /** [2373]B-6:default/tierGroups/activeTierGroup 收进类型面(registry-core 0.13.0 已声明,
241
+ /** [ref]B-6:default/tierGroups/activeTierGroup 收进类型面(registry-core 0.13.0 已声明,
238
242
  * types.d.ts:641/679/724)——此前 wire 面靠「JSON verbatim + 消费方结构读」逃逸,投影/消费两侧
239
243
  * 各自 as 宽铸。tierGroups 上游是 ZodDefault(合规 center 恒发),但本类型描述的是**到货 JSON**
240
244
  * (含非合规/旧存量 center),故仍标 optional——消费方 resolveActiveTiers 自身容缺。 */
@@ -299,7 +303,7 @@ export interface EffectiveConfig {
299
303
  commandPolicy?: CommandRule[];
300
304
  };
301
305
  /**
302
- * #322 批1 —— **limitsHttp 组的热更新发布域**(design/322 §6 批1)。
306
+ * [ref] 批1 —— **limitsHttp 组的热更新发布域**([ref] §6 批1)。
303
307
  *
304
308
  * 🔴 为什么是**新顶层域**而不是往 `runtime` 里加键(亲验,不是推测):registry-core 的 `RuntimeConfig`
305
309
  * 是 zod `"strip"` 对象,`runtime` 里的未知键在**两条腿上都会被静默剥掉**(local 腿实测
@@ -320,7 +324,7 @@ export interface EffectiveConfig {
320
324
  limits?: EffectiveLimits;
321
325
  /** 142-S4(registry-core 0.10.0 第 15 域):center 项目登记簿。wire 面 verbatim JSON —
322
326
  * registry-core `ProjectsConfig` 的形状是 `{projects: Record<projectId, ProjectRegistration>}`(skills/mcp
323
- * 同款域包裹)。[2373]B-8:裸 Record 联合臂随 apply-effective 的宽读一起删(0.13.0 只有包裹形,
327
+ * 同款域包裹)。[ref]B-8:裸 Record 联合臂随 apply-effective 的宽读一起删(0.13.0 只有包裹形,
324
328
  * 裸形无 producer)。消费=applyEffective → config.projects(displayName/gitRemotes/defaultScopes
325
329
  * 三个 runtime 字段;审计字段不进 ServiceConfig)。 */
326
330
  projects?: {
@@ -334,7 +338,7 @@ export interface EffectiveConfig {
334
338
  commandPolicy?: CommandRule[];
335
339
  approvalRequire?: string[];
336
340
  };
337
- /** plugins 域(registry-core 0.5 additive;契约冻结 [1361]②/[1362]/[1366]①,消费半场 2026-07-28
341
+ /** plugins 域(registry-core 0.5 additive;契约冻结 [ref]②/[ref]/[ref]①,消费半场 2026-07-28
338
342
  * 开工车):center 只存"插件从哪来"(PluginSpec 引用,永不承载可执行字节);worker 半场在
339
343
  * capabilities/center-plugins.ts `applyCenterPlugins`(https-only+ALLOW_HOSTS 纵深复验/sha 钉扎/
340
344
  * 隔离 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 期会当场拒启的姿态(无鉴权写面被
@@ -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);