@sema-agent/core 7.72.0 → 7.73.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 (256) hide show
  1. package/CHANGELOG.md +319 -0
  2. package/dist/agents/inherited-tool-pool.d.ts +26 -1
  3. package/dist/agents/inherited-tool-pool.js +46 -2
  4. package/dist/agents/parked-resume-drive.d.ts +10 -0
  5. package/dist/agents/parked-resume-drive.js +9 -0
  6. package/dist/agents/retain-ledger.d.ts +3 -0
  7. package/dist/agents/send-message-tool.js +1 -0
  8. package/dist/agents/send-user-message-tool.d.ts +12 -0
  9. package/dist/agents/send-user-message-tool.js +67 -0
  10. package/dist/agents/subagent-steps.d.ts +9 -0
  11. package/dist/agents/subagent-steps.js +38 -0
  12. package/dist/agents/subagent.d.ts +2 -0
  13. package/dist/agents/subagent.js +43 -12
  14. package/dist/agents/verify.js +23 -8
  15. package/dist/agents/yield-adoption.js +3 -1
  16. package/dist/brain/anthropic.js +14 -9
  17. package/dist/brain/open-responses.js +4 -5
  18. package/dist/brain/openai.js +30 -23
  19. package/dist/brain/stream-engine.js +159 -151
  20. package/dist/core/actions-digest.d.ts +43 -0
  21. package/dist/core/actions-digest.js +22 -0
  22. package/dist/core/allow-entry.js +3 -3
  23. package/dist/core/auto-mode.d.ts +7 -9
  24. package/dist/core/auto-mode.js +114 -8
  25. package/dist/core/checkpoint-features.d.ts +3 -2
  26. package/dist/core/checkpoint-features.js +1 -1
  27. package/dist/core/checkpoint-rekey.d.ts +1 -1
  28. package/dist/core/checkpoint-rekey.js +6 -1
  29. package/dist/core/checkpoint-requirements.d.ts +23 -3
  30. package/dist/core/checkpoint-requirements.js +5 -1
  31. package/dist/core/checkpoint-row-verdict.js +7 -1
  32. package/dist/core/checkpoint-store.d.ts +24 -2
  33. package/dist/core/checkpoint-store.js +1 -0
  34. package/dist/core/child-clamp-seats.d.ts +15 -0
  35. package/dist/core/child-clamp-seats.js +15 -0
  36. package/dist/core/delegation-frames.d.ts +1 -0
  37. package/dist/core/delegation-frames.js +1 -1
  38. package/dist/core/engine-capabilities.d.ts +5 -1
  39. package/dist/core/engine-capabilities.js +1 -1
  40. package/dist/core/engine-notice.d.ts +30 -22
  41. package/dist/core/engine-version.js +1 -1
  42. package/dist/core/entries-not-applied.d.ts +19 -7
  43. package/dist/core/entries-not-applied.js +33 -1
  44. package/dist/core/governance-codes.d.ts +7 -1
  45. package/dist/core/governance-codes.js +13 -5
  46. package/dist/core/hooks.d.ts +3 -0
  47. package/dist/core/hooks.js +1 -0
  48. package/dist/core/host-instance.d.ts +23 -0
  49. package/dist/core/host-instance.js +69 -0
  50. package/dist/core/instruction-preview.d.ts +63 -0
  51. package/dist/core/instruction-preview.js +406 -0
  52. package/dist/core/leg-budget.d.ts +26 -0
  53. package/dist/core/leg-budget.js +9 -0
  54. package/dist/core/leg-identity.d.ts +51 -1
  55. package/dist/core/leg-identity.js +45 -2
  56. package/dist/core/manager-launch-check.d.ts +48 -0
  57. package/dist/core/manager-launch-check.js +64 -0
  58. package/dist/core/mcp-call-meta.d.ts +2 -2
  59. package/dist/core/mcp-injection-drop.d.ts +20 -10
  60. package/dist/core/mcp-injection-drop.js +9 -3
  61. package/dist/core/mcp-server-spec.d.ts +2 -1
  62. package/dist/core/member-outcome.d.ts +3 -2
  63. package/dist/core/member-outcome.js +1 -1
  64. package/dist/core/memory-engine/deletion-record.d.ts +46 -0
  65. package/dist/core/memory-engine/deletion-record.js +96 -0
  66. package/dist/core/memory-engine/engine.js +24 -16
  67. package/dist/core/memory-engine/file-backend.js +7 -5
  68. package/dist/core/memory-engine/projection-ledger.d.ts +1 -1
  69. package/dist/core/memory-engine/projection-ledger.js +1 -1
  70. package/dist/core/memory-engine/scope-contract.d.ts +18 -13
  71. package/dist/core/memory-engine/scope-contract.js +18 -18
  72. package/dist/core/memory-engine/sync-client.js +26 -6
  73. package/dist/core/memory-engine/sync.d.ts +20 -2
  74. package/dist/core/memory-engine/sync.js +18 -17
  75. package/dist/core/mode-policy.d.ts +21 -6
  76. package/dist/core/mode-policy.js +15 -6
  77. package/dist/core/own-property-receipt.js +11 -4
  78. package/dist/core/parent-spec-seat.d.ts +13 -11
  79. package/dist/core/parent-spec-seat.js +13 -9
  80. package/dist/core/peer-seat.js +3 -3
  81. package/dist/core/peer-task-store.d.ts +365 -0
  82. package/dist/core/peer-task-store.js +682 -0
  83. package/dist/core/permission-rule-consent.js +6 -11
  84. package/dist/core/permission-rule-model.d.ts +27 -0
  85. package/dist/core/permission-rule-model.js +33 -5
  86. package/dist/core/permission-rule-provider.d.ts +35 -33
  87. package/dist/core/permission-rule-provider.js +38 -295
  88. package/dist/core/permission-rule-store.d.ts +181 -8
  89. package/dist/core/permission-rule-store.js +420 -17
  90. package/dist/core/permission-rule-sync.js +15 -1
  91. package/dist/core/project-seat.d.ts +55 -0
  92. package/dist/core/project-seat.js +96 -0
  93. package/dist/core/protocol-http-auth.d.ts +3 -2
  94. package/dist/core/protocol-http-auth.js +26 -18
  95. package/dist/core/remote-env.d.ts +4 -4
  96. package/dist/core/retired-keys.js +1 -0
  97. package/dist/core/rule-offer-read.d.ts +1 -1
  98. package/dist/core/rule-offer-read.js +32 -4
  99. package/dist/core/run-ledger-seat.d.ts +66 -0
  100. package/dist/core/run-ledger-seat.js +70 -0
  101. package/dist/core/run-ledger.d.ts +332 -0
  102. package/dist/core/run-ledger.js +550 -0
  103. package/dist/core/runner/checkpoint-scope.d.ts +13 -3
  104. package/dist/core/runner/checkpoint-scope.js +12 -4
  105. package/dist/core/runner/construction-doors.js +6 -0
  106. package/dist/core/runner/contracts.d.ts +21 -5
  107. package/dist/core/runner/delegation-owner.d.ts +30 -0
  108. package/dist/core/runner/delegation-owner.js +20 -4
  109. package/dist/core/runner/finish-reason-seat.js +4 -2
  110. package/dist/core/runner/leg-frame.js +3 -0
  111. package/dist/core/runner/nested-memory-lane.d.ts +22 -5
  112. package/dist/core/runner/nested-memory-lane.js +91 -30
  113. package/dist/core/runner/person-path-rows.d.ts +21 -16
  114. package/dist/core/runner/person-path-rows.js +80 -15
  115. package/dist/core/runner/prepare-caps-and-workflow.js +98 -88
  116. package/dist/core/runner/prepare-config-doors.d.ts +1 -0
  117. package/dist/core/runner/prepare-config-doors.js +5 -3
  118. package/dist/core/runner/prepare-context-lane.js +1 -0
  119. package/dist/core/runner/prepare-delegation-surface.d.ts +3 -0
  120. package/dist/core/runner/prepare-delegation-surface.js +6 -0
  121. package/dist/core/runner/prepare-execution-env.d.ts +3 -3
  122. package/dist/core/runner/prepare-hands-readface.d.ts +5 -2
  123. package/dist/core/runner/prepare-hands-readface.js +12 -1
  124. package/dist/core/runner/prepare-inherited-gate.d.ts +6 -3
  125. package/dist/core/runner/prepare-inherited-gate.js +13 -5
  126. package/dist/core/runner/prepare-run-refs.d.ts +1 -1
  127. package/dist/core/runner/prepare-run-refs.js +3 -2
  128. package/dist/core/runner/prepare-suspend-saga.d.ts +6 -2
  129. package/dist/core/runner/prepare-suspend-saga.js +4 -2
  130. package/dist/core/runner/prepare-task.js +36 -27
  131. package/dist/core/runner/prepare-turn-wiring.d.ts +4 -3
  132. package/dist/core/runner/prepare-turn-wiring.js +2 -1
  133. package/dist/core/runner/prepare-wiring-manifest.d.ts +3 -1
  134. package/dist/core/runner/prepare-wiring-manifest.js +5 -2
  135. package/dist/core/runner/resume-apply.js +11 -5
  136. package/dist/core/runner/resume-review-outcome.d.ts +3 -0
  137. package/dist/core/runner/resume-review-outcome.js +24 -1
  138. package/dist/core/runner/run-harness-handlers.js +3 -0
  139. package/dist/core/runner/run-identity-wiring.js +3 -2
  140. package/dist/core/runner/run-leg.js +3 -0
  141. package/dist/core/runner/run-notification-lane.js +20 -1
  142. package/dist/core/runner/run-settle-and-teardown.js +21 -12
  143. package/dist/core/runner/run-stop-and-final-verify.js +6 -0
  144. package/dist/core/runner/run-telemetry-and-budget-seats.js +1 -1
  145. package/dist/core/runner/runtask.d.ts +6 -2
  146. package/dist/core/runner/runtask.js +21 -9
  147. package/dist/core/runner/shell-env-withheld.d.ts +3 -2
  148. package/dist/core/runner/shell-env-withheld.js +1 -2
  149. package/dist/core/runner/stop-tail-notice.d.ts +10 -2
  150. package/dist/core/runner/stop-tail-notice.js +9 -2
  151. package/dist/core/runner/stream-settle-backstop.d.ts +1 -0
  152. package/dist/core/runner/stream-settle-backstop.js +1 -0
  153. package/dist/core/runner/task-start-doors.js +6 -3
  154. package/dist/core/runner/terminal-account.d.ts +6 -1
  155. package/dist/core/runner/terminal-account.js +16 -1
  156. package/dist/core/runner/unreadable-person-rows.d.ts +2 -1
  157. package/dist/core/runner-deps.d.ts +13 -10
  158. package/dist/core/secret-env.d.ts +53 -37
  159. package/dist/core/secret-env.js +44 -47
  160. package/dist/core/session-checkout.d.ts +3 -0
  161. package/dist/core/session-checkout.js +1 -0
  162. package/dist/core/session-store.d.ts +12 -6
  163. package/dist/core/session-store.js +26 -6
  164. package/dist/core/session.d.ts +31 -8
  165. package/dist/core/store-contracts/checkpoint-store-contract.js +10 -0
  166. package/dist/core/store-contracts/peer-task-store-contract.d.ts +21 -0
  167. package/dist/core/store-contracts/peer-task-store-contract.js +516 -0
  168. package/dist/core/store-contracts/session-store-contract.d.ts +15 -2
  169. package/dist/core/store-contracts/session-store-contract.js +87 -3
  170. package/dist/core/store-contracts/workflow-journal-store-contract.d.ts +19 -1
  171. package/dist/core/store-contracts/workflow-journal-store-contract.js +89 -1
  172. package/dist/core/task-event.d.ts +10 -3
  173. package/dist/core/task-notification.d.ts +96 -10
  174. package/dist/core/task-notification.js +129 -5
  175. package/dist/core/task-registry-shared.d.ts +12 -1
  176. package/dist/core/task-registry-shared.js +3 -1
  177. package/dist/core/task-registry-workflow.d.ts +1 -1
  178. package/dist/core/task-registry-workflow.js +9 -1
  179. package/dist/core/task-registry.d.ts +39 -2
  180. package/dist/core/task-registry.js +76 -12
  181. package/dist/core/task-result.d.ts +13 -0
  182. package/dist/core/task-spec-members.d.ts +3 -1
  183. package/dist/core/task-spec-members.js +11 -3
  184. package/dist/core/task-spec.d.ts +48 -22
  185. package/dist/core/tool-catalog-entries.js +2 -0
  186. package/dist/core/tool-mount-facts.d.ts +1 -1
  187. package/dist/core/tool-mount-facts.js +1 -0
  188. package/dist/core/tool-mount-plan.d.ts +3 -1
  189. package/dist/core/tool-mount-plan.js +6 -0
  190. package/dist/core/tool-mount-static.d.ts +1 -1
  191. package/dist/core/tool-mount-static.js +4 -2
  192. package/dist/core/tool-result-store.d.ts +19 -2
  193. package/dist/core/tool-result-store.js +51 -2
  194. package/dist/core/tool-spec.d.ts +9 -2
  195. package/dist/core/user-attachment.d.ts +5 -1
  196. package/dist/core/user-attachment.js +14 -7
  197. package/dist/core/wiring-manifest.d.ts +26 -20
  198. package/dist/core/wiring-manifest.js +7 -3
  199. package/dist/core/workflow-journal-store.d.ts +53 -10
  200. package/dist/core/workflow-journal-store.js +27 -4
  201. package/dist/core/workflow-run-store-contract.js +16 -0
  202. package/dist/core/workflow-run-store.d.ts +9 -7
  203. package/dist/core/workflow-run-store.js +4 -1
  204. package/dist/engine/execution-env/node-execution-env.js +3 -1
  205. package/dist/engine/harness/types.d.ts +24 -1
  206. package/dist/engine/harness/types.js +10 -0
  207. package/dist/engine/llm/types.d.ts +5 -7
  208. package/dist/engine/lsp/node-lsp-manager.js +2 -1
  209. package/dist/engine/session/import-validate.js +6 -1
  210. package/dist/engine/session/session.d.ts +15 -2
  211. package/dist/engine/session/session.js +34 -4
  212. package/dist/index.d.ts +18 -7
  213. package/dist/index.js +13 -4
  214. package/dist/orchestration/run-workflow-tool.js +40 -32
  215. package/dist/orchestration/workflow-park-adoption.d.ts +51 -12
  216. package/dist/orchestration/workflow-park-adoption.js +47 -12
  217. package/dist/orchestration/workflow-stop.d.ts +128 -0
  218. package/dist/orchestration/workflow-stop.js +156 -0
  219. package/dist/orchestration/workflow.d.ts +30 -6
  220. package/dist/orchestration/workflow.js +117 -55
  221. package/dist/prompts/manager-recipe.d.ts +18 -0
  222. package/dist/prompts/manager-recipe.js +24 -0
  223. package/dist/stores/file/permission-rule-store.d.ts +3 -1
  224. package/dist/stores/file/permission-rule-store.js +0 -1
  225. package/dist/stores/file/workflow-journal-store.d.ts +16 -3
  226. package/dist/stores/file/workflow-journal-store.js +93 -5
  227. package/dist/stores/file/workflow-run-store.d.ts +1 -1
  228. package/dist/tools/fs/file-write-check.js +9 -3
  229. package/dist/tools/fs/index.d.ts +8 -7
  230. package/dist/tools/fs/index.js +4 -4
  231. package/dist/tools/fs/read-deny-home.d.ts +1 -1
  232. package/dist/tools/fs/read-deny-home.js +5 -5
  233. package/dist/tools/fs/read-deny.d.ts +33 -8
  234. package/dist/tools/fs/read-deny.js +114 -25
  235. package/dist/tools/fs/safety.d.ts +4 -1
  236. package/dist/tools/fs/safety.js +4 -2
  237. package/dist/tools/fs/shell-read-check.d.ts +9 -2
  238. package/dist/tools/fs/shell-read-check.js +96 -14
  239. package/dist/tools/fs/shell-read-establish.d.ts +9 -0
  240. package/dist/tools/fs/shell-read-establish.js +21 -11
  241. package/dist/tools/fs/shell-read-judge.d.ts +13 -1
  242. package/dist/tools/fs/shell-read-judge.js +26 -7
  243. package/dist/tools/fs/shell-read-plan.d.ts +5 -0
  244. package/dist/tools/fs/shell-read-write-targets.js +17 -9
  245. package/package.json +2 -2
  246. package/test/export-surface.snapshot.json +131 -1
  247. package/wire-changes/answers/core-stores-sql@7.73.0.json +28 -0
  248. package/wire-changes/answers/core@7.73.0.json +216 -0
  249. package/wire-changes/answers/mods-kernel@7.73.0.json +7 -0
  250. package/wire-changes/answers/primitives@7.73.0.json +12 -0
  251. package/wire-changes/answers/wiki-gate@7.73.0.json +7 -0
  252. package/wire-changes/core-stores-sql@7.73.0.json +326 -0
  253. package/wire-changes/core@7.73.0.json +6480 -0
  254. package/wire-changes/mods-kernel@7.73.0.json +147 -0
  255. package/wire-changes/primitives@7.73.0.json +227 -0
  256. package/wire-changes/wiki-gate@7.73.0.json +145 -0
