@sema-agent/core 7.61.0 → 7.63.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 (298) hide show
  1. package/CHANGELOG.md +840 -0
  2. package/dist/agents/cascade.d.ts +11 -3
  3. package/dist/agents/cascade.js +1 -1
  4. package/dist/agents/peer-held-queue.d.ts +27 -4
  5. package/dist/agents/peer-held-queue.js +81 -36
  6. package/dist/agents/peer-session-drain.js +13 -3
  7. package/dist/agents/subagent-transcript-placement.d.ts +23 -0
  8. package/dist/agents/subagent-transcript-placement.js +14 -0
  9. package/dist/agents/subagent.d.ts +6 -1
  10. package/dist/agents/subagent.js +143 -58
  11. package/dist/agents/suspend-guard.d.ts +38 -16
  12. package/dist/agents/suspend-guard.js +9 -4
  13. package/dist/agents/verify.js +4 -3
  14. package/dist/brain/route-adjudicator.js +9 -4
  15. package/dist/core/approval-object.js +1 -1
  16. package/dist/core/arg-summary.js +1 -1
  17. package/dist/core/ask-question.d.ts +2 -2
  18. package/dist/core/canonical-json.d.ts +23 -13
  19. package/dist/core/canonical-json.js +4 -4
  20. package/dist/core/checkpoint-features.d.ts +722 -0
  21. package/dist/core/checkpoint-features.js +98 -0
  22. package/dist/core/checkpoint-queries.d.ts +47 -4
  23. package/dist/core/checkpoint-queries.js +36 -16
  24. package/dist/core/checkpoint-requirements.d.ts +12 -5
  25. package/dist/core/checkpoint-requirements.js +11 -5
  26. package/dist/core/checkpoint-row-verdict.d.ts +110 -0
  27. package/dist/core/checkpoint-row-verdict.js +245 -0
  28. package/dist/core/checkpoint-store.d.ts +76 -753
  29. package/dist/core/checkpoint-store.js +83 -144
  30. package/dist/core/compliance.d.ts +6 -2
  31. package/dist/core/compliance.js +3 -3
  32. package/dist/core/engine-attestation.d.ts +1 -1
  33. package/dist/core/engine-notice.d.ts +38 -7
  34. package/dist/core/engine-notice.js +9 -2
  35. package/dist/core/gate-fold.js +2 -2
  36. package/dist/core/git-worktree-env.d.ts +62 -3
  37. package/dist/core/git-worktree-env.js +91 -30
  38. package/dist/core/governance-codes.d.ts +9 -3
  39. package/dist/core/governance-codes.js +16 -3
  40. package/dist/core/hooks.d.ts +13 -0
  41. package/dist/core/human-input-projection.d.ts +1 -0
  42. package/dist/core/human-input-projection.js +3 -0
  43. package/dist/core/image-admission.d.ts +1 -1
  44. package/dist/core/locked-config.d.ts +2 -2
  45. package/dist/core/mcp-host-seat.js +6 -1
  46. package/dist/core/memory-engine/consolidation-driver.d.ts +33 -18
  47. package/dist/core/memory-engine/consolidation-driver.js +99 -98
  48. package/dist/core/memory-engine/consolidation.d.ts +73 -10
  49. package/dist/core/memory-engine/consolidation.js +167 -11
  50. package/dist/core/memory-engine/data-plane.d.ts +8 -4
  51. package/dist/core/memory-engine/data-plane.js +11 -6
  52. package/dist/core/memory-engine/delegation-settlement.d.ts +37 -35
  53. package/dist/core/memory-engine/delegation-settlement.js +53 -59
  54. package/dist/core/memory-engine/dual-root.d.ts +12 -6
  55. package/dist/core/memory-engine/dual-root.js +9 -5
  56. package/dist/core/memory-engine/engine.d.ts +98 -35
  57. package/dist/core/memory-engine/engine.js +477 -380
  58. package/dist/core/memory-engine/entry-scan.d.ts +8 -0
  59. package/dist/core/memory-engine/entry-scan.js +3 -0
  60. package/dist/core/memory-engine/file-backend.d.ts +29 -3
  61. package/dist/core/memory-engine/file-backend.js +66 -35
  62. package/dist/core/memory-engine/index.d.ts +7 -7
  63. package/dist/core/memory-engine/index.js +6 -6
  64. package/dist/core/memory-engine/landing-admission.d.ts +5 -3
  65. package/dist/core/memory-engine/landing-admission.js +3 -3
  66. package/dist/core/memory-engine/layout.d.ts +121 -45
  67. package/dist/core/memory-engine/layout.js +252 -102
  68. package/dist/core/memory-engine/memory-backend-contract.d.ts +19 -1
  69. package/dist/core/memory-engine/memory-backend-contract.js +320 -0
  70. package/dist/core/memory-engine/memory-deployment.d.ts +31 -8
  71. package/dist/core/memory-engine/memory-deployment.js +26 -12
  72. package/dist/core/memory-engine/scope-contract.d.ts +52 -11
  73. package/dist/core/memory-engine/scope-contract.js +68 -19
  74. package/dist/core/memory-engine/session-write-home.d.ts +3 -1
  75. package/dist/core/memory-engine/session-write-home.js +1 -1
  76. package/dist/core/memory-engine/sync-client.d.ts +3 -1
  77. package/dist/core/memory-engine/sync-client.js +7 -0
  78. package/dist/core/memory-engine/sync-report.d.ts +3 -2
  79. package/dist/core/memory-engine/sync-report.js +6 -2
  80. package/dist/core/memory-engine/tools.d.ts +2 -2
  81. package/dist/core/memory-engine/tools.js +10 -10
  82. package/dist/core/memory-engine/types.d.ts +118 -19
  83. package/dist/core/memory-engine/types.js +1 -0
  84. package/dist/core/memory-vector.d.ts +1 -1
  85. package/dist/core/memory.d.ts +10 -10
  86. package/dist/core/memory.js +15 -6
  87. package/dist/core/mode-policy.js +1 -1
  88. package/dist/core/mods/classic-events.d.ts +9 -1
  89. package/dist/core/mods/dollar.d.ts +32 -1
  90. package/dist/core/mods/dollar.js +13 -1
  91. package/dist/core/mods/kernel/events.d.ts +11 -3
  92. package/dist/core/mods/kernel/events.js +13 -10
  93. package/dist/core/mods/lifecycle-stations.d.ts +36 -4
  94. package/dist/core/mods/lifecycle-stations.js +44 -9
  95. package/dist/core/mods/session-append.d.ts +4 -1
  96. package/dist/core/mods/session-append.js +7 -0
  97. package/dist/core/mods/session-receive.js +12 -15
  98. package/dist/core/mods/stations.d.ts +70 -6
  99. package/dist/core/mods/stations.js +144 -1
  100. package/dist/core/own-property-receipt.d.ts +7 -0
  101. package/dist/core/own-property-receipt.js +3 -0
  102. package/dist/core/park-selfcheck.js +2 -2
  103. package/dist/core/pause-registry.d.ts +2 -0
  104. package/dist/core/pause-registry.js +3 -0
  105. package/dist/core/permission-rule-consent.d.ts +10 -3
  106. package/dist/core/permission-rule-consent.js +37 -24
  107. package/dist/core/permission-rule-store.d.ts +35 -1
  108. package/dist/core/permission-rule-store.js +27 -8
  109. package/dist/core/read-only-shell.js +3 -2
  110. package/dist/core/read-root-candidate.js +1 -1
  111. package/dist/core/redaction-marks.d.ts +8 -0
  112. package/dist/core/redaction-marks.js +6 -0
  113. package/dist/core/remote-env.d.ts +12 -1
  114. package/dist/core/remote-env.js +3 -0
  115. package/dist/core/resume-startup-cause.d.ts +5 -4
  116. package/dist/core/runner/child-tree.d.ts +29 -3
  117. package/dist/core/runner/child-tree.js +39 -16
  118. package/dist/core/runner/compact-session.js +5 -2
  119. package/dist/core/runner/contracts.d.ts +36 -17
  120. package/dist/core/runner/delegation-owner.d.ts +43 -0
  121. package/dist/core/runner/delegation-owner.js +59 -0
  122. package/dist/core/runner/gate-exit.js +2 -2
  123. package/dist/core/runner/inherited-ask-grants.js +1 -1
  124. package/dist/core/runner/lineage-reroot-view.d.ts +56 -0
  125. package/dist/core/runner/lineage-reroot-view.js +108 -0
  126. package/dist/core/runner/memory-consolidation-driver.d.ts +6 -3
  127. package/dist/core/runner/memory-consolidation-driver.js +4 -4
  128. package/dist/core/runner/memory-consolidation-write-judge.d.ts +2 -1
  129. package/dist/core/runner/memory-consolidation-write-judge.js +3 -2
  130. package/dist/core/runner/permission-rule-lanes.d.ts +2 -1
  131. package/dist/core/runner/permission-rule-lanes.js +2 -2
  132. package/dist/core/runner/person-path-rows.d.ts +23 -3
  133. package/dist/core/runner/person-path-rows.js +31 -4
  134. package/dist/core/runner/placement-fence.d.ts +12 -0
  135. package/dist/core/runner/placement-fence.js +20 -6
  136. package/dist/core/runner/prepare-acquire-reconcile.d.ts +4 -1
  137. package/dist/core/runner/prepare-acquire-reconcile.js +7 -2
  138. package/dist/core/runner/prepare-ask-lane.js +2 -2
  139. package/dist/core/runner/prepare-caps-and-workflow.d.ts +5 -1
  140. package/dist/core/runner/prepare-caps-and-workflow.js +6 -3
  141. package/dist/core/runner/prepare-config-doors.d.ts +6 -6
  142. package/dist/core/runner/prepare-config-doors.js +3 -4
  143. package/dist/core/runner/prepare-execution-env.js +17 -6
  144. package/dist/core/runner/prepare-hands-readface.d.ts +3 -2
  145. package/dist/core/runner/prepare-hands-readface.js +32 -10
  146. package/dist/core/runner/prepare-inherited-gate.d.ts +12 -8
  147. package/dist/core/runner/prepare-inherited-gate.js +14 -6
  148. package/dist/core/runner/prepare-memory-engine-session.d.ts +2 -4
  149. package/dist/core/runner/prepare-memory-engine-session.js +4 -4
  150. package/dist/core/runner/prepare-memory.d.ts +3 -2
  151. package/dist/core/runner/prepare-memory.js +28 -20
  152. package/dist/core/runner/prepare-park-ask.js +4 -3
  153. package/dist/core/runner/prepare-task.js +22 -16
  154. package/dist/core/runner/prepare-workspace-restore.js +3 -6
  155. package/dist/core/runner/resume-admission.d.ts +3 -3
  156. package/dist/core/runner/resume-admission.js +6 -3
  157. package/dist/core/runner/resume-apply.d.ts +4 -0
  158. package/dist/core/runner/resume-apply.js +11 -4
  159. package/dist/core/runner/resume-checkpoint-screen.d.ts +9 -0
  160. package/dist/core/runner/resume-checkpoint-screen.js +4 -84
  161. package/dist/core/runner/run-git-lane.d.ts +2 -0
  162. package/dist/core/runner/run-git-lane.js +4 -1
  163. package/dist/core/runner/run-harness-handlers.d.ts +2 -0
  164. package/dist/core/runner/run-harness-handlers.js +3 -2
  165. package/dist/core/runner/run-leg.js +25 -8
  166. package/dist/core/runner/run-settle-and-teardown.js +6 -4
  167. package/dist/core/runner/run-stop-and-final-verify.js +2 -1
  168. package/dist/core/runner/run-turn-boundary.js +7 -4
  169. package/dist/core/runner/runtask.js +6 -6
  170. package/dist/core/runner/steering-preview.d.ts +9 -0
  171. package/dist/core/runner/steering-preview.js +5 -0
  172. package/dist/core/runner/stream-steer-verb.js +8 -0
  173. package/dist/core/runner/terminal-account.js +1 -1
  174. package/dist/core/runner/tool-face-overlay.js +2 -0
  175. package/dist/core/runner/turn-attachments.d.ts +5 -0
  176. package/dist/core/runner/turn-attachments.js +1 -1
  177. package/dist/core/runner-deps.d.ts +8 -4
  178. package/dist/core/secret-env.d.ts +9 -6
  179. package/dist/core/secret-env.js +41 -22
  180. package/dist/core/session-checkout.d.ts +108 -0
  181. package/dist/core/session-checkout.js +485 -0
  182. package/dist/core/session-store.d.ts +13 -5
  183. package/dist/core/session-store.js +28 -4
  184. package/dist/core/session.d.ts +29 -5
  185. package/dist/core/session.js +3 -0
  186. package/dist/core/store-contracts/checkpoint-store-contract.d.ts +6 -12
  187. package/dist/core/store-contracts/checkpoint-store-contract.js +73 -6
  188. package/dist/core/store-contracts/session-store-contract.js +61 -8
  189. package/dist/core/task-event.d.ts +28 -1
  190. package/dist/core/task-notification.d.ts +9 -1
  191. package/dist/core/task-notification.js +8 -1
  192. package/dist/core/task-registry-agent.d.ts +40 -8
  193. package/dist/core/task-registry-agent.js +57 -24
  194. package/dist/core/task-registry-shared.d.ts +33 -11
  195. package/dist/core/task-registry-workflow.js +4 -3
  196. package/dist/core/task-registry.d.ts +27 -10
  197. package/dist/core/task-registry.js +19 -13
  198. package/dist/core/task-result.d.ts +5 -5
  199. package/dist/core/task-spec-members.js +1 -1
  200. package/dist/core/task-spec.d.ts +21 -1
  201. package/dist/core/terminal-cause.d.ts +6 -6
  202. package/dist/core/tool-face.d.ts +6 -2
  203. package/dist/core/tool-face.js +1 -1
  204. package/dist/core/tool-policy.d.ts +16 -13
  205. package/dist/core/tool-policy.js +11 -10
  206. package/dist/core/tool-roster.d.ts +4 -4
  207. package/dist/core/tool-spec.d.ts +42 -19
  208. package/dist/core/types.d.ts +2 -2
  209. package/dist/core/types.js +1 -1
  210. package/dist/core/untrusted-egress.d.ts +15 -4
  211. package/dist/core/untrusted-egress.js +23 -22
  212. package/dist/core/workspace-snapshot.d.ts +3 -1
  213. package/dist/core/workspace-snapshot.js +1 -0
  214. package/dist/engine/execution-env/node-execution-env.d.ts +3 -0
  215. package/dist/engine/execution-env/node-execution-env.js +12 -5
  216. package/dist/engine/harness/types.d.ts +77 -1
  217. package/dist/engine/harness/types.js +108 -0
  218. package/dist/engine/session/import-validate.js +6 -1
  219. package/dist/engine/session/parent-chain-guard.d.ts +3 -3
  220. package/dist/engine/session/parent-chain-guard.js +1 -1
  221. package/dist/engine/session/path-to-root.d.ts +18 -3
  222. package/dist/engine/session/path-to-root.js +15 -1
  223. package/dist/engine/session/repo-utils.d.ts +12 -1
  224. package/dist/engine/session/repo-utils.js +41 -0
  225. package/dist/engine/session/session.d.ts +24 -1
  226. package/dist/engine/session/session.js +46 -2
  227. package/dist/engine/session/storage-base.d.ts +20 -0
  228. package/dist/engine/session/storage-base.js +28 -9
  229. package/dist/index.d.ts +16 -12
  230. package/dist/index.js +11 -8
  231. package/dist/internal/harness-types.d.ts +1 -1
  232. package/dist/internal/harness.d.ts +4 -3
  233. package/dist/internal/harness.js +3 -2
  234. package/dist/orchestration/run-workflow-tool.d.ts +7 -1
  235. package/dist/orchestration/run-workflow-tool.js +28 -11
  236. package/dist/orchestration/workflow-governance.d.ts +1 -1
  237. package/dist/orchestration/workflow.d.ts +6 -0
  238. package/dist/orchestration/workflow.js +5 -8
  239. package/dist/stores/file/checkpoint-store.d.ts +2 -0
  240. package/dist/stores/file/checkpoint-store.js +7 -6
  241. package/dist/stores/file/fs-atomic.d.ts +0 -22
  242. package/dist/stores/file/fs-atomic.js +0 -17
  243. package/dist/stores/file/index.d.ts +2 -9
  244. package/dist/stores/file/index.js +2 -4
  245. package/dist/stores/file/session-store.d.ts +13 -7
  246. package/dist/stores/file/session-store.js +42 -18
  247. package/dist/tools/fs/bash-program-position.d.ts +3 -2
  248. package/dist/tools/fs/bash-program-position.js +10 -10
  249. package/dist/tools/fs/program-read-model.d.ts +34 -10
  250. package/dist/tools/fs/program-read-model.js +37 -7
  251. package/dist/tools/fs/program-read-model.rows.js +13 -2
  252. package/dist/tools/fs/read-deny.d.ts +13 -1
  253. package/dist/tools/fs/read-deny.js +10 -2
  254. package/dist/tools/fs/removal-targets.js +5 -5
  255. package/dist/tools/fs/safety.d.ts +2 -0
  256. package/dist/tools/fs/safety.js +1 -1
  257. package/dist/tools/fs/shell-read-argv.d.ts +11 -2
  258. package/dist/tools/fs/shell-read-argv.js +45 -29
  259. package/dist/tools/fs/shell-read-bindings.d.ts +20 -2
  260. package/dist/tools/fs/shell-read-bindings.js +153 -69
  261. package/dist/tools/fs/shell-read-brace.d.ts +18 -0
  262. package/dist/tools/fs/shell-read-brace.js +79 -0
  263. package/dist/tools/fs/shell-read-check.js +29 -11
  264. package/dist/tools/fs/shell-read-establish.js +43 -22
  265. package/dist/tools/fs/shell-read-functions.js +2 -2
  266. package/dist/tools/fs/shell-read-judge.d.ts +11 -0
  267. package/dist/tools/fs/shell-read-judge.js +3 -3
  268. package/dist/tools/fs/shell-read-object-path.d.ts +59 -0
  269. package/dist/tools/fs/shell-read-object-path.js +119 -0
  270. package/dist/tools/fs/shell-read-plan.d.ts +18 -0
  271. package/dist/tools/fs/shell-read-plan.js +217 -104
  272. package/dist/tools/fs/shell-read-start.d.ts +76 -13
  273. package/dist/tools/fs/shell-read-start.js +97 -17
  274. package/dist/tools/fs/shell-read-word.d.ts +10 -0
  275. package/dist/tools/fs/shell-read-word.js +9 -5
  276. package/dist/tools/fs/shell-read-workdir.d.ts +54 -14
  277. package/dist/tools/fs/shell-read-workdir.js +103 -19
  278. package/dist/tools/fs/shell-read-write-targets.js +13 -8
  279. package/dist/tools/worktree.d.ts +3 -2
  280. package/dist/tools/worktree.js +7 -35
  281. package/package.json +3 -2
  282. package/test/export-surface.snapshot.json +93 -43
  283. package/wire-changes/core-stores-sql@7.62.0.json +30 -0
  284. package/wire-changes/core-stores-sql@7.63.0.json +30 -0
  285. package/wire-changes/core@7.62.0.json +2181 -0
  286. package/wire-changes/core@7.63.0.json +3523 -0
  287. package/wire-changes/mods-kernel@7.62.0.json +42 -0
  288. package/wire-changes/mods-kernel@7.63.0.json +30 -0
  289. package/wire-changes/primitives@7.62.0.json +30 -0
  290. package/wire-changes/primitives@7.63.0.json +445 -0
  291. package/dist/core/consolidate-scope.d.ts +0 -93
  292. package/dist/core/consolidate-scope.js +0 -98
  293. package/dist/core/credential-vocabulary.d.ts +0 -176
  294. package/dist/core/credential-vocabulary.js +0 -190
  295. package/dist/core/redaction-passes.d.ts +0 -82
  296. package/dist/core/redaction-passes.js +0 -377
  297. package/dist/core/runner/memory-consolidation.d.ts +0 -109
  298. package/dist/core/runner/memory-consolidation.js +0 -251
