@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
@@ -1,4 +1,4 @@
1
- /** design/158 A1: the ServiceConfig TYPE face, split out of the 1.8k-line loader module (config.ts)
1
+ /** [ref] A1: the ServiceConfig TYPE face, split out of the 1.8k-line loader module (config.ts)
2
2
  * so pure-type consumers (http/server, plugins/*, hooks/hook-llm, security, brain, sema-registry)
3
3
  * depend on a LEAF with zero runtime edges — this is the substantive step that dissolves the
4
4
  * type-closed edges into config.ts (lens2 §A). TYPES ONLY: loadConfig and every runtime value stay
@@ -14,7 +14,7 @@ import type { UnattendedApprovalPolicy } from "./tool-approval.js";
14
14
  import type { InfraCostRates } from "./observability/cost-taxonomy.js";
15
15
  import type { Autonomy, CommandRule } from "./runtime-governance.js";
16
16
  import type { GitApiKind } from "./git-api-kind.js";
17
- /** #228:记忆向量面的 embedder 坐标(env `MEMORY_EMBEDDER_*` 解析结果;单一属主 = 本类型,
17
+ /** [ref]:记忆向量面的 embedder 坐标(env `MEMORY_EMBEDDER_*` 解析结果;单一属主 = 本类型,
18
18
  * `plugins/memory-embedder.ts` 的工厂直接消费它,不复制形状)。语义与三问见
19
19
  * {@link ServiceConfigFlat.memoryEmbedder}。纯数据 —— 端点原文照存(拼 `/embeddings` 是 transport
20
20
  * 的活,与 `memorySync.url` 的尾斜杠口径一致)。 */
@@ -31,13 +31,13 @@ export interface MemoryEmbedderConfig {
31
31
  apiKey?: string;
32
32
  }
33
33
  /**
34
- * #270 §4 —— 托管留存的**灰度档**闭集。`as const` 数组是词表的唯一真源(config 解析、能力位、审计行
34
+ * [ref] §4 —— 托管留存的**灰度档**闭集。`as const` 数组是词表的唯一真源(config 解析、能力位、审计行
35
35
  * 的 `mode` 列共读它);两词之外的值在启动期响亮拒 —— 一个拼错的档位静默落回 `audit-only` 会让运维
36
36
  * 以为在删、其实没删,而拼成别的方向就是反过来那件更坏的事。
37
37
  */
38
38
  export declare const RETENTION_MODES: readonly ["audit-only", "enforce"];
39
39
  export type RetentionMode = (typeof RETENTION_MODES)[number];
