@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,9 +1,28 @@
1
+ import { createHash } from "node:crypto";
2
+ import { committedOriginOf } from "@sema-agent/core";
3
+ import { canonicalJson } from "./canonical-json.js";
1
4
  export const ORIGIN_AWARE_QUERY = "originAware";
2
5
  export function readOriginAware(params) {
3
6
  return params.get(ORIGIN_AWARE_QUERY) === "1";
4
7
  }
5
8
  export function isOriginTagged(entry) {
6
- return typeof entry === "object" && entry !== null && Object.prototype.hasOwnProperty.call(entry, "origin") && entry.origin !== undefined;
9
+ if (typeof entry !== "object" || entry === null)
10
+ return false;
11
+ if (Object.prototype.hasOwnProperty.call(entry, "origin") && entry.origin !== undefined)
12
+ return true;
13
+ const fm = entry.frontmatter;
14
+ if (typeof fm !== "object" || fm === null)
15
+ return false;
16
+ if (Object.prototype.hasOwnProperty.call(fm, "origin") && fm.origin !== undefined)
17
+ return true;
18
+ const extra = fm.extra;
19
+ if (extra === undefined)
20
+ return false;
21
+ if (!Array.isArray(extra))
22
+ return true;
23
+ if (!extra.every((l) => typeof l === "string"))
24
+ return true;
25
+ return committedOriginOf({ extra }) !== undefined;
7
26
  }
