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
@@ -2,12 +2,13 @@
2
2
  // participant's feedback candidate or from a reviewed analysis finding, and its markdown rendering.
3
3
  // The commands that resolve the run and read or write drafts are in feedback.ts.
4
4
  import path from "node:path";
5
- import { studyAnalysisSharingProblems } from "../analysis/sharing.js";
6
- import { loadStudyAnalysis } from "../analysis/load.js";
5
+ import { analysisSharingProblems } from "../analysis/sharing.js";
6
+ import { loadAnalysis } from "../analysis/load.js";
7
7
  import { hashAnalysisValue } from "../analysis/validation.js";
8
- import { formatParticipantOutcomes, formatStudyTaskFunnel, participantOutcomeDetails, withCuaReviewProvenance, } from "../run/outcomes.js";
8
+ import { formatParticipantOutcomes, formatRunTaskFunnel, participantOutcomeDetails, withCuaReviewProvenance, } from "../run/outcomes.js";
9
9
  import { loadRunBundlePrepared } from "../run/locate.js";
10
10
  import { isFeedbackIdempotencyKey } from "../run/feedback-shape.js";
11
+ import { isRecord } from "../run/type-guards.js";
11
12
  import { feedbackProofCommands, projectFeedbackAcceptanceProof } from "./proof.js";
12
13
  export const FEEDBACK_SCHEMA = "humanish.feedback.v1";
13
14
  export function buildDraft(bundle, bundlePath, candidateId) {
@@ -65,7 +66,7 @@ export function buildDraft(bundle, bundlePath, candidateId) {
65
66
  ]),
66
67
  ...(bundle.review.tasks === undefined
67
68
  ? []
68
- : [`Tasks: ${formatStudyTaskFunnel(bundle.review.tasks)}.`]),
69
+ : [`Tasks: ${formatRunTaskFunnel(bundle.review.tasks)}.`]),
69
70
  ];