package/dist/index.d.ts CHANGED
@@ -72,6 +72,7 @@ export { askUnresolvableNotice, type AskUnresolvableFacts } from "./core/ask-unr
72
72
  export { ASK_UNRESOLVABLE_CAUSES } from "./core/ask-unresolvable-notice.js";
73
73
  export { APPROVAL_REMEDY_KINDS, type ApprovalRemedy, type ApprovalRemedyKind } from "./core/ask-origin.js";
74
74
  export { USER_INPUT_UNDRAINED_CAUSES, type UserInputUndrainedCause, USER_INPUT_UNDRAINED_FAMILIES } from "./core/engine-notice.js";
75
+ export { setDefaultEngineNoticeSeat } from "./core/engine-notice.js";
75
76
  export { STEER_REPLAY_FACETS, type SteerReplayFacet } from "./core/steer-replay.js";
76
77
  export { TOOL_TURN_INCOMPLETE_CAUSES, type ToolTurnIncompleteCause } from "./internal/llm.js";
77
78
  export { MODEL_OUTPUT_INVALID_CAUSES, type ModelOutputInvalidCause, type ModelOutputInvalid, type OutputLimit } from "./internal/llm.js";
@@ -120,6 +121,7 @@ export { withRetry } from "./core/with-retry.js";
120
121
  export type { RetryPolicy, RetryResult } from "./core/with-retry.js";
121
122
  export type { RemoteExecutionEnv, WorkspaceHandle, SnapshotId, SessionToken, SandboxTier, OutputChunk, ExecStreamOptions, RemoteConnectConfig, VmLifecycleOptions, SecretRef, RemoteExecutionErrorCode, ExecutionEnvFactory, ExecutionEnvFactoryContext, PlacementTarget, } from "./core/remote-env.js";
122
123
  export { addWorktree, pruneWorktrees, WORKTREE_PARENT, type AddWorktreeOptions } from "./core/git-worktree-env.js";
124
+ export { probeWorktreeCapability, releaseSessionCheckout, WORKTREE_INCAPABLE_REASONS, type ReleasedTree, type WorkspaceDeclaration, type WorkspaceSourceDeclaration, type WorktreeCapability, type WorktreeIncapableReason, } from "./core/session-checkout.js";
123
125
  export { runExecGate } from "./core/exec-gate.js";
124
126
  export type { ExecStep, ExecStepResult, ExecGateResult, ExecGateOptions } from "./core/exec-gate.js";
125
127
  export { sanitizeUntrustedText, delimitUntrusted, inlineUntrusted, isMintableProbeReason } from "./core/untrusted-text.js";
@@ -134,11 +136,12 @@ export { deploymentFaceClampNotice, resolveContainmentFace, type ContainmentFace
134
136
  export { WRITE_PROTECTED_DEFAULT_TABLE, resolveWriteProtectedTable, compileWriteProtection, type WriteProtectedEntry, type WriteProtectedRow, type WriteProtectedKind, type WriteProtectedHit, type WriteProtectionMatcher, type WriteProtectionVerdict, type WriteProtectionViewAbsence, type WriteProtectionJudgeContext, type WriteProtectionCompileOptions, type WriteProtectionCheck, WRITE_PROTECTION_TARGET_VIEWS, type WriteProtectionTargetView, type WriteProtectionMount, } from "./core/write-protect.js";
135
137
  export { InMemoryToolResultStore, OFFLOAD_TOOL_NAME, DEFAULT_TOOL_RESULT_THRESHOLD_CHARS, assertSafeToolResultRef, buildToolResultRef, toolResultContentSegment, MAX_MINTED_TOOL_RESULT_REF_CHARS, type ToolResultProvenance, assertToolResultProvenanceMatch, normalizeToolResultProvenance, toolResultProvenanceOf, ToolResultRefConflictError, TOOL_RESULT_REF_CONFLICT_CODE, type ToolResultStore, type ToolResultSlice, type ToolResultDeletionReport, type ToolResultSessionListing, type ToolResultListedEntry, } from "./core/tool-result-store.js";
136
138
  export { InMemoryCheckpointStore, CheckpointError, mintCheckpointId, mintCheckpointToken, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, MAX_SUPPORTED_CHECKPOINT_VERSION, ORG_ADMISSION_CHECKPOINT_VERSION, F012_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, TOKEN_CHECKPOINT_VERSION, debitLedger, remainingBudgetMicroUsd, remainingTokens, winnerFromOutcome, validatePendingSteer, readPendingSteerQueue, appendPendingSteer, judgeParkedSteerRepeat, // #2705 — the queue's one identity judgment (append and the wake entrance read it)
137
- MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, type ActorAssertion, type PendingSteerEntry, type PendingSteerInput, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, type RiskDescriptor, type ProbeCause, type ProbeCauseOperands, type CheckpointStore, type CheckpointSummary, type Checkpoint, type CheckpointToken, type CheckpointGate, type CheckpointState, type SerializedCheckpointState, type CheckpointFaultMode, type PendingAction, type ResumeOutcome, type ResolvedOutcome, type ReopenReason, type ResolveExpectation, type TerminalClaimIntent, type TerminalClaimOutcome, type SafetyAxis, type RealApprovalGateBit, type ResourceLedger, type ResourceLimitReason, type PlatformLimitReason, type CheckpointRow, realApprovalOrgFact, resolveCheckpointStore, checkpointStoreIncomplete, } from "./core/checkpoint-store.js";
139
+ MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, type ActorAssertion, type PendingSteerEntry, type PendingSteerInput, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, type CheckpointRowVerdict, type RiskDescriptor, type ProbeCause, type ProbeCauseOperands, type CheckpointStore, type CheckpointSummary, type Checkpoint, type CheckpointToken, type CheckpointGate, type CheckpointState, type SerializedCheckpointState, type CheckpointFaultMode, type PendingAction, type ResumeOutcome, type ResolvedOutcome, type ReopenReason, type ResolveExpectation, type TerminalClaimIntent, type TerminalClaimOutcome, type SafetyAxis, type RealApprovalGateBit, type ResourceLedger, type ResourceLimitReason, type PlatformLimitReason, type CheckpointRow, realApprovalOrgFact, resolveCheckpointStore, checkpointStoreIncomplete, } from "./core/checkpoint-store.js";
138
140
  export { REOPEN_REASONS, RESUME_STARTUP_CAUSES, resumeStartupCauseOf, reopenReasonOf, type ResumeStartupCause } from "./core/resume-startup-cause.js";