8
27
  export function buildOriginFence(entries, originAware) {
9
28
  if (originAware)
@@ -12,4 +31,25 @@ export function buildOriginFence(entries, originAware) {
12
31
  const withheld = entries.length - kept.length;
13
32
  return withheld > 0 ? { entries: kept, withheldOriginTagged: withheld } : { entries: kept };
14
33
  }
34
+ function sha256Line(text) {
35
+ return createHash("sha256").update(`${text}\n`, "utf8").digest("hex");
36
+ }
37
+ export function buildOriginFencedBundle(bundle, originAware) {
38
+ if (originAware)
39
+ return bundle;
40
+ const kept = bundle.entries.filter((e) => !isOriginTagged(e));
41
+ const withheld = bundle.entries.length - kept.length;
42
+ if (withheld === 0)
43
+ return bundle;
44
+ return {
45
+ ...bundle,
46
+ entries: kept,
47
+ integrity: {
48
+ entryCount: kept.length,
49
+ revs: Object.fromEntries(kept.map((e) => [e.id, e.rev])),
50
+ sectionHashes: { ...bundle.integrity.sectionHashes, entries: sha256Line(canonicalJson(kept)) },
51
+ },
52
+ withheldOriginTagged: withheld,
53
+ };
54
+ }
15
55
  //# sourceMappingURL=memory-origin-fence.js.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * #252 件2/件3 —— 记忆面**姿态**的单一推导点。
2
+ * [ref] 件2/件3 —— 记忆面**姿态**的单一推导点。
3
3
  *
4
4
  * ## 病
5
5
  *
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * ## 两条诚实纪律
18
18
  *
19
- * ① **档位取实例真值,不按后端推断**([3590] 裁①/[3606]①的延续):`vectorMode` 是「后端上限 × embedder
19
+ * ① **档位取实例真值,不按后端推断**([ref] 裁①/[ref]①的延续):`vectorMode` 是「后端上限 × embedder
20
20
  * 在场」的推断结果,两支 SQL 后端各自的实例 getter 才是真值;file 引擎**根本没有**这个指示面
21
21
  * (core 的 `MemoryBackend` 契约里没有 `vectorMode`,亲验),所以它报 `null` —— 「没有这个指示面」与
22
22
  * 「档位是词面」是两件事,折成一件就是编一个数出来。
@@ -51,20 +51,20 @@ export interface MemoryPosture {
51
51
  dimensions: number;
52
52
  } | null;
53
53
  /**
54
- * #299(core 5.45.0 design/324):本部署给委派臂设的**证据标准**(`MEMORY_DELEGATION_EVIDENCE`)。
54
+ * [ref](core 5.45.0 [ref]):本部署给委派臂设的**证据标准**(`MEMORY_DELEGATION_EVIDENCE`)。
55
55
  *
56
56
  * 🔴 `null` = **本部署没设这个键** ⇒ 引擎按它自己的缺省跑。**不是**「等于 static-face」—— 那句话是
57
57
  * 关于 core 缺省的知识声明,本读面不替 core 宣布它(`vectorMode: null` 同一条诚实纪律:
58
58
  * 「没有这个指示面」与「档位是词面」是两件事)。运维要知道「实际生效的是哪一档」,读这一位 +
59
59
  * 实装 core 的契约,两件事分开摆。
60
60
  *
61
- * 受众 = **operator 面独占**:与 `darkReason`/`multiTenant`/embedder 身份同判(#252 件3 的分界),
61
+ * 受众 = **operator 面独占**:与 `darkReason`/`multiTenant`/embedder 身份同判([ref] 件3 的分界),
62
62
  * 刻意**不**进 `GET /v1/capabilities` 的窄投影 —— 证据标准回答的是「这台机器怎么判污染」,是运维
63
63
  * 诊断料,不是任何持凭证调用方该读的位。
64
64
  */
65
65
  delegationEvidence: "static-face" | "attested-only" | null;
66
66
  /**
67
- * #307 件4(core 5.46.0 design/336 §13-3):本部署的 **provenance 姿态**(`MEMORY_PROVENANCE`)——
67
+ * [ref] 件4(core 5.46.0 [ref] §13-3):本部署的 **provenance 姿态**(`MEMORY_PROVENANCE`)——
68
68
  * 一个会话被判为已暴露之后,它的记忆写是**带标收录**(`carry`)还是**整体隔离**(`off`)。
69
69
  *
70
70
  * 🔴 `null` = **本部署没设这个键** ⇒ 引擎按它自己的缺省跑。**不是**「等于 carry」——
@@ -75,7 +75,7 @@ export interface MemoryPosture {
75
75
  */
76
76
  provenance: "off" | "carry" | null;
77
77
  /**
78
- * design/383 §3.1(core 7.0.0 片3,S-49 S-1b):本部署的 **capture 姿态**(`MEMORY_CAPTURE_POLICY`)——
78
+ * [ref] §3.1(core 7.0.0 片3,[ref] S-1b):本部署的 **capture 姿态**(`MEMORY_CAPTURE_POLICY`)——
79
79
  * per-principal `allowMemoryOptOut` verdict 被读进的那个框(`open` fail-safe / `governed` fail-closed /
80
80
  * `capture-required` 全拒)。
81
81
  *
@@ -11,7 +11,7 @@ export declare const V2_SCOPE_PREFIXES: readonly string[];
11
11
  * 校验点 fail-loud。
12
12
  */
13
13
  export declare function isV2ScopeKey(key: string): boolean;
14
- /** Resolve the memory scope for a request (design/138 S1 — the file-based memory engine is the only plane).
14
+ /** Resolve the memory scope for a request ([ref] S1 — the file-based memory engine is the only plane).
15
15
  *
16
16
  * SINGLE-USER (REQUIRE_PRINCIPAL !== "true"): ONE shared scope — `config.memoryScope` (default "local"),
17
17
  * regardless of any principal label the caller self-reports (a single-user worker's `anon:*` / ad-hoc
@@ -26,12 +26,12 @@ export declare function isV2ScopeKey(key: string): boolean;
26
26
  * security.ts 把身份轴守住了,但 `formatUserScope`/`formatProjScope` 的段编码(百分号转义)会
27
27
  * **膨胀**——非 ASCII principal 编码后可超列宽,此前落裸 SQL 错。产出处响亮拒,错误可分类。
28
28
  *
29
- * #271 件1:定义**搬去** `plugins/memory-key-guards.ts`(列宽与 store 写口同源单一属主),此处
29
+ * [ref] 件1:定义**搬去** `plugins/memory-key-guards.ts`(列宽与 store 写口同源单一属主),此处
30
30
  * 只再导出——旧 import 路径(本文件)逐字不变,`memoryScopeFor` 的产出处消费点也不变。 */
31
31
  export { MEMORY_SCOPE_COLUMN_CHARS, assertMemoryScopeWidth } from "./plugins/memory-key-guards.js";
32
32
  export declare function memoryScopeFor(config: ServiceConfig, principal?: string, projectId?: string): string | undefined;
33
33
  /**
34
- * N0 (通宵测试 2026-07-09,三重坐实 e2b+kata+代码): the file memory engine (core design/138) materializes and
34
+ * N0 (通宵测试 2026-07-09,三重坐实 e2b+kata+代码): the file memory engine (core [ref]) materializes and
35
35
  * harvests via `node:fs` on the WORKER's local fs, while a remote exec lane routes the model's file tools to
36
36
  * the SANDBOX fs — the planes never meet: materialized memory is invisible inside the sandbox (the injected
37
37
  * instructions burn failing Write turns) and sandbox writes are never harvested (add=0). Until core defines
@@ -67,7 +67,7 @@ engineWired: boolean): {
67
67
  effect: string;
68
68
  } | undefined;
69
69
  /**
70
- * design/138 S1 wiring gate (pure — unit-testable without booting main): build the file-based memory-engine
70
+ * [ref] S1 wiring gate (pure — unit-testable without booting main): build the file-based memory-engine
71
71
  * backend for this deployment, or `undefined` when memory must stay dark.
72
72
  *
73
73
  * - SINGLE-USER TURNKEY ONLY (`requirePrincipal !== true`): the engine's file basement
@@ -91,13 +91,13 @@ export declare function memoryEngineBackendFor(config: ServiceConfig, fallbackRo
91
91
  /**
92
92
  * MF-30 memory PAUSE (option B, per-request — clay 2026-06-27): build the `TaskSpec.memory` spec for ONE run from
93
93
  * the resolved memory `scope` + the request's `memoryWrite` toggle. `memoryWrite === false` ⇒ `writeScope: null`
94
- * (design/138 engine read-only: normalizeMemorySpec's writeScope:null — materialize/read still works, harvest
94
+ * ([ref] engine read-only: normalizeMemorySpec's writeScope:null — materialize/read still works, harvest
95
95
  * commits nothing). Absent/true ⇒ normal read+write. No scope (engine off / multi-tenant dark) ⇒ undefined
96
96
  * (memory feature off for this run). Pure (testable in isolation) — main.ts's resolveSpec composes it with the
97
97
  * engine-backend presence guard.
98
98
  */
99
99
  export declare function memorySpecForRequest(scope: string | undefined, memoryWrite: boolean | undefined, defaultScopes?: string[],
100
- /** design/170 件A(#148 件3④):origin 盖章的部署形态维(N2)。`multiTenant=true`(requirePrincipal)
100
+ /** [ref] 件A([ref] 件3④):origin 盖章的部署形态维(N2)。`multiTenant=true`(requirePrincipal)
101
101
  * ⇒ 登记簿 defaultScopes 的 org 键按 **request** 盖章(条目由调用方 projectId 选定=caller 可影响的
102
102
  * 选择器,core 准入门据此过目录判决);单用户 ⇒ 一律 deployment(operator 登记簿条目归 deployment,
103
103
  * 否则单用户部署被自家规则整拒——v4 §0 伤害①的成立前提)。缺参=旧调用形,不盖章(整键缺席=
@@ -105,7 +105,7 @@ export declare function memorySpecForRequest(scope: string | undefined, memoryWr
105
105
  originPolicy?: {
106
106
  multiTenant: boolean;
107
107
  },
108
- /** design/383 §2.1(S-49):请求的 `memoryCapture:"off"` 声明 ⇒ `TaskSpec.memory.capture:"off"`(单成员闭集,
108
+ /** [ref] §2.1([ref]):请求的 `memoryCapture:"off"` 声明 ⇒ `TaskSpec.memory.capture:"off"`(单成员闭集,
109
109
  * 拼写门在 prepareSpec 的 400 门 + core 的 `config.memory_capture_spelling`)。缺席 ⇒ 键不铸(缺席就是照常采集
110
110
  * 的唯一形)。与 `memoryWrite` 正交:那是「本 run 只读平面」,这是「本会话永远不进长期记忆」。 */
111
111
  memoryCapture?: "off"): {
@@ -10,7 +10,7 @@
10
10
  * untrusted body/text can pick WHICH configured model but can never inject a baseUrl/apiKey (parseModelMention
11
11
  * only ever returns an allow-listed catalog name).
12
12
  *
13
- * [865]②(生产实锤:面板上选了 A 模型,实际跑的是目录里的另一个):
13
+ * [ref]②(生产实锤:面板上选了 A 模型,实际跑的是目录里的另一个):
14
14
  * - explicit ref 走 name+id 双键索引({@link matchCatalogModel})——壳 boot 回读的 mainLoopModel 是 **id 形**,
15
15
  * 目录键是 **name 形**,单键索引把 id 形请求当「未知」静默落 default = session 中途静默换模型(最恶性的
16
16
  * 上下文污染路径)。
@@ -29,7 +29,7 @@ export declare function resolveTaskModel(bodyModel: unknown, objective: string,
29
29
  unknownExplicit?: string;
30
30
  notAllowed?: ModelNotAllowed;
31
31
  };
32
- /** #233 判别式拒因:名单在场且这次**用户选择**落在名单外。`resolved` 已是目录 name 形(归一后)。 */
32
+ /** [ref] 判别式拒因:名单在场且这次**用户选择**落在名单外。`resolved` 已是目录 name 形(归一后)。 */
33
33
  export interface ModelNotAllowed {
34
34
  /** 调用方发来的原始 ref(name / 档位词 / 别名 / id / `@name`),已做过日志安全的 repr 归一。 */
35
35
  requested: string;
@@ -39,7 +39,7 @@ export interface ModelNotAllowed {
39
39
  source: "explicit" | "mention";
40
40
  }
41
41
  /**
42
- * #233 / A-002.8 —— **归一条款**:membership 判定前把 ref 归一到**终端 catalog 条目**再比。
42
+ * [ref] / [ref] —— **归一条款**:membership 判定前把 ref 归一到**终端 catalog 条目**再比。
43
43
  *
44
44
  * 为什么不能拿字符串直接跟名单比:`expandTiers` 的增广目录里,档位词(`pro`)与 CC 别名(`sonnet`)
45
45
  * 的值与 `config.models[<name>]` 是**同一个对象引用**——裸串比较会让 `@pro` 跳过一张按 name 写的名单
@@ -62,7 +62,7 @@ export interface ModelNotAllowed {
62
62
  */
63
63
  export declare function isModelAllowlisted(ref: string, catalog: Record<string, unknown>, allowlist: readonly string[] | undefined): boolean;
64
64
  /**
65
- * #233 —— ref → **终端 catalog name**(拒因/日志的可读形)。
65
+ * [ref] —— ref → **终端 catalog name**(拒因/日志的可读形)。
66
66
  *
67
67
  * 为什么不是 `matchCatalogModel` 的返回值:增广目录里 `pro`/`opus`/`default` 都是**真实存在的键**,
68
68
  * 于是 `matchCatalogModel("pro")` 回的就是 `"pro"` —— 那是用户点的那个别名,不是他真会跑的模型。
@@ -71,7 +71,7 @@ export declare function isModelAllowlisted(ref: string, catalog: Record<string,
71
71
  */
72
72
  export declare function terminalCatalogName(ref: string, catalog: Record<string, unknown>): string | undefined;
73
73
  /**
74
- * [865]② name+id 双键目录索引:返回 ref 命中的目录 **name 键**(spec.model 的规范形),未知 → undefined。
74
+ * [ref]② name+id 双键目录索引:返回 ref 命中的目录 **name 键**(spec.model 的规范形),未知 → undefined。
75
75
  * - name 命中用 Object.hasOwn(🔴 不用真值索引:Object.prototype 继承键 "constructor"/"__proto__" 等在裸
76
76
  * 索引下是真值,会跳过 allow-list——沿袭原实现的纪律)。
77
77
  * - id 命中扫目录值(`Model.id`),跳过 "default" 别名键(它与其指向的真身共享 id,解析到别名会让 /model
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Per-principal CUMULATIVE cost quota (design/21/27 follow-up). The per-task `maxCostUsd` gate caps a
2
+ * Per-principal CUMULATIVE cost quota ([ref]/27 follow-up). The per-task `maxCostUsd` gate caps a
3
3
  * SINGLE task; this caps a principal's spend ACROSS tasks within a rolling fixed window. Spend is the
4
4
  * authoritative integer `costMicroUsd` accumulated by the tracer (so it includes council/team
5
5
  * sub-tasks, via the principal ALS context). A new task is REFUSED once the window's accumulated cost
@@ -19,8 +19,8 @@ export interface QuotaDecision {
19
19
  }
20
20
  /** The hot-path surface shared by the in-memory {@link CostQuota} (single replica) and the cross-replica
21
21
  * {@link import("../plugins/tidb-cost-quota.js").TiDBCostQuota}. `key` is opaque (principal today;
22
- * principal/team/feature later — design/30 N3), so both stores are key-based. */
23
- /** #322 批1:配额的**值换代**入参(四实现类同一形;单位与构造参数一致 —— USD/秒 → micro/ms 的换算
22
+ * principal/team/feature later — [ref] N3), so both stores are key-based. */
23
+ /** [ref] 批1:配额的**值换代**入参(四实现类同一形;单位与构造参数一致 —— USD/秒 → micro/ms 的换算
24
24
  * 只有一处,`boot/limit-sync.ts` 的 `buildQuotaBounds`)。`limitMicroUsd <= 0` = **关断哨兵**。 */
25
25
  export interface QuotaLimits {
26
26
  limitMicroUsd: number;
@@ -29,20 +29,20 @@ export interface QuotaLimits {
29
29
  export interface QuotaTracker {
30
30
  check(key: string): QuotaDecision;
31
31
  add(key: string, micro: number): void;
32
- /** #322:值换代座位。**接口级**声明——新实现漏掉它 = 编译红,而不是热更新在那条腿上静默失效。 */
32
+ /** [ref]:值换代座位。**接口级**声明——新实现漏掉它 = 编译红,而不是热更新在那条腿上静默失效。 */
33
33
  setLimits(next: QuotaLimits): void;
34
34
  }
35
35
  export declare class CostQuota implements QuotaTracker {
36
36
  private readonly now;
37
37
  private windows;
38
- /** 🔴 不再 `readonly`:限额/窗长是比较参数,换代只动它们,窗内已累计的花费一个不动(design/322 §5)。 */
38
+ /** 🔴 不再 `readonly`:限额/窗长是比较参数,换代只动它们,窗内已累计的花费一个不动([ref] §5)。 */
39
39
  private limitMicroUsd;
40
40
  private windowMs;
41
41
  /** @param limitMicroUsd ceiling per window (integer micro-USD; `<=0` = OFF sentinel). @param windowMs rolling window. */
42
42
  constructor(limitMicroUsd: number, windowMs: number, now?: () => number);
43
43
  /**
44
44
  * 值换代。两件事**语义不同**,别混:
45
- * · **限额**换代 = 纯比较参数 ⇒ 窗内已累计的花费一个不动(design/322 §5 定案:调小当场更严)。
45
+ * · **限额**换代 = 纯比较参数 ⇒ 窗内已累计的花费一个不动([ref] §5 定案:调小当场更严)。
46
46
  * · **窗长**换代 = 换**记账周期** ⇒ 当代累计重开。
47
47
  *
48
48
  * 🔴 后者是 codex R1-F4(真 finding,红先):SQL 腿的窗长是**桶键的一部分**(`floor(now/windowMs)`),
@@ -1,8 +1,8 @@
1
1
  /**
2
- * design/80 b (item 3) — the INFRA cost axes the SERVICE owns, composed with core's LLM-family `costBreakdown`
2
+ * [ref] b (item 3) — the INFRA cost axes the SERVICE owns, composed with core's LLM-family `costBreakdown`
3
3
  * for the supervisor cost surface.
4
4
  *
5
- * (design/158 N24: moved here from the single-file `src/finance/` directory — lens4 §4.4 flagged the "cost"
5
+ * ([ref] N24: moved here from the single-file `src/finance/` directory — lens4 §4.4 flagged the "cost"
6
6
  * concept as split across `finance/cost-taxonomy.ts` + `observability/cost-quota.ts` + `budget.ts`. Chose
7
7
  * "dissolve finance/, fold into observability/" over "collect all three into finance/": this module + the
8
8
  * quota tracker are both cost REPORT/GUARD layers that feed metrics/decisions (observability's existing
@@ -81,10 +81,6 @@ export declare const FAIL_OPEN_TAGS: {
81
81
  readonly cls: "P-DEBT";
82
82
  readonly note: "跨副本赎回 parked 审批时,祖先层在 park 时是 **auto-mode 武装**的,但那只分类器是祖先任务上的活闭包(绑着它自己的转写窗+brain),跨进程重建不出来 ⇒ 本仓交一只如实拒答的 decider,core 收到 `unavailable` 后**不产生任何自动裁决**、原样落到祖先冻结审批席那条链(本腿的席位又是无 ALS 的降级形 ⇒ 再 park 给人)。方向:分类器本会 allow 的改成问人(更严),本会 block 的也改成问人(**不是自动放行**,但比自动拒松一档)⇒ 记债不当合法兜底。计数 = 「丢了祖先分类器判决的继承 ask」次数。收口件二选一:core 把分类器判据持久进链条目,或让祖先 decider 有可跨进程重建的形。";
83
83
  };
84
- readonly "server.hitl.row-derived-approve-drops-updated-input": {
85
- readonly cls: "P-DEBT";
86
- readonly note: "A-054.15:一条**持久 ask 行**上的 `DECIDED=approve` 被回放成裸 `true` 交给 core —— 而人当时可能是带 **ctrl+g 编辑**批的(`updatedInput`)。持久层没有该列(`AskRow`/`DecideAskInput` 皆无),行读不出「这次批准是否改写过实参」,于是 core 的 `d.updatedInput === undefined` 分支落回**原始未改写**实参执行:人批的是改写后的命令,真跑的是原命令 —— 一次**执行面宽于人所批准**的扩权,方向错的一侧,故记债不当合法兜底。四个同形站点全部计在本 tag 下(只在真把 `true` 交出去时计,不在读到行时计):`replayTerminalAskRow` 的三个消费点(`ensureAsk` 幂等回放 / `convergeFromDurableState` / 店报错臂的 `readDecidedForRecovery`)与 `runs.ts` 的 `syncLiveFromDecidedRow`(settled>0 才算)。⚠️ 计数是**上限**不是实数:分不出这次 approve 原本带没带编辑(能分出来就不用记债了),真丢的是其中带编辑的那一部分。补偿:回体在这条路上**省略** `updatedInputForwarded`(从不发 false = 成文的否定信号)。终局收口 = 给 ask 行加 `updated_input` 列(店语义级,须本模块属主立件),届时本 tag 同批销。";
87
- };
88
84
  readonly "server.e2b.orphan-skip-unknown": {
89
85
  readonly cls: "F";
90
86
  readonly note: "#242 E2B 孤儿回收对一只沙盒**判不了属主/活性**(metadata 缺 taskId 的病态形 / run 行状态词在 LIVE 与 TERMINAL 两表之外 / getRun 抛错)⇒ 恒不杀,本轮跳过。方向纪律:回收是清理型能力,缺席判据=不动作——误杀是杀活任务的手,漏杀只是钱;但每次跳过必须计数,否则「回收在跑却总有几只杀不掉」的病灶(店故障/新状态词未收编/别家部署共用 key)永不显形。";
@@ -163,7 +159,7 @@ export type FailOpenTag = keyof typeof FAIL_OPEN_TAGS;
163
159
  * 断连会让保护型计数涨两次(open 一次、complete 又一次),真正的 open 失败率被面包屑的假阳性盖住。
164
160
  * 只有 open 帧是"人在环这道门被跳过"的证据,其余都是体验损失。
165
161
  *
166
- * ⚠️ **两条 question 臂在生产上已不可达**(#173 之后,2026-08-07):本函数唯一的生产调用点是
162
+ * ⚠️ **两条 question 臂在生产上已不可达**([ref] 之后,2026-08-07):本函数唯一的生产调用点是
167
163
  * `routes/tasks.ts` 的 `emitAsk` 断流臂,而 question 与 question_complete 两型帧都先过同文件
168
164
  * `emitQuestion` 的断流守卫(两道守卫同步相邻、其间无 await)并在断流时 throw,永不抵达这里;另一条
169
165
  * question 路(`runs.ts` 的 durable append)根本不经 emitAsk。在产的只剩 elicitation 族与 default。
@@ -72,10 +72,6 @@ export const FAIL_OPEN_TAGS = {
72
72
  cls: "P-DEBT",
73
73
  note: "跨副本赎回 parked 审批时,祖先层在 park 时是 **auto-mode 武装**的,但那只分类器是祖先任务上的活闭包(绑着它自己的转写窗+brain),跨进程重建不出来 ⇒ 本仓交一只如实拒答的 decider,core 收到 `unavailable` 后**不产生任何自动裁决**、原样落到祖先冻结审批席那条链(本腿的席位又是无 ALS 的降级形 ⇒ 再 park 给人)。方向:分类器本会 allow 的改成问人(更严),本会 block 的也改成问人(**不是自动放行**,但比自动拒松一档)⇒ 记债不当合法兜底。计数 = 「丢了祖先分类器判决的继承 ask」次数。收口件二选一:core 把分类器判据持久进链条目,或让祖先 decider 有可跨进程重建的形。",
74
74
  },
75
- "server.hitl.row-derived-approve-drops-updated-input": {
76
- cls: "P-DEBT",
77
- note: "A-054.15:一条**持久 ask 行**上的 `DECIDED=approve` 被回放成裸 `true` 交给 core —— 而人当时可能是带 **ctrl+g 编辑**批的(`updatedInput`)。持久层没有该列(`AskRow`/`DecideAskInput` 皆无),行读不出「这次批准是否改写过实参」,于是 core 的 `d.updatedInput === undefined` 分支落回**原始未改写**实参执行:人批的是改写后的命令,真跑的是原命令 —— 一次**执行面宽于人所批准**的扩权,方向错的一侧,故记债不当合法兜底。四个同形站点全部计在本 tag 下(只在真把 `true` 交出去时计,不在读到行时计):`replayTerminalAskRow` 的三个消费点(`ensureAsk` 幂等回放 / `convergeFromDurableState` / 店报错臂的 `readDecidedForRecovery`)与 `runs.ts` 的 `syncLiveFromDecidedRow`(settled>0 才算)。⚠️ 计数是**上限**不是实数:分不出这次 approve 原本带没带编辑(能分出来就不用记债了),真丢的是其中带编辑的那一部分。补偿:回体在这条路上**省略** `updatedInputForwarded`(从不发 false = 成文的否定信号)。终局收口 = 给 ask 行加 `updated_input` 列(店语义级,须本模块属主立件),届时本 tag 同批销。",
78
- },
79
75
  "server.e2b.orphan-skip-unknown": {
80
76
  cls: "F",
81
77
  note: "#242 E2B 孤儿回收对一只沙盒**判不了属主/活性**(metadata 缺 taskId 的病态形 / run 行状态词在 LIVE 与 TERMINAL 两表之外 / getRun 抛错)⇒ 恒不杀,本轮跳过。方向纪律:回收是清理型能力,缺席判据=不动作——误杀是杀活任务的手,漏杀只是钱;但每次跳过必须计数,否则「回收在跑却总有几只杀不掉」的病灶(店故障/新状态词未收编/别家部署共用 key)永不显形。",
@@ -18,7 +18,7 @@ export declare class Metrics {
18
18
  setGauge(name: string, value: number, labels?: Labels): void;
19
19
  addGauge(name: string, delta: number, labels?: Labels): void;
20
20
  observe(name: string, value: number, labels?: Labels): void;
21
- /** [2557] 2-j:dynamic gauge 求值抛错不再折成 0 —— 0 是该 gauge 的合法读数,折 0 让故障态与真实 0
21
+ /** [ref] 2-j:dynamic gauge 求值抛错不再折成 0 —— 0 是该 gauge 的合法读数,折 0 让故障态与真实 0
22
22
  * 在 wire 上逐字节不可区分(与上方 inc 静默 no-op 同族:观测面的 fail-silent 正是观测要消灭的东西)。
23
23
  * 披露方向:错帧**不发样本行**(缺席=读数未知,面板显示 no data 而非假 0)+ 计
24
24
  * `metric_gauge_eval_errors_total{name}`(响亮、可告警)。每次求值(每次刮取/snapshot)错一次计一次;
@@ -1,4 +1,4 @@
1
- /** The whitelisted projection of core's `prompt.assembled` trace event ([998]② web observability slice A:
1
+ /** The whitelisted projection of core's `prompt.assembled` trace event ([ref]② web observability slice A:
2
2
  * the manifest reaches the durable run event log + turns/stream). Built FIELD-BY-FIELD at record time
3
3
  * (never a spread — the 1.72 task_progress lesson: a future core field must not ride the durable wire raw).
4
4
  * Carries ONLY ids/digests/counts by core's manifest contract (no prompt bodies; hashes are core-salted) —
@@ -10,7 +10,7 @@ export interface PromptManifestRecord {
10
10
  chars: number;
11
11
  hash: string;
12
12
  }>;
13
- /** `contentHash`(core 1.315 [1062]①):operator 声明 section 的**非盐化**对账锚(core 已对 text 校验
13
+ /** `contentHash`(core 1.315 [ref]①):operator 声明 section 的**非盐化**对账锚(core 已对 text 校验
14
14
  * 后透传)——盐化 `hash` 恒在旁;端到端对账链(center 发布→manifest)经本投影,必须透传不可吞。 */
15
15
  sections?: Array<{
16
16
  id: string;
@@ -31,7 +31,7 @@ export interface PromptManifestRecord {
31
31
  shapeDigest: string;
32
32
  wireSchemaDigest: string;
33
33
  }>;
34
- /** core 5.15.0(#181):deferred 披露策略自证三键(诊断值,零内容)。缺席=core <5.15 或无 deferred。 */
34
+ /** core 5.15.0([ref]):deferred 披露策略自证三键(诊断值,零内容)。缺席=core <5.15 或无 deferred。 */
35
35
  toolDisclosure?: {
36
36
  deferredTools: number;
37
37
  strategy: string;
@@ -67,7 +67,7 @@ export declare function promptManifestRecordOf(e: {
67
67
  shapeDigest: string;
68
68
  wireSchemaDigest: string;
69
69
  }>;
70
- /** core 5.15.0(#181,[2872] 提货②):deferred 工具的披露策略自证——{deferredTools(数), strategy
70
+ /** core 5.15.0([ref],[ref] 提货②):deferred 工具的披露策略自证——{deferredTools(数), strategy
71
71
  * ("static"|"swap"), source(四值:`spec` / `env` / `default` / `degraded_no_direct_lane`)}。
72
72
  * 诊断三键(数 + 两闭集词,零内容)。词表属主是 core(`core/trace.d.ts` 的 `source` 联合),本仓宽收
73
73
  * ⇒ 词错不会红,所以照抄时务必对表:`degraded_no_direct_lane` = 直呼车道联锁把 `static` 请求收窄成
@@ -81,7 +81,7 @@ export declare function promptManifestRecordOf(e: {
81
81
  totalChars: number;
82
82
  }): PromptManifestRecord;
83
83
  /**
84
- * [998]② per-task prompt-manifest accumulator — the `ModelUsageTracker`(budget.ts)pattern: the
84
+ * [ref]② per-task prompt-manifest accumulator — the `ModelUsageTracker`(budget.ts)pattern: the
85
85
  * `prompt.assembled` tracer hook is SYNC/no-IO, so it cannot persist; it RECORDS here (registered
86
86
  * top-level runs only — the same leak fence: sub-task manifests are never registered, never leak), and
87
87
  * the durable run lifecycle DRAINS the pending records into `prompt_assembled` events. Two departures
@@ -95,7 +95,7 @@ export declare function promptManifestRecordOf(e: {
95
95
  * delete the NEW leg's registration/pending manifest. Identity-guarded like the sibling
96
96
  * inflight/steerable teardowns.
97
97
  */
98
- /** [1301]③ — `config.assembled` 的白名单投影(core 1.346 trace:catalogVersion/fields[来源标注]/
98
+ /** [ref]③ — `config.assembled` 的白名单投影(core 1.346 trace:catalogVersion/fields[来源标注]/
99
99
  * overrideReasons)。fields 已是 core 精选的观测形(digest-free、有界);32KiB 罩防未来膨胀。 */
100
100
  export declare function configAssembledRecordOf(e: {
101
101
  catalogVersion?: unknown;
@@ -105,7 +105,7 @@ export declare function configAssembledRecordOf(e: {
105
105
  }): Record<string, unknown> | undefined;
106
106
  export declare class PromptManifestTracker {
107
107
  private readonly byTask;
108
- /** [1301]③:config.assembled 的同生命周期伴随记录(register 同门、drainConfig 同拍)。队列形
108
+ /** [ref]③:config.assembled 的同生命周期伴随记录(register 同门、drainConfig 同拍)。队列形
109
109
  * (codex F2):cascade 每 rung 独立解析配置,后到覆盖会把先前已计费 rung 的生效配置抹掉——与
110
110
  * prompt manifests 同姿势逐条保序。 */
111
111
  private readonly configByTask;
@@ -116,7 +116,7 @@ export declare class PromptManifestTracker {
116
116
  register(taskId: string): number;
117
117
  /** Queue this prepare's manifest — ONLY for a registered top-level run (else a no-op). Sync, never throws. */
118
118
  record(taskId: string, m: PromptManifestRecord): void;
119
- /** [1301]③:队一条 config.assembled 投影(同 register 门;逐条保序——cascade 每 rung 各留其形)。 */
119
+ /** [ref]③:队一条 config.assembled 投影(同 register 门;逐条保序——cascade 每 rung 各留其形)。 */
120
120
  recordConfig(taskId: string, rec: Record<string, unknown>): void;
121
121
  /** Return-and-clear ALL pending config records in emission order; `undefined` when none. */
122
122
  drainConfig(taskId: string): Array<Record<string, unknown>> | undefined;
@@ -10,7 +10,7 @@ export interface RateDecision {
10
10
  retryAfterSec: number;
11
11
  remaining: number;
12
12
  }
13
- /** #322 批1:限额的**值换代**入参(六实现类同一形)。语义定案(design/322 §5):窗口内计数**不清零**,
13
+ /** [ref] 批1:限额的**值换代**入参(六实现类同一形)。语义定案([ref] §5):窗口内计数**不清零**,
14
14
  * 新限额即时用于比较 —— 调小 = 窗内立刻更严(可能当场 429,符合运营意图),调大 = 立刻放宽。 */
15
15
  export interface RateLimits {
16
16
  /** 每窗请求上限;`<= 0` = **关断哨兵**(恒放行、不记账、SQL 腿不起刷新环)。 */
@@ -21,7 +21,7 @@ export interface RateLimits {
21
21
  export interface RateGate {
22
22
  check(key: string): RateDecision;
23
23
  sweep(now?: number): void;
24
- /** #322:值换代座位。**接口级**声明(不是各类自选):新实现漏掉它 = 编译红,而不是热更新在那条腿上静默失效。 */
24
+ /** [ref]:值换代座位。**接口级**声明(不是各类自选):新实现漏掉它 = 编译红,而不是热更新在那条腿上静默失效。 */
25
25
  setLimits(next: RateLimits): void;
26
26
  }
27
27
  export declare class RateLimiter implements RateGate {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * A-033.3(#256)—— **密钥形 env 剥除的留痕面**(core D1 `scrubSecretEnv` 的可观测半场)。
2
+ * [ref]([ref])—— **密钥形 env 剥除的留痕面**(core D1 `scrubSecretEnv` 的可观测半场)。
3
3
  *
4
4
  * ## 它解决的问题
5
5
  * `scrubSecretEnv` 是本仓两条 shell/子进程腿的**安全默认**:模型可驱动的 shell(`inheritEnv:"scrub"`)与
@@ -16,7 +16,7 @@ export declare function isKnownDenySource(v: unknown): v is PermissionDeniedSour
16
16
  */
17
17
  export declare function createPermissionDeniedMeter(metrics: Pick<Metrics, "inc">): Hooks;
18
18
  /**
19
- * prove-before-scale stopgap (design/50): a no-op observer hook that logs every tool call (pre + post)
19
+ * prove-before-scale stopgap ([ref]): a no-op observer hook that logs every tool call (pre + post)
20
20
  * to the worker log — INCLUDING resumed legs that `GET /v1/runs/:id/events` does NOT surface (the
21
21
  * streaming-resume observability gap, service[15] API request #2). Gated by `TOOL_TRACE=true`; OFF by
22
22
  * default (no prod noise).
@@ -40,7 +40,7 @@ import { type WorkflowScriptRunner, type WorkflowPrimitives } from "@sema-agent/
40
40
  * timer nor the abort listener fires → it hangs the process. The worker-isolated runner (`terminate()`)
41
41
  * pre-empts that — use it for genuinely-untrusted multi-tenant scripts where resource isolation matters.
42
42
  *
43
- * 🔴 Silent-hang class ([1818]§二, clay live incident 2026-07-26): a script whose promise graph can NEVER settle
43
+ * 🔴 Silent-hang class ([ref]§二, clay live incident 2026-07-26): a script whose promise graph can NEVER settle
44
44
  * (an un-awaited `phase(...)` whose body returns its own promise) used to burn the full totalTimeoutMs blind
45
45
  * and then blame the timeout. The quiescence detector in {@link runHardened} fail-fasts it with a diagnosis:
46
46
  * inside the membrane the bridge is the ONLY async host seam, so bridge-quiescent + both queues drained +
@@ -62,20 +62,20 @@ export interface HardenedVmLimits {
62
62
  * A script exceeding it OOMs the WORKER (killed), never the shared main process. Default 128. */
63
63
  maxHeapMb?: number;
64
64
  }
65
- /** [5434]①(clay 亲机四 run 三次恰在 600s 整点全灭):workflow 总超时默认与旋钮的**单点**。
65
+ /** [ref]①(clay 亲机四 run 三次恰在 600s 整点全灭):workflow 总超时默认与旋钮的**单点**。
66
66
  * 旧默认 600_000(10 分钟)对真实 workflow(验证 agent 逐条重跑清单/任何带审批等待的车)结构性不够——
67
67
  * 默认抬到 **1 小时**;部署经 `WORKFLOW_TOTAL_TIMEOUT_MS` 显式配,域 [60_000, 86_400_000](1 分钟..24h),
68
- * 坏值**响亮拒**(#210 立律:旋钮坏值禁静默回默认)。0/负数不是「禁用」:无界 runaway 脚本会吞掉共享
68
+ * 坏值**响亮拒**([ref] 立律:旋钮坏值禁静默回默认)。0/负数不是「禁用」:无界 runaway 脚本会吞掉共享
69
69
  * 副本的事件循环/堆,禁用臂刻意不提供——要更久就把值配大。模块加载时读一次(坏 env = boot fail-loud)。
70
- * 超时终态分型(partial vs failed,[5434]① 后半)涉 wire status 语义,与 core workflow 终态形另批对表。 */
70
+ * 超时终态分型(partial vs failed,[ref]① 后半)涉 wire status 语义,与 core workflow 终态形另批对表。 */
71
71
  export declare function workflowTotalTimeoutMsDefault(): number;
72
72
  /**
73
73
  * The realm test itself, exported so there is exactly ONE ruler for "did this rejection come from an untrusted
74
74
  * script?" in the process. A promise minted INSIDE a vm context fails `instanceof` against the HOST `Promise`
75
75
  * (different intrinsic per realm) — that is the whole judgement.
76
76
  *
77
- * 🔴 Why it is exported (A-070 二轮重扫, lifecycle-pairing, double-opus CONFIRMED): the guard below is NOT the
78
- * only `unhandledRejection` listener in a real boot. `src/boot/shutdown.ts` installs one at boot (#320① crash
77
+ * 🔴 Why it is exported ([ref] 二轮重扫, lifecycle-pairing, double-opus CONFIRMED): the guard below is NOT the
78
+ * only `unhandledRejection` listener in a real boot. `src/boot/shutdown.ts` installs one at boot ([ref]① crash
79
79
  * last words) that exits(1); Node walks EVERY listener for the event, so containment cannot be expressed by
80
80
  * one listener returning early — whoever exits wins regardless of registration order. The containment DECISION
81
81
  * therefore lives in the boot handler, and it must use this same ruler rather than minting a second one.
@@ -1,7 +1,7 @@
1
1
  import { type WorkflowScriptRunner } from "@sema-agent/core";
2
2
  import { type HardenedVmLimits } from "./hardened-vm-runner.js";
3
3
  /**
4
- * Worker-isolated S8 hard runner (design/98 v2). Runs the hardened-vm membrane inside a `worker_thread`, adding
4
+ * Worker-isolated S8 hard runner ([ref] v2). Runs the hardened-vm membrane inside a `worker_thread`, adding
5
5
  * RESOURCE isolation on top of the in-process {@link import("./hardened-vm-runner.js").createHardenedVmRunner}'s
6
6
  * BOUNDARY isolation:
7
7
  * - HEAP cap (`resourceLimits.maxOldGenerationSizeMb`): a runaway-allocation script OOMs the WORKER (an `error`
@@ -1,6 +1,6 @@
1
1
  import type { SubagentSteerHandle } from "@sema-agent/core";
2
2
  /**
3
- * C2 (core 1.219) + design/122 (core 1.225) — the SERVICE-side registry for
3
+ * C2 (core 1.219) + [ref] (core 1.225) — the SERVICE-side registry for
4
4
  * STEERING and RESUMING a Task SUB-AGENT (a sync delegation spawned by the `Agent` tool), the sibling of
5
5
  * {@link import("./workflow-agent-steer.js").WorkflowAgentRegistry} for workflow agents.
6
6
  *
@@ -10,7 +10,7 @@ import type { SubagentSteerHandle } from "@sema-agent/core";
10
10
  * Delivery is replica-local (the handle is an in-memory bridge, like `steerableRuns`); a cross-replica
11
11
  * steer/resume is an honest 409, never a silent drop.
12
12
  *
13
- * 🔴 LIFECYCLE (design/122 item ③ — the "不改必踩" change): handles are NO LONGER evicted on child settle.
13
+ * 🔴 LIFECYCLE ([ref] item ③ — the "不改必踩" change): handles are NO LONGER evicted on child settle.
14
14
  * `resume` is only legal AFTER the child settled (core rejects `steering.still_running` before), so a
15
15
  * settle-evicted registry would make resume structurally unreachable. Instead:
16
16
  * - one handle PER parentToolCallId, NEWEST WINS (core D2: each resume re-emits a FRESH handle under the
@@ -41,7 +41,7 @@ export declare class SubagentSteerRegistry {
41
41
  /** Register a child handle under its parent run. SAME parentToolCallId replaces (core D2: a resume
42
42
  * re-emits a fresh handle for the revived run — newest wins). Returns an IDENTITY-GUARDED unregister
43
43
  * thunk: it removes the entry only while it still holds THIS handle (a fresh sibling-leg registration
44
- * under the same id survives the old leg's teardown). Call it at LEG END, not on settle (design/122 ③). */
44
+ * under the same id survives the old leg's teardown). Call it at LEG END, not on settle ([ref] ③). */
45
45
  register(runId: string, handle: SubagentSteerHandle): () => void;
46
46
  /** Resolve `runId` + `target` to its handle on this replica. Exact `parentToolCallId` match wins (unique —
47
47
  * newest-per-id by construction → count is 0|1); otherwise match by `agentName` (count may be >1 →
@@ -34,7 +34,7 @@ export declare class WorkflowAgentRegistry {
34
34
  * · **「被截断过」仍有信号**:超界时正文段尾出现 `…`(未超界时不出现)⇒ 消费方能判断"这不是全文";
35
35
  * · **「截了多少」不再披露**:`[+N chars]` 在**所有**档位都没有了(实测 +1 / +10 / +100 / +5000 / +50000
36
36
  * 全部无披露,输出长度恒 4103)。所以一个超出 5 万字符的输入与只超 1 个字符的输入,**外观完全相同**。
37
- * ⚠️ core [1707]⑤ 的措辞是「**刚过界**的输入现在是裸 `…` 结尾」,而实测是**全档位**都没有披露 —— 范围比
37
+ * ⚠️ core [ref]⑤ 的措辞是「**刚过界**的输入现在是裸 `…` 结尾」,而实测是**全档位**都没有披露 —— 范围比
38
38
  * 它描述的宽。已带实测数据上黑板问 core 这是否是有意的(可能只是描述省略,也可能是它没注意到)。
39
39
  * 在得到答复前**不改行为**:core 的截断器是它那侧的安全件,server 不该自己在外面补一层"+N chars"去顶
40
40
  * ——那会变成两处各说一套。 */
@@ -69,7 +69,7 @@ export declare const PURGE_FENCE_MS: number;
69
69
  * to swallow any realistic notify lag incl. a boot-recovery re-fire racing a fresh poll; per-runId scoped, so
70
70
  * it can never starve a DIFFERENT workflow's push. In-memory only (see {@link PURGE_FENCE_MS} rationale). */
71
71
  export declare const SERVED_FENCE_MS: number;
72
- /** design/144 §4 server 折叠键:`JSON([域, taskId, RAW status])[#seq]`。域=external 帧独立 lane(task_id 是
72
+ /** [ref] §4 server 折叠键:`JSON([域, taskId, RAW status])[#seq]`。域=external 帧独立 lane(task_id 是
73
73
  * 调用方自由串,不分域可预占内部帧键把真实子代 settle 帧吞掉)/其余内部帧统一 "task" 域。
74
74
  *
75
75
  * 三路复审修1(MED):status 保留 RAW,不再归一 completed/failed —— 归一让同 id 无 seq 的两条 external
@@ -91,15 +91,15 @@ export declare function taskNotificationFoldKey(n: {
91
91
  status: string;
92
92
  seq?: number;
93
93
  }): string;
94
- /** design/144 stream 侧去重键(core [784]④a + codex 1.189 前双审 F2)= `域:taskId:status[#seq]`。
94
+ /** [ref] stream 侧去重键(core [ref]④a + codex 1.189 前双审 F2)= `域:taskId:status[#seq]`。
95
95
  * 与 {@link taskNotificationFoldKey} 同族,域二分也一致(codex F2 HIGH:external 通知的 task_id 是
96
96
  * POST /v1/sessions/:id/notify 调用方自由串——同一条腿上,drain 出的 external 帧可与内部任务帧同形
97
97
  * `task_id:status:seq` 撞键互吞,per-leg 键集并不豁免这个面,旧注释「没有跨调用方预占面」判错);
98
98
  * 仍与 fold key 有意不同的一点:status 保留 RAW(killed/cancelled/event 不归一 failed)——归一会让同
99
99
  * task 的 Monitor event 批与 failed 终态在一条腿上互吞;wire 去重要的是逐帧身份,不是 inbox 的双终态列。
100
100
  * `seq` 折入 = 停→唤→停的第二周期同 status 帧各自成键(core 1.283 起 background_agent 四腿 notify 铸
101
- * cycleSeq;缺 seq 时旧键曾把二周期 completed 帧在 observer 臂反向吞掉——core [784]④a);无 seq 的帧
102
- * (bash/monitor terminal/retain 降级)保持单周期旧键=同键第二帧吞,诚实语义。[2373]B-10:core 4.0.0 起
101
+ * cycleSeq;缺 seq 时旧键曾把二周期 completed 帧在 observer 臂反向吞掉——core [ref]④a);无 seq 的帧
102
+ * (bash/monitor terminal/retain 降级)保持单周期旧键=同键第二帧吞,诚实语义。[ref]B-10:core 4.0.0 起
103
103
  * task_type 是必填闭合枚举——`task_type?` 可选性**不再对应旧 core 帧**,它活着只为家族前缀构造
104
104
  * (server.ts fleet 腿 `taskNotificationFoldKey({task_id,status})` 同款用法);缺席归 "task" 域的语义
105
105
  * 只在前缀用途下生效。external 帧三来源齐备(notify 端点 core 铸 / inbox entry extras 存 / drain 帧
@@ -257,7 +257,7 @@ export declare function taskNotificationInboxEntry(sessionId: string, owner: str
257
257
  edits: number;
258
258
  }>;
259
259
  resumable?: boolean;
260
- /** core 1.353([1412]):诊断槽(journal 坐标+教句,引擎值单源)——park 透传,drain 帧原样带。 */
260
+ /** core 1.353([ref]):诊断槽(journal 坐标+教句,引擎值单源)——park 透传,drain 帧原样带。 */
261
261
  diagnostics?: string;
262
262
  }, enqueuedAt: number,
263
263
  /** lead-b (dual-ID audit): the PARENT run's durable taskId (the uuid the shell's footer rows
@@ -265,7 +265,7 @@ export declare function taskNotificationInboxEntry(sessionId: string, owner: str
265
265
  * parent row without a side lookup. */
266
266
  parentTaskId?: string,
267
267
  /**
268
- * design/373 §3.6(core 5.61.0,#366 / codex R1[high]):core 在 `onTaskNotification` 的**第二参**上报的
268
+ * [ref] §3.6(core 5.61.0,[ref] / codex R1[high]):core 在 `onTaskNotification` 的**第二参**上报的
269
269
  * 投递档位。park 是**跨 run** 的那条投递路径 —— 不带过去,档位就在最常走的一条路上恒缺席。
270
270
  *
271
271
  * 🔴 只在 core **真的给了**档位时传:缺席原样缺席(与 live 投影同一条「缺席≠later」纪律)。
@@ -152,7 +152,7 @@ export declare class WorkflowNotifyGate {
152
152
  *
153
153
  * BOTH abandoned arms (boot-orphan + stale-past-grace) flip the DURABLE row to `failed` FIRST (CAS on rev),
154
154
  * so the run store, the fleet panel and the delivered notify give ONE answer — previously the notify said
155
- * `failed` while `/workflows` kept saying `running` forever ([2999]: republishing without finalizing would
155
+ * `failed` while `/workflows` kept saying `running` forever ([ref]: republishing without finalizing would
156
156
  * have turned "panel empty" into "panel shows a row that never moves"). A lost CAS means the run moved under
157
157
  * the sweep (e.g. its real terminal landed concurrently) — skip this pass; the entry stays pending and the
158
158
  * next sweep handles the NEW state.
@@ -175,14 +175,14 @@ export declare class WorkflowNotifyGate {
175
175
  /** Replica-local (File/in-memory) journal ONLY: a pending entry recorded BEFORE this timestamp belongs to
176
176
  * a previous incarnation of THIS process — workflow executors are in-process, so they died with it and a
177
177
  * still-`running` run is a boot-orphan: finalize it NOW instead of leaving the user's "Waiting for
178
- * workflow" pointed at a run that can never finish for the whole grace window ([2995] 顺带①/[3000]§二).
178
+ * workflow" pointed at a run that can never finish for the whole grace window ([ref] 顺带①/[ref]§二).
179
179
  * NEVER pass this for a cross-replica (SQL) journal — there a pending running run may be genuinely alive
180
180
  * on another replica, and age (`orphanGraceMs`) is the only sound orphan proxy.
181
181
  * ⚠️ This wall-clock cutoff is a NECESSARY, not sufficient, condition — {@link recordedThisIncarnation}
182
182
  * is the authoritative one (a clock rollback after boot would otherwise stamp THIS process's own new
183
183
  * entries below the cutoff and finalize live runs). */
184
184
  finalizeStartedBeforeMs?: number;
185
- /** Retire a fleet row for a run this sweep just finalized ([2995]/[2999]): called ONLY with a TERMINAL run,
185
+ /** Retire a fleet row for a run this sweep just finalized ([ref]/[ref]): called ONLY with a TERMINAL run,
186
186
  * so the {@link JournalingWorkflowRunStore} projection publishes the final frame and then removes the row —
187
187
  * the store, the panel and the notify end up saying the same thing. Never called with a `running` run (see
188
188
  * the single-writer invariant above). Late-bound because the wrapper is constructed after this gate. */
@@ -264,7 +264,7 @@ export declare class InMemoryWorkflowNotifyJournalStore implements WorkflowNotif
264
264
  */
265
265
  export declare class JournalingWorkflowRunStore implements WorkflowRunStore {
266
266
  private readonly inner;
267
- /** [1262] optional since the fleet decoupling: undefined ⇒ no start-time journal (ephemeral memory
267
+ /** [ref] optional since the fleet decoupling: undefined ⇒ no start-time journal (ephemeral memory
268
268
  * backend has nothing to recover), the FLEET half still publishes — the panel is replica-local UI
269
269
  * state and must not be gated on the durable-notify machinery (the regression that emptied clay's
270
270
  * workflow panel on memory-backend deployments). */
@@ -273,7 +273,7 @@ export declare class JournalingWorkflowRunStore implements WorkflowRunStore {
273
273
  * point as the notify journal). Optional — undefined ⇒ no fleet publish. */
274
274
  private readonly fleetBus?;
275
275
  constructor(inner: WorkflowRunStore,
276
- /** [1262] optional since the fleet decoupling: undefined ⇒ no start-time journal (ephemeral memory
276
+ /** [ref] optional since the fleet decoupling: undefined ⇒ no start-time journal (ephemeral memory
277
277
  * backend has nothing to recover), the FLEET half still publishes — the panel is replica-local UI
278
278
  * state and must not be gated on the durable-notify machinery (the regression that emptied clay's
279
279
  * workflow panel on memory-backend deployments). */
@@ -284,7 +284,7 @@ export declare class JournalingWorkflowRunStore implements WorkflowRunStore {
284
284
  /** Derive + publish the MF-Fleet workflow row from a WorkflowRun (doneCount/totalCount from agents, tokens from
285
285
  * stats); a terminal workflow LEAVES the fleet (publish terminal then remove), a running one stays/updates. */
286
286
  private publishFleet;
287
- /** [2995] recovery projection seam: the same fleet projection as the put/update observation points, exposed so
287
+ /** [ref] recovery projection seam: the same fleet projection as the put/update observation points, exposed so
288
288
  * the recovery sweep can RETIRE a row for a run it just finalized (terminal input ⇒ final frame, then remove).
289
289
  * Wire it as `recover`'s `publishTerminalFleetRow` hook — and only ever hand it a TERMINAL run: a `running`
290
290
  * row published from outside the wrapper's own write path has no guaranteed retirement (see the invariant on
@@ -1,5 +1,5 @@
1
1
  /**
2
- * #219(黑板 [3617]):引擎 **parent 监视**。
2
+ * [ref](黑板 [ref]):引擎 **parent 监视**。
3
3
  *
4
4
  * ## 防的是什么
5
5
  *