humanish 0.107.0 → 0.108.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 (521) hide show
  1. package/ARCHITECTURE.md +22 -17
  2. package/CHANGELOG.md +14 -0
  3. package/CONTEXT.md +51 -44
  4. package/README.md +145 -172
  5. package/SECURITY.md +16 -26
  6. package/TELEMETRY.md +8 -6
  7. package/dist/actors/affordance.d.ts +4 -4
  8. package/dist/actors/affordance.js +12 -12
  9. package/dist/actors/agent-session.d.ts +2 -2
  10. package/dist/actors/agent-session.js +7 -7
  11. package/dist/actors/codex/app-server-actor-trace.d.ts +1 -1
  12. package/dist/actors/codex/app-server-actor-trace.js +1 -1
  13. package/dist/actors/codex/app-server-ui.js +1 -1
  14. package/dist/actors/codex/codex-admission.d.ts +91 -0
  15. package/dist/actors/codex/codex-admission.js +150 -0
  16. package/dist/actors/codex/restricted-executable.d.ts +4 -4
  17. package/dist/actors/codex/restricted-executable.js +8 -8
  18. package/dist/actors/codex/restricted-launch.d.ts +2 -1
  19. package/dist/actors/codex/restricted-launch.js +1 -1
  20. package/dist/actors/codex/restricted-participant.js +8 -6
  21. package/dist/actors/codex/restricted-policy.d.ts +2 -2
  22. package/dist/actors/codex/restricted-policy.js +2 -2
  23. package/dist/actors/codex/restricted-session.d.ts +2 -2
  24. package/dist/actors/codex/restricted-session.js +10 -5
  25. package/dist/actors/computer-use/actor.d.ts +16 -16
  26. package/dist/actors/computer-use/actor.js +2 -2
  27. package/dist/actors/computer-use/admission-limit.d.ts +1 -1
  28. package/dist/actors/computer-use/admission-limit.js +1 -1
  29. package/dist/actors/computer-use/loop/actions.d.ts +3 -3
  30. package/dist/actors/computer-use/loop/actions.js +10 -10
  31. package/dist/actors/computer-use/loop/backstop.d.ts +3 -3
  32. package/dist/actors/computer-use/loop/backstop.js +14 -12
  33. package/dist/actors/computer-use/loop/ending.d.ts +5 -5
  34. package/dist/actors/computer-use/loop/ending.js +7 -7
  35. package/dist/actors/computer-use/loop/observation.d.ts +2 -2
  36. package/dist/actors/computer-use/loop/observation.js +9 -9
  37. package/dist/actors/computer-use/loop/provider-call.d.ts +1 -1
  38. package/dist/actors/computer-use/loop/provider-call.js +1 -1
  39. package/dist/actors/computer-use/loop/session.js +3 -3
  40. package/dist/actors/computer-use/loop/spend.d.ts +1 -1
  41. package/dist/actors/computer-use/loop/spend.js +1 -1
  42. package/dist/actors/computer-use/loop/trace.js +9 -8
  43. package/dist/actors/computer-use/loop/types.d.ts +25 -23
  44. package/dist/actors/computer-use/loop/usage.js +2 -2
  45. package/dist/actors/computer-use/openai-context.d.ts +37 -0
  46. package/dist/actors/computer-use/openai-context.js +214 -0
  47. package/dist/actors/computer-use/openai-provider.d.ts +11 -8
  48. package/dist/actors/computer-use/openai-provider.js +45 -34
  49. package/dist/actors/computer-use/openai-requests.d.ts +36 -10
  50. package/dist/actors/computer-use/openai-requests.js +82 -15
  51. package/dist/actors/computer-use/openai-wire.d.ts +19 -7
  52. package/dist/actors/computer-use/openai-wire.js +36 -34
  53. package/dist/actors/contract.d.ts +78 -43
  54. package/dist/actors/contract.js +29 -23
  55. package/dist/actors/local-agent/claude-session.d.ts +1 -1
  56. package/dist/actors/local-agent/claude-session.js +10 -9
  57. package/dist/actors/local-agent/cli.d.ts +8 -6
  58. package/dist/actors/local-agent/cli.js +24 -28
  59. package/dist/actors/local-agent/readiness.d.ts +2 -2
  60. package/dist/actors/local-agent/readiness.js +4 -4
  61. package/dist/actors/reasoning-effort.js +6 -6
  62. package/dist/actors/registry.d.ts +10 -10
  63. package/dist/actors/registry.js +18 -17
  64. package/dist/actors/scripted-browser/actor.d.ts +8 -8
  65. package/dist/actors/scripted-browser/actor.js +16 -16
  66. package/dist/actors/scripted-browser/browser-command.js +1 -1
  67. package/dist/actors/scripted-browser/steps.js +1 -1
  68. package/dist/actors/scripted-browser/types.d.ts +1 -1
  69. package/dist/actors/stop-conditions.d.ts +1 -1
  70. package/dist/analysis/codex-config.d.ts +6 -2
  71. package/dist/analysis/codex-config.js +22 -14
  72. package/dist/analysis/service.js +5 -5
  73. package/dist/cli/commands/analyze.js +19 -16
  74. package/dist/cli/commands/codex.js +9 -9
  75. package/dist/cli/commands/comms.js +54 -33
  76. package/dist/cli/commands/feedback.js +20 -21
  77. package/dist/cli/commands/lab-format.d.ts +5 -4
  78. package/dist/cli/commands/lab-format.js +35 -23
  79. package/dist/cli/commands/lab-route-computer-use.js +6 -7
  80. package/dist/cli/commands/lab-route-preview.js +4 -3
  81. package/dist/cli/commands/lab-route-shared-world.js +3 -3
  82. package/dist/cli/commands/lab-run.js +10 -11
  83. package/dist/cli/commands/lab-scorer.d.ts +2 -2
  84. package/dist/cli/commands/lab-scorer.js +1 -1
  85. package/dist/cli/commands/migrate.d.ts +4 -0
  86. package/dist/cli/commands/migrate.js +65 -0
  87. package/dist/cli/commands/observe.js +147 -108
  88. package/dist/cli/commands/run-command.d.ts +10 -0
  89. package/dist/cli/commands/run-command.js +85 -0
  90. package/dist/cli/commands/runs.js +137 -138
  91. package/dist/cli/commands/setup.d.ts +2 -2
  92. package/dist/cli/commands/setup.js +26 -21
  93. package/dist/cli/commands/study.d.ts +3 -0
  94. package/dist/cli/commands/study.js +182 -0
  95. package/dist/cli/commands/tui.d.ts +4 -4
  96. package/dist/cli/commands/tui.js +21 -21
  97. package/dist/cli/commands/watch.js +60 -75
  98. package/dist/cli/deprecations.d.ts +18 -0
  99. package/dist/cli/deprecations.js +48 -0
  100. package/dist/cli/doctor.d.ts +15 -5
  101. package/dist/cli/doctor.js +103 -48
  102. package/dist/cli/first-run-path.d.ts +12 -10
  103. package/dist/cli/first-run-path.js +30 -28
  104. package/dist/cli/io.d.ts +41 -6
  105. package/dist/cli/io.js +97 -22
  106. package/dist/cli/observer-follow.d.ts +2 -2
  107. package/dist/cli/observer-follow.js +5 -6
  108. package/dist/cli/orientation.d.ts +6 -3
  109. package/dist/cli/orientation.js +43 -39
  110. package/dist/cli/product-sentence.d.ts +6 -0
  111. package/dist/cli/product-sentence.js +6 -0
  112. package/dist/cli/program.d.ts +6 -1
  113. package/dist/cli/program.js +109 -40
  114. package/dist/cli/telemetry.d.ts +15 -15
  115. package/dist/cli/telemetry.js +48 -40
  116. package/dist/cli.js +1 -1
  117. package/dist/comms/capture-surface.d.ts +13 -12
  118. package/dist/comms/capture-surface.js +23 -22
  119. package/dist/comms/catch-host.d.ts +7 -7
  120. package/dist/comms/catch-host.js +14 -14
  121. package/dist/comms/email-catch.d.ts +3 -3
  122. package/dist/comms/email-catch.js +8 -8
  123. package/dist/comms/external-evidence.js +2 -2
  124. package/dist/comms/extract.js +2 -2
  125. package/dist/comms/fake-inbox.d.ts +2 -2
  126. package/dist/comms/fake-inbox.js +2 -2
  127. package/dist/comms/receiving-render.d.ts +1 -1
  128. package/dist/comms/receiving-render.js +2 -2
  129. package/dist/comms/sandbox-catch-script.d.ts +6 -6
  130. package/dist/comms/sandbox-catch-script.js +6 -6
  131. package/dist/comms/sandbox-catch.d.ts +36 -37
  132. package/dist/comms/sandbox-catch.js +34 -35
  133. package/dist/comms/setup.js +42 -8
  134. package/dist/comms/thread-evidence.d.ts +1 -1
  135. package/dist/comms/thread-evidence.js +6 -6
  136. package/dist/comms/types.d.ts +6 -6
  137. package/dist/comms/types.js +3 -3
  138. package/dist/evidence/frame-signature.d.ts +1 -1
  139. package/dist/evidence/frame-signature.js +4 -4
  140. package/dist/evidence/redaction.d.ts +3 -3
  141. package/dist/evidence/redaction.js +4 -4
  142. package/dist/feedback/draft.js +36 -78
  143. package/dist/feedback/export-bundle.js +1 -1
  144. package/dist/feedback/export.d.ts +5 -1
  145. package/dist/feedback/export.js +7 -8
  146. package/dist/feedback/feedback.d.ts +2 -2
  147. package/dist/feedback/feedback.js +21 -3
  148. package/dist/guest/chromium-text.js +2 -2
  149. package/dist/guest/desktop-native.d.ts +1 -1
  150. package/dist/guest/runtime.js +1 -1
  151. package/dist/index.d.ts +12 -10
  152. package/dist/index.js +8 -6
  153. package/dist/keys/key-resolution.d.ts +5 -5
  154. package/dist/keys/key-resolution.js +23 -23
  155. package/dist/lab/adapter-extension.d.ts +7 -7
  156. package/dist/lab/adapter-extension.js +13 -36
  157. package/dist/lab/adapter-scorer-loader.d.ts +7 -7
  158. package/dist/lab/adapter-scorer-loader.js +32 -32
  159. package/dist/lab/composition-rules.js +42 -42
  160. package/dist/lab/config.js +65 -25
  161. package/dist/lab/deprecated-fields.d.ts +10 -0
  162. package/dist/lab/deprecated-fields.js +24 -0
  163. package/dist/lab/device-presets.d.ts +8 -8
  164. package/dist/lab/device-presets.js +11 -11
  165. package/dist/lab/discover.d.ts +13 -9
  166. package/dist/lab/discover.js +117 -57
  167. package/dist/lab/doctor.d.ts +10 -3
  168. package/dist/lab/doctor.js +47 -9
  169. package/dist/lab/init-templates.js +147 -147
  170. package/dist/lab/init.d.ts +1 -1
  171. package/dist/lab/init.js +41 -9
  172. package/dist/lab/keys.d.ts +2 -0
  173. package/dist/lab/keys.js +42 -8
  174. package/dist/lab/lab-deps.d.ts +7 -12
  175. package/dist/lab/parse/actors.js +9 -9
  176. package/dist/lab/parse/comms.js +5 -5
  177. package/dist/lab/parse/execution.js +13 -13
  178. package/dist/lab/parse/study-v3.d.ts +23 -0
  179. package/dist/lab/parse/study-v3.js +259 -0
  180. package/dist/lab/parse/subject-state.d.ts +7 -7
  181. package/dist/lab/parse/subject-state.js +16 -16
  182. package/dist/lab/parse/subject.js +28 -28
  183. package/dist/lab/parse/values.d.ts +1 -1
  184. package/dist/lab/parse/values.js +3 -3
  185. package/dist/lab/persona-resolve.d.ts +4 -4
  186. package/dist/lab/persona-resolve.js +4 -4
  187. package/dist/lab/plan-participants.d.ts +2 -2
  188. package/dist/lab/plan-types.d.ts +4 -4
  189. package/dist/lab/plan.d.ts +1 -7
  190. package/dist/lab/plan.js +10 -41
  191. package/dist/lab/preflight-probes.js +11 -11
  192. package/dist/lab/preflight-result.d.ts +2 -1
  193. package/dist/lab/preflight-result.js +5 -4
  194. package/dist/lab/preflight.d.ts +7 -5
  195. package/dist/lab/preflight.js +5 -5
  196. package/dist/lab/routing.d.ts +31 -25
  197. package/dist/lab/routing.js +60 -29
  198. package/dist/lab/run-lab-events.d.ts +0 -3
  199. package/dist/lab/run-lab-events.js +0 -6
  200. package/dist/lab/run-lab-homes.d.ts +22 -10
  201. package/dist/lab/run-lab-homes.js +5 -1
  202. package/dist/lab/run-lab-options.d.ts +1 -1
  203. package/dist/lab/run-lab-options.js +16 -13
  204. package/dist/lab/summary.d.ts +7 -6
  205. package/dist/lab/summary.js +10 -10
  206. package/dist/lab/tasks.d.ts +15 -15
  207. package/dist/lab/tasks.js +14 -14
  208. package/dist/lab/types.d.ts +101 -95
  209. package/dist/lab/types.js +2 -0
  210. package/dist/lab/validation.d.ts +13 -13
  211. package/dist/lab/validation.js +44 -42
  212. package/dist/lab/warnings.d.ts +10 -0
  213. package/dist/lab/warnings.js +61 -33
  214. package/dist/library-aliases.d.ts +56 -0
  215. package/dist/library-aliases.js +22 -0
  216. package/dist/observer/artifact.d.ts +1 -1
  217. package/dist/observer/artifact.js +6 -6
  218. package/dist/observer/data.d.ts +6 -6
  219. package/dist/observer/data.js +5 -4
  220. package/dist/observer/exposure.d.ts +1 -1
  221. package/dist/observer/exposure.js +11 -11
  222. package/dist/observer/http.js +1 -1
  223. package/dist/observer/library.d.ts +1 -1
  224. package/dist/observer/library.js +4 -2
  225. package/dist/observer/listen.js +5 -4
  226. package/dist/observer/render.d.ts +1 -1
  227. package/dist/observer/render.js +10 -5
  228. package/dist/observer/run-routes.d.ts +3 -3
  229. package/dist/observer/run-routes.js +1 -1
  230. package/dist/observer/serve.js +7 -3
  231. package/dist/observer/tunnel.js +1 -1
  232. package/dist/observer-app.html +4 -4
  233. package/dist/routes/computer-use/bundle-parts.d.ts +9 -9
  234. package/dist/routes/computer-use/bundle-parts.js +15 -15
  235. package/dist/routes/computer-use/bundle.js +3 -3
  236. package/dist/routes/computer-use/e2b-desktop/comms.d.ts +1 -1
  237. package/dist/routes/computer-use/e2b-desktop/comms.js +14 -14
  238. package/dist/routes/computer-use/e2b-desktop/desktop.js +4 -4
  239. package/dist/routes/computer-use/e2b-desktop/fidelity.d.ts +4 -3
  240. package/dist/routes/computer-use/e2b-desktop/fidelity.js +11 -10
  241. package/dist/routes/computer-use/e2b-desktop/prepare.js +7 -7
  242. package/dist/routes/computer-use/e2b-desktop/start.js +9 -8
  243. package/dist/routes/computer-use/e2b-desktop/teardown.js +5 -4
  244. package/dist/routes/computer-use/external-comms.d.ts +1 -1
  245. package/dist/routes/computer-use/external-comms.js +1 -1
  246. package/dist/routes/computer-use/fanout-bundle.js +18 -18
  247. package/dist/routes/computer-use/fanout-records.js +10 -11
  248. package/dist/routes/computer-use/live-flush.d.ts +1 -1
  249. package/dist/routes/computer-use/live-flush.js +6 -6
  250. package/dist/routes/computer-use/live-phase.d.ts +4 -2
  251. package/dist/routes/computer-use/live-phase.js +6 -6
  252. package/dist/routes/computer-use/local-vm.js +1 -1
  253. package/dist/routes/computer-use/participant-desktop.d.ts +4 -4
  254. package/dist/routes/computer-use/participant-desktop.js +4 -4
  255. package/dist/routes/computer-use/participant-execution.d.ts +4 -4
  256. package/dist/routes/computer-use/participant-execution.js +9 -9
  257. package/dist/routes/computer-use/participant-model.d.ts +6 -0
  258. package/dist/routes/computer-use/participant-model.js +31 -13
  259. package/dist/routes/computer-use/participant-prompt.d.ts +11 -11
  260. package/dist/routes/computer-use/participant-prompt.js +6 -6
  261. package/dist/routes/computer-use/participant-runs.d.ts +7 -7
  262. package/dist/routes/computer-use/participant-runs.js +13 -13
  263. package/dist/routes/computer-use/plan.js +22 -22
  264. package/dist/routes/computer-use/preflight.js +21 -21
  265. package/dist/routes/computer-use/rerun-selection.js +1 -1
  266. package/dist/routes/computer-use/result.js +11 -11
  267. package/dist/routes/computer-use/route.d.ts +2 -1
  268. package/dist/routes/computer-use/route.js +15 -14
  269. package/dist/routes/computer-use/self-report.d.ts +7 -7
  270. package/dist/routes/computer-use/self-report.js +31 -31
  271. package/dist/routes/computer-use/setup.d.ts +1 -1
  272. package/dist/routes/computer-use/setup.js +17 -18
  273. package/dist/routes/computer-use/single-bundle.d.ts +7 -7
  274. package/dist/routes/computer-use/single-bundle.js +28 -30
  275. package/dist/routes/computer-use/subject-projection.d.ts +1 -1
  276. package/dist/routes/computer-use/subject-projection.js +6 -6
  277. package/dist/routes/computer-use/types.d.ts +40 -42
  278. package/dist/routes/computer-use/types.js +10 -10
  279. package/dist/routes/preview.d.ts +8 -2
  280. package/dist/routes/preview.js +8 -4
  281. package/dist/routes/scripted/bundle.d.ts +2 -2
  282. package/dist/routes/scripted/bundle.js +13 -12
  283. package/dist/routes/scripted/plan.d.ts +1 -1
  284. package/dist/routes/scripted/plan.js +9 -9
  285. package/dist/routes/scripted/result.js +5 -5
  286. package/dist/routes/scripted/route.js +5 -6
  287. package/dist/routes/scripted/scenario.js +2 -2
  288. package/dist/routes/scripted/setup.js +7 -7
  289. package/dist/routes/scripted/subject.js +1 -1
  290. package/dist/routes/scripted/surface-records.js +3 -3
  291. package/dist/routes/scripted/types.d.ts +3 -5
  292. package/dist/routes/scripted/types.js +1 -1
  293. package/dist/routes/shared-world/bundle-records.js +9 -8
  294. package/dist/routes/shared-world/bundle.d.ts +5 -5
  295. package/dist/routes/shared-world/bundle.js +40 -38
  296. package/dist/routes/shared-world/checkpoints.d.ts +1 -1
  297. package/dist/routes/shared-world/checkpoints.js +1 -1
  298. package/dist/routes/shared-world/comms.d.ts +5 -5
  299. package/dist/routes/shared-world/comms.js +14 -14
  300. package/dist/routes/shared-world/external-public.d.ts +4 -3
  301. package/dist/routes/shared-world/external-public.js +16 -12
  302. package/dist/routes/shared-world/handoff.d.ts +7 -6
  303. package/dist/routes/shared-world/handoff.js +65 -57
  304. package/dist/routes/shared-world/lobby-code.d.ts +2 -2
  305. package/dist/routes/shared-world/lobby-code.js +9 -9
  306. package/dist/routes/shared-world/participant-specs.d.ts +7 -6
  307. package/dist/routes/shared-world/participant-specs.js +31 -24
  308. package/dist/routes/shared-world/plan.js +7 -7
  309. package/dist/routes/shared-world/provenance.d.ts +2 -2
  310. package/dist/routes/shared-world/provenance.js +2 -2
  311. package/dist/routes/shared-world/provisioned.js +14 -13
  312. package/dist/routes/shared-world/result.js +20 -21
  313. package/dist/routes/shared-world/route.js +23 -22
  314. package/dist/routes/shared-world/setup.d.ts +3 -3
  315. package/dist/routes/shared-world/setup.js +4 -4
  316. package/dist/routes/shared-world/types.d.ts +30 -28
  317. package/dist/routes/shared-world/types.js +4 -4
  318. package/dist/routes/terminal/adapter.d.ts +3 -3
  319. package/dist/routes/terminal/adapter.js +5 -5
  320. package/dist/routes/terminal/bundle.d.ts +3 -3
  321. package/dist/routes/terminal/bundle.js +22 -21
  322. package/dist/routes/terminal/credentials.d.ts +4 -4
  323. package/dist/routes/terminal/credentials.js +7 -7
  324. package/dist/routes/terminal/dry-run.js +4 -4
  325. package/dist/routes/terminal/encoding.js +2 -2
  326. package/dist/routes/terminal/ledger.d.ts +3 -3
  327. package/dist/routes/terminal/ledger.js +14 -14
  328. package/dist/routes/terminal/live-finish.js +3 -3
  329. package/dist/routes/terminal/live-sandbox.js +12 -13
  330. package/dist/routes/terminal/persona.js +1 -1
  331. package/dist/routes/terminal/plan.js +11 -11
  332. package/dist/routes/terminal/recorder.js +2 -2
  333. package/dist/routes/terminal/result.js +8 -8
  334. package/dist/routes/terminal/route.js +6 -7
  335. package/dist/routes/terminal/sandbox.d.ts +1 -1
  336. package/dist/routes/terminal/sandbox.js +1 -1
  337. package/dist/routes/terminal/session.js +8 -7
  338. package/dist/routes/terminal/token-usage.d.ts +1 -1
  339. package/dist/routes/terminal/token-usage.js +7 -8
  340. package/dist/routes/terminal/trace.d.ts +2 -2
  341. package/dist/routes/terminal/trace.js +2 -2
  342. package/dist/routes/terminal/types.d.ts +26 -28
  343. package/dist/routes/terminal/types.js +3 -3
  344. package/dist/run/bundle-shape.js +3 -3
  345. package/dist/run/bundle.d.ts +46 -46
  346. package/dist/run/bundle.js +2 -1
  347. package/dist/run/cost-summary.js +3 -3
  348. package/dist/run/costs.js +7 -1
  349. package/dist/run/detail.d.ts +6 -6
  350. package/dist/run/detail.js +4 -4
  351. package/dist/run/dry-run-inputs.js +1 -1
  352. package/dist/run/dry-run.js +18 -18
  353. package/dist/run/judge.d.ts +19 -13
  354. package/dist/run/judge.js +18 -8
  355. package/dist/run/paths.d.ts +1 -1
  356. package/dist/run/paths.js +1 -1
  357. package/dist/run/pricing.d.ts +11 -6
  358. package/dist/run/pricing.js +20 -13
  359. package/dist/run/projection.d.ts +14 -14
  360. package/dist/run/projection.js +15 -15
  361. package/dist/run/reclaim.js +2 -2
  362. package/dist/run/results.d.ts +5 -5
  363. package/dist/run/run-index.d.ts +8 -6
  364. package/dist/run/run-index.js +15 -16
  365. package/dist/run/run-not-found.d.ts +5 -0
  366. package/dist/run/run-not-found.js +15 -0
  367. package/dist/run/run.d.ts +5 -4
  368. package/dist/run/run.js +1 -1
  369. package/dist/run/sandbox-receipts.d.ts +2 -2
  370. package/dist/run/sandbox-receipts.js +3 -3
  371. package/dist/run/shared-world-evidence.d.ts +36 -35
  372. package/dist/run/shared-world-evidence.js +4 -4
  373. package/dist/run/shared-world-shape.d.ts +1 -1
  374. package/dist/run/shared-world-shape.js +6 -6
  375. package/dist/run/stats.d.ts +12 -6
  376. package/dist/run/stats.js +116 -58
  377. package/dist/run/status.d.ts +8 -29
  378. package/dist/run/status.js +5 -27
  379. package/dist/run/stored-runs.js +2 -1
  380. package/dist/run/stream-shape.js +1 -1
  381. package/dist/run/streams.d.ts +6 -6
  382. package/dist/run/study-provenance.d.ts +47 -0
  383. package/dist/run/study-provenance.js +63 -0
  384. package/dist/run/study-result.d.ts +16 -0
  385. package/dist/run/study-result.js +9 -0
  386. package/dist/run/text.d.ts +2 -0
  387. package/dist/run/text.js +4 -0
  388. package/dist/run-lab.d.ts +7 -7
  389. package/dist/run-lab.js +1 -3
  390. package/dist/study/convert.d.ts +33 -0
  391. package/dist/study/convert.js +432 -0
  392. package/dist/study/field-paths.d.ts +12 -0
  393. package/dist/study/field-paths.js +126 -0
  394. package/dist/study/files.d.ts +26 -0
  395. package/dist/study/files.js +43 -0
  396. package/dist/study/migrate.d.ts +48 -0
  397. package/dist/study/migrate.js +408 -0
  398. package/dist/study/owned-files.d.ts +38 -0
  399. package/dist/study/owned-files.js +182 -0
  400. package/dist/subject/clone.d.ts +1 -1
  401. package/dist/subject/desktop-cli.d.ts +1 -1
  402. package/dist/subject/desktop-cli.js +2 -2
  403. package/dist/subject/local-tree-archive.js +1 -1
  404. package/dist/subject/local-tree.d.ts +1 -1
  405. package/dist/subject/node-bootstrap.js +1 -1
  406. package/dist/subject/runtime.js +8 -9
  407. package/dist/subject/serve.d.ts +1 -1
  408. package/dist/subject/serve.js +3 -3
  409. package/dist/subject/state.d.ts +1 -1
  410. package/dist/subject/steps.d.ts +5 -5
  411. package/dist/subject/steps.js +4 -4
  412. package/dist/substrates/command-failure.d.ts +3 -3
  413. package/dist/substrates/command-failure.js +3 -3
  414. package/dist/substrates/detached.d.ts +6 -6
  415. package/dist/substrates/detached.js +7 -7
  416. package/dist/substrates/e2b/cdp-probe.d.ts +9 -9
  417. package/dist/substrates/e2b/cdp-probe.js +14 -17
  418. package/dist/substrates/e2b/desktop-browser.d.ts +2 -2
  419. package/dist/substrates/e2b/desktop-browser.js +8 -8
  420. package/dist/substrates/e2b/desktop-cdp.d.ts +9 -9
  421. package/dist/substrates/e2b/desktop-cdp.js +8 -8
  422. package/dist/substrates/e2b/desktop-executor.d.ts +1 -1
  423. package/dist/substrates/e2b/desktop-executor.js +1 -1
  424. package/dist/substrates/e2b/desktop-geometry.d.ts +3 -3
  425. package/dist/substrates/e2b/desktop-geometry.js +7 -7
  426. package/dist/substrates/e2b/desktop-media.d.ts +1 -1
  427. package/dist/substrates/e2b/desktop-media.js +1 -1
  428. package/dist/substrates/e2b/desktop-screenshot-cleanup.d.ts +3 -3
  429. package/dist/substrates/e2b/desktop-screenshot-cleanup.js +3 -3
  430. package/dist/substrates/e2b/sandbox.d.ts +1 -1
  431. package/dist/substrates/e2b/sandbox.js +1 -1
  432. package/dist/substrates/e2b/sdk.d.ts +11 -11
  433. package/dist/substrates/e2b/sdk.js +6 -6
  434. package/dist/tui/actions.d.ts +1 -1
  435. package/dist/tui/actions.js +13 -13
  436. package/dist/tui/contract.d.ts +16 -16
  437. package/dist/tui/contract.js +10 -10
  438. package/dist/tui/launch.d.ts +4 -4
  439. package/dist/tui/launch.js +18 -19
  440. package/dist/tui/project.js +5 -5
  441. package/dist/tui-app.js +82 -82
  442. package/dist/verify/actor.d.ts +8 -8
  443. package/dist/verify/actor.js +36 -36
  444. package/dist/verify/artifacts.d.ts +2 -2
  445. package/dist/verify/artifacts.js +3 -3
  446. package/dist/verify/context-growth.d.ts +9 -0
  447. package/dist/verify/context-growth.js +62 -0
  448. package/dist/verify/costs.d.ts +6 -6
  449. package/dist/verify/costs.js +8 -8
  450. package/dist/verify/shared-world-concurrent.d.ts +2 -2
  451. package/dist/verify/shared-world-concurrent.js +79 -76
  452. package/dist/verify/shared-world.d.ts +2 -2
  453. package/dist/verify/shared-world.js +16 -16
  454. package/dist/verify/subject.d.ts +4 -4
  455. package/dist/verify/subject.js +18 -18
  456. package/dist/verify/verify.js +92 -43
  457. package/docs/README.md +25 -32
  458. package/docs/architecture/actor-contract.md +56 -87
  459. package/docs/architecture/desktop-sessions.md +7 -7
  460. package/docs/architecture/external-public-shared-world.md +61 -59
  461. package/docs/architecture/github-feedback-loop.md +1 -4
  462. package/docs/architecture/guest-desktop.md +2 -2
  463. package/docs/architecture/observer.md +34 -34
  464. package/docs/architecture/restricted-codex-analysis.md +34 -28
  465. package/docs/architecture/serve.md +34 -37
  466. package/docs/architecture/state-driven-executor.md +55 -58
  467. package/docs/architecture/task-protocol-support.md +5 -5
  468. package/docs/architecture/terminal-product-route.md +67 -107
  469. package/docs/contracts/README.md +24 -0
  470. package/docs/contracts/adapter-admission.md +3 -3
  471. package/docs/contracts/adapter-fixtures.md +2 -5
  472. package/docs/contracts/core.md +1 -3
  473. package/docs/contracts/errors.md +62 -0
  474. package/docs/contracts/feedback.md +8 -9
  475. package/docs/contracts/policy.md +7 -12
  476. package/docs/contracts/run-bundle.md +45 -44
  477. package/docs/contracts/schemas.md +421 -362
  478. package/docs/contracts/study-analysis.md +3 -3
  479. package/docs/contracts/study-costs.md +11 -7
  480. package/docs/decisions/0001-run-bundle-is-the-source-of-truth.md +1 -1
  481. package/docs/decisions/0002-observer-is-one-self-contained-file.md +2 -2
  482. package/docs/decisions/0003-contained-paths-and-cleanup-authority.md +3 -3
  483. package/docs/principles/actor-fidelity.md +4 -4
  484. package/docs/principles/engineering.md +3 -3
  485. package/docs/principles/invariants-and-defaults.md +38 -38
  486. package/docs/principles/self-driving-harness.md +1 -5
  487. package/docs/principles/three-roles.md +1 -1
  488. package/docs/product/automatic-analysis.md +7 -7
  489. package/examples/participant/README.md +5 -5
  490. package/examples/participant/run.mjs +11 -10
  491. package/examples/scorer/README.md +3 -3
  492. package/examples/scorer/run.mjs +11 -12
  493. package/package.json +16 -17
  494. package/skills/humanish/SKILL.md +60 -58
  495. package/skills/humanish/agents/openai.yaml +1 -1
  496. package/AGENTS.md +0 -99
  497. package/CONTRIBUTING.md +0 -148
  498. package/dist/actors/codex/qualified-versions.d.ts +0 -72
  499. package/dist/actors/codex/qualified-versions.js +0 -132
  500. package/dist/cli/commands/lab.d.ts +0 -3
  501. package/dist/cli/commands/lab.js +0 -199
  502. package/dist/cli/renamed-options.d.ts +0 -11
  503. package/dist/cli/renamed-options.js +0 -18
  504. package/dist/observer/static.d.ts +0 -39
  505. package/dist/observer/static.js +0 -369
  506. package/docs/architecture/comms-inbox.md +0 -122
  507. package/docs/architecture/desktop-recording.md +0 -80
  508. package/docs/architecture/local-browser-runtime.md +0 -178
  509. package/docs/architecture/observer-review.md +0 -144
  510. package/docs/architecture/participant-media.md +0 -90
  511. package/docs/architecture/project-layout.md +0 -62
  512. package/docs/architecture/real-email-receiving.md +0 -136
  513. package/docs/assets/humanish-drawdb-hero.png +0 -0
  514. package/docs/assets/humanish-observer-hero.png +0 -0
  515. package/docs/goals/current.md +0 -207
  516. package/docs/product/lobby-trivia-3player-external-public.md +0 -77
  517. package/docs/product/open-source-install-experience.md +0 -240
  518. package/docs/ramp/README.md +0 -295
  519. package/docs/release/open-source-readiness.md +0 -222
  520. package/docs/release/public-readiness-standard.md +0 -210
  521. package/docs/roadmap/world-class-open-source-v0.md +0 -311
