@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
@@ -5,6 +5,7 @@ import { receiptRefusal, receiveOwnProperties, refuseProxy } from "../own-proper
5
5
  import { assertNoRetiredRunnerDeps } from "./retired-runner-deps.js";
6
6
  import { copyReadDenySeat, READ_DENY_DEPLOYMENT_SEATS } from "../read-face-seats.js";
7
7
  import { receiveHostFloor } from "../host-floor.js";
8
+ import { receiveHostInstance } from "../host-instance.js";
8
9
  import { holdOwnCredentialValues } from "../secret-env.js";
9
10
  import { receivePeerSeat } from "../peer-seat.js";
10
11
  import { receiveProtocolRevocations } from "../protocol-revocation.js";
@@ -12,6 +13,8 @@ import { receiveModelFallbackPolicy } from "../model-fallbacks.js";
12
13
  import { receiveCacheRetention } from "./model-lane-seat.js";
13
14
  import { assertJournalStoreGivesClaimsBack } from "../workflow-journal-store.js";
14
15
  import { screenPermissionModeWhenUnset } from "../mode-policy.js";
16
+ import { receiveAutoModeFace } from "../auto-mode.js";
17
+ import { screenDeploymentShape } from "../deployment-shape.js";
15
18
  export function retainRunnerDeps(deps) {
16
19
  const words = { subject: "RunnerDeps", unit: "seat", moment: "at new Runner" };
17
20
  refuseProxy(deps, words);
@@ -26,6 +29,8 @@ export function retainRunnerDeps(deps) {
26
29
  }
27
30
  if (Object.hasOwn(retained, "hostFloor"))
28
31
  Object.defineProperty(retained, "hostFloor", { value: receiveHostFloor(Reflect.get(retained, "hostFloor")), enumerable: true, writable: true, configurable: true });
32
+ if (Object.hasOwn(retained, "host"))
33
+ Object.defineProperty(retained, "host", { value: receiveHostInstance(Reflect.get(retained, "host"), "RunnerDeps.host"), enumerable: true, writable: true, configurable: true });
29
34
  if (Object.hasOwn(retained, "peerSeat"))
30
35
  Object.defineProperty(retained, "peerSeat", { value: receivePeerSeat(Reflect.get(retained, "peerSeat"), "RunnerDeps.peerSeat"), enumerable: true, writable: true, configurable: true });
31
36
  if (Object.hasOwn(retained, "protocolRevocations"))
@@ -34,6 +39,9 @@ export function retainRunnerDeps(deps) {
34
39
  Object.defineProperty(retained, "modelFallback", { value: receiveModelFallbackPolicy(Reflect.get(retained, "modelFallback"), "RunnerDeps.modelFallback"), enumerable: true, writable: true, configurable: true });
35
40
  receiveCacheRetention(retained.cacheRetention, "RunnerDeps.cacheRetention");
36
41
  screenPermissionModeWhenUnset(retained.permissionModeWhenUnset);
42
+ screenDeploymentShape(retained.deploymentShape, retained.crossBoundaryPosture);
43
+ if (Object.hasOwn(retained, "autoMode"))
44
+ Object.defineProperty(retained, "autoMode", { value: receiveAutoModeFace(Reflect.get(retained, "autoMode"), "RunnerDeps.autoMode"), enumerable: true, writable: true, configurable: true });
37
45
  const honorsReadChanges = retained.executionEnvFactoryHonorsReadChanges;
38
46
  if (honorsReadChanges !== undefined && typeof honorsReadChanges !== "boolean") {
39
47
  const e = new Error(`RunnerDeps.executionEnvFactoryHonorsReadChanges must be a boolean when given, got ${typeof honorsReadChanges} — refused at new Runner rather than read as false`);
@@ -28,6 +28,12 @@ export interface WriteFaceSeat {
28
28
  readonly inForce: () => ContainmentFace;
29
29
  readonly fenced: boolean;
30
30
  }
31
+ /** The two faces the children of a leg that narrowed only its own hands (`TaskSpec.ownHandsReadOnly`) are handed — resolved
32
+ * without that narrowing (`prepare-hands-readface.ts` `carriedFacesOf`). */
33
+ export interface CarriedFaces {
34
+ readonly read: ContainmentFace;
35
+ readonly write: WriteFaceSeat;
36
+ }
31
37
  import type { MaterializedA2a } from "../a2a.js";
32
38
  import type { CompactionForkContext, RapidRefillState } from "../auto-compaction.js";
33
39
  import type { AutoModeArmingRecipe } from "../auto-mode-arming.js";
@@ -373,6 +379,8 @@ export interface Prepared {
373
379
  * prepare emits run-scoped disclosures of its own and each must have a terminal that names it.
374
380
  */
375
381
  runId: string;
382
+ /** Wall-clock epoch ms minted once beside {@link runId} at prepare entry; every leg-start reader (`manifest.leg.instance.startedAt`, `task_started.startedAt`, `task.start.ts`) reads this value. */
383
+ legStartedAt: number;
376
384
  /** The deployment's host floor as the config doors compiled it (absent ⇒ none declared) — the task images' guard reads it. */
377
385
  hostFloor?: import("../host-floor.js").HostFloor;
378
386
  /** The (owner, scope) key this run's registry-facing tools register rows under — ({@link taskId}, mount domain), minted once at prepare; the teardown sweeps read it and never re-derive it. */
@@ -380,6 +388,9 @@ export interface Prepared {
380
388
  readonly owner: string;
381
389
  readonly scope: string;
382
390
  };
391
+ /** The run's member ledger book (`TaskSpec.runLedger`), present only on a run that declares one: the report tool delivers
392
+ * through it, and the settle reads the final ledger off it onto the result. */
393
+ runLedgerBook?: import("../run-ledger.js").RunLedgerBook;
383
394
  /** The session's reminder provenance mark this run mints under (adopted
384
395
  * through the prepare adoption ladder: checkpoint seed → trusted fork channel → session entry →
385
396
  * fresh mint). Every engine-authored `<system-reminder>` open tag in the run carries it, and the
@@ -1546,7 +1557,7 @@ export interface PreparedMicroCompact {
1546
1557
  };
1547
1558
  /** The run's ONE offload persist (write-once, idempotent): the frontier pass, the blocking-point arm and the MC-R arm all clear
1548
1559
  * through it, so they compose identical markers. Absent when no offload store is configured. */
1549
- offloadPersist?: (toolCallId: string, fullText: string) => string;
1560
+ offloadPersist?: import("../tool-result-store.js").OffloadPersist;
1550
1561
  }
1551
1562
  /**
1552
1563
  * Resume inputs threaded into {@link prepareTask} to continue a suspended task. The Runner
@@ -1931,6 +1942,9 @@ export interface RunInternals {
1931
1942
  * a root run it starts (`runTask(spec, { toolCeiling })`): the task-start doors judge it as a host-written workflow ceiling is judged (another spelling of a tool the run carries refuses: `config.tool_face_control`, `near_miss`); its rows record it. Trusted, never a TaskSpec field.
1932
1943
  */
1933
1944
  toolCeiling?: readonly import("../tool-face.js").ToolSelectorLayer[];
1945
+ /** The run's member ledger book (`TaskSpec.runLedger`) — always the run's own lane's (its notification lane mints it and hears the
1946
+ * run's frames into it); undefined on a run without a ledger. Trusted, never a TaskSpec field, never handed to a child. */
1947
+ runLedgerBook?: import("../run-ledger.js").RunLedgerBook | undefined;
1934
1948
  /** Set by the delegation lane when the spawning run's prepare judged this leg's own tool lists (its spec's `allowTools` /
1935
1949
  * `excludeTools` — a definition's or the delegation tool's) against a pool it could list: their digest (`toolListsDigest`), the
1936
1950
  * evidence bound to exactly those lists. A prepare whose own lists digest to it does not judge them again, and its rows record it
@@ -2168,8 +2182,9 @@ export interface RunInternals {
2168
2182
  * mirroring `insideFork`.
2169
2183
  */
2170
2184
  isDelegatedChild?: boolean;
2171
- /** Default project verdict id inherited from the parent leg (used only when child declares none and has no marker; trusted internals). */
2172
- parentProjectId?: string;
2185
+ /** The project seat its spawner (or waker) hands the leg, a DEFAULT: its id only when the leg declares none and has no marker, its texts only
2186
+ * when the leg's verdict is its id (`resolveSessionProject`); screened and copied at the call's internals door (a refused one ends the leg). Trusted internals. */
2187
+ parentProject?: import("../project-seat.js").ProjectSeat;
2173
2188
  /** Who wrote this leg's objective ({@link import("../input-author.js").InputAuthor}), stated by the seat that mints it; absent = the public
2174
2189
  * entry's caller, `operator`. Only the operator's objective passes `classic.UserPromptSubmit`; a non-member reads `unknown`, is screened and
2175
2190
  * reported once (`onError`, `"config"`). Never inherited — each seat says its own. TRUSTED run-scoped channel (NOT a {@link TaskSpec} field). */
@@ -3415,8 +3430,9 @@ export interface RunnerSelfSeat {
3415
3430
  emitTaskOutcome(outcome: TaskOutcome): void;
3416
3431
  /** Announce a fact of a composition's own (the verification gate's `verify.verifier_is_implementer`) on `RunnerDeps.onNotice`, live-read,
3417
3432
  * through the one delivery form every notice leaves by (`deliverEngineNotice`: the same-principal text pass, the session lift, a
3418
- * throwing sink contained). Absent on a hand-built seat ⇒ the composition cannot say it, and says nothing; the Runner always has it. */
3419
- emitNotice?(notice: import("../engine-notice.js").EngineNotice): void;
3433
+ * throwing sink contained). Absent on a hand-built seat ⇒ the composition cannot say it, and says nothing; the Runner always has it. With
3434
+ * a leg's `route` (`noticeAddressOf`) the Runner delivers under that route's admission (`legNoticeAdmission`, its own destination judge). */
3435
+ emitNotice?(notice: import("../engine-notice.js").EngineNotice, route?: import("../leg-identity.js").NoticeRoute): void;
3420
3436
  /** A hold, on the peer seat THIS runner's legs ask, of the references `declared` names — taken by a keeper of declarations outside a
3421
3437
  * leg (which they are: peer-seat.ts's module note), released by it once (peer-seat.ts `holdPeerDeclarations`). */
3422
3438
  holdDeclarations(declared: import("../peer-seat.js").PeerDeclarations): import("../peer-seat.js").PeerDeclarationHold;
@@ -22,7 +22,7 @@
22
22
  */
23
23
  import type { AgentTool } from "../../internal/harness.js";
24
24
  import type { ExecutionEnv, SessionTreeEntry } from "../../internal/harness-types.js";
25
- import { type CrossBoundaryCheck, type CrossBoundaryPosture, type CrossBoundaryTreeToken, type OwedDeliveries } from "../cross-boundary-taint.js";
25
+ import { type BoundaryLeg, type CrossBoundaryCall, type CrossBoundaryCheck, type CrossBoundaryPosture, type CrossBoundaryTreeToken, type OwedDeliveries } from "../cross-boundary-taint.js";
26
26
  import type { NoticeRoute } from "../leg-identity.js";
27
27
  import { type ToolRoster } from "../tool-roster.js";
28
28
  import type { RunnerDeps } from "../types.js";
@@ -58,6 +58,10 @@ export interface CrossBoundaryLane {
58
58
  /** How many times this leg's record writes have waited on the session store — a station that judged before an exit reads again
59
59
  * when the count moved across it (the exit's own form: judged again after a wait). */
60
60
  storeWaits(): number;
61
+ /** The legs one call declares it travels, on its arguments, read off the live roster as the station reads them ({@link legsOfCall}:
62
+ * a call no row answers, or a `"per_call"` resolver that is missing, throws or answers outside its type, reads as every leg — the
63
+ * fault reported). Engaged or not: a confined Runner's mode point reads it for the one call it may release. */
64
+ legsOf(view: CrossBoundaryLegView, call: CrossBoundaryCall): readonly BoundaryLeg[];
61
65
  }
62
66
  /** What the seat reads per call: the live roster (the legs a row declares) and the mounted instances (a `"per_call"` row's resolver,
63
67
  * read off the later mount under the row's name — the instance the row was minted from, but in a redial window: KL-2284-c). */
@@ -90,5 +94,8 @@ export interface CrossBoundaryLaneInput {
90
94
  noticeRoute: NoticeRoute;
91
95
  deps: Pick<RunnerDeps, "onError" | "onNotice" | "tracer">;
92
96
  }
97
+ /** A confined Runner's destination reading for one call: it lands on the leg's hands (`onHands` — the sandbox boundary's own judgment:
98
+ * a hand of the environment with no egress mark) and every boundary leg it declares ({@link CrossBoundaryLane.legsOf}) is the environment's. */
99
+ export declare function destinationOnHands(onHands: boolean, legs: readonly BoundaryLeg[]): boolean;
93
100
  /** The leg's lane: the tree ref joined with what this leg knows, the session's record read and (when the state grew) written. */
94
101
  export declare function prepareCrossBoundaryLane(input: CrossBoundaryLaneInput): Promise<CrossBoundaryLane>;
@@ -62,6 +62,9 @@ function legsOfCall(view, legEnv, token, call, report) {
62
62
  return strictest("answered outside its type ({ legs: a list of boundary legs, env?: an environment })");
63
63
  return { legs: legs, env: env ?? legEnv };
64
64
  }
65
+ export function destinationOnHands(onHands, legs) {
66
+ return onHands && legs.every((leg) => leg === "env");
67
+ }
65
68
  export async function prepareCrossBoundaryLane(input) {
66
69
  const { posture, externalContentTargetActive, env, session, resumeLeg, sessionId, runId, hostTaskId, noticeRoute, deps } = input;
67
70
  const report = (message) => {
@@ -235,6 +238,7 @@ export async function prepareCrossBoundaryLane(input) {
235
238
  },
236
239
  owe: (atLeaf, owed) => write("suspend", atLeaf, () => owedBit(owed)),
237
240
  storeWaits: () => storeWaits,
241
+ legsOf: (view, call) => legsOfCall(view, env, token, call, report).legs,
238
242
  recorded: () => ref.current.targetExecutionArmed === true,
239
243
  settle: (owed, boundMs) => raceTeardownLegOr(() => write("settle", undefined, () => owedBit(owed)).then(() => undefined), "crossBoundary.settle (settle leg)", (timeout) => unwritten("settle", ref.current, timeout), boundMs),
240
244
  };
@@ -136,6 +136,10 @@ export interface JudgedRow {
136
136
  readonly occupant?: () => Promise<string | undefined>;
137
137
  readonly minted?: boolean;
138
138
  readonly runsOn?: true;
139
+ /** `false`: the claimant's judgement taken without its write — a preview of the leg that would run on the row. Everything the claim
140
+ * needs is judged (a store with no conditional owner write refuses as it refuses the leg); a row that records no owner answers open
141
+ * and unclaimed, and nothing is recorded on it. */
142
+ readonly writes?: false;
139
143
  }
140
144
  /** The one refusal of a claim on a store that has no conditional owner write ({@link SessionStore.recordOwner}) — the whole of what a tree
141
145
  * with an owner meets on a row that records none there; one sentence, one place. */
@@ -188,6 +192,10 @@ export declare function readJudgedRow<T>(sessions: Pick<SessionStore, "headOf" |
188
192
  open: true;
189
193
  }>;
190
194
  }>;
195
+ /** The refusal of a read whose row is not the one judged ({@link readStandsAsJudged}). */
196
+ export declare function rowNotTheOneJudged(): Extract<RowAdmission, {
197
+ kind: "not_ours";
198
+ }>;
191
199
  /** {@link judgeRowForTree} for an entry that reads its CALLER's seat off the tool call (SendMessage, AgentTranscript, an extension's
192
200
  * transcript read): the seat's reading, bounded and ended by the call's stop. A caller that holds no seat — a tool driven with no run around
193
201
  * it, an operator's continuation — is an anonymous tree's ({@link delegationOwnerOf}): it opens only rows that record no owner. What a
@@ -295,6 +303,28 @@ export declare function judgeLegRow(sessions: Pick<SessionStore, "headOf" | "rec
295
303
  }>;
296
304
  };
297
305
  }, leg: JudgedLeg, report?: (err: Error, sessionId: string) => void): Promise<void>;
306
+ /** A leg's refusal of a row its judgement did not open: the store fault's own code ({@link RowStoreFaultCode}) for a store that could not
307
+ * judge it, `delegation.owner_mismatch` for a row that is not the tree's (the row named, no owner). Thrown by the leg's prepare
308
+ * ({@link judgeLegRow}) and answered by a preview of that leg alike. */
309
+ export declare function legRowRefusal(sessionId: string, verdict: Exclude<RowAdmission, {
310
+ open: true;
311
+ }>): Error & {
312
+ code: string;
313
+ };
314
+ /** What a leg's row is judged by ({@link JudgedLeg}), read off its spec, its internals and its tree's owner (`undefined` = the leg holds
315
+ * no seat: nothing is judged). The one reading of a leg's prepare and of a preview of that leg. */
316
+ export declare function judgedLegOf(spec: {
317
+ readonly sessionId?: string;
318
+ readonly requireExistingSession?: boolean;
319
+ readonly signal?: AbortSignal;
320
+ }, internals: {
321
+ readonly sessionIdMintedBySpawner?: boolean;
322
+ } | undefined, treeOwner: {
323
+ readonly owner: string | null;
324
+ } | undefined): JudgedLeg | undefined;
325
+ /** Whether a read of a row stands for the head a judgement read (`judged`; `null` = judged not there): the head after the read records
326
+ * the same owner on the same occupant. A row judged not there stands for no read. */
327
+ export declare function readStandsAsJudged(judged: SessionHead | null, now: SessionHead | undefined): boolean;
298
328
  /** What a delegated leg's row is judged by in prepare: the tree owner its seat bound (`owner`; `null` = anonymous), whether the engine
299
329
  * minted the id for this leg's create-capable acquire (`minted` — no author named it: the store's mint, or the spawning lane's,
300
330
  * `RunInternals.sessionIdMintedBySpawner`), and the leg's own stop (`signal`, its spec's). */
@@ -135,6 +135,8 @@ export async function judgeRowForTree(sessions, row, tree, signal) {
135
135
  const recordOwner = sessions.recordOwner;
136
136
  if (typeof recordOwner !== "function")
137
137
  return claimUnavailable();
138
+ if (row.writes === false)
139
+ return { open: true, claimed: false, head };
138
140
  let answered;
139
141
  try {
140
142
  answered = await boundedOwnerRead(() => Promise.resolve().then(() => recordOwner.call(sessions, sessionId, owner, { row: { owner: null, ...(head.incarnation !== undefined ? { incarnation: head.incarnation } : {}) } })), signal, "delegation owner claim");
@@ -167,10 +169,13 @@ export async function readJudgedRow(sessions, sessionId, verdict, read, signal)
167
169
  throw runAbortedError();
168
170
  return { refused: storeFault("storage", `the row could not be read back after the read (${ownerReadEnd(err) === "unanswered" ? "the session store did not answer in time" : "the session store's read failed"})`, err) };
169
171
  }
170
- if (judged !== null && now !== undefined && (now.owner ?? null) === (judged.owner ?? null) && sameOccupant(now.incarnation, judged.incarnation))
172
+ if (readStandsAsJudged(judged, now))
171
173
  return { read: value };
172
174
  await forgetHeld(sessions, sessionId);
173
- return { refused: refused("the row is not the one judged — it changed hands, was laid down again, or was not there when it was judged") };
175
+ return { refused: rowNotTheOneJudged() };
176
+ }
177
+ export function rowNotTheOneJudged() {
178
+ return { open: false, kind: "not_ours", why: "the row is not the one judged — it changed hands, was laid down again, or was not there when it was judged" };
174
179
  }
175
180
  export async function judgeRowForSeat(sessions, row, seat, signal) {
176
181
  return judgeRowForTree(sessions, row, await delegationOwnerOf(seat, signal), signal);
@@ -268,9 +273,20 @@ export async function judgeLegRow(sessions, held, leg, report) {
268
273
  if (verdict.open)
269
274
  return;
270
275
  await forgetHeld(sessions, held.sessionId, report);
276
+ throw legRowRefusal(held.sessionId, verdict);
277
+ }
278
+ export function legRowRefusal(sessionId, verdict) {
271
279
  if (verdict.kind === "store")
272
- throw rowStoreFaultError(held.sessionId, verdict);
273
- throw Object.assign(new Error(`the session row ${held.sessionId} does not record this delegation tree's owner: ${verdict.why}`), { code: DELEGATION_OWNER_MISMATCH });
280
+ return rowStoreFaultError(sessionId, verdict);
281
+ return Object.assign(new Error(`the session row ${sessionId} does not record this delegation tree's owner: ${verdict.why}`), { code: DELEGATION_OWNER_MISMATCH });
282
+ }
283
+ export function judgedLegOf(spec, internals, treeOwner) {
284
+ if (treeOwner === undefined)
285
+ return undefined;
286
+ return { owner: treeOwner.owner, minted: spec.requireExistingSession !== true && (spec.sessionId === undefined || internals?.sessionIdMintedBySpawner === true), ...(spec.signal !== undefined ? { signal: spec.signal } : {}) };
287
+ }
288
+ export function readStandsAsJudged(judged, now) {
289
+ return judged !== null && now !== undefined && (now.owner ?? null) === (judged.owner ?? null) && sameOccupant(now.incarnation, judged.incarnation);
274
290
  }
275
291
  function forgetHeld(sessions, sessionId, report) {
276
292
  return settleTeardownLeg(() => Promise.resolve(sessions.forget ? sessions.forget(sessionId) : undefined).catch(() => undefined), "forget (acquire-reconcile owner judgement leg)", report && ((e) => report(e, sessionId)));
@@ -26,12 +26,14 @@ export function createFinishReasonSeat(onNotice, ids) {
26
26
  const dropped = readMember(late, "contentDropped");
27
27
  const valid = (statement === "ending" || statement === "error" || statement === "content") && typeof lateWord === "string" && typeof frames === "number";
28
28
  if (valid && typeof dropped === "string") {
29
+ const ending = statement === "ending" ? lateWord : undefined;
29
30
  if (once(`dropped\u0000${dropped}`)) {
30
31
  deliverEngineNotice(onNotice, {
31
32
  code: "route.stream_content_dropped",
32
- message: `After the provider had already ended a response, its stream sent more of the model's output (first: ${dropped} content; ${frames} frame${frames === 1 ? "" : "s"} after the end in all). ` +
33
+ message: `After the provider had already ended a response, its stream sent more of the model's output (first: ${dropped} content` +
34
+ `${ending !== undefined ? ` alongside the ending "${ending}"` : ""}; ${frames} frame${frames === 1 ? "" : "s"} after the end in all). ` +
33
35
  `The first ending stands and that output was not added to the turn — the answer above may be missing what the model sent after it.`,
34
- detail: { word: dropped, frames, sessionId: ids.sessionId, runId: ids.runId },
36
+ detail: { word: dropped, ...(ending !== undefined ? { ending } : {}), frames, sessionId: ids.sessionId, runId: ids.runId },
35
37
  });
36
38
  }
37
39
  }
@@ -473,6 +473,13 @@ export interface GatePass {
473
473
  * or `declined`, or no answer): no row of the leg's read-deny table was applied to those reads. Writer: the fold's read
474
474
  * station. Reader: the release record ({@link releaseRecordOf}). */
475
475
  shellReadUnestablished?: true;
476
+ /** borrowed-mutable — the read check went silent over an ask a person was already required on (its real-approval bit stood,
477
+ * whoever brought it). Writer: the silence
478
+ * (`silencedBy`). Readers: a confined Runner's mode point and its headless way out (`confinedCallOf`). On no decision. */
479
+ silencePersonRequired?: boolean;
480
+ /** borrowed-mutable — the read station gave this call no answer (its wait elapsed or threw) and the gate put the station's fallback
481
+ * in its place. Writer: the fold's read station. Readers: a confined Runner's mode point and its headless way out (`confinedCallOf`). */
482
+ shellReadFallback?: true;
476
483
  /** borrowed-mutable — what the call's release read of the read-deny table those reads went past: the table, or `"unread"`.
477
484
  * Read once, by the first release record minted for the call; absent until a mode releases it. Writer and reader:
478
485
  * {@link releaseRecordOf}. */
@@ -2,6 +2,7 @@ import { DENIED_BY_MAY_ECHO, modeReleaseOf, readDenyTableOf, screenGateOutcome,
2
2
  import { traceHookCrash } from "../gate-crash-trace.js";
3
3
  import { thrownText } from "../thrown-value.js";
4
4
  import { ASK_CLASSES, askFaceOf, classifyAsk, headlessApprovalRemedy, withParkRemedy, NOBODY_CAN_APPROVE, unresolvedAskDenialMessage } from "../ask-origin.js";
5
+ import { confinedCallOf } from "../shell-read-silence.js";
5
6
  import { NOT_RESUMABLE_CARRY_ON, notResumableWayOut } from "../park-resumability.js";
6
7
  import { wireOf } from "../tool-name-readings.js";
7
8
  import { isProtectedWrite } from "../tool-registry.js";
@@ -394,7 +395,7 @@ export async function exitGate(pass) {
394
395
  const floated = ledger.settled?.origin === "ancestor_marked";
395
396
  const parkCanWait = unavailableLandingOf({ parkRoute: pass.suspendAsk !== undefined, suspendTargetGap: floated ? undefined : pass.suspendTargetGap, attemptFailed: false, question: false, durableQuestionFace: undefined }) === "park";
396
397
  const nobodyMayAnswer = input.askSeatForm !== undefined && input.askSeatForm !== "callback" && !parkCanWait && pass.askClassification?.classes.has("content_question") !== true;
397
- const remedyOf = (approverSeat) => headlessApprovalRemedy({ mode: input.permissionMode?.(), classification: foldCause !== undefined ? ancestorUnresolvedClassification(pass.req) : pass.askClassification, approverSeat, coveredWrite: isProtectedWrite(pass.req), ...(pass.shellUnplacedOptions !== undefined ? { unplacedOptions: pass.shellUnplacedOptions } : {}), ...(wayOut !== undefined ? { notResumableWayOut: wayOut } : {}) });
398
+ const remedyOf = (approverSeat) => headlessApprovalRemedy({ mode: input.permissionMode?.(), classification: foldCause !== undefined ? ancestorUnresolvedClassification(pass.req) : pass.askClassification, approverSeat, coveredWrite: isProtectedWrite(pass.req), ...(pass.shellUnplacedOptions !== undefined ? { unplacedOptions: pass.shellUnplacedOptions } : {}), ...(wayOut !== undefined ? { notResumableWayOut: wayOut } : {}), ...confinedCallOf(input.confined, pass, pass.policyRewrite ?? pass.currentInput, input.confined !== undefined ? input.trackedCwd?.() : undefined) });
398
399
  const headless = bindingRefusal !== undefined || remedySeat === undefined ? undefined : remedyOf(remedySeat);
399
400
  const parkNote = pass.parkFailed !== undefined ? ((r) => ({ kind: "failed", cause: pass.parkFailed, ...(r !== undefined ? { reason: r } : {}) }))(suspendLaneReasonOf(pass.parkFailedReason)) : unresolvable !== undefined && pass.parkTargetGap !== undefined ? { kind: "no_target", gap: pass.parkTargetGap } : undefined;
400
401
  const parkFailedSaid = parkNote?.kind === "failed" && headless !== undefined ? foreignLine(parkNote.cause, PARK_FAILURE_CAUSE_MAX) : "";
@@ -1,5 +1,6 @@
1
1
  import { retiredKeyOf, retiredKeyRefusal } from "../retired-keys.js";
2
2
  import { boundedThrownName } from "../thrown-value.js";
3
+ import { captureProjectSeat } from "../project-seat.js";
3
4
  export const DRAINED_LEG_FRAME_TYPES = Object.freeze(["status", "wiring_manifest", "message_committed", "workspace_changed"]);
4
5
  export const LEG_LABEL_KINDS = Object.freeze(["impl", "verifier", "fix", "rung"]);
5
6
  const drained = new WeakSet();
@@ -50,6 +51,8 @@ export function admitLegFrameSeat(internals, entry) {
50
51
  throw retiredKeyRefusal(hit, "RunInternals");
51
52
  }
52
53
  const read = readLegInternals(internals, entry);
54
+ if (read.parentProject !== undefined)
55
+ read.parentProject = captureProjectSeat(read.parentProject, "RunInternals.parentProject");
53
56
  const seat = read.onLegFrame;
54
57
  if (seat === undefined) {
55
58
  refuseHiddenLegFrameSeat(internals, entry);
@@ -22,6 +22,9 @@ export declare function meteredDepsOf<D extends {
22
22
  /** The deployment's own bag behind a run's bag (itself for a bag that is no run's): the identity a once-per-deployment side
23
23
  * table keys on — a run's metered bag is a fresh object per run, and keying on it would say "once per deployment" once per run. */
24
24
  export declare function deploymentBagOf(deps: object): object;
25
+ /** Carry `from`'s deployment identity (`DEPLOYMENT_BAG`) onto a shallow copy minted before {@link meteredDepsOf} (e.g.
26
+ * role-map normalisation), so once-per-deployment side tables still key on the deployment's own bag. */
27
+ export declare function keepDeploymentOf<D extends object>(from: object, copy: D): D;
25
28
  /** The meter a run's bag carries, if it is one. */
26
29
  export declare function meterOf(deps: object): SpendMeter | undefined;
27
30
  /** The model lane over a deps bag's Brain seat and its fallback policy (`RunnerDeps.modelFallback`; absent ⇒ the default gate),
@@ -40,6 +40,10 @@ export function deploymentBagOf(deps) {
40
40
  const own = deps[DEPLOYMENT_BAG];
41
41
  return typeof own === "object" && own !== null ? own : deps;
42
42
  }
43
+ export function keepDeploymentOf(from, copy) {
44
+ Object.defineProperty(copy, DEPLOYMENT_BAG, { value: deploymentBagOf(from), enumerable: true, writable: true, configurable: true });
45
+ return copy;
46
+ }
43
47
  export function meterOf(deps) {
44
48
  const m = deps[RUN_METER];
45
49
  return m === undefined ? undefined : m;
@@ -8,6 +8,7 @@ import type { ReminderDisclosureCounts } from "../reminder-disclosure.js";
8
8
  import type { TaskSpec } from "../task-spec.js";
9
9
  import type { EngineNotice, RunnerDeps, TaskEvent, TaskEventIdentity } from "../types.js";
10
10
  import type { WiringManifest } from "../wiring-manifest.js";
11
+ import type { WiringInstructions } from "../instruction-preview.js";
11
12
  import type { Prepared } from "./contracts.js";
12
13
  /** At most this many names in `files` (and in `alternate.files`). */
13
14
  export declare const NESTED_MEMORY_MAX_NAMES = 8;
@@ -144,13 +145,28 @@ interface LaneHands {
144
145
  readonly root: string;
145
146
  readonly additionalRoots?: ReadonlyArray<DeclaredRoot>;
146
147
  }
148
+ /** What the lane reads of the leg it serves: the model it sizes frames for, the transcript's host texts, the leg's ids, its once-told
149
+ * record and identity. A prepared leg is one; a preview of a leg builds one with nothing behind it to write to. */
150
+ export interface InstructionLaneLeg {
151
+ readonly harness: {
152
+ getModel(): ReturnType<Prepared["harness"]["getModel"]>;
153
+ };
154
+ readonly session: {
155
+ buildContext(): ReturnType<Prepared["session"]["buildContext"]>;
156
+ };
157
+ readonly sessionId: string;
158
+ readonly runId: string;
159
+ readonly announcedListingsRef: Prepared["announcedListingsRef"];
160
+ readonly frameReceipts: Pick<Prepared["frameReceipts"], "listingSnapshotOwed">;
161
+ readonly hookIdentity: Pick<Prepared["hookIdentity"], "taskId" | "isDelegatedChild">;
162
+ }
147
163
  interface LaneSeatCommon {
148
164
  readonly declaration: ScreenedNestedMemory;
149
165
  readonly signal: AbortSignal;
150
166
  readonly mark: string | undefined;
151
167
  readonly counts: ReminderDisclosureCounts | undefined;
152
168
  readonly deps: Pick<RunnerDeps, "onNotice" | "onError">;
153
- readonly leg: () => Pick<Prepared, "harness" | "session" | "sessionId" | "runId" | "announcedListingsRef" | "frameReceipts" | "hookIdentity"> | undefined;
169
+ readonly leg: () => InstructionLaneLeg | undefined;
154
170
  /** The file tools the run's roster mounts, read at each mint — what a frame's sentence (a cut file's way to the rest) may send the
155
171
  * model to; absent outside a Runner: every one taken as mounted. */
156
172
  readonly fileTools?: () => FrameFileTools;
@@ -213,15 +229,16 @@ export interface NestedMemoryLane {
213
229
  * out. The load's per-request size cap is not applied (it can only take frames away). Empty once that load is taken. */
214
230
  owedAhead(triggers: readonly string[]): readonly MintedAttachmentFrame[];
215
231
  /** Each root's members the conversation holds (a read-state entry) or a load has on its way, relative to that root,
216
- * `/`-separated — the declared names first, in declaration order (`files`, then `localFiles`), then the rules by path: the
217
- * task root's (`selected`) and, under the opt-in, each additional root's in declaration order (the wiring manifest's
218
- * member); none on a lane with no hands (it reads no file). */
219
- selected(): NonNullable<WiringManifest["instructions"]> | undefined;
232
+ * `/`-separated, plus first-load `@`-included and withheld entries (present iff non-empty); `undefined` on a lane with no
233
+ * hands unless host-text withholds occurred. */
234
+ selected(): WiringInstructions | undefined;
220
235
  /** Is this key a member of the declared family — at a root's own level, or at any level — read off the declaration
221
236
  * and the path alone (a member's name, or a markdown file under a rules directory), whoever wrote its entry? */
222
237
  isMember(key: string, at: "root" | "any"): boolean;
223
238
  }
224
239
  export declare function createNestedMemoryLane(seat: NestedMemoryLaneSeat): NestedMemoryLane;
240
+ /** One first-load reading over a seated lane — shared by `primeInstructionLane` (manifest) and `Runner.previewInstructions`. */
241
+ export declare function primeInstructionReading(lane: NestedMemoryLane, report: (e: Error) => void): Promise<WiringInstructions | undefined>;
225
242
  /** The leg's first load, before its manifest goes out, and the manifest's `instructions` member it answers
226
243
  * ({@link WiringManifest.instructions}). A load that throws leaves the leg's first request to load (the operator hears
227
244
  * why); the manifest then says what the read state holds. */