70
71
  return {
71
72
  schema: FEEDBACK_SCHEMA,
@@ -146,10 +147,10 @@ export function buildDraft(bundle, bundlePath, candidateId) {
146
147
  export async function buildAnalysisDraft(context, options) {
147
148
  if (!options.analysis || !options.finding || options.candidate !== undefined)
148
149
  return null;
149
- const loaded = await loadStudyAnalysis(context.preparedRunPaths, options.analysis);
150
+ const loaded = await loadAnalysis(context.preparedRunPaths, options.analysis);
150
151
  const analysis = loaded.analysis;
151
152
  const finding = analysis?.result?.findings.find((item) => item.id === options.finding);
152
- const sharing = studyAnalysisSharingProblems(loaded);
153
+ const sharing = analysisSharingProblems(loaded);
153
154
  if (loaded.state !== "ready" || sharing.sensitive || sharing.unverified || !analysis || !finding)
154
155
  return null;
155
156
  const correction = loaded.corrections.filter((item) => item.findingId === finding.id).at(-1);
@@ -253,9 +254,6 @@ export function isUsableFeedbackCandidate(candidate) {
253
254
  !item.path.includes("://") &&
254
255
  !item.path.includes(".."));
255
256
  }
256
- function isRecord(value) {
257
- return typeof value === "object" && value !== null && !Array.isArray(value);
258
- }
259
257
  export function renderMarkdown(draft, repo) {
260
258
  return `This issue was drafted by humanish from a verified humanish run bundle.
261
259
 
@@ -16,7 +16,7 @@ import { verifyRunPrepared } from "../verify/verify.js";
16
16
  import { loadRunBundlePrepared, resolveRunPath } from "../run/locate.js";
17
17
  import {} from "../run/bundle.js";
18
18
  import { runIdOf, isPathInside, prepareRunArtifactPaths, validatePreparedRunArtifactPaths, } from "../run/paths.js";
19
- import { isStudyAnalysisRecordPath } from "../analysis/sharing.js";
19
+ import { isAnalysisRecordPath } from "../analysis/sharing.js";
20
20
  import { assertPreparedSelectedOutputDirectory, prepareManagedHumanishOutputDirectory, prepareSelectedOutputDirectory, readContainedRegularFile, writeContainedOutputFile, } from "../run/contained-output.js";
21
21
  const DERIVATION_SCHEMA = "humanish.redacted-derivation.v1";
22
22
  const MAX_FILES = 10_000;
@@ -46,9 +46,9 @@ function jsonBytes(value) {
46
46
  return Buffer.from(`${JSON.stringify(value, null, 2)}\n`);
47
47
  }
48
48
  function omittedReason(relative) {
49
- if (relative.startsWith("analysis-automatic/") && isStudyAnalysisRecordPath(relative))
49
+ if (relative.startsWith("analysis-automatic/") && isAnalysisRecordPath(relative))
50
50
  return "automatic execution intent and liveness do not transfer to a derivative";
51
- if (isStudyAnalysisRecordPath(relative))
51
+ if (isAnalysisRecordPath(relative))
52
52
  return "analysis records bind original evidence hashes; reanalyze the derivative";
53
53
  if (relative.startsWith(".analysis-lock/"))
54
54
  return "local analysis execution lock";
@@ -477,7 +477,7 @@ async function resolveDestination(cwd, runPaths, runId, options) {
477
477
  * it. The raw snapshot is removed before the derivative is built.
478
478
  */
479
479
  async function verifyFrozenSource(workspace, source, runId) {
480
- // Verify the SAME frozen bytes that will be transformed. Verifying the live
480
+ // Verify the same frozen bytes that will be transformed. Verifying the live
481
481
  // source and then rereading run.json permits an ABA edit to contaminate a
482
482
  // derivative whose receipt still names the first inventory's hashes.
483
483
  // Raw verification bytes stay in private OS temporary storage, even when
@@ -3,7 +3,7 @@
3
3
  // A run is a directory. Sharing it meant a tunnel (`serve --expose`) or a hand-zipped bundle,
4
4
  // neither of which is "send one thing". The Observer is already a single-file artifact with the
5
5
  // run's data inlined; what keeps it from travelling is the screenshots it references by path.
6
- // Export embeds each unique raster once and writes ONE .html that opens offline.
6
+ // Export embeds each unique raster once and writes one .html that opens offline.
7
7
  //
8
8
  // Share safety is the point, not a step: export runs verify inside the flow and refuses a bundle
9
9
  // that is not share_ready. A local_only bundle (raw screenshots) exports only with an explicit
@@ -18,10 +18,10 @@ import { resolveRunPath } from "../run/locate.js";
18
18
  import { verifyRun } from "../verify/verify.js";
19
19
  import {} from "../run/bundle.js";
20
20
  import { exportRedactedBundle } from "./export-bundle.js";
21
- import { loadStudyAnalysis } from "../analysis/load.js";
22
- import { studyAnalysisSharingProblems } from "../analysis/sharing.js";
21
+ import { loadAnalysis } from "../analysis/load.js";
22
+ import { analysisSharingProblems } from "../analysis/sharing.js";
23
23
  import { EVIDENCE_LIMITS, validateAnalysisEvidence } from "../analysis/evidence.js";
24
- import { readBoundedStudyFile } from "../run/study-files.js";
24
+ import { readBoundedFile } from "../run/evidence-files.js";
25
25
  import { shellQuote } from "../substrates/shell.js";
26
26
  const EXPORT_SCHEMA = "humanish.export-result.v1";
27
27
  /** Past this the file stops being a thing you attach to an email. Declared, never silent. */
@@ -73,7 +73,7 @@ export async function exportRun(cwdInput, runInput, options = {}, deps = {}) {
73
73
  return slot;
74
74
  // Every string in the data that names an image file inside the run becomes an asset reference. Paths are
75
75
  // run-root-relative in the data; a path that resolves outside the run is left alone, never read.
76
- const analysis = await loadStudyAnalysis(runPaths);
76
+ const analysis = await loadAnalysis(runPaths);
77
77
  const data = await currentObserverData(runPaths, analysis, slot);
78
78
  if (data === undefined)
79
79
  return exportFailure(cwd, runInput, "HUMANISH_EXPORT_VERIFY_FAILED", "Source evidence changed while preparing the analysis export.");
@@ -175,7 +175,7 @@ async function currentObserverData(runPaths, analysis, slot) {
175
175
  const saved = JSON.parse(slot);
176
176
  if (analysis.state !== "ready" || !analysis.analysis)
177
177
  return { value: saved };
178
- const source = await readBoundedStudyFile(runPaths, "run.json", EVIDENCE_LIMITS.sourceBytes);
178
+ const source = await readBoundedFile(runPaths, "run.json", EVIDENCE_LIMITS.sourceBytes);
179
179
  if (!source ||
180
180
  createHash("sha256").update(source).digest("hex") !== analysis.analysis.sourceRunSha256)
181
181
  return undefined;
@@ -211,7 +211,7 @@ async function inlineImages(runPaths, runRoot, data, analysis, options, warnings
211
211
  for (const candidate of candidates) {
212
212
  if (!(await isInside(runRoot, candidate)))
213
213
  continue;
214
- const bytes = await readBoundedStudyFile(runPaths, path.relative(runRoot, candidate), options.maxBytes ?? DEFAULT_EXPORT_MAX_BYTES);
214
+ const bytes = await readBoundedFile(runPaths, path.relative(runRoot, candidate), options.maxBytes ?? DEFAULT_EXPORT_MAX_BYTES);
215
215
  if (bytes === null)
216
216
  continue;
217
217
  if (bytes.byteLength > MAX_PORTABLE_IMAGE_BYTES) {
@@ -302,7 +302,7 @@ async function recheckAnalysis(runPaths, analysis, verified, inlined, options) {
302
302
  // Revalidate the independent interpretation against source evidence. Never trust a
303
303
  // saved HTML slot or traverse model-provided strings as image paths.
304
304
  if (analysis.state === "ready" && analysis.analysis) {
305
- const source = await readBoundedStudyFile(runPaths, "run.json", EVIDENCE_LIMITS.sourceBytes);
305
+ const source = await readBoundedFile(runPaths, "run.json", EVIDENCE_LIMITS.sourceBytes);
306
306
  try {
307
307
  if (!source)
308
308
  throw new Error("source unavailable");
@@ -312,7 +312,7 @@ async function recheckAnalysis(runPaths, analysis, verified, inlined, options) {
312
312
  return "changed";
313
313
  }
314
314
  }
315
- const analysisSharing = studyAnalysisSharingProblems(analysis);
315
+ const analysisSharing = analysisSharingProblems(analysis);
316
316
  if (!analysisSharing.sensitive && !analysisSharing.unverified)
317
317
  return "ok";
318
318
  verified.shareSafety = {
@@ -12,7 +12,7 @@ export interface FeedbackResult {
12
12
  issueMarkdown?: string;
13
13
  issueUrl?: string;
14
14
  draft?: FeedbackDraft;
15
- /** Every usable candidate on the bundle, so a multi-lane study's second and third findings can be
15
+ /** Every usable candidate on the bundle, so a multi-participant study's second and third findings can be
16
16
  * chosen with `--candidate` instead of being invisible behind the first (#609). */
17
17
  candidates?: FeedbackCandidateSummary[];
18
18
  shareSafety?: VerifyResult["shareSafety"];
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { runLab } from "./run-lab.js";
1
+ export { runPackageLab as runLab } from "./run-lab.js";
2
2
  export type { LabOutcome, LabResult, RunLabOptions } from "./run-lab.js";
3
3
  export type { LabEvent } from "./lab/run-lab-events.js";
4
- export type { ProviderContext } from "./lab/run-lab-options.js";
4
+ export type { ProviderContext } from "./lab/run-lab-homes.js";
5
5
  export { routeOf } from "./lab/plan.js";
6
6
  export type { LabRoute } from "./lab/plan.js";
7
7
  export { parseLabConfig } from "./lab/config.js";
@@ -22,11 +22,8 @@ export { CuaAdmissionLimitError } from "./actors/computer-use/admission-limit.js
22
22
  export { defaultRedactionHooks } from "./evidence/redaction.js";
23
23
  export type { RedactionHooks } from "./evidence/redaction.js";
24
24
  export type { E2BDesktopSandbox } from "./substrates/e2b/sdk.js";
25
+ export { browserScorer, terminalScorer } from "./lab/adapter-scorer-loader.js";
25
26
  export type { AdapterScorerModule, AdapterScoringContext } from "./lab/adapter-scorer-loader.js";
26
27
  export type { BrowserLabScoringContext } from "./lab/adapter-extension.js";
27
28
  export type { TerminalProductScoringContext } from "./routes/terminal/types.js";
28
29
  export type { RunAdapterArtifact, RunAdapterScore } from "./run/bundle.js";
29
- export { routesToComputerUse, routesToConcurrentSharedWorld, routesToExternalPublicSharedWorld, routesToProvisionedSharedWorld, routesToScriptedBrowser, routesToSharedWorld, routesToTerminalProduct, } from "./lab/routing.js";
30
- export { selectLabBackend } from "./lab/plan.js";
31
- export { actorResolvesToTerminal, concurrentSharedWorldValidationReason, cuaLaneCount, cuaLaneValidationReason, externalPublicSharedWorldValidationReason, MAX_CUA_LANES, resolveLabDryRun, resolveSeatUrl, runConcurrentSharedWorld, runCuaActorLab, runCuaActorSession, runDryRun, runScriptedBrowserLab, runTerminalProductLab, sharedWorldValidationReason, } from "./deprecated.js";
32
- export type { AutomaticAnalysisHooks, BrowserLabAdapterHooks, ConcurrentSharedWorldLabResult, CuaActorLabHooks, CuaActorLabResult, LabBackend, RunConcurrentSharedWorldLabOptions, RunCuaActorLabOptions, RunOptions, RunResult, RunScriptedBrowserLabOptions, RunTerminalProductLabOptions, ScriptedBrowserLabHooks, ScriptedBrowserLabResult, SharedWorldLabHooks, SubjectPhaseEvent, TerminalProductLabHooks, TerminalProductLabResult, } from "./deprecated.js";
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // score a run. Everything else is internal and reached through the `humanish` bin. See
3
3
  // docs/contracts/schemas.md, "Library options", and the site's library page.
4
4
  // Run a lab.
5
- export { runLab } from "./run-lab.js";
5
+ export { runPackageLab as runLab } from "./run-lab.js";
6
6
  export { routeOf } from "./lab/plan.js";
7
7
  export { parseLabConfig } from "./lab/config.js";
8
8
  export { LAB_CONFIG_SCHEMA } from "./lab/types.js";
@@ -14,8 +14,5 @@ export { runComputerUseLoop, stableProgressKey } from "./actors/computer-use/loo
14
14
  export { createOpenAiResponsesProvider } from "./actors/computer-use/openai-provider.js";
15
15
  export { CuaAdmissionLimitError } from "./actors/computer-use/admission-limit.js";
16
16
  export { defaultRedactionHooks } from "./evidence/redaction.js";
17
- // Routing: the planLab series deprecates these and removes them in the next minor.
18
- export { routesToComputerUse, routesToConcurrentSharedWorld, routesToExternalPublicSharedWorld, routesToProvisionedSharedWorld, routesToScriptedBrowser, routesToSharedWorld, routesToTerminalProduct, } from "./lab/routing.js";
19
- export { selectLabBackend } from "./lab/plan.js";
20
- // Deprecated this minor, removed in the next.
21
- export { actorResolvesToTerminal, concurrentSharedWorldValidationReason, cuaLaneCount, cuaLaneValidationReason, externalPublicSharedWorldValidationReason, MAX_CUA_LANES, resolveLabDryRun, resolveSeatUrl, runConcurrentSharedWorld, runCuaActorLab, runCuaActorSession, runDryRun, runScriptedBrowserLab, runTerminalProductLab, sharedWorldValidationReason, } from "./deprecated.js";
17
+ // Score a run.
18
+ export { browserScorer, terminalScorer } from "./lab/adapter-scorer-loader.js";
@@ -13,12 +13,14 @@ export declare function userKeyStorePath(env: NodeJS.ProcessEnv, deps?: KeyResol
13
13
  /**
14
14
  * Fill missing provider keys into `env` from the discovery chain, announcing each fill as
15
15
  * `NAME from SOURCE`. Returns the fills. Opt-out: HUMANISH_STRICT_KEYS=1 returns [] untouched.
16
+ * With `announced`, every key is still filled, and only the fills it names are announced.
16
17
  */
17
18
  export declare function discoverProviderKeys(args: {
18
19
  cwd: string;
19
20
  env: NodeJS.ProcessEnv;
20
21
  announce: (line: string) => void;
21
22
  deps?: KeyResolutionDeps;
23
+ announced?: ReadonlySet<string>;
22
24
  }): Promise<ResolvedKeyFill[]>;
23
25
  export interface KeySourceProbe {
24
26
  name: string;
@@ -48,7 +50,7 @@ export declare function resolveKeyName(vendorOrName: string): string | null;
48
50
  * are storable (the store feeds implicit discovery — an arbitrary-name store would be an env
49
51
  * injection vector with extra steps). The value must be a single non-empty line that
50
52
  * round-trips the store's own parser byte-identically, and the write refuses symlinks at the
51
- * file AND its parent directory (red-team findings). */
53
+ * file and its parent directory (red-team findings). */
52
54
  export declare function setUserKey(name: string, value: string, env: NodeJS.ProcessEnv, deps?: KeyResolutionDeps): {
53
55
  path: string;
54
56
  };
@@ -5,15 +5,15 @@
5
5
  // 1. process env — including whatever --env-file just loaded (explicit always wins);
6
6
  // 2. `.humanish/local/provider.env` — the project-local overlay this CLI's own --help
7
7
  // examples document;
8
- // 3. the OWNING vendor's native store, where one exists:
8
+ // 3. the owning vendor's native store, where one exists:
9
9
  // E2B_API_KEY <- ~/.e2b/config.json (written by `e2b auth login`);
10
10
  // GH_TOKEN <- `gh auth token` (the gh CLI's credential chain);
11
11
  // 4. the humanish user-level store `$XDG_CONFIG_HOME/humanish/keys.env`, written only by
12
12
  // `humanish keys set` (0600, prompted or --stdin) — the fallback for vendors that ship
13
13
  // no machine chain of their own (OpenAI, Anthropic).
14
14
  //
15
- // Every fill is ANNOUNCED by key name + source, never by value. The subject app's own
16
- // `.env`/`.env.local` are NEVER read — those hold product credentials, a different class
15
+ // Every fill is announced by key name + source, never by value. The subject app's own
16
+ // `.env`/`.env.local` are never read: those hold product credentials, a different class
17
17
  // (#11); this module only reads humanish-owned files and vendor-owned stores.
18
18
  // `HUMANISH_STRICT_KEYS=1` disables every rung below process env (the pre-#436 behavior).
19
19
  import { spawn } from "node:child_process";
@@ -21,7 +21,7 @@ import { chmodSync, closeSync, constants as fsConstants, existsSync, ftruncateSy
21
21
  import { homedir } from "node:os";
22
22
  import path from "node:path";
23
23
  import { loadEnvFile } from "./env-file.js";
24
- /** The ONLY names implicit discovery may fill (and `humanish keys set` may store). Everything
24
+ /** The only names implicit discovery may fill (and `humanish keys set` may store). Everything
25
25
  * else in an overlay/store file is ignored-and-named: a repo-planted NODE_OPTIONS/LD_PRELOAD
26
26
  * must never enter process env off a file the operator did not explicitly pass (an explicit
27
27
  * --env-file remains the operator's own full-file load). Red-team finding, #436. */
@@ -51,7 +51,7 @@ const PROJECT_OVERLAY_RELATIVE = path.join(".humanish", "local", "provider.env")
51
51
  export function userKeyStorePath(env, deps = {}) {
52
52
  const home = deps.homeDir ?? homedir();
53
53
  const declared = env.XDG_CONFIG_HOME?.trim();
54
- // The XDG spec: a relative XDG_CONFIG_HOME MUST be ignored. Honoring one would make the
54
+ // The XDG spec: a relative XDG_CONFIG_HOME must be ignored. Honoring one would make the
55
55
  // key store cwd-relative — `humanish keys set` would write a secret into the current repo.
56
56
  const configHome = declared !== undefined && declared !== "" && path.isAbsolute(declared)
57
57
  ? declared
@@ -61,7 +61,7 @@ export function userKeyStorePath(env, deps = {}) {
61
61
  function e2bConfigPath(deps) {
62
62
  return path.join(deps.homeDir ?? homedir(), ".e2b", "config.json");
63
63
  }
64
- /** Default exec: bounded, quiet, stdin closed; null on ANY failure. Never throws. */
64
+ /** Default exec: bounded, quiet, stdin closed; null on any failure. Never throws. */
65
65
  function defaultExecText(command, args, timeoutMs, env) {
66
66
  return new Promise((resolve) => {
67
67
  let child;
@@ -128,7 +128,7 @@ function readE2bConfigKey(deps) {
128
128
  return null;
129
129
  }
130
130
  }
131
- /** Refuse to READ a store through a symlink: a repo-local overlay that is secretly a link to
131
+ /** Refuse to read a store through a symlink: a repo-local overlay that is secretly a link to
132
132
  * an unrelated file is exactly the retargeting shape the artifact paths refuse elsewhere. */
133
133
  function isRegularFile(filePath) {
134
134
  try {
@@ -141,15 +141,16 @@ function isRegularFile(filePath) {
141
141
  /**
142
142
  * Fill missing provider keys into `env` from the discovery chain, announcing each fill as
143
143
  * `NAME from SOURCE`. Returns the fills. Opt-out: HUMANISH_STRICT_KEYS=1 returns [] untouched.
144
+ * With `announced`, every key is still filled, and only the fills it names are announced.
144
145
  */
145
146
  export async function discoverProviderKeys(args) {
146
- const { cwd, env, announce } = args;
147
+ const { cwd, env, announce, announced } = args;
147
148
  const deps = args.deps ?? {};
148
149
  if (env.HUMANISH_STRICT_KEYS?.trim() === "1")
149
150
  return [];
150
151
  const fills = [];
151
152
  const ignored = [];
152
- // Fill-only means PRESENCE wins, including an explicitly-set empty value: an operator who
153
+ // Fill-only means presence wins, including an explicitly-set empty value: an operator who
153
154
  // exported OPENAI_API_KEY="" said "off", and a rung that "fixes" that has overridden them
154
155
  // (red-team finding). Only a truly-unset name is fillable.
155
156
  const fillable = (name) => env[name] === undefined;
@@ -157,7 +158,7 @@ export async function discoverProviderKeys(args) {
157
158
  env[name] = value;
158
159
  fills.push({ name, source });
159
160
  };
160
- // Rung 2: the documented project-local overlay. Parsed ATOMICALLY against a scratch env so a
161
+ // Rung 2: the documented project-local overlay. Parsed atomically against a scratch env so a
161
162
  // file loadEnvFile rejects can never half-apply (red-team finding: earlier lines used to land
162
163
  // in env unannounced before the parse error aborted). Only allowlisted provider names cross
163
164
  // from the file into the real env.
@@ -184,7 +185,7 @@ export async function discoverProviderKeys(args) {
184
185
  if (teamKey !== null)
185
186
  fill("E2B_API_KEY", teamKey, "~/.e2b/config.json (e2b auth login)");
186
187
  }
187
- // Rung 3b: the gh CLI's credential chain. Only consulted when NEITHER GitHub env name is
188
+ // Rung 3b: the gh CLI's credential chain. Only consulted when neither GitHub env name is
188
189
  // present; fills GH_TOKEN (the name humanish reads first). gh runs without any provider key in
189
190
  // its environment, so the keys the rungs above just filled stay in this process.
190
191
  if (fillable("GH_TOKEN") && fillable("GITHUB_TOKEN")) {
@@ -193,7 +194,7 @@ export async function discoverProviderKeys(args) {
193
194
  if (token !== null)
194
195
  fill("GH_TOKEN", token, "gh auth token");
195
196
  }
196
- // Rung 4: the humanish user-level store — read with the SAME lenient parser `keys set`/`list`
197
+ // Rung 4: the humanish user-level store, read with the same lenient parser `keys set`/`list`
197
198
  // use, so one hand-mangled line degrades to that line alone instead of silently voiding the
198
199
  // whole store (red-team finding: the strict parser disagreed with the store's own reader).
199
200
  const storePath = userKeyStorePath(env, deps);
@@ -209,12 +210,13 @@ export async function discoverProviderKeys(args) {
209
210
  }
210
211
  }
211
212
  for (const fill_ of fills)
212
- announce(`humanish keys: ${fill_.name} from ${fill_.source}`);
213
+ if (announced === undefined || announced.has(fill_.name))
214
+ announce(`humanish keys: ${fill_.name} from ${fill_.source}`);
213
215
  for (const name of ignored)
214
216
  announce(`humanish keys: ignored non-provider name ${name} — implicit discovery fills provider keys only; pass the file via --env-file to load everything in it`);
215
217
  return fills;
216
218
  }
217
- /** True when the file's PARENT directory is (or traverses) a symlink at its last component —
219
+ /** True when the file's parent directory is (or traverses) a symlink at its last component:
218
220
  * the dir-level retarget that defeats a file-level lstat check (red-team finding). */
219
221
  function dirIsSymlink(filePath) {
220
222
  try {
@@ -295,7 +297,7 @@ export function resolveKeyName(vendorOrName) {
295
297
  * are storable (the store feeds implicit discovery — an arbitrary-name store would be an env
296
298
  * injection vector with extra steps). The value must be a single non-empty line that
297
299
  * round-trips the store's own parser byte-identically, and the write refuses symlinks at the
298
- * file AND its parent directory (red-team findings). */
300
+ * file and its parent directory (red-team findings). */
299
301
  export function setUserKey(name, value, env, deps = {}) {
300
302
  const trimmed = value.trim();
301
303
  if (trimmed.length === 0 || /[\u0000-\u001f\u007f]/.test(trimmed)) {
@@ -320,7 +322,7 @@ export function setUserKey(name, value, env, deps = {}) {
320
322
  entries.set(name, trimmed);
321
323
  // The written line must read back byte-identically through the store's own parser: a value
322
324
  // that parses differently (an embedded '#', a leading quote the env parser would strip)
323
- // would silently resolve to a DIFFERENT secret on the next run.
325
+ // would silently resolve to a different secret on the next run.
324
326
  const roundTrip = parseStoreLine(`${name}=${trimmed}`);
325
327
  if (roundTrip === null || roundTrip[0] !== name || roundTrip[1] !== trimmed) {
326
328
  throw new Error("The value does not round-trip the store format (avoid leading quotes and '#'); pass it via --env-file instead.");
@@ -1,7 +1,9 @@
1
1
  import type { RunAdapterArtifact, RunAdapterScore, RunBundle, RunFeedbackCandidate, RunScorerProvenance } from "../run/bundle.js";
2
2
  type BrowserAdapterBackend = "cua" | "shared-world" | "concurrent-shared-world";
3
+ /** The routes that call a browser scorer. */
4
+ type BrowserScorerRoute = "computer-use" | "shared-world";
3
5
  /**
4
- * Product-agnostic scoring context for browser/computer-use lanes. Product-specific
6
+ * Product-agnostic scoring context for browser/computer-use routes. Product-specific
5
7
  * evidence/rubrics stay in the adopter's repo; core provides the assembled bundle
6
8
  * plus stable run identifiers and never learns product nouns.
7
9
  */
@@ -16,11 +18,26 @@ export interface BrowserLabScoringContext {
16
18
  labId: string;
17
19
  runId: string;
18
20
  actor: string;
21
+ /** The route that ran the participants. */
22
+ route: BrowserScorerRoute;
23
+ /**
24
+ * @deprecated Use `route`. `cua` is `computer-use` and `concurrent-shared-world` is
25
+ * `shared-world`. Reading it warns once per process; the next minor removes it.
26
+ */
19
27
  backend: BrowserAdapterBackend;
20
28
  dryRun: boolean;
29
+ /** How many participants the run had. */
30
+ participantCount: number;
31
+ /**
32
+ * @deprecated Use `participantCount`, which has the same value. Reading it warns once per
33
+ * process; the next minor removes it.
34
+ */
21
35
  laneCount: number;
22
36
  }
23
- export interface BrowserLabAdapterHooks {
37
+ /** The context a route passes to applyBrowserScorer; the deprecated fields derive from it. */
38
+ type BrowserScoringFacts = Omit<BrowserLabScoringContext, "backend" | "laneCount">;
39
+ /** The scorer functions a computer-use or shared-world run calls: `RunLabOptions.scorer`. */
40
+ export interface BrowserScorer {
24
41
  /**
25
42
  * Browser-route extension seam (#165): a thin adapter may score the assembled
26
43
  * browser/shared-world evidence without forking core. The score is stored as
@@ -51,19 +68,24 @@ export interface ScorerOutcome {
51
68
  export declare const DECLARED_SCORER_MALFORMED = "Declared product scorer returned a malformed value instead of a verdict; a declared gate that cannot render a pass is recorded as a fail, never a silent pass.";
52
69
  /** A DECLARED scorer that threw never rendered a verdict. `detail` is already sanitized. */
53
70
  export declare function declaredScorerThrew(detail: string): string;
54
- export declare function applyBrowserAdapterHooks(args: {
55
- hooks: BrowserLabAdapterHooks | undefined;
56
- context: BrowserLabScoringContext;
71
+ export declare function applyBrowserScorer(args: {
72
+ scorer: BrowserScorer | undefined;
73
+ context: BrowserScoringFacts;
57
74
  bundle: RunBundle;
58
75
  sanitize: (text: string) => string;
59
76
  warnings: string[];
60
- hookLabel: string;
61
77
  /** Present only when the scorer was CONFIG-DECLARED (#316); core-stamped onto the bundle as
62
78
  * evidence of which out-of-tree module was loaded. Absent for library callers. Its presence also
63
79
  * makes a THROWING or MALFORMED scorer a failure — a declared gate that cannot render a pass is
64
80
  * a fail, never a silent green. */
65
81
  scorerProvenance?: RunScorerProvenance;
66
82
  }): Promise<ScorerOutcome>;
83
+ /**
84
+ * A feedback candidate a scorer returned, accepted at the seam: the bundle's candidate shape with a
85
+ * non-empty summary. The browser and terminal seams both use it, so a candidate either seam drops
86
+ * never reaches a bundle.
87
+ */
88
+ export declare function isAdapterFeedbackCandidate(value: unknown): value is RunFeedbackCandidate;
67
89
  export declare function adapterScoreFailureMessage(bundle: RunBundle): string | undefined;
68
90
  /**
69
91
  * Deep-freeze a structured clone so a loaded scorer sees a READ-ONLY bundle: it cannot mutate