139
141
  export { EXECUTION_OUTCOME_RECORD_WORDS, EXECUTION_RECORD_LEAVES_ROW_UNRECORDED, type ExecutionOutcomeRecordWord, type ExecutionRecordRowFacts, type ExecutionVerdict, ExecutionOutcomeConflictError, checkpointExecutionRecorded, executionRecordDisposition, sameExecutionRecord, executionVerdict, } from "./core/checkpoint-execution-record.js";
140
142
  export { PAUSE_REGISTRY, type GateKind, type PendingKind, type ResumeGate, isGateKind, resumeGateMatches, type CheckpointPause, type CheckpointFields, pauseOf, checkpointFrom, facetOf } from "./core/pause-registry.js";
141
143
  export { REQUIREMENT_WORDS, type RequirementWord, checkpointRequirementsFor } from "./core/checkpoint-requirements.js";
144
+ export { judgeCheckpointRow } from "./core/checkpoint-row-verdict.js";
142
145
  export { InMemoryUsageWindowStore, GLOBAL_USAGE_KEY, EMPTY_USAGE_WINDOW_RECORD, chargeUsageRecord, readUsageRecord, usageRetryAfterMs, resolveUsageWindows, type UsageWindow, type UsageWindowStore, type UsageWindowReading, type UsageWindowRecord, type UsageSlot, type UsageBucketRow, } from "./core/usage-window-store.js";
143
146
  export { FileUsageWindowStore, type FileUsageWindowStoreOptions } from "./stores/file/usage-window-store.js";
144
147
  export { ENV_LIFETIME_SUSPEND_MARGIN_MS, USAGE_WINDOW_REAP_MARGIN_MS } from "./core/runner/prepare-task.js";
@@ -161,7 +164,7 @@ export type { FileHistoryStore, FileHistoryResult, FileHistoryTrackResult, FileH
161
164
  export type { InMemoryFileHistoryStoreOptions } from "./core/file-history-store.js";
162
165
  export { DEFAULT_FILE_HISTORY_BOUNDARY_KEEP, resolveFileHistoryRetention, fileHistoryBoundariesToKeep } from "./core/file-history-retention.js";
163
166
  export type { FileHistoryRetentionPolicy } from "./core/file-history-retention.js";
164
- export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileMemoryStore, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, createFileConsolidationLock, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, type FileStoreLockErrorCode, processFingerprint, isProcessLive, type ProcessFingerprint, type FileStorageBackendOptions, type FileStorageCorruptReadInfo, type FileFileHistoryStoreOptions, type FileSessionRepoOptions, type FileCheckpointStoreOptions, type CheckpointLedgerEventKind, type CheckpointLedgerReading, type ReadCheckpointLedgerOptions, } from "./stores/file/index.js";
167
+ export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileMemoryStore, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, type FileStoreLockErrorCode, processFingerprint, isProcessLive, type ProcessFingerprint, type FileStorageBackendOptions, type FileStorageCorruptReadInfo, type FileFileHistoryStoreOptions, type FileSessionRepoOptions, type FileCheckpointStoreOptions, type CheckpointLedgerEventKind, type CheckpointLedgerReading, type ReadCheckpointLedgerOptions, } from "./stores/file/index.js";
165
168
  export { CacheBreakDetector, type CacheBreakFinding, type ToolFingerprintInput } from "./core/cache-break-detector.js";
166
169
  export { maybeCompact, type MaybeCompactOptions, type CompactionPassStart, type CompactionWindowSafetyInfo, type CompactionRestoreAsk } from "./core/auto-compaction.js";
167
170
  export type { MintedAttachmentFrame } from "./core/user-attachment.js";
@@ -290,31 +293,32 @@ export { FileDurableRulePartitionProvider, ORG_STATE_FILE } from "./stores/file/
290
293
  export { adoptFilePermissionRuleStore, type AdoptFileRuleStoreResult } from "./stores/file/permission-rule-adopt.js";
291
294
  export { AdoptionError, assertAdoptionBootGate, readRootAdoptionFile, writeRootAdoptionFile, ROOT_ADOPTION_FILE, type AdoptionErrorCode, type AdoptionReport, type AdoptionReceipt, type AdoptionLegReport, type AffectedDeploymentConfig, type RootAdoptionFile, } from "./stores/file/adoption/marker.js";
292
295
  export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdoptionQuarantine, readAdoptionStatus, type AdoptionStatus, type AdoptLocalDataRootOptions, type AdoptLocalDataRootResult, type AdoptionCarriageLeg, type AdoptionCarriageLegContext, type AdoptionConfigWitnessReceipt, } from "./stores/file/adoption/adopt.js";
293
- export { formatHookFeedback, runToolGate, createHookEnvCapabilities, type PersistedRuleHit, type PersistedRuleHitRule, type PersistedRuleUnreadable, type PersistedRuleCoverage, type PersistedRuleAnswer, normalizePersistedRuleHit, type HookInvocationIdentity, type ClassicEventBase, type PreToolUseEvent, type PostToolUseEvent, type PostToolUseFailureEvent, type PostToolBatchEvent, type UserPromptSubmitEvent, type SubagentStartEvent, type StopEvent, type StopFailureEvent, type PreCompactEvent, type PostCompactEvent, type StopHookResult, type HookEnvCapabilities, type HookToolOutput, type PreToolUseResult, type PostToolUseResult, type UserPromptSubmitResult, type SubagentStartResult, type HookToolFailure, type PostToolUseFailureResult, type PostToolBatchCall, type PostToolBatchResult, type PreCompactContext, type PreCompactResult, type PostCompactContext, type PermissionDeniedPayload, } from "./core/hooks.js";
296
+ export { formatHookFeedback, runToolGate, createHookEnvCapabilities, type PersistedRuleHit, type PersistedRuleHitRule, type PersistedRuleUnreadable, type PersistedRuleCoverage, type PersistedRuleAnswer, normalizePersistedRuleHit, type HookInvocationIdentity, type ClassicEventBase, type PreToolUseEvent, type PostToolUseEvent, type PostToolUseFailureEvent, type PostToolBatchEvent, type UserPromptSubmitEvent, type SubagentStartEvent, type StopEvent, type StopFailureEvent, type SessionStartEvent, type SessionEndEvent, type PreCompactEvent, type PostCompactEvent, type StopHookResult, type HookEnvCapabilities, type HookToolOutput, type PreToolUseResult, type PostToolUseResult, type UserPromptSubmitResult, type SubagentStartResult, type HookToolFailure, type PostToolUseFailureResult, type PostToolBatchCall, type PostToolBatchResult, type PreCompactContext, type PreCompactResult, type PostCompactContext, type PermissionDeniedPayload, } from "./core/hooks.js";
294
297
  export type { ClassicEventMap, ClassicEventName, ObservedAnswer, EngineModRegistration } from "./core/mods/classic-events.js";
295
298
  export { KERNEL_CONTRACT_VERSION, MOD_TIERS, MOD_SEATS, MOD_EVENT_SIDES, MOD_EVENT_TABLE, MODS_INVALID_CODE, MODS_REGISTRATION_REFUSED_CODE, type ModTier, type ModRegistrationTier, type ModSeat, type ModEventSide, type ModEventName, type ModEventRow, type ModStation, type ModRegistration, type ModUses, type On, type ModHandler, type ModHandlerOptions, type ModNext, type ModOrigin, type ModTraceEntry, type ModCaughtError, type ModDollarBase, type ModEventPayload, type ModMatcher, type ModAdmissionRecord, } from "./core/mods/kernel/index.js";
296
- export type { AgentSpawnAnswer, EngineDollar, ModelCompleteBlock, SessionAppendAnswer, SessionCompactAnswer, SessionSendAnswer, ToolCallAnswer } from "./core/mods/dollar.js";
297
- export { admitModChain } from "./core/mods/stations.js";
299
+ export type { AgentSpawnAnswer, EngineDollar, ModelCompleteBlock, SessionAppendAnswer, SessionCompactAnswer, SessionSendAnswer, SessionUsage, SessionVersion, ToolCallAnswer } from "./core/mods/dollar.js";
300
+ export type { ContextOccupancy } from "./core/mods/lifecycle-stations.js";
301
+ export { admitModChain, promptScreenDeclaredBy } from "./core/mods/stations.js";
298
302
  export { SESSION_APPEND_DOORS, SESSION_APPEND_ORIGIN_KINDS, type SessionAppendDoor, type SessionAppendOrigin } from "./core/mods/session-append.js";
299
303
  export { SESSION_RECEIVE_ORIGIN_KINDS, type SessionReceiveOrigin } from "./core/mods/session-receive.js";
300
304
  export { SESSION_SEND_ORIGIN_KINDS, type SessionSendOrigin } from "./core/mods/session-send.js";
301
305
  export { loadModPackage, type ModPackageHost, type ModPackageRegistration } from "./core/mods/package.js";
302
306
  export { CREDENTIAL_REF_KINDS, CREDENTIAL_REF_TRUST, CREDENTIAL_REF_TEXT_MAX, CREDENTIAL_REF_MAP_MAX, CREDENTIAL_REF_PROBLEM_REASONS, readCredentialRef, type CredentialRef, type CredentialRefKind, type CredentialRefRequestAdmission, type CredentialRefProblem, type CredentialRefProblemReason, type CredentialRefReading, } from "@sema-agent/primitives";
