@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,8 +1,8 @@
1
1
  /**
2
- * v2 MVP M4 — the leader orchestrator (design/50 §3, V2-MVP-PLAN.md). Composes the proven pieces into one
2
+ * v2 MVP M4 — the leader orchestrator ([ref] §3, V2-MVP-PLAN.md). Composes the proven pieces into one
3
3
  * callable API: Planner → fanOut (M1) → diff-out (M2) → merge(b) (M3) → Coordinator push.
4
4
  *
5
- * Worker-env model (design/68 §8 F2(a)): preferred = FACTORY env (runner-owned lifecycle; durable suspend only
5
+ * Worker-env model ([ref] §8 F2(a)): preferred = FACTORY env (runner-owned lifecycle; durable suspend only
6
6
  * yields a complete ownedEnv on this path) + diff-out via the worker's mandatory SELF-UPLOAD last step
7
7
  * (`fetchDiff`, diffup.ts). Compat = the original static env the leader owns: provision up-front, pull each
8
8
  * branch's diff OUT of the still-alive env (pullDiff), destroy every env in a `finally`.
@@ -16,7 +16,7 @@ import { type RunnerLike, type WorkerReport } from "./fanout.js";
16
16
  import { type ExecStreamLike } from "./diffout.js";
17
17
  import { type MergeDeps, type MergeResult } from "./merge.js";
18
18
  import { type TaskSpec, type VerifyConfig, type CheckpointToken, type ToolSpec, type RepairTerminal, type OracleTier, type RepairResult } from "@sema-agent/core";
19
- /** design/74 Slice 6: drive a worker's resource-suspend auto-resume to a terminal (or bound) state. Exported
19
+ /** [ref] Slice 6: drive a worker's resource-suspend auto-resume to a terminal (or bound) state. Exported
20
20
  * for unit tests. Loops `resume(token, slice)` WHILE the result carries a `resource_limit` checkpoint gate —
21
21
  * NOT by status (the verify wrapper may surface a suspend as failed-with-token). Exits on: a terminal result
22
22
  * (completed/failed → no gate), an exhausted budget (core fails the resume fast → no token/gate), a
@@ -44,16 +44,16 @@ export interface ProvisionedWorker {
44
44
  branch: string;
45
45
  /** base commit of THIS worker's env (drives `git format-patch <baseSha>..<branch>` diff-out). */
46
46
  baseSha: string;
47
- /** runs the worker agent on this worker's env (static `executionEnv` or a factory — design/68 F2(a)). */
47
+ /** runs the worker agent on this worker's env (static `executionEnv` or a factory — [ref] F2(a)). */
48
48
  runner: RunnerLike;
49
49
  /** Static-env mode (M2 compat): pull the worker's branch diff OUT of its (post-task, still-alive) env. */
50
50
  diffEnv?: ExecStreamLike;
51
- /** Factory-env mode (design/68 F2(a), preferred when set): fetch the diff the worker SELF-UPLOADED as its
51
+ /** Factory-env mode ([ref] F2(a), preferred when set): fetch the diff the worker SELF-UPLOADED as its
52
52
  * mandatory last task step (presigned MinIO object) — the env is runner-owned and already gone. */
53
53
  fetchDiff?: () => Promise<import("./diffout.js").PullDiffResult>;