@@ -112,13 +112,13 @@ export interface EngineNotice {
112
112
  * A run whose deployment turned the listing off (`attachments.skillsListing: false`) emits nothing,
113
113
  * since nothing is rendered. There is NO dedup key: each notice is one delivered frame`s cost, and
114
114
  * a frame is delivered (and committed) once.
115
- * - `"tool_result.offload_put_failed"` (#167) — a clear-with-offload persist's fire-and-forget put failed; THIS attempt stored
116
- * nothing (the failure arm reports, it never re-inserts under the ref) — an earlier attempt of the same idempotent re-put may
117
- * already have stored the row, so the notice claims a failed write, not an empty ref; `detail: { ref, sessionId, cause,
118
- * occurrenceId }`. Per-occurrence, not per-process-deduplicated: each failed write is a distinct fact, and `ref` names the ROW
119
- * rather than the attempt, so the uuidv7 `occurrenceId` minted at the failure is what tells two genuine losses of one ref apart.
120
- * Dedup key: (code, occurrenceId). One refusal is told ONCE PER SESSION instead (its own sentence, the same `detail`): the ref
121
- * holds the session's own entry with no identity recorded — it is there, no run reads it, every later attempt meets the same.
115
+ * - `"tool_result.offload_put_failed"` (#167) — a clear-with-offload put failed: THIS attempt stored nothing and nothing is
116
+ * re-inserted under the ref (an earlier attempt of the same idempotent re-put may have stored the row: a failed write, not an
117
+ * empty ref); `detail: { ref, sessionId, cause, occurrenceId }`, per occurrence (`ref` names the row, not the attempt), dedup
118
+ * key (code, occurrenceId). The session's own entry with no identity recorded is told ONCE PER SESSION instead (its own sentence).
119
+ * - `"tool_result.offload_put_unsettled"` — a request stopped waiting for those puts at `OFFLOAD_PUT_WAIT_BOUND_MS` (10 000 ms)
120
+ * and went out: none had settled, not "failed" — each runs on (lands ⇒ reads back; fails ⇒ `tool_result.offload_put_failed`)
121
+ * and no later request waits for it; once per batch, `detail: { refs, sessionId, boundMs, occurrenceId }`; a cut tells nothing.
122
122
  * - `"tool_result.media_refused"` — an executed call's result carried media blocks (an image or a document, from
123
123
  * an MCP server, a host tool, an engine tool or a `tool_result` hook's replacement) whose bytes the tool-result
124
124
  * seat's admission refused: not a base64 payload, a media type outside the closed set, over the cap, bytes
@@ -589,8 +589,8 @@ export interface EngineNotice {
589
589
  * output — a later ending, an error, a frame that only closes or opens a message (attention `inform`); the next code is the other.
590
590
  * - `"route.stream_content_dropped"` (7.70.0) — among the frames refused after the end, at least one carried the model's
591
591
  * output (text, reasoning, a refusal, a tool call, or a block that opens one: `streamEndIgnored.contentDropped`), which the
592
- * turn does not have. ONCE PER LEG PER word. Audience `user`, attention `act`; `detail: { word, frames, sessionId, runId }` —
593
- * `word` the first such frame's kind, `frames` how many frames came after the end in all.
592
+ * turn does not have. ONCE PER LEG PER word. Audience `user`, attention `act`; `detail: { word, ending?, frames, sessionId, runId }` —
593
+ * `word` the first such frame's kind, `ending` present iff the first late frame was itself an ending frame (`content_filter`, `length`, …), `frames` how many frames came after the end in all.
594
594
  * - `"route.extra_body_reserved_dropped"` (#1520) — a request's `Model.extraBody` carried keys the wire adapter
595
595
  * sets itself (`temperature`, `max_tokens`, `stop`, the thinking-enable keys, `messages`, `tools`, …), so the
596
596
  * adapter stripped them and the request went out with the engine's value (or without the key); core wins, and
@@ -896,23 +896,23 @@ export interface EngineNotice {
896
896
  * could not be read —, a server's name, a model word) and the kind's own members; `count` all of them; `identity` an opaque digest of
897
897
  * the whole set (equal for the same set). Audience `user`, attention `act`. The kinds:
898
898
  * · `stored_rule_row` — the person's store served rows that take no part in this run's checks (a foreign writer's or a hand
899
- * edit's, in practice): entries whose behavior word could not be read (no rows: the sentence says where each was served and what
900
- * was read there), project-scoped rows whose scope root is not a complete absolute path — a deny or ask row among them protects
901
- * nothing — and allow rows whose text is not the canonical spelling of their stored fields, or a member of which could not be
902
- * read as the type it holds (they allow nothing), until rewritten or removed; and deny or ask rows of either personal partition a
903
- * member of which could not be read (`EffectivePermissionRules.unreadableRows`: one whose tool, match and path read, or whose
904
- * text says them, applies as written; one neither of whose spellings reads — no allow clears a call it may reach). Once per run,
905
- * by whichever read met them first; one sentence per kind of row present. Each entry: `reason` (`scope_root_not_absolute` /
906
- * `invalid_rule_text` / `metadata_mismatch` / the unreadable rows' words), `scopeRoot?` (scope rows only, neutralized and
907
- * bounded), `member?` (the first member that could not be read), `behavior?` (a deny or ask row so read), `element?` (an entry
908
- * that is no row: `{ partition, index, read }`). Left-out rows first. Routing `sessionId`, `runId`.
899
+ * edit's, in practice): project-scoped rows whose scope root is not a complete absolute path — a deny or ask row among them
900
+ * protects nothing — and allow rows whose text is not the canonical spelling of their stored fields, or a member of which
901
+ * could not be read as the type it holds (they allow nothing), until rewritten or removed; and rows of either personal
902
+ * partition a member of which could not be read (`EffectivePermissionRules.unreadableRows`: a deny/ask whose tool, match and
903
+ * path read, or whose text says them, applies as written; one neither of whose spellings reads — or an entry whose behavior
904
+ * word could not be read — stands at its strictest reading so no allow clears a call it may reach). Once per run, by whichever
905
+ * read met them first; one sentence per cause present. Each entry: `reason` (`scope_root_not_absolute` / `invalid_rule_text`
906
+ * / `metadata_mismatch`), `scopeRoot?` (scope rows only, neutralized and bounded), `member?` (the first member that could not
907
+ * be read), `behavior?` (a deny or ask row whose behavior word read), `element?` (host-supplied views only: `{ partition,
908
+ * index, read }`). Left-out rows first. Routing `sessionId`, `runId`.
909
909
  * · `rule_text_unreadable` — a leg's own tool policy left out rules a person's settings layer (`user` / `project`) wrote whose
910
910
  * text the compiler cannot read (`ToolPolicy.skippedRules`); a deny or ask rule among them is NOT in force, each in its own
911
911
  * clause. At prepare on every leg, for rules no ancestor of its delegation chain holds; once per session per set. Each entry:
912
912
  * `reason` (the issue code), `behavior`, `layer`. Routing: the leg notice's (`sessionId`, `sourceSessionId?`, `agentId?`), `runId`.
913
- * · `mcp_injection_dropped` — an entry of the user's own request-lane MCP injection was NOT mounted for the leg (minted by the
914
- * host's intake through `mcpInjectionDroppedNotice`, the one mint; see its module). One entry: `entry` the server name as the
915
- * user spelled it, `reason` (`MCP_INJECTION_DROP_REASONS`), `field?`. Routing `sessionId` (required at the mint).
913
+ * · `mcp_injection_dropped` — an MCP server declaration was NOT mounted (request-lane drop at host intake, or agent-definition
914
+ * entry shadowed at spawn; minted through `mcpInjectionDroppedNotice`). One entry: `entry` (server name), `reason`
915
+ * (`MCP_INJECTION_DROP_REASONS`), `field?`, `agent?`. Routing `sessionId` (required at the mint; root session for agent drops).
916
916
  * · `model_word_unknown` — a role seat (other than `default` and `classifier`) names a model word the catalog does not hold, or a
917
917
  * tier the deployment's tiers leave absent, so the seat is read as an unset one and the run goes on. Once per SESSION per
918
918
  * (seat, word, cause), root legs only. One entry: `entry` the word (bounded), `seat`, `role`, `reason` (`unknown_model_ref` /
@@ -1169,6 +1169,14 @@ export interface EngineNotice {
1169
1169
  * the sentence names each task with what the run's end does to it. A stop that lands on the run's tail after this cut no wait:
1170
1170
  * its `task.interrupt_unconsumed` carries `waitedFor: []`. Audience `"user"`, attention `act` (the result carries nothing from them).
1171
1171
  *
1172
+ * - `"task.manager_launch_narrowed"` — a run that declares a member ledger (`TaskSpec.runLedger`) took its launch check
1173
+ * (`managerLaunchCheck`) at prepare and starts narrowed: something it needs for part of its job is missing (read hands, the
1174
+ * worker-record tool, isolated checks, an approval route for its workers' writes, the task list). Once per prepared leg:
1175
+ * `detail: { sessionId, runId, taskId?, launch }`, `launch` the check (`{ verdict, items: [{ item, state, means? }] }`); the
1176
+ * sentence names each missing item and what it means. An item that could not be read is `unknown` and narrows nothing. A check
1177
+ * whose missing item refuses (no background delegation lane, no report tool) refuses the run instead (`config.invalid_argument`,
1178
+ * `detail.reason: "run_ledger_unready"`). Audience `"user"`, attention `act`.
1179
+ *
1172
1180
  * - `"approval.read_root_granted"` / `"approval.read_root_grant_rejected"` — an approver's `readRootGrant`
1173
1181
  * (`AskOutcome`, with its `readRootGrantLasts`). GRANTED: it equalled the card's `readRootCandidate.dir` beside
1174
1182
  * `allow: true`; the READ directories now include it (never the write roots), for `detail.lasts`: `"session"` — a
@@ -1 +1 @@
1
- export const ENGINE_VERSION = "7.72.0";
1
+ export const ENGINE_VERSION = "7.73.0";
@@ -13,10 +13,22 @@ export type EntryNotApplied = {
13
13
  } & {
14
14
  readonly [key: string]: EntryMember;
15
15
  };
16
- /** The `kind`, `entries`, `count` and `identity` members of one frame over every entry of the kind (`all`, in the order told). */
17
- export declare function entriesNotAppliedDetail(kind: EntriesNotAppliedKind, all: readonly EntryNotApplied[]): {
18
- kind: EntriesNotAppliedKind;
19
- entries: EntryNotApplied[];
20
- count: number;
21
- identity: string;
22
- };
16
+ /** Detail shape minted by {@link entriesNotAppliedDetail}. `entries` lists at most {@link ENTRIES_NOT_APPLIED_SHOWN} entries
17
+ * ordered severest-first ({@link orderEntriesBySeverity}); `count` counts all entries; `identity` digests the full set. */
18
+ export interface EntriesNotAppliedDetail {
19
+ readonly kind: EntriesNotAppliedKind;
20
+ readonly entries: EntryNotApplied[];
21
+ readonly count: number;
22
+ readonly identity: string;
23
+ /** Per-reason totals across the full entry set. Present iff the list was cut (`count > ENTRIES_NOT_APPLIED_SHOWN`) and at least one entry carries a string `reason`. */
24
+ readonly reasonCounts?: Readonly<Record<string, number>>;
25
+ }
26
+ /** Stable severest-first ordering shared by {@link entriesNotAppliedDetail} and message renderers so the sentence and
27
+ * `detail.entries` surface the same high-severity entries when a list is cut. */
28
+ export declare function orderEntriesBySeverity<T extends {
29
+ readonly entry?: unknown;
30
+ readonly reason?: unknown;
31
+ readonly behavior?: unknown;
32
+ }>(all: readonly T[]): T[];
33
+ /** The `kind`, `entries`, `count`, `identity` (and cut-only `reasonCounts`) members of one frame over every entry of the kind. */
34
+ export declare function entriesNotAppliedDetail(kind: EntriesNotAppliedKind, all: readonly EntryNotApplied[]): EntriesNotAppliedDetail;
@@ -17,11 +17,43 @@ function canonical(v) {
17
17
  return `{${Object.keys(v).sort().map((k) => `${JSON.stringify(k)}:${canonical(v[k])}`).join(",")}}`;
18
18
  return JSON.stringify(v) ?? "null";
19
19
  }
20
+ function entrySeverityRank(e) {
21
+ if (e.reason === "wildcard_all" && e.entry === "*")
22
+ return 0;
23
+ if (e.reason === "wildcard_all" || e.reason === "namespace_wildcard" || e.reason === "wildcard_tool")
24
+ return 1;
25
+ if (e.behavior === "deny")
26
+ return 2;
27
+ if (e.behavior === "ask")
28
+ return 3;
29
+ return 4;
30
+ }
31
+ export function orderEntriesBySeverity(all) {
32
+ return all
33
+ .map((item, index) => ({ item, index, rank: entrySeverityRank(item) }))
34
+ .sort((a, b) => a.rank - b.rank || a.index - b.index)
35
+ .map((x) => x.item);
36
+ }
20
37
  export function entriesNotAppliedDetail(kind, all) {
38
+ const ordered = orderEntriesBySeverity(all);
39
+ let reasonCounts;
40
+ if (all.length > ENTRIES_NOT_APPLIED_SHOWN) {
41
+ const counts = {};
42
+ let hasReason = false;
43
+ for (const e of all) {
44
+ if (typeof e.reason === "string") {
45
+ counts[e.reason] = (counts[e.reason] ?? 0) + 1;
46
+ hasReason = true;
47
+ }
48
+ }
49
+ if (hasReason)
50
+ reasonCounts = counts;
51
+ }
21
52
  return {
22
53
  kind,
23
- entries: all.slice(0, ENTRIES_NOT_APPLIED_SHOWN).map((e) => ({ ...e })),
54
+ entries: ordered.slice(0, ENTRIES_NOT_APPLIED_SHOWN).map((e) => ({ ...e })),
24
55
  count: all.length,
25
56
  identity: announceDigest(`config.entries_not_applied:${kind}`, all.map(canonical).sort().join("\n")),
57
+ ...(reasonCounts !== undefined ? { reasonCounts } : {}),
26
58
  };
27
59
  }
@@ -180,7 +180,7 @@ export type NoticeAttention = "act" | "inform" | "audit";
180
180
  * the union's catalog ({@link EngineNotice.code}). The groups below say only which family a row joins,
181
181
  * so the catalog is not written a second time here and the two cannot drift.
182
182
  */
183
- export declare const ENGINE_NOTICE_CODES: readonly ["config.autocompact_window_clamped", "config.env_timeout_discarded", "config.materialize_env_discarded", "config.models_swapped", "config.context_settings_swapped", "config.read_face_swapped", "config.read_face_deployment_clamped", "config.write_face_swapped", "config.write_face_deployment_clamped", "config.read_deny_swapped", "config.tool_model_gate_removed", "config.tool_model_gate_unknown_class", "config.tool_model_gate_env_invalid", "config.artifact_host_invalid", "config.task_root_not_canonical", "config.write_protection_target_view_absent", "config.path_view_unresolved", "config.execution_env_capability_invalid", "config.execution_env_failure_contract_broken", "config.read_deny_floor_unkept", "config.read_floor_confinement_unavailable", "config.inherit_env_declared_late", "config.command_sandbox_unavailable", "config.tool_card_undeclared", "config.tool_face_undeclared", "config.tool_face_invalid", "config.host_sink_failed", "config.seat_malformed", "config.session_delete_withheld", "config.env_knob_adjusted", "config.read_deny_home", "config.permission_rules_skipped", "config.process_start_time_unavailable", "config.data_root_spelling_split", "config.durable_gate_unavailable", "config.peer_admission_out_of_range", "config.peer_lane_unmounted", "config.scheduler_store_unmoved", "config.secret_env_scrubbed", "inherit_env.names_withheld", "config.credential_not_withheld", "config.cross_boundary_posture_undeclared", "config.cross_boundary_record_unwritten", "config.permission_mode_unavailable", "permission.rule_store_unavailable", "permission.rule_store_unreadable_relaxed", "config.entries_not_applied", "config.session_rules_earlier_grammar", "config.session_rules_reread", "config.skill_deny_unreadable", "config.legacy_tool_name", "config.toolpolicy.unmatched_names", "config.agent.unknown_tool", "permission.allow_rule_not_used_in_auto", "permission.revival_root_policy_unrestated", "mods.registration_refused", "mods.registration_refused_deployment", "mods.display_withheld", "mods.stop_ended", "mods.stop_continue_dropped", "mods.package_key_unread", "peer.inbound_disposition", "peer.inbound_unread", "peer.notice_user_only", "peer.receipt_delivered_user_only", "peer.held_settled", "peer.held_approval_unhonored", "peer.held_decision_applied", "peer.idle_subscription", "peer.idle_subscription_declined", "classifier.denial_limit", "classifier.fallback", "classifier.seat_rate_limited", "classifier.role_defaulted", "classifier.contract_broken", "classifier.unavailable", "classifier.unavailable_handed_on", "classifier.review_skipped", "checkpoint.execution_outcome_unrecorded", "delegation.transcript_integrity", "delegation.ask_unresolvable", "delegation.resume_lane_missing", "delegation.spawn_depth_unknown", "delegation.delivery_discarded", "delegation.settlement_external", "delegation.settlement_write_failed", "delegation.durable_row_unpersisted", "delegation.parked_card_unreadable", "delegation.parked_card_id_untrusted", "delegation.agent_row_ending_unreadable", "protocol.revocation_probe_failed", "mcp.server_redialed", "mcp.authorization_required", "mcp.server_unavailable", "mcp.server_connecting", "mcp.credential_echoed", "a2a.peer_card_drift", "mcp.server_stderr", "workflow.governance_key_stripped", "workflow.agent_option_ignored", "workflow.parked_decision_unused", "workflow.parked_decision_used", "workflow.record_unwritten", "memory.session_polluted", "memory.harvest_quarantined", "memory.harvest_refused", "memory.harvest_conflict", "memory.delegation_static_mark_waived", "memory.content_class_declared", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "memory.consolidation_recommended", "memory.consolidation_committed", "memory.consolidation_conflict", "memory.consolidation_incomplete", "memory.consolidation_refused", "memory.consolidation_withheld", "memory.restore_withheld", "memory.project_scope_absent", "memory.notice_unscoped", "route.fallback_to_primary", "route.classifier_unroutable", "route.seat_detached", "advisor.not_attached", "route.credential_origin_mismatch", "route.credential_mismatch", "route.credential_rebound", "route.response_model_mismatch", "route.tool_call_id_folded", "route.finish_reason_unknown", "route.stream_end_ignored", "route.stream_content_dropped", "route.extra_body_reserved_dropped", "model.capability_downgraded", "model.fast_mode_changed", "model.fallback", "model.fallback_side_call", "context.tool_turn_repaired", "context.media_removed", "context.tool_schema_removed", "context.messages_omitted", "instructions.withheld", "instructions.outside_root", "instructions.family_undeclared", "task.user_steer_undrained", "task.user_followup_undrained", "task.undelivered_input_dropped", "steering.parked_input_blocked", "task.turn_interrupted", "task.halt_unconsumed", "mods.turn_aborted", "mods.turn_abort_unconsumed", "task.late_approval", "task.interrupt_unconsumed", "task.wait_ceiling_reached", "task.completed_past_limit", "task.verdict_refused", "task.tool_turn_incomplete", "task.tool_turn_unrecovered", "approval.read_root_granted", "approval.read_root_grant_rejected", "approval.session_call_granted", "approval.session_call_grant_rejected", "approval.approver_defect", "memory.capture_opted_out", "memory.capture_switched_off", "memory.capture_optout_unpersisted", "memory.mount_failed", "skills.listing_truncated", "agents.listing_truncated", "tool_result.offload_put_failed", "tool_result.media_refused", "tool_result.media_persisted", "tool_result.read_refused", "artifact.owner_refused", "config.image_processor_unavailable", "fs.staging_file_left", "fs.staging_file_swept", "store.tail_segment_unjudged", "store.lock_retained", "store.lock_reclaimed_on_declaration", "store.append_log_parked", "store.tree_id_stamp_incomplete", "store.process_anchor_unavailable", "store.process_anchor_lost", "engine.debug_trace", "session.lineage_rerooted", "rewind.boundary_unrecorded", "rewind.file_left_as_is", "verify.verifier_is_implementer", "workspace.sync_failed", "memory.layer_locked_legacy", "server.model_unreachable", "permission.entry_mode_clamped", "model.context_window_assumed", "config.store_ephemeral", "memory.sync_layer_parked"];
183
+ export declare const ENGINE_NOTICE_CODES: readonly ["config.autocompact_window_clamped", "config.env_timeout_discarded", "config.materialize_env_discarded", "config.models_swapped", "config.context_settings_swapped", "config.read_face_swapped", "config.read_face_deployment_clamped", "config.write_face_swapped", "config.write_face_deployment_clamped", "config.read_deny_swapped", "config.tool_model_gate_removed", "config.tool_model_gate_unknown_class", "config.tool_model_gate_env_invalid", "config.artifact_host_invalid", "config.task_root_not_canonical", "config.write_protection_target_view_absent", "config.path_view_unresolved", "config.execution_env_capability_invalid", "config.execution_env_failure_contract_broken", "config.read_deny_floor_unkept", "config.read_floor_confinement_unavailable", "config.inherit_env_declared_late", "config.command_sandbox_unavailable", "config.tool_card_undeclared", "config.tool_face_undeclared", "config.tool_face_invalid", "config.host_sink_failed", "config.seat_malformed", "config.session_delete_withheld", "config.env_knob_adjusted", "config.read_deny_home", "config.permission_rules_skipped", "config.process_start_time_unavailable", "config.data_root_spelling_split", "config.durable_gate_unavailable", "config.peer_admission_out_of_range", "config.peer_lane_unmounted", "config.scheduler_store_unmoved", "config.secret_env_scrubbed", "inherit_env.names_withheld", "config.credential_not_withheld", "config.cross_boundary_posture_undeclared", "config.cross_boundary_record_unwritten", "config.permission_mode_unavailable", "permission.rule_store_unavailable", "permission.rule_store_unreadable_relaxed", "config.entries_not_applied", "config.session_rules_earlier_grammar", "config.session_rules_reread", "config.skill_deny_unreadable", "config.legacy_tool_name", "config.toolpolicy.unmatched_names", "config.agent.unknown_tool", "permission.allow_rule_not_used_in_auto", "permission.revival_root_policy_unrestated", "mods.registration_refused", "mods.registration_refused_deployment", "mods.display_withheld", "mods.stop_ended", "mods.stop_continue_dropped", "mods.package_key_unread", "peer.inbound_disposition", "peer.inbound_unread", "peer.notice_user_only", "peer.receipt_delivered_user_only", "peer.held_settled", "peer.held_approval_unhonored", "peer.held_decision_applied", "peer.idle_subscription", "peer.idle_subscription_declined", "classifier.denial_limit", "classifier.fallback", "classifier.seat_rate_limited", "classifier.role_defaulted", "classifier.contract_broken", "classifier.unavailable", "classifier.unavailable_handed_on", "classifier.review_skipped", "checkpoint.execution_outcome_unrecorded", "delegation.transcript_integrity", "delegation.ask_unresolvable", "delegation.resume_lane_missing", "delegation.spawn_depth_unknown", "delegation.delivery_discarded", "delegation.settlement_external", "delegation.settlement_write_failed", "delegation.durable_row_unpersisted", "delegation.parked_card_unreadable", "delegation.parked_card_id_untrusted", "delegation.agent_row_ending_unreadable", "protocol.revocation_probe_failed", "mcp.server_redialed", "mcp.authorization_required", "mcp.server_unavailable", "mcp.server_connecting", "mcp.credential_echoed", "a2a.peer_card_drift", "mcp.server_stderr", "workflow.governance_key_stripped", "workflow.agent_option_ignored", "workflow.parked_decision_unused", "workflow.parked_decision_used", "workflow.record_unwritten", "memory.session_polluted", "memory.harvest_quarantined", "memory.harvest_refused", "memory.harvest_conflict", "memory.delegation_static_mark_waived", "memory.content_class_declared", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "memory.consolidation_recommended", "memory.consolidation_committed", "memory.consolidation_conflict", "memory.consolidation_incomplete", "memory.consolidation_refused", "memory.consolidation_withheld", "memory.restore_withheld", "memory.project_scope_absent", "memory.notice_unscoped", "route.fallback_to_primary", "route.classifier_unroutable", "route.seat_detached", "advisor.not_attached", "route.credential_origin_mismatch", "route.credential_mismatch", "route.credential_rebound", "route.response_model_mismatch", "route.tool_call_id_folded", "route.finish_reason_unknown", "route.stream_end_ignored", "route.stream_content_dropped", "route.extra_body_reserved_dropped", "model.capability_downgraded", "model.fast_mode_changed", "model.fallback", "model.fallback_side_call", "context.tool_turn_repaired", "context.media_removed", "context.tool_schema_removed", "context.messages_omitted", "instructions.withheld", "instructions.outside_root", "instructions.family_undeclared", "task.user_steer_undrained", "task.user_followup_undrained", "task.undelivered_input_dropped", "steering.parked_input_blocked", "task.turn_interrupted", "task.halt_unconsumed", "mods.turn_aborted", "mods.turn_abort_unconsumed", "task.late_approval", "task.interrupt_unconsumed", "task.wait_ceiling_reached", "task.manager_launch_narrowed", "task.completed_past_limit", "task.verdict_refused", "task.tool_turn_incomplete", "task.tool_turn_unrecovered", "approval.read_root_granted", "approval.read_root_grant_rejected", "approval.session_call_granted", "approval.session_call_grant_rejected", "approval.approver_defect", "memory.capture_opted_out", "memory.capture_switched_off", "memory.capture_optout_unpersisted", "memory.mount_failed", "skills.listing_truncated", "agents.listing_truncated", "tool_result.offload_put_failed", "tool_result.offload_put_unsettled", "tool_result.media_refused", "tool_result.media_persisted", "tool_result.read_refused", "artifact.owner_refused", "config.image_processor_unavailable", "fs.staging_file_left", "fs.staging_file_swept", "store.tail_segment_unjudged", "store.lock_retained", "store.lock_reclaimed_on_declaration", "store.append_log_parked", "store.tree_id_stamp_incomplete", "store.process_anchor_unavailable", "store.process_anchor_lost", "engine.debug_trace", "session.lineage_rerooted", "rewind.boundary_unrecorded", "rewind.file_left_as_is", "verify.verifier_is_implementer", "workspace.sync_failed", "memory.layer_locked_legacy", "server.model_unreachable", "permission.entry_mode_clamped", "model.context_window_assumed", "config.store_ephemeral", "memory.sync_layer_parked"];
184
184
  /** A catalogued code (see {@link ENGINE_NOTICE_CODES}); {@link NOTICE_MINTER} says who mints it. NOT the type of
185
185
  * `EngineNotice.code`, which stays `string` — a host forwarding its own notices through the same
186
186
  * sink is a supported shape, and narrowing that field would break it. */
@@ -229,6 +229,7 @@ declare const NOTICE_AUDIENCE_TABLE: {
229
229
  readonly "task.late_approval": "user";
230
230
  readonly "task.interrupt_unconsumed": "user";
231
231
  readonly "task.wait_ceiling_reached": "user";
232
+ readonly "task.manager_launch_narrowed": "user";
232
233
  readonly "task.tool_turn_incomplete": "user";
233
234
  readonly "task.tool_turn_unrecovered": "user";
234
235
  readonly "task.completed_past_limit": "operator";
@@ -359,6 +360,7 @@ declare const NOTICE_AUDIENCE_TABLE: {
359
360
  readonly "skills.listing_truncated": "operator";
360
361
  readonly "agents.listing_truncated": "operator";
361
362
  readonly "tool_result.offload_put_failed": "operator";
363
+ readonly "tool_result.offload_put_unsettled": "operator";
362
364
  readonly "tool_result.media_refused": "operator";
363
365
  readonly "tool_result.media_persisted": "operator";
364
366
  readonly "tool_result.read_refused": "operator";
@@ -465,6 +467,7 @@ declare const NOTICE_ATTENTION_TABLE: {
465
467
  readonly "task.halt_unconsumed": "act";
466
468
  readonly "task.interrupt_unconsumed": "act";
467
469
  readonly "task.wait_ceiling_reached": "act";
470
+ readonly "task.manager_launch_narrowed": "act";
468
471
  readonly "task.late_approval": "act";
469
472
  readonly "memory.capture_optout_unpersisted": "act";
470
473
  readonly "memory.mount_failed": "act";
@@ -564,6 +567,7 @@ declare const NOTICE_ATTENTION_TABLE: {
564
567
  readonly "instructions.family_undeclared": "act";
565
568
  readonly "approval.approver_defect": "act";
566
569
  readonly "tool_result.offload_put_failed": "act";
570
+ readonly "tool_result.offload_put_unsettled": "act";
567
571
  readonly "artifact.owner_refused": "act";
568
572
  readonly "fs.staging_file_left": "act";
569
573
  readonly "store.lock_retained": "act";
@@ -818,6 +822,7 @@ declare const NOTICE_MINTER_TABLE: {
818
822
  readonly "task.late_approval": "engine";
819
823
  readonly "task.interrupt_unconsumed": "engine";
820
824
  readonly "task.wait_ceiling_reached": "engine";
825
+ readonly "task.manager_launch_narrowed": "engine";
821
826
  readonly "task.completed_past_limit": "engine";
822
827
  readonly "task.verdict_refused": "engine";
823
828
  readonly "task.tool_turn_incomplete": "engine";
@@ -834,6 +839,7 @@ declare const NOTICE_MINTER_TABLE: {
834
839
  readonly "skills.listing_truncated": "engine";
835
840
  readonly "agents.listing_truncated": "engine";
836
841
  readonly "tool_result.offload_put_failed": "engine";
842
+ readonly "tool_result.offload_put_unsettled": "engine";
837
843
  readonly "tool_result.media_refused": "engine";
838
844
  readonly "tool_result.media_persisted": "engine";
839
845
  readonly "tool_result.read_refused": "engine";
@@ -294,6 +294,7 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
294
294
  "task.late_approval",
295
295
  "task.interrupt_unconsumed",
296
296
  "task.wait_ceiling_reached",
297
+ "task.manager_launch_narrowed",
297
298
  "task.completed_past_limit",
298
299
  "task.verdict_refused",
299
300
  "task.tool_turn_incomplete",
@@ -310,6 +311,7 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
310
311
  "skills.listing_truncated",
311
312
  "agents.listing_truncated",
312
313
  "tool_result.offload_put_failed",
314
+ "tool_result.offload_put_unsettled",
313
315
  "tool_result.media_refused",
314
316
  "tool_result.media_persisted",
315
317
  "tool_result.read_refused",
@@ -365,6 +367,7 @@ const NOTICE_AUDIENCE_TABLE = {
365
367
  "task.late_approval": "user",
366
368
  "task.interrupt_unconsumed": "user",
367
369
  "task.wait_ceiling_reached": "user",
370
+ "task.manager_launch_narrowed": "user",
368
371
  "task.tool_turn_incomplete": "user",
369
372
  "task.tool_turn_unrecovered": "user",
370
373
  "task.completed_past_limit": "operator",
@@ -495,6 +498,7 @@ const NOTICE_AUDIENCE_TABLE = {
495
498
  "skills.listing_truncated": "operator",
496
499
  "agents.listing_truncated": "operator",
497
500
  "tool_result.offload_put_failed": "operator",
501
+ "tool_result.offload_put_unsettled": "operator",
498
502
  "tool_result.media_refused": "operator",
499
503
  "tool_result.media_persisted": "operator",
500
504
  "tool_result.read_refused": "operator",
@@ -586,6 +590,7 @@ const NOTICE_ATTENTION_TABLE = {
586
590
  "task.halt_unconsumed": "act",
587
591
  "task.interrupt_unconsumed": "act",
588
592
  "task.wait_ceiling_reached": "act",
593
+ "task.manager_launch_narrowed": "act",
589
594
  "task.late_approval": "act",
590
595
  "memory.capture_optout_unpersisted": "act",
591
596
  "memory.mount_failed": "act",
@@ -685,6 +690,7 @@ const NOTICE_ATTENTION_TABLE = {
685
690
  "instructions.family_undeclared": "act",
686
691
  "approval.approver_defect": "act",
687
692
  "tool_result.offload_put_failed": "act",
693
+ "tool_result.offload_put_unsettled": "act",
688
694
  "artifact.owner_refused": "act",
689
695
  "fs.staging_file_left": "act",
690
696
  "store.lock_retained": "act",
@@ -911,6 +917,7 @@ const NOTICE_MINTER_TABLE = {
911
917
  "task.late_approval": "engine",
912
918
  "task.interrupt_unconsumed": "engine",
913
919
  "task.wait_ceiling_reached": "engine",
920
+ "task.manager_launch_narrowed": "engine",
914
921
  "task.completed_past_limit": "engine",
915
922
  "task.verdict_refused": "engine",
916
923
  "task.tool_turn_incomplete": "engine",
@@ -927,6 +934,7 @@ const NOTICE_MINTER_TABLE = {
927
934
  "skills.listing_truncated": "engine",
928
935
  "agents.listing_truncated": "engine",
929
936
  "tool_result.offload_put_failed": "engine",
937
+ "tool_result.offload_put_unsettled": "engine",
930
938
  "tool_result.media_refused": "engine",
931
939
  "tool_result.media_persisted": "engine",
932
940
  "tool_result.read_refused": "engine",
@@ -1044,7 +1052,7 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
1044
1052
  attentionBefore: "act",
1045
1053
  attentionAfter: "inform",
1046
1054
  branches: [
1047
- { to: "route.stream_content_dropped", when: "a frame refused after the end carried the model's output", keys: { statement: null, word: "word", frames: "frames", sessionId: "sessionId", runId: "runId" } },
1055
+ { to: "route.stream_content_dropped", when: "a frame refused after the end carried the model's output", keys: { statement: null, word: "word", frames: "frames", sessionId: "sessionId", runId: "runId" }, added: ["ending"] },
1048
1056
  ],
1049
1057
  },
1050
1058
  "memory.capture_opted_out": {
@@ -1099,7 +1107,7 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
1099
1107
  sessionId: "sessionId",
1100
1108
  runId: "runId",
1101
1109
  },
1102
- added: ["kind", "identity", "entries[].reason", "entries[].behavior", "entries[].member", "entries[].element.partition", "entries[].element.index", "entries[].element.read"],
1110
+ added: ["kind", "identity", "reasonCounts", "entries[].reason", "entries[].behavior", "entries[].member", "entries[].element.partition", "entries[].element.index", "entries[].element.read"],
1103
1111
  toDetail: { kind: ["stored_rule_row"] },
1104
1112
  },
1105
1113
  ],
@@ -1125,7 +1133,7 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
1125
1133
  agentId: "agentId",
1126
1134
  runId: "runId",
1127
1135
  },
1128
- added: ["kind", "identity"],
1136
+ added: ["kind", "identity", "reasonCounts"],
1129
1137
  toDetail: { kind: ["rule_text_unreadable"] },
1130
1138
  },
1131
1139
  ],
@@ -1186,7 +1194,7 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
1186
1194
  "entries[].carriedBy": "entries[].carriedBy",
1187
1195
  sessionId: "sessionId",
1188
1196
  },
1189
- added: ["kind", "count", "identity"],
1197
+ added: ["kind", "count", "identity", "reasonCounts"],
1190
1198
  toDetail: { kind: ["allow_entry_inert"] },
1191
1199
  bounded: { "entries[]": 8 },
1192
1200
  },
@@ -1208,7 +1216,7 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
1208
1216
  "entries[].carriedBy": "entries[].carriedBy",
1209
1217
  sessionId: "sessionId",
1210
1218
  },
1211
- added: ["count", "identity"],
1219
+ added: ["count", "identity", "reasonCounts"],
1212
1220
  bounded: { "entries[]": 8 },
1213
1221
  },
1214
1222
  ],
@@ -543,6 +543,9 @@ export declare function createHookEnvCapabilities(env: ExecutionEnv): HookEnvCap
543
543
  export interface HookInvocationIdentity {
544
544
  /** The run's session id (uuid domain) — the same key `TaskResult.sessionId` reports. */
545
545
  readonly sessionId: string;
546
+ /** The delegation tree's root session id — the session the tree's shared task list belongs to (`task_list.partition_is_root_session`):
547
+ * `internals.rootSessionId` when present, else {@link sessionId} on a top-level leg, else absent (never fabricated on a child/observer leg with no root anchor). */
548
+ readonly rootSessionId?: string;
546
549
  /** The run's unified task id (the leg's one mint; TaskEvent's `sourceTaskId` and `task_progress` key on it): a background
547
550
  * sub-agent's registry task id, else the host's declared task id, else {@link sessionId}. */
548
551
  readonly taskId: string;
@@ -81,6 +81,7 @@ const IDENTITY_AGENT_NAME_MAX = 80;
81
81
  export function mintHookInvocationIdentity(facts) {
82
82
  return Object.freeze(Object.assign(Object.create(null), {
83
83
  sessionId: facts.sessionId,
84
+ ...(facts.rootSessionId !== undefined ? { rootSessionId: facts.rootSessionId } : {}),
84
85
  taskId: facts.taskId,
85
86
  legKind: facts.legKind,
86
87
  isDelegatedChild: facts.isDelegatedChild,
@@ -0,0 +1,23 @@
1
+ /** Deployment-declared host process identity (`RunnerDeps.host`, projected onto `WiringManifest.host`). */
2
+ export interface HostInstanceDeclaration {
3
+ /** Stable identifier of the host process / replica (single-line visible string, 1..256 UTF-16 units). */
4
+ readonly instanceId: string;
5
+ /** Epoch milliseconds when the host process started (non-negative safe integer, matching `/health.startedAt`). */
6
+ readonly startedAt: number;
7
+ }
8
+ /** Engine-minted per-leg instance identity (`WiringManifest.leg.instance`). */
9
+ export interface WiringLegInstance {
10
+ /** The leg's per-run invocation id (`TaskResult.runId`), minted once at prepare entry. */
11
+ readonly runId: string;
12
+ /** Wall-clock epoch milliseconds minted once beside {@link runId} at prepare entry. */
13
+ readonly startedAt: number;
14
+ }
15
+ /**
16
+ * Receive `RunnerDeps.host` (or `WiringFacts.host`) through the engine's one member door (`receiveMembers`).
17
+ * Absent (`undefined`) ⇒ `undefined` (omitted from the manifest). Present ⇒ validated and returned as a frozen copy;
18
+ * any bad container, stray member, throwing getter, invalid `instanceId`, or invalid `startedAt` throws
19
+ * `config.invalid_argument` naming `<subject>` or `<subject>.<member>` (each member is read once: a getter is kept at its first answer).
20
+ */
21
+ export declare function receiveHostInstance(raw: unknown, subject?: string): Readonly<HostInstanceDeclaration> | undefined;
22
+ /** Screen and freeze a `WiringFacts.legInstance` fact for `deriveWiringManifest`. */
23
+ export declare function readLegInstanceFact(raw: unknown): Readonly<WiringLegInstance>;
@@ -0,0 +1,69 @@
1
+ import { callerText } from "./caller-text.js";
2
+ import { optionKeys, receiveMembers } from "./own-property-receipt.js";
3
+ import { describeRejectedValue } from "./tool-search-setting.js";
4
+ const HOST_INSTANCE_KEYS = optionKeys()({ instanceId: 0, startedAt: 0 });
5
+ const HOST_INSTANCE_ID_MAX_CHARS = 256;
6
+ function hostRefusal(message, field) {
7
+ const e = new Error(message);
8
+ e.code = "config.invalid_argument";
9
+ e.detail = Object.freeze({ field });
10
+ return e;
11
+ }
12
+ export function receiveHostInstance(raw, subject = "RunnerDeps.host") {
13
+ if (raw === undefined)
14
+ return undefined;
15
+ if (typeof raw !== "object" || raw === null) {
16
+ throw hostRefusal(`${subject} must be a plain object { instanceId, startedAt }, got ${raw === null ? "null" : typeof raw}`, subject);
17
+ }
18
+ let copy;
19
+ try {
20
+ copy = receiveMembers(raw, { subject, unit: "member", moment: "when host identity is declared" }, HOST_INSTANCE_KEYS, (msg, [stray]) => hostRefusal(msg, typeof stray === "string" ? `${subject}.${stray}` : subject));
21
+ }
22
+ catch (err) {
23
+ if (err instanceof Error && err.detail === undefined) {
24
+ const { member } = err;
25
+ const field = typeof member === "string" ? `${subject}.${member}` : subject;
26
+ err.detail = Object.freeze({ field });
27
+ }
28
+ throw err;
29
+ }
30
+ const idField = `${subject}.instanceId`;
31
+ const id = copy.instanceId;
32
+ if (typeof id !== "string") {
33
+ throw hostRefusal(`${idField} must be a non-empty string, got ${describeRejectedValue(id)}`, idField);
34
+ }
35
+ if (id.length === 0 || id.trim().length === 0) {
36
+ throw hostRefusal(`${idField} must be a non-empty visible string (got empty or whitespace-only)`, idField);
37
+ }
38
+ if (id.trim() !== id) {
39
+ throw hostRefusal(`${idField} must not carry leading or trailing whitespace (${callerText(id)})`, idField);
40
+ }
41
+ if (/[\u0000-\u001f\u007f-\u009f\u{2028}\u{2029}]/u.test(id)) {
42
+ throw hostRefusal(`${idField} must be a single-line visible string without control characters (${callerText(id)})`, idField);
43
+ }
44
+ if (/(?:^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF](?:$|[^\uDC00-\uDFFF])/.test(id)) {
45
+ throw hostRefusal(`${idField} must be well-formed Unicode`, idField);
46
+ }
47
+ if (id.length > HOST_INSTANCE_ID_MAX_CHARS) {
48
+ throw hostRefusal(`${idField} exceeds ${HOST_INSTANCE_ID_MAX_CHARS} UTF-16 code units (got ${id.length})`, idField);
49
+ }
50
+ const startedAtField = `${subject}.startedAt`;
51
+ const startedAt = copy.startedAt;
52
+ if (typeof startedAt !== "number" || !Number.isSafeInteger(startedAt) || startedAt < 0) {
53
+ throw hostRefusal(`${startedAtField} must be a non-negative safe integer epoch-ms timestamp, got ${describeRejectedValue(startedAt)}`, startedAtField);
54
+ }
55
+ return Object.freeze({ instanceId: id, startedAt });
56
+ }
57
+ export function readLegInstanceFact(raw) {
58
+ if (typeof raw !== "object" || raw === null) {
59
+ throw new Error(`the legInstance wiring fact must be { runId, startedAt }, got ${raw === null ? "null" : typeof raw}`);
60
+ }
61
+ const { runId, startedAt } = raw;
62
+ if (typeof runId !== "string" || runId.length === 0) {
63
+ throw new Error(`the legInstance wiring fact requires a non-empty string runId, got ${describeRejectedValue(runId)}`);
64
+ }
65
+ if (typeof startedAt !== "number" || !Number.isSafeInteger(startedAt) || startedAt < 0) {
66
+ throw new Error(`the legInstance wiring fact requires a non-negative safe integer epoch-ms startedAt, got ${describeRejectedValue(startedAt)}`);
67
+ }
68
+ return Object.freeze({ runId, startedAt });
69
+ }
@@ -0,0 +1,63 @@
1
+ import type { SessionStore } from "./session.js";
2
+ import type { TerminalFailureDetail } from "./terminal-cause.js";
3
+ import type { RunnerDeps, TaskSpec } from "./types.js";
4
+ import type { RunInternals } from "./runner/contracts.js";
5
+ import { type InstructionsWithheldReason } from "./runner/nested-memory-lane.js";
6
+ import { type SessionReadFileStates } from "./runner/session-read-file-states.js";
7
+ /** Why an `outside_its_root` withheld file would still be refused by Read admission even after `externalIncludes` approval. */
8
+ export declare const EXTERNAL_INCLUDE_POST_APPROVAL_BLOCKS: readonly ["outside_roots", "rule_denied", "approval_required", "admission_unknown"];
9
+ export type ExternalIncludePostApprovalBlock = (typeof EXTERNAL_INCLUDE_POST_APPROVAL_BLOCKS)[number];
10
+ /** One instruction file loaded via an `@` include on a leg's first load. */
11
+ export interface InstructionIncludedEntry {
12
+ /** Resolved canonical path of the included instruction file. */
13
+ readonly path: string;
14
+ /** Resolved path of the file (or name of the host text) whose `@` include named this file. */
15
+ readonly includedBy: string;
16
+ /** Path after `@` as the engine read it. */
17
+ readonly spelled: string;
18
+ }
19
+ /** One lane-discovered or host-text instruction file that was not loaded on a leg's first load. */
20
+ export interface InstructionWithheldEntry {
21
+ /** Path the lane probed (or first skipped host text name for `too_many_texts`, or spelled include for `unanchored`). */
22
+ readonly path: string;
23
+ /** Why the file was not loaded — the same closed set `instructions.withheld` notices carry. */
24
+ readonly reason: InstructionsWithheldReason;
25
+ /** Resolved canonical target for `outside_its_root` when resolution named a key (pass this in `externalIncludes`). */
26
+ readonly target?: string;
27
+ /** Resolved path of the file (or name of the host text) whose `@` include named this file. */
28
+ readonly includedBy?: string;
29
+ /** Path after `@` as the engine read it; present with `includedBy`. */
30
+ readonly spelled?: string;
31
+ /** Present on `outside_its_root` entries only when Read admission would still refuse the file after approval. */
32
+ readonly blockedAfterApproval?: ExternalIncludePostApprovalBlock;
33
+ }
34
+ /** The instruction files a leg starts with, shared identically by `WiringManifest.instructions` and `Runner.previewInstructions`. */
35
+ export interface WiringInstructions {
36
+ readonly selected: readonly string[];
37
+ readonly additionalDirectories?: ReadonlyArray<{
38
+ readonly directory: string;
39
+ readonly selected: readonly string[];
40
+ }>;
41
+ /** Files loaded via `@` include; present iff non-empty. */
42
+ readonly included?: readonly InstructionIncludedEntry[];
43
+ /** Lane-discovered and host-text files withheld; present iff non-empty. */
44
+ readonly withheld?: readonly InstructionWithheldEntry[];
45
+ }
46
+ /** Coded answer of `Runner.previewInstructions(spec)`: either the instruction manifest preview, or the run's coded refusal. */
47
+ export type InstructionPreviewResult = {
48
+ readonly ok: true;
49
+ readonly projectMemory: "on" | "disabled" | "absent";
50
+ readonly instructions?: WiringInstructions;
51
+ } | {
52
+ readonly ok: false;
53
+ readonly code?: string;
54
+ readonly message: string;
55
+ readonly detail?: TerminalFailureDetail;
56
+ };
57
+ export interface PreviewInstructionsSeats {
58
+ readonly deps: RunnerDeps;
59
+ readonly sessions: SessionStore;
60
+ readonly readStates: SessionReadFileStates;
61
+ }
62
+ /** Read what instruction files a run of `spec` would load or withhold, through the lane's single first-load reading. */
63
+ export declare function previewInstructionsOf(seats: PreviewInstructionsSeats, spec: TaskSpec, internals?: RunInternals): Promise<InstructionPreviewResult>;