303
- export { InMemoryMemoryStore, composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, type NormalizedMemorySpec, type MemorySpecInput, supportsConsolidation, supportsPeriodicConsolidation, firstSentence, expandLexicalTerms, lexicalSearchMatch, type Embedder, classifyPromotable, enforcePromotableWriteGate, guardedMemoryStore, MemoryGateError, MemoryProjectionError, detectSecret, enforceSecretWriteGate, enforceStructuredNoteSecretGate, type UtilityGate, type MemoryStore, type MemoryVectorMode, type ScoredMemory, type MemoryNoteHeader, type MemoryNoteRecord, type MemoryNoteType, type StructuredNoteInput, MEMORY_PROJECT_KEY_ABSENT_REASONS, type MemoryProjectKeyAbsentReason, type MemoryProjectKey, } from "./core/memory.js";
304
- export { MemoryEngine, FileMemoryEngineBackend, memoryBackendContract, assertMemoryBackendSearchEquivalence, type MemoryBackendContractHooks, buildMemoryInstruction, writableRootOf, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, type OriginClearanceRow, type OriginClearanceEvent, type OriginClearanceShadow, committedDistilledOf, distilledEquals, type MemoryEntryDistilled, type MemoryEntryDistilledInput, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, readIntentCredentials, supersessionFuseCeiling, deriveShadowedSet, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, type ConsolidationGateRead, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type ConsolidationWriteGate, type MemoryConsolidationOptions, type ConsolidationCommitReceipt, type ConsolidationReconcileReport, type ConsolidationResolveReceipt, type ConsolidationPlanSummary, type ConsolidationPlanFoldEvidence, type SessionMemoryStatus, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, type CleanArmLeakFinding, type CleanArmLeakVerdict, type MemoryDistillerPurityContract, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, type ConsolidationDistillFn, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationDriveResult, type ConsolidationFoldState, type DistillerCandidate, type DistillerChatAnswer, type DistillerChatFn, type DistillerChatRequest, type FuseSchedule, type LlmConsolidationPlan, type LlmConsolidationPlanArm, type LlmConsolidationPlanProduct, type LlmDistillerContract, type MintLlmConsolidationPlanResult, type PlanParseRepairs, type SanitizedLlmGroups, CONSOLIDATION_DRIVER_PLANS_DIR, CONSOLIDATION_DRIVER_RUNS_FILE, CONSOLIDATION_RUN_STOP_REASONS, CONSOLIDATION_WRITE_REFUSED_CODE, archiveDistillerPlan, readConsolidationDriverRun, runMemoryConsolidationDriver, type ConsolidationDriverEngine, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type ConsolidationRunStopReason, type ConsolidationWriteJudge, type ConsolidationWriteTarget, type RunMemoryConsolidationOptions, isInstructionEntry, type MemoryEntryOrigin, type MemoryOriginCause, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, markSessionCaptureOptOut, readSessionCaptureOptOut, listSessionCaptureOptOut, fileSessionCaptureRecordStore, type SessionCaptureOptOutRecord, type SessionCaptureOptOutMarkOutcome, type SessionCaptureRecordStore, readV2HeaderHints, type V2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, type ControlPlaneRebuildReceipt, type StrictControlPlaneLedger, type ChallengeAssignment, type ChallengeEvent, type ChallengedHistoryRow, type LineagePendingTxn, type LineagePromotion, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, type MemorySearchDetails, type MemorySearchHit, type CleanMemorySearchHit, type ExposedMemorySearchHit, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, type MemoryGetDetails, type MemoryIndexDetails, type MemoryIndexRow, type CleanMemoryIndexRow, type ExposedMemoryIndexRow, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, type MemoryAnnouncement, type ScanFinding, type MemoryEngineOptions, type MemoryInjection, type EntryProvenanceAccount, type TransferEvidence, type CommittedBinding, type CommittedEntrySnapshot, type CommittedScopeSnapshots, type EntryCustodyReport, erasureSelectHash, type EraseMemoryEntriesInput, type ErasureCarrierAnswer, type ErasureCarrierClass, type ErasureCountAnswer, type ErasureSelect, type ErasedBinding, type MemoryErasureAttestation, computeMemoryBundleHash, type MemoryExportBundle, type MemoryImportReport, type MemoryExportSnapshot, type MemoryBundleImportPlan, type BundleChallengeRow, type BundleLineageRow, type BundlePollutedSession, type MemoryBackend, type MemoryEntry, type MemoryEntryFrontmatter, type MemoryEntryHeader, type MemoryScopeEnumeration, type ScoredMemoryEntry, type NotePatch, type PatchReport, type MaterializedFile, type MemorySessionHandle, type HarvestReport, type HarvestRejection, type HarvestRejectionCode, type ParsedEntryFile, type ScannedEntryFile, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, isOrgScopeKey, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, type ParsedScopeKey, migrateScope, type MigrateScopeReport, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, type RemoteMemoryFile, type RemoteMemoryBaseline, type RemoteMaterialization, type RemoteHarvestResult, type InboundEntryFinding, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, type MemorySyncCursor, type MemorySyncConflict, type MemorySyncPlan, type RecallSource, syncMemoryScope, memorySyncStoreOf, carriesCredential, type MemorySyncTransport, type MemorySyncRequestBody, type MemorySyncResponseBody, type MemorySyncClientConflict, type SyncMemoryScopeOptions, type MemorySyncClientResult, memorySyncReportOf, memoryTravelGapOf, type MemorySyncLayerReport, type MemorySyncRoundReport, } from "./core/memory-engine/index.js";
307
+ export { InMemoryMemoryStore, composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, type NormalizedMemorySpec, type MemorySpecInput, supportsConsolidation, supportsPeriodicConsolidation, firstSentence, expandLexicalTerms, lexicalSearchMatch, type Embedder, classifyPromotable, enforcePromotableWriteGate, guardedMemoryStore, MemoryGateError, MemoryProjectionError, detectSecret, enforceSecretWriteGate, enforceStructuredNoteSecretGate, type UtilityGate, type MemoryVectorMode, type ScoredMemory, type MemoryNoteHeader, type MemoryNoteRecord, type MemoryNoteType, type StructuredNoteInput, MEMORY_PROJECT_KEY_ABSENT_REASONS, type MemoryProjectKeyAbsentReason, type MemoryProjectKey, } from "./core/memory.js";
308
+ export { MemoryEngine, FileMemoryEngineBackend, readMemoryLedgerForm, memoryBackendContract, assertMemoryBackendSearchEquivalence, type MemoryBackendContractHooks, memoryGovernanceStoreContract, type MemoryGovernanceStoreContractHooks, buildMemoryInstruction, writableRootOf, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, type OriginClearanceRow, type OriginClearanceEvent, type OriginClearanceShadow, committedDistilledOf, distilledEquals, type MemoryEntryDistilled, type MemoryEntryDistilledInput, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, memoryGovernanceDurability, type MemoryGovernanceDurability, deriveShadowedSet, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, type ConsolidationGateRead, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type ConsolidationWriteGate, type MemoryConsolidationOptions, type ConsolidationCommitReceipt, type ConsolidationReconcileReport, type ConsolidationResolveReceipt, type ConsolidationPlanSummary, type ConsolidationPlanFoldEvidence, type SessionMemoryStatus, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, type CleanArmLeakFinding, type CleanArmLeakVerdict, type MemoryDistillerPurityContract, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, type ConsolidationDistillFn, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationDriveResult, type ConsolidationFoldState, type DistillerCandidate, type DistillerChatAnswer, type DistillerChatFn, type DistillerChatRequest, type FuseSchedule, type LlmConsolidationPlan, type LlmConsolidationPlanArm, type LlmConsolidationPlanProduct, type LlmDistillerContract, type MintLlmConsolidationPlanResult, type PlanParseRepairs, type SanitizedLlmGroups, CONSOLIDATION_RUN_STOP_REASONS, CONSOLIDATION_WRITE_REFUSED_CODE, runMemoryConsolidationDriver, type ConsolidationDriverEngine, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type ConsolidationRunStopReason, type ConsolidationWriteJudge, type ConsolidationWriteTarget, type RunMemoryConsolidationOptions, isInstructionEntry, type MemoryEntryOrigin, type MemoryOriginCause, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, markSessionCaptureOptOut, readSessionCaptureOptOut, listSessionCaptureOptOut, fileSessionCaptureRecordStore, type SessionCaptureOptOutRecord, type SessionCaptureOptOutMarkOutcome, type SessionCaptureRecordStore, readV2HeaderHints, type V2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, type ControlPlaneRebuildReceipt, type StrictControlPlaneLedger, type ChallengeAssignment, type ChallengeEvent, type ChallengedHistoryRow, type LineagePendingTxn, type LineagePromotion, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, type MemorySearchDetails, type MemorySearchHit, type CleanMemorySearchHit, type ExposedMemorySearchHit, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, type MemoryGetDetails, type MemoryIndexDetails, type MemoryIndexRow, type CleanMemoryIndexRow, type ExposedMemoryIndexRow, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, type MemoryAnnouncement, type ScanFinding, type MemoryEngineOptions, type MemoryInjection, type EntryProvenanceAccount, type TransferEvidence, type CommittedBinding, type CommittedEntrySnapshot, type CommittedScopeSnapshots, type EntryCustodyReport, erasureSelectHash, type EraseMemoryEntriesInput, type ErasureCarrierAnswer, type ErasureCarrierClass, type ErasureCountAnswer, type ErasureSelect, type ErasedBinding, type MemoryErasureAttestation, computeMemoryBundleHash, type MemoryExportBundle, type MemoryImportReport, type MemoryExportSnapshot, type MemoryBundleImportPlan, type BundleChallengeRow, type BundleLineageRow, type BundlePollutedSession, type MemoryBackend, type MemoryGovernanceStore, MEMORY_GOVERNANCE_DOC_NAMES, type MemoryGovernanceDocName, type MemoryGovernanceDocs, type ConsolidationTx, type MemoryEntry, type MemoryEntryFrontmatter, type MemoryEntryHeader, type MemoryScopeEnumeration, type ScoredMemoryEntry, type NotePatch, type PatchReport, type MaterializedFile, type MemorySessionHandle, type HarvestReport, type HarvestRejection, type HarvestRejectionCode, type ParsedEntryFile, type ScannedEntryFile, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatUserLocalScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, isReplicableScope, isOrgScopeKey, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, type ParsedScopeKey, migrateScope, type MigrateScopeReport, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, type RemoteMemoryFile, type RemoteMemoryBaseline, type RemoteMaterialization, type RemoteHarvestResult, type InboundEntryFinding, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, type MemorySyncCursor, type MemorySyncConflict, type MemorySyncPlan, type RecallSource, syncMemoryScope, memorySyncStoreOf, carriesCredential, type MemorySyncTransport, type MemorySyncRequestBody, type MemorySyncResponseBody, type MemorySyncClientConflict, type SyncMemoryScopeOptions, type MemorySyncClientResult, memorySyncReportOf, memoryTravelGapOf, type MemorySyncLayerReport, type MemorySyncRoundReport, } from "./core/memory-engine/index.js";
305
309
  export { createConsolidationWriteJudge, deliverWriteRefusal, type ConsolidationWriteJudgeInput } from "./core/runner/memory-consolidation-write-judge.js";
306
310
  export { STORE_FORM_REFUSAL_CODES, TARGET_OUTSIDE_STORE, SCOPE_HOME_NOT_DIRECTORY, SCOPE_HOME_FORMS, type StoreFormRefusalCode, type StoreFormRefusalDetail, type StoreFormRefusal, type ScopeHomeForm } from "./core/memory-engine/layout.js";
307
311
  export { resolveMemoryScopeStore, type MemoryScopeStore, type MemoryScopeStoreInput } from "./core/memory-engine/dual-root.js";
308
- export { classifyScopePlanes, scopePlanesOf, type ScopePlanes } from "./core/memory-engine/dual-root.js";
312
+ export { classifyScopePlanes, memoryScopePlaneOf, scopePlanesOf, type ScopePlanes } from "./core/memory-engine/dual-root.js";
309
313
  export { createMemoryDeployment, type MemoryDeployment, type MemoryDeploymentInput, type MemoryDeploymentStore, type DeploymentSessionMemoryStatus, } from "./core/memory-engine/memory-deployment.js";
310
314
  export { reanchorMemoryStoreRoot, type StoreRootReanchor } from "./core/memory-engine/layout.js";
315
+ export { admittingLandings, cutPerLanding, LandingsNeedAdmission, MAX_LANDING_ADMISSION_ROUNDS, requireLandingsAdmitted, type AdmitLandings, type LandingCut, type PatchLanding, type PatchShare, } from "./core/memory-engine/landing-admission.js";
316
+ export { NON_GOVERNANCE_MEMORY_CODES } from "./core/governance-codes.js";
311
317
  export { SHARED_MEMORY_READ_CAP_BYTES, SHARED_MEMORY_LIST_PAGE_SIZE, SharedMemoryStoreError, type SharedMemoryStoreProvider, type SharedMemoryStoreReader, type SharedMemoryPagedList, type SharedMemoryStoreInfo, type SharedMemoryDocumentEntry, type SharedMemorySnapshot, type SharedMemoryRequestContext, type MemoryListDetails, type MemoryReadDetails, } from "./core/shared-memory/types.js";
312
318
  export { isSharedMemoryDocumentPath, isSharedMemoryStoreId } from "./core/shared-memory/normalize.js";
313
319
  export { sharedMemoryStoreContract, type SharedMemoryFixture, type SharedMemoryStoreContractHooks, } from "./core/shared-memory/contract.js";
314
320
  export { termSet, jaccardDistance, cosineDistance } from "./core/memory-vector.js";
