@sema-agent/core 7.58.0 → 7.60.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 (519) hide show
  1. package/CHANGELOG.md +1340 -0
  2. package/README.md +6 -4
  3. package/dist/agents/agent-definition.d.ts +7 -0
  4. package/dist/agents/agent-definition.js +12 -0
  5. package/dist/agents/agent-transcript-tool.d.ts +2 -1
  6. package/dist/agents/agent-transcript-tool.js +3 -1
  7. package/dist/agents/cc-peer-directory.js +8 -8
  8. package/dist/agents/child-model-seat.d.ts +4 -2
  9. package/dist/agents/child-model-seat.js +9 -4
  10. package/dist/agents/cumulative-stats.js +0 -1
  11. package/dist/agents/inherited-tool-pool.d.ts +26 -1
  12. package/dist/agents/inherited-tool-pool.js +22 -0
  13. package/dist/agents/peer-directory.d.ts +9 -0
  14. package/dist/agents/peer-directory.js +6 -2
  15. package/dist/agents/retain-ledger.d.ts +11 -1
  16. package/dist/agents/retain-ledger.js +13 -2
  17. package/dist/agents/roster-store.d.ts +1 -1
  18. package/dist/agents/roster-store.js +3 -1
  19. package/dist/agents/send-message-tool.d.ts +8 -19
  20. package/dist/agents/send-message-tool.js +32 -50
  21. package/dist/agents/subagent.d.ts +51 -17
  22. package/dist/agents/subagent.js +150 -112
  23. package/dist/agents/tool-filter.d.ts +1 -3
  24. package/dist/agents/tool-filter.js +4 -12
  25. package/dist/bench/metrics.d.ts +3 -5
  26. package/dist/bench/metrics.js +0 -1
  27. package/dist/brain/anthropic.js +161 -45
  28. package/dist/brain/degrading.js +3 -1
  29. package/dist/brain/errors.d.ts +9 -3
  30. package/dist/brain/errors.js +7 -1
  31. package/dist/brain/failover.js +2 -1
  32. package/dist/brain/open-responses.js +3 -3
  33. package/dist/brain/openai.js +103 -53
  34. package/dist/brain/provider-dialect.d.ts +11 -0
  35. package/dist/brain/provider-dialect.js +5 -2
  36. package/dist/brain/reasoning-request.js +5 -4
  37. package/dist/brain/reasoning.d.ts +19 -0
  38. package/dist/brain/reasoning.js +17 -2
  39. package/dist/brain/request-route.d.ts +4 -1
  40. package/dist/brain/request-route.js +4 -1
  41. package/dist/brain/route-adjudicator.d.ts +84 -18
  42. package/dist/brain/route-adjudicator.js +90 -22
  43. package/dist/brain/route-conformance.js +1 -1
  44. package/dist/brain/status-sink.d.ts +7 -1
  45. package/dist/brain/status-sink.js +6 -0
  46. package/dist/brain/stream-engine.js +84 -49
  47. package/dist/brain/stream-shared.d.ts +30 -0
  48. package/dist/brain/stream-shared.js +34 -1
  49. package/dist/brain/timeout.d.ts +65 -6
  50. package/dist/brain/timeout.js +111 -11
  51. package/dist/core/a2a.d.ts +15 -5
  52. package/dist/core/a2a.js +34 -19
  53. package/dist/core/account-row.d.ts +61 -0
  54. package/dist/core/account-row.js +51 -0
  55. package/dist/core/advisor-verdict.d.ts +2 -1
  56. package/dist/core/advisor-verdict.js +1 -1
  57. package/dist/core/agent-definition.d.ts +20 -0
  58. package/dist/core/allow-entry.d.ts +20 -6
  59. package/dist/core/allow-entry.js +17 -7
  60. package/dist/core/approval-object.d.ts +29 -15
  61. package/dist/core/approval-object.js +47 -19
  62. package/dist/core/artifact-host.d.ts +0 -2
  63. package/dist/core/artifact-host.js +0 -1
  64. package/dist/core/auto-compaction.js +1 -1
  65. package/dist/core/auto-mode-defaults.d.ts +8 -0
  66. package/dist/core/auto-mode-defaults.js +1 -0
  67. package/dist/core/auto-mode-rebuild.d.ts +2 -1
  68. package/dist/core/auto-mode.d.ts +39 -4
  69. package/dist/core/auto-mode.js +63 -12
  70. package/dist/core/background-agent-store.d.ts +26 -4
  71. package/dist/core/background-agent-store.js +3 -2
  72. package/dist/core/background-shell.d.ts +12 -1
  73. package/dist/core/background-shell.js +12 -0
  74. package/dist/core/checkpoint-requirements.d.ts +13 -1
  75. package/dist/core/checkpoint-requirements.js +3 -1
  76. package/dist/core/checkpoint-store.d.ts +66 -25
  77. package/dist/core/checkpoint-store.js +22 -9
  78. package/dist/core/child-clamp-seats.d.ts +29 -0
  79. package/dist/core/child-clamp-seats.js +56 -1
  80. package/dist/core/compliance.d.ts +3 -3
  81. package/dist/core/compliance.js +1 -1
  82. package/dist/core/credential-echo.d.ts +52 -0
  83. package/dist/core/credential-echo.js +65 -0
  84. package/dist/core/credential-vocabulary.d.ts +13 -3
  85. package/dist/core/credential-vocabulary.js +12 -4
  86. package/dist/core/cross-boundary-taint.d.ts +4 -5
  87. package/dist/core/effective-path-target.d.ts +8 -2
  88. package/dist/core/effective-path-target.js +8 -3
  89. package/dist/core/engine-notice.d.ts +156 -23
  90. package/dist/core/engine-notice.js +19 -5
  91. package/dist/core/frame-settlement.d.ts +5 -0
  92. package/dist/core/frame-settlement.js +4 -0
  93. package/dist/core/gate-fold.js +8 -6
  94. package/dist/core/gate-lanes.js +47 -12
  95. package/dist/core/gate-outcome.d.ts +32 -3
  96. package/dist/core/gate-outcome.js +19 -1
  97. package/dist/core/governance-codes.d.ts +17 -1
  98. package/dist/core/governance-codes.js +25 -0
  99. package/dist/core/hands-band-screen.js +0 -1
  100. package/dist/core/hands-band.d.ts +0 -3
  101. package/dist/core/hooks.d.ts +70 -59
  102. package/dist/core/hooks.js +125 -80
  103. package/dist/core/image-admission.d.ts +106 -52
  104. package/dist/core/image-admission.js +184 -56
  105. package/dist/core/image-downsample.d.ts +36 -69
  106. package/dist/core/image-downsample.js +111 -73
  107. package/dist/core/integer-option.d.ts +21 -0
  108. package/dist/core/integer-option.js +13 -0
  109. package/dist/core/locked-config.d.ts +59 -5
  110. package/dist/core/locked-config.js +82 -50
  111. package/dist/core/mailbox-store.d.ts +45 -1
  112. package/dist/core/mailbox-store.js +53 -9
  113. package/dist/core/mcp-call-meta.d.ts +2 -2
  114. package/dist/core/mcp-call-meta.js +9 -10
  115. package/dist/core/mcp-failure.d.ts +122 -20
  116. package/dist/core/mcp-failure.js +73 -5
  117. package/dist/core/mcp-host-seat.d.ts +92 -0
  118. package/dist/core/mcp-host-seat.js +131 -0
  119. package/dist/core/mcp-probe.d.ts +7 -2
  120. package/dist/core/mcp-probe.js +7 -2
  121. package/dist/core/mcp-server-link.d.ts +22 -1
  122. package/dist/core/mcp-server-link.js +25 -1
  123. package/dist/core/mcp-server-spec.d.ts +38 -9
  124. package/dist/core/mcp-server-spec.js +55 -21
  125. package/dist/core/mcp.d.ts +27 -12
  126. package/dist/core/mcp.js +105 -76
  127. package/dist/core/memory-admission.d.ts +23 -6
  128. package/dist/core/memory-admission.js +19 -9
  129. package/dist/core/memory-engine/consolidation-driver.d.ts +2 -4
  130. package/dist/core/memory-engine/consolidation-driver.js +3 -3
  131. package/dist/core/memory-engine/consolidation.d.ts +4 -0
  132. package/dist/core/memory-engine/consolidation.js +1 -0
  133. package/dist/core/memory-engine/content-origin.d.ts +13 -0
  134. package/dist/core/memory-engine/content-origin.js +21 -3
  135. package/dist/core/memory-engine/delegation-settlement.js +5 -12
  136. package/dist/core/memory-engine/distiller.js +2 -2
  137. package/dist/core/memory-engine/dual-root.d.ts +50 -1
  138. package/dist/core/memory-engine/dual-root.js +44 -1
  139. package/dist/core/memory-engine/engine.d.ts +67 -14
  140. package/dist/core/memory-engine/engine.js +384 -212
  141. package/dist/core/memory-engine/export-bundle.d.ts +23 -0
  142. package/dist/core/memory-engine/export-bundle.js +23 -4
  143. package/dist/core/memory-engine/file-backend.d.ts +128 -55
  144. package/dist/core/memory-engine/file-backend.js +290 -117
  145. package/dist/core/memory-engine/index.d.ts +3 -2
  146. package/dist/core/memory-engine/index.js +2 -1
  147. package/dist/core/memory-engine/layout.d.ts +59 -11
  148. package/dist/core/memory-engine/layout.js +190 -40
  149. package/dist/core/memory-engine/memory-backend-contract.d.ts +1 -1
  150. package/dist/core/memory-engine/memory-backend-contract.js +39 -2
  151. package/dist/core/memory-engine/scope-contract.d.ts +13 -3
  152. package/dist/core/memory-engine/scope-contract.js +2 -2
  153. package/dist/core/memory-engine/sync-client.d.ts +51 -9
  154. package/dist/core/memory-engine/sync-client.js +107 -13
  155. package/dist/core/memory-engine/sync-report.d.ts +103 -0
  156. package/dist/core/memory-engine/sync-report.js +119 -0
  157. package/dist/core/memory-engine/sync.d.ts +8 -1
  158. package/dist/core/memory-engine/types.d.ts +6 -0
  159. package/dist/core/mode-policy.d.ts +9 -1
  160. package/dist/core/mode-policy.js +11 -1
  161. package/dist/core/model-receipt.d.ts +39 -0
  162. package/dist/core/model-receipt.js +139 -0
  163. package/dist/core/mods/agent-stations.d.ts +65 -0
  164. package/dist/core/mods/agent-stations.js +105 -0
  165. package/dist/core/mods/classic-events.d.ts +5 -1
  166. package/dist/core/mods/kernel/dispatch.d.ts +5 -1
  167. package/dist/core/mods/kernel/dispatch.js +6 -5
  168. package/dist/core/mods/kernel/events.d.ts +11 -4
  169. package/dist/core/mods/kernel/events.js +11 -7
  170. package/dist/core/mods/kernel/receive.d.ts +5 -0
  171. package/dist/core/mods/kernel/receive.js +10 -0
  172. package/dist/core/mods/kernel/registration.d.ts +4 -0
  173. package/dist/core/mods/kernel/registration.js +3 -0
  174. package/dist/core/mods/lifecycle-stations.d.ts +41 -0
  175. package/dist/core/mods/lifecycle-stations.js +35 -0
  176. package/dist/core/mods/stations.d.ts +73 -60
  177. package/dist/core/mods/stations.js +64 -40
  178. package/dist/core/mods/tool-call.d.ts +10 -4
  179. package/dist/core/mods/tool-call.js +28 -12
  180. package/dist/core/mounted-mcp.d.ts +5 -0
  181. package/dist/core/mounted-mcp.js +2 -2
  182. package/dist/core/namespaced-rule-name.d.ts +7 -1
  183. package/dist/core/namespaced-rule-name.js +13 -2
  184. package/dist/core/oracle-isolation.js +1 -1
  185. package/dist/core/own-property-receipt.d.ts +3 -0
  186. package/dist/core/own-property-receipt.js +3 -0
  187. package/dist/core/parent-spec-seat.d.ts +8 -3
  188. package/dist/core/parent-spec-seat.js +2 -0
  189. package/dist/core/park-selfcheck.js +14 -8
  190. package/dist/core/peer-seat.d.ts +133 -16
  191. package/dist/core/peer-seat.js +319 -42
  192. package/dist/core/permission-rule-consent.d.ts +0 -21
  193. package/dist/core/permission-rule-consent.js +11 -6
  194. package/dist/core/permission-rule-model.d.ts +20 -2
  195. package/dist/core/permission-rule-model.js +8 -7
  196. package/dist/core/present-plan-tool.d.ts +11 -3
  197. package/dist/core/present-plan-tool.js +2 -2
  198. package/dist/core/protocol-http-auth.d.ts +14 -2
  199. package/dist/core/protocol-http-auth.js +16 -7
  200. package/dist/core/read-face-seats.d.ts +7 -5
  201. package/dist/core/read-face-seats.js +4 -1
  202. package/dist/core/redaction-marks.d.ts +4 -3
  203. package/dist/core/redaction-marks.js +2 -2
  204. package/dist/core/remote-env.d.ts +146 -98
  205. package/dist/core/remote-env.js +113 -14
  206. package/dist/core/resume-startup-cause.js +1 -0
  207. package/dist/core/retention.js +37 -12
  208. package/dist/core/retired-keys.d.ts +6 -1
  209. package/dist/core/retired-keys.js +4 -1
  210. package/dist/core/rewrite-rejudge.d.ts +13 -5
  211. package/dist/core/rewrite-rejudge.js +9 -5
  212. package/dist/core/roles.d.ts +69 -3
  213. package/dist/core/roles.js +167 -80
  214. package/dist/core/rule-owner.d.ts +3 -0
  215. package/dist/core/runner/announce-once-ledger.d.ts +5 -4
  216. package/dist/core/runner/announce-once-ledger.js +4 -2
  217. package/dist/core/runner/assemble-result.d.ts +0 -5
  218. package/dist/core/runner/assemble-result.js +0 -1
  219. package/dist/core/runner/call-hook-stations.d.ts +17 -10
  220. package/dist/core/runner/call-hook-stations.js +23 -12
  221. package/dist/core/runner/child-tree.d.ts +7 -8
  222. package/dist/core/runner/child-tree.js +6 -6
  223. package/dist/core/runner/classifier-ladder.d.ts +10 -2
  224. package/dist/core/runner/classifier-ladder.js +39 -8
  225. package/dist/core/runner/construction-doors.js +5 -0
  226. package/dist/core/runner/contracts.d.ts +82 -57
  227. package/dist/core/runner/credential-origin-seat.js +4 -3
  228. package/dist/core/runner/cross-boundary-lane.d.ts +3 -5
  229. package/dist/core/runner/cross-boundary-lane.js +11 -2
  230. package/dist/core/runner/cwd-alignment-probe.d.ts +20 -0
  231. package/dist/core/runner/cwd-alignment-probe.js +21 -0
  232. package/dist/core/runner/decide-continuation.d.ts +2 -2
  233. package/dist/core/runner/env-capability-census.d.ts +15 -20
  234. package/dist/core/runner/env-capability-census.js +25 -34
  235. package/dist/core/runner/file-history-request.d.ts +2 -2
  236. package/dist/core/runner/file-history-request.js +0 -8
  237. package/dist/core/runner/gate-exit.d.ts +87 -11
  238. package/dist/core/runner/gate-exit.js +30 -8
  239. package/dist/core/runner/git-status-frame.d.ts +5 -2
  240. package/dist/core/runner/git-status-frame.js +3 -4
  241. package/dist/core/runner/image-removed-seat.d.ts +12 -0
  242. package/dist/core/runner/image-removed-seat.js +19 -0
  243. package/dist/core/runner/image.d.ts +7 -2
  244. package/dist/core/runner/image.js +14 -8
  245. package/dist/core/runner/inline-image.d.ts +10 -8
  246. package/dist/core/runner/inline-image.js +11 -9
  247. package/dist/core/runner/memory-consolidation-driver.js +5 -5
  248. package/dist/core/runner/park-commit.d.ts +1 -1
  249. package/dist/core/runner/park-commit.js +3 -0
  250. package/dist/core/runner/permission-rule-lanes.js +1 -1
  251. package/dist/core/runner/prepare-ask-lane.d.ts +1 -1
  252. package/dist/core/runner/prepare-ask-lane.js +2 -1
  253. package/dist/core/runner/prepare-boundary-parks.d.ts +2 -2
  254. package/dist/core/runner/prepare-boundary-parks.js +5 -5
  255. package/dist/core/runner/prepare-caps-and-workflow.d.ts +7 -5
  256. package/dist/core/runner/prepare-caps-and-workflow.js +6 -3
  257. package/dist/core/runner/prepare-config-doors.d.ts +6 -1
  258. package/dist/core/runner/prepare-config-doors.js +16 -9
  259. package/dist/core/runner/prepare-context-lane.js +2 -0
  260. package/dist/core/runner/prepare-delegation-surface.d.ts +9 -3
  261. package/dist/core/runner/prepare-delegation-surface.js +5 -4
  262. package/dist/core/runner/prepare-file-history.d.ts +10 -12
  263. package/dist/core/runner/prepare-file-history.js +3 -12
  264. package/dist/core/runner/prepare-gate-stations.d.ts +4 -3
  265. package/dist/core/runner/prepare-gate-stations.js +4 -3
  266. package/dist/core/runner/prepare-hands-readface.d.ts +7 -1
  267. package/dist/core/runner/prepare-hands-readface.js +19 -6
  268. package/dist/core/runner/prepare-inherited-gate.d.ts +6 -7
  269. package/dist/core/runner/prepare-inherited-gate.js +22 -31
  270. package/dist/core/runner/prepare-memory-engine-session.js +1 -1
  271. package/dist/core/runner/prepare-memory.d.ts +2 -2
  272. package/dist/core/runner/prepare-memory.js +12 -19
  273. package/dist/core/runner/prepare-park-ask.d.ts +4 -6
  274. package/dist/core/runner/prepare-park-ask.js +5 -9
  275. package/dist/core/runner/prepare-policy-chain.d.ts +8 -7
  276. package/dist/core/runner/prepare-policy-chain.js +136 -121
  277. package/dist/core/runner/prepare-project-context.d.ts +2 -2
  278. package/dist/core/runner/prepare-project-context.js +10 -7
  279. package/dist/core/runner/prepare-prompt-inputs.d.ts +5 -2
  280. package/dist/core/runner/prepare-prompt-inputs.js +10 -20
  281. package/dist/core/runner/prepare-protocol-tools.d.ts +5 -3
  282. package/dist/core/runner/prepare-protocol-tools.js +17 -2
  283. package/dist/core/runner/prepare-run-refs.d.ts +2 -3
  284. package/dist/core/runner/prepare-run-refs.js +4 -1
  285. package/dist/core/runner/prepare-suspend-saga.d.ts +0 -2
  286. package/dist/core/runner/prepare-suspend-saga.js +5 -7
  287. package/dist/core/runner/prepare-task.js +44 -28
  288. package/dist/core/runner/prepare-turn-wiring.d.ts +2 -0
  289. package/dist/core/runner/prepare-turn-wiring.js +7 -2
  290. package/dist/core/runner/prepare-wiring-manifest.d.ts +5 -4
  291. package/dist/core/runner/prepare-wiring-manifest.js +34 -19
  292. package/dist/core/runner/prepare-workspace-restore.js +3 -3
  293. package/dist/core/runner/reply-pricing.d.ts +30 -0
  294. package/dist/core/runner/reply-pricing.js +19 -0
  295. package/dist/core/runner/resume-admission.js +4 -2
  296. package/dist/core/runner/resume-apply.js +6 -1
  297. package/dist/core/runner/resume-checkpoint-screen.js +4 -4
  298. package/dist/core/runner/resume-policy-outcome.js +5 -5
  299. package/dist/core/runner/retired-runner-deps.js +4 -1
  300. package/dist/core/runner/role-seat-defaulted.d.ts +44 -0
  301. package/dist/core/runner/role-seat-defaulted.js +40 -0
  302. package/dist/core/runner/run-attachment-seats.js +3 -3
  303. package/dist/core/runner/run-brain-sinks.js +3 -0
  304. package/dist/core/runner/run-git-lane.d.ts +3 -1
  305. package/dist/core/runner/run-git-lane.js +1 -1
  306. package/dist/core/runner/run-harness-handlers.d.ts +3 -1
  307. package/dist/core/runner/run-harness-handlers.js +3 -1
  308. package/dist/core/runner/run-identity-wiring.d.ts +2 -5
  309. package/dist/core/runner/run-identity-wiring.js +6 -5
  310. package/dist/core/runner/run-leg.d.ts +2 -0
  311. package/dist/core/runner/run-leg.js +63 -56
  312. package/dist/core/runner/run-notification-lane.d.ts +3 -1
  313. package/dist/core/runner/run-notification-lane.js +16 -10
  314. package/dist/core/runner/run-settle-and-teardown.js +5 -1
  315. package/dist/core/runner/run-stop-and-final-verify.d.ts +4 -0
  316. package/dist/core/runner/run-stop-and-final-verify.js +14 -6
  317. package/dist/core/runner/run-terminal-adoption.d.ts +2 -5
  318. package/dist/core/runner/run-terminal-adoption.js +9 -3
  319. package/dist/core/runner/run-turn-boundary.js +89 -77
  320. package/dist/core/runner/runtask.d.ts +8 -5
  321. package/dist/core/runner/runtask.js +21 -13
  322. package/dist/core/runner/side-call-account.d.ts +1 -1
  323. package/dist/core/runner/side-call-account.js +3 -18
  324. package/dist/core/runner/skills-seat.js +2 -2
  325. package/dist/core/runner/sub-agent-deny-lists.d.ts +24 -0
  326. package/dist/core/runner/sub-agent-deny-lists.js +20 -7
  327. package/dist/core/runner/synthetic-tools.js +2 -2
  328. package/dist/core/runner/tool-disclosure.js +0 -2
  329. package/dist/core/runner/tool-end-body.js +2 -2
  330. package/dist/core/runner/tool-face-overlay.d.ts +1 -1
  331. package/dist/core/runner/tool-face-overlay.js +26 -19
  332. package/dist/core/runner/tool-occurrence.d.ts +1 -1
  333. package/dist/core/runner/tool-occurrence.js +2 -2
  334. package/dist/core/runner/tool-result-media-seat.d.ts +9 -1
  335. package/dist/core/runner/tool-result-media-seat.js +17 -1
  336. package/dist/core/runner/turn-attachments.d.ts +29 -27
  337. package/dist/core/runner/turn-attachments.js +27 -42
  338. package/dist/core/runner-deps.d.ts +32 -19
  339. package/dist/core/secret-env.d.ts +35 -4
  340. package/dist/core/secret-env.js +65 -3
  341. package/dist/core/sensitive-path-policy.js +3 -3
  342. package/dist/core/session-policy-store.d.ts +12 -3
  343. package/dist/core/session-policy-store.js +29 -10
  344. package/dist/core/session-store.d.ts +5 -7
  345. package/dist/core/session-store.js +50 -11
  346. package/dist/core/side-query.d.ts +11 -1
  347. package/dist/core/side-query.js +9 -0
  348. package/dist/core/skill-grant-binding.d.ts +31 -2
  349. package/dist/core/skill-grant-binding.js +31 -1
  350. package/dist/core/skill-grant.d.ts +17 -5
  351. package/dist/core/skill-grant.js +24 -6
  352. package/dist/core/store-contracts/background-agent-store-contract.js +27 -0
  353. package/dist/core/store-contracts/checkpoint-store-contract.js +3 -2
  354. package/dist/core/store-contracts/mailbox-store-contract.js +31 -1
  355. package/dist/core/store-contracts/tool-result-store-contract.d.ts +1 -1
  356. package/dist/core/store-contracts/tool-result-store-contract.js +37 -0
  357. package/dist/core/stub-env.d.ts +5 -5
  358. package/dist/core/stub-env.js +11 -1
  359. package/dist/core/swappable-deps.d.ts +17 -43
  360. package/dist/core/swappable-deps.js +15 -5
  361. package/dist/core/synthetic-read-verdict.d.ts +1 -1
  362. package/dist/core/synthetic-read-verdict.js +2 -1
  363. package/dist/core/task-event.d.ts +50 -10
  364. package/dist/core/task-notification.d.ts +88 -5
  365. package/dist/core/task-notification.js +146 -17
  366. package/dist/core/task-registry-agent.d.ts +18 -12
  367. package/dist/core/task-registry-agent.js +19 -6
  368. package/dist/core/task-registry-monitor.d.ts +7 -0
  369. package/dist/core/task-registry-monitor.js +28 -1
  370. package/dist/core/task-registry-shared.d.ts +43 -3
  371. package/dist/core/task-registry-shared.js +21 -7
  372. package/dist/core/task-registry-workflow.js +1 -1
  373. package/dist/core/task-registry.d.ts +50 -35
  374. package/dist/core/task-registry.js +64 -23
  375. package/dist/core/task-result.d.ts +3 -12
  376. package/dist/core/task-spec.d.ts +15 -7
  377. package/dist/core/task-stream.d.ts +1 -1
  378. package/dist/core/terminal-cause.d.ts +10 -0
  379. package/dist/core/tool-catalog-entries.js +1 -1
  380. package/dist/core/tool-check-reading.d.ts +1 -0
  381. package/dist/core/tool-check-reading.js +3 -3
  382. package/dist/core/tool-face-reader.d.ts +7 -6
  383. package/dist/core/tool-face-reader.js +4 -3
  384. package/dist/core/tool-name-aliases.d.ts +19 -0
  385. package/dist/core/tool-name-aliases.js +54 -2
  386. package/dist/core/tool-policy.d.ts +21 -4
  387. package/dist/core/tool-policy.js +1 -1
  388. package/dist/core/tool-registry.d.ts +5 -5
  389. package/dist/core/tool-registry.js +2 -2
  390. package/dist/core/tool-result-store.d.ts +88 -5
  391. package/dist/core/tool-result-store.js +51 -12
  392. package/dist/core/tool-roster.d.ts +112 -5
  393. package/dist/core/tool-roster.js +42 -1
  394. package/dist/core/tool-spec.d.ts +23 -5
  395. package/dist/core/trace.d.ts +0 -1
  396. package/dist/core/types.d.ts +5 -5
  397. package/dist/core/types.js +2 -2
  398. package/dist/core/untrusted-text.js +1 -1
  399. package/dist/core/user-attachment.d.ts +10 -5
  400. package/dist/core/user-attachment.js +15 -7
  401. package/dist/core/wiring-manifest.d.ts +6 -3
  402. package/dist/engine/compaction/compaction.js +29 -3
  403. package/dist/engine/execution-env/node-execution-env.d.ts +11 -5
  404. package/dist/engine/execution-env/node-execution-env.js +21 -13
  405. package/dist/engine/harness/agent-harness.d.ts +26 -3
  406. package/dist/engine/harness/agent-harness.js +49 -16
  407. package/dist/engine/harness/messages.d.ts +3 -1
  408. package/dist/engine/harness/messages.js +3 -2
  409. package/dist/engine/harness/types.d.ts +119 -28
  410. package/dist/engine/llm/rejected-images.d.ts +46 -0
  411. package/dist/engine/llm/rejected-images.js +54 -0
  412. package/dist/engine/llm/tool-turns.d.ts +2 -1
  413. package/dist/engine/llm/types.d.ts +18 -7
  414. package/dist/engine/loop/agent-loop.d.ts +20 -12
  415. package/dist/engine/loop/agent-loop.js +205 -36
  416. package/dist/engine/loop/types.d.ts +12 -3
  417. package/dist/engine/lsp/node-lsp-manager.d.ts +3 -3
  418. package/dist/engine/lsp/node-lsp-manager.js +32 -13
  419. package/dist/engine/session/path-to-root.d.ts +38 -0
  420. package/dist/engine/session/path-to-root.js +39 -0
  421. package/dist/engine/session/storage-base.js +4 -21
  422. package/dist/index.d.ts +35 -21
  423. package/dist/index.js +26 -17
  424. package/dist/internal/harness-types.d.ts +1 -1
  425. package/dist/internal/harness.d.ts +1 -0
  426. package/dist/internal/llm.d.ts +1 -0
  427. package/dist/orchestration/run-workflow-tool.d.ts +9 -3
  428. package/dist/orchestration/run-workflow-tool.js +59 -29
  429. package/dist/orchestration/workflow-governance.d.ts +1 -1
  430. package/dist/orchestration/workflow-governance.js +2 -1
  431. package/dist/orchestration/workflow-observe.d.ts +17 -1
  432. package/dist/orchestration/workflow-observe.js +20 -0
  433. package/dist/orchestration/workflow-types.d.ts +32 -7
  434. package/dist/orchestration/workflow.d.ts +4 -0
  435. package/dist/orchestration/workflow.js +762 -491
  436. package/dist/prompts/default.d.ts +1 -10
  437. package/dist/prompts/default.js +0 -2
  438. package/dist/shell/counting-pass.d.ts +50 -0
  439. package/dist/shell/counting-pass.js +502 -0
  440. package/dist/shell/lex.d.ts +4 -2
  441. package/dist/shell/lex.js +93 -34
  442. package/dist/shell/shell-words.d.ts +1 -1
  443. package/dist/shell/shell-words.js +7 -6
  444. package/dist/stores/file/background-agent-store.d.ts +1 -1
  445. package/dist/stores/file/background-agent-store.js +3 -1
  446. package/dist/stores/file/checkpoint-store.d.ts +127 -2
  447. package/dist/stores/file/checkpoint-store.js +19 -14
  448. package/dist/stores/file/file-history-store.d.ts +1 -1
  449. package/dist/stores/file/file-history-store.js +3 -1
  450. package/dist/stores/file/index.d.ts +4 -3
  451. package/dist/stores/file/index.js +17 -8
  452. package/dist/stores/file/mailbox-store.d.ts +1 -1
  453. package/dist/stores/file/mailbox-store.js +9 -11
  454. package/dist/stores/file/memory-store.d.ts +1 -1
  455. package/dist/stores/file/memory-store.js +3 -1
  456. package/dist/stores/file/session-policy-store.d.ts +1 -1
  457. package/dist/stores/file/session-policy-store.js +3 -1
  458. package/dist/stores/file/session-store.d.ts +1 -1
  459. package/dist/stores/file/session-store.js +3 -1
  460. package/dist/stores/file/shared-ledger.d.ts +26 -0
  461. package/dist/stores/file/shared-ledger.js +38 -9
  462. package/dist/stores/file/tool-result-store.d.ts +20 -2
  463. package/dist/stores/file/tool-result-store.js +74 -6
  464. package/dist/stores/file/usage-window-store.d.ts +1 -1
  465. package/dist/stores/file/usage-window-store.js +3 -1
  466. package/dist/stores/file/workflow-journal-store.d.ts +1 -11
  467. package/dist/stores/file/workflow-journal-store.js +3 -2
  468. package/dist/tools/fs/containment-face.d.ts +5 -0
  469. package/dist/tools/fs/encoding.d.ts +13 -4
  470. package/dist/tools/fs/encoding.js +17 -2
  471. package/dist/tools/fs/fs-bash-background-text.d.ts +7 -0
  472. package/dist/tools/fs/fs-bash-background-text.js +1 -0
  473. package/dist/tools/fs/fs-bash.d.ts +14 -4
  474. package/dist/tools/fs/fs-bash.js +29 -35
  475. package/dist/tools/fs/fs-pdf.d.ts +2 -2
  476. package/dist/tools/fs/fs-pdf.js +26 -21
  477. package/dist/tools/fs/fs-read.d.ts +5 -4
  478. package/dist/tools/fs/fs-read.js +35 -18
  479. package/dist/tools/fs/fs-search-tools.js +4 -1
  480. package/dist/tools/fs/fs-shared.d.ts +11 -13
  481. package/dist/tools/fs/fs-shared.js +11 -7
  482. package/dist/tools/fs/fs-write.js +5 -5
  483. package/dist/tools/fs/index.d.ts +14 -8
  484. package/dist/tools/fs/index.js +13 -5
  485. package/dist/tools/fs/program-read-model.d.ts +13 -0
  486. package/dist/tools/fs/program-read-model.js +15 -0
  487. package/dist/tools/fs/program-read-model.rows.js +1 -1
  488. package/dist/tools/fs/read-deny.d.ts +13 -10
  489. package/dist/tools/fs/read-deny.js +25 -5
  490. package/dist/tools/fs/read-floor.d.ts +62 -0
  491. package/dist/tools/fs/read-floor.js +58 -0
  492. package/dist/tools/fs/removal-targets.d.ts +9 -4
  493. package/dist/tools/fs/removal-targets.js +17 -9
  494. package/dist/tools/fs/search.d.ts +3 -3
  495. package/dist/tools/fs/search.js +4 -4
  496. package/dist/tools/fs/shell-read-check.d.ts +1 -1
  497. package/dist/tools/fs/shell-read-check.js +2 -1
  498. package/dist/tools/fs/shell-read-judge.d.ts +16 -8
  499. package/dist/tools/fs/shell-read-judge.js +10 -6
  500. package/dist/tools/fs/shell-read-plan.d.ts +6 -1
  501. package/dist/tools/fs/shell-read-plan.js +22 -15
  502. package/dist/tools/fs/shell-read-start.js +1 -0
  503. package/dist/tools/fs/shell-reentry-text.d.ts +15 -1
  504. package/dist/tools/fs/shell-reentry-text.js +25 -3
  505. package/dist/tools/monitor.d.ts +9 -4
  506. package/dist/tools/monitor.js +17 -8
  507. package/dist/tools/scheduler-tools.js +42 -4
  508. package/dist/tools/web.d.ts +0 -10
  509. package/dist/tools/web.js +1 -4
  510. package/package.json +5 -2
  511. package/test/export-surface.snapshot.json +161 -21
  512. package/wire-changes/core-stores-sql@7.59.0.json +29 -0
  513. package/wire-changes/core-stores-sql@7.60.0.json +30 -0
  514. package/wire-changes/core@7.59.0.json +2459 -0
  515. package/wire-changes/core@7.60.0.json +3274 -0
  516. package/wire-changes/mods-kernel@7.59.0.json +29 -0
  517. package/wire-changes/mods-kernel@7.60.0.json +62 -0
  518. package/wire-changes/primitives@7.59.0.json +29 -0
  519. package/wire-changes/primitives@7.60.0.json +30 -0
