humanish 0.106.1 → 0.107.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 (453) hide show
  1. package/AGENTS.md +4 -4
  2. package/ARCHITECTURE.md +17 -16
  3. package/CHANGELOG.md +14 -0
  4. package/CONTEXT.md +42 -39
  5. package/CONTRIBUTING.md +8 -8
  6. package/README.md +8 -3
  7. package/dist/actors/codex/app-server-client.js +2 -1
  8. package/dist/actors/codex/app-server-trace.d.ts +0 -1
  9. package/dist/actors/codex/app-server-trace.js +1 -3
  10. package/dist/actors/codex/app-server.js +2 -1
  11. package/dist/actors/codex/protocol-compat.d.ts +27 -0
  12. package/dist/actors/codex/protocol-compat.js +357 -0
  13. package/dist/actors/codex/protocol-contract.d.ts +61 -0
  14. package/dist/actors/codex/protocol-contract.js +471 -0
  15. package/dist/actors/codex/qualified-versions.d.ts +30 -3
  16. package/dist/actors/codex/qualified-versions.js +50 -5
  17. package/dist/actors/codex/restricted-executable.d.ts +24 -0
  18. package/dist/actors/codex/restricted-executable.js +97 -22
  19. package/dist/actors/codex/restricted-launch.d.ts +7 -1
  20. package/dist/actors/codex/restricted-launch.js +42 -3
  21. package/dist/actors/codex/restricted-notifications.d.ts +101 -0
  22. package/dist/actors/codex/restricted-notifications.js +277 -0
  23. package/dist/actors/codex/restricted-participant.d.ts +30 -0
  24. package/dist/actors/codex/restricted-participant.js +60 -2
  25. package/dist/actors/codex/restricted-policy.d.ts +9 -1
  26. package/dist/actors/codex/restricted-session.d.ts +14 -1
  27. package/dist/actors/codex/restricted-session.js +50 -17
  28. package/dist/actors/codex/restricted-transport.d.ts +29 -0
  29. package/dist/actors/codex/restricted-transport.js +139 -27
  30. package/dist/actors/codex/restricted-turn.d.ts +19 -4
  31. package/dist/actors/codex/restricted-turn.js +43 -30
  32. package/dist/actors/computer-use/actor.d.ts +1 -1
  33. package/dist/actors/computer-use/actor.js +4 -4
  34. package/dist/actors/computer-use/loop/backstop.js +1 -1
  35. package/dist/actors/computer-use/loop/ending.d.ts +2 -2
  36. package/dist/actors/computer-use/loop/ending.js +2 -2
  37. package/dist/actors/computer-use/loop/spend.d.ts +1 -1
  38. package/dist/actors/computer-use/loop/spend.js +3 -3
  39. package/dist/actors/computer-use/loop/trace.js +2 -2
  40. package/dist/actors/computer-use/loop/types.d.ts +14 -5
  41. package/dist/actors/computer-use/loop.js +4 -4
  42. package/dist/actors/computer-use/openai-provider.d.ts +1 -1
  43. package/dist/actors/computer-use/openai-provider.js +2 -2
  44. package/dist/actors/contract.d.ts +9 -7
  45. package/dist/actors/local-agent/cli.js +1 -1
  46. package/dist/actors/scripted-browser/actor.d.ts +2 -2
  47. package/dist/actors/scripted-browser/journey.js +15 -4
  48. package/dist/actors/scripted-browser/steps.js +18 -0
  49. package/dist/actors/scripted-browser/types.d.ts +11 -1
  50. package/dist/actors/stop-conditions.js +1 -3
  51. package/dist/analysis/automatic-completion.d.ts +13 -8
  52. package/dist/analysis/automatic-completion.js +14 -8
  53. package/dist/analysis/automatic-config.d.ts +1 -1
  54. package/dist/analysis/automatic-config.js +2 -2
  55. package/dist/analysis/automatic.d.ts +10 -4
  56. package/dist/analysis/automatic.js +17 -13
  57. package/dist/analysis/diagnostics.d.ts +23 -0
  58. package/dist/analysis/diagnostics.js +112 -0
  59. package/dist/analysis/evidence-sources.js +2 -2
  60. package/dist/analysis/evidence.js +6 -6
  61. package/dist/analysis/execute.d.ts +7 -1
  62. package/dist/analysis/execute.js +39 -12
  63. package/dist/analysis/job.d.ts +8 -5
  64. package/dist/analysis/job.js +15 -14
  65. package/dist/analysis/load.d.ts +1 -1
  66. package/dist/analysis/load.js +5 -5
  67. package/dist/analysis/provider.d.ts +9 -1
  68. package/dist/analysis/restricted-codex.d.ts +2 -0
  69. package/dist/analysis/restricted-codex.js +10 -1
  70. package/dist/analysis/service.d.ts +2 -0
  71. package/dist/analysis/service.js +31 -12
  72. package/dist/analysis/sharing.d.ts +2 -2
  73. package/dist/analysis/sharing.js +5 -5
  74. package/dist/analysis/store-executions.d.ts +5 -5
  75. package/dist/analysis/store-executions.js +12 -12
  76. package/dist/analysis/store.d.ts +4 -4
  77. package/dist/analysis/store.js +13 -13
  78. package/dist/cli/commands/analysis-signals.d.ts +2 -1
  79. package/dist/cli/commands/analysis-signals.js +4 -1
  80. package/dist/cli/commands/analyze.js +4 -2
  81. package/dist/cli/commands/comms.js +8 -1
  82. package/dist/cli/commands/lab-route-computer-use.d.ts +0 -2
  83. package/dist/cli/commands/lab-route-computer-use.js +26 -14
  84. package/dist/cli/commands/lab-route-preview.d.ts +1 -3
  85. package/dist/cli/commands/lab-route-preview.js +3 -4
  86. package/dist/cli/commands/lab-route-run.d.ts +6 -4
  87. package/dist/cli/commands/lab-route-run.js +6 -2
  88. package/dist/cli/commands/lab-route-scripted.d.ts +0 -2
  89. package/dist/cli/commands/lab-route-scripted.js +0 -1
  90. package/dist/cli/commands/lab-route-shared-world.d.ts +0 -2
  91. package/dist/cli/commands/lab-route-shared-world.js +0 -1
  92. package/dist/cli/commands/lab-route-terminal.d.ts +0 -2
  93. package/dist/cli/commands/lab-route-terminal.js +0 -1
  94. package/dist/cli/commands/lab-run.js +76 -45
  95. package/dist/cli/commands/lab-scorer.d.ts +0 -2
  96. package/dist/cli/commands/lab.js +12 -6
  97. package/dist/cli/commands/observe.js +22 -0
  98. package/dist/cli/commands/run-signals.d.ts +30 -0
  99. package/dist/cli/commands/run-signals.js +146 -0
  100. package/dist/cli/commands/runs.js +10 -8
  101. package/dist/cli/commands/watch.js +12 -10
  102. package/dist/cli/doctor.d.ts +3 -0
  103. package/dist/cli/doctor.js +10 -2
  104. package/dist/cli/io.d.ts +5 -4
  105. package/dist/cli/io.js +12 -8
  106. package/dist/cli/program.js +3 -3
  107. package/dist/cli/renamed-options.d.ts +11 -0
  108. package/dist/cli/renamed-options.js +18 -0
  109. package/dist/cli/telemetry.d.ts +2 -2
  110. package/dist/cli/telemetry.js +1 -1
  111. package/dist/comms/capture-surface.d.ts +1 -1
  112. package/dist/comms/catch-host.d.ts +1 -1
  113. package/dist/comms/connections.js +4 -4
  114. package/dist/comms/external-evidence.d.ts +27 -0
  115. package/dist/comms/external-evidence.js +93 -0
  116. package/dist/comms/lease-store.js +7 -7
  117. package/dist/comms/types.js +1 -1
  118. package/dist/evidence/browser-hygiene.d.ts +1 -1
  119. package/dist/evidence/browser-hygiene.js +1 -1
  120. package/dist/evidence/redaction.js +1 -1
  121. package/dist/evidence/secret-scrub.d.ts +9 -0
  122. package/dist/evidence/secret-scrub.js +96 -0
  123. package/dist/feedback/draft.js +7 -9
  124. package/dist/feedback/export-bundle.js +4 -4
  125. package/dist/feedback/export.js +9 -9
  126. package/dist/feedback/feedback.d.ts +1 -1
  127. package/dist/index.d.ts +3 -6
  128. package/dist/index.js +3 -6
  129. package/dist/keys/key-resolution.d.ts +3 -1
  130. package/dist/keys/key-resolution.js +18 -16
  131. package/dist/lab/adapter-extension.d.ts +28 -6
  132. package/dist/lab/adapter-extension.js +65 -126
  133. package/dist/lab/adapter-scorer-loader.d.ts +25 -5
  134. package/dist/lab/adapter-scorer-loader.js +24 -0
  135. package/dist/lab/composition-rules.js +20 -20
  136. package/dist/lab/config.js +28 -26
  137. package/dist/lab/device-presets.d.ts +2 -2
  138. package/dist/lab/discover.js +1 -3
  139. package/dist/lab/doctor.d.ts +44 -9
  140. package/dist/lab/doctor.js +149 -41
  141. package/dist/lab/init-plan.js +1 -3
  142. package/dist/lab/keys.js +1 -1
  143. package/dist/lab/lab-deps.d.ts +85 -0
  144. package/dist/lab/lab-deps.js +4 -0
  145. package/dist/lab/parse/actors.js +8 -7
  146. package/dist/lab/parse/comms.js +3 -2
  147. package/dist/lab/parse/execution.js +3 -2
  148. package/dist/lab/parse/subject-state.js +2 -1
  149. package/dist/lab/parse/subject.js +2 -1
  150. package/dist/lab/parse/values.d.ts +0 -1
  151. package/dist/lab/parse/values.js +0 -3
  152. package/dist/lab/persona-resolve.d.ts +3 -3
  153. package/dist/lab/persona-resolve.js +4 -4
  154. package/dist/lab/persona.js +1 -3
  155. package/dist/lab/plan-base.d.ts +0 -2
  156. package/dist/lab/plan-base.js +6 -4
  157. package/dist/lab/plan-participants.d.ts +5 -5
  158. package/dist/lab/plan-participants.js +2 -2
  159. package/dist/lab/plan-types.d.ts +22 -4
  160. package/dist/lab/plan.d.ts +3 -11
  161. package/dist/lab/plan.js +18 -42
  162. package/dist/lab/preflight-result.js +0 -2
  163. package/dist/lab/preflight.d.ts +0 -3
  164. package/dist/lab/preflight.js +1 -1
  165. package/dist/lab/requirements.d.ts +20 -0
  166. package/dist/lab/requirements.js +54 -0
  167. package/dist/lab/route-inputs.d.ts +23 -12
  168. package/dist/lab/route-inputs.js +48 -51
  169. package/dist/lab/routing.d.ts +19 -24
  170. package/dist/lab/routing.js +14 -47
  171. package/dist/lab/run-lab-events.d.ts +6 -11
  172. package/dist/lab/run-lab-events.js +3 -11
  173. package/dist/lab/run-lab-homes.d.ts +64 -0
  174. package/dist/lab/run-lab-homes.js +3 -0
  175. package/dist/lab/run-lab-options.d.ts +12 -66
  176. package/dist/lab/run-lab-options.js +45 -275
  177. package/dist/lab/summary.d.ts +9 -4
  178. package/dist/lab/summary.js +15 -8
  179. package/dist/lab/types.d.ts +132 -132
  180. package/dist/lab/validation.d.ts +15 -15
  181. package/dist/lab/validation.js +28 -28
  182. package/dist/lab/warnings.js +20 -19
  183. package/dist/observer/artifact.d.ts +1 -1
  184. package/dist/observer/artifact.js +3 -3
  185. package/dist/observer/data.js +2 -2
  186. package/dist/observer/render.js +2 -2
  187. package/dist/observer/run-routes.d.ts +1 -1
  188. package/dist/observer/run-routes.js +5 -5
  189. package/dist/observer/serve.d.ts +17 -0
  190. package/dist/observer/serve.js +34 -3
  191. package/dist/routes/computer-use/bundle-parts.d.ts +1 -1
  192. package/dist/routes/computer-use/bundle-parts.js +10 -3
  193. package/dist/routes/computer-use/bundle.d.ts +4 -11
  194. package/dist/routes/computer-use/bundle.js +9 -15
  195. package/dist/routes/computer-use/diagnostics.d.ts +1 -1
  196. package/dist/routes/computer-use/diagnostics.js +1 -1
  197. package/dist/routes/computer-use/e2b-desktop/comms.d.ts +10 -10
  198. package/dist/routes/computer-use/e2b-desktop/comms.js +11 -14
  199. package/dist/routes/computer-use/e2b-desktop/desktop.d.ts +2 -2
  200. package/dist/routes/computer-use/e2b-desktop/desktop.js +4 -7
  201. package/dist/routes/computer-use/e2b-desktop/fidelity.d.ts +13 -13
  202. package/dist/routes/computer-use/e2b-desktop/fidelity.js +11 -11
  203. package/dist/routes/computer-use/e2b-desktop/prepare.d.ts +3 -3
  204. package/dist/routes/computer-use/e2b-desktop/prepare.js +33 -36
  205. package/dist/routes/computer-use/e2b-desktop/start.d.ts +1 -1
  206. package/dist/routes/computer-use/e2b-desktop/start.js +24 -23
  207. package/dist/routes/computer-use/e2b-desktop/state.d.ts +5 -4
  208. package/dist/routes/computer-use/e2b-desktop/state.js +5 -3
  209. package/dist/routes/computer-use/e2b-desktop/teardown.d.ts +1 -1
  210. package/dist/routes/computer-use/e2b-desktop/teardown.js +29 -17
  211. package/dist/routes/computer-use/external-comms.d.ts +4 -4
  212. package/dist/routes/computer-use/external-comms.js +19 -43
  213. package/dist/routes/computer-use/fanout-bundle.d.ts +3 -3
  214. package/dist/routes/computer-use/fanout-bundle.js +25 -29
  215. package/dist/routes/computer-use/{fanout-lanes.js → fanout-records.js} +25 -19
  216. package/dist/routes/computer-use/in-process-desktop.d.ts +3 -10
  217. package/dist/routes/computer-use/in-process-desktop.js +3 -9
  218. package/dist/routes/computer-use/live-flush.d.ts +7 -5
  219. package/dist/routes/computer-use/live-flush.js +19 -27
  220. package/dist/routes/computer-use/{run-lanes.js → live-phase.js} +12 -11
  221. package/dist/routes/computer-use/local-tree-pack.d.ts +3 -3
  222. package/dist/routes/computer-use/local-tree-pack.js +4 -5
  223. package/dist/routes/computer-use/local-vm.d.ts +11 -8
  224. package/dist/routes/computer-use/local-vm.js +39 -66
  225. package/dist/routes/computer-use/participant-desktop.d.ts +8 -23
  226. package/dist/routes/computer-use/participant-desktop.js +5 -25
  227. package/dist/routes/computer-use/{lanes.d.ts → participant-execution.d.ts} +10 -10
  228. package/dist/routes/computer-use/{lanes.js → participant-execution.js} +35 -22
  229. package/dist/routes/computer-use/participant-facts.d.ts +7 -1
  230. package/dist/routes/computer-use/participant-facts.js +12 -1
  231. package/dist/routes/computer-use/participant-model.d.ts +19 -11
  232. package/dist/routes/computer-use/participant-model.js +49 -25
  233. package/dist/routes/computer-use/participant-prompt.d.ts +3 -3
  234. package/dist/routes/computer-use/participant-prompt.js +4 -4
  235. package/dist/routes/computer-use/participant-runs.d.ts +6 -6
  236. package/dist/routes/computer-use/participant-runs.js +8 -8
  237. package/dist/routes/computer-use/plan.d.ts +21 -29
  238. package/dist/routes/computer-use/plan.js +52 -60
  239. package/dist/routes/computer-use/preflight.d.ts +3 -5
  240. package/dist/routes/computer-use/preflight.js +20 -16
  241. package/dist/routes/computer-use/rerun-selection.js +10 -6
  242. package/dist/routes/computer-use/result.d.ts +1 -1
  243. package/dist/routes/computer-use/result.js +40 -30
  244. package/dist/routes/computer-use/route.d.ts +3 -4
  245. package/dist/routes/computer-use/route.js +21 -19
  246. package/dist/routes/computer-use/self-report.d.ts +2 -2
  247. package/dist/routes/computer-use/self-report.js +4 -4
  248. package/dist/routes/computer-use/setup.d.ts +8 -14
  249. package/dist/routes/computer-use/setup.js +96 -72
  250. package/dist/routes/computer-use/single-bundle.d.ts +8 -11
  251. package/dist/routes/computer-use/single-bundle.js +20 -25
  252. package/dist/routes/computer-use/subject-projection.d.ts +5 -7
  253. package/dist/routes/computer-use/subject-projection.js +20 -19
  254. package/dist/routes/computer-use/types.d.ts +169 -210
  255. package/dist/routes/computer-use/types.js +13 -5
  256. package/dist/routes/preview.js +0 -1
  257. package/dist/routes/scripted/bundle.d.ts +3 -6
  258. package/dist/routes/scripted/bundle.js +11 -16
  259. package/dist/routes/scripted/plan.d.ts +5 -7
  260. package/dist/routes/scripted/plan.js +6 -4
  261. package/dist/routes/scripted/result.d.ts +4 -1
  262. package/dist/routes/scripted/result.js +10 -6
  263. package/dist/routes/scripted/route.js +10 -11
  264. package/dist/routes/scripted/scenario.d.ts +1 -1
  265. package/dist/routes/scripted/scenario.js +1 -1
  266. package/dist/routes/scripted/setup.d.ts +3 -2
  267. package/dist/routes/scripted/setup.js +22 -21
  268. package/dist/routes/scripted/subject.d.ts +8 -3
  269. package/dist/routes/scripted/subject.js +9 -5
  270. package/dist/routes/scripted/surface-records.js +1 -1
  271. package/dist/routes/scripted/surface-sessions.d.ts +2 -2
  272. package/dist/routes/scripted/surface-sessions.js +4 -4
  273. package/dist/routes/scripted/types.d.ts +19 -36
  274. package/dist/routes/scripted/types.js +1 -2
  275. package/dist/routes/shared-world/{seat-records.js → bundle-records.js} +8 -8
  276. package/dist/routes/shared-world/bundle.d.ts +2 -2
  277. package/dist/routes/shared-world/bundle.js +22 -26
  278. package/dist/routes/shared-world/checkpoints.d.ts +4 -4
  279. package/dist/routes/shared-world/checkpoints.js +4 -4
  280. package/dist/routes/shared-world/comms.d.ts +5 -4
  281. package/dist/routes/shared-world/comms.js +28 -41
  282. package/dist/routes/shared-world/external-public.d.ts +5 -5
  283. package/dist/routes/shared-world/external-public.js +19 -20
  284. package/dist/routes/shared-world/handoff.d.ts +4 -4
  285. package/dist/routes/shared-world/handoff.js +50 -50
  286. package/dist/routes/shared-world/lobby-code.d.ts +5 -5
  287. package/dist/routes/shared-world/lobby-code.js +13 -13
  288. package/dist/routes/shared-world/{seats.d.ts → participant-specs.d.ts} +8 -6
  289. package/dist/routes/shared-world/{seats.js → participant-specs.js} +43 -48
  290. package/dist/routes/shared-world/plan.d.ts +2 -6
  291. package/dist/routes/shared-world/plan.js +1 -2
  292. package/dist/routes/shared-world/provenance.d.ts +4 -4
  293. package/dist/routes/shared-world/provenance.js +4 -4
  294. package/dist/routes/shared-world/provisioned.d.ts +3 -2
  295. package/dist/routes/shared-world/provisioned.js +46 -40
  296. package/dist/routes/shared-world/result.js +31 -19
  297. package/dist/routes/shared-world/route.js +37 -41
  298. package/dist/routes/shared-world/setup.d.ts +5 -4
  299. package/dist/routes/shared-world/setup.js +12 -14
  300. package/dist/routes/shared-world/types.d.ts +53 -126
  301. package/dist/routes/shared-world/types.js +2 -2
  302. package/dist/routes/terminal/adapter.d.ts +8 -8
  303. package/dist/routes/terminal/adapter.js +28 -125
  304. package/dist/routes/terminal/bundle.d.ts +7 -12
  305. package/dist/routes/terminal/bundle.js +24 -34
  306. package/dist/routes/terminal/credentials.d.ts +2 -2
  307. package/dist/routes/terminal/credentials.js +16 -16
  308. package/dist/routes/terminal/dry-run.d.ts +1 -1
  309. package/dist/routes/terminal/dry-run.js +9 -11
  310. package/dist/routes/terminal/encoding.d.ts +1 -1
  311. package/dist/routes/terminal/encoding.js +2 -2
  312. package/dist/routes/terminal/ledger.d.ts +6 -6
  313. package/dist/routes/terminal/ledger.js +9 -9
  314. package/dist/routes/terminal/live-finish.d.ts +1 -2
  315. package/dist/routes/terminal/live-finish.js +21 -20
  316. package/dist/routes/terminal/live-sandbox.d.ts +3 -2
  317. package/dist/routes/terminal/live-sandbox.js +20 -20
  318. package/dist/routes/terminal/participant-text.d.ts +23 -0
  319. package/dist/routes/terminal/participant-text.js +165 -0
  320. package/dist/routes/terminal/plan.d.ts +2 -6
  321. package/dist/routes/terminal/plan.js +13 -9
  322. package/dist/routes/terminal/recorder.d.ts +6 -1
  323. package/dist/routes/terminal/recorder.js +12 -4
  324. package/dist/routes/terminal/result.js +4 -4
  325. package/dist/routes/terminal/route.js +26 -26
  326. package/dist/routes/terminal/runtime.d.ts +3 -2
  327. package/dist/routes/terminal/runtime.js +3 -3
  328. package/dist/routes/terminal/sandbox.d.ts +3 -3
  329. package/dist/routes/terminal/sandbox.js +9 -9
  330. package/dist/routes/terminal/session.js +16 -14
  331. package/dist/routes/terminal/token-usage.js +5 -5
  332. package/dist/routes/terminal/trace.d.ts +5 -8
  333. package/dist/routes/terminal/trace.js +9 -64
  334. package/dist/routes/terminal/types.d.ts +85 -93
  335. package/dist/routes/terminal/types.js +9 -4
  336. package/dist/run/active-runs.d.ts +13 -0
  337. package/dist/run/active-runs.js +12 -0
  338. package/dist/run/bundle-shape.d.ts +2 -1
  339. package/dist/run/bundle-shape.js +4 -4
  340. package/dist/run/bundle.d.ts +63 -56
  341. package/dist/run/bundle.js +9 -8
  342. package/dist/run/cost-summary.js +3 -2
  343. package/dist/run/costs.d.ts +6 -6
  344. package/dist/run/costs.js +10 -10
  345. package/dist/run/detail.d.ts +5 -5
  346. package/dist/run/detail.js +6 -6
  347. package/dist/run/dry-run.js +5 -12
  348. package/dist/run/{study-files.d.ts → evidence-files.d.ts} +4 -4
  349. package/dist/run/{study-files.js → evidence-files.js} +5 -5
  350. package/dist/run/feedback-shape.js +1 -1
  351. package/dist/run/judge.d.ts +16 -4
  352. package/dist/run/judge.js +24 -7
  353. package/dist/run/locate.d.ts +2 -0
  354. package/dist/run/locate.js +3 -1
  355. package/dist/run/outcomes.d.ts +3 -3
  356. package/dist/run/outcomes.js +3 -3
  357. package/dist/run/participant-records.d.ts +2 -2
  358. package/dist/run/participant-records.js +2 -2
  359. package/dist/run/paths.js +1 -1
  360. package/dist/run/pricing.d.ts +19 -9
  361. package/dist/run/pricing.js +30 -18
  362. package/dist/run/projection.d.ts +13 -13
  363. package/dist/run/projection.js +8 -8
  364. package/dist/run/reclaim.d.ts +6 -0
  365. package/dist/run/reclaim.js +13 -3
  366. package/dist/run/results.d.ts +1 -1
  367. package/dist/run/run-index.d.ts +1 -1
  368. package/dist/run/run-index.js +11 -11
  369. package/dist/run/run.d.ts +4 -2
  370. package/dist/run/run.js +9 -5
  371. package/dist/run/sandbox-receipts.d.ts +4 -4
  372. package/dist/run/sandbox-receipts.js +4 -4
  373. package/dist/run/shared-world-evidence.d.ts +47 -47
  374. package/dist/run/shared-world-shape.d.ts +3 -3
  375. package/dist/run/shared-world-shape.js +11 -11
  376. package/dist/run/stats.d.ts +5 -5
  377. package/dist/run/stats.js +8 -8
  378. package/dist/run/status.d.ts +16 -6
  379. package/dist/run/status.js +31 -8
  380. package/dist/run/streams.d.ts +26 -19
  381. package/dist/run/terminal-contract.d.ts +5 -5
  382. package/dist/run/terminal-contract.js +4 -4
  383. package/dist/run/transient-comms-secrets.d.ts +5 -0
  384. package/dist/run/transient-comms-secrets.js +12 -0
  385. package/dist/run-lab.d.ts +36 -34
  386. package/dist/run-lab.js +41 -37
  387. package/dist/subject/desktop-cli.d.ts +1 -1
  388. package/dist/subject/desktop-cli.js +1 -1
  389. package/dist/subject/local-tree-archive.d.ts +1 -1
  390. package/dist/subject/local-tree-archive.js +4 -4
  391. package/dist/subject/local-tree.d.ts +2 -2
  392. package/dist/subject/local-tree.js +1 -1
  393. package/dist/subject/node-bootstrap.d.ts +1 -1
  394. package/dist/subject/node-bootstrap.js +4 -4
  395. package/dist/subject/runtime.js +5 -5
  396. package/dist/subject/serve.js +1 -1
  397. package/dist/subject/steps.d.ts +4 -4
  398. package/dist/subject/steps.js +5 -5
  399. package/dist/substrates/e2b/cdp-probe.d.ts +2 -2
  400. package/dist/substrates/e2b/cdp-probe.js +1 -1
  401. package/dist/substrates/e2b/desktop-browser.d.ts +3 -3
  402. package/dist/substrates/e2b/desktop-browser.js +4 -4
  403. package/dist/substrates/e2b/desktop-cdp.d.ts +7 -7
  404. package/dist/substrates/e2b/desktop-cdp.js +4 -4
  405. package/dist/substrates/e2b/desktop-geometry.d.ts +4 -4
  406. package/dist/substrates/e2b/desktop-geometry.js +3 -3
  407. package/dist/substrates/e2b/desktop-media.js +2 -2
  408. package/dist/substrates/e2b/sandbox.js +1 -1
  409. package/dist/substrates/e2b/sdk.js +2 -2
  410. package/dist/substrates/local/runtime-host.d.ts +2 -0
  411. package/dist/substrates/local/runtime-host.js +6 -0
  412. package/dist/tui/actions.d.ts +7 -5
  413. package/dist/tui/actions.js +18 -9
  414. package/dist/tui-app.js +42 -42
  415. package/dist/verify/actor.d.ts +10 -10
  416. package/dist/verify/actor.js +15 -15
  417. package/dist/verify/artifacts.d.ts +1 -1
  418. package/dist/verify/artifacts.js +3 -3
  419. package/dist/verify/costs.d.ts +2 -2
  420. package/dist/verify/costs.js +2 -2
  421. package/dist/verify/liveness.d.ts +1 -1
  422. package/dist/verify/liveness.js +4 -1
  423. package/dist/verify/rerun.d.ts +1 -1
  424. package/dist/verify/rerun.js +1 -1
  425. package/dist/verify/shared-world.js +2 -2
  426. package/dist/verify/verify.js +6 -6
  427. package/docs/README.md +1 -1
  428. package/docs/architecture/actor-contract.md +60 -22
  429. package/docs/architecture/desktop-sessions.md +9 -9
  430. package/docs/architecture/external-public-shared-world.md +5 -0
  431. package/docs/architecture/observer.md +4 -4
  432. package/docs/architecture/restricted-codex-analysis.md +36 -2
  433. package/docs/architecture/state-driven-executor.md +4 -5
  434. package/docs/architecture/task-protocol-support.md +3 -5
  435. package/docs/architecture/{terminal-product-lane.md → terminal-product-route.md} +24 -16
  436. package/docs/contracts/run-bundle.md +10 -8
  437. package/docs/contracts/schemas.md +109 -53
  438. package/docs/contracts/study-analysis.md +24 -0
  439. package/docs/decisions/0004-participant-desktops-stay-in-the-route.md +2 -1
  440. package/docs/product/automatic-analysis.md +1 -0
  441. package/docs/ramp/README.md +2 -1
  442. package/package.json +4 -4
  443. package/skills/humanish/SKILL.md +3 -2
  444. package/skills/humanish/agents/openai.yaml +1 -1
  445. package/dist/deprecated.d.ts +0 -90
  446. package/dist/deprecated.js +0 -106
  447. package/dist/lab/bag-overrides.d.ts +0 -18
  448. package/dist/lab/bag-overrides.js +0 -121
  449. package/dist/routes/computer-use/legacy-lane-spec.d.ts +0 -62
  450. package/dist/routes/computer-use/legacy-lane-spec.js +0 -39
  451. /package/dist/routes/computer-use/{fanout-lanes.d.ts → fanout-records.d.ts} +0 -0
  452. /package/dist/routes/computer-use/{run-lanes.d.ts → live-phase.d.ts} +0 -0
  453. /package/dist/routes/shared-world/{seat-records.d.ts → bundle-records.d.ts} +0 -0