315
321
  export { encodeSurfacedKey, buildManifestText, validateSelectedIds, composeSelectiveBody, formatMemoryAge, resolveLinkedIds, RECALL_CAVEAT, DEFAULT_MAX_SELECTED, DEFAULT_MAX_LINKED, type MemorySelector, type MemorySelectRequest, type SelectiveRecallOptions, type SelectiveRecallResult, type LayeredRecallOptions, type LayeredRecallResult, } from "./core/memory-recall.js";
316
- export { runMemoryConsolidation, CONSOLIDATION_SYSTEM_PROMPT, DEFAULT_CONSOLIDATION_BAND, DEFAULT_CONSOLIDATION_SEARCH_LIMIT, DEFAULT_CONSOLIDATION_MAX_NOTES, normalizeForExactMatch, type ConsolidationParams, type ConsolidationStats, type ConsolidationNote, type ConsolidationLLM, } from "./core/runner/memory-consolidation.js";
317
- export { consolidateScope, advanceCursorAfterInline, type ConsolidateScopeDeps, type ConsolidateScopeOptions, } from "./core/consolidate-scope.js";
318
322
  export { resolveMemoryConsolidationDriver, autoRunOnRecommendationEffective, // the ONE arming reading (`memory.auto_consolidation.arming_has_one_resolver`) — the seat's absence is not "off"
319
323
  type MemoryConsolidationDriverDeps, } from "./core/runner/memory-consolidation-driver.js";
320
324
  export { teardownLegBudget } from "./core/runner/teardown-bounded.js";