@@ -11,7 +11,7 @@ const OBSERVER_DATA_PLACEHOLDER = "__HUMANISH_OBSERVER_DATA__";
11
11
  const OBSERVER_DATA_SLOT = `<script id="observer-data" type="application/json">${OBSERVER_DATA_PLACEHOLDER}</script>`;
12
12
  let cachedObserverArtifact = null;
13
13
  /**
14
- * Resolve — and in a repo checkout, build — the Observer artifact BEFORE any run or
14
+ * Resolve (and in a repo checkout, build) the Observer artifact before any run or
15
15
  * lab work starts. A missing artifact must cost seconds at startup, never a completed
16
16
  * session (a live participant spends real money before the render step would have noticed).
17
17
  * Unconditional on purpose: the artifact is the only renderer now, so the fail-before-
@@ -42,7 +42,7 @@ function loadObserverArtifact() {
42
42
  // together) must not race one `vite build` output: a reader can catch the
43
43
  // artifact half-written. A mkdir lock serializes builders across processes;
44
44
  // whoever loses the race re-checks staleness and usually just reads.
45
- // The lock lives OUTSIDE dist/ (vite empties dist mid-build) and inside an
45
+ // The lock lives outside dist/ (vite empties dist mid-build) and inside an
46
46
  // ignored path so a crashed builder cannot dirty the tree.
47
47
  const lockDir = path.join(workspaceDir, "node_modules", ".observer-build-lock");
48
48
  mkdirSync(path.dirname(lockDir), { recursive: true });
@@ -50,7 +50,7 @@ function loadObserverArtifact() {
50
50
  for (;;) {
51
51
  try {
52
52
  mkdirSync(lockDir);
53
- break; // lock acquired — this process builds
53
+ break; // lock acquired: this process builds
54
54
  }
55
55
  catch {
56
56
  if (Date.now() > deadline)
@@ -71,7 +71,7 @@ function loadObserverArtifact() {
71
71
  try {
72
72
  // NODE_ENV is forced: Vite respects a preset NODE_ENV (test, development),
73
73
  // and a dev-flavored artifact embeds jsxDEV plus the builder's absolute
74
- // filesystem paths — which the run's public-safety scan then rightly rejects.
74
+ // filesystem paths, which the run's public-safety scan then rightly rejects.
75
75
  execSync("pnpm --filter humanish-observer build", {
76
76
  cwd: repoRoot,
77
77
  stdio: ["ignore", "pipe", "inherit"],
@@ -79,7 +79,7 @@ function loadObserverArtifact() {
79
79
  });
80
80
  }
81
81
  catch {
82
- throw new Error("observer workspace build failed — run `pnpm --filter humanish-observer build` for the full output.");
82
+ throw new Error("observer workspace build failed; run `pnpm --filter humanish-observer build` to see the full output.");
83
83
  }
84
84
  }
85
85
  }
@@ -169,7 +169,7 @@ function renderObserverAppHtml(data, snapshot, analysis, assets) {
169
169
  .replace(OBSERVER_DATA_SLOT, () => `<script id="observer-data" type="application/json">${escapeJsonScript(data)}</script>`)
170
170
  .replace(/<script id="study-analysis" type="application\/json">[\s\S]*?<\/script>/, () => `<script id="study-analysis" type="application/json">${escapeJsonScript(analysis)}</script>`)
171
171
  .replace("</body>", () => `${renderExportAssets(assets)}</body>`)
172
- .replace(/<title>[^<]*<\/title>/, () => `<title>humanish Observer — ${escapeHtml(data.run.runId)}</title>`);
172
+ .replace(/<title>[^<]*<\/title>/, () => `<title>humanish Observer · ${escapeHtml(data.run.runId)}</title>`);
173
173
  }
174
174
  /** Render current packaged UI around a validated/projected Observer snapshot. */