40
- /** #270 §3/§4 —— sweep lane 的节律与灰度档(语义与三问见 {@link ServiceConfigFlat.retentionSweep})。 */
40
+ /** [ref] §3/§4 —— sweep lane 的节律与灰度档(语义与三问见 {@link ServiceConfigFlat.retentionSweep})。 */
41
41
  export interface RetentionSweepConfig {
42
42
  /** `audit-only` = 照跑照判、只记 `audit_only` 行,**不调任何破坏性方法**;`enforce` = 真删。默认前者。 */
43
43
  mode: RetentionMode;
@@ -45,7 +45,7 @@ export interface RetentionSweepConfig {
45
45
  intervalSec: number;
46
46
  }
47
47
  /**
48
- * design/378 D2 —— 周期腿节律的**下界**(秒)。一轮 consolidation 读全库(~1e5 prompt tokens)且
48
+ * [ref] D2 —— 周期腿节律的**下界**(秒)。一轮 consolidation 读全库(~1e5 prompt tokens)且
49
49
  * core 自带 24h 的时间闸,比这更密的节律只可能是把分钟/毫秒当成秒写的手滑。夹取(不是拒启)方向安全:
50
50
  * 夹上去只会**少**跑,而这条腿花的是钱。
51
51
  * ⚠️ 今天这条夹取**还够不着**:本 build 没有周期腿,任何正值在解析期就拒启(见
@@ -54,7 +54,7 @@ export interface RetentionSweepConfig {
54
54
  */
55
55
  export declare const MEMORY_CONSOLIDATION_MIN_INTERVAL_SEC = 300;
56
56
  /**
57
- * design/378 D1/D2 —— consolidation driver 阀门的三根旋钮(语义与三问见
57
+ * [ref] D1/D2 —— consolidation driver 阀门的三根旋钮(语义与三问见
58
58
  * {@link ServiceConfigFlat.memoryConsolidationDriver})。纯数据。
59
59
  */
60
60
  export interface MemoryConsolidationDriverConfig {
@@ -122,7 +122,7 @@ export interface A2aServeSkill {
122
122
  *
123
123
  * `url` is REQUIRED here because it is required when the knob is on: a public discovery document that
124
124
  * cannot say where to call is a broken card, and the reachable address is the operator's to declare —
125
- * #123 `FLEET_ADVERTISE_ADDRESS` precedent, 不自猜可达地址(deriving it from the request `Host` header
125
+ * [ref] `FLEET_ADVERTISE_ADDRESS` precedent, 不自猜可达地址(deriving it from the request `Host` header
126
126
  * would let an anonymous caller decide what our public card advertises).
127
127
  */
128
128
  export interface A2aServeConfig {
@@ -144,15 +144,15 @@ export interface A2aServeConfig {
144
144
  * off (the control plane never mounts). The runner-facing facts (the runner principal, the build-host CACHE_BASE,
145
145
  * the default base ref) live here so image-api injects only VETTED, server-fixed values into the build.sh argv —
146
146
  * operator free-text never reaches the runner. */
147
- /** #151 车3(design/172 流内审批协议)的配置面。总开关默认 **true**(clay 裁 2026-08-08,#164 翻真验证后;
147
+ /** [ref] 车3([ref] 流内审批协议)的配置面。总开关默认 **true**(clay 裁 2026-08-08,[ref] 翻真验证后;
148
148
  * 树上已生效,发布线落在 7.4.0 之后的下一个发布);四个从属旋钮只在开关为真时生效
149
149
  * (语义与「谁需要 / 谁被伤 / 什么补偿」三问见 `ServiceConfigFlat.streamApproval` 的注)。 */
150
150
  export interface StreamApprovalConfig {
151
- /** 协议总开关。`STREAM_APPROVAL_ENABLED`,默认 **true**(clay 裁 2026-08-08,#164 翻真验证后;7.5.0 起)。显式 false ⇒ 全链逐字 7.3.0 前行为(唯一干净还原键)。
151
+ /** 协议总开关。`STREAM_APPROVAL_ENABLED`,默认 **true**(clay 裁 2026-08-08,[ref] 翻真验证后;7.5.0 起)。显式 false ⇒ 全链逐字 7.3.0 前行为(唯一干净还原键)。
152
152
  * 翻真要等回决端点(车4)与对账收敛器(车5)到位——在此之前是个不完整协议(有卡无正规回决口、
153
153
  * 有 PARKING 无收敛器、跨副本回决无唤醒路径)。 */
154
154
  enabled: boolean;
155
- /** 开关为真时作为 `ToolApprovalCoordinator` 的 `ttlMs`(design/172 §3.3 的「配置窗默认」)。
155
+ /** 开关为真时作为 `ToolApprovalCoordinator` 的 `ttlMs`([ref] §3.3 的「配置窗默认」)。
156
156
  * `STREAM_ASK_WINDOW_MS`,默认 **300000**(同裁与 sync 腿既有 5min 活卡窗对齐)。`0` = 运维显式关窗 ⇒ 恒 park(§3.3 窗=0 语义)。
157
157
  * 开关为假 ⇒ 本值不参与,窗保持既有 `DEFAULT_APPROVAL_TTL_MS`(5min)。 */
158
158
  windowMs: number;
@@ -161,12 +161,12 @@ export interface StreamApprovalConfig {
161
161
  replayMax: number;
162
162
  /** 写侧准入门(§0 X-2)的 per-task 未决 ask 上限。超限 ⇒ 在落 pending/建 timer/发帧**之前**返回
163
163
  * `"unavailable"`(park 路由;**缺省 park 政策下永不 deny**——过载 bypass 到 park 是 §3.3 的硬条款。
164
- * #280 R-13 C:`UNATTENDED_APPROVAL_POLICY=deny` 的部署按自声明当场拒,理由见该键域注)。
164
+ * [ref] R-13 C:`UNATTENDED_APPROVAL_POLICY=deny` 的部署按自声明当场拒,理由见该键域注)。
165
165
  * `STREAM_APPROVAL_ADMIT_MAX_PER_TASK`,默认 **32**。消费点在刀 3b。 */
166
166
  admitMaxPerTask: number;
167
167
  /** 同上,per-owner(租户)维。`STREAM_APPROVAL_ADMIT_MAX_PER_OWNER`,默认 **256**。 */
168
168
  admitMaxPerOwner: number;
169
- /** #151 车5 §5 治理旋钮(全部 `numEnvBounded` 有界解析,§9 C6)—— 对账收敛器每 tick **每段**
169
+ /** [ref] 车5 §5 治理旋钮(全部 `numEnvBounded` 有界解析,§9 C6)—— 对账收敛器每 tick **每段**
170
170
  * (PARKING / 孤儿 STREAM_PENDING)最多处理的行数。超出的下轮接着扫(靠 `deferReconcile` 的队列
171
171
  * 轮转保证「接着」是真的,不是永远同一批)。`STREAM_APPROVAL_RECONCILE_BATCH`,默认 **200**,
172
172
  * 有界 [1, 10000]。 */
@@ -184,12 +184,12 @@ export interface StreamApprovalConfig {
184
184
  * 默认 **7d**,有界 [60000, 90d]。 */
185
185
  orphanTtlMs: number;
186
186
  /**
187
- * S-43(案A,#374 / core #481)—— **零活流铸造**的 ask 的悬挂窗。`UNREACHED_ASK_TTL_MS`,
188
- * 默认 **3600000**(1h),有界 [60000, 86400000](60s ~ 24h),坏值/越界**拒启**(#210 A 档)。
187
+ * [ref](案A,[ref] / core [ref])—— **零活流铸造**的 ask 的悬挂窗。`UNREACHED_ASK_TTL_MS`,
188
+ * 默认 **3600000**(1h),有界 [60000, 86400000](60s ~ 24h),坏值/越界**拒启**([ref] A 档)。
189
189
  *
190
190
  * 三问(behavior-facing 硬条款):
191
191
  * · **谁需要**:workflow 恒后台跑(CC 220 parity)⇒ 子代 ask 到达时 (owner, session) 键域常无活 SSE。
192
- * 改形前那一刻即答 `"unavailable"`,合成整条命令死拒([5443] 车道2 实证)。悬挂让人稍后经
192
+ * 改形前那一刻即答 `"unavailable"`,合成整条命令死拒([ref] 车道2 实证)。悬挂让人稍后经
193
193
  * `/v1/approvals` / 壳队列 / attach 补投三通道回来答它。1h 是「人不在场但当天会回来」的尺度。
194
194
  * · **谁被伤**:悬挂 ask 占一格写侧准入配额(`STREAM_APPROVAL_ADMIT_MAX_PER_TASK`,默认 32)且占一条
195
195
  * 持久行,窗越长积压越久;显式声明无人值守的部署(`UNATTENDED_APPROVAL_POLICY=deny`)**完全不受
@@ -252,7 +252,7 @@ export interface ServiceConfigFlat {
252
252
  *
253
253
  * 🔴 **缺席 = 不传给引擎**(不是"传个默认值"):此前这里是硬编码 `maxRetries: 2`,而显式传参**压过**
254
254
  * 引擎默认 ⇒ core 抬默认对 server 部署一点效果都没有。缺席不传之后,引擎默认当家、core 抬默认自动继承。
255
- * (五报清查 R1① 的 server 半场,黑板 [2161]/[2162];anthropic 腿早有 `ANTHROPIC_MAX_RETRIES` 出口,
255
+ * (五报清查 R1① 的 server 半场,黑板 [ref]/[ref];anthropic 腿早有 `ANTHROPIC_MAX_RETRIES` 出口,
256
256
  * 这条只是把同样的出口补给限流 provider 真正走的那条腿。) */
257
257
  gatewayMaxRetries?: number;
258
258
  /** Optional Anthropic Messages API ROUTE (cloud). Selected for models whose `provider` is
@@ -274,7 +274,7 @@ export interface ServiceConfigFlat {
274
274
  * env 没配时以前会铸成 `2` 再显式传给引擎,把引擎默认写死在 server 这一层。 */
275
275
  maxRetries?: number;
276
276
  };
277
- /** Resilience brain stack (1.38, design/27): tiered timeouts + an optional circuit breaker layered
277
+ /** Resilience brain stack (1.38, [ref]): tiered timeouts + an optional circuit breaker layered
278
278
  * UNDER the existing failover (gatewayFallbackUrls). Every field defaults to off/disabled, so the
279
279
  * brain composition stays byte-identical until an operator opts in. The breaker only changes
280
280
  * behaviour when paired with ≥2 gateway routes (it fast-fails a tripped primary so failover switches
@@ -282,10 +282,10 @@ export interface ServiceConfigFlat {
282
282
  * cross-replica shared state (TiDB adapter) is a documented follow-up. */
283
283
  resilience: {
284
284
  /** Abort fetch if response headers don't arrive within this many ms → retryable [network].
285
- * Default 30s ([880] fleet audit). 0 = off. */
285
+ * Default 30s ([ref] fleet audit). 0 = off. */
286
286
  connectTimeoutMs: number;
287
287
  /** Cancel an open SSE stream if no content/thinking delta arrives within this many ms.
288
- * Default 120s ([880] fleet audit — core's idle timer only arms after the first token,
288
+ * Default 120s ([ref] fleet audit — core's idle timer only arms after the first token,
289
289
  * so this is the only guard for a stream that opens and never emits). 0 = off. */
290
290
  firstTokenTimeoutMs: number;
291
291
  /** Mid-stream stall watchdog (1.40.1): after output starts, re-armed on every delta; silence for
@@ -339,7 +339,7 @@ export interface ServiceConfigFlat {
339
339
  /** Role → model map (1.24): `subagent`/`summarize` → the cheap model when `MODEL_CHEAP_ID` is set
340
340
  * (council lenses + compaction get cheap), `default`/`team`/`synthesize` stay on the main model. */
341
341
  roles: ModelRoles;
342
- /** #233 / A-002.8 —— **`@`-mention 允许名单**(registry-core `models.atModelAllowlist` 的服务端消费面)。
342
+ /** [ref] / [ref] —— **`@`-mention 允许名单**(registry-core `models.atModelAllowlist` 的服务端消费面)。
343
343
  * 语义(registry-core `ModelsDomain.atModelAllowlist` 的 JSDoc 同源):**缺席/空 = 全部启用模型都可被用户点选**;非空 = 用户
344
344
  * 逐 turn 选择通道只能落在名单内的 catalog name 上。
345
345
  *
@@ -368,7 +368,7 @@ export interface ServiceConfigFlat {
368
368
  /** B1 /health 活体 store 探测:后台缓存探针间隔 ms(STORE_PROBE_INTERVAL_MS;0=显式关,负/非数 boot
369
369
  * 响亮拒)。只对 SQL 后端接线;探针原语=backend.dbNowMs()(S10 时钟探针的真 DB 往返,零新 SQL 面)。 */
370
370
  storeProbeIntervalMs: number;
371
- /** Long-term memory (design/138 S1, clay 2026-07-08): the injection-first file-based memory ENGINE
371
+ /** Long-term memory ([ref] S1, clay 2026-07-08): the injection-first file-based memory ENGINE
372
372
  * (core `RunnerDeps.memoryBackend` + `MemoryEngine`) is the ONLY memory plane — the legacy MemoryStore
373
373
  * path (MEMORY_BACKEND/EMBEDDING_* SQL/file note stores) was dropped without migration. Default ON;
374
374
  * `MEMORY_ENGINE=off` is the explicit kill-switch. Single-user only — main.ts gates the wiring on
@@ -387,7 +387,7 @@ export interface ServiceConfigFlat {
387
387
  /** The single-user deployment's one memory scope name (env MEMORY_SCOPE; default "local" under
388
388
  * single-user). Feeds `spec.memory.scope` — the new engine consumes the same normalized scopes. */
389
389
  memoryScope?: string;
390
- /** #217(core 5.26.0 `TaskSpec.memoryPersistenceCapable`)—— 本部署对「这台机器上的任务**能不能**把
390
+ /** [ref](core 5.26.0 `TaskSpec.memoryPersistenceCapable`)—— 本部署对「这台机器上的任务**能不能**把
391
391
  * 用户说的『记住 X』落到持久处」的**自我声明**,env `MEMORY_PERSISTENCE_CAPABLE`,三态:
392
392
  * · 缺席(默认)⇒ 键不上 TaskSpec,core 按自己的 roster 推断(已知落盘路 = 挂载且未排除的文件写工具
393
393
  * 或可写 shell;remote 执行环境的手带写的是沙箱盘,不算够得着 host 记忆根);
@@ -396,7 +396,7 @@ export interface ServiceConfigFlat {
396
396
  * 收窄的官方恢复路径);
397
397
  * · `false` ⇒ 强制披露只读/无持久面,并关掉文件工具往记忆根的写通道(披露不会被存储事实推翻)。
398
398
  *
399
- * 🔴 **`false` 自 core 5.27.0 起还多一层**([3612] F2,#231 提货):declared-false 的会话是**受限会话**
399
+ * 🔴 **`false` 自 core 5.27.0 起还多一层**([ref] F2,[ref] 提货):declared-false 的会话是**受限会话**
400
400
  * —— materialize/search/harvest 一律按**已提交账**(ledger + shadow)供给,磁盘上无事务背书的分歧
401
401
  * 既不收编也不供给,而是留盘 + 响亮点名(`restricted_divergence`,`HarvestRejectionCode` 新成员),
402
402
  * 等下一次**非受限**会话走正常门收编。这补上了 5.26.0 自己登记的那条残余(读侧入站同步收编磁盘分歧
@@ -412,7 +412,7 @@ export interface ServiceConfigFlat {
412
412
  * 客户端表态(per-run 暂停写,writeScope:null),`memoryPersistenceCapable` 是**部署**声明(operator 面,
413
413
  * 与请求无关)。两轴任一取「否」方向即只读方向 —— 客户端能收紧本次运行,永远不能靠表态把部署声明的
414
414
  * `false` 撑开(operator 旋钮不挂客户端表态派生腿)。
415
- * ⚠️ **别把两轴的「只读」当成同一件事**([3612] F2 修后口径,逐字对齐 core):**受限**是**会话级的
415
+ * ⚠️ **别把两轴的「只读」当成同一件事**([ref] F2 修后口径,逐字对齐 core):**受限**是**会话级的
416
416
  * verdict 单键**(= 这里的 declared-false),而 `writeScope:null` 的只读**平面**(`memoryWrite:false` 的
417
417
  * per-run 暂停 / org 层默认只读 / 双根非写面)**保持 adopt-on-read 原样** —— 受限是会话的**声明**,
418
418
  * 永远不是平面的**结构**。所以:一次 `memoryWrite:false` 的运行照常收编磁盘上的新内容(用户手改、
@@ -431,18 +431,18 @@ export interface ServiceConfigFlat {
431
431
  maxPushEntries?: number;
432
432
  maxPullEntries?: number;
433
433
  };
434
- /** #228(黑板 [3590]/[3606] 两裁):记忆检索的**向量面**接线 —— OpenAI 兼容 `/embeddings` 端点。
434
+ /** [ref](黑板 [ref]/[ref] 两裁):记忆检索的**向量面**接线 —— OpenAI 兼容 `/embeddings` 端点。
435
435
  * env 四键(+ 可选 key):`MEMORY_EMBEDDER_ENDPOINT` / `MEMORY_EMBEDDER_MODEL` / `MEMORY_EMBEDDER_DIM`
436
436
  * (+ `MEMORY_EMBEDDER_TIMEOUT_MS` / `MEMORY_EMBEDDER_API_KEY`)。三问:
437
437
  *
438
438
  * ① **谁需要**:pg 记忆后端的部署。core 的记忆引擎三档(`vectorMode = lexical|portable|native`)不是
439
- * 档位旋钮,而是「后端上限 × embedder 在场」的**推断结果**([3590] 裁①:不开档位 env —— 显式选档
440
- * 只会造出「选了 native 却没 embedder」这类矛盾态)。本仓在 #228 之前从未注入过 embedder,所以
439
+ * 档位旋钮,而是「后端上限 × embedder 在场」的**推断结果**([ref] 裁①:不开档位 env —— 显式选档
440
+ * 只会造出「选了 native 却没 embedder」这类矛盾态)。本仓在 [ref] 之前从未注入过 embedder,所以
441
441
  * pg 部署的检索**恒 lexical**(词面 jaccard),向量列空转。配上这几键 = 该部署真正拿到语义检索。
442
442
  * ② **半配为何拒启**:三键里少任何一件,「向量面」都无从组装。静默忽略的后果不是功能缺席,而是
443
443
  * **operator 以为开了**——检索照常返回结果(词面档),质量差异只在最终答案里,任何日志都不报。
444
444
  * 所以照 `MEMORY_SYNC_*` / `REQUIRED_ENVS_BY_LANE` 的同款姿势整拒并点名缺哪几键。
445
- * ③ **维度守卫为何是拒启不是 warn**:向量列写错维度是**静默毒库**形([3606] 裁③)——错长度的向量
445
+ * ③ **维度守卫为何是拒启不是 warn**:向量列写错维度是**静默毒库**形([ref] 裁③)——错长度的向量
446
446
  * 既不会让 DB 报错(本仓 pg 记忆表的 embedding 是 `jsonb`,无维度约束),也不会让检索报错(维度
447
447
  * 不匹配的行只是悄悄退回词面档),只会让「向量面开着」这句话变成谎。所以坏 DIM(非正整数)在
448
448
  * boot 期拒;运行期真维度不符(模型换了 / 端点指错)由 embedder 自己抛,绝不截断补零。
@@ -450,11 +450,11 @@ export interface ServiceConfigFlat {
450
450
  * ⚠️ 后端门:只有 `MEMORY_ENGINE_BACKEND=pg` 收这几键 —— tidb 记忆后端 v1 无向量档(传 embedder
451
451
  * 它自己就 fail-loud 拒),file 引擎压根没有 embedder 接缝。配错后端 = 拒启点名。 */
452
452
  memoryEmbedder?: MemoryEmbedderConfig;
453
- /** design/170 件A(clay 三裁 [2687]):org 记忆准入模式。`enforce`(默认)=判决即结果;`audit`=判决
453
+ /** [ref] 件A(clay 三裁 [ref]):org 记忆准入模式。`enforce`(默认)=判决即结果;`audit`=判决
454
454
  * 照算但纯观察零行为变化(不整拒、不窄化 writeScope,只记 would-deny/would-narrow)——运维诊断位,
455
455
  * 非发布步骤(audit-first 灰度步按裁2 免除)。env `MEMORY_ORG_ADMISSION_MODE`(enumEnv 二值)。 */
456
456
  memoryOrgAdmissionMode: "audit" | "enforce";
457
- /** #299(core 5.45.0 design/324,#324 裁定① 的部署半场):委派臂的**证据标准** —— 一次委派调用要不要把
457
+ /** [ref](core 5.45.0 [ref],[ref] 裁定① 的部署半场):委派臂的**证据标准** —— 一次委派调用要不要把
458
458
  * 本会话的记忆标记成 polluted,按哪一档证据判。env `MEMORY_DELEGATION_EVIDENCE`,两词闭集:
459
459
  * · `static-face` —— core 的缺省行为逐字:委派的 attestation 缺失/未知 **且** 静态工具面够得着外部
460
460
  * 内容 ⇒ 标记(能力过近似:可能性即暴露);
@@ -467,7 +467,7 @@ export interface ServiceConfigFlat {
467
467
  * 自身被分类为污染的照标。
468
468
  *
469
469
  * 🔴 **缺席 = 不铸键**(不复制上游缺省 —— 上游改缺省之日起本仓不会成为第二份真源;`readFace` 同姿态)。
470
- * 坏值 ⇒ 启动期响亮拒(#210);core 侧 `prepareConfigDoors` 另有一道同判的门
470
+ * 坏值 ⇒ 启动期响亮拒([ref]);core 侧 `prepareConfigDoors` 另有一道同判的门
471
471
  * (`config.memory_delegation_evidence`,精确拼写、绝不真值判),两道门同向不冲突。
472
472
  *
473
473
  * ⚠️ **部署席 ONLY**(与 `readDenyBuiltinTiers` 同判,core 侧的设计):TaskSpec 上没有同名键,也不在受治
@@ -478,19 +478,19 @@ export interface ServiceConfigFlat {
478
478
  * 异常收尾(crash/salvage)的前台子代同样不按静态面标记(链上仍记 `incomplete`)。已标记的会话永不
479
479
  * 回滚清洗,本键只管**新**标记。 */
480
480
  memoryDelegationEvidence?: "static-face" | "attested-only";
481
- /** #307 件4(core 5.46.0 design/336 §13-3 的部署半场,[4652]①/[4677]②):记忆 **provenance 总开关** ——
481
+ /** [ref] 件4(core 5.46.0 [ref] §13-3 的部署半场,[ref]①/[ref]②):记忆 **provenance 总开关** ——
482
482
  * 一个会话被判为「已暴露」之后,它的记忆写要怎么处置。env `MEMORY_PROVENANCE`,两词闭集:
483
483
  * · `carry` —— core 缺省行为逐字:**普通**记忆写照常提交,但带上引擎铸的 `origin` 标记(随条目走
484
484
  * 后端/同步/导出包);指令形文件(feedback / pinned / triggers / applies-when)仍被扣下隔离;
485
485
  * 派生索引的会话散文照回滚;内容扫描门原样跑(**标记不是豁免**);
486
- * · `off` —— design/336 之前的行为:不铸 origin 标记,已暴露会话的 harvest **一条都不收**(整体
486
+ * · `off` —— [ref] 之前的行为:不铸 origin 标记,已暴露会话的 harvest **一条都不收**(整体
487
487
  * 隔离候人审)。⚠️ 已提交的标记在编辑时照样带下去 —— `off` 停的是**铸**,从不抹掉已记的事实。
488
488
  *
489
489
  * 与 {@link memoryDelegationEvidence} **正交**(core 顶注明写,四种组合全合法):那一键决定
490
490
  * **什么时候**把会话判为已暴露(证据标准),本键决定判为暴露之后**对写做什么**(带标收录 vs 整体隔离)。
491
491
  *
492
492
  * 🔴 **缺席 = 不铸键**(不复制上游缺省;`readFace` / `memoryDelegationEvidence` 同姿态)。
493
- * 坏值 ⇒ 启动期响亮拒(#210 + 「部署级旋钮坏值禁静默回默认」);core 侧 `prepareConfigDoors` 另有
493
+ * 坏值 ⇒ 启动期响亮拒([ref] + 「部署级旋钮坏值禁静默回默认」);core 侧 `prepareConfigDoors` 另有
494
494
  * 一道同判的门(`config.memory_provenance`,精确拼写、绝不真值判),两道门同向不冲突。
495
495
  *
496
496
  * ⚠️ **部署席 ONLY**(与 `memoryDelegationEvidence` 同判,core 侧的设计):TaskSpec 上没有同名键,
@@ -498,7 +498,7 @@ export interface ServiceConfigFlat {
498
498
  * ⚠️ **不冻进 checkpoint**:resume 的那条腿跟**当前**部署配置走(core 成文)。
499
499
  * 运维读面 = `GET /v1/diagnostics/wiring` 的 `memoryPosture.provenance`(`null`=本部署未设)。 */
500
500
  memoryProvenance?: "off" | "carry";
501
- /** design/383 §3.1(core 7.0.0 片3,S-49 S-1b):本部署的记忆 **capture 姿态** —— per-principal
501
+ /** [ref] §3.1(core 7.0.0 片3,[ref] S-1b):本部署的记忆 **capture 姿态** —— per-principal
502
502
  * `RuntimeCaps.allowMemoryOptOut` verdict 被读进的那个框。env `MEMORY_CAPTURE_POLICY`,三词闭集:
503
503
  * · `open`(≡ 缺席时 core 的缺省)—— `TaskSpec.memory.capture:"off"` 声明按面值生效;只有 resolver 的
504
504
  * **显式** `false` 拒它(`memory.capture_optout_denied`,terminal)。resolver **故障**(throw / 非
@@ -521,7 +521,7 @@ export interface ServiceConfigFlat {
521
521
  * 运维读面 = `GET /v1/diagnostics/wiring` 的 `memoryPosture.capturePolicy`(`null`=本部署未设)。 */
522
522
  memoryCapturePolicy?: "open" | "governed" | "capture-required";
523
523
  /**
524
- * design/378(core 5.58 design/376 片②)—— 记忆 **consolidation driver 阀门**的三根旋钮。
524
+ * [ref](core 5.58 [ref] 片②)—— 记忆 **consolidation driver 阀门**的三根旋钮。
525
525
  * **恒在场**(不是可选块,与 {@link retentionSweep} 同姿态):三根都有文档化的缺省,而缺省本身
526
526
  * 是一条要能被读出来的姿态 —— `{enabled:false, intervalSec:0, scopes:[]}` = 「阀门关着」。
527
527
  *
@@ -533,7 +533,7 @@ export interface ServiceConfigFlat {
533
533
  * 语义与解析见 {@link MemoryConsolidationDriverConfig} 与 config.ts 的 `parseMemoryDomain`。
534
534
  */
535
535
  memoryConsolidationDriver: MemoryConsolidationDriverConfig;
536
- /** debt #322-B(core 5.48 C18 提货件):委派入口 caps 的部署旋钮 —— env `DELEGATION_MAX_CONCURRENT` /
536
+ /** debt [ref]-B(core 5.48 C18 提货件):委派入口 caps 的部署旋钮 —— env `DELEGATION_MAX_CONCURRENT` /
537
537
  * `DELEGATION_MAX_PER_SESSION`(整数,numEnvBounded 响亮拒坏值)。**缺席 = 不铸键**(core 自缺省
538
538
  * CC parity 20/200;`memoryDelegationEvidence` 同姿态);两键各自独立可设,pair 合法性
539
539
  * (maxConcurrent ≤ maxCumulativePerSession)由 core prepare 的 `config.delegation_entry_caps`
@@ -553,12 +553,12 @@ export interface ServiceConfigFlat {
553
553
  /** 件A 目录 unavailable 退避窗(ms)——取数失败的退避语义(bound center hammering),不是策略负结果。
554
554
  * 默认 10s。env `MEMORY_ORG_UNAVAILABLE_BACKOFF_MS`(numEnvBounded)。 */
555
555
  memoryOrgUnavailableBackoffMs: number;
556
- /** design/48 v1b + design/61: opt-in remote execution backend (PEER adapters, chosen by REMOTE_EXEC). Unset
556
+ /** [ref] v1b + [ref]: opt-in remote execution backend (PEER adapters, chosen by REMOTE_EXEC). Unset
557
557
  * (OA/review deployments) → in-process stub env, zero behavior change. Secrets (apiKey/privateKey) ONLY from env.
558
558
  * - `e2b` → per-task E2B Firecracker VM (isolated, suspendable). The default code-agent worker.
559
559
  * - `k8s` → per-task Kata pod on our k3s (isolated, NOT suspendable — no managed memory
560
560
  * snapshot). Self-hosted sandbox lane; auth = explicit K8S_* env or in-cluster service account.
561
- * - `ssh` → a real host over SSH (NOT isolated/suspendable; design/61 §5). AI-orchestrated batch deploy.
561
+ * - `ssh` → a real host over SSH (NOT isolated/suspendable; [ref] §5). AI-orchestrated batch deploy.
562
562
  * - `adb` → a real device over ADB (NOT isolated/suspendable). On-device APP testing. */
563
563
  remoteExec?: {
564
564
  provider: "e2b";
@@ -569,7 +569,7 @@ export interface ServiceConfigFlat {
569
569
  allowInternetAccess?: boolean;
570
570
  sandboxEnv?: Record<string, string>;
571
571
  mountPath?: string;
572
- /** #242:崩溃遗留沙盒回收腿(E2B_ORPHAN_RECLAIM,默认 true;判据与 v1 边界见
572
+ /** [ref]:崩溃遗留沙盒回收腿(E2B_ORPHAN_RECLAIM,默认 true;判据与 v1 边界见
573
573
  * plugins/e2b-orphan-reclaim.ts 头注)。 */
574
574
  orphanReclaim?: boolean;
575
575
  } | {
@@ -625,6 +625,11 @@ export interface ServiceConfigFlat {
625
625
  execTimeoutMs?: number;
626
626
  /** `DEVICE_MAX_INFLIGHT_PER_DEVICE`(§11-O3 clay 已裁 = 4)。 */
627
627
  maxInflightPerDevice?: number;
628
+ /** `DEVICE_MAX_PREAUTH_PER_REMOTE`(默认 8;字面 `off` = 显式停用 per-remote 层)= 未鉴权
629
+ * 握手的 per-remote 并发帽([ref]/[ref]:帽键是裸 remoteAddress——XFF 反代 / 公司 NAT 部署
630
+ * 形会把全员折叠成单键,per-remote 层退化成共享预算而非公平层,`off` + 全局帽 64 是诚实形)。
631
+ * 坏值拒启([ref] A 档),词表与拒因见 config.ts `parseDevicePreAuthPerRemoteEnv`。 */
632
+ maxPreAuthPerRemote?: number | "off";
628
633
  /** `DEVICE_SUPERSEDE`(默认 `stale_only`)= 同 deviceId 二连的顶替策略(§5.2)。 */
629
634
  supersede?: "stale_only" | "deny";
630
635
  } | {
@@ -642,7 +647,7 @@ export interface ServiceConfigFlat {
642
647
  env?: Record<string, string>;
643
648
  };
644
649
  /**
645
- * SVC-3 git-WORKTREE ISOLATION (design/97 CORE-6). Opt-in (WORKTREE_ISOLATION_ENABLED + WORKTREE_REPO_ROOT).
650
+ * SVC-3 git-WORKTREE ISOLATION ([ref] CORE-6). Opt-in (WORKTREE_ISOLATION_ENABLED + WORKTREE_REPO_ROOT).
646
651
  * When set, the deployment's `executionEnvFactory` is wrapped so an agent core marks `isolation:"worktree"`
647
652
  * (via the TRUSTED RunInternals — never a TaskSpec) runs in its OWN detached git worktree under `repoRoot`.
648
653
  * Operator-supplied ONLY (never a task input). v1 covers the `host` lane (the TOC fan-out lane); other lanes
@@ -683,11 +688,11 @@ export interface ServiceConfigFlat {
683
688
  };
684
689
  /** Which SQL engine the durable stores run on (clay 2026-06-21 PG migration). Canonical value is `mysql`
685
690
  * = any MySQL-protocol server — MySQL, TiDB, MariaDB — over the same mysql2 pool; `pg` (PostgreSQL
686
- * dialect) reads `pg` below. [2354]/[2373]B-3(5.0.0):the env value `tidb` and the TIDB_* coord names
691
+ * dialect) reads `pg` below. [ref]/[ref]B-3(5.0.0):the env value `tidb` and the TIDB_* coord names
687
692
  * are RETIRED — `tidb` is rejected by the enum and any TIDB_* env in place refuses to start with the
688
693
  * MYSQL_* replacement named (see RETIRED_ENVS in config.ts). `mysql` reads MYSQL_* coords only.
689
694
  * TiDB itself stays fully supported (any MySQL-protocol engine works — memory no longer needs a VECTOR
690
- * column since design/138 moved it onto the file engine). Env: DB_BACKEND. */
695
+ * column since [ref] moved it onto the file engine). Env: DB_BACKEND. */
691
696
  dbBackend: "mysql" | "pg" | "local" | "memory";
692
697
  /** clay 拍(2026-07-27):operator 是否显式设了 DB_BACKEND。main.ts 的降级判据——**默认推导**的
693
698
  * local(裸 boot)在 mkdir/ensure 失败时降级 memory + warn + gauge(auto-DB 不可达先例);
@@ -701,14 +706,14 @@ export interface ServiceConfigFlat {
701
706
  * `local` backend reads it. */
702
707
  localDataRoot?: string;
703
708
  /**
704
- * S-46 件B(`RUN_STORE_STRICT_HYDRATE`,普查表第 29 行的**终局格**)—— file 后端的**可选** fail-closed
709
+ * [ref] 件B(`RUN_STORE_STRICT_HYDRATE`,普查表第 29 行的**终局格**)—— file 后端的**可选** fail-closed
705
710
  * 启动门。`true` ⇒ `FileRunStore.hydrate()` 列不出 `runs/` 时**拒启**(error 级遗言带绝对路径 + 异常
706
711
  * 文案,然后抛);缺省 **false** ⇒ 件6 的既有形逐字不变(带病起动 + 一行 error + P-DEBT 计数)。
707
712
  *
708
713
  * 为什么默认是 off:件6 当年把「不拒启」写成了刻意保留的行为,默认翻面等于替所有存量部署做主。
709
714
  * 为什么值得有这根旋钮:空账起动之后每一次 `getRun` 恒 miss,而「恒 miss」与「本来就没有这条 run」
710
715
  * 在 wire 上同形(#43 现场就是这么被误读的)—— 把 run 账本当真账本用的部署有权要求「读不出就别起」。
711
- * 坏值**拒启**(#210 A 档):静默回默认会让 operator 要的 fail-closed 被无声吃掉。
716
+ * 坏值**拒启**([ref] A 档):静默回默认会让 operator 要的 fail-closed 被无声吃掉。
712
717
  *
713
718
  * 只有 `local`(file)后端读它;SQL 后端的 hydrate 不经这条路。
714
719
  */
@@ -754,7 +759,7 @@ export interface ServiceConfigFlat {
754
759
  * 实证,大字节归对象存储);`SNAPSHOT_BLOB_ALLOW_SQL_BYTES=true` 显式接受 SQL 店 + (a) 的帽
755
760
  * (单机/测试台形)。严格 "true" 判——这是安全姿势开关,不收宽松真值。 */
756
761
  snapshotBlobAllowSql: boolean;
757
- /** S-15 twin 保留条款(core design/381 §片2):per-file rewind 历史的**边界上限**,键形与 core
762
+ /** [ref] twin 保留条款(core [ref] §片2):per-file rewind 历史的**边界上限**,键形与 core
758
763
  * `FileStorageBackendOptions.fileHistory.retention.keep` **同域同名**(local 腿原样透传给 core 的 File 店;
759
764
  * SQL 双生店构造期同调 core `resolveFileHistoryRetention` —— 一套语义,三条车道)。缺席 = core 缺省
760
765
  * (100,由 core 兑现,本仓不复制那个数);`{ keep: "unbounded" }` 是唯一的「不剪」拼法。坏值在
@@ -763,14 +768,14 @@ export interface ServiceConfigFlat {
763
768
  fileHistory?: {
764
769
  retention?: FileHistoryRetentionPolicy;
765
770
  };
766
- /** plugins 域 clone host 白名单(`PLUGINS_ALLOW_HOSTS`,缺省 github.com;契约 [1361]① 双保险面,
771
+ /** plugins 域 clone host 白名单(`PLUGINS_ALLOW_HOSTS`,缺省 github.com;契约 [ref]① 双保险面,
767
772
  * 消费在 capabilities/center-plugins.ts)。 */
768
773
  pluginsAllowHosts: string[];
769
- /** 监听绑址([1934] cli 实锤:此前 `HOST` **零消费**、`listen(port)` 恒绑所有接口)。
774
+ /** 监听绑址([ref] cli 实锤:此前 `HOST` **零消费**、`listen(port)` 恒绑所有接口)。
770
775
  * `BIND_HOST`(兼容 `HOST`)。显式值恒生效;缺省见 {@link resolveBindHost}——**无鉴权写面
771
776
  * (allowUnauthedWrites 且零凭证)自动收窄到 127.0.0.1**,其余维持全接口(既有部署零影响)。 */
772
777
  bindHost?: string;
773
- /** [2062]③ `bindHost` 的取值来源(BIND_HOST 显式 / HOST 兼容名 / 未设)。`"HOST"` 时 main.ts 打一行
778
+ /** [ref]③ `bindHost` 的取值来源(BIND_HOST 显式 / HOST 兼容名 / 未设)。`"HOST"` 时 main.ts 打一行
774
779
  * 启动告警:zsh 常把 HOST 设成机器名,`{...process.env}` 起底的壳会静默继承给引擎——bind 面被 shell
775
780
  * 环境暗配而部署者不知情(HOST=机器名解析到 LAN 口时=静默扩暴露面)。 */
776
781
  bindHostSource?: "BIND_HOST" | "HOST";
@@ -778,11 +783,11 @@ export interface ServiceConfigFlat {
778
783
  * 复审 F10:同 tick 邻居(workflowOrphanGraceMs/attachmentUnboundTtlMs/scratchpadSweepTtlMs)都有
779
784
  * 旋钮——存量对象巨大的部署要调慢/停掉,不该被迫取消 MinIO 配置(那会连带关掉整个附件面)。 */
780
785
  attachmentOrphanGraceMs: number;
781
- /** ⚠️ INERT since S-15(workspace 浏览面随整树快照纪元退役,消费点归零)。键**保留**:center 热推
786
+ /** ⚠️ INERT since [ref](workspace 浏览面随整树快照纪元退役,消费点归零)。键**保留**:center 热推
782
787
  * 可能仍携带它,删键会让整份推送按未知键处置——正式摘除走 settings-schema 的弃用车道。 */
783
788
  workspaceFileMaxBytes: number;
784
789
  /** SendUserFile dual-track public-link issuance (design settled cross-repo 2026-07-14; S3_PUBLIC_* are
785
- * [766]② cross-repo contract names — never rename). Enabled iff the adapter-held MinIO/S3 creds are set:
790
+ * [ref]② cross-repo contract names — never rename). Enabled iff the adapter-held MinIO/S3 creds are set:
786
791
  * `endpoint` = MINIO_ENDPOINT (the shared snapshot-lane name, wins when both are set) with S3_ENDPOINT
787
792
  * as the external-S3 compat alias (one address serving both internal + public faces), plus
788
793
  * MINIO_ACCESS_KEY + MINIO_SECRET_KEY (optional MINIO_REGION) — any of the three unset/empty ⇒ the whole
@@ -864,19 +869,19 @@ export interface ServiceConfigFlat {
864
869
  * sema-registry `EffectiveConfig.runtime` (structured config, not an env scalar). undefined = unmanaged. */
865
870
  commandPolicy?: CommandRule[];
866
871
  /**
867
- * design/170 件B —— 本部署的**合规档位**(core `RunnerDeps.compliancePostureResolver` 的供数)。
872
+ * [ref] 件B —— 本部署的**合规档位**(core `RunnerDeps.compliancePostureResolver` 的供数)。
868
873
  * env `COMPLIANCE_PROFILE`(闭集 `hipaa|zdr`)+ `COMPLIANCE_ADDITIONAL_DENIES`(闭集能力名 csv,
869
874
  * **只能收紧** profile 的内建 floor)。两个词表都是 core 的闭集,拼错一律 boot 拒 —— 一个拼错的
870
- * 能力名等于「标着 hipaa 的部署根本没在执行那一条」(design/170 §3.2)。
875
+ * 能力名等于「标着 hipaa 的部署根本没在执行那一条」([ref] §3.2)。
871
876
  *
872
877
  * 🔴 **档位是部署级、不是 per-principal**:core 的座席按 principal 取值,但本仓能拿到的**唯一真源**
873
- * 是部署配置面(design/170 §1 表:center 侧的档位真源标着「新建」= 尚不存在)。所以 resolver 对每个
878
+ * 是部署配置面([ref] §1 表:center 侧的档位真源标着「新建」= 尚不存在)。所以 resolver 对每个
874
879
  * principal 返回同一份档位 —— 诚实的窄实现,而不是一条永远查不到值的 center 假腿。
875
880
  * 缺席 = 无合规限制(core 契约),现存部署逐字零影响。
876
881
  */
877
882
  compliancePosture?: CompliancePosture;
878
883
  /**
879
- * design/170 件C —— **管理员锁定层**的部署声明(core `RunnerDeps.lockedConfig.keys`)。
884
+ * [ref] 件C —— **管理员锁定层**的部署声明(core `RunnerDeps.lockedConfig.keys`)。
880
885
  * env `LOCKED_CONFIG_KEYS`(csv;词表 = core 的 `LOCKED_KEY_REGISTRY` 闭集,未知键 boot 拒 =
881
886
  * `config.locked_registry`「不解析的安全控件不得半开」)。
882
887
  *
@@ -886,17 +891,17 @@ export interface ServiceConfigFlat {
886
891
  */
887
892
  lockedConfigKeys?: readonly LockedKey[];
888
893
  /**
889
- * design/170 件D —— **托管留存期**声明(core `RunnerDeps.retentionPolicy`)。env `RETENTION_MAX_AGE_DAYS`
894
+ * [ref] 件D —— **托管留存期**声明(core `RunnerDeps.retentionPolicy`)。env `RETENTION_MAX_AGE_DAYS`
890
895
  * (有限非负数;坏值 boot 拒 —— 删数据的旋钮不许 NaN 流通)。
891
896
  *
892
897
  * 🔴 语义边界(成文,别当成"数据会被删"):core **只**拿它做启动期能力校验(锁着 + 店未声明
893
898
  * `retention:"managed"` ⇒ 拒启),引擎自己在任务路径上从不删数据;真执行(调度/重试/副本协调/审计)
894
- * 是部署侧的活,本仓**尚未**建(design/170 §5.2「server 半场四件皆新建」)。所以配了策略而没有任何
899
+ * 是部署侧的活,本仓**尚未**建([ref] §5.2「server 半场四件皆新建」)。所以配了策略而没有任何
895
900
  * managed 店时,启动会打一条 `retention_policy_not_executed` 的响亮 warn。
896
901
  */
897
902
  retentionPolicy?: RetentionPolicy;
898
903
  /**
899
- * #270 车2 —— 托管留存 **sweep lane** 的两个旋钮(设计稿 `DESIGN-270-retention-lane.md` §3/§4)。
904
+ * [ref] 车2 —— 托管留存 **sweep lane** 的两个旋钮(设计稿 `DESIGN-270-retention-lane.md` §3/§4)。
900
905
  * `retentionPolicy` 说的是「保留多久」(一句声明),本格说的是「谁在什么节律上按那句话删」。
901
906
  * **恒在场**(不是可选块):两根都有文档化的缺省,而缺省本身是一条要能被读出来的姿态 ——
902
907
  * `{mode:"audit-only", intervalSec:0}` = 「lane 关着,真开起来也先只记账」。
@@ -909,14 +914,22 @@ export interface ServiceConfigFlat {
909
914
  * CANNOT decide (a requester approving its own high-risk op would defeat the gate). **Empty/unset =
910
915
  * legacy behavior** (the shared service token IS the operator boundary — back-compat). */
911
916
  operatorPrincipals: string[];
917
+ /**
918
+ * DESIGN-278 §5 S2([ref])—— `GET /v1/config/catalog`(配置目录自描述端点)的显式旋钮。
919
+ * 默认 **ON**(设计稿 §0.5:合规部署可关)。端点本身已是 operator-only(`explicitOperatorOk`,
920
+ * 空名单=谁都不是),本键给的是「即便 operator 也不许从 wire 读部署事实」的合规姿态:关 ⇒ 路径
921
+ * 不存在(404 族,与 memory-consolidation 阀门同判:旋钮没开 ≠ 能力缺失)、能力位 `configCatalog`
922
+ * 同步翻假。`CONFIG_CATALOG_ENABLED=false`。
923
+ */
924
+ configCatalogEnabled: boolean;
912
925
  /** Tool names that are always denied. */
913
926
  approvalDeny: string[];
914
- /** design/45 durable-checkpoint (core 1.67): when true (+ a TiDB pool), F4 uses durable **suspend/resume**
927
+ /** [ref] durable-checkpoint (core 1.67): when true (+ a TiDB pool), F4 uses durable **suspend/resume**
915
928
  * instead of poll-blocking — a gated tool `ask` suspends the task (status:"suspended" + checkpoint), an
916
- * operator resumes it on any replica. Default OFF([2354] A-5:轮询车道已退役,OFF+门意图 ⇒ core UNGATED
929
+ * operator resumes it on any replica. Default OFF([ref] A-5:轮询车道已退役,OFF+门意图 ⇒ core UNGATED
917
930
  * 告警,不再有回退门形). `DURABLE_APPROVAL=true`. */
918
931
  durableApproval: boolean;
919
- /** design/80 seam #2 (preemption) / design/74 ("失败≠没做完" third state): when true (+ durable mode), the
932
+ /** [ref] seam #2 (preemption) / [ref] ("失败≠没做完" third state): when true (+ durable mode), the
920
933
  * /v1/runs durable path opts every task into core `resourceSuspend` — a budget/turns/walltime limit OR a
921
934
  * scheduler preempt (`POST /v1/assistant/tasks/:id/preempt`) durably SUSPENDS the task (resumable via
922
935
  * `POST /v1/assistant/tasks/:id/resume`) instead of FAILING. 🔴 PRECONDITION for `preemptSignal` to fire at
@@ -929,25 +942,25 @@ export interface ServiceConfigFlat {
929
942
  * resume happens long before this; the deadline only reaps abandonment. `RESOURCE_SUSPEND_TTL_SEC`. */
930
943
  resourceSuspendTtlSec: number;
931
944
  /**
932
- * [3833] 件 S-3 —— **跨片总额**:一条任务在整条 park→resume→再 park 链上允许烧掉的 token 总量。
945
+ * [ref] 件 S-3 —— **跨片总额**:一条任务在整条 park→resume→再 park 链上允许烧掉的 token 总量。
933
946
  * `RESOURCE_SUSPEND_TOTAL_TOKENS`,**0 / 缺省 = 不设**(维持现状)。
934
947
  *
935
948
  * 🔴 为什么这是一根独立的旋钮、而不是 `MAX_TASK_TOKENS` 的同义词:`limits.maxTokens` 是 core 的
936
949
  * **per-SLICE 窗**(core `types.d.ts` 逐字:"PER-SLICE windows, not whole-task totals"),而一次 resume
937
950
  * 会**重开满窗**。跨片总额是唯一能跨越 park 边界约束总量的轴 —— core 把它冻在 checkpoint 的
938
951
  * resource ledger 上,`remainingTokens(ledger)` 在 total 缺席时回 `undefined` = **无天花板**。
939
- * [3833](plan_review approve 后一条 resume 腿烧 75 万 token 无产出)的三个叠加因子之一就是本值缺席。
952
+ * [ref](plan_review approve 后一条 resume 腿烧 75 万 token 无产出)的三个叠加因子之一就是本值缺席。
940
953
  *
941
954
  * 🔒 **冻结语义**:core 把它冻在 checkpoint 的 resource ledger 上("Set ONLY on the FIRST slice";
942
955
  * `debitLedger` 逐字 `prior ?? total`)⇒ 续跑腿重供**无效**,「一次 resume 刷新不了自己的额度」这条
943
956
  * 安全语义由 core 保证。本仓每片都供值是无害的(首片生效,其后被 prior 挡掉)。
944
957
  */
945
958
  resourceSuspendTotalTokens: number;
946
- /** [3833] 件 S-3 —— 跨片总额的 **$ 轴**(`totalTokens` 的姊妹,语义与冻结形同上)。
959
+ /** [ref] 件 S-3 —— 跨片总额的 **$ 轴**(`totalTokens` 的姊妹,语义与冻结形同上)。
947
960
  * `RESOURCE_SUSPEND_TOTAL_BUDGET_USD`,0 / 缺省 = 不设。可为小数(美元)。 */
948
961
  resourceSuspendTotalBudgetUsd: number;
949
962
  /**
950
- * [3833] 件 S-3 —— 跨片 **片数**上限:整条 resume 链最多几片,超出 core 以 `"suspend.loop"` 收场。
963
+ * [ref] 件 S-3 —— 跨片 **片数**上限:整条 resume 链最多几片,超出 core 以 `"suspend.loop"` 收场。
951
964
  * `RESOURCE_SUSPEND_MAX_SLICES`,0 / 缺省 = 不设。
952
965
  *
953
966
  * 它是**零进展 slice 循环**的兜底(两条总额才是主约束),与重启环的 `maxSuspends` 是两个独立计数。
@@ -960,28 +973,28 @@ export interface ServiceConfigFlat {
960
973
  * 级旋钮本就该跟着当期部署走,但别把它误读成「冻在链上」。钉:test/resource-suspend.test.ts 的上游契约格。
961
974
  */
962
975
  resourceSuspendMaxSlices: number;
963
- /** design/80 D-E (upgrade-budget): max NORMAL gated tool calls AUTO-APPROVED per run-leg before the rest
976
+ /** [ref] D-E (upgrade-budget): max NORMAL gated tool calls AUTO-APPROVED per run-leg before the rest
964
977
  * escalate to a human — a circuit-breaker against a runaway/inflated approval loop (an AI stuck re-asking),
965
978
  * NOT a cap on safety asks. 0 = OFF (every gated tool asks a human — unchanged, back-compat default). Clamped
966
979
  * to ≤10000 (the hard ceiling). A Supervisor deployment sets this high to get "the AI auto-approves routine
967
980
  * asks, the human only sees the rest". `APPROVAL_AUTO_BUDGET`. */
968
981
  approvalAutoBudget: number;
969
- /** design/80 D-E (inv#2 — safety asks are never budgetable): gated tools that ALWAYS require a human even when
982
+ /** [ref] D-E (inv#2 — safety asks are never budgetable): gated tools that ALWAYS require a human even when
970
983
  * the auto-budget is on — the "irreversible / never auto-approve" set. empty = the budget may auto-approve any
971
984
  * required tool THIS layer sees. `APPROVAL_NEVER_AUTO`.
972
985
  *
973
- * 🔴 **NOT the only human-gate under an auto-budget**(2026-08-10 修口,#205 件2)。这里原来写的是
986
+ * 🔴 **NOT the only human-gate under an auto-budget**(2026-08-10 修口,[ref] 件2)。这里原来写的是
974
987
  * "(In-service every gated ask is gate.kind=\"human\", so this set is the ONLY way to keep an irreversible
975
988
  * tool human-gated under an auto-budget.)" —— 两句都已过期,且过期方向是**高估本旋钮的责任**:
976
- * · design/80 D-2 起,带 egress / irreversibility 静态标记的工具铸的是 `irreversible_ask`,不是 `human`;
977
- * · core 5.24.0(#130/#131/#120)起,带 `requiresRealApproval` 的 ask 一律铸
989
+ * · [ref] D-2 起,带 egress / irreversibility 静态标记的工具铸的是 `irreversible_ask`,不是 `human`;
990
+ * · core 5.24.0([ref]/[ref]/[ref])起,带 `requiresRealApproval` 的 ask 一律铸
978
991
  * `irreversible_ask` + `gate.realApproval:{origin}` + checkpoint v8 —— **不再铸可预算的 `human`**。
979
992
  * 而 `requiresRealApproval` 的生产者(`createTranscriptIntegrityPolicy` / `createUnverifiableDeletePolicy`)
980
993
  * 被 core 在 `prepare-task.js` 里**无条件**焊进每一条策略链,所以这条路径在**每一个**部署上都活着,
981
994
  * 不是 org 治理部署的专属面。
982
995
  * ⇒ 本旋钮承担的是**本层**(`createDurableAskPolicy` 的 per-leg 计数预算)的 inv#2;安全类 ask 另有
983
996
  * core 侧那两层守卫兜底,两层各自独立、不互为前提。消费侧钉:`test/durable-approval-policy.test.ts`
984
- * 的「#205 件2」describe(含反向锚:普通调用仍走预算自动批)。
997
+ * 的「[ref] 件2」describe(含反向锚:普通调用仍走预算自动批)。
985
998
  *
986
999
  * 🔴 **NOT required to be a subset of `approvalRequire`**(2026-07-31 修口)。这里原来写的是
987
1000
  * "Subset of approvalRequire",而 `approval.ts` 的 inv#2 执行面逐字相反:
@@ -991,7 +1004,7 @@ export interface ServiceConfigFlat {
991
1004
  * 「只配 APPROVAL_NEVER_AUTO」这一形被判成"零门意图" ⇒ 落进单用户 allow-all 基线 ⇒ 那张表
992
1005
  * 从未进入任何 policy。判定现在单源在 `hasOperatorGateIntent()`(与 inv#2 同文件)。 */
993
1006
  approvalNeverAuto: string[];
994
- /** design/80 D-G (HMAC = integrity, not identity; ✅ WIRED — the "SCAFFOLD, not yet wired" note here was STALE,
1007
+ /** [ref] D-G (HMAC = integrity, not identity; ✅ WIRED — the "SCAFFOLD, not yet wired" note here was STALE,
995
1008
  * corrected 2026-07-25: consumed by `verifyDirectDoorProof` → `verifyApprovalHmac`, reached from the live decide
996
1009
  * routes — the two `verifyDirectDoorProof(` call sites in `http/routes/approvals-assistant.ts`): the
997
1010
  * sema-registry-managed, ROTATING key-set used to verify an
@@ -1000,12 +1013,12 @@ export interface ServiceConfigFlat {
1000
1013
  * accurate description of every stock deployment. sema-registry mints + rotates the set; the shape is
1001
1014
  * provisional (ASK-CENTER-2026-06-17). */
1002
1015
  approvalHmacKeys: ApprovalHmacKey[];
1003
- /** design/80 D-G: open the DIRECT-connect /decide door (a CLI/desktop client without the BFF). When true, this
1016
+ /** [ref] D-G: open the DIRECT-connect /decide door (a CLI/desktop client without the BFF). When true, this
1004
1017
  * worker is in DIRECT MODE — it REQUIRES the crypto direct-door proof (signed principal JWT + HMAC envelope) and
1005
1018
  * treats the trusted `x-agent-principal` header as UNTRUSTED (the BFF runs on a separate non-direct worker). Off
1006
1019
  * (default) ⇒ the BFF trusted-header door is byte-identical. `DIRECT_APPROVAL_DOOR=true`. */
1007
1020
  directApprovalDoor: boolean;
1008
- /** design/80 D-G: the issuer's PUBLIC JWKS (non-secret, config-projected like operatorPrincipals) the worker
1021
+ /** [ref] D-G: the issuer's PUBLIC JWKS (non-secret, config-projected like operatorPrincipals) the worker
1009
1022
  * verifies a direct client's principal JWT against. Empty ⇒ no trust anchor ⇒ the direct door cannot open.
1010
1023
  * `PRINCIPAL_JWT_PUBKEYS` (JSON [{kid,alg,key(PEM),status}]). */
1011
1024
  principalJwtPubkeys: PrincipalJwtKey[];
@@ -1017,16 +1030,16 @@ export interface ServiceConfigFlat {
1017
1030
  principalJwtMaxTtlSec: number;
1018
1031
  /** Computed: the direct door is truly active (all anchors present). Off ⇒ direct branch never runs. */
1019
1032
  directDoorActive: boolean;
1020
- /** design/80 b (item 3): the INFRA cost rates the service owns (the engine prices only LLM tokens), composed
1033
+ /** [ref] b (item 3): the INFRA cost rates the service owns (the engine prices only LLM tokens), composed
1021
1034
  * with core's costBreakdown for the supervisor cost surface. All default 0 (= not priced, like MODEL_COST_*).
1022
1035
  * `INFRA_COST_TOOL_CALL` / `INFRA_COST_SANDBOX_SEC` / `INFRA_COST_EGRESS_GB` (micro-USD). */
1023
1036
  infraCostRates: InfraCostRates;
1024
- /** v2 leader endpoint (design/50): enable POST/GET /v1/leader. Requires an ISOLATED remote-exec backend —
1037
+ /** v2 leader endpoint ([ref]): enable POST/GET /v1/leader. Requires an ISOLATED remote-exec backend —
1025
1038
  * REMOTE_EXEC=e2b, OR REMOTE_EXEC=k8s (Kata pod-sandbox) WITH an S3/MinIO config for the workspace-durable
1026
1039
  * snapshot/merge (main.ts:524) — + (deploy) git on the host + a durable remote with creds. Orthogonal to the
1027
1040
  * D-G direct door (auth axis) — a worker can be direct-mode + kata + leader at once. Default OFF. `LEADER_ENABLED=true`. */
1028
1041
  leaderEnabled: boolean;
1029
- /** design/68 A6 (correctness-first knob): `LEADER_FANOUT_ENABLED=false` pins the leader router to the
1042
+ /** [ref] A6 (correctness-first knob): `LEADER_FANOUT_ENABLED=false` pins the leader router to the
1030
1043
  * deterministic single route (never fans out, zero router cost). Default true (router decides). */
1031
1044
  leaderFanoutEnabled: boolean;
1032
1045
  /** A value router (S1 verdict §6.3 cash-out, src/router/route-orchestration.ts): auto-decide per-task
@@ -1035,7 +1048,7 @@ export interface ServiceConfigFlat {
1035
1048
  * mechanism dark; enable after a live validation (the router only ever TIGHTENS via tightenTaskSpec + honors
1036
1049
  * caller-explicit modes, so enabling can't loosen any gate). */
1037
1050
  routerEnabled: boolean;
1038
- /** S8 LLM self-orchestration (design/98): mount core's `run_workflow` tool so a strong model can author a
1051
+ /** S8 LLM self-orchestration ([ref]): mount core's `run_workflow` tool so a strong model can author a
1039
1052
  * deterministic JS orchestration script, run under the HARDENED-vm sandbox (src/orchestration/hardened-vm-runner.ts).
1040
1053
  * DEFAULT OFF (`SELF_ORCHESTRATION_ENABLED=true`). When off, core is FAIL-CLOSED (tool not mounted, prompt not
1041
1054
  * injected) — zero impact. When on: the hard runner + a CONSERVATIVE governance baseline (workflow children are
@@ -1054,7 +1067,7 @@ export interface ServiceConfigFlat {
1054
1067
  * (置了也只 boot warn 一次,行为零变——半配置 fail-loud)。⚠️ 非 postureOn:observer 是实验面,
1055
1068
  * core ships dark,单用户 turnkey 也不默认开 —— 只认显式 "true"。合成序见 applyObserverEnvOptIn。 */
1056
1069
  experimentalObserverAgents: boolean;
1057
- /** S8 governance baseline: the model NAMES an LLM-authored workflow script may pick (design/98 §2.5). Empty ⇒
1070
+ /** S8 governance baseline: the model NAMES an LLM-authored workflow script may pick ([ref] §2.5). Empty ⇒
1058
1071
  * FAIL-CLOSED (the script cannot pick a model → spawned children use the workflow's default role). NEVER the
1059
1072
  * whole catalog. `SELF_ORCHESTRATION_MODELS=a,b`. */
1060
1073
  selfOrchestrationModels: string[];
@@ -1069,7 +1082,7 @@ export interface ServiceConfigFlat {
1069
1082
  * pinning). Either durable form means a background run's record SURVIVES a restart, which is what lets the
1070
1083
  * at-least-once completion notify re-derive a run's terminal state after a crash. `memory` = the ephemeral
1071
1084
  * `InMemoryWorkflowRunStore` (process-local; no crash recovery, no notify journal) — an explicit opt-out for
1072
- * a single-instance/ephemeral deployment. (A-002.18: the old docblock claimed `file` was the default and
1085
+ * a single-instance/ephemeral deployment. ([ref]: the old docblock claimed `file` was the default and
1073
1086
  * omitted `auto` entirely — a reader picking a backend off this comment would never learn the SQL twin
1074
1087
  * exists.) `WORKFLOW_RUN_STORE=auto|file|memory`. Only consulted when SELF_ORCHESTRATION_ENABLED. */
1075
1088
  workflowRunStoreBackend: "auto" | "file" | "memory";
@@ -1084,9 +1097,9 @@ export interface ServiceConfigFlat {
1084
1097
  * the TOC shell `SchedulerDaemon` reads the SAME store to fire due intents. DEFAULT OFF (the model self-scheduling
1085
1098
  * is a power; multi-tenant deployments route scheduling to center, not this host daemon). `SCHEDULER_ENABLED=true`. */
1086
1099
  schedulerEnabled: boolean;
1087
- /** design/113 C4: host-lane project-memory injection (CLAUDE.md + git narrative). Default **ON** (subject to the
1100
+ /** [ref] C4: host-lane project-memory injection (CLAUDE.md + git narrative). Default **ON** (subject to the
1088
1101
  * host-lane + single-user gate), so "open like CC" works without config. `PROJECT_MEMORY_ENABLED=false` opts out.
1089
- * design/158 B4 (lens4 N8): this was `projectMemoryDisabled` — the ONE negative boolean on a ServiceConfig whose
1102
+ * [ref] B4 (lens4 N8): this was `projectMemoryDisabled` — the ONE negative boolean on a ServiceConfig whose
1090
1103
  * other 16 flags are positive `*Enabled`/`*Allowed`, so every read site had to invert twice. 🪦 server 3.0.0:
1091
1104
  * the retired env name `PROJECT_MEMORY_DISABLED` is a **fail-loud tombstone** — setting it (any value) refuses
1092
1105
  * boot with a message naming this knob; it is no longer read. */
@@ -1100,13 +1113,13 @@ export interface ServiceConfigFlat {
1100
1113
  * 中心让同步 boot 挂 ~5.7s(SYN 重传节奏,8s fetch 超时内)——本地 TOC 用户的「启动 5 秒」就是它。
1101
1114
  * 默认 1500;调大(≥8000)≈旧的全阻塞行为。`CONFIG_BOOT_FETCH_BUDGET_MS`。 */
1102
1115
  configBootFetchBudgetMs: number;
1103
- /** [1009]②/[1014]③ supportsSessionWakeup host-signal (core 1.309 ScheduleWakeup 治本位): the SHELL knows
1116
+ /** [ref]②/[ref]③ supportsSessionWakeup host-signal (core 1.309 ScheduleWakeup 治本位): the SHELL knows
1104
1117
  * whether a resident daemon exists to honor session wakeups — when it spawns a headless engine with none,
1105
1118
  * it sets `SCHEDULER_SESSION_WAKEUP=false` and core's ScheduleWakeup refuses up front (fail-loud) instead
1106
- * of parking a wakeup that would never fire (TB background-reap族 [991]②b). Default ON (the co-resident
1119
+ * of parking a wakeup that would never fire (TB background-reap族 [ref]②b). Default ON (the co-resident
1107
1120
  * TOC daemon does honor its own sessions' wakeups); opt-out only — SCHEDULER_ENABLED 同门. */
1108
1121
  schedulerSessionWakeup: boolean;
1109
- /** [2425]/[2436] session-lifetime 同族 host-signal(5.6.0):headless 部署(spawn 时已知无常驻 daemon
1122
+ /** [ref]/[ref] session-lifetime 同族 host-signal(5.6.0):headless 部署(spawn 时已知无常驻 daemon
1110
1123
  * 收割 session-lifetime 记录)设 `SCHEDULER_SESSION_LIFETIME=false` ⇒ capability 面
1111
1124
  * `supportsSessionLifetime:false` ⇒ core 的 CronCreate 前门拒收 durable:false(fail-closed 于工具层),
1112
1125
  * backend.schedule 第二道同拒——session 记录不落盘=孤儿不产生。Default ON(co-resident TOC daemon
@@ -1120,7 +1133,7 @@ export interface ServiceConfigFlat {
1120
1133
  * handsReadOnly, read-only from start) is unaffected/independent. */
1121
1134
  planModeEnabled: boolean;
1122
1135
  /**
1123
- * [5118]⑥(core 5.56 `Hooks.timeoutMs` 座)—— **每一只 hook 席位单次调用的时间上限**(ms)。
1136
+ * [ref]⑥(core 5.56 `Hooks.timeoutMs` 座)—— **每一只 hook 席位单次调用的时间上限**(ms)。
1124
1137
  * `HOOKS_TIMEOUT_MS`;**缺席 = 不铸键**,由 core 自默认(600s = CC 自己的数;server 不复制上游默认)。
1125
1138
  *
1126
1139
  * 🔴 `0` 是有效值(core 契约逐字:写下零的部署说了一件事 —— 每个席位立即到期),不是「未设」;
@@ -1141,43 +1154,53 @@ export interface ServiceConfigFlat {
1141
1154
  * Running rows are never reaped (that is the orphan-grace sweep's job). Default 30 days, floor 1m.
1142
1155
  * `WORKFLOW_RUN_RETENTION_MS`. */
1143
1156
  workflowRunRetentionMs: number;
1144
- /** design/166-T1 — core 5.8.0 部署级 token 治理窗(`RunnerDeps.usageWindows`):滑动窗内跨任务
1145
- * token 预算,key=principal(缺席=GLOBAL 一口锅,per-key 各一份额度——混流部署语义见 USAGE.md)。
1146
- * `USAGE_WINDOWS` 单键 JSON 数组(每项 {windowMs,maxTokens,anchor:"first-use"|"rolling"});
1147
- * 缺省未设=关(零行为变化)。fail-loud:坏 JSON/空数组/非正整数/未知 anchor boot throw
1148
- * (parseUsageWindows)。窗形变更≈重开账(first-use 桶按 windowMs 配对,老桶下次 charge 即弃)。 */
1157
+ /** [ref]-T1 — core 5.8.0 部署级治理窗(`RunnerDeps.usageWindows`):滑动窗内跨任务预算,
1158
+ * key=principal(缺席=GLOBAL 一口锅,per-key 各一份额度——混流部署语义见 USAGE.md)。
1159
+ * `USAGE_WINDOWS` 单键 JSON 数组(每项 {windowMs, maxTokens?, maxCostUsd?, anchor});
1160
+ * 缺省未设=关(零行为变化)。[ref](core 7.0.0):`maxCostUsd` 是与 maxTokens **对等**的第二只
1161
+ * ceiling(绝对美元;whichever fills first 即耗尽;缺席的 ceiling 不参与——非 0、非 )——两者
1162
+ * each optional on its own、**at least one required**(双缺=parseUsageWindows 响亮拒)。fail-loud:
1163
+ * 坏 JSON/空数组/坏值/未知 anchor → boot throw(parseUsageWindows)。窗形变更≈重开账(first-use
1164
+ * 桶按 windowMs 配对,老桶下次 charge 即弃)。$ 窗要求 run 可计价:无价目模型撞 $ 窗=core 门口拒
1165
+ * (`config.usage_window_unpriced`),USAGE.md §9.2。 */
1149
1166
  usageWindows?: readonly {
1150
1167
  windowMs: number;
1151
- maxTokens: number;
1168
+ maxTokens?: number;
1169
+ maxCostUsd?: number;
1152
1170
  anchor: "first-use" | "rolling";
1153
1171
  }[];
1154
- /** core 1.364 durable background agents([1503] 提货单③):reaper 经 `TaskRegistry.reapDurableAgents`
1172
+ /** core 1.364 durable background agents([ref] 提货单③):reaper 经 `TaskRegistry.reapDurableAgents`
1155
1173
  * (联合 reap——条件删赢了才 release 转录 session;裸 store.reap 会 strand 转录)按 scope 清 TERMINAL
1156
1174
  * `a*` 行,老于此值的删。SQL twins 走 DISTINCT-scope 枚举;local FileBackgroundAgentStore 单租户
1157
- * scope="default"。Default 7 days, floor 1m。`BG_AGENT_RETENTION_MS`。 */
1175
+ * scope="default"。Default 7 days, floor 1m。`BG_AGENT_RETENTION_MS`。
1176
+ * 🔴 [ref]([ref]②,设计判定 2026-08-30):这根旋钮**同时是子代转录(placed 分区)的生效留存视界**——
1177
+ * 联合 reap 行赢删才 release 转录,分区孤儿腿 `olderThanMs` 同源(core `reapDurableAgentsLane` 亲核),
1178
+ * retention lane 对 placed 显式让权(retention-store-sql.ts 第五腿)。core 词表常量
1179
+ * `SUBAGENT_TRANSCRIPT_RETENTION_DAYS_DEFAULT`(30d)在 core dist 零消费,本服务未按它跑;天数形
1180
+ * 专用旋钮无 core policy 座,候 core 扩座后再铸(生效值已投 wiring_static 日志)。 */
1158
1181
  backgroundAgentRetentionMs: number;
1159
1182
  /** 同批:stale-running 翻转窗——running 行的写者心跳(core 60s)断更超过此值 = 宿主进程死,行翻
1160
1183
  * failed/stoppedBy=system(诚实终态,跨实例读面永不虚构存活)。core 契约要求 ≥10min(60s 心跳的
1161
1184
  * 安全裕度),**下限 10min 硬钳**。Default 15min。`BG_AGENT_STALE_RUNNING_MS`。 */
1162
1185
  backgroundAgentStaleRunningMs: number;
1163
- /** core 1.382(design/153,[1561] 提货单④)`TaskRegistry.reconcileParkedAgents` 的 stale-claim 清算窗
1186
+ /** core 1.382([ref],[ref] 提货单④)`TaskRegistry.reconcileParkedAgents` 的 stale-claim 清算窗
1164
1187
  * ——core 该整块逻辑被 `opts.staleClaimMaxAgeMs !== undefined` 门住,缺席 = **整块清算永不运行**
1165
1188
  * (claim 后 claimer 进程崩死的行永久卡在"已 claim 不可再 claim"态,只能等 checkpoint TTL 自然过期;
1166
1189
  * checkpoint 已 resolved 但 finalize 未落的行——人已做出的审批决定——同样不会被诚实翻 failed)。
1167
- * cli 复查([1575] F1)抓获:server 侧此前调用漏传本项,清算臂结构性不可达。Default 1h(claim→drive→
1190
+ * cli 复查([ref] F1)抓获:server 侧此前调用漏传本项,清算臂结构性不可达。Default 1h(claim→drive→
1168
1191
  * finalize 正常全链本应秒级完成,1h 是给"进程慢但仍在跑"的宽松裕度)。`BG_AGENT_PARK_CLAIM_STALE_MS`。 */
1169
1192
  backgroundAgentParkClaimStaleMs: number;
1170
- /** [1522] MED2:agent_roster 的 TTL 清理窗(core RB-23②③ 派给部署的半场——task-scoped 具名 spawn
1193
+ /** [ref] MED2:agent_roster 的 TTL 清理窗(core [ref]②③ 派给部署的半场——task-scoped 具名 spawn
1171
1194
  * 每 run 一新行,无清理=线性无界)。按行的 recorded_at_ms(最后 upsert 触碰)删;SQL twins 扩展面,
1172
1195
  * File/Memory 店 core 自带 maxAgeMs。Default 30 days, floor 1m。`ROSTER_RETENTION_MS`。 */
1173
1196
  rosterRetentionMs: number;
1174
- /** #193 车4 件1(codex R1-high②):`leader_run` 行停在 `running` 超过这个时长即被清算成 `failed`
1197
+ /** [ref] 车4 件1(codex R1-high②):`leader_run` 行停在 `running` 超过这个时长即被清算成 `failed`
1175
1198
  * 并写清 WHY —— 驱动它的副本已经死了,没有任何东西在跑。**不是接管**(见 store 的
1176
1199
  * `reapStaleRunning` 头注)。默认 26h(leader run 的文档上限 24h + 余量),下限 1m。
1177
1200
  * Env: `LEADER_RUN_STALE_MS`。`LEADER_ENABLED=false` 的部署上这条腿根本不注册。 */
1178
1201
  leaderRunStaleMs: number;
1179
1202
  /** 修8(三路复审 absorb-2):periodic scratchpad sweep TTL — the reaper removes per-session scratchpad dirs
1180
- * ([820]③ ensureScratchpadDir) whose mtime is older than this (env-facts.ts `sweepStaleScratchpads`; the E21
1203
+ * ([ref]③ ensureScratchpadDir) whose mtime is older than this (env-facts.ts `sweepStaleScratchpads`; the E21
1181
1204
  * session-DELETE purge is the primary lifecycle, this sweep is the orphan backstop). Default 7 days, floor 1m
1182
1205
  * when enabled; `SCRATCHPAD_SWEEP_TTL_MS=0`(or negative)disables the sweep entirely. */
1183
1206
  scratchpadSweepTtlMs: number;
@@ -1204,7 +1227,7 @@ export interface ServiceConfigFlat {
1204
1227
  * documented core-side); the server only passes it through. `SENSITIVE_WRITE_PATTERNS` (comma-separated):
1205
1228
  * explicitly set = FULL REPLACEMENT of the recommended set (not a merge); `off` or an empty value = disabled
1206
1229
  * (empty array); unset = core's recommended set.
1207
- * 🔴 **施加点 = governance 层,无条件(#177 / [2951] issue #29;搬家前「composed into the fs-write gate fold
1230
+ * 🔴 **施加点 = governance 层,无条件([ref] / [ref] issue #29;搬家前「composed into the fs-write gate fold
1208
1231
  * on host-semantics lanes — task-settings.ts」的旧描述已作废)**:与 `AUTONOMY`/`MANUAL_MODE_SHELL_GATE`
1209
1232
  * 同拍,resolve-spec 预铸成一条纯 DENY policy 递给 `applyRuntimeGovernance`,**不看客户端 settings/
1210
1233
  * permissionMode 的在场性、不看落在哪个模式臂、不看执行 lane**。旧家把它唯一的合成点挂在
@@ -1219,17 +1242,17 @@ export interface ServiceConfigFlat {
1219
1242
  * ⚠️ 非法模式(不含任何路径段,如 `"/"`)在 boot 期 fail-loud(createResolveSpec 先编译一次)——
1220
1243
  * **对存量部署是行为变更**:搬家前这种坏值只在 default/auto/acceptEdits 三臂上每请求炸,只跑
1221
1244
  * headless 的部署带着坏值也能起服务;现在起不来(方向=运维当场看见,而不是每任务一条 500)。
1222
- * ✅ 旧注写的「沙箱 lane 相对形有一格无人裁决(cwd 里的守卫段看不见)」自 core 5.19.0(#108)起
1245
+ * ✅ 旧注写的「沙箱 lane 相对形有一格无人裁决(cwd 里的守卫段看不见)」自 core 5.19.0([ref])起
1223
1246
  * 已收口:守卫按 `ToolCallRequest.cwd` 解析写目标,两条 lane 同得。剩余射程边界(引擎未盖戳的直接
1224
1247
  * 调用形)成文在 `deployment-governance.ts` 的 `RelativeTargetLexicalEnv` 类注。 */
1225
1248
  sensitiveWritePatterns: string[];
1226
- /** [1557]§四 opt-in (cli[1555]② finding, core[1556] suggested mechanism): the CC manual-family permission
1249
+ /** [ref]§四 opt-in (cli[ref]② finding, core[ref] suggested mechanism): the CC manual-family permission
1227
1250
  * modes (default/auto/acceptEdits) gate every fs WRITE hand tool (Write/Edit/NotebookEdit) but never touched
1228
1251
  * Bash — a model can `echo -n '…' > file` straight past the write-approval card. `MANUAL_MODE_SHELL_GATE`
1229
1252
  * opts a deployment into ALSO tightening `TaskSpec.shellGate` (core `bashReversibilityProbe` under
1230
1253
  * `"classify"` asks on constructively-irreversible commands — shell redirects etc. — **plus** the boundary
1231
1254
  * case in the 🔴 note below; it is not a "constructive-irreversibility only" filter).
1232
- * 🔴 **施加点 = governance 层,无条件(#153 / [2713] 分单②;搬家前的旧描述已作废)**:与 `AUTONOMY`
1255
+ * 🔴 **施加点 = governance 层,无条件([ref] / [ref] 分单②;搬家前的旧描述已作废)**:与 `AUTONOMY`
1233
1256
  * 同拍在 `applyRuntimeGovernance`(runtime-governance.ts)里施加,**不看客户端 settings/permissionMode
1234
1257
  * 的在场性、不看落在哪个模式臂、不看执行 lane**。旧家挂在 task-settings 的 default/auto/acceptEdits 三臂
1235
1258
  * + host-lane fs-write wiring 上,等于让一个部署级旋钮的生死由客户端表态决定(print/headless 腿不 stamp
@@ -1237,7 +1260,7 @@ export interface ServiceConfigFlat {
1237
1260
  * rank 合成:与 autonomy 派生值取大(`ask`→`"always"` 压过 `"classify"`),对 base 只升不降。
1238
1261
  * 客户端 settings 折叠在其后、tighten-only,拿不掉这个值;SUP 路由姿态只会把它抬到 `"always"`。
1239
1262
  * 🔴 **语义随 core 版本演进(2026-07-31 核)**:`"classify"` 下「纯读自动放行」这句自 core 2.7.0 起
1240
- * **不再无条件成立** —— RB-412 给 classifier 加了 root 边界扫描,core 内部自铸 boundary
1263
+ * **不再无条件成立** —— [ref] 给 classifier 加了 root 边界扫描,core 内部自铸 boundary
1241
1264
  * (`prepare-task.ts` 的 `shellReadBoundary`:roots=任务 root+additionalRoots+additionalReadRoots,
1242
1265
  * cwd=活 handsCwd),
1243
1266
  * **读到 roots 之外的路径同样会 ask**(server 侧零接线即得:我们只传 shellGate,边界是 core 自算的)。
@@ -1247,7 +1270,7 @@ export interface ServiceConfigFlat {
1247
1270
  * other value (incl. `"off"`) is treated as unset — this knob has no "off" value to opt BACK OUT with once a
1248
1271
  * session's baseline already tightened elsewhere (tightenTaskSpec would reject that as a loosen anyway). */
1249
1272
  manualModeShellGate?: "always" | "classify";
1250
- /** [803]④ defer face (EXPERIMENTAL, default OFF): mark the default scenario's LONG-TAIL first-party tools
1273
+ /** [ref]④ defer face (EXPERIMENTAL, default OFF): mark the default scenario's LONG-TAIL first-party tools
1251
1274
  * (today = SelectEnvironment only) `defer:true` (core tool-disclosure: the model sees a placeholder until it
1252
1275
  * ToolSearch-loads the schema). Assessment says the win is marginal for us (spec.tools total ≈4.2k tokens, of
1253
1276
  * which Agent + the Task quartet ≈3.2k are CC-core posture = must stay inline; the deferrable tail is
@@ -1255,7 +1278,7 @@ export interface ServiceConfigFlat {
1255
1278
  * hiding it behind ToolSearch suppresses exactly the spontaneous use it exists for). MCP tools are ALWAYS
1256
1279
  * auto-deferred by core regardless of this flag. `TOOL_DEFER_LONGTAIL=true` opts in. */
1257
1280
  toolDeferLongtail: boolean;
1258
- /** LSP code-intelligence tool (design/64 §13.1): mount core's `lsp` tool, routed to an E2B LSP sidecar. Requires
1281
+ /** LSP code-intelligence tool ([ref] §13.1): mount core's `lsp` tool, routed to an E2B LSP sidecar. Requires
1259
1282
  * REMOTE_EXEC=e2b. Default OFF (the on-the-fly language-server install is heavy until an E2B template bakes it).
1260
1283
  * `LSP_ENABLED=true`. */
1261
1284
  lspEnabled: boolean;
@@ -1264,7 +1287,7 @@ export interface ServiceConfigFlat {
1264
1287
  * server binary on PATH, and it DEGRADES gracefully (ENOENT → grep/read) + spawns lazily/cached, so it is DEFAULT
1265
1288
  * ON for the host lane (CC-parity); set `LSP_HOST_ENABLED=false` to opt out. (`REMOTE_EXEC=host` only — ssh/adb/
1266
1289
  * local-docker can't reach a local child process to the right filesystem.)
1267
- * design/158 B4 (lens4 N7): this lane used to share `LSP_ENABLED` with `lspEnabled` above — one env name driving
1290
+ * [ref] B4 (lens4 N7): this lane used to share `LSP_ENABLED` with `lspEnabled` above — one env name driving
1268
1291
  * two OPPOSITE defaults. It now has its own knob. 🪦 server 3.0.0: `LSP_ENABLED=false` (the pre-split host
1269
1292
  * opt-out) is a **fail-loud tombstone** — it refuses boot naming `LSP_HOST_ENABLED`; `LSP_ENABLED=true` keeps
1270
1293
  * its own meaning (the sandbox lane's opt-in above) and is unaffected. */
@@ -1275,7 +1298,7 @@ export interface ServiceConfigFlat {
1275
1298
  * 10s hard-cut would kill long turns); floor 10s. Env: DRAIN_GRACE_MS. SIGINT (Ctrl-C dev
1276
1299
  * ergonomics) and a SECOND SIGTERM skip the drain and hard-stop immediately. */
1277
1300
  drainGraceMs: number;
1278
- /** B3 (shell [771]②): SIGHUP idle window. SIGHUP means "the process-group owner's terminal went away" — but
1301
+ /** B3 (shell [ref]②): SIGHUP idle window. SIGHUP means "the process-group owner's terminal went away" — but
1279
1302
  * under the shared-engine shape (several shell sessions on one config, engine rides the FIRST shell's process
1280
1303
  * group per the T11 anti-orphan call) other live sessions may still be using this engine, so an unconditional
1281
1304
  * drain kills a peer mid-turn (499) and 503s new submits. Instead SIGHUP arms an idle watch: shut down only
@@ -1284,7 +1307,7 @@ export interface ServiceConfigFlat {
1284
1307
  * T11 stands, just bounded instead of immediate. A SECOND SIGHUP (or SIGTERM) escalates to the normal drain
1285
1308
  * path. Default 120s, floor 5s. Env: SIGHUP_IDLE_GRACE_MS. */
1286
1309
  sighupIdleGraceMs: number;
1287
- /** #219(黑板 [3617]):引擎 **parent 监视**。壳自 spawn 引擎的同机形里,壳被 SIGKILL(崩溃/强杀,
1310
+ /** [ref](黑板 [ref]):引擎 **parent 监视**。壳自 spawn 引擎的同机形里,壳被 SIGKILL(崩溃/强杀,
1288
1311
  * 没有任何清理钩子)后引擎被 reparent 到 init 而**继续活着** —— 孤儿引擎占端口、占库连接、占模型
1289
1312
  * 配额,而且再没有人会给它发 SIGTERM(T11 的进程组腿只覆盖信号送得到的形)。设了本键 = 引擎每 15s
1290
1313
  * 用 `process.kill(pid, 0)` 探一拍这个 pid,**连续两拍** ESRCH(父不在)才判死;判死后走与 SIGTERM
@@ -1295,7 +1318,7 @@ export interface ServiceConfigFlat {
1295
1318
  * 已知残余(成文,不收窄):两拍窗口内 pid 被系统复用 ⇒ 探活看到的是**新**进程,监视判"父还活着"
1296
1319
  * 而不自退。监视是**尽力自愈**、不是强一致的父子生命周期绑定。 Env: `SEMA_PARENT_PID`。 */
1297
1320
  parentPid?: number;
1298
- /** #118(黑板 [5371]②):引擎**附着租约自退**总开关。壳自 spawn 引擎的本机形里,壳退出之后引擎
1321
+ /** [ref](黑板 [ref]②):引擎**附着租约自退**总开关。壳自 spawn 引擎的本机形里,壳退出之后引擎
1299
1322
  * 继续活着 = 占端口/占库连接/占模型配额的孤儿。设了本键 = 引擎每 15s 自查一次「还有没有人附着」,
1300
1323
  * **三合取**(无附着 SSE 流 ∧ 无在飞 run ∧ 无非探针 HTTP 触点)**持续**满 {@link engineLingerMs}
1301
1324
  * 才自退,且自退走的是与 SIGTERM **逐字同一条** graceful drain 腿(不是裸 `process.exit`)。
@@ -1304,11 +1327,11 @@ export interface ServiceConfigFlat {
1304
1327
  * 与 {@link parentPid} 是**两件**:那条问「生我的 pid 还在吗」(多壳共享一引擎时结构性问错),
1305
1328
  * 这条问「还有没有人附着」。两条可同时装,各走各的判据。 Env: `ENGINE_AUTO_EXIT`(默认 off)。 */
1306
1329
  engineAutoExit: boolean;
1307
- /** #118:自退前三合取必须**持续**成立的静默窗。默认 60s —— 防的是**壳重启窗**:壳崩了/重启的 1-3s
1330
+ /** [ref]:自退前三合取必须**持续**成立的静默窗。默认 60s —— 防的是**壳重启窗**:壳崩了/重启的 1-3s
1308
1331
  * 里附着数确实是 0,窗太短就在用户眼皮底下把引擎杀了,窗内任何一次重连即把计时清零。
1309
1332
  * {@link engineAutoExit} 关着时本值不生效,但**照样解析、坏值照样拒启**(部署级旋钮的解析不挂在
1310
1333
  * 另一个旋钮的表态上 —— 否则手滑值躺在配置里,等哪天有人打开自退时当场生效且从没人报过警)。
1311
- * **坏值拒启**(#210 A 档):非安全整数 / 落在 `[1000, 86400000]`(1s…24h)之外一律 boot 期 throw
1334
+ * **坏值拒启**([ref] A 档):非安全整数 / 落在 `[1000, 86400000]`(1s…24h)之外一律 boot 期 throw
1312
1335
  * 带指路 —— 「把 60(秒)填进一个毫秒键」是这类旋钮最常见的手滑,而 60ms 的 linger 等于把整条防误杀
1313
1336
  * 腿静默摘掉;上界那一侧同样承重(codex R1-F2):`1e100` 能过朴素的「正整数吗」检查,而 elapsed
1314
1337
  * **永远追不上它** ⇒ 看着配好了、自退其实整件失效。要「永不自退」请用 `ENGINE_AUTO_EXIT=false`。
@@ -1329,26 +1352,26 @@ export interface ServiceConfigFlat {
1329
1352
  * stream (the durable-suspend leg is wired separately). A CC cap → posture-gated (single-user turnkey →
1330
1353
  * ON; multi-tenant opt-in); `ASK_QUESTION_ENABLED=true/false` overrides. */
1331
1354
  askQuestionEnabled: boolean;
1332
- /** #166 裁2:AskUserQuestion 的**裁量窗**——每 run 腿的并发帽 / 总量帽 / 无人应答的释放窗。窗用尽或到期
1355
+ /** [ref] 裁2:AskUserQuestion 的**裁量窗**——每 run 腿的并发帽 / 总量帽 / 无人应答的释放窗。窗用尽或到期
1333
1356
  * 不是拒绝、也不是替人作答:协调器报 `unavailable`,落点(durable park / 非 durable 合成续跑)归 core。
1334
1357
  * `QUESTION_MAX_CONCURRENT_PER_RUN`(默认 2)/ `QUESTION_MAX_TOTAL_PER_RUN`(20)/ `QUESTION_TTL_MS`
1335
1358
  * (300000),越界值启动期响亮拒(照 `MCP_ELICITATION_*` 同门,不静默夹取)。缺席 ⇒ 协调器出厂窗
1336
1359
  * {@link import("./question.js").DEFAULT_QUESTION_THROTTLE}(与本旋钮族默认逐字同值)。 */
1337
1360
  questionThrottle?: QuestionThrottle;
1338
- /** [816]/[820]② live tool-approval HITL — mount the ToolApprovalCoordinator on `RunnerDeps.onAsk` + the
1361
+ /** [ref]/[ref]② live tool-approval HITL — mount the ToolApprovalCoordinator on `RunnerDeps.onAsk` + the
1339
1362
  * `POST /v1/tool-approvals/:id/respond` route so a policy `ask` (the fs-write gate, ask-lists, non-durable safety
1340
1363
  * asks) routes to the live human as the CC three-choice card on the run's stream (core 1.290 sync-ask leg). A CC
1341
1364
  * cap → posture-gated like askQuestion (single-user turnkey → ON; multi-tenant opt-in);
1342
- * `TOOL_APPROVAL_ENABLED=true/false` overrides. Absent ⇒ core's headless auto-deny stands ([819]⑤ fail-closed). */
1365
+ * `TOOL_APPROVAL_ENABLED=true/false` overrides. Absent ⇒ core's headless auto-deny stands ([ref]⑤ fail-closed). */
1343
1366
  toolApprovalEnabled: boolean;
1344
1367
  /**
1345
- * #154 车二(core design/179 持久化权限规则「不再询问」车道)**总开关**。`PERMISSION_RULES_ENABLED`,
1346
- * **#203 起默认 ON**(clay [3396] 裁)。
1368
+ * [ref] 车二(core [ref] 持久化权限规则「不再询问」车道)**总开关**。`PERMISSION_RULES_ENABLED`,
1369
+ * **[ref] 起默认 ON**(clay [ref] 裁)。
1347
1370
  *
1348
1371
  * 🔴 它曾经默认 OFF,而那个默认有**唯一**一条理由(codex 车二 round7 [high] 一):这条车道**只会加
1349
1372
  * 放行、不会减**,而车二**没有撤销面**——列出 / 删除自己已存规则的口子没建,core 的
1350
1373
  * `removePersistedRule` 在包里但本仓零调用点。一次误导入的全局规则因此会一直生效,租户自己拿它没
1351
- * 办法,只能找运维改库。#203 交付的正是那条撤销面本身(`GET /v1/rules` + `DELETE /v1/rules`,后者
1374
+ * 办法,只能找运维改库。[ref] 交付的正是那条撤销面本身(`GET /v1/rules` + `DELETE /v1/rules`,后者
1352
1375
  * 恒经 `removePersistedRule` 产墓碑)加上 operator 的超范围回收腿 ⇒ **前置条件兑现,默认翻转**。
1353
1376
  * 记这段史不是怀旧:哪天有人想把某条「只加放行」的车道默认打开,判据就是这一条 —— 收得回来才敢开。
1354
1377
  *
@@ -1364,15 +1387,15 @@ export interface ServiceConfigFlat {
1364
1387
  /** 运维是否**显式**设过 `PERMISSION_RULES_ENABLED`(取值之外的一位,同 {@link dbBackendExplicit} 的
1365
1388
  * 姿势)。唯一消费者 = boot 期休眠行审计:对显式表过态的部署说「N 只桶随默认 ON 激活」是假话。 */
1366
1389
  permissionRulesEnabledExplicit: boolean;
1367
- /** #151 车2(design/172 §3.3 D3,窗长三元的安全余量):`ToolApprovalCoordinator` 的可选 `windowMarginMs`
1390
+ /** [ref] 车2([ref] §3.3 D3,窗长三元的安全余量):`ToolApprovalCoordinator` 的可选 `windowMarginMs`
1368
1391
  * 构造项——有效窗 = `min(ttlMs, legRemainingMs − 本值)`,余量不足 ⇒ 不开窗直接走窗到期同路(park)。
1369
1392
  * 仅在装配点把 `ToolApprovalRunContext.legDeadlineMonotonic` 传给协调器(车3 的活)时才实际生效——本
1370
1393
  * 旋钮本身缺省对现行为零影响(D1)。`STREAM_ASK_WINDOW_MARGIN_MS`,默认 10000(10s)。ttl 概念沿用既有
1371
1394
  * `approvalTimeoutSec` 族,本旋钮不新增第二个 TTL 概念。 */
1372
1395
  streamAskWindowMarginMs: number;
1373
- /** #151 车3(design/172 流内审批协议)总开关 + 四个从属旋钮。
1396
+ /** [ref] 车3([ref] 流内审批协议)总开关 + 四个从属旋钮。
1374
1397
  *
1375
- * **现行默认(clay 裁 2026-08-08 走 (a),#164 翻真验证后)**:`STREAM_APPROVAL_ENABLED` 默认 **true**
1398
+ * **现行默认(clay 裁 2026-08-08 走 (a),[ref] 翻真验证后)**:`STREAM_APPROVAL_ENABLED` 默认 **true**
1376
1399
  * = 协议整体默认 **ON**;`STREAM_ASK_WINDOW_MS` 默认 **300000**(5min,与 sync 腿既有活卡窗、与
1377
1400
  * `DEFAULT_APPROVAL_TTL_MS` 对齐——「开协议」不再顺带把窗砍短)。⚠️ 版本坐标:翻转**已在树上生效**,
1378
1401
  * 发布线上落在 7.4.0 之后的下一个发布,所以一台自报 7.4.0 的**已发布** worker 仍是 OFF,别只按
@@ -1397,20 +1420,20 @@ export interface ServiceConfigFlat {
1397
1420
  * `STREAM_APPROVAL_ADHOC_GRACE_MS` / `STREAM_APPROVAL_ORPHAN_TTL_MS`(后四键 = 车5 收敛器)。 */
1398
1421
  streamApproval: StreamApprovalConfig;
1399
1422
  /**
1400
- * #280 R-13 C(`UNATTENDED_APPROVAL_POLICY`;裁定 [4297]Q1「裁2:A+C」/[4338] 裁②)——一只治理 ask
1423
+ * [ref] R-13 C(`UNATTENDED_APPROVAL_POLICY`;裁定 [ref]Q1「裁2:A+C」/[ref] 裁②)——一只治理 ask
1401
1424
  * 到了而**没有任何人**能答时,这条部署要什么终局。闭集 `park`(缺省)/ `deny`,**坏值 boot 拒启**
1402
- * (#210 A 档:一个拼错的词若被当成「未设」静默回缺省,运维会以为自己关掉了 park 积压而实际没有)。
1425
+ * ([ref] A 档:一个拼错的词若被当成「未设」静默回缺省,运维会以为自己关掉了 park 积压而实际没有)。
1403
1426
  *
1404
1427
  * **谁需要**:auto / headless / 无人值守部署(夜间批处理、CI 里的 agent、没有任何人盯屏的 worker)。
1405
1428
  * 它们的 park 是死信:run 挂起候一个永远不会来的人,占着 checkpoint 与配额直到 TTL。
1406
1429
  * **谁被伤**:配了 `deny` 却其实有人的部署 —— 那些本可以补批的操作变成当场拒绝。补偿 = 这是**显式**
1407
1430
  * 一句声明,缺省永远是 `park`;改回来只需删掉这一行 env。
1408
- * **不看任何客户端表态**(纯部署级;memory: operator-knob-must-be-unconditional —— #153 shellGate 让
1431
+ * **不看任何客户端表态**(纯部署级;memory: operator-knob-must-be-unconditional —— [ref] shellGate 让
1409
1432
  * 一个部署级旋钮的生死由客户端 posture 决定,同病犯过两次)。
1410
1433
  *
1411
1434
  * 施加点 = `ToolApprovalCoordinator` 的构造参 `unattendedPolicy` **一处**,五条「无人可答」的臂读同一
1412
1435
  * 个值(设计稿 §1 的表:(a) 有店窗到期赢 CAS /(b) 无店窗到期 /(c) 店报错 catch /(d) windowZero 与
1413
- * headless 腿 /(e) 断连强转 + emit 全灭 + 写侧准入超限 + **投递集合入口活性过滤清空**(A-054.17
1436
+ * headless 腿 /(e) 断连强转 + emit 全灭 + 写侧准入超限 + **投递集合入口活性过滤清空**([ref]
1414
1437
  * 位:与「查无活流」同一件事实的两个时刻,详见 `askBroadcast` 的该臂注))。`"timeout"` 宿主自报只留在 (b)(c) ——
1415
1438
  * 结束等待的确实是本仓的窗;其余三臂结束等待的是容量/连接/装配,自报恒缺席。
1416
1439
  *
@@ -1435,9 +1458,9 @@ export interface ServiceConfigFlat {
1435
1458
  * 自行收敛成 DENIED/VOID,不会凭空生出 park;残余 = 那类行的归因记成 `routing_failure`。
1436
1459
  */
1437
1460
  unattendedApprovalPolicy: UnattendedApprovalPolicy;
1438
- /** [824]① (clay A 案 = workflow 权限全面 CC parity): workflow 子 agent 的默认权限基线与主 LLM 同权(base `{}`)。
1439
- * 安全论证:主 LLM 与子 agent 同 root 同信任域,主 LLM 本就能写这棵树([816] ask 门照管),单独钳子 agent 的
1440
- * 安全增益≈0(只防绕路不防直路的门不是边界);实测产品代价=[814]A 死锁。`WORKFLOW_AGENTS_READONLY=true` =
1461
+ /** [ref]① (clay A 案 = workflow 权限全面 CC parity): workflow 子 agent 的默认权限基线与主 LLM 同权(base `{}`)。
1462
+ * 安全论证:主 LLM 与子 agent 同 root 同信任域,主 LLM 本就能写这棵树([ref] ask 门照管),单独钳子 agent 的
1463
+ * 安全增益≈0(只防绕路不防直路的门不是边界);实测产品代价=[ref]A 死锁。`WORKFLOW_AGENTS_READONLY=true` =
1441
1464
  * TOB 保守部署的可选旋钮:workflow 子 agent 基线加 handsReadOnly(1.190 前的旧默认)。默认 off。 */
1442
1465
  workflowAgentsReadOnly: boolean;
1443
1466
  /** Sandbox-image-pool BAKE job API (IMAGE-API-DESIGN.md §P2): enable /v1/images/bakes* (operator-submit + the
@@ -1450,22 +1473,22 @@ export interface ServiceConfigFlat {
1450
1473
  /** Task Trace API (S1): persist the agent's reasoning/thinking into the durable run event log (for the CC-style
1451
1474
  * trace UI). Default ON; `TRACE_THINKING=false` disables capture for sensitive deployments. Redacted on persist. */
1452
1475
  traceThinking: boolean;
1453
- /** #246(core 5.30.0 readFace 部署座席):READ 容纳面。缺席=不铸(core 引擎默认 roots,server 不写死
1476
+ /** [ref](core 5.30.0 readFace 部署座席):READ 容纳面。缺席=不铸(core 引擎默认 roots,server 不写死
1454
1477
  * 上游默认);显式坏词启动期响亮拒。只影响读面,写面永不受它管(core 契约)。 */
1455
1478
  readFace?: "open" | "roots";
1456
- /** #246:部署级 READ deny 追加表(additive-only,core 内建表永不可缩)。env=JSON 数组
1479
+ /** [ref]:部署级 READ deny 追加表(additive-only,core 内建表永不可缩)。env=JSON 数组
1457
1480
  * [{pattern, caseSensitive?}],boot 时用 core `compileReadDeny` 预验——坏形拒启。缺席=不铸。 */
1458
1481
  readDenyPatterns?: {
1459
1482
  pattern: string;
1460
1483
  caseSensitive: boolean;
1461
1484
  }[];
1462
- /** #253 件 G5(core 5.33.0 #245,clay 裁定件):**内建** deny 表的档位选择(闭集四档:credentials /
1485
+ /** [ref] 件 G5(core 5.33.0 [ref],clay 裁定件):**内建** deny 表的档位选择(闭集四档:credentials /
1463
1486
  * shell-history / browser / wallet)。`READ_DENY_BUILTIN_TIERS`=逗号分隔;`none`=显式空姿态(core 的
1464
1487
  * `[]`:一档内建都不要);坏档名 / 空串**启动期响亮拒**(校验用 core 自己的 `resolveReadDenyBuiltins`)。
1465
1488
  * 缺席=不铸 ⇒ core 自默认(除 shell-history 外全开)。**仅 deployment 席**:TaskSpec 上没有同名键,
1466
1489
  * 任务/受治脚本无法据此放宽自己的部署(core 侧的设计,与本仓「部署级旋钮无条件施加」同向)。 */
1467
1490
  readDenyBuiltinTiers?: readonly string[];
1468
- /** #253 件 G5:按**行名**(内建表的 canonical pattern)删内建条目,在档位选择**之后**生效。
1491
+ /** [ref] 件 G5:按**行名**(内建表的 canonical pattern)删内建条目,在档位选择**之后**生效。
1469
1492
  * `READ_DENY_BUILTIN_EXCLUDE`=逗号分隔;不在表里的行名 / 空串**启动期响亮拒**。
1470
1493
  * 🔴 不变量(判据帖 G5b):删内建**绝不**削弱任务自己显式声明的 deny —— 那是另一层(additions)。 */
1471
1494
  readDenyBuiltinExclude?: readonly string[];
@@ -1579,11 +1602,11 @@ export type ServiceApprovalConfig = Pick<ServiceConfigFlat, "approvalRequire" |
1579
1602
  export type ServiceMemoryConfig = Pick<ServiceConfigFlat, "memoryEngineEnabled" | "memoryEngineDir" | "memoryEngineRemoteLaneAllowed" | "memoryEngineBackend" | "memoryScope" | "memoryPersistenceCapable" | "memorySync" | "memoryEmbedder" | "memoryOrgAdmissionMode" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "memoryConsolidationDriver" | "memoryOrgDirectoryJson" | "memoryOrgGrantTtlMs" | "memoryOrgUnavailableBackoffMs" | "projectMemoryEnabled" | "syncImportLeaseStaleSec">;
1580
1603
  /** 组:auth(鉴权 / 身份 / 治理棒)。`commandPolicy` 只有 sema-registry 腿(无 env 标量形),故 env 解析
1581
1604
  * 函数不产出它,但它与 `autonomy` 是同一根治理棒的两半,归本组。
1582
- * design/170 的三件部署治理声明(`compliancePosture`/`lockedConfigKeys`/`retentionPolicy`)同归本组:
1605
+ * [ref] 的三件部署治理声明(`compliancePosture`/`lockedConfigKeys`/`retentionPolicy`)同归本组:
1583
1606
  * 三者都是 operator 在配置面写下的**治理声明**(与 autonomy/commandPolicy 同族),不是存储旋钮
1584
1607
  * ——`retentionPolicy` 尤其容易被误归 store 组:它的消费点是 core 的启动期能力校验与将来的调度面,
1585
1608
  * config 这一层它只是一句声明。 */
1586
- export type ServiceAuthConfig = Pick<ServiceConfigFlat, "authToken" | "authTokens" | "allowUnauthedWrites" | "corsOrigins" | "principalHeader" | "requirePrincipal" | "autonomy" | "commandPolicy" | "compliancePosture" | "lockedConfigKeys" | "retentionPolicy" | "retentionSweep" | "operatorPrincipals" | "principalJwtPubkeys" | "principalJwtIss" | "principalJwtAud" | "principalJwtMaxTtlSec" | "bindHost" | "bindHostSource">;
1609
+ export type ServiceAuthConfig = Pick<ServiceConfigFlat, "authToken" | "authTokens" | "allowUnauthedWrites" | "corsOrigins" | "principalHeader" | "requirePrincipal" | "autonomy" | "commandPolicy" | "compliancePosture" | "lockedConfigKeys" | "configCatalogEnabled" | "retentionPolicy" | "retentionSweep" | "operatorPrincipals" | "principalJwtPubkeys" | "principalJwtIss" | "principalJwtAud" | "principalJwtMaxTtlSec" | "bindHost" | "bindHostSource">;
1587
1610
  /** 组:orchestration(编排 + 执行车道 + 沙箱面 + workflow/后台 agent 存留)。 */
1588
1611
  export type ServiceOrchestrationConfig = Pick<ServiceConfigFlat, "remoteExec" | "worktreeIsolation" | "leaderEnabled" | "leaderFanoutEnabled" | "routerEnabled" | "selfOrchestrationEnabled" | "selfOrchestrationModels" | "selfOrchestrationWorkerIsolation" | "forkEnabled" | "experimentalObserverAgents" | "schedulerEnabled" | "schedulerSessionWakeup" | "schedulerSessionLifetime" | "schedulerStorePath" | "planModeEnabled" | "hooksTimeoutMs" | "workflowRunStoreBackend" | "workflowOrphanGraceMs" | "workflowJournalRetentionMs" | "workflowRunRetentionMs" | "usageWindows" | "workflowAgentsReadOnly" | "workflowSizeGuideline" | "backgroundAgentRetentionMs" | "backgroundAgentStaleRunningMs" | "backgroundAgentParkClaimStaleMs" | "delegationEntryCaps" | "rosterRetentionMs" | "leaderRunStaleMs" | "scratchpadSweepTtlMs" | "sandboxPkgSource" | "sessionAutoTitle" | "selectEnvironmentTool" | "envFactsEnabled" | "toolDeferLongtail" | "lspEnabled" | "lspHostEnabled" | "imageBakes" | "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude">;
1589
1612
  /** 组:limitsHttp(HTTP 面 + 各类上限/配额/回收窗)。 */