@@ -382,7 +386,7 @@ export { readAgentState, agentStateSourceOfRecord, agentStateSummary, type Agent
382
386
  export type { TranscriptStep } from "./agents/subagent-steps.js";
383
387
  export type { UnifiedTaskResult } from "./core/task-registry-shared.js";
384
388
  export { TASK_OUTPUT_REPLAY_KINDS, type TaskOutputReplay } from "./core/task-registry-shared.js";
385
- export { REMOVAL_LIVENESS_WORDS, type RemovalLiveness, RULE_WRITE_COMMITTED_WORDS, type RuleWriteCommitted } from "./core/permission-rule-store.js";
389
+ export { REMOVAL_LIVENESS_WORDS, type RemovalLiveness, RULE_REFUSAL_CODES, type RuleRefusalCode, RULE_WRITE_COMMITTED_WORDS, type RuleWriteCommitted } from "./core/permission-rule-store.js";
386
390
  export { normalizeReadRootCandidate, READ_ROOT_CANDIDATE_DIR_MAX } from "./core/read-root-candidate.js";
387
391
  export { FileBackgroundAgentStore, type FileBackgroundAgentStoreOptions } from "./stores/file/background-agent-store.js";
388
392
  export { A2A_TASK_STATES, type A2ATaskState, type A2ATaskStateReversal, type A2ATaskStateReversalFaithful, type A2ATaskStateReversalLossy, toA2ATaskState, fromA2ATaskState, } from "./core/a2a-task-state.js";
@@ -425,7 +429,7 @@ export { principalInboundLayers } from "./agents/cross-session-judge.js";
425
429
  export { PRINCIPAL_INBOX_UNMINTED_CAUSE } from "./agents/peer-session-drain.js";
426
430
  export { renderCrossSessionMessageFrame, renderCrossSessionNoticeLine } from "./core/task-notification.js";
427
431
  export { PEER_HELD_QUEUE_CAP, PEER_IDLE_SUBSCRIPTION_TTL_MS, PEER_IDLE_SUBSCRIBER_TABLE_CAP, PEER_IDLE_OUTSTANDING_CAP, PEER_IDLE_PRIORS_KEPT, PEER_IDLE_FIRE_DEBOUNCE_MS, PEER_IDLE_HELD_BACKOFF_MS, PEER_IDLE_LABEL_MAX, CROSS_SESSION_DIALOG_EXPIRY_VALUES, CROSS_SESSION_DIALOG_EXPIRY_DEFAULT, resolveCrossSessionDialogExpiry, PEER_HELD_REVIEW_CAUSES, PEER_DELIVERY_RECEIPT_STATES, isPeerDeliveryReceiptState, PEER_DROP_REASONS, peerRecipientSuffix, renderCrossSessionDeliveryNotice, describePeerDropReasons, renderCrossSessionDroppedNotice, PEER_IDLE_NOTICE_KINDS, isPeerIdleNoticeKind, PEER_IDLE_UNAVAILABLE_CAUSES, peerIdleNoticeLabel, formatPeerNoticeClock, renderCrossSessionIdleNotice, describePeerIdleSubscription, type CrossSessionDialogExpiry, type ResolvedCrossSessionDialogExpiry, type PeerDeliveryReceiptState, type PeerDropReason, type PeerIdleNoticeKind, type PeerIdleNoticeFields, } from "./agents/peer-notices.js";
428
- export { createPeerHeldQueue, peerHeldQueueFor, peerHeldQueueIfAny, peerHeldQueueKey, realPeerClock, type PeerInboundHoldCause, type PeerHeldEntry, type PeerHeldSettlement, type PeerHeldSettleReason, type PeerHeldSettleOutcome, type PeerHoldOutcome, type PeerCardDecision, type PeerClock, type PeerHeldQueueSink, type PeerHeldQueueConfig, type PeerHeldQueue, } from "./agents/peer-held-queue.js";
432
+ export { createPeerHeldQueue, peerHeldQueueFor, peerHeldQueueIfAny, peerHeldQueueKey, listPeerHeldQueues, realPeerClock, type PeerHeldQueueSnapshot, type PeerInboundHoldCause, type PeerHeldEntry, type PeerHeldSettlement, type PeerHeldSettleReason, type PeerHeldSettleOutcome, type PeerHoldOutcome, type PeerCardDecision, type PeerClock, type PeerHeldQueueSink, type PeerHeldQueueConfig, type PeerHeldQueue, } from "./agents/peer-held-queue.js";
429
433
  export { createPeerIdleTarget, createPeerIdleRequester, peerIdleMachineFor, peerIdleMachineIfAny, peerIdleMachineKey, type PeerIdleSubscriber, type PeerIdleTargetNotice, type PeerIdleTargetSink, type PeerIdleSubscribeOutcome, type PeerIdleTarget, type PeerIdleOutstanding, type PeerIdleRequesterSink, type PeerIdleRequester, type PeerIdleMachine, } from "./agents/peer-idle.js";
430
434
  export { routePeerDeliveryReceipt, routePeerDroppedReceipt, routePeerIdleNotice, type PeerNoticeRoute } from "./agents/peer-notice-route.js";
431
435
  export { type PeerAdmissionStage } from "./agents/peer-admission.js";
package/dist/index.js CHANGED
@@ -57,6 +57,7 @@ export { askUnresolvableNotice } from "./core/ask-unresolvable-notice.js";
57
57
  export { ASK_UNRESOLVABLE_CAUSES } from "./core/ask-unresolvable-notice.js";
58
58
  export { APPROVAL_REMEDY_KINDS } from "./core/ask-origin.js";
59
59
  export { USER_INPUT_UNDRAINED_CAUSES, USER_INPUT_UNDRAINED_FAMILIES } from "./core/engine-notice.js";
60
+ export { setDefaultEngineNoticeSeat } from "./core/engine-notice.js";
60
61
  export { STEER_REPLAY_FACETS } from "./core/steer-replay.js";
61
62
  export { TOOL_TURN_INCOMPLETE_CAUSES } from "./internal/llm.js";
62
63
  export { MODEL_OUTPUT_INVALID_CAUSES } from "./internal/llm.js";
@@ -97,6 +98,7 @@ export { confineShellStart } from "./core/shell-confinement.js";
97
98
  export { RemoteExecutionError, hasDestroy, isRemoteExecutionEnv, isSuspendable, isIsolated, canonicalPathIsAuthoritative, pathsAreHostLocal, keepsReadFloor, missingRestoreSurface, isRetryableRemoteErrorCode, RETRYABLE_REMOTE_ERROR_CODES, } from "./core/remote-env.js";
98
99
  export { withRetry } from "./core/with-retry.js";
99
100
  export { addWorktree, pruneWorktrees, WORKTREE_PARENT } from "./core/git-worktree-env.js";
101
+ export { probeWorktreeCapability, releaseSessionCheckout, WORKTREE_INCAPABLE_REASONS, } from "./core/session-checkout.js";
100
102
  export { runExecGate } from "./core/exec-gate.js";
101
103
  export { sanitizeUntrustedText, delimitUntrusted, inlineUntrusted, isMintableProbeReason } from "./core/untrusted-text.js";
102
104
  export { mintReminderMark, isValidReminderMark, openSystemReminder, mintSystemReminder, reminderMarkDeclaration } from "./core/reminder-mint.js";
@@ -113,6 +115,7 @@ export { REOPEN_REASONS, RESUME_STARTUP_CAUSES, resumeStartupCauseOf, reopenReas
113
115
  export { EXECUTION_OUTCOME_RECORD_WORDS, EXECUTION_RECORD_LEAVES_ROW_UNRECORDED, ExecutionOutcomeConflictError, checkpointExecutionRecorded, executionRecordDisposition, sameExecutionRecord, executionVerdict, } from "./core/checkpoint-execution-record.js";
114
116
  export { PAUSE_REGISTRY, isGateKind, resumeGateMatches, pauseOf, checkpointFrom, facetOf } from "./core/pause-registry.js";
115
117
  export { REQUIREMENT_WORDS, checkpointRequirementsFor } from "./core/checkpoint-requirements.js";
118
+ export { judgeCheckpointRow } from "./core/checkpoint-row-verdict.js";
116
119
  export { InMemoryUsageWindowStore, GLOBAL_USAGE_KEY, EMPTY_USAGE_WINDOW_RECORD, chargeUsageRecord, readUsageRecord, usageRetryAfterMs, resolveUsageWindows, } from "./core/usage-window-store.js";
117
120
  export { FileUsageWindowStore } from "./stores/file/usage-window-store.js";
118
121
  export { ENV_LIFETIME_SUSPEND_MARGIN_MS, USAGE_WINDOW_REAP_MARGIN_MS } from "./core/runner/prepare-task.js";
@@ -127,7 +130,7 @@ export { trackKeyOf as fileHistoryTrackKeyOf, resolveTrackKey as fileHistoryReso
127
130
  export { describeTrackKey as fileHistoryDescribeTrackKey, fileHistoryExportDigest, validateFileHistoryExport } from "./core/file-history-store.js";
128
131
  export { fileHistoryBlobExchangeOf } from "./core/file-history-store.js";
129
132
  export { DEFAULT_FILE_HISTORY_BOUNDARY_KEEP, resolveFileHistoryRetention, fileHistoryBoundariesToKeep } from "./core/file-history-retention.js";
130
- export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileMemoryStore, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, createFileConsolidationLock, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, processFingerprint, isProcessLive, } from "./stores/file/index.js";
133
+ export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileMemoryStore, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, processFingerprint, isProcessLive, } from "./stores/file/index.js";
131
134
  export { CacheBreakDetector } from "./core/cache-break-detector.js";
132
135
  export { maybeCompact } from "./core/auto-compaction.js";
133
136
  export { brainToRuntime } from "./core/runtime.js";
@@ -223,27 +226,27 @@ export { AdoptionError, assertAdoptionBootGate, readRootAdoptionFile, writeRootA
223
226
  export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdoptionQuarantine, readAdoptionStatus, } from "./stores/file/adoption/adopt.js";
224
227
  export { formatHookFeedback, runToolGate, createHookEnvCapabilities, normalizePersistedRuleHit, } from "./core/hooks.js";
225
228
  export { KERNEL_CONTRACT_VERSION, MOD_TIERS, MOD_SEATS, MOD_EVENT_SIDES, MOD_EVENT_TABLE, MODS_INVALID_CODE, MODS_REGISTRATION_REFUSED_CODE, } from "./core/mods/kernel/index.js";
226
- export { admitModChain } from "./core/mods/stations.js";
229
+ export { admitModChain, promptScreenDeclaredBy } from "./core/mods/stations.js";
227
230
  export { SESSION_APPEND_DOORS, SESSION_APPEND_ORIGIN_KINDS } from "./core/mods/session-append.js";
228
231
  export { SESSION_RECEIVE_ORIGIN_KINDS } from "./core/mods/session-receive.js";
229
232
  export { SESSION_SEND_ORIGIN_KINDS } from "./core/mods/session-send.js";
230
233
  export { loadModPackage } from "./core/mods/package.js";
231
234
  export { CREDENTIAL_REF_KINDS, CREDENTIAL_REF_TRUST, CREDENTIAL_REF_TEXT_MAX, CREDENTIAL_REF_MAP_MAX, CREDENTIAL_REF_PROBLEM_REASONS, readCredentialRef, } from "@sema-agent/primitives";
232
235
  export { InMemoryMemoryStore, composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, supportsConsolidation, supportsPeriodicConsolidation, firstSentence, expandLexicalTerms, lexicalSearchMatch, classifyPromotable, enforcePromotableWriteGate, guardedMemoryStore, MemoryGateError, MemoryProjectionError, detectSecret, enforceSecretWriteGate, enforceStructuredNoteSecretGate, MEMORY_PROJECT_KEY_ABSENT_REASONS, } from "./core/memory.js";
233
- export { MemoryEngine, FileMemoryEngineBackend, memoryBackendContract, assertMemoryBackendSearchEquivalence, buildMemoryInstruction, writableRootOf, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, committedDistilledOf, distilledEquals, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, readIntentCredentials, supersessionFuseCeiling, deriveShadowedSet, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, CONSOLIDATION_DRIVER_PLANS_DIR, CONSOLIDATION_DRIVER_RUNS_FILE, CONSOLIDATION_RUN_STOP_REASONS, CONSOLIDATION_WRITE_REFUSED_CODE, archiveDistillerPlan, readConsolidationDriverRun, runMemoryConsolidationDriver, isInstructionEntry, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, markSessionCaptureOptOut, readSessionCaptureOptOut, listSessionCaptureOptOut, fileSessionCaptureRecordStore, readV2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, erasureSelectHash, computeMemoryBundleHash, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, isOrgScopeKey, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, migrateScope, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, syncMemoryScope, memorySyncStoreOf, carriesCredential, memorySyncReportOf, memoryTravelGapOf, } from "./core/memory-engine/index.js";
236
+ export { MemoryEngine, FileMemoryEngineBackend, readMemoryLedgerForm, memoryBackendContract, assertMemoryBackendSearchEquivalence, memoryGovernanceStoreContract, buildMemoryInstruction, writableRootOf, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, committedDistilledOf, distilledEquals, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, memoryGovernanceDurability, deriveShadowedSet, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, CONSOLIDATION_RUN_STOP_REASONS, CONSOLIDATION_WRITE_REFUSED_CODE, runMemoryConsolidationDriver, isInstructionEntry, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, markSessionCaptureOptOut, readSessionCaptureOptOut, listSessionCaptureOptOut, fileSessionCaptureRecordStore, readV2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, erasureSelectHash, computeMemoryBundleHash, MEMORY_GOVERNANCE_DOC_NAMES, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatUserLocalScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, isReplicableScope, isOrgScopeKey, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, migrateScope, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, syncMemoryScope, memorySyncStoreOf, carriesCredential, memorySyncReportOf, memoryTravelGapOf, } from "./core/memory-engine/index.js";
234
237
  export { createConsolidationWriteJudge, deliverWriteRefusal } from "./core/runner/memory-consolidation-write-judge.js";
235
238
  export { STORE_FORM_REFUSAL_CODES, TARGET_OUTSIDE_STORE, SCOPE_HOME_NOT_DIRECTORY, SCOPE_HOME_FORMS } from "./core/memory-engine/layout.js";
236
239
  export { resolveMemoryScopeStore } from "./core/memory-engine/dual-root.js";
237
- export { classifyScopePlanes, scopePlanesOf } from "./core/memory-engine/dual-root.js";
240
+ export { classifyScopePlanes, memoryScopePlaneOf, scopePlanesOf } from "./core/memory-engine/dual-root.js";
238
241
  export { createMemoryDeployment, } from "./core/memory-engine/memory-deployment.js";
239
242
  export { reanchorMemoryStoreRoot } from "./core/memory-engine/layout.js";
243
+ export { admittingLandings, cutPerLanding, LandingsNeedAdmission, MAX_LANDING_ADMISSION_ROUNDS, requireLandingsAdmitted, } from "./core/memory-engine/landing-admission.js";
244
+ export { NON_GOVERNANCE_MEMORY_CODES } from "./core/governance-codes.js";
240
245
  export { SHARED_MEMORY_READ_CAP_BYTES, SHARED_MEMORY_LIST_PAGE_SIZE, SharedMemoryStoreError, } from "./core/shared-memory/types.js";
241
246
  export { isSharedMemoryDocumentPath, isSharedMemoryStoreId } from "./core/shared-memory/normalize.js";
242
247
  export { sharedMemoryStoreContract, } from "./core/shared-memory/contract.js";
243
248
  export { termSet, jaccardDistance, cosineDistance } from "./core/memory-vector.js";
244
249
  export { encodeSurfacedKey, buildManifestText, validateSelectedIds, composeSelectiveBody, formatMemoryAge, resolveLinkedIds, RECALL_CAVEAT, DEFAULT_MAX_SELECTED, DEFAULT_MAX_LINKED, } from "./core/memory-recall.js";
245
- export { runMemoryConsolidation, CONSOLIDATION_SYSTEM_PROMPT, DEFAULT_CONSOLIDATION_BAND, DEFAULT_CONSOLIDATION_SEARCH_LIMIT, DEFAULT_CONSOLIDATION_MAX_NOTES, normalizeForExactMatch, } from "./core/runner/memory-consolidation.js";
246
- export { consolidateScope, advanceCursorAfterInline, } from "./core/consolidate-scope.js";
247
250
  export { resolveMemoryConsolidationDriver, autoRunOnRecommendationEffective, } from "./core/runner/memory-consolidation-driver.js";
248
251
  export { teardownLegBudget } from "./core/runner/teardown-bounded.js";
249
252
  export { DEFAULT_COMPACTION_INSTRUCTIONS } from "./core/auto-compaction.js";
@@ -306,7 +309,7 @@ export { canAccessAgentRecord, STALE_RUNNING_REAP_ATTRIBUTION, BackgroundAgentSt
306
309
  export { serveDurableAgentRowLane, buildAgentPollDetails, } from "./core/task-registry-agent.js";
307
310
  export { readAgentState, agentStateSourceOfRecord, agentStateSummary, } from "./core/agent-state.js";
308
311
  export { TASK_OUTPUT_REPLAY_KINDS } from "./core/task-registry-shared.js";
309
- export { REMOVAL_LIVENESS_WORDS, RULE_WRITE_COMMITTED_WORDS } from "./core/permission-rule-store.js";
312
+ export { REMOVAL_LIVENESS_WORDS, RULE_REFUSAL_CODES, RULE_WRITE_COMMITTED_WORDS } from "./core/permission-rule-store.js";
310
313
  export { normalizeReadRootCandidate, READ_ROOT_CANDIDATE_DIR_MAX } from "./core/read-root-candidate.js";
311
314
  export { FileBackgroundAgentStore } from "./stores/file/background-agent-store.js";
312
315
  export { A2A_TASK_STATES, toA2ATaskState, fromA2ATaskState, } from "./core/a2a-task-state.js";
@@ -345,7 +348,7 @@ export { principalInboundLayers } from "./agents/cross-session-judge.js";
345
348
  export { PRINCIPAL_INBOX_UNMINTED_CAUSE } from "./agents/peer-session-drain.js";
346
349
  export { renderCrossSessionMessageFrame, renderCrossSessionNoticeLine } from "./core/task-notification.js";
347
350
  export { PEER_HELD_QUEUE_CAP, PEER_IDLE_SUBSCRIPTION_TTL_MS, PEER_IDLE_SUBSCRIBER_TABLE_CAP, PEER_IDLE_OUTSTANDING_CAP, PEER_IDLE_PRIORS_KEPT, PEER_IDLE_FIRE_DEBOUNCE_MS, PEER_IDLE_HELD_BACKOFF_MS, PEER_IDLE_LABEL_MAX, CROSS_SESSION_DIALOG_EXPIRY_VALUES, CROSS_SESSION_DIALOG_EXPIRY_DEFAULT, resolveCrossSessionDialogExpiry, PEER_HELD_REVIEW_CAUSES, PEER_DELIVERY_RECEIPT_STATES, isPeerDeliveryReceiptState, PEER_DROP_REASONS, peerRecipientSuffix, renderCrossSessionDeliveryNotice, describePeerDropReasons, renderCrossSessionDroppedNotice, PEER_IDLE_NOTICE_KINDS, isPeerIdleNoticeKind, PEER_IDLE_UNAVAILABLE_CAUSES, peerIdleNoticeLabel, formatPeerNoticeClock, renderCrossSessionIdleNotice, describePeerIdleSubscription, } from "./agents/peer-notices.js";
348
- export { createPeerHeldQueue, peerHeldQueueFor, peerHeldQueueIfAny, peerHeldQueueKey, realPeerClock, } from "./agents/peer-held-queue.js";
351
+ export { createPeerHeldQueue, peerHeldQueueFor, peerHeldQueueIfAny, peerHeldQueueKey, listPeerHeldQueues, realPeerClock, } from "./agents/peer-held-queue.js";
349
352
  export { createPeerIdleTarget, createPeerIdleRequester, peerIdleMachineFor, peerIdleMachineIfAny, peerIdleMachineKey, } from "./agents/peer-idle.js";
350
353
  export { routePeerDeliveryReceipt, routePeerDroppedReceipt, routePeerIdleNotice } from "./agents/peer-notice-route.js";
351
354
  export {} from "./agents/peer-admission.js";
@@ -9,7 +9,7 @@ export type { InvokedSkillRetention } from "../engine/compaction/utils.js";
9
9
  export type { AgentCoreRuntimeDeps } from "../engine/loop/runtime-deps.js";
10
10
  export type { LoopTerminalReason } from "../engine/loop/agent-loop.js";
11
11
  export type { AgentMessage, AgentTool, AgentToolResult, AgentToolUpdateCallback, ThinkingLevel, ToolExecutionMode, ToolInputValidationContext, ToolInputVerdict, } from "../engine/loop/types.js";
12
- export type { AgentHarnessEvent, CompactionSettings, ExecutionEnv, ExecutionErrorCode, FileError, FileKind, FileErrorCode, FileInfo, Result, WriteExpectation, WriteReceipt, SymlinkChain, BoundFileObject, Session, SessionMetadata, SessionRepo, SessionStorage, SessionTreeEntry, Skill, } from "../engine/harness/types.js";
12
+ export type { AgentHarnessEvent, CompactionSettings, ExecutionEnv, ExecutionErrorCode, FileError, FileKind, FileErrorCode, FileInfo, Result, WriteExpectation, WriteReceipt, SymlinkChain, BoundFileObject, Session, SessionCheckoutCell, SessionCheckoutDeclared, SessionCheckoutRecord, SessionCheckoutSource, SessionMetadata, SessionRepo, SessionStorage, SessionTreeEntry, Skill, } from "../engine/harness/types.js";
13
13
  export type { ExecutionEnvExecOptions, ExecResult, ReadFloor, ExecutionEnvCapabilities } from "../engine/harness/types.js";
14
14
  export type { SessionWriteOptions, CompactionEntry } from "../engine/harness/types.js";
15
15
  export type { RowAdmission, RowRaising } from "../engine/harness/types.js";
@@ -17,14 +17,15 @@ export { DEFAULT_CHARS_PER_TOKEN, DEFAULT_CLAMP_TOLERANCE, DEFAULT_COMPACTION_SE
17
17
  export { SKILL_RETENTION_PER_SKILL_MAX_CHARS, SKILL_RETENTION_TOTAL_MAX_CHARS, SKILL_RETENTION_TRUNCATION_MARKER, formatFileOperations, formatPersistedOutputRefs, readCompactionActiveTools, readRetainedInvokedSkills, renderInvokedSkillsRetention, } from "../engine/compaction/utils.js";
18
18
  export { NodeExecutionEnv } from "../engine/execution-env/node-execution-env.js";
19
19
  export { StoredSession, buildSessionContext } from "../engine/session/session.js";
20
- export { assertForkTarget, compareOccupants, forkRowCells, frozenRow, getEntriesToFork, importRowCells, incarnationCell, ownerCell, readIncarnationCell, readOwnerCell, rowExpectationMissed, sessionRowMatches } from "../engine/session/repo-utils.js";
20
+ export { assertForkTarget, compareOccupants, forkRowCells, frozenRow, getEntriesToFork, importRowCells, incarnationCell, ownerCell, placementCellToWrite, readIncarnationCell, readOwnerCell, readPlacementCell, rowExpectationMissed, sessionRowMatches } from "../engine/session/repo-utils.js";
21
21
  export { validateEntriesForImport, StreamingImportValidator } from "../engine/session/import-validate.js";
22
- export { BaseSessionStorage, leafIdAfterEntry, resolveLeafId, sessionLogMarkOf } from "../engine/session/storage-base.js";
22
+ export { BaseSessionStorage, entryParentLinks, leafIdAfterEntry, resolveLeafId, sessionLogMarkOf } from "../engine/session/storage-base.js";
23
23
  export { InMemorySessionStorage } from "../engine/session/memory-storage.js";
24
24
  export { InMemorySessionRepo } from "../engine/session/memory-repo.js";
25
25
  export { uuidv7 } from "../engine/session/uuid.js";
26
26
  export { ParentChainGuard } from "../engine/session/parent-chain-guard.js";
27
- export type { ForkPoint } from "../engine/session/path-to-root.js";
27
+ export type { ForkPoint, ReplayLoss } from "../engine/session/path-to-root.js";
28
+ export { LineageBreak, pathToRoot, replayLossText } from "../engine/session/path-to-root.js";
28
29
  export { findUnansweredToolBatch, readToolCallArguments } from "../engine/loop/agent-loop.js";
29
30
  export { SessionError } from "../engine/harness/types.js";
30
31
  export type { AnnouncedAdvisorState, AnnouncedListingSnapshot, AnnouncedListingSnapshotInput, AnnouncedMcpFailure } from "../engine/harness/types.js";
@@ -5,13 +5,14 @@ export { DEFAULT_CHARS_PER_TOKEN, DEFAULT_CLAMP_TOLERANCE, DEFAULT_COMPACTION_SE
5
5
  export { SKILL_RETENTION_PER_SKILL_MAX_CHARS, SKILL_RETENTION_TOTAL_MAX_CHARS, SKILL_RETENTION_TRUNCATION_MARKER, formatFileOperations, formatPersistedOutputRefs, readCompactionActiveTools, readRetainedInvokedSkills, renderInvokedSkillsRetention, } from "../engine/compaction/utils.js";
6
6
  export { NodeExecutionEnv } from "../engine/execution-env/node-execution-env.js";
7
7
  export { StoredSession, buildSessionContext } from "../engine/session/session.js";
8
- export { assertForkTarget, compareOccupants, forkRowCells, frozenRow, getEntriesToFork, importRowCells, incarnationCell, ownerCell, readIncarnationCell, readOwnerCell, rowExpectationMissed, sessionRowMatches } from "../engine/session/repo-utils.js";
8
+ export { assertForkTarget, compareOccupants, forkRowCells, frozenRow, getEntriesToFork, importRowCells, incarnationCell, ownerCell, placementCellToWrite, readIncarnationCell, readOwnerCell, readPlacementCell, rowExpectationMissed, sessionRowMatches } from "../engine/session/repo-utils.js";
9
9
  export { validateEntriesForImport, StreamingImportValidator } from "../engine/session/import-validate.js";
10
- export { BaseSessionStorage, leafIdAfterEntry, resolveLeafId, sessionLogMarkOf } from "../engine/session/storage-base.js";
10
+ export { BaseSessionStorage, entryParentLinks, leafIdAfterEntry, resolveLeafId, sessionLogMarkOf } from "../engine/session/storage-base.js";
11
11
  export { InMemorySessionStorage } from "../engine/session/memory-storage.js";
12
12
  export { InMemorySessionRepo } from "../engine/session/memory-repo.js";
13
13
  export { uuidv7 } from "../engine/session/uuid.js";
14
14
  export { ParentChainGuard } from "../engine/session/parent-chain-guard.js";
15
+ export { LineageBreak, pathToRoot, replayLossText } from "../engine/session/path-to-root.js";
15
16
  export { findUnansweredToolBatch, readToolCallArguments } from "../engine/loop/agent-loop.js";
16
17
  export { SessionError } from "../engine/harness/types.js";
17
18
  export { normalizeGitAnnouncement } from "../engine/harness/types.js";
@@ -184,6 +184,9 @@ export interface RunWorkflowToolDeps {
184
184
  /** The host run tree's cross-boundary token (`RunInternals.crossBoundaryTree`), riding deps for the same auto-mounted-ctx reason as
185
185
  * `rootSessionId` above; handed to the workflow run so every workflow-spawned agent joins the host tree's state. */
186
186
  crossBoundaryTree?: import("../core/cross-boundary-taint.js").CrossBoundaryTreeToken;
187
+ /** The host run tree's owner seat (`RunInternals.delegationOwner`), riding deps for the same auto-mounted-ctx reason; handed to the
188
+ * workflow run so every workflow-spawned agent (and the children it delegates) reads the host tree's owner. */
189
+ delegationOwner?: import("../core/runner/delegation-owner.js").DelegationOwnerSeat;
187
190
  /** Process-local unified task registry. When present, RunWorkflow returns `task_id === runId` with a `w*` id. */
188
191
  taskRegistry?: TaskRegistry;
189
192
  /** design/115 P2 core slice: run-local task-notification sink for SDK event + live model XML injection.
@@ -255,9 +258,12 @@ export interface RunWorkflowToolDeps {
255
258
  /** TRUSTED nesting depth from the run's internals (NOT a tool param) — passed to `startWorkflow` so a
256
259
  * cross-process child workflow is rejected by the one-level guard. */
257
260
  workflowDepth?: number;
258
- /** The HOST task's effective working root — threaded into every spawned agent's trusted internals so a
261
+ /** Where the HOST task writes (read at the spawn) — threaded into every spawned agent's trusted internals so a
259
262
  * TOC env factory can root the child at the parent's cwd (CC parity, 2026-07-03). */
260
263
  parentCwd?: string;
264
+ /** The HOST task's own task root — threaded beside {@link parentCwd} as `RunInternals.callerRoot`, the checkout a child's
265
+ * placement is judged against (whichever tree the host has switched to inside it). */
266
+ callerRoot?: string;
261
267
  /** The HOST task's own placement target (what its env reported as its workspace settled) — the fence every agent the
262
268
  * workflow spawns is minted under (`RunInternals.placementTarget`). Rides deps for the auto-mounted form (whose
263
269
  * execute ctx carries none); a rich ctx's own `placementTarget` wins. */
@@ -31,7 +31,7 @@ import { parseWorkflowMeta, splitWorkflowMeta, workflowScriptReadsClockOrRandom
31
31
  import { mergeWorkflowArgs, normalizeStringArg } from "./workflow-script-store.js";
32
32
  import { workflowSizeGuidelineSection } from "./workflow-size-guideline.js";
33
33
  import { mountRuleFace, toolFace } from "../core/tool-catalog-entries.js";
34
- import { thrownText } from "../core/thrown-value.js";
34
+ import { readMember, thrownText } from "../core/thrown-value.js";
35
35
  export const RUN_WORKFLOW_TOOL_NAME = "Workflow";
36
36
  export const WORKFLOW_NO_COMPLETION_CHANNEL = "a workflow run is not available here — no completion would come back from one on this mount (no notification channel and no deployment notifier is wired), and a workflow has no synchronous form. Do the work directly instead.";
37
37
  function stripCodeFences(s) {
@@ -119,10 +119,11 @@ const SCRIPT_ERROR_CODES = new Set([
119
119
  "workflow.budget_exceeded",
120
120
  ]);
121
121
  function failureSummary(err, runId) {
122
- const e = err;
123
- const code = typeof e?.code === "string" ? e.code : undefined;
122
+ const codeWord = readMember(err, "code");
123
+ const code = typeof codeWord === "string" ? codeWord : undefined;
124
124
  if (code === WORKFLOW_AGENT_PARKED_ERROR_CODE) {
125
- const msg = typeof e?.message === "string" ? egressText("same-principal", e.message) : "";
125
+ const parkedWords = readMember(err, "message");
126
+ const msg = typeof parkedWords === "string" ? egressText("same-principal", parkedWords) : "";
126
127
  return (`workflow parked (${code}): ${msg.length > 200 ? `${msg.slice(0, 200)}…` : msg} — it did not fail and is not finished` +
127
128
  (runId ? `; the diagnostics below name its record (the parked agent's row reads status "parked")` : "") +
128
129
  `; do not re-issue the same call — once the approval is decided, the deployment resumes this run${runId ? ` (resumeFromRunId: "${runId}")` : ""} and the script continues from the parked call`);
@@ -130,8 +131,9 @@ function failureSummary(err, runId) {
130
131
  const guide = runId
131
132
  ? `; which agents failed is in the diagnostics below; after fixing, re-invoke with resumeFromRunId: "${runId}" (completed agents replay from the journal)`
132
133
  : "";
133
- if (code && SCRIPT_ERROR_CODES.has(code) && typeof e?.message === "string") {
134
- const msg = egressText("same-principal", e.message);
134
+ const scriptWords = code && SCRIPT_ERROR_CODES.has(code) ? readMember(err, "message") : undefined;
135
+ if (code && typeof scriptWords === "string") {
136
+ const msg = egressText("same-principal", scriptWords);
135
137
  return `workflow failed (${code}): ${msg.length > 200 ? `${msg.slice(0, 200)}…` : msg}${guide}`;
136
138
  }
137
139
  return `${code && code.startsWith("workflow.") ? `workflow failed (${code})` : "workflow failed"}${guide}`;
@@ -517,6 +519,7 @@ async function mountRunWorkflowTool(d) {
517
519
  ...((ctx.placementRoot ?? d.placementRoot) !== undefined ? { placementRoot: ctx.placementRoot ?? d.placementRoot } : {}),
518
520
  ...((ctx.placementTarget ?? d.placementTarget) !== undefined ? { placementTarget: ctx.placementTarget ?? d.placementTarget } : {}),
519
521
  ...((ctx.crossBoundaryTreeForChildren ?? d.crossBoundaryTree) !== undefined ? { crossBoundaryTree: ctx.crossBoundaryTreeForChildren ?? d.crossBoundaryTree } : {}),
522
+ ...((ctx.delegationOwner ?? d.delegationOwner) !== undefined ? { delegationOwner: ctx.delegationOwner ?? d.delegationOwner } : {}),
520
523
  ...(workflowTaskId !== undefined ? { runId: workflowTaskId } : {}),
521
524
  journalStore: d.journalStore,
522
525
  ...(resumeFromRunId !== undefined ? { resumeFromRunId } : {}),
@@ -528,6 +531,7 @@ async function mountRunWorkflowTool(d) {
528
531
  maxResultChars: lim.maxResultChars ?? DEFAULTS.maxResultChars,
529
532
  maxLogChars: lim.maxLogChars ?? DEFAULTS.maxLogChars,
530
533
  ...(d.parentCwd !== undefined ? { parentCwd: d.parentCwd } : {}),
534
+ ...(d.callerRoot !== undefined ? { callerRoot: d.callerRoot } : {}),
531
535
  parentToolCallId: ctx.toolCallId,
532
536
  ...(sourceTaskId !== undefined ? { parentTaskId: sourceTaskId } : {}),
533
537
  ...((ctx.interactionPosture ?? d.parentInteractionPosture) !== undefined ? { interactionPosture: (ctx.interactionPosture ?? d.parentInteractionPosture) } : {}),
@@ -642,16 +646,29 @@ async function mountRunWorkflowTool(d) {
642
646
  diagnostics: workflowDiagnostics(runId, d.journalStore?.locator?.(runId, res.run.scope), res.run.resume?.journalEntries === 0, await recordOf(res.run).catch(() => "This run's record could not be read.")),
643
647
  completionId: res.run.completionId,
644
648
  }), async (err) => {
645
- const failedRun = settledRunOf(handle.done);
646
- const record = (failedRun !== undefined ? await recordOf(failedRun).catch(() => undefined) : undefined) ?? "This run's record could not be read.";
649
+ let parts = {
650
+ summary: failureSummary(undefined, runId),
651
+ diagnostics: workflowDiagnostics(runId, undefined, undefined, "This run's record could not be read."),
652
+ };
653
+ try {
654
+ const failedRun = settledRunOf(handle.done);
655
+ const record = (failedRun !== undefined ? await recordOf(failedRun).catch(() => undefined) : undefined) ?? "This run's record could not be read.";
656
+ const summary = failureSummary(err, runId);
657
+ const settleId = failedRun?.completionId;
658
+ parts = {
659
+ summary,
660
+ diagnostics: workflowDiagnostics(runId, undefined, undefined, record),
661
+ ...(settleId !== undefined ? { completionId: settleId } : {}),
662
+ };
663
+ }
664
+ catch {
665
+ }
647
666
  fire({
648
667
  task_id: runId,
649
668
  task_type: "workflow",
650
669
  ...(ctx.toolCallId !== undefined ? { toolUseId: ctx.toolCallId } : {}),
651
670
  status: "failed",
652
- summary: failureSummary(err, runId),
653
- diagnostics: workflowDiagnostics(runId, undefined, undefined, record),
654
- ...(failedRun?.completionId !== undefined ? { completionId: failedRun.completionId } : {}),
671
+ ...parts,
655
672
  });
656
673
  })
657
674
  .catch(() => { });
@@ -92,7 +92,7 @@ export interface WorkflowAgentSpec extends ScriptClampSeats {
92
92
  * restricting value, an add-only row through the row's script and entry laws. A row marked inherited-only (its
93
93
  * restricting value switches off an operator-side record) is outside this set and is stripped like any other key.
94
94
  */
95
- export declare const WHITELIST_KEYS: readonly ("thinking" | "objective" | "images" | "systemPrompt" | "limits" | ScriptSeat | "modelName")[];
95
+ export declare const WHITELIST_KEYS: readonly ("thinking" | "systemPrompt" | "objective" | "images" | "limits" | ScriptSeat | "modelName")[];
96
96
  /**
97
97
  * #505 ② — ACCEPTED ALIAS SPELLINGS on the spec: `alias → the {@link WHITELIST_KEYS} member it means`.
98
98
  *
@@ -355,6 +355,9 @@ export interface RunWorkflowOptions {
355
355
  /** The host run tree's cross-boundary token (`RunInternals.crossBoundaryTree`, threaded by the run-workflow tool): every
356
356
  * workflow-spawned agent joins the tree it names, so a bit a workflow agent sets is read by the host and its siblings. */
357
357
  crossBoundaryTree?: import("../core/cross-boundary-taint.js").CrossBoundaryTreeToken;
358
+ /** The host run tree's owner seat (`RunInternals.delegationOwner`, threaded by the run-workflow tool): every workflow-spawned agent
359
+ * holds it, so a child it delegates records the host tree's owner. */
360
+ delegationOwner?: import("../core/runner/delegation-owner.js").DelegationOwnerSeat;
358
361
  /** design/149 — the PROCESS-level child observer (same seam as
359
362
  * {@link import("../core/types.js").RunnerDeps.onBackgroundChildEvent}). When set, every workflow
360
363
  * agent emits spawn/tick/terminal {@link import("../core/types.js").BackgroundChildEvent} frames with a
@@ -435,6 +438,9 @@ export interface RunWorkflowOptions {
435
438
  * (`RunInternals.parentCwd`) so a TOC env factory roots children at the parent's cwd (CC parity;
436
439
  * `isolation: "worktree"` on an individual agent wins over it). */
437
440
  parentCwd?: string;
441
+ /** The HOST task's own task root — `RunInternals.callerRoot` on both spawn legs, the checkout a child's placement is judged
442
+ * against (the host's {@link parentCwd} can sit in a tree inside it). Absent: the host's root is where it works ({@link parentCwd}). */
443
+ callerRoot?: string;
438
444
  /**
439
445
  * The SPAWNING tool call's id (`run_workflow`'s own `ToolExecuteContext.toolCallId`) — threaded into every
440
446
  * spawned agent's trusted internals (`RunInternals.parentToolCallId`) so each child's frames carry this id
@@ -26,6 +26,7 @@ import { namesEveryTool } from "../agents/tool-filter.js";
26
26
  import { definitionAllowTools, withDefinitionServers } from "../agents/inherited-tool-pool.js";
27
27
  import { snapshotAndValidateMcpEntries } from "../core/locked-config.js";
28
28
  import { compileOutputSchema } from "../core/runner/strict-output-schema.js";
29
+ import { callerPlacementSeats } from "../core/runner/child-tree.js";
29
30
  import { WorkflowBudgetExceededError, WorkflowNestingError, WorkflowAgentBlockedError, WorkflowAgentParkedError, WorkflowAgentSchemaError, WorkflowAgentStalledError, WorkflowMaxAgentsError, WORKFLOW_SPAWN_BLOCKED_ERROR_CODE } from "./workflow-types.js";
30
31
  import { WorkflowScriptError } from "./workflow-meta.js";
31
32
  import { firstByteLaneKnobMs, STALL_FIRST_BYTE_MS, STALL_FIRST_TOKEN_MS } from "../brain/timeout.js";
@@ -742,6 +743,7 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
742
743
  ...(opts.placementRoot !== undefined ? { placementRoot: opts.placementRoot } : {}),
743
744
  ...(opts.placementTarget !== undefined ? { placementTarget: opts.placementTarget } : {}),
744
745
  ...(opts.crossBoundaryTree !== undefined ? { crossBoundaryTree: opts.crossBoundaryTree } : {}),
746
+ ...(opts.delegationOwner !== undefined ? { delegationOwner: opts.delegationOwner } : {}),
745
747
  ...(opts.originatingSessionId !== undefined ? { parentSessionId: opts.originatingSessionId } : {}),
746
748
  };
747
749
  const captureFloorSeatsNow = async () => {
@@ -1892,7 +1894,7 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
1892
1894
  opts.onForwardEvent(e.type === "task_progress" || e.type === "task_started" ? { ...e, workflowRunId: runId, workflowAgentLabel: label } : e);
1893
1895
  }
1894
1896
  : undefined;
1895
- const baseInternals = { ...(agentOpts.isolation ? { isolation: agentOpts.isolation } : {}), ...(opts.parentCwd !== undefined ? { parentCwd: opts.parentCwd, callerRoot: opts.parentCwd } : {}), ...spawnAttribution, ...(await captureFloorSeatsNow()), ...(enrichedForward !== undefined ? { onForwardEvent: enrichedForward } : {}), delegationTaskType: "workflow", agentName: label, onWorkspaceResolved: createWorkspaceObserver(rec) };
1897
+ const baseInternals = { ...(agentOpts.isolation ? { isolation: agentOpts.isolation } : {}), ...(opts.parentCwd !== undefined ? { parentCwd: opts.parentCwd } : {}), ...callerPlacementSeats(opts.parentCwd, opts.callerRoot), ...spawnAttribution, ...(await captureFloorSeatsNow()), ...(enrichedForward !== undefined ? { onForwardEvent: enrichedForward } : {}), delegationTaskType: "workflow", agentName: label, onWorkspaceResolved: createWorkspaceObserver(rec) };
1896
1898
  let attempts = 0;
1897
1899
  let throttleRetried = false;
1898
1900
  let lastAttemptReason;
@@ -2284,6 +2286,7 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
2284
2286
  ...(inheritedModelRef !== undefined ? { inheritedModelRef } : {}),
2285
2287
  ...(agentOpts.isolation ? { isolation: agentOpts.isolation } : {}),
2286
2288
  ...(opts.parentCwd !== undefined ? { parentCwd: opts.parentCwd } : {}),
2289
+ ...callerPlacementSeats(opts.parentCwd, opts.callerRoot),
2287
2290
  ...spawnAttribution,
2288
2291
  ...(await captureFloorSeatsNow()),
2289
2292
  ...(enrichedForwardS !== undefined ? { onForwardEvent: enrichedForwardS } : {}),
@@ -2782,13 +2785,7 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
2782
2785
  run.error = egressThrownText("same-principal", err);
2783
2786
  closeAbandonedAgents(run.endedAt);
2784
2787
  {
2785
- let thrownCode;
2786
- try {
2787
- thrownCode = err !== null && (typeof err === "object" || typeof err === "function") ? err.code : undefined;
2788
- }
2789
- catch {
2790
- thrownCode = undefined;
2791
- }
2788
+ const thrownCode = readMember(err, "code");
2792
2789
  const firstFailed = run.agents
2793
2790
  .filter((a) => a.status === "failed" && typeof a.errorCode === "string" && a.errorCode !== "")
2794
2791
  .sort((a, b) => (a.endedAt ?? Number.POSITIVE_INFINITY) - (b.endedAt ?? Number.POSITIVE_INFINITY))[0];
@@ -174,6 +174,8 @@ export declare class FileCheckpointStore implements CheckpointStore {
174
174
  private readonly ledger;
175
175
  private closed;
176
176
  private get cps();
177
+ /** The listing's memo of each replayed row object's verdict: a put or a replay holds a new object, so a replaced row is judged again. */
178
+ private readonly rowVerdicts;
177
179
  /** One-shot crash fault (mirrors `InMemoryCheckpointStore.testInjectFault`). */
178
180
  private fault;
179
181
  /** The guarded {@link FileCheckpointStoreOptions.onCorruptRead} seat (the ledger's replay and this store's projection share it). */
@@ -1,10 +1,10 @@
1
1
  import { join } from "node:path";
2
2
  import { assertAdoptionBootGate } from "./adoption/marker.js";
3
- import { optionKeys, receiveOptions } from "../../core/own-property-receipt.js";
3
+ import { memberPresent, optionKeys, receiveOptions } from "../../core/own-property-receipt.js";
4
4
  import { readLedgerTuning } from "./ledger-tuning.js";
5
5
  import { checkpointExecutionRecorded, executionRecordDisposition, ExecutionOutcomeConflictError, } from "../../core/checkpoint-execution-record.js";
6
6
  import { checkpointHolderMatches, checkpointOccMatches, checkpointRevOf } from "../../core/checkpoint-generation.js";
7
- import { appendPendingSteer, CheckpointError, checkpointRowMatches, encodeAtFidelity, summarizeCheckpoint, validatePendingSteer, winnerFromOutcome, } from "../../core/checkpoint-store.js";
7
+ import { appendPendingSteer, CheckpointError, checkpointRowMatches, encodeAtFidelity, summarizeStoredCheckpoint, validatePendingSteer, winnerFromOutcome, } from "../../core/checkpoint-store.js";
8
8
  import { checkpointDeadlinePassed, deleteSessionRowsAtStart, readCheckpointOverdueQuery, readCheckpointSessionQuery, selectOverduePage, selectSessionPage, } from "../../core/checkpoint-queries.js";
9
9
  import { readLedgerSettled, SharedLedgerTable } from "./shared-ledger.js";
10
10
  import { guardCorruptSink } from "./corrupt-read-sink.js";
@@ -27,9 +27,9 @@ function applyCheckpointEvent(cps, ev) {
27
27
  case "resolve":
28
28
  cp.status = "resolved";
29
29
  cp.rev = ev.rev;
30
- if (ev.resolvedOutcome !== undefined)
30
+ if (memberPresent(ev, "resolvedOutcome"))
31
31
  cp.resolvedOutcome = ev.resolvedOutcome;
32
- cp.reopenReason = undefined;
32
+ delete cp.reopenReason;
33
33
  break;
34
34
  case "reopen":
35
35
  cp.status = "pending";
@@ -103,6 +103,7 @@ export class FileCheckpointStore {
103
103
  get cps() {
104
104
  return this.ledger.rows;
105
105
  }
106
+ rowVerdicts = new WeakMap();
106
107
  fault = null;
107
108
  discloseCorrupt;
108
109
  ledgerPath;
@@ -255,7 +256,7 @@ export class FileCheckpointStore {
255
256
  const out = [];
256
257
  for (const cp of this.cps.values()) {
257
258
  if (cp.scope === scope && cp.status === "pending")
258
- out.push(summarizeCheckpoint(cp, disclose));
259
+ out.push(summarizeStoredCheckpoint(cp, this.rowVerdicts, disclose));
259
260
  }
260
261
  return out;
261
262
  }
@@ -272,7 +273,7 @@ export class FileCheckpointStore {
272
273
  }
273
274
  async listOverdue(query) {
274
275
  const disclose = this.listingDisclose();
275
- return selectOverduePage(this.cps.entries(), readCheckpointOverdueQuery(query), (cp) => summarizeCheckpoint(cp, disclose), disclose);
276
+ return selectOverduePage(this.cps.entries(), readCheckpointOverdueQuery(query), (cp) => summarizeStoredCheckpoint(cp, this.rowVerdicts, disclose), disclose);
276
277
  }
277
278
  async listBySession(query) {
278
279
  return selectSessionPage(this.cps.entries(), readCheckpointSessionQuery(query), (cp) => structuredClone(cp), this.listingDisclose());