@@ -4,12 +4,12 @@ import { isNonNegativeSafeInteger, isRecord } from "./type-guards.js";
4
4
  // The promptDigest convention: sha256 hex, first 16 chars. A "seeded" record without a real
5
5
  // digest cannot pin "same recipe" across bundles, so verify treats it as a hollow claim.
6
6
  export const COMMAND_DIGEST_PATTERN = /^[0-9a-f]{16}$/;
7
- // Env var NAME shape (mirrors ENV_NAME_PATTERN in src/lab/parse/values.ts). externalEnvNames
8
- // must hold NAMES only — a value sneaking into the list trips this check (a free secret tripwire).
7
+ // Env var name shape (mirrors ENV_NAME_PATTERN in src/lab/parse/values.ts). externalEnvNames
8
+ // must hold names only: a value sneaking into the list trips this check (a free secret tripwire).
9
9
  export const SUBJECT_ENV_NAME_PATTERN = /^[A-Z][A-Z0-9_]*$/;
10
- // SEQUENTIAL: the three disclosures a sequential shared-world bundle MUST pin (verify fails closed
10
+ // Sequential: the three disclosures a sequential shared-world bundle must pin (verify fails closed
11
11
  // if any is absent — omission overclaims): sequential turns only, no concurrency/races handled, and
