@sema-agent/core 7.72.0 → 7.74.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 (375) hide show
  1. package/CHANGELOG.md +565 -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/list-agents-tool.js +1 -1
  5. package/dist/agents/parked-resume-drive.d.ts +10 -0
  6. package/dist/agents/parked-resume-drive.js +9 -0
  7. package/dist/agents/retain-ledger.d.ts +3 -0
  8. package/dist/agents/retain-ledger.js +3 -3
  9. package/dist/agents/send-message-tool.js +5 -4
  10. package/dist/agents/send-user-message-tool.d.ts +12 -0
  11. package/dist/agents/send-user-message-tool.js +67 -0
  12. package/dist/agents/subagent-steps.d.ts +9 -0
  13. package/dist/agents/subagent-steps.js +38 -0
  14. package/dist/agents/subagent.d.ts +2 -0
  15. package/dist/agents/subagent.js +43 -12
  16. package/dist/agents/verify.js +23 -8
  17. package/dist/agents/yield-adoption.js +3 -1
  18. package/dist/brain/anthropic.d.ts +42 -1
  19. package/dist/brain/anthropic.js +68 -13
  20. package/dist/brain/failover.d.ts +5 -0
  21. package/dist/brain/failover.js +51 -22
  22. package/dist/brain/model-lane.d.ts +12 -3
  23. package/dist/brain/model-lane.js +5 -5
  24. package/dist/brain/open-responses.js +7 -8
  25. package/dist/brain/openai.js +31 -24
  26. package/dist/brain/route-adjudicator.d.ts +33 -4
  27. package/dist/brain/route-adjudicator.js +49 -12
  28. package/dist/brain/stream-engine.js +166 -156
  29. package/dist/brain/stream-shared.d.ts +4 -3
  30. package/dist/brain/stream-shared.js +2 -2
  31. package/dist/core/actions-digest.d.ts +43 -0
  32. package/dist/core/actions-digest.js +22 -0
  33. package/dist/core/allow-entry.js +4 -4
  34. package/dist/core/ask-class.d.ts +2 -2
  35. package/dist/core/ask-headline.d.ts +1 -1
  36. package/dist/core/ask-origin.d.ts +44 -4
  37. package/dist/core/ask-origin.js +29 -10
  38. package/dist/core/auto-mode.d.ts +7 -9
  39. package/dist/core/auto-mode.js +114 -8
  40. package/dist/core/background-agent-store.d.ts +1 -0
  41. package/dist/core/background-agent-store.js +49 -8
  42. package/dist/core/checkpoint-features.d.ts +3 -2
  43. package/dist/core/checkpoint-features.js +1 -1
  44. package/dist/core/checkpoint-rekey.d.ts +1 -1
  45. package/dist/core/checkpoint-rekey.js +6 -1
  46. package/dist/core/checkpoint-requirements.d.ts +23 -3
  47. package/dist/core/checkpoint-requirements.js +5 -1
  48. package/dist/core/checkpoint-row-verdict.d.ts +1 -1
  49. package/dist/core/checkpoint-row-verdict.js +9 -3
  50. package/dist/core/checkpoint-store.d.ts +26 -2
  51. package/dist/core/checkpoint-store.js +9 -2
  52. package/dist/core/child-clamp-seats.d.ts +15 -0
  53. package/dist/core/child-clamp-seats.js +15 -0
  54. package/dist/core/config-refusal-codes.d.ts +1 -1
  55. package/dist/core/config-refusal-codes.js +1 -0
  56. package/dist/core/cron.js +9 -1
  57. package/dist/core/delegation-frames.d.ts +1 -0
  58. package/dist/core/delegation-frames.js +1 -1
  59. package/dist/core/deployment-shape.d.ts +7 -0
  60. package/dist/core/deployment-shape.js +19 -0
  61. package/dist/core/engine-capabilities.d.ts +13 -1
  62. package/dist/core/engine-capabilities.js +1 -1
  63. package/dist/core/engine-notice.d.ts +41 -28
  64. package/dist/core/engine-version.js +1 -1
  65. package/dist/core/entries-not-applied.d.ts +19 -7
  66. package/dist/core/entries-not-applied.js +33 -1
  67. package/dist/core/gate-fold.js +5 -4
  68. package/dist/core/gate-lanes.js +8 -12
  69. package/dist/core/gate-outcome.d.ts +8 -2
  70. package/dist/core/gate-outcome.js +10 -3
  71. package/dist/core/governance-codes.d.ts +14 -2
  72. package/dist/core/governance-codes.js +22 -6
  73. package/dist/core/hook-condition.d.ts +37 -0
  74. package/dist/core/hook-condition.js +567 -0
  75. package/dist/core/hooks.d.ts +5 -0
  76. package/dist/core/hooks.js +1 -0
  77. package/dist/core/host-instance.d.ts +23 -0
  78. package/dist/core/host-instance.js +69 -0
  79. package/dist/core/instruction-preview.d.ts +63 -0
  80. package/dist/core/instruction-preview.js +406 -0
  81. package/dist/core/leg-budget.d.ts +26 -0
  82. package/dist/core/leg-budget.js +9 -0
  83. package/dist/core/leg-identity.d.ts +51 -1
  84. package/dist/core/leg-identity.js +45 -2
  85. package/dist/core/manager-launch-check.d.ts +48 -0
  86. package/dist/core/manager-launch-check.js +64 -0
  87. package/dist/core/mcp-call-meta.d.ts +2 -2
  88. package/dist/core/mcp-injection-drop.d.ts +20 -10
  89. package/dist/core/mcp-injection-drop.js +9 -3
  90. package/dist/core/mcp-server-spec.d.ts +2 -1
  91. package/dist/core/member-outcome.d.ts +3 -2
  92. package/dist/core/member-outcome.js +1 -1
  93. package/dist/core/memory-engine/deletion-record.d.ts +46 -0
  94. package/dist/core/memory-engine/deletion-record.js +96 -0
  95. package/dist/core/memory-engine/engine.js +24 -16
  96. package/dist/core/memory-engine/file-backend.js +7 -5
  97. package/dist/core/memory-engine/projection-ledger.d.ts +1 -1
  98. package/dist/core/memory-engine/projection-ledger.js +1 -1
  99. package/dist/core/memory-engine/scope-contract.d.ts +18 -13
  100. package/dist/core/memory-engine/scope-contract.js +18 -18
  101. package/dist/core/memory-engine/sync-client.js +26 -6
  102. package/dist/core/memory-engine/sync.d.ts +20 -2
  103. package/dist/core/memory-engine/sync.js +18 -17
  104. package/dist/core/mode-policy.d.ts +25 -6
  105. package/dist/core/mode-policy.js +33 -8
  106. package/dist/core/model-seat.d.ts +8 -5
  107. package/dist/core/model-shell.d.ts +129 -0
  108. package/dist/core/model-shell.js +249 -0
  109. package/dist/core/mods/kernel/digest.d.ts +4 -0
  110. package/dist/core/mods/kernel/digest.js +5 -0
  111. package/dist/core/mods/kernel/dispatch.d.ts +3 -0
  112. package/dist/core/mods/kernel/dispatch.js +15 -6
  113. package/dist/core/mods/kernel/events.d.ts +21 -5
  114. package/dist/core/mods/kernel/events.js +19 -10
  115. package/dist/core/mods/kernel/hash-mirror.d.ts +1 -0
  116. package/dist/core/mods/kernel/hash-mirror.js +55 -0
  117. package/dist/core/mods/kernel/index.d.ts +1 -0
  118. package/dist/core/mods/kernel/index.js +1 -0
  119. package/dist/core/mods/kernel/package-reader.d.ts +48 -0
  120. package/dist/core/mods/kernel/package-reader.js +149 -0
  121. package/dist/core/mods/kernel/site-rules.d.ts +4 -0
  122. package/dist/core/mods/kernel/site-rules.js +13 -0
  123. package/dist/core/mods/package.d.ts +7 -3
  124. package/dist/core/mods/package.js +47 -80
  125. package/dist/core/own-property-receipt.js +11 -4
  126. package/dist/core/parent-spec-seat.d.ts +13 -11
  127. package/dist/core/parent-spec-seat.js +13 -9
  128. package/dist/core/peer-seat.js +3 -3
  129. package/dist/core/peer-task-store.d.ts +365 -0
  130. package/dist/core/peer-task-store.js +682 -0
  131. package/dist/core/permission-rule-consent.js +6 -11
  132. package/dist/core/permission-rule-model.d.ts +27 -0
  133. package/dist/core/permission-rule-model.js +33 -5
  134. package/dist/core/permission-rule-org.js +13 -3
  135. package/dist/core/permission-rule-provider.d.ts +35 -33
  136. package/dist/core/permission-rule-provider.js +38 -295
  137. package/dist/core/permission-rule-store.d.ts +181 -8
  138. package/dist/core/permission-rule-store.js +420 -17
  139. package/dist/core/permission-rule-sync.js +15 -1
  140. package/dist/core/permission-rules.js +4 -1
  141. package/dist/core/project-seat.d.ts +55 -0
  142. package/dist/core/project-seat.js +96 -0
  143. package/dist/core/protocol-http-auth.d.ts +3 -2
  144. package/dist/core/protocol-http-auth.js +26 -18
  145. package/dist/core/remote-env.d.ts +4 -4
  146. package/dist/core/retain-seat.d.ts +42 -0
  147. package/dist/core/retain-seat.js +76 -0
  148. package/dist/core/retired-keys.js +1 -0
  149. package/dist/core/rewind-refusal-codes.d.ts +8 -0
  150. package/dist/core/rewind-refusal-codes.js +12 -0
  151. package/dist/core/roles.d.ts +2 -2
  152. package/dist/core/roles.js +15 -1
  153. package/dist/core/rule-offer-read.d.ts +1 -1
  154. package/dist/core/rule-offer-read.js +32 -4
  155. package/dist/core/rule-store-fault.d.ts +9 -7
  156. package/dist/core/rule-store-fault.js +8 -3
  157. package/dist/core/run-ledger-seat.d.ts +66 -0
  158. package/dist/core/run-ledger-seat.js +70 -0
  159. package/dist/core/run-ledger.d.ts +332 -0
  160. package/dist/core/run-ledger.js +550 -0
  161. package/dist/core/runner/checkpoint-scope.d.ts +14 -3
  162. package/dist/core/runner/checkpoint-scope.js +16 -6
  163. package/dist/core/runner/compact-session.js +1 -1
  164. package/dist/core/runner/construction-doors.js +8 -0
  165. package/dist/core/runner/contracts.d.ts +21 -5
  166. package/dist/core/runner/cross-boundary-lane.d.ts +8 -1
  167. package/dist/core/runner/cross-boundary-lane.js +4 -0
  168. package/dist/core/runner/delegation-owner.d.ts +30 -0
  169. package/dist/core/runner/delegation-owner.js +20 -4
  170. package/dist/core/runner/finish-reason-seat.js +4 -2
  171. package/dist/core/runner/gate-exit.d.ts +7 -0
  172. package/dist/core/runner/gate-exit.js +2 -1
  173. package/dist/core/runner/leg-frame.js +3 -0
  174. package/dist/core/runner/model-lane-seat.d.ts +3 -0
  175. package/dist/core/runner/model-lane-seat.js +4 -0
  176. package/dist/core/runner/nested-memory-lane.d.ts +22 -5
  177. package/dist/core/runner/nested-memory-lane.js +91 -30
  178. package/dist/core/runner/person-path-rows.d.ts +27 -16
  179. package/dist/core/runner/person-path-rows.js +93 -15
  180. package/dist/core/runner/prepare-caps-and-workflow.js +98 -88
  181. package/dist/core/runner/prepare-config-doors.d.ts +1 -0
  182. package/dist/core/runner/prepare-config-doors.js +13 -7
  183. package/dist/core/runner/prepare-context-lane.js +1 -0
  184. package/dist/core/runner/prepare-delegation-surface.d.ts +3 -0
  185. package/dist/core/runner/prepare-delegation-surface.js +6 -0
  186. package/dist/core/runner/prepare-execution-env.d.ts +3 -3
  187. package/dist/core/runner/prepare-gate-stations.d.ts +6 -0
  188. package/dist/core/runner/prepare-gate-stations.js +3 -1
  189. package/dist/core/runner/prepare-hands-readface.d.ts +5 -2
  190. package/dist/core/runner/prepare-hands-readface.js +15 -3
  191. package/dist/core/runner/prepare-inherited-gate.d.ts +6 -3
  192. package/dist/core/runner/prepare-inherited-gate.js +13 -5
  193. package/dist/core/runner/prepare-offload-wrappers.js +1 -1
  194. package/dist/core/runner/prepare-run-refs.d.ts +1 -1
  195. package/dist/core/runner/prepare-run-refs.js +3 -2
  196. package/dist/core/runner/prepare-suspend-saga.d.ts +6 -2
  197. package/dist/core/runner/prepare-suspend-saga.js +4 -2
  198. package/dist/core/runner/prepare-task.js +42 -30
  199. package/dist/core/runner/prepare-turn-wiring.d.ts +4 -3
  200. package/dist/core/runner/prepare-turn-wiring.js +2 -1
  201. package/dist/core/runner/prepare-wiring-manifest.d.ts +3 -1
  202. package/dist/core/runner/prepare-wiring-manifest.js +8 -6
  203. package/dist/core/runner/resume-apply.js +11 -5
  204. package/dist/core/runner/resume-policy-outcome.js +5 -2
  205. package/dist/core/runner/resume-review-outcome.d.ts +3 -0
  206. package/dist/core/runner/resume-review-outcome.js +24 -1
  207. package/dist/core/runner/role-seat-defaulted.d.ts +3 -3
  208. package/dist/core/runner/role-seat-defaulted.js +1 -1
  209. package/dist/core/runner/rule-store-unreadable-notice.d.ts +1 -1
  210. package/dist/core/runner/rule-store-unreadable-notice.js +3 -3
  211. package/dist/core/runner/run-harness-handlers.js +4 -1
  212. package/dist/core/runner/run-identity-wiring.js +3 -2
  213. package/dist/core/runner/run-leg.js +5 -2
  214. package/dist/core/runner/run-notification-lane.js +20 -1
  215. package/dist/core/runner/run-settle-and-teardown.js +21 -12
  216. package/dist/core/runner/run-stop-and-final-verify.js +6 -0
  217. package/dist/core/runner/run-telemetry-and-budget-seats.js +1 -1
  218. package/dist/core/runner/runtask.d.ts +6 -2
  219. package/dist/core/runner/runtask.js +21 -9
  220. package/dist/core/runner/shell-env-withheld.d.ts +6 -4
  221. package/dist/core/runner/shell-env-withheld.js +25 -3
  222. package/dist/core/runner/stop-tail-notice.d.ts +10 -2
  223. package/dist/core/runner/stop-tail-notice.js +9 -2
  224. package/dist/core/runner/stream-settle-backstop.d.ts +1 -0
  225. package/dist/core/runner/stream-settle-backstop.js +1 -0
  226. package/dist/core/runner/sub-agent-deny-lists.js +9 -5
  227. package/dist/core/runner/task-start-doors.js +6 -3
  228. package/dist/core/runner/terminal-account.d.ts +6 -1
  229. package/dist/core/runner/terminal-account.js +16 -1
  230. package/dist/core/runner/tool-end-body.d.ts +1 -1
  231. package/dist/core/runner/tool-not-executed.d.ts +27 -8
  232. package/dist/core/runner/tool-not-executed.js +22 -11
  233. package/dist/core/runner/unreadable-person-rows.d.ts +2 -1
  234. package/dist/core/runner/write-protection-station.d.ts +1 -1
  235. package/dist/core/runner/write-protection-station.js +1 -1
  236. package/dist/core/runner-deps.d.ts +17 -10
  237. package/dist/core/secret-env.d.ts +61 -37
  238. package/dist/core/secret-env.js +49 -49
  239. package/dist/core/session-checkout.d.ts +3 -0
  240. package/dist/core/session-checkout.js +1 -0
  241. package/dist/core/session-store.d.ts +12 -6
  242. package/dist/core/session-store.js +26 -6
  243. package/dist/core/session.d.ts +31 -8
  244. package/dist/core/shell-read-silence.d.ts +40 -2
  245. package/dist/core/shell-read-silence.js +23 -4
  246. package/dist/core/store-contracts/checkpoint-store-contract.js +10 -0
  247. package/dist/core/store-contracts/peer-task-store-contract.d.ts +21 -0
  248. package/dist/core/store-contracts/peer-task-store-contract.js +516 -0
  249. package/dist/core/store-contracts/session-store-contract.d.ts +15 -2
  250. package/dist/core/store-contracts/session-store-contract.js +87 -3
  251. package/dist/core/store-contracts/workflow-journal-store-contract.d.ts +19 -1
  252. package/dist/core/store-contracts/workflow-journal-store-contract.js +89 -1
  253. package/dist/core/task-event.d.ts +14 -7
  254. package/dist/core/task-notification.d.ts +96 -10
  255. package/dist/core/task-notification.js +135 -6
  256. package/dist/core/task-registry-agent.d.ts +1 -0
  257. package/dist/core/task-registry-agent.js +1 -1
  258. package/dist/core/task-registry-shared.d.ts +12 -1
  259. package/dist/core/task-registry-shared.js +3 -1
  260. package/dist/core/task-registry-workflow.d.ts +1 -1
  261. package/dist/core/task-registry-workflow.js +9 -1
  262. package/dist/core/task-registry.d.ts +40 -2
  263. package/dist/core/task-registry.js +80 -15
  264. package/dist/core/task-result.d.ts +18 -3
  265. package/dist/core/task-spec-members.d.ts +3 -1
  266. package/dist/core/task-spec-members.js +19 -3
  267. package/dist/core/task-spec.d.ts +48 -22
  268. package/dist/core/tool-catalog-entries.js +2 -0
  269. package/dist/core/tool-gate-phase.d.ts +6 -3
  270. package/dist/core/tool-gate-phase.js +1 -0
  271. package/dist/core/tool-mount-facts.d.ts +8 -4
  272. package/dist/core/tool-mount-facts.js +7 -2
  273. package/dist/core/tool-mount-plan.d.ts +3 -1
  274. package/dist/core/tool-mount-plan.js +10 -3
  275. package/dist/core/tool-mount-static.d.ts +1 -1
  276. package/dist/core/tool-mount-static.js +4 -2
  277. package/dist/core/tool-result-store.d.ts +56 -3
  278. package/dist/core/tool-result-store.js +219 -25
  279. package/dist/core/tool-spec.d.ts +9 -2
  280. package/dist/core/trace.d.ts +3 -3
  281. package/dist/core/user-attachment.d.ts +5 -1
  282. package/dist/core/user-attachment.js +14 -7
  283. package/dist/core/wiring-manifest.d.ts +26 -20
  284. package/dist/core/wiring-manifest.js +7 -3
  285. package/dist/core/workflow-journal-store.d.ts +53 -10
  286. package/dist/core/workflow-journal-store.js +27 -4
  287. package/dist/core/workflow-run-store-contract.js +16 -0
  288. package/dist/core/workflow-run-store.d.ts +9 -7
  289. package/dist/core/workflow-run-store.js +4 -1
  290. package/dist/engine/execution-env/node-execution-env.d.ts +75 -1
  291. package/dist/engine/execution-env/node-execution-env.js +227 -13
  292. package/dist/engine/harness/types.d.ts +49 -1
  293. package/dist/engine/harness/types.js +10 -0
  294. package/dist/engine/llm/types.d.ts +13 -7
  295. package/dist/engine/llm/validation.d.ts +8 -1
  296. package/dist/engine/llm/validation.js +31 -2
  297. package/dist/engine/lsp/node-lsp-manager.js +2 -1
  298. package/dist/engine/session/import-validate.js +6 -1
  299. package/dist/engine/session/session.d.ts +15 -2
  300. package/dist/engine/session/session.js +34 -4
  301. package/dist/host-env.d.ts +10 -0
  302. package/dist/host-env.js +1 -0
  303. package/dist/index.d.ts +28 -9
  304. package/dist/index.js +22 -6
  305. package/dist/internal/harness-types.d.ts +1 -1
  306. package/dist/orchestration/goal.js +1 -1
  307. package/dist/orchestration/run-workflow-tool.js +40 -32
  308. package/dist/orchestration/workflow-park-adoption.d.ts +51 -12
  309. package/dist/orchestration/workflow-park-adoption.js +47 -12
  310. package/dist/orchestration/workflow-primitives.js +10 -1
  311. package/dist/orchestration/workflow-script-runner.d.ts +2 -2
  312. package/dist/orchestration/workflow-stop.d.ts +128 -0
  313. package/dist/orchestration/workflow-stop.js +156 -0
  314. package/dist/orchestration/workflow.d.ts +31 -7
  315. package/dist/orchestration/workflow.js +119 -57
  316. package/dist/prompts/manager-recipe.d.ts +18 -0
  317. package/dist/prompts/manager-recipe.js +24 -0
  318. package/dist/shell/lex.d.ts +2 -2
  319. package/dist/shell/lex.js +1 -1
  320. package/dist/stores/file/permission-rule-store.d.ts +3 -1
  321. package/dist/stores/file/permission-rule-store.js +0 -1
  322. package/dist/stores/file/workflow-journal-store.d.ts +16 -3
  323. package/dist/stores/file/workflow-journal-store.js +93 -5
  324. package/dist/stores/file/workflow-run-store.d.ts +1 -1
  325. package/dist/tools/fs/bash-model-shell.d.ts +23 -0
  326. package/dist/tools/fs/bash-model-shell.js +25 -0
  327. package/dist/tools/fs/bash-readonly-classifier.d.ts +6 -0
  328. package/dist/tools/fs/bash-readonly-classifier.js +3 -0
  329. package/dist/tools/fs/file-write-check.js +9 -3
  330. package/dist/tools/fs/fs-bash.js +13 -11
  331. package/dist/tools/fs/index.d.ts +8 -7
  332. package/dist/tools/fs/index.js +4 -4
  333. package/dist/tools/fs/read-deny-home.d.ts +1 -1
  334. package/dist/tools/fs/read-deny-home.js +5 -5
  335. package/dist/tools/fs/read-deny.d.ts +33 -8
  336. package/dist/tools/fs/read-deny.js +114 -25
  337. package/dist/tools/fs/safety.d.ts +4 -1
  338. package/dist/tools/fs/safety.js +4 -2
  339. package/dist/tools/fs/shell-read-argv.js +1 -0
  340. package/dist/tools/fs/shell-read-check.d.ts +9 -2
  341. package/dist/tools/fs/shell-read-check.js +134 -22
  342. package/dist/tools/fs/shell-read-establish.d.ts +9 -0
  343. package/dist/tools/fs/shell-read-establish.js +21 -11
  344. package/dist/tools/fs/shell-read-judge.d.ts +13 -1
  345. package/dist/tools/fs/shell-read-judge.js +26 -7
  346. package/dist/tools/fs/shell-read-plan.d.ts +7 -3
  347. package/dist/tools/fs/shell-read-plan.js +8 -5
  348. package/dist/tools/fs/shell-read-word.d.ts +8 -0
  349. package/dist/tools/fs/shell-read-word.js +13 -4
  350. package/dist/tools/fs/shell-read-write-targets.js +17 -9
  351. package/dist/tools/monitor.js +12 -8
  352. package/dist/tools/scheduler-tools.d.ts +1 -0
  353. package/dist/tools/scheduler-tools.js +5 -2
  354. package/package.json +3 -2
  355. package/test/export-surface.snapshot.json +192 -3
  356. package/wire-changes/answers/core-stores-sql@7.73.0.json +28 -0
  357. package/wire-changes/answers/core-stores-sql@7.74.0.json +7 -0
  358. package/wire-changes/answers/core@7.73.0.json +216 -0
  359. package/wire-changes/answers/core@7.74.0.json +68 -0
  360. package/wire-changes/answers/mods-kernel@7.73.0.json +7 -0
  361. package/wire-changes/answers/mods-kernel@7.74.0.json +21 -0
  362. package/wire-changes/answers/primitives@7.73.0.json +12 -0
  363. package/wire-changes/answers/primitives@7.74.0.json +7 -0
  364. package/wire-changes/answers/wiki-gate@7.73.0.json +7 -0
  365. package/wire-changes/answers/wiki-gate@7.74.0.json +8 -0
  366. package/wire-changes/core-stores-sql@7.73.0.json +326 -0
  367. package/wire-changes/core-stores-sql@7.74.0.json +143 -0
  368. package/wire-changes/core@7.73.0.json +6480 -0
  369. package/wire-changes/core@7.74.0.json +2210 -0
  370. package/wire-changes/mods-kernel@7.73.0.json +147 -0
  371. package/wire-changes/mods-kernel@7.74.0.json +421 -0
  372. package/wire-changes/primitives@7.73.0.json +227 -0
  373. package/wire-changes/primitives@7.74.0.json +174 -0
  374. package/wire-changes/wiki-gate@7.73.0.json +145 -0
  375. package/wire-changes/wiki-gate@7.74.0.json +145 -0