@@ -1,3 +1,4 @@
1
+ import { targetIsExternal } from "../remote-env.js";
1
2
  import { BOUNDARY_LEGS, CROSS_BOUNDARY_RECORD_TYPE, CROSS_BOUNDARY_TAINT_BITS, STRICTEST_CROSS_BOUNDARY_TREE, crossBoundaryObligation, crossBoundaryPostureUndeclaredNotice, crossBoundaryRecordUnwrittenNotice, crossBoundaryRecordData, crossBoundaryTreeCovers, crossBoundaryTreeGoverned, joinCrossBoundaryTree, readCrossBoundaryRecord, } from "../cross-boundary-taint.js";
2
3
  import { deliverEngineNotice } from "../engine-notice.js";
3
4
  import { policyCannotAnswer } from "../real-approval.js";
@@ -23,6 +24,14 @@ export function joinedCrossBoundaryTree(handed, report) {
23
24
  const EVERY_LEG = Object.freeze([...BOUNDARY_LEGS]);
24
25
  const ONE_OUTSIDE_READ = Object.freeze([Object.freeze({ legs: Object.freeze(["outside_read"]) })]);
25
26
  const bitsOf = (t) => CROSS_BOUNDARY_TAINT_BITS.filter((b) => t[b] === true);
27
+ function obligationReaching(legs, reached, tree) {
28
+ const declared = reached === undefined ? false : targetIsExternal(reached);
29
+ if (declared !== "undeclared")
30
+ return crossBoundaryObligation(legs, declared, tree);
31
+ const onTarget = crossBoundaryObligation(legs, true, tree);
32
+ const offTarget = crossBoundaryObligation(legs, false, tree);
33
+ return Object.freeze({ mandate: onTarget.mandate || offTarget.mandate, record: onTarget.record || offTarget.record });
34
+ }
26
35
  function legsOfCall(view, legEnv, token, call, report) {
27
36
  const roster = view.roster.current;
28
37
  const row = roster !== undefined ? rosterEntryNamed(roster, call.toolName) : undefined;
@@ -137,7 +146,7 @@ export async function prepareCrossBoundaryLane(input) {
137
146
  const OBSERVED = Object.freeze({ offTargetReadObserved: true });
138
147
  const addedBy = (record) => (record && ref.current.offTargetReadObserved !== true ? OBSERVED : undefined);
139
148
  const owedBit = (owed) => {
140
- const records = (given) => given.some((d) => crossBoundaryObligation(d.legs, d.env?.externalContentTarget === true, ref.current).record);
149
+ const records = (given) => given.some((d) => obligationReaching(d.legs, d.env, ref.current).record);
141
150
  try {
142
151
  return addedBy(records(owed()));
143
152
  }
@@ -166,7 +175,7 @@ export async function prepareCrossBoundaryLane(input) {
166
175
  const obligationOf = (call, say) => {
167
176
  const { legs, env: reached } = legsOfCall(view, env, token, call, say);
168
177
  try {
169
- return crossBoundaryObligation(legs, reached?.externalContentTarget === true, ref.current);
178
+ return obligationReaching(legs, reached, ref.current);
170
179
  }
171
180
  catch (err) {
172
181
  say(`the cross-boundary obligation of "${call.toolName}" could not be read (${thrownText(err)}) — the call reads as every leg, off the target`);
@@ -0,0 +1,20 @@
1
+ /** The shell's answer. `unknown` = the root is not a directory in the shell's view, or its `test` has no `-ef`:
2
+ * no judgment, so no observation. */
3
+ export type CwdAlignmentVerdict = "same" | "differ" | "unknown";
4
+ /**
5
+ * The probe's last sub-command: the shell asks whether its working directory and the task root are one directory
6
+ * (`test . -ef <root>`: the same filesystem object, links followed, spelling and case irrelevant) and prints one
7
+ * line `cwd-alignment:<same|differ|unknown>:<its pwd -P>`. The line carries its own marker, so a banner a login
8
+ * shell prints first moves nothing.
9
+ */
10
+ export declare function cwdAlignmentProbe(taskRoot: string): string;
11
+ /** The framed answer and the shell's own `pwd -P` reading, found by its marker (the last such line — the probe's
12
+ * last sub-command — wherever earlier output put it); a word outside the closed set reads `unknown`; no framed
13
+ * line at all reads `undefined` (the probe's tail never arrived: nothing to judge). */
14
+ export declare function readCwdAlignment(lines: readonly string[]): {
15
+ verdict: CwdAlignmentVerdict;
16
+ shellPwd: string;
17
+ } | undefined;
18
+ /** The operator-lane sentence for a `differ` verdict: the two readings and the shell's finding, nothing about
19
+ * where an exec or an artifact would land. */
20
+ export declare function cwdMisalignmentMessage(taskRoot: string, shellPwd: string): string;
@@ -0,0 +1,21 @@
1
+ import { shellQuote } from "../../tools/fs/search.js";
2
+ const CWD_ALIGNMENT_MARK = "cwd-alignment:";
3
+ export function cwdAlignmentProbe(taskRoot) {
4
+ const root = shellQuote(taskRoot);
5
+ return `(p=$(pwd -P 2>/dev/null || pwd); if test -d ${root} >/dev/null 2>&1; then test . -ef ${root} >/dev/null 2>&1; case $? in 0) v=same;; 1) v=differ;; *) v=unknown;; esac; else v=unknown; fi; printf '%s\\n' "${CWD_ALIGNMENT_MARK}$v:$p")`;
6
+ }
7
+ export function readCwdAlignment(lines) {
8
+ for (let i = lines.length - 1; i >= 0; i--) {
9
+ const line = lines[i] ?? "";
10
+ if (!line.startsWith(CWD_ALIGNMENT_MARK))
11
+ continue;
12
+ const rest = line.slice(CWD_ALIGNMENT_MARK.length);
13
+ const cut = rest.indexOf(":");
14
+ const word = cut < 0 ? rest : rest.slice(0, cut);
15
+ return { verdict: word === "same" || word === "differ" ? word : "unknown", shellPwd: cut < 0 ? "" : rest.slice(cut + 1).trim() };
16
+ }
17
+ return undefined;
18
+ }
19
+ export function cwdMisalignmentMessage(taskRoot, shellPwd) {
20
+ return `execution-env cwd misalignment: a probe run with the task root "${taskRoot}" as its working directory reports pwd "${shellPwd}", and the env's shell found that directory to be a different one from the task root`;
21
+ }
@@ -131,8 +131,8 @@ export declare function mintDecideRecord(cp: Checkpoint, facts: HostDecisionFact
131
131
  * row stays `pending` for a well-formed decide, exactly like the other capture-time domain refusals,
132
132
  * and BEFORE the hygiene check so no guard ever consults a value outside the domain. The rejected field
133
133
  * is named in the message, and in `detail` where the caller hands the closed set's word for the cell
134
- * (`CheckpointErrorField`: `feedback` has one; `reason` and `editedPlan` have none, and widening the set is a
135
- * wire-surface change of its own).
134
+ * (`CheckpointErrorField`: `feedback` and the approval lane's deny `reason` have one; the other lanes' `reason` and
135
+ * `editedPlan` have none, and widening the set is a wire-surface change of its own).
136
136
  */
137
137
  export declare function assertOutcomeText(value: string | undefined, field: "editedPlan" | "reason" | "feedback", detail?: {
138
138
  field: CheckpointErrorField;
@@ -4,30 +4,25 @@ import type { EngineNotice } from "../engine-notice.js";
4
4
  export interface MalformedCapabilityDeclaration {
5
5
  readonly key: string;
6
6
  readonly valueType: string;
7
- /** The shape the seat takes: a `capabilities.*` boolean, or an optional seam method. */
8
- readonly expected: "boolean" | "function";
7
+ /** The shape the seat takes: a `capabilities.*` boolean (or the block itself, an object), an optional seam method, or
8
+ * nothing (`absent`: a member of the block that is no capability). */
9
+ readonly expected: "boolean" | "object" | "function" | "absent";
9
10
  }
10
11
  /**
11
- * Every boolean capability this env DECLARES with a value that is not a boolean.
12
+ * Every capability this env does not DECLARE as a boolean: each key of the block that is absent, not a boolean, or
13
+ * cannot be received — or the block itself, when it is present but not an object or cannot be received — and each
14
+ * member the block carries outside the eight keys (a misspelled key leaves the key it meant undeclared).
12
15
  *
13
- * The probe is the VALUE, not membership, because the value is what the readers get: a `capabilities`
14
- * that answers `has` and `get` differently (a Proxy) would otherwise hide from the census exactly the
15
- * value a reader goes on to act on. `undefined` is where absence lands — an absent key and an explicit
16
- * `undefined` are the same word to every reader, and both are the documented silent reading of every key
17
- * outside {@link NO_ABSENT_READING} (and announced, alike, for a key inside it) — so one test covers both and
18
- * the census needs no membership rule at all.
16
+ * The block is judged on its one receipt (`capabilityReceiptOf`), the frozen copy every reader reads. `undefined` is
17
+ * where absence lands — an absent key and an explicit `undefined` are the same word to every reader — and both are
18
+ * announced, as a wrong shape is. An env with no block at all is announced once per key: every reader takes every key's
19
+ * safe side, and the operator learns which.
19
20
  *
20
- * TOTAL by construction: a diagnostic may not be the thing that fails a run. Every read of the adapter
21
- * can throw on a getter or a Proxy trap — the structural probe, the block acquisition and each key —
22
- * and a read that throws is itself a declaration nobody can use, so all three are reported rather than
23
- * raised (`unreadable`, under the key when there is one and under `capabilities` when the block itself
24
- * could not be had).
25
- *
26
- * What a snapshot cannot promise: this is taken once, at admission. An adapter whose capability values
27
- * CHANGE afterwards can hand a later reader something this census never saw; the declaration is
28
- * documented as a constant property of the adapter, and a mutable one is outside what any one-time
29
- * reading covers.
21
+ * TOTAL by construction: a diagnostic may not be the thing that fails a run. Every read of the adapter can throw on a
22
+ * getter or a Proxy trap — the block acquisition, each key, each optional method — and a read that throws is itself a
23
+ * declaration nobody can use, so it is reported rather than raised (`unreadable`, under the key when there is one and
24
+ * under `capabilities` when the block itself could not be had).
30
25
  */
31
26
  export declare function malformedCapabilityDeclarations(env: ExecutionEnv): MalformedCapabilityDeclaration[];
32
- /** Announce each malformed declaration once, to the operator who wired the adapter. */
27
+ /** Announce each undeclared or malformed declaration once, to the operator who wired the adapter. */
33
28
  export declare function announceMalformedCapabilities(env: ExecutionEnv, onNotice: ((notice: EngineNotice) => void) | undefined): void;
@@ -1,9 +1,5 @@
1
- import { isRemoteExecutionEnv } from "../remote-env.js";
1
+ import { CAPABILITY_KEYS, UNDECLARED_CAPABILITY_READING, capabilityReceiptOf } from "../remote-env.js";
2
2
  import { deliverEngineNotice } from "../engine-notice.js";
3
- const BOOLEAN_CAPABILITY_KEYS = ["isolation", "suspendable", "canonicalPathAuthoritative", "sharesProcessTable"];
4
- const NO_ABSENT_READING = {
5
- sharesProcessTable: "whether the commands it runs are processes on this engine's own process table has no default, so the Bash tool refuses every pattern kill that needs the question (`pkill`, `killall`, a `kill` fed by `pgrep`; `pkill -P $$`, the shell's own children, runs) on this environment until the adapter declares it — `true` when its commands run on a table that holds the engine (a host lane, or a PID namespace that contains the engine's), `false` only when they run where the engine is not (another machine, a PID namespace that does not contain it)",
6
- };
7
3
  const OPTIONAL_METHOD_KEYS = ["writeFileExclusive", "writeFileGuarded", "setFileMode", "readLink", "canonicalChain", "fileIdentity", "openBound"];
8
4
  export function malformedCapabilityDeclarations(env) {
9
5
  const out = [];
@@ -20,41 +16,36 @@ export function malformedCapabilityDeclarations(env) {
20
16
  continue;
21
17
  out.push({ key, valueType: value === null ? "null" : typeof value, expected: "function" });
22
18
  }
23
- let caps;
24
- try {
25
- if (!isRemoteExecutionEnv(env))
26
- return out;
27
- caps = env.capabilities;
28
- }
29
- catch {
30
- out.push({ key: "capabilities", valueType: "unreadable", expected: "boolean" });
31
- return out;
32
- }
33
- for (const key of BOOLEAN_CAPABILITY_KEYS) {
34
- let value;
35
- try {
36
- value = caps[key];
37
- }
38
- catch {
39
- out.push({ key, valueType: "unreadable", expected: "boolean" });
40
- continue;
41
- }
42
- if (typeof value === "boolean" || (value === undefined && NO_ABSENT_READING[key] === undefined))
43
- continue;
44
- out.push({ key, valueType: value === null ? "null" : typeof value, expected: "boolean" });
45
- }
19
+ for (const finding of capabilityReceiptOf(env).findings)
20
+ out.push(finding);
46
21
  return out;
47
22
  }
23
+ function declaredAs({ key, valueType, expected }) {
24
+ if (expected === "function")
25
+ return `declares ${key} as a ${valueType}, not a function`;
26
+ if (expected === "object")
27
+ return valueType === "unreadable" ? "declares a capabilities block that cannot be read" : `declares capabilities as a ${valueType}, not an object`;
28
+ if (expected === "absent")
29
+ return `declares capabilities.${key}, which is no capability`;
30
+ if (valueType === "undefined")
31
+ return `does not declare capabilities.${key}`;
32
+ if (valueType === "unreadable")
33
+ return `declares capabilities.${key} with a value that cannot be read`;
34
+ return `declares capabilities.${key} as a ${valueType}, not a boolean`;
35
+ }
48
36
  export function announceMalformedCapabilities(env, onNotice) {
49
- for (const { key, valueType, expected } of malformedCapabilityDeclarations(env)) {
50
- const noAbsentReading = NO_ABSENT_READING[key];
37
+ for (const finding of malformedCapabilityDeclarations(env)) {
38
+ const { key, valueType, expected } = finding;
39
+ const row = expected === "boolean" ? UNDECLARED_CAPABILITY_READING[key] : undefined;
51
40
  deliverEngineNotice(onNotice, {
52
41
  code: "config.execution_env_capability_invalid",
53
42
  message: expected === "function"
54
- ? `The execution environment declares ${key} as a ${valueType}, not a function. This seat is declared by being present as a callable method and undeclared by being absent, so every reader takes the absent reading — the reach the adapter meant to declare is silently the old one. Fix the adapter — this is a wiring fault, not a supported way to leave the seat unset.`
55
- : noAbsentReading !== undefined
56
- ? `The execution environment ${valueType === "undefined" ? `does not declare capabilities.${key}` : `declares capabilities.${key} as a ${valueType}, not a boolean`}: ${noAbsentReading}. Fix the adapter — this is a wiring fault, not a supported way to leave the capability unset.`
57
- : `The execution environment declares capabilities.${key} as a ${valueType}, not a boolean. What a reader makes of that is the reader's own business and differs between them — the containment readers take only the boolean, so this reads as undeclared, while the suspend reader takes any truthy value, so a non-empty string reads as TRUE. That is why a declaration of the wrong shape cannot pass quietly: the engine may act on something other than what the adapter meant. Fix the adapter — this is a wiring fault, not a supported way to leave the capability unset.`,
43
+ ? `The execution environment ${declaredAs(finding)}. This seat is declared by being present as a callable method and undeclared by being absent, so every reader takes the absent reading — the reach the adapter meant to declare is silently the old one. Fix the adapter — this is a wiring fault, not a supported way to leave the seat unset.`
44
+ : expected === "absent"
45
+ ? `The execution environment ${declaredAs(finding)}: the block holds exactly ${CAPABILITY_KEYS.join(", ")}, so no reader takes this member, and a misspelled key leaves the key it meant undeclared. Fix the adapter — this is a wiring fault, not a supported extension of the block.`
46
+ : expected === "object"
47
+ ? `The execution environment ${declaredAs(finding)}. Every capability is required and none can be read, so every reader takes its key's undeclared reading (${CAPABILITY_KEYS.map((k) => `${k} as ${JSON.stringify(UNDECLARED_CAPABILITY_READING[k].reads)}`).join(", ")}). Fix the adapter — this is a wiring fault, not a supported way to leave the capabilities unset.`
48
+ : `The execution environment ${declaredAs(finding)}. Every capability is required and has no default reading, so the engine reads it as ${JSON.stringify(row?.reads)}: ${row?.so}. Fix the adapter — this is a wiring fault, not a supported way to leave the capability unset.`,
58
49
  detail: { key, valueType },
59
50
  });
60
51
  }
@@ -4,8 +4,8 @@ import type { RunnerDeps, TaskSpec } from "../types.js";
4
4
  /**
5
5
  * The file-history REQUEST door: every refusal the request (`TaskSpec`) and the deployment's own seats decide
6
6
  * without the session, the env or the store's contents — the three bad-value doors (`RunnerDeps.onTrackFailure`,
7
- * `RunnerDeps.fileHistoryStore` / `fileHistoryCapture`, `TaskSpec.fileHistory`), the retired `rewindFiles` restore
8
- * sense, the restoreFiles / resumeAt / rewindFilesTo contradictions, and a restore asked of a run that holds no
7
+ * `RunnerDeps.fileHistoryStore` / `fileHistoryCapture`, `TaskSpec.fileHistory`), the restoreFiles / resumeAt /
8
+ * rewindFilesTo contradictions, and a restore asked of a run that holds no
9
9
  * history (`rewind.capture_disabled` / `rewind.store_unconfigured`). SYNCHRONOUS and side-effect free; the driver
10
10
  * calls it BEFORE the session is acquired, so a request refused here leaves the session — its leaf included —
11
11
  * exactly as it was. What it resolves rides into the file-history phase (`prepareFileHistory`) unchanged.
@@ -4,14 +4,6 @@ export function resolveFileHistoryRequest(spec, deps) {
4
4
  const declaredOff = wiredSeat === "disabled" || runDeclaredOff;
5
5
  const fileHistoryStore = declaredOff ? undefined : wiredSeat;
6
6
  const captureStore = captureOff ? undefined : fileHistoryStore;
7
- const legacyRewindFiles = spec.rewindFiles;
8
- if (legacyRewindFiles === true) {
9
- if (spec.resumeAt !== undefined) {
10
- const e = new Error(`rewind-files: TaskSpec.rewindFiles is retired (design/381 — rewind now converges the per-edited-file history, not a whole-tree snapshot). This request pairs it with resumeAt, i.e. the RESTORE sense: set restoreFiles: true instead. (The capture sense needs no request anymore — first-touch tracking is on whenever a RunnerDeps.fileHistoryStore is wired and neither RunnerDeps.fileHistoryCapture nor TaskSpec.fileHistory turns it off.)`);
11
- e.code = "rewind.rewind_files_retired";
12
- throw e;
13
- }
14
- }
15
7
  if (spec.restoreFiles === true && spec.resumeAt === undefined) {
16
8
  const e = new Error(`rewind-files: restoreFiles: true needs a resumeAt anchor — restoring files means converging them to a specific prior entry's boundary, and this spec names none. Use resumeAt + restoreFiles to move conversation and files together, or rewindFilesTo alone for a code-only restore.`);
17
9
  e.code = "rewind.invalid_spec";
@@ -55,6 +55,9 @@ export interface GateExitFacts {
55
55
  clearedBy?: AllowRuleClearance;
56
56
  /** The permission mode REFUSED the surviving ask — only beside `deniedBy: "mode"`. */
57
57
  modeRefusal?: ModeRefusal;
58
+ /** The registration whose handler ended the call at the hook layer (its deny answer or its failure) — only beside `deniedBy: "hook"`.
59
+ * As the bus names it: the engine's own origin word is read as no extension at the mint, once. */
60
+ extension?: string;
58
61
  }
59
62
  /**
60
63
  * Mint the outcome. A defect here is an ENGINE defect (a refusing site that did not say who refused, a
@@ -65,7 +68,7 @@ export interface GateExitFacts {
65
68
  export declare function mintGateOutcome(facts: GateExitFacts): GateOutcome;
66
69
  /** A direct refusal by one layer, with no ask settled — the five short-circuit exits (a hook that threw or
67
70
  * never answered, the hook's own deny, the compliance lock, the plan-mode block). */
68
- export declare function directDeny(deniedBy: Exclude<DeniedBy, "ask_resolution">): GateOutcome;
71
+ export declare function directDeny(deniedBy: Exclude<DeniedBy, "ask_resolution">, extension?: string): GateOutcome;
69
72
  /**
70
73
  * The gate's settlement LEDGER for one pass — the one place "which ask did this pass consume" is written,
71
74
  * with ONE rule for every read, all through the decision's engine record ({@link attestationOf}):
@@ -137,23 +140,55 @@ export declare function frozenInputSnapshot(input: unknown): unknown;
137
140
  /** What one `classic.PreToolUse` screening came to: an answer the receipt took (`undefined` = no opinion), or the
138
141
  * engine's fail-closed refusal of the call with its sentence (a handler that failed or broke the site's contract,
139
142
  * or a cancel). */
140
- /** A screen's outcome; an answer names the registration whose answer the chain returned (`answeredBy`, absent when no
141
- * handler spoke) and the extensions that authored its `updatedInput` (`rewrittenBy`, in the order they rewrote; absent
142
- * when the answer carries no rewrite). */
143
+ /** A screen's outcome over every installation that screens the call (the leg's own bus, then each inherited installation). An
144
+ * answer is the leg's own verdict — or an inherited installation's `deny`, which ends the screen — naming the registration that
145
+ * answered it (`answeredBy`, absent when no handler spoke); its `updatedInput` is the bytes the screen ended on when any
146
+ * installation rewrote, `rewrittenBy` the extensions that authored them (in the order they rewrote). `contexts` are every
147
+ * `additionalContext` line the screen collected, in raise order. `settled`: an inherited installation's question was refused
148
+ * where its installation froze it (`deniedBy` / `cause` as the pass's ledger read the refusal). A refusal — a deny, a failure, a
149
+ * settled refusal — names the bytes its judge judged (`judged`) when a rewrite earlier in the screen made them other bytes than
150
+ * those the screen was given. */
143
151
  export type PreToolUseScreen = {
144
152
  readonly kind: "answered";
145
153
  readonly answer: PreToolUseResult | undefined;
146
154
  readonly answeredBy?: string;
147
155
  readonly rewrittenBy?: readonly string[];
156
+ readonly contexts: readonly string[];
157
+ readonly inherited?: InheritedScreenRead;
158
+ readonly judged?: unknown;
148
159
  } | {
149
160
  readonly kind: "refused";
150
- readonly reason: string;
161
+ readonly reason: string; /** the registration the bus names for the failed screening (the mint reads whether it names an extension); absent on a cancel */
162
+ readonly extension?: string;
163
+ readonly judged?: unknown;
164
+ } | {
165
+ readonly kind: "settled";
166
+ readonly deny: PermissionResult;
167
+ readonly deniedBy: DeniedBy;
168
+ readonly cause?: ClassifierDenyCause;
169
+ readonly judged?: unknown;
151
170
  };
171
+ /** What the inherited installations' `classic.PreToolUse` came to beside the leg's own answer (present when one was raised): the
172
+ * registrations whose `allow` is no objection here (the allow layer's `hook` member discloses them; an inherited allow clears
173
+ * nothing of this leg's), the question a settlement floated to this leg's park (the call is marked; it folds as the leg's own
174
+ * hook ask does), and a person's approval of an edit at an installation's question (the gate's approved-edit pass takes it). */
175
+ export interface InheritedScreenRead {
176
+ readonly allowedBy: readonly string[];
177
+ readonly floated?: Extract<PermissionResult, {
178
+ action: "ask";
179
+ }>;
180
+ readonly approved?: Extract<PermissionResult, {
181
+ action: "allow";
182
+ }> & {
183
+ readonly updatedInput: unknown;
184
+ };
185
+ }
152
186
  /**
153
- * The PreToolUse screening face as the gate's stations see it — `classic.PreToolUse` raised on the leg's bus, the
154
- * per-screening e, the answer receipt and the fail-closed sentences behind one method, so the approved-edit re-screen
155
- * in the lanes runs the SAME screening the phase-1 pass ran. Present on the pass exactly when a handler hangs on the
156
- * event (an observe handler runs inside the screening too; it never decides).
187
+ * The PreToolUse screening face as the gate's stations see it — `classic.PreToolUse` raised on the leg's bus and then on each
188
+ * inherited installation's, the per-screening e, the answer receipt, the installations' settlements and the fail-closed
189
+ * sentences behind one method, so every re-screen (the fold's second look, the approved-edit pass) runs the SAME screening
190
+ * the phase-1 pass ran. Present on the pass exactly when a handler hangs on the event on one of those buses (an observe
191
+ * handler of the leg's own runs inside the screening too; it never decides).
157
192
  */
158
193
  export interface PreToolUseScreening {
159
194
  /** Raise `classic.PreToolUse` over `args`; `subject` names what is screened in a fail-closed sentence; `readAs` is the call
@@ -165,6 +200,31 @@ export interface PreToolUseScreening {
165
200
  /** The model-facing text for the screen's OWN deny of this call (unwrapped; every exit wraps it with the leg's mark). */
166
201
  deniedReason(answer: PreToolUseResult): string;
167
202
  }
203
+ /** What the inherited installations said in a screen, taken onto the pass — the one reading for phase 1 and the fold's second
204
+ * look: a floated question folds as the leg's own hook ask does (the call is marked, so no layer of this leg answers it), the
205
+ * allow speakers go to the allow layer's disclosure (the latest screen's reading replaces an earlier one), and a person's
206
+ * approved edit waits for the lanes' approved-edit pass. */
207
+ export declare function takeInheritedScreen(pass: GatePass, read: InheritedScreenRead | undefined): void;
208
+ /** A screen's `settled` outcome: an inherited installation's question refused where its installation froze it, in the layer word
209
+ * and the cause its reader read (`policy` when it read none), over the bytes its judge judged when a rewrite made them others. */
210
+ export declare function settledScreen(read: {
211
+ readonly decision: PermissionResult;
212
+ readonly deniedBy?: DeniedBy;
213
+ readonly cause?: ClassifierDenyCause;
214
+ }, judged: {
215
+ readonly judged?: unknown;
216
+ }): Extract<PreToolUseScreen, {
217
+ kind: "settled";
218
+ }>;
219
+ /** A settled screen taken onto the pass — the one reading for phase 1, the fold's second look and the approved-edit pass's two
220
+ * screens: its layer word and cause are the pass's; the refusal is returned for the site to stand (the decision, or the edit's). */
221
+ export declare function takeSettledScreen(pass: GatePass, settled: Extract<PreToolUseScreen, {
222
+ kind: "settled";
223
+ }>): PermissionResult;
224
+ /** A settled screen ends the pass as the call's settlement: its refusal is the decision, through the single deny exit. */
225
+ export declare function settledScreenExit(pass: GatePass, settled: Extract<PreToolUseScreen, {
226
+ kind: "settled";
227
+ }>): Promise<ToolGateResult>;
168
228
  /** The FACE a pass's questions are put on ({@link askFaceOf} of the call's wire name) — the one reading of it the
169
229
  * write-protection tighten (the fold) and every class derivation (the lanes) make. */
170
230
  export declare function passAskFace(pass: Pick<GatePass, "req">): AskFace;
@@ -251,6 +311,18 @@ export interface GatePass {
251
311
  * that answered it: the allow layer's hook member (its `entries`). Writers: the dispatch (phase 1) and the fold's second
252
312
  * look after a policy rewrite (rewrite-rejudge.ts), whose answer replaces the first. Reader: the lanes' allow layer. */
253
313
  hookAllowedBy?: readonly string[];
314
+ /** borrowed-mutable — the inherited installations whose `classic.PreToolUse` answered `allow` for the bytes that run: no
315
+ * objection, disclosed as the allow layer's `hook` member over a standing ask (never a clear). Writers: the dispatch (phase 1)
316
+ * and the fold's second look (its reading replaces the first). Reader: the lanes' allow layer. */
317
+ inheritedAllowedBy?: readonly string[];
318
+ /** borrowed-mutable — a person at an inherited installation's question approved an EDIT of the call during a screen: the lanes
319
+ * take it into the approved-edit pass after the fold (as a `tool.check` raise's approval is taken). Writers: the dispatch
320
+ * (phase 1) and the fold's second look. Reader: the lanes. */
321
+ screenApproval?: Extract<PermissionResult, {
322
+ action: "allow";
323
+ }> & {
324
+ readonly updatedInput: unknown;
325
+ };
254
326
  /** borrowed-mutable — `tool.check` was raised in this pass's first adjudication, which raises it once: set by the
255
327
  * raise in front of the ask branch, read by the raise behind the read-only arm (it then raises nothing). Writer and
256
328
  * reader: the lanes. */
@@ -264,6 +336,10 @@ export interface GatePass {
264
336
  * that ended as a refusal). The exit mints the outcome from it beside the ledger's `settled`; a refusal
265
337
  * that reaches the exit without it is an engine defect and the mint throws. */
266
338
  deniedBy: DeniedBy | undefined;
339
+ /** borrowed-mutable — the registration whose handler refused, written by every site that writes `deniedBy: "hook"` (its deny
340
+ * answer, or its failure; absent when the refusal names no extension — the engine's own failed raise, a cancel). Read only
341
+ * beside `deniedBy: "hook"` ({@link DENIED_BY_MAY_NAME_EXTENSION}); the exit mints `GateDisposition.extension` from it. */
342
+ deniedExtension?: string;
267
343
  /** borrowed-mutable — a refusing station's STRUCTURED details (the shell read station's refusal card), written
268
344
  * beside `deniedBy` by that station alone; the exit puts it on the gate result for the loop's error result.
269
345
  * OPTIONAL (the `probeUnanswered` form): the dispatch that builds the pass has nothing to declare here. */
@@ -362,7 +438,7 @@ export interface GatePass {
362
438
  * here — an attribution channel whose job is "why was this call denied" must see an engine deny, or the
363
439
  * deployment's only evidence of a broken hook is a tool that mysteriously stops working.
364
440
  */
365
- export declare function engineFailClosedExit(pass: GatePass, reason: string): Promise<ToolGateResult>;
441
+ export declare function engineFailClosedExit(pass: GatePass, reason: string, extension?: string): Promise<ToolGateResult>;
366
442
  /** The refusal sentence for args the gate could not take into its own copy (`ownArgs` refused them), naming what. */
367
443
  export declare const unownedArgsMessage: (subject: string, reason: string) => string;
368
444
  /**
@@ -388,7 +464,7 @@ export declare function untakenValueExit(pass: GatePass, untaken: {
388
464
  export declare function unownedArgsExit(pass: GatePass, reason: string): Promise<ToolGateResult>;
389
465
  /** The hook's OWN deny in phase 1. A PreToolUse hook deny does NOT fire `permissionDenied`
390
466
  * (the exclusion recorded on `PermissionDeniedPayload`) — this return stays observer-free. */
391
- export declare function hookDenyExit(pass: GatePass, deniedReason: string): ToolGateResult;
467
+ export declare function hookDenyExit(pass: GatePass, deniedReason: string, extension?: string): ToolGateResult;
392
468
  /**
393
469
  * The exit of the adjudicate chain — the pass has a standing `deny` or `allow` (every ask was resolved or
394
470
  * parked before this), and this is where it becomes the gate result and the ONE record of the pass.
@@ -2,7 +2,7 @@ import { screenGateOutcome, SETTLEMENT_IS_REFUSAL } from "../gate-outcome.js";
2
2
  import { askFaceOf, classifyAsk, headlessApprovalRemedy } from "../ask-origin.js";
3
3
  import { wireOf } from "../tool-name-readings.js";
4
4
  import { isProtectedWrite } from "../tool-registry.js";
5
- import { attestationOf, decisionText, licenseCovers } from "../tool-policy.js";
5
+ import { attestationOf, decisionText, foldHookAsk, licenseCovers } from "../tool-policy.js";
6
6
  import { pathDenialCardOf } from "../../tools/fs/safety.js";
7
7
  import { argsAsTheToolReads } from "../effective-path-target.js";
8
8
  import { rewriteRecordOf } from "../rewrite-rejudge.js";
@@ -11,9 +11,11 @@ import { inlineUntrusted } from "../untrusted-text.js";
11
11
  import { formatHookFeedback } from "../reminder-mint.js";
12
12
  import { types } from "node:util";
13
13
  import { receive } from "../mods/kernel/receive.js";
14
+ import { namedRegistration } from "../mods/kernel/registration.js";
14
15
  import { describeBindingFault, MAX_DEPTH } from "../canonical-json.js";
15
16
  export function mintGateOutcome(facts) {
16
17
  const settlement = facts.settled !== undefined ? Object.freeze({ ...facts.settled.settlement, who: Object.freeze({ ...facts.settled.settlement.who }) }) : undefined;
18
+ const extension = namedRegistration(facts.extension);
17
19
  const attribution = facts.classifier !== undefined ? Object.freeze({ ...facts.classifier, ...(facts.classifier.fallback !== undefined ? { fallback: Object.freeze({ ...facts.classifier.fallback }) } : {}) }) : undefined;
18
20
  const outcome = Object.freeze({
19
21
  disposition: Object.freeze(facts.deniedBy !== undefined
@@ -21,6 +23,7 @@ export function mintGateOutcome(facts) {
21
23
  kind: "denied",
22
24
  deniedBy: facts.deniedBy,
23
25
  ...(facts.cause !== undefined ? { cause: facts.cause } : {}),
26
+ ...(extension !== undefined ? { extension } : {}),
24
27
  ...(attribution !== undefined ? { classifier: attribution } : {}),
25
28
  ...(facts.modeRefusal !== undefined ? { mode: facts.modeRefusal.mode, askClass: facts.modeRefusal.askClass, classes: Object.freeze([...facts.modeRefusal.classes]) } : {}),
26
29
  }
@@ -41,8 +44,8 @@ function releaseRecordOf(a) {
41
44
  const { kind: _kind, ...record } = a;
42
45
  return record;
43
46
  }
44
- export function directDeny(deniedBy) {
45
- return mintGateOutcome({ deniedBy });
47
+ export function directDeny(deniedBy, extension) {
48
+ return mintGateOutcome({ deniedBy, ...(extension !== undefined ? { extension } : {}) });
46
49
  }
47
50
  const SETTLEMENT_IS_HUMAN = {
48
51
  human_allowed: true,
@@ -215,12 +218,31 @@ function withParkFailureCause(reason, parkFailed, nobodyJudged) {
215
218
  const note = `${reason} — note: a durable approval park was attempted for this call and could not be minted (${inlineUntrusted(parkFailed, PARK_FAILURE_CAUSE_MAX)})`;
216
219
  return nobodyJudged ? `${note}; with nobody to judge the call, that is why it stopped — it can be issued again once its park can be minted.` : `${note}.`;
217
220
  }
221
+ export function takeInheritedScreen(pass, read) {
222
+ if (read?.floated !== undefined)
223
+ pass.hookAsk = pass.hookAsk !== undefined ? foldHookAsk(pass.hookAsk, read.floated) : read.floated;
224
+ pass.inheritedAllowedBy = read !== undefined && read.allowedBy.length > 0 ? read.allowedBy : undefined;
225
+ if (read?.approved !== undefined)
226
+ pass.screenApproval = read.approved;
227
+ }
228
+ export function settledScreen(read, judged) {
229
+ return { kind: "settled", deny: read.decision, deniedBy: read.deniedBy ?? "policy", ...(read.cause !== undefined ? { cause: read.cause } : {}), ...judged };
230
+ }
231
+ export function takeSettledScreen(pass, settled) {
232
+ pass.deniedBy = settled.deniedBy;
233
+ pass.denyCause = settled.cause;
234
+ return settled.deny;
235
+ }
236
+ export async function settledScreenExit(pass, settled) {
237
+ pass.decision = takeSettledScreen(pass, settled);
238
+ return await exitGate(pass);
239
+ }
218
240
  export function passAskFace(pass) {
219
241
  return askFaceOf(wireOf("gate.askFace", pass.req));
220
242
  }
221
- export async function engineFailClosedExit(pass, reason) {
243
+ export async function engineFailClosedExit(pass, reason, extension) {
222
244
  const { input, toolName, toolCallId, notifyPermissionDenied } = pass;
223
- const gate = directDeny("hook");
245
+ const gate = directDeny("hook", extension);
224
246
  const finalInput = frozenInputSnapshot(pass.currentInput);
225
247
  await notifyPermissionDenied({ toolName, input: cloneObserverInput(finalInput), toolCallId, reason, gate, ...(input.identity !== undefined ? { identity: input.identity } : {}) });
226
248
  return { block: true, reason: formatHookFeedback(reason, input.reminderMark), gate, finalInput, preToolContext: pass.preToolContext };
@@ -235,12 +257,12 @@ export async function untakenValueExit(pass, untaken) {
235
257
  export async function unownedArgsExit(pass, reason) {
236
258
  return await untakenValueExit(pass, { value: pass.currentInput, message: unownedArgsMessage(`the arguments of "${pass.toolName}"`, reason), deniedBy: "policy" });
237
259
  }
238
- export function hookDenyExit(pass, deniedReason) {
260
+ export function hookDenyExit(pass, deniedReason, extension) {
239
261
  const { input } = pass;
240
262
  return {
241
263
  block: true,
242
264
  reason: formatHookFeedback(deniedReason, input.reminderMark),
243
- gate: directDeny("hook"),
265
+ gate: directDeny("hook", extension),
244
266
  finalInput: frozenInputSnapshot(pass.currentInput),
245
267
  preToolContext: pass.preToolContext,
246
268
  };
@@ -269,7 +291,7 @@ export async function exitGate(pass) {
269
291
  pass.deniedBy = "mode";
270
292
  ledger.supersede();
271
293
  }
272
- const gate = mintGateOutcome({ deniedBy: pass.deniedBy, ...(pass.denyCause !== undefined ? { cause: pass.denyCause } : {}), ...(ledger.settled !== undefined ? { settled: ledger.settled } : {}), ...(pass.classifierRound !== undefined ? { classifier: pass.classifierRound } : {}), ...(modeRefusal !== undefined ? { modeRefusal: { mode: modeRefusal.mode, askClass: modeRefusal.askClass, classes: modeRefusal.classes } } : {}) });
294
+ const gate = mintGateOutcome({ deniedBy: pass.deniedBy, ...(pass.deniedBy === "hook" && pass.deniedExtension !== undefined ? { extension: pass.deniedExtension } : {}), ...(pass.denyCause !== undefined ? { cause: pass.denyCause } : {}), ...(ledger.settled !== undefined ? { settled: ledger.settled } : {}), ...(pass.classifierRound !== undefined ? { classifier: pass.classifierRound } : {}), ...(modeRefusal !== undefined ? { modeRefusal: { mode: modeRefusal.mode, askClass: modeRefusal.askClass, classes: modeRefusal.classes } } : {}) });
273
295
  const foldCause = attestationOf(pass.decision, { toolCallId, toolName })?.unresolvableCause;
274
296
  const unresolvable = foldCause ?? unresolvableCauseOfSettlement(gate);
275
297
  const tableSeat = unresolvable !== undefined ? askUnresolvableRemedySeat(unresolvable) : undefined;
@@ -1,4 +1,4 @@
1
- import type { AgentMessage, ExecutionEnv, GitAnnouncementKind, SessionTreeEntry } from "../../internal/harness-types.js";
1
+ import type { AgentMessage, ExecutionEnv, GitAnnouncementKind, ReadFloor, SessionTreeEntry } from "../../internal/harness-types.js";
2
2
  /** Bound into the hash domain: bump when the frame's wording/structure changes so the upgraded
3
3
  * renderer re-announces on its first leg instead of being suppressed by a pre-upgrade hash. */
4
4
  export declare const GIT_STATUS_FRAME_FORMAT_VERSION = 1;
@@ -155,6 +155,9 @@ export declare function probeGitStatusLane(args: {
155
155
  };
156
156
  handsEnabled: boolean;
157
157
  taskRoot: string;
158
+ /** The byte floor of the run's base read-deny table: the snapshot's lines enter the frame the model reads, so its start
159
+ * carries it (`git config` reads what an `include.path` names). */
160
+ readFloor?: ReadFloor;
158
161
  onDegrade: (reason: string) => void;
159
162
  }): Promise<GitStatusLaneRef>;
160
163
  /**
@@ -189,7 +192,7 @@ export declare function newestEngineGitFrame(branch: SessionTreeEntry[], mark?:
189
192
  entryId: string;
190
193
  positive: boolean;
191
194
  } | undefined;
192
- export declare function stripGitStatusUnits(text: string, mark?: string): string;
195
+ export declare function stripGitStatusUnits(text: string): string;
193
196
  /**
194
197
  * The readable-absence tombstone question (R2-1), answered by the classifier above: does the
195
198
  * branch carry a still-context-visible POSITIVE engine frame as its newest git frame? A newest
@@ -62,7 +62,7 @@ export function resolveGitStatusFrame(outcome, canonicalRoot, degradedMaterial)
62
62
  return resolved;
63
63
  }
64
64
  export async function probeGitStatusLane(args) {
65
- const { executionEnv, envFacts, handsEnabled, taskRoot, onDegrade } = args;
65
+ const { executionEnv, envFacts, handsEnabled, taskRoot, readFloor, onDegrade } = args;
66
66
  const ref = {};
67
67
  if (!handsEnabled)
68
68
  return ref;
@@ -75,7 +75,7 @@ export async function probeGitStatusLane(args) {
75
75
  ...(envFacts.gitDirty !== undefined ? { dirty: envFacts.gitDirty } : {}),
76
76
  };
77
77
  try {
78
- const snap = await executionEnv.exec(`(m=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null); m=\${m#origin/}; for s in "$m" main master; do if [ -n "$s" ] && git show-ref --verify --quiet "refs/remotes/origin/$s"; then echo "$s"; break; fi; done) || true; echo "${SEP}"; (git config user.name 2>/dev/null || true); echo "${SEP}"; gs=$(git --no-optional-locks status --short) || exit 41; printf '%s\\n' "$gs"; echo "${SEP}"; gl=$(git --no-optional-locks log --oneline -n 5) || exit 42; printf '%s\\n' "$gl"`, { cwd: envFacts.cwd, timeout: 10 });
78
+ const snap = await executionEnv.exec(`(m=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null); m=\${m#origin/}; for s in "$m" main master; do if [ -n "$s" ] && git show-ref --verify --quiet "refs/remotes/origin/$s"; then echo "$s"; break; fi; done) || true; echo "${SEP}"; (git config user.name 2>/dev/null || true); echo "${SEP}"; gs=$(git --no-optional-locks status --short) || exit 41; printf '%s\\n' "$gs"; echo "${SEP}"; gl=$(git --no-optional-locks log --oneline -n 5) || exit 42; printf '%s\\n' "$gl"`, { cwd: envFacts.cwd, timeout: 10, ...(readFloor !== undefined ? { readFloor } : {}) });
79
79
  if (snap.ok && snap.value.exitCode === 0) {
80
80
  const parts = snap.value.stdout.split(`${SEP}\n`);
81
81
  if (parts.length === 4) {
@@ -208,8 +208,7 @@ function hasNestedReminderOpenTag(seg) {
208
208
  }
209
209
  return false;
210
210
  }
211
- export function stripGitStatusUnits(text, mark) {
212
- void mark;
211
+ export function stripGitStatusUnits(text) {
213
212
  const close = "</system-reminder>";
214
213
  const findHead = (out, from) => {
215
214
  for (let at = out.indexOf("<system-reminder", from); at !== -1; at = out.indexOf("<system-reminder", at + 1)) {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The run's account of the images a provider refused (`context.image_removed`, user). The harness's request view
3
+ * removes the images a provider refusal points at (`engine/llm/rejected-images.ts`) and hands this seat the removals
4
+ * the run itself met; every request re-reads the transcript — the live failure, then its record or a rebuilt copy —
5
+ * so the seat announces ONCE PER RUN PER REFUSAL, keyed by the identity all of those share (`refusalAt`).
6
+ */
7
+ import { type EngineNotice } from "../engine-notice.js";
8
+ import type { RejectedImageRemoval } from "../../internal/llm.js";
9
+ export declare function createImageRemovedSeat(onNotice: ((notice: EngineNotice) => void) | undefined, ids: {
10
+ sessionId: string;
11
+ runId: string;
12
+ }): (removals: readonly RejectedImageRemoval[]) => void;
@@ -0,0 +1,19 @@
1
+ import { deliverEngineNotice } from "../engine-notice.js";
2
+ export function createImageRemovedSeat(onNotice, ids) {
3
+ const announced = new Set();
4
+ return (removals) => {
5
+ for (const { refusalAt, images } of removals) {
6
+ if (announced.has(refusalAt))
7
+ continue;
8
+ announced.add(refusalAt);
9
+ const one = images === 1;
10
+ deliverEngineNotice(onNotice, {
11
+ code: "context.image_removed",
12
+ message: `The model provider could not process ${one ? "an image" : `${images} images`} in this conversation, so ${one ? "it was" : "they were"} removed ` +
13
+ `from what the model sees (each replaced by a line saying so) and the request was sent again without ${one ? "it" : "them"}. ` +
14
+ `The session still holds the original; to show the model this content again, send it in another format.`,
15
+ detail: { images, sessionId: ids.sessionId, runId: ids.runId },
16
+ });
17
+ }
18
+ };
19
+ }