12
- // a checkpoint delta is attributed to the TURN it followed, not a specific action (correlation).
12
+ // a checkpoint delta is attributed to the turn it followed, never a specific action (correlation).
13
13
  export const MANDATORY_ATTRIBUTION_LIMITS = [
14
14
  "sequential-only",
15
15
  "no-concurrent-races",
@@ -17,11 +17,11 @@ export const MANDATORY_ATTRIBUTION_LIMITS = [
17
17
  ];
18
18
  // A shared-world checkpoint record persists DIGEST-ONLY: exactly these keys, nothing value-shaped.
19
19
  export const SHARED_WORLD_CHECKPOINT_KEYS = new Set(["kind", "name", "digest", "deltaFromPrev"]);
20
- // CONCURRENT stateSeries record is DIGEST-ONLY too (FIX-7): permit ONLY a numeric timestamp + the
20
+ // A concurrent stateSeries record is digest-only too: it permits a numeric timestamp + the
21
21
  // sha256-16 digest; any other key is a value-shaped leak / a smuggled per-delta→actor field.
22
22
  export const SHARED_WORLD_STATESERIES_KEYS = new Set(["timestamp", "digest"]);
23
23
  /**
24
- * Single-plane provenance: every item shares ONE (commit, seedDigest), and that pair matches
24
+ * Single-plane provenance: every item shares one (commit, seedDigest), and that pair matches
25
25
  * sharedWorld.plane. Only the first item that diverges from the plane is reported. The shape guard
26
26
  * has already typed both fields as strings (commit may be absent).
27
27
  */
@@ -62,7 +62,7 @@ export function sharedWorldCommonFindings(bundle, sw) {
62
62
  if (isRecord(plane) && Array.isArray(plane.envNames)) {
63
63
  for (const name of plane.envNames) {
64
64
  if (typeof name !== "string" || !SUBJECT_ENV_NAME_PATTERN.test(name)) {
65
- // Does NOT echo the entry: a malformed entry may BE a value.
65
+ // Never echoes the entry: a malformed entry may be a value.
66
66
  findings.push("sharedWorld.plane.envNames carries an entry that is not an env var NAME shape (values must never appear in evidence)");
67
67
  }
68
68
  }
@@ -70,8 +70,8 @@ export function sharedWorldCommonFindings(bundle, sw) {
70
70
  return findings;
71
71
  }
72
72
  /**
73
- * Tolerant SHAPE guard for the shared-world evidence block (#164). Validates required fields +
74
- * types but TOLERATES extra keys (additive): the strict value-shape/timeline checks are
73
+ * Tolerant shape guard for the shared-world evidence block (#164). Validates required fields +
74
+ * types and tolerates extra keys (additive): the strict value-shape/timeline checks are
75
75
  * sharedWorldEvidenceFindings' job (an injected value-shaped checkpoint field must pass the shape
76
76
  * guard so verify can catch it fail-closed, not silently bounce off isRunBundle).
77
77
  */
@@ -109,7 +109,7 @@ export function isSharedWorldEvidence(value) {
109
109
  if (!(Array.isArray(value.attributionLimits) &&
110
110
  value.attributionLimits.every((limit) => typeof limit === "string")))
111
111
  return false;
112
- // Tolerant: validate the TYPE of each present field only (the coherence + topologyMode dispatch
112
+ // Tolerant: validate the type of each present field only (the coherence + topologyMode dispatch
113
113
  // are the job of sharedWorldEvidenceFindings — an injected value-shaped field must pass this
114
114
  // guard so verify catches it fail-closed). A bundle must carry at least one of the two shapes.
115
115
  if (value.sequence !== undefined &&
@@ -148,7 +148,7 @@ function isSharedWorldTimelineEntry(value) {
148
148
  }
149
149
  return false;
150
150
  }
151
- // Tolerant shape guards for the CONCURRENT series (extra keys tolerated — the digest-only /
151
+ // Tolerant shape guards for the concurrent series (extra keys tolerated; the digest-only /
152
152
  // allowed-keys tripwires are the strict job of sharedWorldEvidenceFindings).
153
153
  function isSharedWorldLaneWindow(value) {
154
154
  return (isRecord(value) &&
@@ -1,4 +1,4 @@
1
- import { type StudyCosts, type StudyCostRow } from "./costs.js";
1
+ import { type CostTotals, type CostRow } from "./costs.js";
2
2
  declare const STATS_SCHEMA = "humanish.stats.v1";
3
3
  interface StatsParticipants {
4
4
  total: number;
@@ -24,7 +24,7 @@ interface StatsLabRow {
24
24
  /** Runs with no estimate: a subscription brain, an interrupted run, an old bundle. Never zero. */
25
25
  unpricedRuns: number;
26
26
  participants: StatsParticipants;
27
- costs: StudyCosts;
27
+ costs: CostTotals;
28
28
  }
29
29
  interface StatsDayRow {
30
30
  day: string;
@@ -33,7 +33,7 @@ interface StatsDayRow {
33
33
  /** Participant and desktop subtotal; `costs` also includes retained analysis. */
34
34
  estimatedSpendUsd: number;
35
35
  unpricedRuns: number;
36
- costs: StudyCosts;
36
+ costs: CostTotals;
37
37
  }
38
38
  export interface StatsResult {
39
39
  schema: typeof STATS_SCHEMA;
@@ -51,12 +51,12 @@ export interface StatsResult {
51
51
  unpricedRuns: number;
52
52
  participants: StatsParticipants;
53
53
  verdicts: Record<string, number>;
54
- costs: StudyCosts;
54
+ costs: CostTotals;
55
55
  };
56
56
  labs: StatsLabRow[];
57
57
  days: StatsDayRow[];
58
58
  /** Same selected runs; individual accounting gaps are inspectable without reading private evidence. */
59
- costsByRun: StudyCostRow[];
59
+ costsByRun: CostRow[];
60
60
  /** Directories that could not be read, by name — surfaced, never silently dropped. */
61
61
  unreadable: string[];
62
62
  note: string;
package/dist/run/stats.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // counts as unknown and never as zero, and every rate has a denominator next to it.
4
4
  import path from "node:path";
5
5
  import { readRunIndex } from "./run-index.js";
6
- import { addStudyCosts, emptyStudyCosts, readStudyCosts, } from "./costs.js";
6
+ import { addCostTotals, emptyCostTotals, readCostTotals, } from "./costs.js";
7
7
  import { round6 } from "./pricing.js";
8
8
  const STATS_SCHEMA = "humanish.stats.v1";
9
9
  const STATS_NOTE = "Every dollar figure is a retained rate-table estimate, never a provider charge. " +
@@ -47,7 +47,7 @@ function addToLabRow(labs, entry, priced, costs) {
47
47
  unpricedRuns: 0,
48
48
  participants: emptyParticipants(),
49
49
  durations: [],
50
- costs: emptyStudyCosts(),
50
+ costs: emptyCostTotals(),
51
51
  runCosts: [],
52
52
  };
53
53
  labs.set(labId, row);
@@ -69,7 +69,7 @@ function addToLabRow(labs, entry, priced, costs) {
69
69
  else
70
70
  row.unpricedRuns += 1;
71
71
  addParticipants(row.participants, entry);
72
- addStudyCosts(row.costs, costs);
72
+ addCostTotals(row.costs, costs);
73
73
  }
74
74
  function addToDayRow(days, entry, priced, costs) {
75
75
  const at = entryTime(entry);
@@ -82,7 +82,7 @@ function addToDayRow(days, entry, priced, costs) {
82
82
  live: 0,
83
83
  estimatedSpendUsd: 0,
84
84
  unpricedRuns: 0,
85
- costs: emptyStudyCosts(),
85
+ costs: emptyCostTotals(),
86
86
  };
87
87
  days.set(day, dayRow);
88
88
  }
@@ -93,7 +93,7 @@ function addToDayRow(days, entry, priced, costs) {
93
93
  dayRow.estimatedSpendUsd += entry.estimatedCostUsd;
94
94
  else
95
95
  dayRow.unpricedRuns += 1;
96
- addStudyCosts(dayRow.costs, costs);
96
+ addCostTotals(dayRow.costs, costs);
97
97
  }
98
98
  export async function computeStats(cwdInput, options = {}) {
99
99
  const cwd = path.resolve(cwdInput);
@@ -148,15 +148,15 @@ export async function computeStats(cwdInput, options = {}) {
148
148
  unpricedRuns: 0,
149
149
  participants: emptyParticipants(),
150
150
  verdicts: {},
151
- costs: emptyStudyCosts(),
151
+ costs: emptyCostTotals(),
152
152
  };
153
153
  const labs = new Map();
154
154
  const days = new Map();
155
155
  const costsByRun = [];
156
156
  for (const entry of selected) {
157
- const accounting = await readStudyCosts(cwd, entry);
157
+ const accounting = await readCostTotals(cwd, entry);
158
158
  costsByRun.push(accounting);
159
- addStudyCosts(totals.costs, accounting.costs);
159
+ addCostTotals(totals.costs, accounting.costs);
160
160
  totals.runs += 1;
161
161
  if (entry.mode === "live")
162
162
  totals.live += 1;
@@ -7,7 +7,7 @@ export declare const RUN_STATUS_FILE = "status.json";
7
7
  /** How often a live run touches `updatedAt`. */
8
8
  export declare const RUN_STATUS_TOUCH_MS = 5000;
9
9
  /**
10
- * A `running` record whose `updatedAt` is older than this is INTERRUPTED, not alive: the process
10
+ * A `running` record whose `updatedAt` is older than this is interrupted, not alive: the process
11
11
  * died without finalizing (a dropped SSH, a killed terminal, a crash). Three touch intervals of
12
12
  * slack so an ordinary scheduling hiccup or a slow disk never mislabels a healthy run.
13
13
  */
@@ -21,7 +21,9 @@ export interface RunLabProvenance {
21
21
  /** `committed` = humanish/labs, `ignored` = a local overlay, `explicit` = a path the operator passed. */
22
22
  origin?: "committed" | "ignored" | "explicit";
23
23
  }
24
- type RunStatusState = "running" | "finished";
24
+ type RunStatusState = "running" | "finished" | "interrupted";
25
+ /** The signals the CLI's run handler records when it stops a run. */
26
+ export type RunInterruptSignal = "SIGINT" | "SIGTERM" | "SIGHUP";
25
27
  /** The outcome summary a finalized record carries. Derived from the bundle; never authoritative. */
26
28
  interface RunStatusOutcome {
27
29
  /** `review.verdict` verbatim. */
@@ -55,6 +57,8 @@ export interface RunStatusRecord {
55
57
  /** Refreshed on a fixed cadence while the run is alive; the staleness signal. */
56
58
  updatedAt: string;
57
59
  completedAt?: string;
60
+ /** The signal that stopped the run, on an `interrupted` record. */
61
+ signal?: RunInterruptSignal;
58
62
  outcome?: RunStatusOutcome;
59
63
  }
60
64
  export interface RunStatusHandle {
@@ -72,11 +76,16 @@ export interface RunStatusHandle {
72
76
  ok: boolean;
73
77
  execution: ExecutionOutcome;
74
78
  }): Promise<void>;
79
+ /** The process is being stopped by `signal`: state `interrupted`, `completedAt` and the signal.
80
+ * It stops the cadence and makes a later finish or settle a no-op, so the route cannot write
81
+ * `running` or `finished` over it. When the run had finished it writes nothing, waits for the
82
+ * writes already queued and resolves false. */
83
+ interrupt(signal: RunInterruptSignal): Promise<boolean>;
75
84
  }
76
85
  export interface BeginRunStatusOptions {
77
86
  runId: string;
78
87
  mode: "dry-run" | "live";
79
- lab?: RunLabProvenance;
88
+ lab?: RunLabProvenance | undefined;
80
89
  }
81
90
  /**
82
91
  * Start a run's status record and keep it fresh. Fire-and-forget by design: a status write that
@@ -84,7 +93,8 @@ export interface BeginRunStatusOptions {
84
93
  * `unref`'d — this file can never be the reason a process stays alive.
85
94
  */
86
95
  export declare function beginRunStatus(runPaths: PreparedOutputRoot, options: BeginRunStatusOptions): RunStatusHandle;
87
- /** The three ways a run reads from disk. `interrupted` is a `running` record gone stale. */
96
+ /** The three ways a run reads from disk. `interrupted` is a record its stopped process wrote, or a
97
+ * `running` record gone stale. */
88
98
  export type RunLiveness = "running" | "interrupted" | "finished";
89
99
  /**
90
100
  * Classify a status record. Pure, so the TUI, the CLI and tests share one definition of "alive".
@@ -94,11 +104,11 @@ export declare function classifyRunStatus(record: Pick<RunStatusRecord, "state"
94
104
  /** Shape guard for a record read off disk. Unknown extra fields are tolerated (additive contract). */
95
105
  export declare function isRunStatusRecord(value: unknown): value is RunStatusRecord;
96
106
  /**
97
- * The legacy bridge: infer a lab id for a bundle written BEFORE this contract, where the only
107
+ * The legacy bridge: infer a lab id for a bundle written before this contract, where the only
98
108
  * attribution was the `lab:<id>` convention on persona/scenario source strings. Deliberately
99
109
  * conservative — it reads the convention and nothing else, and a `lab:` prefix with an empty
100
110
  * remainder is not an id. Ids may contain colons (the removed meta-lab wrote `oss:meta`), so
101
- * only the FIRST segment is stripped. Returns undefined when the bundle carries no such marker.
111
+ * only the first segment is stripped. Returns undefined when the bundle carries no such marker.
102
112
  */
103
113
  export declare function inferLegacyLabId(bundle: {
104
114
  persona?: {
@@ -17,11 +17,12 @@ export const RUN_STATUS_FILE = "status.json";
17
17
  /** How often a live run touches `updatedAt`. */
18
18
  export const RUN_STATUS_TOUCH_MS = 5_000;
19
19
  /**
20
- * A `running` record whose `updatedAt` is older than this is INTERRUPTED, not alive: the process
20
+ * A `running` record whose `updatedAt` is older than this is interrupted, not alive: the process
21
21
  * died without finalizing (a dropped SSH, a killed terminal, a crash). Three touch intervals of
22
22
  * slack so an ordinary scheduling hiccup or a slow disk never mislabels a healthy run.
23
23
  */
24
24
  export const RUN_STATUS_STALE_MS = RUN_STATUS_TOUCH_MS * 3;
25
+ const RUN_INTERRUPT_SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
25
26
  /** The outcome a finalized status record carries, read from the bundle that was just written. */
26
27
  export function runStatusOutcome(bundle) {
27
28
  return {
@@ -102,12 +103,16 @@ export function beginRunStatus(runPaths, options) {
102
103
  return;
103
104
  // The record is public-safe by construction, so each message passes the shape redaction
104
105
  // again even though the routes scrubbed it.
106
+ const redacted = (failure) => ({
107
+ kind: failure.kind,
108
+ message: redactText(failure.message),
109
+ });
105
110
  const execution = {
106
111
  succeeded: result.execution.succeeded,
107
- failures: result.execution.failures.map((failure) => ({
108
- kind: failure.kind,
109
- message: redactText(failure.message),
110
- })),
112
+ failures: result.execution.failures.map(redacted),
113
+ ...(result.execution.warnings === undefined
114
+ ? {}
115
+ : { warnings: result.execution.warnings.map(redacted) }),
111
116
  };
112
117
  finishedRecord = {
113
118
  ...finishedRecord,
@@ -115,6 +120,19 @@ export function beginRunStatus(runPaths, options) {
115
120
  };
116
121
  await write(finishedRecord);
117
122
  },
123
+ async interrupt(signal) {
124
+ // A finish that has not landed yet is in the chain: wait for it so the process does not
125
+ // exit with `running` on disk.
126
+ if (finished) {
127
+ await writing;
128
+ return false;
129
+ }
130
+ finished = true;
131
+ clearInterval(timer);
132
+ const completedAt = iso();
133
+ await write({ ...base, state: "interrupted", updatedAt: completedAt, completedAt, signal });
134
+ return true;
135
+ },
118
136
  };
119
137
  return handle;
120
138
  }
@@ -125,6 +143,8 @@ export function beginRunStatus(runPaths, options) {
125
143
  export function classifyRunStatus(record, nowMs, staleMs = RUN_STATUS_STALE_MS) {
126
144
  if (record.state === "finished")
127
145
  return "finished";
146
+ if (record.state === "interrupted")
147
+ return "interrupted";
128
148
  const updated = Date.parse(record.updatedAt);
129
149
  if (!Number.isFinite(updated))
130
150
  return "interrupted";
@@ -139,7 +159,10 @@ export function isRunStatusRecord(value) {
139
159
  return false;
140
160
  if (typeof record.runId !== "string" || record.runId === "")
141
161
  return false;
142
- if (record.state !== "running" && record.state !== "finished")
162
+ if (record.state !== "running" && record.state !== "finished" && record.state !== "interrupted")
163
+ return false;
164
+ if (record.signal !== undefined &&
165
+ (typeof record.signal !== "string" || !RUN_INTERRUPT_SIGNALS.includes(record.signal)))
143
166
  return false;
144
167
  if (record.mode !== "dry-run" && record.mode !== "live")
145
168
  return false;
@@ -156,11 +179,11 @@ export function isRunStatusRecord(value) {
156
179
  return true;
157
180
  }
158
181
  /**
159
- * The legacy bridge: infer a lab id for a bundle written BEFORE this contract, where the only
182
+ * The legacy bridge: infer a lab id for a bundle written before this contract, where the only
160
183
  * attribution was the `lab:<id>` convention on persona/scenario source strings. Deliberately
161
184
  * conservative — it reads the convention and nothing else, and a `lab:` prefix with an empty
162
185
  * remainder is not an id. Ids may contain colons (the removed meta-lab wrote `oss:meta`), so
163
- * only the FIRST segment is stripped. Returns undefined when the bundle carries no such marker.
186
+ * only the first segment is stripped. Returns undefined when the bundle carries no such marker.
164
187
  */
165
188
  export function inferLegacyLabId(bundle) {
166
189
  for (const source of [bundle.persona?.source, bundle.scenario?.source]) {
@@ -1,5 +1,5 @@
1
1
  import type { CodexAppServerTrace } from "../actors/codex/app-server-trace.js";
2
- import type { ActorTrace, ActorTraceItem } from "../actors/contract.js";
2
+ import type { ActorStatus, ActorTrace, ActorTraceItem } from "../actors/contract.js";
3
3
  import type { RunDesktopRecording } from "../evidence/desktop-recording-types.js";
4
4
  export type RunStreamKind = "ui" | "browser" | "terminal" | "tui" | "codex-ui" | "artifact" | "summary";
5
5
  export type RunSimulationStatus = "queued" | "preparing" | "running" | "passed" | "abandoned" | "incomplete" | "complete" | "blocked" | "timed_out" | "failed" | "contract_proof_only";
@@ -29,10 +29,10 @@ interface RunStreamCompletion {
29
29
  meaningfulUse?: RunMeaningfulUseScore;
30
30
  }
31
31
  /**
32
- * The CLOSED set of core meaningful-use scoring components. Closed by design: these are the generic
32
+ * The closed set of core meaningful-use scoring components. Closed by design: these are the generic
33
33
  * dimensions core itself meters (setup/filesystem/nested/actor/product/feedback). A
34
- * product-specific scorecard does NOT extend this enum, so adopters' nouns stay out of core. It
35
- * ships as a thin in-repo extension that emits a namespaced `RunAdapterScore` via the lane's
34
+ * product-specific scorecard does not extend this enum, so adopters' nouns stay out of core. It
35
+ * ships as a thin in-repo extension that emits a namespaced `RunAdapterScore` via the route's
36
36
  * `score` hook, leaving its own component breakdown in that score's `data`. Exported so a thin
37
37
  * adapter can type against core's score shape without forking.
38
38
  */
@@ -64,14 +64,14 @@ export interface RunDesktopGeometry {
64
64
  source: "xdpyinfo";
65
65
  };
66
66
  /**
67
- * The device preset as DECLARED by the lab, present only when it differs from `requested`
67
+ * The device preset as declared by the lab, present only when it differs from `requested`
68
68
  * because the rendered width was floored to MIN_DESKTOP_RENDER_WIDTH.
69
69
  *
70
70
  * Without this, a floored run is indistinguishable from a faithful one: `verified` compares
71
71
  * the floored number with itself and reports a match, so a reader of the bundle sees
72
72
  * requested 500 / verified 500 and reasonably concludes a 500-wide preset was asked for. A
73
73
  * `mobile` (414) and a `small-mobile` (360) seat both render at 500 and look identical here.
74
- * When this field is set, the preset width did NOT render; see #221.
74
+ * When this field is set, the preset width did not render; see #221.
75
75
  */
76
76
  declared?: {
77
77
  width: number;
@@ -121,10 +121,10 @@ export interface RunDesktopGeometry {
121
121
  source: "cdp";
122
122
  };
123
123
  /**
124
- * Page targets the participant drove AFTER the launch page (a link that opened in a new tab)
124
+ * Page targets the participant drove after the launch page (a link that opened in a new tab)
125
125
  * whose own read-back reported the requested viewport width (#623). Absent when the
126
- * participant never left the launch tab; a later tab that did NOT report the width is a lane
127
- * warning instead.
126
+ * participant never left the launch tab; a later tab that did not report the width is a
127
+ * participant warning instead.
128
128
  */
129
129
  laterTargets?: {
130
130
  targetId: string;
@@ -154,20 +154,27 @@ export interface RunParticipantAssignment {
154
154
  export interface RunStream {
155
155
  id: string;
156
156
  simId: string;
157
- /** Adapter-owned lane id for fan-out / target-swarm runs. Safe categorical metadata only. */
157
+ /** Adapter-owned participant id for fan-out / target-swarm runs. Safe categorical metadata only. */
158
158
  laneId?: string;
159
- /** Adapter-owned actor class for grouping lanes, e.g. viewer/reviewer/admin. */
159
+ /** Adapter-owned actor class for grouping participants, e.g. viewer/reviewer/admin. */
160
160
  actorType?: string;
161
- /** Adapter-owned product surface label for grouping lanes without parsing URLs. */
161
+ /** Adapter-owned product surface label for grouping participants without parsing URLs. */
162
162
  surface?: string;
163
163
  /** Adapter-owned scenario/case grouping label. */
164
164
  caseGroup?: string;
165
- /** Authored/default mission and lane focus, redacted before persistence. Missing on older
165
+ /** Authored/default mission and participant focus, redacted before persistence. Missing on older
166
166
  * bundles and uninstrumented routes; never reconstructed from study context or narration. */
167
167
  assignment?: RunParticipantAssignment;
168
168
  kind: RunStreamKind;
169
169
  label: string;
170
170
  status: RunSimulationStatus;
171
+ /**
172
+ * The judge's status for this participant (`judgedStatus` in src/run/judge.ts). It differs from
173
+ * the trace status when a goal_satisfied session reported a blocker or never engaged. Computer-use
174
+ * fan-out writes it for a finished live participant; rerun selection reads it. Absent elsewhere,
175
+ * and in bundles written before it existed.
176
+ */
177
+ judgedStatus?: ActorStatus;
171
178
  transport: "snapshot" | "polling" | "sse" | "pty" | "app-server";
172
179
  updatedAt: string;
173
180
  url?: string;
@@ -176,7 +183,7 @@ export interface RunStream {
176
183
  url?: string;
177
184
  title?: string;
178
185
  };
179
- /** Set by the attached watch server when the lane's sandbox is gone: the injected live URL
186
+ /** Set by the attached watch server when the participant's sandbox is gone: the injected live URL
180
187
  * would render a provider error page, so viewers fall back to recorded evidence. Runtime-only
181
188
  * and never persisted into bundles; declared here because the served observer-data carries it
182
189
  * and the client is typed against this contract. */
@@ -192,7 +199,7 @@ export interface RunStream {
192
199
  deviceScaleFactor?: number;
193
200
  isMobile?: boolean;
194
201
  };
195
- /** Truthful screen/window/viewport evidence for hosted desktop browser lanes. */
202
+ /** Truthful screen/window/viewport evidence for hosted desktop browser participants. */
196
203
  desktopGeometry?: RunDesktopGeometry;
197
204
  terminal?: {
198
205
  title: string;
@@ -227,10 +234,10 @@ export interface RunStream {
227
234
  };
228
235
  actor?: ActorTrace;
229
236
  /**
230
- * Mid-run partial actor evidence (#441): the redacted trace items recorded SO FAR,
231
- * flushed while a live lane is still running so the attached Observer's timeline can
232
- * grow. Deliberately NOT an ActorTrace — a running lane has no honest status,
233
- * completionReason, or completedAt, and this shape cannot claim them. Present ONLY on
237
+ * Mid-run partial actor evidence (#441): the redacted trace items recorded so far,
238
+ * flushed while a live participant is still running so the attached Observer's timeline can
239
+ * grow. It is deliberately not an ActorTrace: a running participant has no honest status,
240
+ * completionReason, or completedAt, and this shape cannot claim them. Present only on
234
241
  * `inProgress` bundles; the final write replaces it with the real `actor` and never
235
242
  * carries it.
236
243
  */
@@ -1,15 +1,15 @@
1
1
  export declare const TERMINAL_EVENTS_ARTIFACT = "terminal-events.ndjson";
2
2
  export declare const TERMINAL_TRANSCRIPT_ARTIFACT = "terminal-transcript.txt";
3
3
  export declare const TERMINAL_LEDGERS_ARTIFACT = "terminal-ledgers.json";
4
- /** The cost categories the lane meters. product/media/payment are adapter signals; core can
4
+ /** The cost categories the terminal route meters. product/media/payment are adapter signals; core can
5
5
  * populate the provider line from the actor trace's tokenUsage.costUsd when present. */
6
6
  export type CostCategory = "product" | "media" | "payment" | "provider";
7
7
  /** The four cost categories, in a fixed order so the ledger shape is stable across runs. */
8
8
  export declare const COST_CATEGORIES: readonly CostCategory[];
9
9
  /**
10
10
  * Strip ANSI/control noise from a captured terminal transcript into stable, scannable text. Pure
11
- * (no IO). Exported so the terminal-product lane (src/routes/terminal/live-sandbox.ts) normalizes
12
- * its captured exec stream EXACTLY as the local-actor lanes do — the verdict-nonce scorer is only
11
+ * (no IO). Exported so the terminal-product route (src/routes/terminal/live-sandbox.ts) normalizes
12
+ * its captured exec stream exactly as the local-actor routes do: the verdict-nonce scorer is only
13
13
  * sound against the same normalization the marker is matched on, so the logic must not diverge.
14
14
  */
15
15
  export declare function normalizeLocalActorTranscript(transcript: string): string;
@@ -18,8 +18,8 @@ type ActorVerdict = "passed" | "blocked" | "failed";
18
18
  * Extract the per-run verdict from a normalized transcript: the agent must print exactly
19
19
  * `HUMANISH_ACTOR_VERDICT=<status> HUMANISH_ACTOR_NONCE=<nonce>`, and the nonce is mandatory so a
20
20
  * bare marker (echoed or replayed from untrusted text) can never forge a verdict. Pure (no IO).
21
- * Exported so the terminal-product lane scores its in-sandbox `codex exec` run by the same marker;
22
- * divergent verdict logic would let the two lanes disagree about what "passed" means.
21
+ * Exported so the terminal-product route scores its in-sandbox `codex exec` run by the same marker;
22
+ * divergent verdict logic would let the two routes disagree about what "passed" means.
23
23
  */
24
24
  export declare function extractLocalActorVerdict(transcript: string, verdictNonce: string): ActorVerdict | null;
25
25
  export {};
@@ -14,8 +14,8 @@ export const COST_CATEGORIES = [
14
14
  ];
15
15
  /**
16
16
  * Strip ANSI/control noise from a captured terminal transcript into stable, scannable text. Pure
17
- * (no IO). Exported so the terminal-product lane (src/routes/terminal/live-sandbox.ts) normalizes
18
- * its captured exec stream EXACTLY as the local-actor lanes do — the verdict-nonce scorer is only
17
+ * (no IO). Exported so the terminal-product route (src/routes/terminal/live-sandbox.ts) normalizes
18
+ * its captured exec stream exactly as the local-actor routes do: the verdict-nonce scorer is only
19
19
  * sound against the same normalization the marker is matched on, so the logic must not diverge.
20
20
  */
21
21
  export function normalizeLocalActorTranscript(transcript) {
@@ -31,8 +31,8 @@ export function normalizeLocalActorTranscript(transcript) {
31
31
  * Extract the per-run verdict from a normalized transcript: the agent must print exactly
32
32
  * `HUMANISH_ACTOR_VERDICT=<status> HUMANISH_ACTOR_NONCE=<nonce>`, and the nonce is mandatory so a
33
33
  * bare marker (echoed or replayed from untrusted text) can never forge a verdict. Pure (no IO).
34
- * Exported so the terminal-product lane scores its in-sandbox `codex exec` run by the same marker;
35
- * divergent verdict logic would let the two lanes disagree about what "passed" means.
34
+ * Exported so the terminal-product route scores its in-sandbox `codex exec` run by the same marker;
35
+ * divergent verdict logic would let the two routes disagree about what "passed" means.
36
36
  */
37
37
  export function extractLocalActorVerdict(transcript, verdictNonce) {
38
38
  const compactTranscript = transcript.replace(/\s+/g, "");
@@ -3,3 +3,8 @@ export declare function withTransientCommsSecrets<T>(work: () => Promise<T>): Pr
3
3
  export declare function registerTransientCommsSecrets(values: string[]): void;
4
4
  /** Literal, longest-first replacement in one pass; replacement text is never matched recursively. */
5
5
  export declare function scrubTransientCommsText(text: string): string;
6
+ /**
7
+ * The scope's values as a scrubSecretValues scrub, which also finds them percent-encoded, escaped or
8
+ * base64-encoded and returns decoded text. Outside a scope it changes nothing.
9
+ */
10
+ export declare function transientCommsEncodedScrub(): (text: string) => string;
@@ -1,4 +1,5 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
+ import { scrubSecretValues } from "../evidence/secret-scrub.js";
2
3
  import { escapeRegExp } from "./text.js";
3
4
  const scopes = new AsyncLocalStorage();
4
5
  const MAX_VALUES = 8192;
@@ -70,3 +71,14 @@ export function scrubTransientCommsText(text) {
70
71
  return fail(scope);
71
72
  }
72
73
  }
74
+ /**
75
+ * The scope's values as a scrubSecretValues scrub, which also finds them percent-encoded, escaped or
76
+ * base64-encoded and returns decoded text. Outside a scope it changes nothing.
77
+ */
78
+ export function transientCommsEncodedScrub() {
79
+ const scope = scopes.getStore();
80
+ if (!scope)
81
+ return (text) => text;
82
+ usable(scope);
83
+ return scrubSecretValues([...scope.values]);
84
+ }