@@ -36,8 +36,16 @@ export declare function stopTailWaitedFor(owed: Pick<DeliveryObligations, "pendi
36
36
  read: TaskAccess;
37
37
  owner: TaskAccess;
38
38
  }, registry?: Pick<TaskRegistry, "runEndReading">): readonly StopTailWaitedTask[];
39
- /** `task.interrupt_unconsumed`, for a stop that landed after the answer settled. `origin` names the axis that stopped the run. */
40
- export declare function interruptUnconsumedNotice(waitedFor: readonly StopTailWaitedTask[], origin: string, ids: Record<string, string>): EngineNotice;
39
+ /** `task.interrupt_unconsumed`, for a stop that landed after the answer settled. `origin` names the axis that stopped the run;
40
+ * `crossedAxis` the axis the result's `limitCrossed` records when it records one (a budget, walltime or turn stop at the tail is a
41
+ * ceiling the run ended past) — the sentence then names that record instead of saying none exists. */
42
+ export declare function interruptUnconsumedNotice(waitedFor: readonly StopTailWaitedTask[], origin: string, ids: Record<string, string>, crossedAxis?: string): EngineNotice;
43
+ /**
44
+ * The engine note a run with a member ledger reads when its one-shot wait reached its ceiling (`TaskSpec.runLedger`): one more turn,
45
+ * told which tasks it is leaving behind and what the run's end does to each, so the gap goes into its report to the person. Same
46
+ * reading as {@link waitCeilingReachedNotice} (read before the run-end sweep).
47
+ */
48
+ export declare function ceilingTurnNote(waitedFor: readonly StopTailWaitedTask[], ceilingMs: number): string;
41
49
  /**
42
50
  * `task.wait_ceiling_reached`, for a one-shot ending whose wait reached its ceiling (`limits.oneShotWaitCeilingMs`, `ceilingMs` the
43
51
  * value it waited under) with background tasks it started still owed: no stop arrived — the wait gave up. `waitedFor` is the same
@@ -27,8 +27,10 @@ function fatesSaid(waitedFor) {
27
27
  .join("; ");
28
28
  }
29
29
  const counted = (n) => `${n} background task${n === 1 ? "" : "s"}`;
30
- export function interruptUnconsumedNotice(waitedFor, origin, ids) {
31
- const tail = "the answer stands as the result, the run ends completed, and no interruption marker or limit code records the stop.";
30
+ export function interruptUnconsumedNotice(waitedFor, origin, ids, crossedAxis) {
31
+ const tail = crossedAxis !== undefined
32
+ ? `the answer stands as the result and the run ends completed; no interruption marker records the stop, and the result records the ${crossedAxis} limit it ended past.`
33
+ : "the answer stands as the result, the run ends completed, and no interruption marker or limit code records the stop.";
32
34
  if (waitedFor.length === 0) {
33
35
  return { code: "task.interrupt_unconsumed", message: `a stop arrived after the run had already given its answer: nothing was cut or stopped by it — ${tail}`, detail: { ...ids, origin, waitedFor: [] } };
34
36
  }
@@ -39,6 +41,11 @@ export function interruptUnconsumedNotice(waitedFor, origin, ids) {
39
41
  detail: { ...ids, origin, waitedFor: waitedFor.map((t) => ({ ...t })) },
40
42
  };
41
43
  }
44
+ export function ceilingTurnNote(waitedFor, ceilingMs) {
45
+ const left = waitedFor.length > 0 ? ` ${counted(waitedFor.length)} you started ${waitedFor.length === 1 ? "has" : "have"} not finished (${fatesSaid(waitedFor)}).` : "";
46
+ return (`[Engine note] The wait for the work you dispatched reached its ceiling (${ceilingMs} ms), so this run ends after this turn.${left} ` +
47
+ "Nothing from them reaches your result. Tell the person what is missing — call SendUserMessage with the gap and what it means for your conclusions — then end.");
48
+ }
42
49
  export function waitCeilingReachedNotice(waitedFor, ceilingMs, ids) {
43
50
  return {
44
51
  code: "task.wait_ceiling_reached",
@@ -1,3 +1,4 @@
1
+ export { failedPreRunResult } from "./terminal-account.js";
1
2
  import type { CheckpointToken } from "../checkpoint-store.js";
2
3
  import type { PushQueue } from "../push-queue.js";
3
4
  import type { SessionStore } from "../session.js";
@@ -1,4 +1,5 @@
1
1
  import { thrownFailureOf } from "./terminal-account.js";
2
+ export { failedPreRunResult } from "./terminal-account.js";
2
3
  import { compensateUnstarted, reopenReasonOf, resumeAgainMayCure, rowKeepsWhatItsRetryNeeds, unstartedFailureOf, unstartedRowSentence } from "../resume-startup-cause.js";
3
4
  import { resumeDecisionWasNegative } from "./decide-continuation.js";
4
5
  import { drainForwardedFramesBeforeDone, forwardsSubagentEvents } from "./prepare-run-refs.js";
@@ -95,8 +95,11 @@ const NEAR_MISS_EFFECT = {
95
95
  allowed: "it admits nothing, so the tool it was written for is not granted",
96
96
  denied: "it hides nothing, so the tool it was written for stays available to the agent",
97
97
  };
98
- function nearMissRefusal(where, side, flaw, code) {
99
- return refused(`${where} declares tool ${inertEntryPhrase(flaw)} in its ${LIST_WORD[side]}, a spelling that reaches no tool a run mounts — ${NEAR_MISS_EFFECT[side]}. Write the name as the tool is mounted.`, code, "near_miss");
98
+ function nearMissRefusal(where, side, flaw, code, poolUnlisted = false) {
99
+ const tail = poolUnlisted
100
+ ? "Write the name as the tool is mounted — or, if the name is one a delegation tool's extraTools factory injects, declare it in that tool's extraToolNames so this run can list it."
101
+ : "Write the name as the tool is mounted.";
102
+ return refused(`${where} declares tool ${inertEntryPhrase(flaw)} in its ${LIST_WORD[side]}, a spelling that reaches no tool a run mounts — ${NEAR_MISS_EFFECT[side]}. ${tail}`, code, "near_miss");
100
103
  }
101
104
  function grammarSentence(where, side, entry, consequence) {
102
105
  return `${where} declares tool ${inertEntryPhrase({ entry, reason: "grammar" })} in its ${LIST_WORD[side]}, a spelling no tool name can have — ${consequence} ${DENY_LIST_NAMES_ONLY}`;
@@ -152,7 +155,7 @@ const KEPT_ENTRY = {
152
155
  };
153
156
  const KEPT_ENTRY_UNLISTED_POOL = "so it is kept here: the pool this delegation tool hands its child cannot be listed, and the spawned child judges the entry against its own roster (another spelling of a tool it carries refuses the child before it starts; an exact name takes effect; a name nothing answers to there stays in force for a tool of that name mounted later)";
154
157
  const PEER_WORD = { mcp: "MCP server", a2a: "A2A peer" };
155
- function judgeToolNameList(where, side, value, universe, advise, code, retired, definition) {
158
+ function judgeToolNameList(where, side, value, universe, advise, code, retired, definition, hintUnlistedPool = false) {
156
159
  const form = readToolNameListForm(where, side, ruleListUnderView(value, universe.retiredNames));
157
160
  const refusing = definition === true ? form.flaws.find(isStructuralFlaw) : form.flaws[0];
158
161
  if (refusing !== undefined)
@@ -177,7 +180,7 @@ function judgeToolNameList(where, side, value, universe, advise, code, retired,
177
180
  const { inert } = compileAllowList([toolName], "deny", universe.known);
178
181
  const flaw = inert[0] === undefined ? undefined : { ...inert[0], entry, ...(inert[0].reason === "near_miss" && inert[0].currentName !== undefined ? { carriedBy: universe.carrierOf(inert[0].currentName) } : {}) };
179
182
  if (universe.complete && flaw?.currentName !== undefined)
180
- throw nearMissRefusal(where, side, flaw, code);
183
+ throw nearMissRefusal(where, side, flaw, code, hintUnlistedPool);
181
184
  if (toolName !== name) {
182
185
  advise(new Error(`${where} declares ${renderListEntry(entry)} in its allowed tools: an allowed list names tools, not content, so this entry grants nothing — name the tool "${inlineUntrusted(toolName, 80)}" to grant it, or move the content rule to a denied list or a permission rule.`));
183
186
  continue;
@@ -414,8 +417,9 @@ export function judgeRunToolLists(input) {
414
417
  const silent = () => undefined;
415
418
  const told = input.toldUpstream === true;
416
419
  const ownAdvise = told ? silent : ownWhere === undefined ? adviseAuthor : advise;
420
+ const rootTaskLists = ownWhere === undefined && !input.legs.includes("delegated");
417
421
  for (const [side, value] of own)
418
- judgeToolNameList(ownWhere ?? (side === "allowed" ? "TaskSpec.allowTools" : "TaskSpec.excludeTools"), side, value, root, ownAdvise, "config.tool_face_control", told ? silent : retire);
422
+ judgeToolNameList(ownWhere ?? (side === "allowed" ? "TaskSpec.allowTools" : "TaskSpec.excludeTools"), side, value, root, ownAdvise, "config.tool_face_control", told ? silent : retire, undefined, rootTaskLists && !pool.complete);
419
423
  }
420
424
  if (definitionLayer !== undefined && definitionWhere !== undefined) {
421
425
  judgeToolNameList(definitionWhere, "allowed", definitionLayer.allow, root, advise, "config.agent.unknown_tool", undefined, true);
@@ -21,7 +21,8 @@ import { enterConfigDoor, LIVE_OVER_ROW, resolveSeatValue } from "../config-refu
21
21
  import { envOfAssembly, workspaceOfAssembly } from "./prepare-execution-env.js";
22
22
  import { compileReadDeny, readDenyBuiltinConfigOf } from "../../tools/fs/read-deny.js";
23
23
  import { readDenyFloorRefusal } from "../../tools/fs/read-floor.js";
24
- import { unionAddOnly } from "../child-clamp-seats.js";
24
+ import { unionAddOnly, withOwnLegHands } from "../child-clamp-seats.js";
25
+ import { assertRunLedgerDeclaration } from "../run-ledger.js";
25
26
  import { prepareSafetyScan } from "./prepare-safety-scan.js";
26
27
  import { boundOwnToolLists, boundToolListsJudgment, judgeHostToolCeiling, ownListsWhereOf, readToolSelector, refuseNonListToolCeiling } from "./sub-agent-deny-lists.js";
27
28
  import { legRetiredNameView, selectorLayerUnderView } from "../tool-name-aliases.js";
@@ -64,13 +65,16 @@ export function taskStartDoors(input) {
64
65
  const languageDeclared = enterConfigDoor("taskConfig", () => screenLanguageSeat(spec.language));
65
66
  const allowedTools = enterConfigDoor("taskConfig", () => screenAllowedToolsValue(spec.allowedTools, "TaskSpec.allowedTools"));
66
67
  const userAttachmentsSeat = enterConfigDoor("taskConfig", () => screenUserAttachments(spec.userAttachments, { resumeLeg: resume !== undefined }));
68
+ const delegation = effectiveDelegationFacts(internals, resume?.seed.isDelegatedChild);
67
69
  const declaredModeAtDoor = (() => {
68
- const requested = modeRequestAfterResume(permissionModeSeat, recordedModeSeed(resume?.seed.inheritedGate), resume?.outcome);
69
70
  const live = internals?.inheritedGate?.permissionModeCeiling;
70
71
  const ceiling = live !== undefined ? (live.observed ?? live.current) : internals?.inheritedGate?.permissionMode;
72
+ const requested = modeRequestAfterResume(permissionModeSeat, recordedModeSeed(resume?.seed.inheritedGate), resume?.outcome, delegation.isDelegatedChild && ceiling === undefined ? true : undefined);
71
73
  return ceiling === undefined ? (requested ?? "default") : clampPermissionMode(requested, ceiling).effective;
72
74
  })();
73
75
  spec = withModeSeats(spec, declaredModeAtDoor);
76
+ enterConfigDoor("taskConfig", () => assertRunLedgerDeclaration(spec.runLedger));
77
+ spec = enterConfigDoor("taskConfig", () => withOwnLegHands(spec));
74
78
  const planFile = spec.planFile;
75
79
  enterConfigDoor("taskConfig", () => checkedPlanFileShape(planFile));
76
80
  const scanned = spec;
@@ -80,7 +84,6 @@ export function taskStartDoors(input) {
80
84
  const { toolFaceLists } = doors;
81
85
  const ownListsRecord = resolveSeatValue(internals?.ownToolLists, () => resume?.seed.ownToolLists, LIVE_OVER_ROW);
82
86
  const ownToolLists = enterConfigDoor(ownListsRecord.input, () => boundOwnToolLists(ownListsRecord.value, toolFaceLists));
83
- const delegation = effectiveDelegationFacts(internals, resume?.seed.isDelegatedChild);
84
87
  const approvalParkNotResumable = approvalParkNotResumableOf({ engineLaneLeg: engineLaneLegOf(internals), parkLaneHeld: internals?.parkLaneHeld === true, hostDeclaredNotResumable: doors.hostApprovalParksNotResumable });
85
88
  const notResumableSays = notResumableSaysOf(approvalParkNotResumable, doors.hostApprovalParksNotResumable);
86
89
  const overlay = enterConfigDoor("deps", () => contextOverlayFor(deps.contextSettings, doors.resolvedRole.modelRef, deps));
@@ -8,7 +8,7 @@
8
8
  import { type AssistantMessage, type ModelOutputInvalid } from "../../internal/llm.js";
9
9
  import type { LoopTerminalReason } from "../../internal/harness-types.js";
10
10
  import { type RequestRoute } from "../../brain/request-route.js";
11
- import type { TerminalCause } from "../types.js";
11
+ import type { TaskResult, TerminalCause } from "../types.js";
12
12
  import { type TerminalFailureDetail } from "../terminal-cause.js";
13
13
  type ProviderRejected = Extract<TerminalFailureDetail, {
14
14
  kind: "provider_rejected";
@@ -56,6 +56,11 @@ export declare function thrownFailureOf(err: unknown, text: string): {
56
56
  message: string;
57
57
  detail?: TerminalFailureDetail;
58
58
  };
59
+ /** A `failed` TaskResult for a throw that occurred before a Runner leg could start (e.g. the one-shot `runTask(spec, deps)`
60
+ * when `new Runner(deps)` refuses deployment deps): carries the same coded terminal account (`thrownFailureOf`),
61
+ * intake (`{ committed: false }`), unsettled continuation, and zero/usageMissing stats as the stream settle backstop,
62
+ * without invoking any throwing getter on `spec`. */
63
+ export declare function failedPreRunResult(err: unknown, spec: unknown): TaskResult;
59
64
  /** The completion's one account, read off the final message: it ended on a provider word the brain does not read (the
60
65
  * turn was kept and the run announced the word — stated in the echo shape the brain carried it in), or its answer stopped
61
66
  * arriving before the provider ended it and what arrived was kept. A cut stream has no ending word, so the two never meet. */