175
175
  export function renderObserverHtml(data, options = {}) {
@@ -31,18 +31,18 @@ export interface ObserverData {
31
31
  lifecycle: RunBundle["lifecycle"];
32
32
  knownGaps: string[];
33
33
  /**
34
- * What happened to the PARTICIPANTS, with the denominator attached. `status` above collapses the
34
+ * What happened to the participants, with the denominator attached. `status` above collapses the
35
35
  * run to one word for a gate; this is the study result, and it is what the person watching
36
36
  * through the glass actually wants to know. Absent on a bundle with no participants.
37
37
  *
38
- * A viewing room that shows only vivid moments manufactures certainty from n=1 — so the count
38
+ * A viewing room that shows only vivid moments manufactures certainty from n=1, so the count
39
39
  * travels with the outcome here, always (docs/principles/three-roles.md).
40
40
  */
41
41
  participants?: RunBundle["review"]["participants"];
42
42
  /** The same thing as one readable line, so a renderer cannot accidentally show a number
43
43
  * without its denominator. */
44
44
  participantsLine?: string;
45
- /** The study's per-task completion rates (#414), when the lab declared a protocol. */
45
+ /** The study's per-task completion rates, when the lab declared a protocol. */
46
46
  tasks?: RunBundle["review"]["tasks"];
47
47
  /** Pre-formatted like participantsLine, denominator on every number. */
48
48
  tasksLine?: string;
@@ -56,8 +56,8 @@ export interface ObserverData {
56
56
  };
57
57
  laneGroups: ObserverLaneGroup[];
58
58
  /**
59
- * OPTIONAL run-level cost ESTIMATE projected straight through from the bundle
60
- * (humanish.run-cost-summary.v1). Absent when the bundle carries none. The Observer LABELS every
59
+ * Optional run-level cost estimate projected straight through from the bundle
60
+ * (humanish.run-cost-summary.v1). Absent when the bundle carries none. The Observer labels every
61
61
  * figure as estimated (rates as of <asOf>) and never presents it as an authoritative charge.
62
62
  */
63
63
  cost?: RunCostSummary;
@@ -68,7 +68,7 @@ export interface ObserverData {
68
68
  publishable: false;
69
69
  note: string;
70
70
  /**
71
- * ADDITIVE + OPTIONAL (#584): the result of verification at static render or
71
+ * Additive + optional: the result of verification at static render or
72
72
  * export time. Unverified projections omit this field. The timestamp records
73
73
  * that check; it is not an assertion about subsequent file changes.
74
74
  */
@@ -33,7 +33,7 @@ export function buildObserverData(bundle, generatedAt = new Date().toISOString()
33
33
  const sim = bundle.simulations.find((candidate) => candidate.id === stream.simId) ??
34
34
  fallbackSimulation(bundle, stream);
35
35
  // A natural session can finish its protocol while the participant explicitly reports a
36
- // blocker (#690). Match the review's typed-outcome rule without rewriting the raw trace or
36
+ // blocker. Match the review's typed-outcome rule without rewriting the raw trace or
37
37
  // guessing from prose. Never turn an active or failed harness into a participant outcome.
38
38
  const status = (stream.status === "passed" || stream.status === "complete") &&
39
39
  stream.actor?.completionReason === "goal_satisfied" &&
@@ -47,7 +47,7 @@ export function buildObserverData(bundle, generatedAt = new Date().toISOString()
47
47
  status,
48
48
  sim,
49
49
  kindLabel: kindLabel(stream.kind),
50
- statusLabel: statusLabel(status),
50
+ statusLabel: statusLabel(status, bundle.mode),
51
51
  terminalPlain: stripAnsi(stream.terminal?.tail ?? ""),
52
52
  timeline: [
53
53
  ...events.filter((event) => event.simId === sim.id || event.streamId === stream.id),
@@ -229,10 +229,11 @@ function kindLabel(kind) {
229
229
  return "Summary";
230
230
  }
231
231
  }
232
- function statusLabel(status) {
232
+ /** `contract_proof_only` reads "Dry run" on a dry run; a live participant with it has no result. */
233
+ function statusLabel(status, mode) {
233
234
  switch (status) {
234
235
  case "contract_proof_only":
235
- return "Contract proof";
236
+ return mode === "dry-run" ? "Dry run" : "No verdict";
236
237
  case "preparing":
237
238
  return "Preparing";
238
239
  case "queued":
@@ -47,7 +47,7 @@ export type ExposureValidation = {
47
47
  };
48
48
  };
49
49
  /** Why `watch` refuses `--safe`, on every watch path. */
50
- export declare const WATCH_SAFE_NOT_APPLICABLE_MESSAGE = "watch streams a single live run that is never share_ready; --safe (a share_ready library filter) applies to `serve`, not `watch`. Restrict viewers with edge auth: --allow-email / --allow-domain.";
50
+ export declare const WATCH_SAFE_NOT_APPLICABLE_MESSAGE = "watch streams a single live run that is never share_ready, so --safe (a share_ready library filter for `observe --all`) cannot apply. Restrict viewers with edge auth: --allow-email / --allow-domain.";
51
51
  export declare function validateExposure(surface: ExposureSurface, request: ExposureRequest, live?: WatchLiveContext): ExposureValidation;
52
52
  export interface ExposableServer {
53
53
  readonly port: number;
@@ -1,15 +1,15 @@
1
- // Shared fail-closed exposure validation + tunnel orchestration for BOTH `serve` (a library of
2
- // finished runs) and `watch` (one live run). Exposure auth is TUNNEL-EDGE only: humanish carries no
1
+ // Shared fail-closed exposure validation + tunnel orchestration for both `serve` (a library of
2
+ // finished runs) and `watch` (one live run). Exposure auth is tunnel-edge only: humanish carries no
3
3
  // in-process auth. Exposure is admitted only behind edge auth (ngrok --oauth google, or an operator
4
- // --public-url they secure) OR, for serve, behind --safe (share_ready runs only). A live watch run
5
- // is never share_ready (raw, unverified screenshots), so watch --expose ALWAYS requires edge auth.
4
+ // --public-url they secure) or, for serve, behind --safe (share_ready runs only). A live watch run
5
+ // is never share_ready (raw, unverified screenshots), so watch --expose always requires edge auth.
6
6
  //
7
7
  // This module is pure with respect to the fail-closed matrix (validateExposure) and thin over the
8
8
  // tunnel launcher (startExposedObserver), so the CLI just maps flags in and results out.
9
9
  import { parsePublicOrigin } from "./http.js";
10
10
  import { startNgrokTunnel } from "./tunnel.js";
11
11
  /** Why `watch` refuses `--safe`, on every watch path. */
12
- export const WATCH_SAFE_NOT_APPLICABLE_MESSAGE = "watch streams a single live run that is never share_ready; --safe (a share_ready library filter) applies to `serve`, not `watch`. Restrict viewers with edge auth: --allow-email / --allow-domain.";
12
+ export const WATCH_SAFE_NOT_APPLICABLE_MESSAGE = "watch streams a single live run that is never share_ready, so --safe (a share_ready library filter for `observe --all`) cannot apply. Restrict viewers with edge auth: --allow-email / --allow-domain.";
13
13
  function code(surface, suffix) {
14
14
  return `HUMANISH_${surface.toUpperCase()}_${suffix}`;
15
15
  }
@@ -70,12 +70,12 @@ export function validateExposure(surface, request, live) {
70
70
  const warnings = [];
71
71
  if (surface === "watch") {
72
72
  // A live, in-progress run is never share_ready (raw screenshots, unverified), so --safe would
73
- // admit nothing and expose nothing: watch --expose ALWAYS requires edge auth, and the live-follow
73
+ // admit nothing and expose nothing: watch --expose always requires edge auth, and the live-follow
74
74
  // preconditions are checked first so `--dry-run`/`--detach`/`--json` fail with the clearer reason.
75
75
  if (live && (live.dryRun || live.detach || live.json)) {
76
76
  return fail("EXPOSE_REQUIRES_LIVE_FOLLOW", "watch --expose streams a live desktop over an attached follow channel; it cannot combine with --dry-run, --detach, or --json.");
77
77
  }
78
- // --safe is a share_ready LIBRARY filter for `serve`; watch streams a single live run that is
78
+ // --safe is a share_ready library filter for `serve`; watch streams a single live run that is
79
79
  // never share_ready, so --safe would silently do nothing here. Reject it rather than ignore it.
80
80
  if (request.safe) {
81
81
  return fail("SAFE_NOT_APPLICABLE", WATCH_SAFE_NOT_APPLICABLE_MESSAGE);
@@ -85,18 +85,18 @@ export function validateExposure(surface, request, live) {
85
85
  }
86
86
  }
87
87
  else {
88
- // serve: --expose must ALWAYS resolve to a reachable public origin (a tunnel or a --public-url),
88
+ // serve: --expose must always resolve to a reachable public origin (a tunnel or a --public-url),
89
89
  // even under --safe. Without one the exposed server is an unreachable loopback no-op, so fail
90
- // closed before the origin-less bind. When an origin IS present, keep the edge-auth-OR-safe gate.
90
+ // closed before the origin-less bind. When an origin is present, keep the edge-auth-or-safe gate.
91
91
  if (!request.tunnel && !publicOrigin) {
92
92
  return fail("EXPOSE_REQUIRES_ORIGIN", "--expose needs a declared public origin: pass --tunnel ngrok or --public-url <origin>.");
93
93
  }
94
94
  if (!edgeAuthed && !request.safe) {
95
- return fail("EXPOSE_REQUIRES_EDGE_AUTH_OR_SAFE", "--expose opens a public URL to local run bundles; require edge auth (--oauth google with --tunnel, or a --public-url you secure) OR --safe (share_ready runs only).");
95
+ return fail("EXPOSE_REQUIRES_EDGE_AUTH_OR_SAFE", "--expose opens a public URL to local run bundles, so it needs edge auth (--oauth google with --tunnel, or a --public-url you secure) or --safe (share_ready runs only).");
96
96
  }
97
97
  }
98
98
  if (request.oauth && request.allowEmails.length === 0 && request.allowDomains.length === 0) {
99
- warnings.push("ngrok --oauth google with NO --allow-email/--allow-domain lets ANY Google account that reaches the URL in; add at least one allow rule to restrict who can watch.");
99
+ warnings.push("ngrok --oauth google without --allow-email or --allow-domain lets in any Google account that reaches the URL. Add at least one allow rule to choose who can watch.");
100
100
  }
101
101
  const mode = edgeAuthed ? "exposed" : "share-safe-open";
102
102
  return {
@@ -1,4 +1,4 @@
1
- // Shared HTTP hardening primitives for the serve surfaces. Extracted here so BOTH the live
1
+ // Shared HTTP hardening primitives for the serve surfaces. Extracted here so both the live
2
2
  // Observer server (src/observer/render.ts) and the run-library server
3
3
  // (src/observer/serve.ts) can enforce the identical Host allowlist + security-header posture
4
4
  // without a module cycle. This file imports nothing from the serve modules.
@@ -9,7 +9,7 @@ export interface LibraryHistory {
9
9
  /** Current contained status-record observation, separate from the evidence verdict. */
10
10
  runtimeState?: "running" | "finished" | "interrupted" | "unknown";
11
11
  streamCount: number;
12
- /** Labeled run-total cost ESTIMATE (null when the run carries no cost summary). */
12
+ /** Labeled run-total cost estimate (null when the run carries no cost summary). */
13
13
  estimatedCostUsd: number | null;
14
14
  costRatesAsOf: string | null;
15
15
  costPlaceholder: boolean;
@@ -7,8 +7,8 @@ const STATUS_TONES = {
7
7
  };
8
8
  export function renderLibraryHtml(history, opts) {
9
9
  const emptyState = opts.safe
10
- ? "No share_ready runs yet — run `humanish verify` to see why."
11
- : "No runs yet — run `humanish watch` to create one.";
10
+ ? "No share_ready runs yet. Run `humanish verify` to see why."
11
+ : "No runs yet. Run `humanish watch` to create one.";
12
12
  return `<!doctype html>
13
13
  <html lang="en" data-theme="dark">
14
14
  <head>
@@ -39,6 +39,7 @@ function modeLabel(opts) {
39
39
  const auth = opts.mode === "exposed" ? "edge-authed" : opts.mode === "share-safe-open" ? "open" : "loopback";
40
40
  return opts.safe ? `${auth} · share_ready only` : auth;
41
41
  }
42
+ // prose-check: script (the library page's CSS)
42
43
  function libraryCss() {
43
44
  return `
44
45
  :root { color-scheme: dark; }
@@ -80,6 +81,7 @@ main { padding: 1rem 1.1rem 3rem; max-width: 44rem; margin: 0 auto; }
80
81
  .empty { color: #9aa3b2; font-size: 0.85rem; padding: 2rem 0; text-align: center; }
81
82
  `;
82
83
  }
84
+ // prose-check: script (the library page's JavaScript)
83
85
  function libraryClientJs() {
84
86
  const tones = JSON.stringify(STATUS_TONES);
85
87
  return `
@@ -1,9 +1,10 @@
1
1
  // One loopback bind for every humanish server, with the one failure people actually hit named.
2
2
  //
3
- // `listen EADDRINUSE` used to surface as HUMANISH_UNEXPECTED, the command-boundary catch-all for
4
- // "a handler threw" (#484). Something already serving on the port is the most expected condition
5
- // a serve command has: a second session, a forgotten background one, someone's dev server. It only
6
- // bites with an explicit --port, which is exactly when a person is asking for a stable address.
3
+ // `listen EADDRINUSE` becomes PortInUseError: HUMANISH_UNEXPECTED, the command-boundary catch-all
4
+ // for "a handler threw", would misname it. Something already serving on the port is the most
5
+ // expected condition a serve command has: a second session, a forgotten background one, someone's
6
+ // dev server. It only bites with an explicit --port, which is exactly when a person is asking for a
7
+ // stable address.
7
8
  export class PortInUseError extends Error {
8
9
  port;
9
10
  holder;
@@ -48,7 +48,7 @@ export declare function serveObserver(result: ObserverResult, options?: Observer
48
48
  export interface DesktopOpenerHost {
49
49
  platform: NodeJS.Platform;
50
50
  env: NodeJS.ProcessEnv;
51
- /** Whether an executable with this name is on the host's PATH. */
51
+ /** Whether an executable with this name is on the host's `PATH`. */
52
52
  onPath(name: string): boolean;
53
53
  }
54
54
  /**
@@ -1,4 +1,5 @@
1
1
  import { spawn } from "node:child_process";
2
+ import { runNotFoundMessage } from "../run/run-not-found.js";
2
3
  import { accessSync, constants } from "node:fs";
3
4
  import { realpath } from "node:fs/promises";
4
5
  import { createServer } from "node:http";
@@ -22,6 +23,10 @@ const observerPreparedRunPaths = new WeakMap();
22
23
  export function attachObserverRuntimeStreamUrls(result, streams) {
23
24
  observerRuntimeStreamUrls.set(result, streams.filter((stream) => stream.streamId && stream.url));
24
25
  }
26
+ async function runNotFound(cwd, runInput) {
27
+ const message = await runNotFoundMessage(cwd, runInput);
28
+ return observerRunError(cwd, runInput, "HUMANISH_RUN_NOT_FOUND", message);
29
+ }
25
30
  export async function renderObserver(cwdInput, runInput, options = {}) {
26
31
  const cwd = path.resolve(cwdInput);
27
32
  let selection;
@@ -46,7 +51,7 @@ export async function renderObserver(cwdInput, runInput, options = {}) {
46
51
  selection = null;
47
52
  }
48
53
  if (!selection) {
49
- return observerRunError(cwd, runInput, "HUMANISH_RUN_NOT_FOUND", `Run not found: ${runInput}`);
54
+ return runNotFound(cwd, runInput);
50
55
  }
51
56
  let preparedRunPaths;
52
57
  try {
@@ -80,7 +85,7 @@ export async function renderObserver(cwdInput, runInput, options = {}) {
80
85
  const loaded = await loadRunBundlePrepared(selectedPhysicalCwd, preparedRunPaths);
81
86
  await validatePreparedRunArtifactPaths(preparedRunPaths);
82
87
  if (!loaded) {
83
- return observerRunError(cwd, runInput, "HUMANISH_RUN_NOT_FOUND", `Run not found: ${runInput}`);
88
+ return runNotFound(cwd, runInput);
84
89
  }
85
90
  if (loaded.bundle.runId !== selection.runId ||
86
91
  (await realpath(loaded.runDir)) !== preparedRunPaths.physicalRunRoot) {
@@ -118,7 +123,7 @@ export async function renderObserver(cwdInput, runInput, options = {}) {
118
123
  warnings: [
119
124
  loaded.bundle.mode === "live"
120
125
  ? "Observer renders verified local evidence artifacts; runtime stream auth URLs are not persisted."
121
- : "Observer renders local contract evidence only; dry-run participants do not claim product behavior proof.",
126
+ : "This is a dry run: its participants are synthetic and no product behavior was tested.",
122
127
  "Before filing public feedback, use `humanish feedback issue` so redaction and public-safety checks gate the payload.",
123
128
  ...(openResult.warning ? [openResult.warning] : []),
124
129
  ],
@@ -290,7 +295,7 @@ export function desktopOpener(target, host) {
290
295
  if (host.platform === "win32")
291
296
  return { command: "cmd", args: ["/c", "start", "", target] };
292
297
  if (!host.env.DISPLAY && !host.env.WAYLAND_DISPLAY)
293
- return { reason: "no display is available (DISPLAY and WAYLAND_DISPLAY are unset)" };
298
+ return { reason: "no display is available (`DISPLAY` and `WAYLAND_DISPLAY` are unset)" };
294
299
  if (!host.onPath("xdg-open"))
295
300
  return { reason: "xdg-open is not installed" };
296
301
  return { command: "xdg-open", args: [target] };
@@ -322,7 +327,7 @@ export function openTarget(target, host = { platform: process.platform, env: pro
322
327
  detached: true,
323
328
  stdio: "ignore",
324
329
  });
325
- // An opener that disappears after the PATH check still fails asynchronously (ENOENT). The
330
+ // An opener that disappears after the `PATH` check still fails asynchronously (ENOENT). The
326
331
  // served URL remains usable; an opener must never crash its server.
327
332
  child.on("error", () => { });
328
333
  child.unref();
@@ -5,13 +5,13 @@ export interface ObserverRuntimeStreamUrl {
5
5
  streamId: string;
6
6
  url: string;
7
7
  /** Set when the participant's sandbox is gone (finished or torn down). An ended stream's live URL is a
8
- * dead noVNC page — the overlay stops injecting it so the tile falls back to the recorded
9
- * evidence (keyframe replay/screenshot) instead of rendering "sandbox not found" (#357). */
8
+ * dead noVNC page; the overlay stops injecting it so the tile falls back to the recorded
9
+ * evidence (keyframe replay/screenshot) instead of rendering "sandbox not found". */
10
10
  ended?: boolean;
11
11
  }
12
12
  /** internal: consumed by src/observer/serve.ts */
13
13
  export declare function serveRunPath(runRoot: PinnedDirectory, relativePath: string, response: ServerResponse, runtimeStreamUrls?: ObserverRuntimeStreamUrl[], request?: Pick<IncomingMessage, "method" | "headers">): Promise<void>;
14
- /** internal: exported for the #357 lifecycle tests. */
14
+ /** internal: exported for the stream lifecycle tests. */
15
15
  export declare function withRuntimeStreamUrls(data: ObserverData, runtimeStreamUrls: ObserverRuntimeStreamUrl[]): ObserverData;
16
16
  /** internal: consumed by src/observer/serve.ts */
17
17
  export declare function buildHistoryIndex(proofRoot: PinnedDirectory, admitRun?: (runId: string, pinned: PinnedDirectory) => Promise<PinnedDirectory | null>): Promise<{
@@ -161,7 +161,7 @@ async function withLocalRunStatus(runRoot, input) {
161
161
  return data;
162
162
  }
163
163
  }
164
- /** internal: exported for the #357 lifecycle tests. */
164
+ /** internal: exported for the stream lifecycle tests. */
165
165
  export function withRuntimeStreamUrls(data, runtimeStreamUrls) {
166
166
  const byStream = new Map(runtimeStreamUrls.map((stream) => [stream.streamId, stream]));
167
167
  return {
@@ -1,4 +1,5 @@
1
1
  import { listenOnLoopback, PortInUseError } from "./listen.js";
2
+ import { runNotFoundMessage } from "../run/run-not-found.js";
2
3
  import { createServer } from "node:http";
3
4
  import path from "node:path";
4
5
  import { pinDirectChildDirectory, pinDirectory } from "./pinned-files.js";
@@ -215,7 +216,10 @@ export async function serveObserverLibrary(cwdInput, options) {
215
216
  if (!resolved || !pinned) {
216
217
  return {
217
218
  ok: false,
218
- error: { code: "HUMANISH_RUN_NOT_FOUND", message: `Run not found: ${options.entryRunId}` },
219
+ error: {
220
+ code: "HUMANISH_RUN_NOT_FOUND",
221
+ message: await runNotFoundMessage(cwd, options.entryRunId),
222
+ },
219
223
  };
220
224
  }
221
225
  if (options.safe && (await admission.admit(resolved)) === null) {
@@ -232,7 +236,7 @@ export async function serveObserverLibrary(cwdInput, options) {
232
236
  }
233
237
  entryRunId = resolved;
234
238
  }
235
- // Counts are computed over the UNCAPPED run list, not the 80-item history
239
+ // Counts are computed over the uncapped run list, not the 80-item history
236
240
  // index: an edge-authed surface (non-safe) grants access to every run by direct
237
241
  // URL, and share-safe modes admit every share_ready run per request, so a
238
242
  // count capped at 80 would understate exactly what the exposure warning
@@ -277,7 +281,7 @@ export async function serveObserverLibrary(cwdInput, options) {
277
281
  }
278
282
  catch (error) {
279
283
  if (error instanceof PortInUseError) {
280
- // The most expected failure a serve command has, named instead of HUMANISH_UNEXPECTED (#484).
284
+ // The most expected failure a serve command has, named instead of HUMANISH_UNEXPECTED.
281
285
  return { ok: false, error: { code: "HUMANISH_SERVE_PORT_IN_USE", message: error.message } };
282
286
  }
283
287
  throw error;
@@ -54,7 +54,7 @@ export async function startNgrokTunnel(options) {
54
54
  child.once("error", (error) => {
55
55
  settle({
56
56
  error: error.code === "ENOENT"
57
- ? new ServeTunnelError("HUMANISH_SERVE_TUNNEL_NOT_FOUND", "ngrok binary not found on PATH. Install ngrok, or run your own tunnel and pass --public-url <origin>.")
57
+ ? new ServeTunnelError("HUMANISH_SERVE_TUNNEL_NOT_FOUND", "ngrok binary not found on `PATH`. Install ngrok, or run your own tunnel and pass --public-url <origin>.")
58
58
  : new ServeTunnelError("HUMANISH_SERVE_TUNNEL_START_FAILED", `ngrok failed to start: ${error.message}`),
59
59
  });
60
60
  });