54
54
  /** Static-env mode only: the leader owns + destroys the env. Factory envs omit this — the runner's factory
55
55
  * lifecycle destroys them, and a SUSPENDED worker's paused env is thereby exempt from the leader's reap
56
- * (design/68 row4/C4: destroying a suspended worker's env = expiring its resume token). */
56
+ * ([ref] row4/C4: destroying a suspended worker's env = expiring its resume token). */
57
57
  destroy?: () => Promise<void>;
58
58
  spec: Omit<TaskSpec, "sessionId" | "signal">;
59
59
  /** Optional read-effect PROBE tools for the L3 verifier (verifyWorker path). The default verifierTools = the
@@ -71,7 +71,7 @@ export interface LeaderDeps {
71
71
  push: MergeDeps["push"];
72
72
  /** Integration test command (the merge gate) + repo dir inside the sandbox. */
73
73
  testCmd: string;
74
- /** Optional truecorrect MEASURE (design/59): a thorough hidden-oracle command run IN the integration sandbox
74
+ /** Optional truecorrect MEASURE ([ref]): a thorough hidden-oracle command run IN the integration sandbox
75
75
  * after the gate passes (NOT a gate) — offloads the measure from the control plane. Result in result.merge.measure. */
76
76
  measureCmd?: string;
77
77
  repoDir?: string;
@@ -80,7 +80,7 @@ export interface LeaderDeps {
80
80
  /** fan-out deadline + concurrency cap. */
81
81
  timeoutMs: number;
82
82
  maxConcurrency: number;
83
- /** design/52 L3a — optional per-module sub-gate + bounded repair, run AFTER fan-out, BEFORE merge. For each
83
+ /** [ref] L3a — optional per-module sub-gate + bounded repair, run AFTER fan-out, BEFORE merge. For each
84
84
  * completed worker: judge its module (diff) vs its sub-objective; on fail, re-run that ONE worker with the
85
85
  * judge's feedback (bounded by maxRepairs, default 1) on its own still-alive env, then re-judge. A module that
86
86
  * still fails is marked `failed` (merge quarantines it). Catches per-module escapes the end-integration test
@@ -93,12 +93,12 @@ export interface LeaderDeps {
93
93
  repairObjective: (sub: SubtaskSpec, reason: string) => string;
94
94
  maxRepairs?: number;
95
95
  };
96
- /** core 1.72 native L3a (design/54 §4): when set, each worker runs via `runWithVerification` (run the module +
96
+ /** core 1.72 native L3a ([ref] §4): when set, each worker runs via `runWithVerification` (run the module +
97
97
  * an INDEPENDENT DECORRELATED verifier tries to break it reading the diff/workspace + a bounded fix-loop)
98
98
  * instead of plain fan-out. The worker runner's `models` catalog MUST carry the heterogeneous `verifierModel`
99
99
  * (decorrelation = deployment contract). Mutually exclusive with `moduleGate` (this IS the native version). */
100
100
  verifyWorker?: VerifyConfig;
101
- /** Replan-lite (design/68 §6): bounded, DETERMINISTIC reactions — no runtime DAG surgery. When set:
101
+ /** Replan-lite ([ref] §6): bounded, DETERMINISTIC reactions — no runtime DAG surgery. When set:
102
102
  * worker failed → redispatch ×1 on a FRESH env (clean base; a crashed worker's half-written workspace is
103
103
  * never reused) → still failed = collapse-remainder-to-single; verify FAIL (repair already bounded inside
104
104
  * the verify loop) → collapse; structural merge conflict → collapse + record; budgetUsd exceeded → stop
@@ -151,7 +151,7 @@ export interface LeaderResult {
151
151
  route?: "single" | "fanout";
152
152
  /** Set when planning/provisioning failed before fan-out. */
153
153
  error?: string;
154
- /** Replan-lite (design/68 §6): which trigger won arbitration + what was done. */
154
+ /** Replan-lite ([ref] §6): which trigger won arbitration + what was done. */
155
155
  replan?: {
156
156
  trigger: "suspended" | "budget" | "merge-conflict" | "verify-fail" | "worker-failed";
157
157
  redispatched?: string[];
@@ -163,7 +163,7 @@ export interface LeaderResult {
163
163
  workerId: string;
164
164
  sessionId: string;
165
165
  }>;
166
- /** design/74 Slice 6 / task#16: the diff (uncommitted work auto-committed by the belt, then diff-out) of
166
+ /** [ref] Slice 6 / task#16: the diff (uncommitted work auto-committed by the belt, then diff-out) of
167
167
  * workers that did NOT merge (failed / still-suspended). Their progress is otherwise lost — the merge only
168
168
  * integrates COMPLETED workers — so surface it here for review/cherry-pick instead of silently dropping it
169
169
  * (the migration-run loss: a network-failed worker's 4 commits vanished). Best-effort + non-empty only. */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * v2 MVP M3 — merge(b), the hard bone (design/50 §7, V2-MVP-PLAN.md, search [25]/[26], council round-1).
2
+ * v2 MVP M3 — merge(b), the hard bone ([ref] §7, V2-MVP-PLAN.md, search [25]/[26], council round-1).
3
3
  *
4
4
  * The deterministic Coordinator integrates N completed workers' branches under FULL isolation:
5
5
  * 1. pull each worker's patch OUT of its container (M2 `pullDiff` — no creds go in).
@@ -65,7 +65,7 @@ export interface IntegrationRepair {
65
65
  * then VERIFIES no marker/.rej remains before continuing, and the downstream test gate still guards correctness.
66
66
  * Wired by the caller (provisionIntegrationSandbox); when unset, an apply conflict stays terminal exactly as before
67
67
  * (zero behaviour change). Reuses the IntegrationRepair sandbox + hands pattern → no new core/env seam (the seam
68
- * design/68 §8 feared for "adopting N half-done workspaces" is unnecessary for the conflict case).
68
+ * [ref] §8 feared for "adopting N half-done workspaces" is unnecessary for the conflict case).
69
69
  */
70
70
  export interface ConflictResolver {
71
71
  /** Max resolution attempts before giving up (each = one agent run + one marker/.rej re-check). */
@@ -112,7 +112,7 @@ export interface MergeDeps {
112
112
  repoDir?: string;
113
113
  /** Full test command run in the sandbox (the merge gate). */
114
114
  testCmd: string;
115
- /** Optional truecorrect MEASURE (design/59): a thorough hidden-oracle command run IN the integration sandbox
115
+ /** Optional truecorrect MEASURE ([ref]): a thorough hidden-oracle command run IN the integration sandbox
116
116
  * (E2B) right after the gate passes — offloads the measure from the CPU-contended control plane (the
117
117
  * frontier-multi oracle-timeout fix). NOT a gate (does not affect `ok`); the result lands in MergeResult.measure
118
118
  * for the caller to read as the objective truly-correct signal. Same place + env as the gate, just a thornier test. */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * v2 MVP — LLM Planner (design/50 §3: leader = LLM-planner that splits a DAG + deterministic Coordinator).
2
+ * v2 MVP — LLM Planner ([ref] §3: leader = LLM-planner that splits a DAG + deterministic Coordinator).
3
3
  * Decomposes an objective into N **disjoint-file** sub-tasks via one model completion, then VALIDATES the plan
4
4
  * deterministically (the trust boundary: an LLM proposes, the Coordinator enforces — service[19] leaderless-
5
5
  * leader). Disjoint file-ownership is the invariant that lets workers run in parallel + merge without conflict.
@@ -14,17 +14,17 @@ export interface PlanOptions {
14
14
  maxSubtasks?: number;
15
15
  /** Extra repo/context guidance appended to the prompt (e.g. file layout, conventions). */
16
16
  context?: string;
17
- /** Deployment knob (design/68 §11 A6, correctness-first): `false` = never fan out — `routePlan` skips the
17
+ /** Deployment knob ([ref] §11 A6, correctness-first): `false` = never fan out — `routePlan` skips the
18
18
  * router model call entirely and returns the deterministic single route (zero routing cost, zero risk of a
19
19
  * false fan-out). Default (undefined/true) = the router decides. */
20
20
  fanoutEnabled?: boolean;
21
- /** Economic guard threshold (design/68 §7, search[83] ruling): an objective SHORTER than this never reaches
21
+ /** Economic guard threshold ([ref] §7, search[83] ruling): an objective SHORTER than this never reaches
22
22
  * the router — deterministic single (a small task can't be economically decomposable; false-single is the
23
23
  * cheap error side). Default 64 — deliberately below the route corpus's smallest fan-out case. */
24
24
  minFanoutChars?: number;
25
25
  }
26
26
  /**
27
- * Deterministic economic 防灾 guard (design/68 §7 / §11 D2, search [83] ruling (b)): the asymmetry is that a
27
+ * Deterministic economic 防灾 guard ([ref] §7 / §11 D2, search [83] ruling (b)): the asymmetry is that a
28
28
  * false fan-out is the -98% disaster while a false single merely runs slower — so every case decidable WITHOUT
29
29
  * the model resolves to single, for free. Pure function (unit-testable); the semantic judgments (sequential/
30
30
  * coupled/uncertain) stay with the router LLM, and "估不准回 single" is the collapse fallback (B3).
@@ -65,7 +65,7 @@ export declare function routePrompt(objective: string, opts?: PlanOptions): stri
65
65
  * validated by `parsePlan` (the same disjointness/shape invariants the Coordinator depends on). */
66
66
  export declare function routePlan(objective: string, runRoute: (prompt: string) => Promise<string>, opts?: PlanOptions): Promise<SubtaskSpec[]>;
67
67
  /**
68
- * Decomposer quality gate (design/68 §5/§11 B1-B3): run the router, and on a rejected/unparseable plan retry
68
+ * Decomposer quality gate ([ref] §5/§11 B1-B3): run the router, and on a rejected/unparseable plan retry
69
69
  * the LLM AT MOST ONCE, then COLLAPSE TO SINGLE (never fail the task on a bad plan — single is almost always
70
70
  * the right fallback, and a false fan-out is the -98% disaster; a plan failure must not be louder than that).
71
71
  * `collapsed` carries the reason (observability: a collapse is a router-quality signal, not silent).
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The PROFILE-injected `RepairOracle` closure for the leader's single-agent self-repair loop
3
- * (`runRepairLoop`, core design/78 / D1). See `sema-internal server/docs/LEADER-REPAIRLOOP-INTEGRATION.md` (§3.1 + the authoritative
3
+ * (`runRepairLoop`, core [ref] / D1). See `sema-internal server/docs/LEADER-REPAIRLOOP-INTEGRATION.md` (§3.1 + the authoritative
4
4
  * §10 corrected layer). The closure GRADES a worker's candidate in an ISOLATED grader env (the reused
5
5
  * integration sandbox, distinct from the worker env) and maps the result to a core `OracleResult`. core only
6
6
  * fixes the `OracleResult` shape + the read-only/identity contract; the composition lives HERE so the core type
@@ -5,11 +5,11 @@ import type { LeaderRequestBody } from "./endpoint.js";
5
5
  export interface LeaderWireConfig {
6
6
  /** Static-env compat mode (E2B only): the leader provisions/owns each env. Required when `envFactory` unset. */
7
7
  e2bApiKey?: string;
8
- /** design/68 F2(a) + k8s lane: the per-task execution-env factory the service main already built for
8
+ /** [ref] F2(a) + k8s lane: the per-task execution-env factory the service main already built for
9
9
  * REMOTE_EXEC (e2b or k8s/Kata) — workers and the integration sandbox run on envs from THIS factory.
10
10
  * Requires `s3` (diff-out is the worker's self-upload; there is no leader-held env to pull from). */
11
11
  envFactory?: ExecutionEnvFactory;
12
- /** Durable suspend/resume for SUB-WORKERS (design/68 C4): when set, each worker task carries the durable
12
+ /** Durable suspend/resume for SUB-WORKERS ([ref] C4): when set, each worker task carries the durable
13
13
  * question/ask policy + checkpoint store, so a gated ask/AskUserQuestion SUSPENDS the worker (checkpoint +
14
14
  * paused env) instead of failing — the trigger replan-lite C4 arbitrates on. Mirrors main.ts's per-task
15
15
  * durable wiring; ctx is seeded at provision so the surfaced token is resumable on the single-agent path. */
@@ -31,7 +31,7 @@ export interface LeaderWireConfig {
31
31
  * the resume dies with SessionError "Entry <leafId> not found" (found live: drill c3 deny path). */
32
32
  sessionStore?: SessionStore;
33
33
  /**
34
- * design/170 件B/C/D(#252,codex R2-F1)—— 部署治理三座席,**原样递给本车道的每一只 Runner**。
34
+ * [ref] 件B/C/D([ref],codex R2-F1)—— 部署治理三座席,**原样递给本车道的每一只 Runner**。
35
35
  * 主车道的 `boot/governance-seams.ts` 是唯一属主(判据、拒启、解析全在那里),本字段只是把它的产物
36
36
  * 搬过来:一个进程里「这台部署禁哪些能力、锁了哪些键」只能有一个答案。缺席 = 与接线前逐字相同。
37
37
  */
@@ -48,7 +48,7 @@ export interface LeaderWireConfig {
48
48
  name: string;
49
49
  email: string;
50
50
  };
51
- /** design/68 A6 knob: false = router never fans out (deterministic single route, zero router cost). */
51
+ /** [ref] A6 knob: false = router never fans out (deterministic single route, zero router cost). */
52
52
  fanoutEnabled?: boolean;
53
53
  /** The model (a catalog name) the ROUTER/planner call runs on. The route is a trivial single-vs-fanout
54
54
  * classification; running it on a heavy reasoning model (deepseek-v4-pro + reasoning) returns an EMPTY
@@ -65,7 +65,7 @@ export interface LeaderWireConfig {
65
65
  * Env override: LEADER_CONFLICT_ROUNDS. Resolves the conflict in-place + keeps the other workers' work, instead
66
66
  * of discarding all fan-out output and redoing single. Runs the strong (default) model with hands in the sandbox. */
67
67
  conflictRounds?: number;
68
- /** design/68 §8 F2(a): when set, workers run on FACTORY envs (runner-owned lifecycle — the durable-suspend-
68
+ /** [ref] §8 F2(a): when set, workers run on FACTORY envs (runner-owned lifecycle — the durable-suspend-
69
69
  * complete path; a suspended worker's paused env is exempt from the leader reap by construction) and diff-out
70
70
  * is the worker's mandatory self-upload to this MinIO/S3 store (presigned per worker; creds adapter-held).
71
71
  * Unset = the original leader-owned static-env mode (pullDiff compat). */
@@ -85,11 +85,11 @@ export interface LeaderWireConfig {
85
85
  /** The env surface wire needs (both the E2B and k8s adapters implement core's RemoteExecutionEnv). */
86
86
  type WireEnv = Pick<RemoteExecutionEnv, "exec" | "writeFile">;
87
87
  /**
88
- * Resume-safe worker staging (the design/68 F2(a) factory-env path). Runs adapter-side before the agent's
88
+ * Resume-safe worker staging (the [ref] F2(a) factory-env path). Runs adapter-side before the agent's
89
89
  * first workspace-touching call: seed the base repo at the worker branch + plant the upload script (so the
90
90
  * presigned URL never passes through the model).
91
91
  *
92
- * 🔴 BL-1 fix (design/74 Slice 6): on a RESOURCE-SUSPEND RESUME core re-invokes the `executionEnvFactory`,
92
+ * 🔴 BL-1 fix ([ref] Slice 6): on a RESOURCE-SUSPEND RESUME core re-invokes the `executionEnvFactory`,
93
93
  * producing a FRESH `withStaging` wrapper (`staged=undefined`) whose `stage()` runs AGAIN — AFTER core's
94
94
  * `resumeVM()` has already untar'd the snapshot onto the fresh pod (`resumeVM` is not a STAGED_METHOD, so it
95
95
  * is NOT intercepted by the staging proxy; the agent's first `exec` is what triggers `stage()`, lazily, and
@@ -134,7 +134,7 @@ export declare function leaderResourceConfig(env?: NodeJS.ProcessEnv): {
134
134
  workerBudgetUsd: number;
135
135
  workerLimits: Partial<TaskSpec>;
136
136
  presignTtlSec: number;
137
- /** design/74 Slice 6: opt-in (LEADER_RESOURCE_SUSPEND=true) resource-slice suspend for workers. When set, a
137
+ /** [ref] Slice 6: opt-in (LEADER_RESOURCE_SUSPEND=true) resource-slice suspend for workers. When set, a
138
138
  * worker SUSPENDS at the per-slice window (`sliceMaxCostUsd`) instead of failing at the budget, and the
139
139
  * leader auto-resumes (resumeWithVerification) until the TOTAL (`totalBudgetUsd` = workerBudgetUsd) is spent
140
140
  * — a budget overrun becomes a resumable pause, not a worker failure. ⚠️ 语义更新(core 5.11.0 B3,
@@ -160,7 +160,7 @@ export interface LeaderLoopConfig {
160
160
  measureGatesOn: boolean;
161
161
  repairLoopAttempts: number;
162
162
  oracleFlakyK: number;
163
- /** replan-lite (design/68 §6) fan-out spend cap from LEADER_BUDGET_USD. Absent = replan-lite's own default
163
+ /** replan-lite ([ref] §6) fan-out spend cap from LEADER_BUDGET_USD. Absent = replan-lite's own default
164
164
  * (unset env stays absent — existing contract untouched; see leaderLoopConfig doc below). */
165
165
  replanBudgetUsd?: number;
166
166
  }
@@ -68,7 +68,7 @@ export interface E2bLspManagerOptions {
68
68
  }
69
69
  /**
70
70
  * §DESIGN-V2 F1/F8/F9 —— 本文件曾**手抄**一份 core 的 `settleOnAbort`(注释自陈 core「un-exported」,并写下
71
- * 「一旦 core 导出即 find-and-delete」的计划)。A-033.1(#256)执行了那句话:core 现已从包根导出它
71
+ * 「一旦 core 导出即 find-and-delete」的计划)。[ref]([ref])执行了那句话:core 现已从包根导出它
72
72
  * (`index.d.ts:27`,来自 `core/lsp.js`),手抄件遂删除,本文件的两处调用直接消费 core 的实现。
73
73
  *
74
74
  * 它的语义(读点在 `open` 的两处调用):给**这一个**调用方一个自己的 settle —— 调用方的 `signal` 让它拿到
@@ -86,7 +86,7 @@ export declare class E2bLspManager implements LspServerManager {
86
86
  private readonly log;
87
87
  private readonly hasServerCommand;
88
88
  private readonly metrics;
89
- /** design/121 (core 1.220, board [S] ①): the workspace diagnostics registry — WORKSPACE-scoped (survives
89
+ /** [ref] (core 1.220, board [S] ①): the workspace diagnostics registry — WORKSPACE-scoped (survives
90
90
  * heal/evict; diagnostics belong to files, not servers), drained by the Runner at turn boundaries. Every
91
91
  * session feeds it from `textDocument/publishDiagnostics` (the WS transport now dispatches notifications).
92
92
  * ⚠️ ONE registry across sandboxes on this manager instance (it is per-deployment) — same posture as
@@ -1,5 +1,5 @@
1
1
  /**
2
- * LSP sidecar — service-side types (design/64 §13.1). core 1.82+ ships `createLspTool(manager)`
2
+ * LSP sidecar — service-side types ([ref] §13.1). core 1.82+ ships `createLspTool(manager)`
3
3
  * + the `LspServerManager`/`LspSession`/`LspResult` SEAM (`@sema-agent/core`); the runner mounts the tool
4
4
  * when OUR manager is wired via `RunnerDeps.lspManager`. We re-export core's seam types — SINGLE SOURCE OF TRUTH,
5
5
  * incl. the injectable `LspTransport` (the WS-bridge connection to the language server inside E2B) + `LspReadText`.
@@ -17,7 +17,7 @@ export declare class WsLspTransport implements LspTransport {
17
17
  private isClosed;
18
18
  private keepalive;
19
19
  private awaitingPong;
20
- /** design/121: server→client NOTIFICATION subscribers (publishDiagnostics etc.). */
20
+ /** [ref]: server→client NOTIFICATION subscribers (publishDiagnostics etc.). */
21
21
  private readonly notificationHandlers;
22
22
  constructor(ws: WsLike, requestTimeoutMs?: number, keepaliveMs?: number);
23
23
  /** Manager-visible liveness (LspTransport.closed): evict + reopen instead of reusing a dead connection. */
@@ -26,7 +26,7 @@ export declare class WsLspTransport implements LspTransport {
26
26
  private failAll;
27
27
  request(method: string, params: unknown, signal?: AbortSignal): Promise<unknown>;
28
28
  notify(method: string, params: unknown): void;
29
- /** design/121 (core 1.220): subscribe to server→client notifications; returns unsubscribe. Additive —
29
+ /** [ref] (core 1.220): subscribe to server→client notifications; returns unsubscribe. Additive —
30
30
  * core's diagnostics registry is the intended consumer; with no subscriber, behavior is byte-identical. */
31
31
  onNotification(handler: (method: string, params: unknown) => void): () => void;
32
32
  close(): Promise<void>;
package/dist/main.js CHANGED
@@ -32,7 +32,7 @@ import { createHttpServer, explicitOperatorOk, hasServiceAuth } from "./http/ser
32
32
  import { exportMemoryScope } from "./memory-export.js";
33
33
  import { workflowModelAllowlistFor } from "./task-workflow.js";
34
34
  import { createMemoryBundleFaces } from "./memory-bundle-engine.js";
35
- import { backendOwnsControlPlane, createMemoryComplianceFaces, createMemoryOriginFaces } from "./memory-operator-faces.js";
35
+ import { backendOwnsControlPlane, createMemoryComplianceFaces, createMemoryOriginFaces, createSessionMemoryStatusFace } from "./memory-operator-faces.js";
36
36
  import { performMemorySync } from "./memory-sync.js";
37
37
  import { startOtlpExporter } from "./observability/otel-exporter.js";
38
38
  import { HEARTBEAT_MS, backgroundAgentOutput, taskHandleOutput, taskHandleStop } from "./runs.js";
@@ -120,17 +120,23 @@ async function main() {
120
120
  await configCenter.applyLocalRemoteExec();
121
121
  const { backend, storeBackendDegraded, memoryEngine, memorySyncCursors, rosterStore, backgroundAgentStore, taskAttachmentStore, mailboxStore, memoryExportBackend, memorySyncRunner, sessionStore, breakerState, usageWindowStore, memoryPosture, taskListLane, } = await openStores({ config, logger, metrics, localRoot });
122
122
  const instanceId = uuidv7();
123
- const memoryBundleFaces = memoryEngine ? createMemoryBundleFaces(memoryEngine) : undefined;
123
+ const sessionCaptureRecordStore = backend?.sessionCaptureRecords();
124
+ const memoryBundleFaces = memoryEngine ? createMemoryBundleFaces(memoryEngine, { ...(sessionCaptureRecordStore !== undefined ? { captureRecordStore: sessionCaptureRecordStore } : {}) }) : undefined;
124
125
  const memoryComplianceFaces = memoryEngine
125
126
  ? createMemoryComplianceFaces(memoryEngine, {
126
127
  onIncident: (err) => logger.warn("memory_compliance_incident", { code: err.code ?? null, detail: err.message }),
128
+ ...(sessionCaptureRecordStore !== undefined ? { captureRecordStore: sessionCaptureRecordStore } : {}),
127
129
  })
128
130
  : undefined;
129
131
  const memoryOriginFaces = memoryEngine
130
132
  ? createMemoryOriginFaces(memoryEngine, {
131
133
  onIncident: (err) => logger.warn("memory_origin_incident", { code: err.code ?? null, detail: err.message }),
134
+ ...(sessionCaptureRecordStore !== undefined ? { captureRecordStore: sessionCaptureRecordStore } : {}),
132
135
  })
133
136
  : undefined;
137
+ const sessionMemoryStatusFace = memoryEngine
138
+ ? createSessionMemoryStatusFace(memoryEngine, { ...(sessionCaptureRecordStore !== undefined ? { captureRecordStore: sessionCaptureRecordStore } : {}) })
139
+ : undefined;
134
140
  const adoptionBoot = await runAdoptionBootScan({ backend, logger });
135
141
  if (adoptionBoot.scanned > 0 || adoptionBoot.error !== undefined) {
136
142
  logger.info("adoption_boot_scan", { ...adoptionBoot });
@@ -211,6 +217,7 @@ async function main() {
211
217
  ...(config.memoryProvenance !== undefined ? { provenance: config.memoryProvenance } : {}),
212
218
  onIncident: (err) => logger.warn("memory_consolidation_incident", { code: err.code ?? null, detail: err.message }),
213
219
  onStopDetail: (audit) => logger.warn("memory_consolidation_stop_detail", audit),
220
+ ...(sessionCaptureRecordStore !== undefined ? { captureRecordStore: sessionCaptureRecordStore } : {}),
214
221
  })
215
222
  : undefined;
216
223
  for (const w of buildConsolidationValveAudit({
@@ -246,6 +253,7 @@ async function main() {
246
253
  mcpRevocations,
247
254
  config, logger, metrics, localRoot, promptSource: configCenter.promptSource, rosterStore, backgroundAgentStore, mailboxStore, usageWindowStore, brain,
248
255
  pricing, tracer, outcomeSink, elicitation, question, toolApproval, sessionStore, memoryEngine,
256
+ sessionCaptureRecordStore,
249
257
  memorySyncRunner, toolResultStore: runnerOffloadStore, sessionPolicyStore, runtimeCapsResolver, fileHistoryStore,
250
258
  legacyRewindBoundaryProbe: backend?.legacyRewindBoundaryProbe ? backend.legacyRewindBoundaryProbe.bind(backend) : undefined,
251
259
  permissionRuleStore: permissionRuleStores?.provider,
@@ -555,6 +563,7 @@ async function main() {
555
563
  posture: staticWiring.interaction.posture,
556
564
  streamApproval: streamApprovalGate.active ? "active" : streamApprovalGate.reason,
557
565
  subagentTranscripts: staticWiring.fleet.subagentTranscripts,
566
+ subagentTranscriptRetentionMs: config.backgroundAgentRetentionMs,
558
567
  });
559
568
  const stores = {
560
569
  runStore,
@@ -609,6 +618,7 @@ async function main() {
609
618
  memoryBundleImport: memoryBundleFaces ? memoryBundleFaces.importBundle : undefined,
610
619
  memoryCompliance: memoryComplianceFaces,
611
620
  memoryOriginFace: memoryOriginFaces,
621
+ sessionMemoryStatus: sessionMemoryStatusFace,
612
622
  memoryConsolidation: memoryConsolidationFaces,
613
623
  memoryOptOutGrant: memoryOptOutGrantStore,
614
624
  orgMemoryDirectory: orgMemoryAdmission.directory,
@@ -661,6 +671,7 @@ async function main() {
661
671
  mcpRevocations,
662
672
  mcpRevocationState: () => configCenter.mcpRevocationState(),
663
673
  configRefreshNow: () => configCenter.refreshNow(),
674
+ configCenterManagedKeys: () => configCenter.centerManagedKeys(),
664
675
  drainState,
665
676
  storeDegraded: storeBackendDegraded,
666
677
  storeLiveState: storeLiveProbe ? () => storeLiveProbe.state() : undefined,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * design/378(core 5.60.0)—— `McpServerSpec.contentOrigin` 的**闭词表单一属主**。
2
+ * [ref](core 5.60.0)—— `McpServerSpec.contentOrigin` 的**闭词表单一属主**。
3
3
  *
4
4
  * core 给 MCP 条目开了一个**内容出处声明**座位:一台 server 的整套工具的结果算 `"local"`(部署自己
5
5
  * 写的)/ `"execution"`(执行环境产物,`execIsExternalContent` 仍能收紧)/ `"external"`(第三方内容,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * #264 v2-c —— `POST /v1/memory/{export,import}` 两口的**引擎接线**(core 5.40.0 design/178 v2-c)。
2
+ * [ref] v2-c —— `POST /v1/memory/{export,import}` 两口的**引擎接线**(core 5.40.0 [ref] v2-c)。
3
3
  *
4
4
  * ## 为什么需要这个模块(而不是在 main.ts 里直接 new)
5
5
  *
@@ -29,7 +29,7 @@
29
29
  * HTTP 面诚实 501。
30
30
  *
31
31
  * 🔴 首版把这件事当成**运行期**事实(照常挂载,让 core 每次抛 `memory.export_incomplete` / 422),
32
- * 被 codex 交叉复审驳倒(#277 提货批 [medium],验真后修):`typeof backend.exportSnapshotOf === "function"`
32
+ * 被 codex 交叉复审驳倒([ref] 提货批 [medium],验真后修):`typeof backend.exportSnapshotOf === "function"`
33
33
  * 是一次**属性检查**,boot 期就判得出;而且它是**永久**缺席(换后端才会变),不是瞬时状态。照旧挂着
34
34
  * 就成了「能力位说 yes、每一次调用都确定性失败」——本仓「says yes ⟺ route works」是结构性承诺,
35
35
  * 一个恒假的 yes 会让壳给用户开出一条走不通的迁移流程。
@@ -41,7 +41,7 @@
41
41
  * `memory.export_incomplete` —— 那是诚实的运行期拒,附录 A 单列一条。绝不在这里回落到「用通用读面拼
42
42
  * 一个包」:core 明写那正是它拒绝生产的形(a governance-less export is the laundering shape)。
43
43
  */
44
- import { type MemoryBackend, type MemoryExportBundle, type MemoryImportReport } from "@sema-agent/core";
44
+ import { type MemoryBackend, type MemoryExportBundle, type MemoryImportReport, type SessionCaptureRecordStore } from "@sema-agent/core";
45
45
  /** 两口 HTTP 面消费的窄能力面(`ServiceDeps.memoryBundle{Export,Import}` 的实参来源)。 */
46
46
  export interface MemoryBundleFaces {
47
47
  exportScopes: (scopes: readonly string[]) => Promise<MemoryExportBundle>;
@@ -60,5 +60,7 @@ export interface MemoryBundleFaces {
60
60
  export declare function createMemoryBundleFaces(store: {
61
61
  backend: MemoryBackend;
62
62
  root: string;
63
+ }, opts?: {
64
+ captureRecordStore?: SessionCaptureRecordStore;
63
65
  }): MemoryBundleFaces | undefined;
64
66
  //# sourceMappingURL=memory-bundle-engine.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { MemoryEngine } from "@sema-agent/core";
2
- export function createMemoryBundleFaces(store) {
2
+ export function createMemoryBundleFaces(store, opts) {
3
3
  const b = store.backend;
4
4
  if (typeof b.exportSnapshotOf !== "function" || typeof b.importBundleCommit !== "function")
5
5
  return undefined;
6
- const engine = new MemoryEngine({ backend: store.backend, memoryDir: store.root });
6
+ const engine = new MemoryEngine({ backend: store.backend, memoryDir: store.root, ...(opts?.captureRecordStore !== undefined ? { captureRecordStore: opts.captureRecordStore } : {}) });
7
7
  return {
8
8
  exportScopes: (scopes) => engine.exportMemoryScopes(scopes),
9
9
  importBundle: (bundle, opts) => engine.importMemoryBundle(bundle, opts),
@@ -1,6 +1,6 @@
1
1
  /**
2
- * design/316 件③ —— `GET /v1/memory/entries/:entryId/provenance` · `POST /v1/memory/erase` 两口的
3
- * **引擎接线**(core 5.57.0 `MemoryEngine.provenanceOf` / `eraseMemoryEntries`,design/178 v2-a/v2-b)。
2
+ * [ref] 件③ —— `GET /v1/memory/entries/:entryId/provenance` · `POST /v1/memory/erase` 两口的
3
+ * **引擎接线**(core 5.57.0 `MemoryEngine.provenanceOf` / `eraseMemoryEntries`,[ref] v2-a/v2-b)。
4
4
  *
5
5
  * ## 为什么是一个模块而不是 main.ts 里直接 new
6
6
  *
@@ -25,7 +25,7 @@
25
25
  * ⇒ 裁:`controlPlaneRoot` 缺席 ⇒ 本工厂返回 **undefined**,两口整个不挂载,HTTP 面诚实 501。今天满足这一
26
26
  * 条的只有 core 自带的 `FileMemoryEngineBackend`(它把控制面写死在 config-root 一侧);本仓两只 SQL 记忆
27
27
  * 孪生(`plugins/memory-engine-{pg,tidb}.ts`)没有这个面 ⇒ 在那些部署上两口不挂。SQL 控制面是 core 的候升件
28
- * (design/316 §0b-4 咨询单),**绝不**在本层为它们现造一个「够用的」控制面 —— 那是把一个 core 拒绝生产的
28
+ * ([ref] §0b-4 咨询单),**绝不**在本层为它们现造一个「够用的」控制面 —— 那是把一个 core 拒绝生产的
29
29
  * 半吊子治理面自己造出来,与 bundle 那条「a governance-less export is the laundering shape」同族。
30
30
  *
31
31
  * 🔴 这条判断是承重的,所以它有**机器钉**而不是只有这段注释:`test/memory-operator-faces.test.ts` 用一只
@@ -36,16 +36,16 @@
36
36
  *
37
37
  * 判据是一次**属性检查**、boot 期就判得出、而且是**永久**缺席(换后端才会变)——不是瞬时状态。照旧挂着
38
38
  * 就成了「能力位说 yes、每一次调用都确定性失败」,而本仓「says yes ⟺ route works」是结构性承诺。
39
- * (这条纪律是 #264 提货批被 codex 交叉复审驳倒后立的,见 memory-bundle-engine.ts 头注。)
39
+ * (这条纪律是 [ref] 提货批被 codex 交叉复审驳倒后立的,见 memory-bundle-engine.ts 头注。)
40
40
  *
41
41
  * ⚠️ **刻意不把审计/托管/证据三个可选面编进构造判定**:`committedSnapshotOf` / `custodyOf` 缺席时 core
42
42
  * 明写要诚实答 `binding:"unknown"` / `contentState:"capability-absent"` / `custody:"capability-absent"`
43
- * (#196 absence-reports-not-silent-green,engine.d.ts:748 逐字),那是一个**答得出话**的部署;把它们编进
43
+ * ([ref] absence-reports-not-silent-green,engine.d.ts:748 逐字),那是一个**答得出话**的部署;把它们编进
44
44
  * 构造判定会让这种部署整口消失,把 core 的诚实答案换成一句 501 谎话。`eraseWithEvidence` 同理:缺它时
45
45
  * core 自己响亮拒(`memory.erasure_evidence_unavailable`),那是**运行期**的诚实拒,与「换部署形态才行」
46
46
  * 不是一回事(附录 A 两条分列)。
47
47
  */
48
- import { type EntryProvenanceAccount, type MemoryBackend, type MemoryEntryOrigin, type MemoryErasureAttestation, type OriginClearanceRow } from "@sema-agent/core";
48
+ import { type EntryProvenanceAccount, type MemoryBackend, type MemoryEntryOrigin, type MemoryErasureAttestation, type OriginClearanceRow, type SessionCaptureRecordStore, type SessionMemoryStatus } from "@sema-agent/core";
49
49
  /**
50
50
  * 控制面归属判据 —— 三个记忆操作面(合规两口 / 外源标记三口 / consolidation 阀门的 D1 拒启门)共用的
51
51
  * **同一只**谓词:backend 的面上带**非空** `controlPlaneRoot` 才算归属在案。空串与缺席同判「不归属」:
@@ -128,6 +128,7 @@ opts?: {
128
128
  onIncident?: (err: Error & {
129
129
  code?: string;
130
130
  }) => void;
131
+ captureRecordStore?: SessionCaptureRecordStore;
131
132
  }): MemoryComplianceFaces | undefined;
132
133
  /** 件② 三口 HTTP 面消费的窄能力面(`ServiceDeps.memoryOriginFace` 的实参来源)。 */
133
134
  export interface MemoryOriginFaces {
@@ -135,7 +136,7 @@ export interface MemoryOriginFaces {
135
136
  * §13-4① 视图面:点名 scope 里**每一条**带外源标记的条目 + 它的出处账。
136
137
  *
137
138
  * 🔴 `scopes` 由**调用方**给,本层不发明默认值:v1 本仓没有任何 scope 枚举读面(core 5.59.0 的
138
- * `listMemoryScopes` 已到 File 腿、SQL 腿是 core 候升件 #437④,本仓尚未接线),而「空 scope 名单」
139
+ * `listMemoryScopes` 已到 File 腿、SQL 腿是 core 候升件 [ref]④,本仓尚未接线),而「空 scope 名单」
139
140
  * 与「查全店」在这条路上是两件事 —— 猜一个默认名单会让审计的**不完备变成静默的**(空数组与
140
141
  * 「这些 scope 干净」同形)。缺参时路由那侧 400 并指路,理由与文案同源于此。
141
142
  */
@@ -161,8 +162,8 @@ export interface MemoryOriginFaces {
161
162
  }>;
162
163
  }
163
164
  /**
164
- * design/316 件② —— 外源标记人面的**引擎接线**(core 5.59.0 `MemoryEngine.listExternalOriginEntries` /
165
- * `listOriginClearances` / `clearEntryOrigin`,design/336 §13-4①②)。
165
+ * [ref] 件② —— 外源标记人面的**引擎接线**(core 5.59.0 `MemoryEngine.listExternalOriginEntries` /
166
+ * `listOriginClearances` / `clearEntryOrigin`,[ref] §13-4①②)。
166
167
  *
167
168
  * ## 控制面归属:判据与合规两口**逐字同一条**(§1 F-9 裁),但理由更硬
168
169
  *
@@ -182,11 +183,11 @@ export interface MemoryOriginFaces {
182
183
  * 而且下一次 resume 调用大概率落到另一台副本、读不到那行 ⇒ 一条被清标的记忆连同它的托管字节一起消失。
183
184
  * 本仓是 stateless replicas(CLAUDE.md 首段)。所以判在**构造期**:工厂返 undefined、三口整个不挂、
184
185
  * HTTP 面诚实 501,与 `createMemoryComplianceFaces` 同形同码不同文案(要查的旋钮不是同一个)。
185
- * SQL 控制面是 core 的候升件(design/316 §0b-4 / #437④),**绝不**在本层为它现造一个。
186
+ * SQL 控制面是 core 的候升件([ref] §0b-4 / [ref]④),**绝不**在本层为它现造一个。
186
187
  *
187
188
  * ## 刻意不做的两件事
188
189
  *
189
- * ⚠️ **不把 `listScopes` 编进构造判定**:core 5.59.0 长出了 `listMemoryScopes`(#437③,File 腿在场、
190
+ * ⚠️ **不把 `listScopes` 编进构造判定**:core 5.59.0 长出了 `listMemoryScopes`([ref]③,File 腿在场、
190
191
  * SQL 腿候升),但那是**发现链**的面,不是本族三口的执行前提 —— 把它编进来会让一个「scope 名由运维
191
192
  * 自己拿着」的部署整口消失。发现链的不完备由 `GET …/external` 缺参时的 400 文案如实说出来。
192
193
  * ⚠️ **不在 seam 里翻译拒因码**:core 的 origin-clear 族是**闭集**,翻译点只有一个(路由的 switch),
@@ -207,5 +208,34 @@ opts?: {
207
208
  onIncident?: (err: Error & {
208
209
  code?: string;
209
210
  }) => void;
211
+ captureRecordStore?: SessionCaptureRecordStore;
210
212
  }): MemoryOriginFaces | undefined;
213
+ /** [ref] seam① 的窄能力面(`ServiceDeps.sessionMemoryStatus` 的实参来源)。 */
214
+ export interface SessionMemoryStatusFace {
215
+ status: (sessionId: string) => Promise<SessionMemoryStatus>;
216
+ }
217
+ /**
218
+ * [ref] seam①([ref] §S-7,core 7.0.2 [ref] 件1)—— `GET /v1/sessions/:id/memory-status` 的引擎面。
219
+ * 命名照 CLAUDE.md 工厂律:返回带行为的活对象 ⇒ `create*`。
220
+ *
221
+ * 挂载判据与合规/清标两族**同一条 F-9 裁**(`backendOwnsControlPlane`,理由见文件头):
222
+ * `committedCount` / `foldedCount` / `lastCaptureAt` 读的是引擎控制面的 lineage 台账 ——
223
+ * 控制面归属缺席的部署上(两只 SQL 记忆孪生),core 会把控制面落到**副本本地盘**,一个「可读的空目录」
224
+ * 让 core 面答出 `committedCount: 0`(readLineageRecord 对空目录**不抛**,亲读 engine.js)——
225
+ * 那是**说谎的 0**,比缺席更坏(S-7 的诚实键律:可读零必须是真零)。⇒ 归属缺席 ⇒ 工厂返 undefined,
226
+ * HTTP 面诚实 501,与 erase/origin 同码同分支。
227
+ *
228
+ * `captureRecordStore` = [ref]② 的 SQL 载体(main.ts 单实例,与 Runner/其余引擎同源 —— 全站同批注入律,
229
+ * 机器钉 capture-optout-lane ②):`captureOptedOut` / `optOutSource` 两键经它读,多副本部署上答的才是
230
+ * 跨副本的真记录。缺席(local 车道)⇒ core 文件三腿,单机字节不变。
231
+ *
232
+ * 面**不抛**(core 契约:sessionMemoryStatus never throws —— 每个事实源各自 catch 折缺席键);
233
+ * 不接 onIncident:这条只读路径上今天零 sink 站点,而且缺席键本身就是它的披露形。
234
+ */
235
+ export declare function createSessionMemoryStatusFace(store: {
236
+ backend: MemoryBackend;
237
+ root: string;
238
+ }, opts?: {
239
+ captureRecordStore?: SessionCaptureRecordStore;
240
+ }): SessionMemoryStatusFace | undefined;
211
241
  //# sourceMappingURL=memory-operator-faces.d.ts.map
@@ -43,6 +43,7 @@ export function createMemoryComplianceFaces(store, opts) {
43
43
  backend: store.backend,
44
44
  memoryDir: store.root,
45
45
  ...(opts?.onIncident !== undefined ? { onIncident: opts.onIncident } : {}),
46
+ ...(opts?.captureRecordStore !== undefined ? { captureRecordStore: opts.captureRecordStore } : {}),
46
47
  });
47
48
  return {
48
49
  provenanceOf: (entryId) => engine.provenanceOf(entryId),
@@ -66,6 +67,7 @@ export function createMemoryOriginFaces(store, opts) {
66
67
  backend: store.backend,
67
68
  memoryDir: store.root,
68
69
  ...(opts?.onIncident !== undefined ? { onIncident: opts.onIncident } : {}),
70
+ ...(opts?.captureRecordStore !== undefined ? { captureRecordStore: opts.captureRecordStore } : {}),
69
71
  });
70
72
  return {
71
73
  listExternal: (scopes) => engine.listExternalOriginEntries(scopes),
@@ -73,4 +75,14 @@ export function createMemoryOriginFaces(store, opts) {
73
75
  clear: (entryId, input) => engine.clearEntryOrigin(entryId, input),
74
76
  };
75
77
  }
78
+ export function createSessionMemoryStatusFace(store, opts) {
79
+ if (!backendOwnsControlPlane(store.backend))
80
+ return undefined;
81
+ const engine = new MemoryEngine({
82
+ backend: store.backend,
83
+ memoryDir: store.root,
84
+ ...(opts?.captureRecordStore !== undefined ? { captureRecordStore: opts.captureRecordStore } : {}),
85
+ });
86
+ return { status: (sessionId) => engine.sessionMemoryStatus(sessionId) };
87
+ }
76
88
  //# sourceMappingURL=memory-operator-faces.js.map
@@ -1,42 +1,14 @@
1
- /**
2
- * design/383 S-6 / S-50 §三(S-49 F3)—— 带 `origin` 标的记忆条目在 wire 读口上的 **fence-or-refuse**。
3
- *
4
- * ## 病(S-6 禁形)
5
- * 记忆条目的 `origin` 标(design/336 provenance 标记族)是 additive 键。旧 SDK / 旧壳的 strict/strip parse 会
6
- * **静默剥掉**它 ⇒ 一条「外源已标」的条目摊平成无标文本,消费端再把它当洁净内容引用/回写 = 出处被洗掉。
7
- * core 无法在 wire 上强制(它不认识客户端),383 §3.4 显式授权 server 裁三点,S-50 §三裁定如下。
8
- *
9
- * ## 三点裁定(逐字)
10
- * 1. **判定点 = 端点级能力位,不猜客户端版本**:server 无 per-client 版本可见性。凡投影带标条目的读口,
11
- * **缺省不投带标条目**;消费方以查询参数 `originAware=1` 声明「我认识 origin 键族」后才放行。参数缺席 =
12
- * 老客户端假定成立 ⇒ fence。
13
- * 2. **粒度 = 整条目扣留,不做字段降级**:字段级(剥 origin 只给文本)恰是被禁的摊平。整条目扣留 + 计数披露
14
- * (`refusedUntrusted` 计数拒的既有先例形):响应带 `withheldOriginTagged: <n>`(additive,**只在 n>0 时铸**——
15
- * 只记真),消费端机读得出「有 n 条因我没声明能力而被围栏」。
16
- * 3. **能力位形 = 每请求查询参数,不是每客户端注册**:注册制引入一张会陈旧的表;查询参数让「谁认识键族」由
17
- * 当次调用自证,零状态。SDK 新版缺省带 `originAware=1`;旧 SDK 不带 ⇒ 结构性 fence。
18
- *
19
- * ## 判「带标」的谓词
20
- * 条目对象上 **own** `origin` 键且值非 `undefined`。不读 `origin` 的内部形(那是 core 的开放判别式),只判在场。
21
- *
22
- * ## 射程(S-50 §三.1 点名的读口,本仓现状三处)
23
- * · `GET /v1/memory/export?scope=`(memory-policy.ts,属主自助条目读,分页/全量两腿)
24
- * · `GET /v1/memory/origin/external?scopes=`(memory-origin.ts,外源标记人面 —— 它的每条都带标,缺省下
25
- * 全部扣留 + 计数:operator 的工具必须声明能力位才看得见,这正是「围栏」的意思,不是 bug)
26
- * · `POST /v1/memory/export`(memory-bundle.ts,治理携出包 —— 包经 SDK 落盘再 import,旧 SDK 剥标后 import
27
- * 会把无标条目当洁净内容收进另一台 = 跨库洗出处;所以包也围栏,计数键落在包顶层)
28
- * 不围栏的:`GET /v1/memory/entries/:id/provenance`(单条出处账,消费它的人就是来读 origin 的,且响应根不是
29
- * 条目)、`GET /v1/memory/origin/clearances`(`buildClearanceRowWire` 深白名单投影,已是显式形)。
30
- *
31
- * ## 读面行为收窄 = L3(S-50 §三.3 成文)
32
- * 存量消费者若依赖读到带标条目(现状 = origin 键族尚未在这些读口上稳定出现;真实射程 = 蒸馏产物到货后的新条目),
33
- * 从本版起须带 `originAware=1`。判据入 383 片3 判据面。
34
- */
1
+ import { type MemoryExportBundle } from "@sema-agent/core";
35
2
  /** 查询参数名与合法值(闭集:只认字面 `1`;`true`/`yes` 不认 —— 能力位不做宽松解析)。 */
36
3
  export declare const ORIGIN_AWARE_QUERY = "originAware";
37
4
  /** 从 `URLSearchParams` 读能力位:`originAware=1` ⇒ true;缺席/其它值 ⇒ false(老客户端假定)。 */
38
5
  export declare function readOriginAware(params: URLSearchParams): boolean;
39
- /** 「这条条目带 origin 标吗」—— own 键在场且非 undefined。纯谓词,不读 origin 的形。 */
6
+ /** 「这条条目带 origin 标吗」—— 载体三形(G53 [ref] + codex R1-high 后齐):
7
+ * ① 顶层 `origin`(listExternal 投影行)—— own 键在场且非 undefined 即带标(不读形;typed null/坏形也算:
8
+ * core 读取器对 null 会抛,围栏对读不出的载体只许扣留不许放行);
9
+ * ② `frontmatter.origin`(core `MemoryEntry`,138 S3)—— 同 own 键判;
10
+ * ③ `frontmatter.extra` 的 origin 悬置形块 —— 单源直调 core 出口的 `committedOriginOf`(typed 缺席时读
11
+ * extraOriginCarriers[0];退化形记 at:0 也算载体,过近似=安全方向),server 不自铸解析。 */
40
12
  export declare function isOriginTagged(entry: unknown): boolean;
41
13
  /**
42
14
  * 围栏(`build*`:纯数据)。`originAware=true` ⇒ 原数组同一引用、无计数键(零行为差);否则扣留带标条目,
@@ -47,4 +19,17 @@ export declare function buildOriginFence<T>(entries: readonly T[], originAware:
47
19
  entries: readonly T[];
48
20
  withheldOriginTagged?: number;
49
21
  };
22
+ /**
23
+ * 治理携出包的围栏(`build*`:纯数据)。`originAware=true` ∨ 零扣留 ⇒ **原对象同一引用**(逐字节旧形,
24
+ * integrity 一个字不动);否则:扣留带标条目 + 顶层 `withheldOriginTagged`(只记真),并按扣留后内容重铸
25
+ * integrity —— `entryCount`=kept 数、`revs`=kept 的 id→rev(core 校验器要求 revs 基数≡条目 id 集,
26
+ * 只重算 entryCount/sectionHashes 而留旧 revs 同样过不了自校验)、`sectionHashes.entries`=kept 的
27
+ * canonical 哈希;meta/governance/residuals 三段内容未动 ⇒ 三段哈希原样。
28
+ * governance 行(challenges/lineage)**不**随条目扣留:它们不携 origin 键(无标可剥,S-6 的摊平病对它们
29
+ * 不成立),扣了反而是静默改写治理史;import 侧对超出 entries 的引用按 referentialOrphans 具名报告,
30
+ * 诚实方向一致。
31
+ */
32
+ export declare function buildOriginFencedBundle(bundle: MemoryExportBundle, originAware: boolean): MemoryExportBundle & {
33
+ withheldOriginTagged?: number;
34
+ };
50
35
  //# sourceMappingURL=memory-origin-fence.d.ts.map