@@ -4,7 +4,7 @@ import { admittedProviderMessage } from "../../brain/provider-message.js";
4
4
  import { isProviderCondition, isProviderConditionSource } from "../../brain/provider-dialect.js";
5
5
  import { admittedRequestRoute } from "../../brain/request-route.js";
6
6
  import { REFUSED_REQUEST_PARTS } from "../terminal-cause.js";
7
- import { readMember } from "../thrown-value.js";
7
+ import { readMember, thrownText } from "../thrown-value.js";
8
8
  import { egressText } from "../untrusted-egress.js";
9
9
  import { isSensitiveName, looksLikeCredentialValue } from "../secret-env.js";
10
10
  import { isSensitiveRecordKey, REDACTION_MARKS } from "@sema-agent/primitives";
@@ -251,6 +251,21 @@ export function thrownFailureOf(err, text) {
251
251
  const detail = codedFailureDetailOf(coded.code, coded.link);
252
252
  return { code: coded.code, message, ...(detail !== undefined ? { detail } : {}) };
253
253
  }
254
+ export function failedPreRunResult(err, spec) {
255
+ const { code, message, detail } = thrownFailureOf(err, thrownText(err));
256
+ const specTaskId = readMember(spec, "taskId");
257
+ const specSessionId = readMember(spec, "sessionId");
258
+ return {
259
+ taskId: typeof specTaskId === "string" && specTaskId.length > 0 ? specTaskId : "unknown",
260
+ sessionId: typeof specSessionId === "string" && specSessionId.length > 0 ? specSessionId : "unknown",
261
+ terminal: { kind: "failed", ...(code !== undefined ? { code } : {}), message, ...(detail !== undefined ? { detail } : {}) },
262
+ result: "",
263
+ resultEntryIds: [],
264
+ intake: { committed: false },
265
+ continuesFrom: { none: "unsettled" },
266
+ stats: { turns: 0, tokens: 0, toolCalls: 0, cachedTokens: 0, costMicroUsd: 0, usageMissing: true },
267
+ };
268
+ }
254
269
  export function completedTerminalOf(final) {
255
270
  const finishReasonUnknown = readMember(final, "finishReasonUnknown");
256
271
  if (typeof finishReasonUnknown === "string" && isProviderEchoShape(finishReasonUnknown))
@@ -99,7 +99,7 @@ export interface OccurrenceEnd {
99
99
  /** See {@link toolEndBodyFrom}'s parameter of the same name. */
100
100
  heldPark?: import("../agent-state.js").AgentPark;
101
101
  }
102
- /** What the end projection decided, for the readers that ride beside the frame (the trace row, the row's record, the rows' `notExecuted`). */
102
+ /** What the end projection decided, for the readers that ride beside the frame (the trace row, the row's record, the rows' `notExecuted` and `gate`). */
103
103
  export interface SettledOccurrence extends Pick<OccurrenceEnd, "notExecuted"> {
104
104
  /** The latest gate record — the call's disposition (absent when no gate exit saw it). */
105
105
  gate?: GateOutcome;
@@ -1,4 +1,21 @@
1
+ /**
2
+ * `notExecuted` and `gate` — what the engine writes onto a persisted `toolResult` row for a call it has positive evidence never ran, in ONE place.
3
+ *
4
+ * The fact has one reading ({@link refusedBeforeRelease}, over the call's occurrence) and one return (`emitSettled`'s, beside the
5
+ * `tool_end` frame); every face that repeats it reads that return: the frame, the resumed leg's `toolResult` rows
6
+ * ({@link withRowNotExecuted}) and the live leg's ({@link stampRowNotExecuted}). `details.notExecuted` and `details.gate` on a
7
+ * persisted row are the ENGINE's keys: set from the settlement (`gate` as a structural copy of the end frame's verdict when
8
+ * `notExecuted` holds and the frame carried one) and dropped from whatever a tool wrote under either name ({@link rowDetailsOf}).
9
+ *
10
+ * A leaf: it reads the occurrence's type, the gate-outcome type and the guarded member readers, and writes nothing but the one result it is handed.
11
+ */
12
+ import type { GateOutcome } from "../gate-outcome.js";
1
13
  import type { ToolOccurrence } from "./tool-occurrence.js";
14
+ /** The end projection's row-facing settlement facts (`SettledOccurrence`'s `notExecuted` and `gate`). */
15
+ export interface RowEndFacts {
16
+ readonly notExecuted?: true;
17
+ readonly gate?: GateOutcome;
18
+ }
2
19
  /** The engine's own judgment refused this call and it was never let go to an executor: the latest gate record is a
3
20
  * refusal and the life never left `announced` — positive evidence the call did not run (a refusal recorded AFTER the
4
21
  * release, by a station inside the execution, is not). A call whose start this stream never carried (a recovered
@@ -7,14 +24,16 @@ export declare function refusedBeforeRelease(occ: Pick<ToolOccurrence, "life" |
7
24
  /** The one reading of the engine's positive evidence that a call never ran: refused before it was let go
8
25
  * ({@link refusedBeforeRelease}), or answered in place of its body by an extension at `tool.call` (the body was never called). */
9
26
  export declare function neverExecuted(occ: Pick<ToolOccurrence, "life" | "gateRounds" | "startEmitted" | "answeredInPlaceBy">): boolean;
10
- /** `details` as a persisted `toolResult` row carries it: `notExecuted` is the ENGINE's key — the settlement's fact when it holds,
11
- * absent otherwise, whatever a tool wrote under that name. Returns `details` itself unless the key has to move; never mutates it. */
12
- export declare function rowDetailsOf(details: unknown, notExecuted: boolean): unknown;
27
+ /** `details` as a persisted `toolResult` row carries it: `notExecuted` and `gate` are the ENGINE's keys —
28
+ * `notExecuted: true` when the settlement's fact holds, `gate` a structural copy of the end frame's verdict
29
+ * when both `notExecuted` and `gate` hold, and both absent otherwise, whatever a tool wrote under either name.
30
+ * Returns `details` itself unless a key has to move; never mutates it. */
31
+ export declare function rowDetailsOf(details: unknown, settled: RowEndFacts | undefined): unknown;
13
32
  /** The persisted row's mark: the call this `toolResult` row closes never ran (the key {@link rowDetailsOf} writes). */
14
33
  export declare function rowNotExecuted(details: unknown): boolean;
15
- /** A row the resumed leg mints (`toolResultMsg`) with the settlement's fact on it. */
16
- export declare function withRowNotExecuted<T extends object>(row: T, notExecuted: boolean): T;
17
- /** Write the end projection's one `notExecuted` onto the result the live loop persists as the call's row: the loop builds that message
34
+ /** A row the resumed leg mints (`toolResultMsg`) with the settlement's facts (`notExecuted`, `gate`) on it. */
35
+ export declare function withRowNotExecuted<T extends object>(row: T, settled: RowEndFacts | undefined): T;
36
+ /** Write the end projection's `notExecuted` and `gate` onto the result the live loop persists as the call's row: the loop builds that message
18
37
  * from this very result right after the end event. The frame's card was projected from the previous `details` first and keeps its
19
- * members (a row mark is never part of a card). `Reflect.set`: a result that refuses the write keeps its row as it was. */
20
- export declare function stampRowNotExecuted(result: unknown, notExecuted: boolean): void;
38
+ * members (row marks are never part of a card). `Reflect.set`: a result that refuses the write keeps its row as it was. */
39
+ export declare function stampRowNotExecuted(result: unknown, settled: RowEndFacts | undefined): void;
@@ -5,13 +5,20 @@ export function refusedBeforeRelease(occ) {
5
5
  export function neverExecuted(occ) {
6
6
  return refusedBeforeRelease(occ) || occ.answeredInPlaceBy !== undefined;
7
7
  }
8
- export function rowDetailsOf(details, notExecuted) {
9
- const carries = (() => { try {
10
- return details !== null && typeof details === "object" && !Array.isArray(details) && Object.keys(details).includes("notExecuted");
11
- }
12
- catch {
13
- return false;
14
- } })();
8
+ export function rowDetailsOf(details, settled) {
9
+ const notExecuted = settled?.notExecuted === true;
10
+ const gate = notExecuted ? settled.gate : undefined;
11
+ const carries = (() => {
12
+ try {
13
+ if (details === null || typeof details !== "object" || Array.isArray(details))
14
+ return false;
15
+ const keys = Object.keys(details);
16
+ return keys.includes("notExecuted") || keys.includes("gate");
17
+ }
18
+ catch {
19
+ return false;
20
+ }
21
+ })();
15
22
  if (!notExecuted && !carries)
16
23
  return details;
17
24
  const bag = { ...readOwnMembers(details) };
@@ -19,6 +26,10 @@ export function rowDetailsOf(details, notExecuted) {
19
26
  bag["notExecuted"] = true;
20
27
  else
21
28
  delete bag["notExecuted"];
29
+ if (gate !== undefined)
30
+ bag["gate"] = structuredClone(gate);
31
+ else
32
+ delete bag["gate"];
22
33
  return bag;
23
34
  }
24
35
  export function rowNotExecuted(details) {
@@ -29,13 +40,13 @@ export function rowNotExecuted(details) {
29
40
  return false;
30
41
  }
31
42
  }
32
- export function withRowNotExecuted(row, notExecuted) {
33
- return notExecuted ? { ...row, details: rowDetailsOf(undefined, true) } : row;
43
+ export function withRowNotExecuted(row, settled) {
44
+ return settled?.notExecuted === true ? { ...row, details: rowDetailsOf(undefined, settled) } : row;
34
45
  }
35
- export function stampRowNotExecuted(result, notExecuted) {
46
+ export function stampRowNotExecuted(result, settled) {
36
47
  if (result === null || typeof result !== "object")
37
48
  return;
38
- const next = rowDetailsOf(result.details, notExecuted);
49
+ const next = rowDetailsOf(result.details, settled);
39
50
  if (next !== result.details)
40
51
  Reflect.set(result, "details", next);
41
52
  }
@@ -3,7 +3,8 @@
3
3
  * (`EffectivePermissionRules.unreadableRows`), as the run's readers judge them. A row whose identity read stands in the read's rules as
4
4
  * written (`as_read`): these readers pass it by. A row whose identity did not read stands at its strictest reading over the calls it may
5
5
  * reach — the partition's own failure law, scoped to the row (a call it reaches in its scope takes the answer a call takes while a
6
- * partition cannot be read; a row reaching every call makes every path check that is no call refuse).
6
+ * partition cannot be read; a row reaching every call in its scope makes every path check that is no call refuse — the scope first, by
7
+ * {@link unreadableRowsInScope}, for every reader).
7
8
  */
8
9
  import type { EffectivePermissionRules } from "../permission-rule-provider.js";
9
10
  import { type ScopeRootIdentity } from "../permission-rule-model.js";
@@ -54,7 +54,7 @@ export declare function legWriteProtectionTable(deps: Pick<RunnerDeps, "writePro
54
54
  export declare function mountWriteProtection(input: {
55
55
  /** borrowed-readonly — the deployment seats: the table (`writeProtectedPaths`; absent ⇒ the default
56
56
  * table, `[]` ⇒ opted out) and the operator sink. */
57
- deps: Pick<RunnerDeps, "writeProtectedPaths" | "onNotice">;
57
+ deps: Pick<RunnerDeps, "writeProtectedPaths" | "onNotice" | "deploymentShape">;
58
58
  /** borrowed-readonly — the leg's configuration roots (`leg-caller-places.ts`, the leg's one mint: the deployment's root, the
59
59
  * task's, a resumed row's) — the `.sema` rows are also placed below each. */
60
60
  configRoots: readonly string[];
@@ -26,7 +26,7 @@ export function mountWriteProtection(input) {
26
26
  message: `This run's write-protection judge did not get an answer from its execution environment for one lookup of a write's judgment ` +
27
27
  `(${reason === ABSENCE_REASON.symlink ? "a symlink whose real target is unknowable" : "the environment refused, errored or did not answer in time"}: ${absence.cause}). ` +
28
28
  `A write whose target's real destination (or link chain) could not be determined is refused where the table has rows — the ` +
29
- `table cannot say it is not a protected path; a root whose key did not come back exempts and places nothing; guarded write rows ` +
29
+ `table cannot say it is not a protected path${input.deps.deploymentShape !== undefined ? " (a shell command's such write is a question instead, which bypassPermissions releases on this Runner, whose deployment declares its shape, where no deny row guards writes)" : ""}; a root whose key did not come back exempts and places nothing; guarded write rows ` +
30
30
  `a deployment's policy did not return are held, so the writes they could guard are not placed. Every row a source that did ` +
31
31
  `answer met stays met. An environment that cannot answer path questions is a deployment fact: fix the environment (or the ` +
32
32
  `link) and the same writes are judged again. Announced once per leg per reason; later writes of the same shape are judged ` +
@@ -68,6 +68,9 @@ export interface RunnerDeps {
68
68
  /** The deployment's Brain; every engine read of it goes through the model lane (`brain/model-lane.ts`), which walks a catalog
69
69
  * entry's `Model.fallbacks` chain on this same Brain and passes any other request straight through. */
70
70
  brain: Brain;
71
+ /** Deployment-declared host process identity (`{ instanceId, startedAt }`, epoch ms), projected frozen onto `WiringManifest.host`
72
+ * on both static and effective halves iff declared; refused (`config.invalid_argument`) when malformed; out of `configFingerprint` and `swapDeps`. */
73
+ host?: import("./host-instance.js").HostInstanceDeclaration;
71
74
  /** Catalog used to resolve string ModelRefs to Model objects; its door (`new Runner` / `swapDeps`) also resolves each entry's
72
75
  * `fallbacks` words over it (`config.model_fallback_invalid` on a bad chain). */
73
76
  models?: Record<string, Model>;
@@ -154,13 +157,13 @@ export interface RunnerDeps {
154
157
  */
155
158
  hands?: HandsBandOptions;
156
159
  /**
157
- * design/199 件B — DEPLOYMENT-layer ADDITIONS to the built-in sensitive-path READ deny set
160
+ * design/199 件B / #4800 — DEPLOYMENT-layer ADDITIONS to the sensitive-path deny set
158
161
  * ({@link import("../tools/fs/read-deny.js").READ_FACE_DEFAULT_DENY_ENTRIES}); see
159
- * {@link TaskSpec.readDenyPatterns} for the judged surfaces. INDEPENDENT of the built-in switch. Add-only on
160
- * THIS seat: unions with the active built-ins and any task-layer additions, and `[]` ≡ absent — narrowing the built-in
161
- * set is the sibling knobs' job ({@link readDenyBuiltinTiers} / {@link readDenyBuiltinExclude},
162
- * #245 revision of D-4), not a replacement escape hatch here. Bad entry shapes refuse loudly at
163
- * prepare (#123).
162
+ * {@link TaskSpec.readDenyPatterns} for the judged surfaces and the shell's reach: reads and writes both, while
163
+ * built-in tiers stay read-only and pair with the write-protection table. Add-only on THIS seat: unions with the
164
+ * active built-ins and any task-layer additions, and `[]` ≡ absent — narrowing the built-in set is the sibling
165
+ * knobs' job ({@link readDenyBuiltinTiers} / {@link readDenyBuiltinExclude}, #245 revision of D-4), not a
166
+ * replacement escape hatch here. Bad entry shapes refuse loudly at prepare (#123).
164
167
  */
165
168
  readDenyPatterns?: readonly import("../tools/fs/read-deny.js").ReadDenyEntry[];
166
169
  /**
@@ -316,6 +319,9 @@ export interface RunnerDeps {
316
319
  /** The deployment's cross-boundary posture, one of {@link import("./cross-boundary-taint.js").CROSS_BOUNDARY_POSTURES} (who is hurt when a tree that
317
320
  * executes on a target device reaches past it). Absent reads `"single_user"`; any other value refuses the prepare, and a resume before its claim (`config.cross_boundary_posture`). */
318
321
  crossBoundaryPosture?: "single_user" | "multi_tenant";
322
+ /** The deployment's declared shape ({@link import("./deployment-shape.js")} says what it vouches for and costs): ONLY a deployment with one owner declares it, and never a Runner that mixes in a tree another principal governs or members acting for another
323
+ * principal. Under `bypassPermissions` an unfinished read check is then released where what it did not see guards nothing (`confined: true`). Absent ⇒ nothing changes; a word outside the set, or the seat beside `crossBoundaryPosture: "multi_tenant"`, refuses `new Runner` (`config.deployment_shape`). */
324
+ deploymentShape?: import("./deployment-shape.js").DeploymentShape;
319
325
  /**
320
326
  * design/383 §2.1b — an optional host-supplied carrier for the session capture opt-out record
321
327
  * (per memory plane, keyed by that plane's control dir). Absent = the `capture` objects of the engine's governance store (#3484: the File store over the plane's control dir, or the store the backend carries)
@@ -1274,6 +1280,7 @@ export interface RunnerDeps {
1274
1280
  */
1275
1281
  onError?: (err: unknown, context: {
1276
1282
  phase: "compaction" | "prompt-constitution" | "degraded" | "config" | "memory" | "mcp" | "a2a" | "interrupt-reconcile" | "suggestions" | "rewind" | "hook";
1283
+ /** The session the line is about; `""` when it belongs to none (a `CenterPromptSource` boot restore) — the absence of a session, as `sessionId: ""` reads everywhere. */
1277
1284
  sessionId: string;
1278
1285
  /**
1279
1286
  * Machine-readable sub-classification when the site has one (a kebab-case word naming the arm) —
@@ -1329,10 +1336,10 @@ export interface RunnerDeps {
1329
1336
  * deployment wires the factory.
1330
1337
  */
1331
1338
  executionEnvFactory?: import("./remote-env.js").ExecutionEnvFactory;
1332
- /** Whether `executionEnvFactory` answers purpose `"read_changes"` (attaches or throws `env.purpose_unsupported`; mints and
1333
- * writes nothing). Absent / `false` ⇒ never asked for it, and no static `executionEnv` stands in: reading what a session
1334
- * changed has no hands for the working tree. A Runner with no factory ignores the value (a deployment spreads one set of keys
1335
- * into every Runner, some with only a static env); a non-boolean is refused at construction (`config.invalid_argument`). */
1339
+ /** Whether `executionEnvFactory` answers purpose `"read_changes"` (read-only readings outside a run — `Runner.readSessionChanges`,
1340
+ * `Runner.previewInstructions`: attaches or throws `env.purpose_unsupported`; mints and writes nothing). Absent / `false` ⇒ never
1341
+ * asked for it, and no static `executionEnv` stands in: those out-of-run reads have no hands for the working tree. A Runner with no
1342
+ * factory ignores the value; a non-boolean is refused at construction (`config.invalid_argument`). */
1336
1343
  executionEnvFactoryHonorsReadChanges?: boolean;
1337
1344
  /**
1338
1345
  * Containment root for the file tools (design/44 §4 invariant 7): every path must resolve within it, else the tool rejects