humanish 0.96.1 → 0.98.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 (193) hide show
  1. package/AGENTS.md +86 -79
  2. package/CONTRIBUTING.md +7 -2
  3. package/README.md +11 -2
  4. package/dist/actor-contract.d.ts +35 -1
  5. package/dist/actor-contract.js +38 -0
  6. package/dist/actor-contract.js.map +1 -1
  7. package/dist/adapter-extension.js +1 -0
  8. package/dist/adapter-extension.js.map +1 -1
  9. package/dist/automatic-analysis-config.d.ts +15 -5
  10. package/dist/automatic-analysis-config.js +25 -4
  11. package/dist/automatic-analysis-config.js.map +1 -1
  12. package/dist/automatic-study-analysis.js +4 -2
  13. package/dist/automatic-study-analysis.js.map +1 -1
  14. package/dist/browser-control-client.d.ts +14 -0
  15. package/dist/browser-control-client.js +134 -0
  16. package/dist/browser-control-client.js.map +1 -0
  17. package/dist/browser-control-dispatcher.d.ts +14 -0
  18. package/dist/browser-control-dispatcher.js +109 -0
  19. package/dist/browser-control-dispatcher.js.map +1 -0
  20. package/dist/browser-control-protocol.d.ts +371 -0
  21. package/dist/browser-control-protocol.js +155 -0
  22. package/dist/browser-control-protocol.js.map +1 -0
  23. package/dist/browser-control-transport.d.ts +24 -0
  24. package/dist/browser-control-transport.js +156 -0
  25. package/dist/browser-control-transport.js.map +1 -0
  26. package/dist/comms-lease-store.d.ts +1 -0
  27. package/dist/comms-lease-store.js +9 -3
  28. package/dist/comms-lease-store.js.map +1 -1
  29. package/dist/computer-use-actor.d.ts +2 -2
  30. package/dist/computer-use-actor.js +6 -1
  31. package/dist/computer-use-actor.js.map +1 -1
  32. package/dist/computer-use.d.ts +23 -1
  33. package/dist/computer-use.js +253 -70
  34. package/dist/computer-use.js.map +1 -1
  35. package/dist/cua-actor-lab.d.ts +24 -289
  36. package/dist/cua-actor-lab.js +203 -1983
  37. package/dist/cua-actor-lab.js.map +1 -1
  38. package/dist/cua-desktop-lane.d.ts +35 -0
  39. package/dist/cua-desktop-lane.js +13 -0
  40. package/dist/cua-desktop-lane.js.map +1 -0
  41. package/dist/cua-executor-error.d.ts +31 -0
  42. package/dist/cua-executor-error.js +48 -0
  43. package/dist/cua-executor-error.js.map +1 -0
  44. package/dist/cua-provider-error.d.ts +12 -0
  45. package/dist/cua-provider-error.js +28 -0
  46. package/dist/cua-provider-error.js.map +1 -0
  47. package/dist/desktop-session.d.ts +41 -0
  48. package/dist/desktop-session.js +46 -0
  49. package/dist/desktop-session.js.map +1 -0
  50. package/dist/doctor-lab.d.ts +8 -1
  51. package/dist/doctor-lab.js +40 -8
  52. package/dist/doctor-lab.js.map +1 -1
  53. package/dist/e2b-cua-desktop.d.ts +3 -0
  54. package/dist/e2b-cua-desktop.js +675 -0
  55. package/dist/e2b-cua-desktop.js.map +1 -0
  56. package/dist/e2b-cua-provisioning.d.ts +311 -0
  57. package/dist/e2b-cua-provisioning.js +1213 -0
  58. package/dist/e2b-cua-provisioning.js.map +1 -0
  59. package/dist/e2b-desktop-executor.d.ts +1 -24
  60. package/dist/e2b-desktop-executor.js +2 -127
  61. package/dist/e2b-desktop-executor.js.map +1 -1
  62. package/dist/e2b-desktop-session.d.ts +7 -0
  63. package/dist/e2b-desktop-session.js +29 -0
  64. package/dist/e2b-desktop-session.js.map +1 -0
  65. package/dist/e2b-terminal-lab.js +1 -0
  66. package/dist/e2b-terminal-lab.js.map +1 -1
  67. package/dist/frame-signature.d.ts +24 -0
  68. package/dist/frame-signature.js +128 -0
  69. package/dist/frame-signature.js.map +1 -0
  70. package/dist/guest-bootstrap.d.ts +43 -0
  71. package/dist/guest-bootstrap.js +240 -0
  72. package/dist/guest-bootstrap.js.map +1 -0
  73. package/dist/guest-browser-tools.d.ts +8 -0
  74. package/dist/guest-browser-tools.js +66 -0
  75. package/dist/guest-browser-tools.js.map +1 -0
  76. package/dist/guest-chromium-text.d.ts +27 -0
  77. package/dist/guest-chromium-text.js +281 -0
  78. package/dist/guest-chromium-text.js.map +1 -0
  79. package/dist/guest-desktop-executor.d.ts +22 -0
  80. package/dist/guest-desktop-executor.js +177 -0
  81. package/dist/guest-desktop-executor.js.map +1 -0
  82. package/dist/guest-desktop-native.d.ts +14 -0
  83. package/dist/guest-desktop-native.js +131 -0
  84. package/dist/guest-desktop-native.js.map +1 -0
  85. package/dist/guest-runtime-desktop.d.ts +35 -0
  86. package/dist/guest-runtime-desktop.js +231 -0
  87. package/dist/guest-runtime-desktop.js.map +1 -0
  88. package/dist/guest-runtime-main.d.ts +1 -0
  89. package/dist/guest-runtime-main.js +31 -0
  90. package/dist/guest-runtime-main.js.map +1 -0
  91. package/dist/guest-runtime-revision.d.ts +1 -0
  92. package/dist/guest-runtime-revision.js +3 -0
  93. package/dist/guest-runtime-revision.js.map +1 -0
  94. package/dist/guest-runtime.d.ts +25 -0
  95. package/dist/guest-runtime.js +96 -0
  96. package/dist/guest-runtime.js.map +1 -0
  97. package/dist/index.d.ts +1 -1
  98. package/dist/lab-config.js +10 -3
  99. package/dist/lab-config.js.map +1 -1
  100. package/dist/lab-engine.js +6 -0
  101. package/dist/lab-engine.js.map +1 -1
  102. package/dist/lab-summary.d.ts +5 -1
  103. package/dist/lab-summary.js +5 -0
  104. package/dist/lab-summary.js.map +1 -1
  105. package/dist/local-agent-cli.js +1 -1
  106. package/dist/local-agent-cli.js.map +1 -1
  107. package/dist/local-firecracker-desktop.d.ts +13 -0
  108. package/dist/local-firecracker-desktop.js +150 -0
  109. package/dist/local-firecracker-desktop.js.map +1 -0
  110. package/dist/local-firecracker-study.d.ts +9 -0
  111. package/dist/local-firecracker-study.js +93 -0
  112. package/dist/local-firecracker-study.js.map +1 -0
  113. package/dist/local-runtime-config.d.ts +6 -0
  114. package/dist/local-runtime-config.js +56 -0
  115. package/dist/local-runtime-config.js.map +1 -0
  116. package/dist/local-runtime-release.d.ts +3 -0
  117. package/dist/local-runtime-release.js +8 -0
  118. package/dist/local-runtime-release.js.map +1 -0
  119. package/dist/local-runtime.d.ts +25 -0
  120. package/dist/local-runtime.js +113 -0
  121. package/dist/local-runtime.js.map +1 -0
  122. package/dist/observer-app.html +4 -4
  123. package/dist/pricing.d.ts +22 -1
  124. package/dist/pricing.js +22 -0
  125. package/dist/pricing.js.map +1 -1
  126. package/dist/program.js +50 -9
  127. package/dist/program.js.map +1 -1
  128. package/dist/restricted-codex-analysis.d.ts +15 -0
  129. package/dist/restricted-codex-analysis.js +13 -0
  130. package/dist/restricted-codex-analysis.js.map +1 -0
  131. package/dist/restricted-codex-participant-policy.d.ts +39 -0
  132. package/dist/restricted-codex-participant-policy.js +69 -0
  133. package/dist/restricted-codex-participant-policy.js.map +1 -0
  134. package/dist/restricted-codex-participant-run.d.ts +20 -0
  135. package/dist/restricted-codex-participant-run.js +78 -0
  136. package/dist/restricted-codex-participant-run.js.map +1 -0
  137. package/dist/restricted-codex-participant.d.ts +14 -0
  138. package/dist/restricted-codex-participant.js +178 -0
  139. package/dist/restricted-codex-participant.js.map +1 -0
  140. package/dist/restricted-codex-policy.d.ts +56 -0
  141. package/dist/restricted-codex-policy.js +151 -0
  142. package/dist/restricted-codex-policy.js.map +1 -0
  143. package/dist/restricted-codex-session.d.ts +19 -0
  144. package/dist/restricted-codex-session.js +413 -0
  145. package/dist/restricted-codex-session.js.map +1 -0
  146. package/dist/restricted-codex-transport.d.ts +58 -0
  147. package/dist/restricted-codex-transport.js +233 -0
  148. package/dist/restricted-codex-transport.js.map +1 -0
  149. package/dist/run-detail.js +4 -2
  150. package/dist/run-detail.js.map +1 -1
  151. package/dist/run.d.ts +12 -5
  152. package/dist/run.js +17 -1
  153. package/dist/run.js.map +1 -1
  154. package/dist/shared-world-lab.js +2 -2
  155. package/dist/shared-world-lab.js.map +1 -1
  156. package/dist/study-analysis-codex-config.d.ts +11 -0
  157. package/dist/study-analysis-codex-config.js +34 -0
  158. package/dist/study-analysis-codex-config.js.map +1 -0
  159. package/dist/study-analysis-engine.d.ts +6 -3
  160. package/dist/study-analysis-engine.js +19 -10
  161. package/dist/study-analysis-engine.js.map +1 -1
  162. package/dist/study-analysis-job.d.ts +3 -2
  163. package/dist/study-analysis-job.js +1 -1
  164. package/dist/study-analysis-job.js.map +1 -1
  165. package/dist/study-analysis-provider.d.ts +4 -2
  166. package/dist/study-analysis-provider.js +1 -1
  167. package/dist/study-analysis-provider.js.map +1 -1
  168. package/dist/study-analysis-service.d.ts +3 -0
  169. package/dist/study-analysis-service.js +24 -6
  170. package/dist/study-analysis-service.js.map +1 -1
  171. package/dist/study-analysis-validation.d.ts +43 -19
  172. package/dist/study-analysis-validation.js +23 -10
  173. package/dist/study-analysis-validation.js.map +1 -1
  174. package/dist/study-analysis.d.ts +27 -2
  175. package/dist/study-costs.js +6 -0
  176. package/dist/study-costs.js.map +1 -1
  177. package/dist/tui-app.js +102 -102
  178. package/docs/architecture/browser-control.md +117 -0
  179. package/docs/architecture/desktop-sessions.md +80 -0
  180. package/docs/architecture/guest-desktop.md +87 -0
  181. package/docs/architecture/local-browser-runtime.md +100 -0
  182. package/docs/architecture/restricted-codex-analysis.md +91 -0
  183. package/docs/architecture/runtime-broker-core.md +30 -0
  184. package/docs/contracts/schemas.md +1 -1
  185. package/docs/contracts/study-analysis.md +44 -2
  186. package/docs/goals/current.md +25 -9
  187. package/docs/product/automatic-analysis.md +24 -3
  188. package/docs/product/open-source-install-experience.md +7 -0
  189. package/docs/ramp/README.md +30 -13
  190. package/docs/release/0.97.0-codex-account-analysis.md +45 -0
  191. package/docs/release/0.98.0-local-browser-studies.md +31 -0
  192. package/package.json +4 -2
  193. package/skills/humanish/SKILL.md +39 -0
@@ -0,0 +1,117 @@
1
+ # Internal browser control
2
+
3
+ The browser-control client implements the existing `CuaExecutor` over an
4
+ already-owned Node `Duplex`. The matching dispatcher invokes an owner-supplied
5
+ executor. This is a preparatory internal boundary, not a managed-local runtime,
6
+ CLI mode, browser launcher, VM isolation claim, or installer.
7
+
8
+ ## Ownership and admission
9
+
10
+ `createBrowserControlClient({ transport, identity, requestTimeoutMs? })` returns
11
+ `{ executor, ready(), close() }`. `ready()` performs a lazy handshake; the first
12
+ observation/action also performs it when needed. The owner closes the client
13
+ when its session ends. The client never discovers endpoints, opens sockets,
14
+ spawns processes, reconnects, retries, or replays a mutation.
15
+
16
+ `attachBrowserControlDispatcher({ transport, identity, executor, isAuthorized,
17
+ authoritySignal })` returns `{ close() }`. The authority signal is required.
18
+ The owner establishes the channel and authority independently; the identity's
19
+ `generation`, `challenge`, and `runtimeRevision` only check consistency.
20
+ Each is a bounded ASCII token. A matching string does not prove a lease or
21
+ authenticate executable bytes.
22
+
23
+ The dispatcher checks current authorization immediately before invoking browser
24
+ I/O. It passes a signal combining owner revocation, channel loss, and its request
25
+ deadline to `execute`. The physical driver must check that signal immediately
26
+ before **each actual input**, including after asynchronous preparation. Closing
27
+ the channel cannot roll back already-dispatched input or prove the browser has
28
+ stopped. The physical owner remains responsible for resource cleanup and the
29
+ independent watchdog. Observation has no cancellation parameter in the existing
30
+ executor interface; late observations are discarded after closure.
31
+
32
+ One operation may be pending, including handshake and observation. Concurrent
33
+ calls are rejected rather than queued. The client marks its executor with
34
+ `stallRecovery: 'fail_closed'`, so an earlier computer-use loop deadline cannot
35
+ trigger the legacy observation retry or idle-action skip behavior.
36
+
37
+ ## Wire contract
38
+
39
+ Each frame is a four-byte unsigned big-endian length followed by strict UTF-8
40
+ JSON. The parser allocates its bounded payload only after validating the length;
41
+ it handles fragmented and coalesced input without repeatedly concatenating it.
42
+ A partially received frame has a nonrenewing 35-second assembly deadline.
43
+
44
+ Version 1 has only `HELLO`, `OBSERVE`, and `EXECUTE`. Both directions carry the
45
+ version, operation, identity, strictly increasing sequence and `request-N`
46
+ correlation ID. Execute additionally carries the distinct `action-N` ID.
47
+ Unknown fields, methods, versions, stale identity, duplicates, missing or wrong
48
+ correlation, malformed UTF-8/JSON and oversized frames close admission. There is
49
+ no generic CDP, command, file, navigation-management, or runtime-management method.
50
+ Initial target navigation remains an adapter-owned operation.
51
+
52
+ Replies acknowledge completion or contain a finite `CuaExecutorError` code and
53
+ `not_dispatched` / `outcome_uncertain` disposition. They never include raw
54
+ exception prose, typed text, page URLs, or browser errors in their error fields.
55
+ A generic driver exception after invocation is uncertain; only a genuine typed
56
+ driver declaration can attest that input was never dispatched.
57
+
58
+ The client resolves execute only after a matching completion acknowledgement and
59
+ its write callback. Cancellation, deadline, explicit close, or channel loss after
60
+ a possible write is uncertain and terminal. A later acknowledgement cannot reopen
61
+ that channel. Pre-aborted signals and locally rejected input cause no write.
62
+ Cancellation during the preliminary handshake remains a pre-dispatch action
63
+ failure. No exactly-once or rollback guarantee is implied by sequence IDs.
64
+
65
+ ## Finite bounds
66
+
67
+ | Input | Version 1 bound |
68
+ | --- | --- |
69
+ | Framed JSON | 12 MiB |
70
+ | PNG bytes | 8 MiB |
71
+ | Image dimensions | 4096 per side, at most 16,000,000 pixels |
72
+ | Typed text and each observed string | 64 KiB UTF-8 |
73
+ | Key chord | 16 keys, 64 characters per key |
74
+ | Drag | 1–1024 points |
75
+ | Coordinates, deltas, scroll position | Finite, within ±1,000,000; fractions preserved |
76
+ | Wait | 0–30 seconds, fractions preserved |
77
+ | Client request | 35 seconds by default; caller may choose 1–60 seconds |
78
+ | Dispatcher request | 35 seconds including acknowledgement write |
79
+
80
+ Observation requires a PNG and state signature. It may include bounded URL,
81
+ title, text, and fractional scroll position; those remain runtime-only under the
82
+ existing loop contract. Arbitrary `appState` is refused because v1 has no closed
83
+ schema for it. The protocol does not truncate strings, round coordinates, or
84
+ silently drop unsupported state.
85
+
86
+ PNG admission checks signature, IHDR before decoder allocation, chunk framing,
87
+ IDAT/IEND presence, no trailing bytes, CRCs and full decode. Version 1 admits
88
+ 8-bit, noninterlaced browser PNGs. Interlaced and 16-bit images are rejected:
89
+ the current decoder has an unbounded interlaced inflation branch, so admitting
90
+ those would require a separately bounded decoder. Image dimensions and the
91
+ pixel product are checked before decoding, independently of compressed size.
92
+
93
+ ## Verification boundary
94
+
95
+ `tests/browser-control-protocol.test.ts`, `browser-control-transport.test.ts`
96
+ and `browser-control-client.test.ts` exercise production schemas and framing,
97
+ all action kinds, image limits, correlation, malformed input, revocation,
98
+ concurrency, lost acknowledgements, backpressure and cancellation. These use
99
+ synthetic PNGs and inert paired byte streams, with no network, model or VM calls.
100
+ They establish the protocol contract, not a real-browser or managed-runtime
101
+ claim. The separate owned-child/browser conformance proof must retain real
102
+ pixels and independently observed fixture mutations through the same modules.
103
+
104
+ From a source checkout, run `pnpm build && pnpm browser-control:proof` with a
105
+ Chromium installation that supports its sandbox. The proof uses a fresh profile,
106
+ a private local socket, a separate controller process and a synthetic loopback
107
+ page. It checks a normal save, a lost acknowledgement after one save, and owner
108
+ revocation/cancellation during input preparation. Screenshots, loop traces,
109
+ independent save counts and exact child/profile cleanup results are retained in
110
+ `.humanish/browser-control-proof/`. Failed cleanup remains unconfirmed and keeps
111
+ the private recovery directory; killing a controller alone does not prove its
112
+ browser stopped.
113
+
114
+ This is deterministic `runComputerUseLoop` conformance, not model perception,
115
+ the study producer, a ready-desktop adapter, a durable local-study bundle or
116
+ Observer qualification. Page request interception does not establish process-wide
117
+ egress isolation. Those integration and runtime boundaries remain separate gates.
@@ -0,0 +1,80 @@
1
+ # Owned desktop sessions
2
+
3
+ Independent hosted computer-use lanes acquire an owned desktop allocation before
4
+ subject setup, then bind its executor after browser setup. The participant loop
5
+ still consumes `CuaExecutor`; provisioning commands stay in the hosted adapter.
6
+ This internal interface is not a public runtime plugin API.
7
+
8
+ `desktop-session.ts` holds the lifecycle contract. The allocation captures a
9
+ resource ID and a release closure. Its ID is a record of acquisition, not
10
+ authority to reconstruct or reclaim a resource from an arbitrary saved bundle.
11
+
12
+ An allocation binds one participant executor. Closing it immediately rejects new
13
+ observations and actions, forwards no further calls, and shares one release
14
+ attempt across repeated or concurrent callers. Cancellation signals pass through
15
+ unchanged. Closing does not wait for an already-dispatched backend operation;
16
+ that operation may fail as the desktop stops.
17
+
18
+ Cleanup has three outcomes:
19
+
20
+ - `released`: the adapter confirmed termination or that the resource was already
21
+ gone;
22
+ - `retained`: an existing debug-retention policy deliberately kept the desktop;
23
+ - `unconfirmed`: release was unavailable, failed, or returned an invalid result.
24
+
25
+ A closed allocation never implicitly retries cleanup or reopens input. Recovery
26
+ needs its own authorized operation. Runtime exceptions remain untrusted and must
27
+ pass the caller's existing redaction before entering warnings or artifacts.
28
+
29
+ The E2B adapter preserves the existing create options, template overload, startup
30
+ retry guard and kill-on-timeout policy. It captures the acquired ID and kill
31
+ method before provisioning hooks can mutate the SDK object. E2B's boolean kill
32
+ result confirms either termination (`true`) or prior absence (`false`, its 404
33
+ case). Other values do not confirm cleanup. Account-wide enumeration is never
34
+ part of release.
35
+
36
+ Already-absent cleanup carries a warning: the exact termination time is unknown.
37
+ As before, desktop cost is an estimate over the host's acquisition-to-cleanup
38
+ span, not a provider billing measurement.
39
+
40
+ `CuaDesktopLane` separates desktop preparation from the participant runner:
41
+
42
+ 1. `prepare()` acquires and prepares the desktop. Failures still leave cleanup
43
+ authority with the adapter.
44
+ 2. The runner starts its model session and signals the existing hosted pipeline
45
+ gate, preserving the current scheduling order.
46
+ 3. `openSession()` measures initial browser geometry, starts the optional live
47
+ stream, and supplies a `CuaExecutor` plus any participant inbox location.
48
+ 4. The runner executes the participant loop and closes its model session.
49
+ 5. `finalize()` collects final evidence and releases the desktop, including after
50
+ preparation or participant failure. Repeated calls share one finalization.
51
+ 6. `snapshot()` supplies the desktop facts for the existing lane outcome.
52
+
53
+ The E2B implementation lives in `e2b-cua-desktop.ts`; its browser, media and
54
+ subject provisioning primitives live in `e2b-cua-provisioning.ts`. Existing
55
+ helper imports through `cua-actor-lab.ts` remain supported. The adapter never
56
+ imports the lab runner at runtime.
57
+
58
+ The runner owns instructions, model execution, spend guards, screenshots, trace
59
+ persistence and participant outcome interpretation. It does not invoke desktop
60
+ shell commands or manufacture E2B objects for an alternate executor. The internal
61
+ `CuaLaneDeps.createDesktopLane` seam is for construction and contract testing;
62
+ it does not add a user-facing runtime option or bypass CLI admission checks.
63
+
64
+ Final evidence errors cannot skip desktop release. Existing bundle fields and
65
+ desktop lifetime accounting retain their meanings; unconfirmed or retained
66
+ desktops do not become confirmed cleanup. Provider facts remain absent when the
67
+ adapter cannot establish them.
68
+
69
+ This change supplies an internal boundary for future runtime adapters. Managed
70
+ local execution, artifact installation, controller-death leases, capability
71
+ admission and new media support require separate implementations and proofs.
72
+ Independent hosted browser and terminal lanes, plus concurrent shared-world
73
+ seats that use `runCuaLane`, use this boundary. Sequential shared-world lifecycle
74
+ remains separate and uses the same re-exported provisioning helpers.
75
+
76
+ The independent lane's `runSession` testing hook now receives a constructed
77
+ `executor` instead of `desktop`/`executorOptions`. A hook should consume the
78
+ normal `CuaActorSessionOptions` executor or delegate to `runCuaActorSession`.
79
+ Library calls directly using `runCuaActorSession({ desktop, executorOptions })`
80
+ remain supported; the custom in-process `buildExecutor` route is unchanged.
@@ -0,0 +1,87 @@
1
+ # Headed browser guest components
2
+
3
+ These internal components implement native input and full-desktop captures for a
4
+ maintained browser-only guest. They do not enable a public local-runtime mode.
5
+ The VM owner, control transport, app network policy, installed setup and complete
6
+ study journey require separate qualification.
7
+
8
+ The driver uses the existing `CuaExecutor` contract behind
9
+ [browser control](browser-control.md). Coordinates refer to the complete Xvfb
10
+ frame, including the browser's address bar. Invalid points are refused instead
11
+ of moved to a different target. Captures must match the admitted geometry and
12
+ pass the bounded PNG validator. Browser URL/title/DOM metadata is absent in this
13
+ component; callers must not invent it from the screenshot or infer task matches.
14
+ Progress detection uses the same coarse frame signature as the hosted desktop.
15
+
16
+ ## Input boundary
17
+
18
+ The actor receives the existing finite action union. Native tool paths, display,
19
+ Xauthority and guest temporary directory come from the owner. Key names map to a
20
+ closed list before reaching xdotool, whose own command syntax must never receive
21
+ arbitrary participant strings. A native wheel step is not an exact pixel-scroll
22
+ promise; one action permits at most 100 wheel steps. The entire drag is checked
23
+ before its first input.
24
+
25
+ Each input checks the current authority after asynchronous preparation. A
26
+ partial or unacknowledged input closes the executor; it is never automatically
27
+ replayed. Releasing a held button can itself click or drop, so revocation does
28
+ not inject a cleanup mouseup into the app. The owner must stop the private
29
+ browser/display. A stopped helper alone does not establish desktop or VM absence.
30
+
31
+ Text in a focused, editable top-level document uses Chromium's fixed
32
+ `Input.insertText` command over the owner's private Playwright pipe. The actor
33
+ receives no CDP, JavaScript, selector, or debugging endpoint. A separate isolated
34
+ world checks actual document focus and binds preparation to the editable element;
35
+ page changes, additional tabs, dialogs, iframe focus and ambiguous focus are
36
+ refused. The owner acquires the one page and native window before untrusted
37
+ navigation. The driver never chooses another tab or brings one to the front.
38
+ Focus can change between protocol messages; this is not atomic element-targeted
39
+ input or a general multi-window driver.
40
+
41
+ Address-bar text is admitted only after an explicit Ctrl+L action, uses printable
42
+ ASCII, and repeats that chord after checking the owned active window. Unicode
43
+ or control characters in browser chrome are refused. Clicking an arbitrary
44
+ chrome field does not authorize text entry there. Content insertion is browser
45
+ text/IME insertion, not a stream of physical key presses; keyboard shortcuts
46
+ remain native. There is no alternate-route fallback after a failed insertion.
47
+
48
+ Direct native Unicode typing and a one-transfer clipboard helper were rejected
49
+ by exact Chromium field readback. Successful process or clipboard transfer
50
+ acknowledgements did not establish successful application input. The supported
51
+ text paths likewise need application readback to establish task outcomes.
52
+
53
+ Native children use fixed paths and a minimal explicit environment. Operator
54
+ credentials and inherited Xauthority are not forwarded. Native address-bar text travels over the
55
+ helper's stdin; web text travels over the private browser pipe, never a shell. Helpers have bounded deadlines and output;
56
+ raw diagnostic text is never returned as an executor error. Only an acquired,
57
+ still-live child handle authorizes termination. If capture-helper exit cannot
58
+ be confirmed, its private files stay for runtime-owner reclamation.
59
+
60
+ ## Build and proof
61
+
62
+ The source-only [guest recipe](https://github.com/danielgwilson/humanish/blob/main/runtime/browser-guest/README.md) builds a
63
+ pinned Debian/Chromium/Xvfb development base with package/source references and
64
+ notices. It is not a redistributed release image or a VM qualification receipt.
65
+ A native ARM64 build and its exact browser behavior are separate from amd64.
66
+
67
+ After building the development image and JavaScript, run the scoped native proof
68
+ with its exact local image ID:
69
+
70
+ ```sh
71
+ HUMANISH_GUEST_IMAGE=sha256:<image-id> pnpm guest-desktop:proof
72
+ ```
73
+
74
+ This launches an ordinary disposable container with no network, host mounts or
75
+ host devices. Chromium retains its sandbox. The harness downloads and verifies
76
+ the hash-pinned upstream Playwright Docker seccomp profile, which permits the
77
+ user namespaces needed by that sandbox. This container configuration is a test
78
+ environment, not the proposed Firecracker boundary. The harness retains failed
79
+ attempts, full-frame captures, synthetic app readback and exact-container cleanup
80
+ under ignored `.humanish/guest-desktop-proof/`.
81
+
82
+ The proof covers visible browser chrome, address-bar navigation, Unicode and
83
+ rapid/large/stalled-renderer text insertion, page/focus rejection, pointer and
84
+ keyboard input, native scrolling and cancellation. CI reruns this proof for
85
+ changes to the guest driver, image recipe, protocol or dependency lockfile. Its deterministic fixture is not a model participant,
86
+ a run bundle, a host network policy, an independent watchdog or a Linux/Mac
87
+ installed study. Those remain separate gates before local runtime support.
@@ -0,0 +1,100 @@
1
+ # Local browser studies
2
+
3
+ Linux x64 users can run isolated Firecracker browser participants from the
4
+ installed CLI or TUI. Docker manages their containers and private state volumes;
5
+ the normal study runner supplies scheduling, recordings, Observer and findings.
6
+ No separate host service is installed.
7
+
8
+ ## Start a study
9
+
10
+ Prerequisites: a local, rootful Docker Engine; Linux KVM (`/dev/kvm`) and TUN
11
+ (`/dev/net/tun`); and a signed-in, supported Codex CLI. See
12
+ [Codex account setup](restricted-codex-analysis.md) for the qualified version
13
+ and account restrictions. Docker access is an administrative capability.
14
+ Humanish does not install Docker or change host permissions.
15
+
16
+ Start your app on loopback, then save a lab such as
17
+ `.humanish/labs/local-browser.yaml`:
18
+
19
+ ```yaml
20
+ schema: humanish.lab.v2
21
+ id: local-browser
22
+ title: Review the note editor
23
+ subject:
24
+ source: app-url
25
+ appUrl: http://127.0.0.1:3000
26
+ actors:
27
+ - type: local-agent
28
+ localAgent: codex
29
+ count: 2
30
+ mission: Create a note and explain anything confusing about saving it.
31
+ scenario:
32
+ mode: live
33
+ execution:
34
+ target: local
35
+ concurrency: 2
36
+ timeoutMs: 120000
37
+ ```
38
+
39
+ ```sh
40
+ npx humanish init --yes
41
+ npx humanish runtime status --json
42
+ npx humanish doctor --lab .humanish/labs/local-browser.yaml --json
43
+ npx humanish lab run .humanish/labs/local-browser.yaml
44
+ ```
45
+
46
+ The first live run downloads the pinned runtime archive (about 569 MiB), verifies
47
+ its exact size and SHA-256, and loads it into Docker. Later runs reuse the image.
48
+ `humanish runtime setup` prepares it in advance. Status, doctor and dry-run never
49
+ download an image or launch a participant. Preparation does not consume the
50
+ participant's task-time budget. The TUI lists the same lab and runtime readiness;
51
+ starting it uses the same preparation and execution path.
52
+
53
+ This configuration needs neither an E2B key nor an OpenAI API key. Participants
54
+ and the separate post-run analyst use Codex account quota and **remote model
55
+ inference**. It is not an offline model. The restricted participant has no host
56
+ shell, checkout mount or credential files. Account dollar cost and output-token
57
+ ceilings are unknown; numeric dollar/token caps are rejected. Set
58
+ `review.analysis: false` to skip analysis.
59
+
60
+ For API billing and its supported caps, use `type: openai-computer-use`, remove
61
+ `localAgent`, and provide `OPENAI_API_KEY`. Its analysis retains the existing API
62
+ default. Neither path silently falls back to another provider or hosted desktop.
63
+ Existing labs without `execution.target: local` retain their previous behavior.
64
+
65
+ ## Current limits
66
+
67
+ - Linux x64 only. Mac/Lima setup is a separate follow-up.
68
+ - A local Docker Engine; remote contexts, rootless Docker and Docker Desktop
69
+ virtual machines are not supported by this host adapter.
70
+ - Loopback HTTP(S) app URLs on explicit ports above 1023. Each participant can
71
+ reach its selected app port, plus public destinations over ordinary TCP/UDP.
72
+ Other private host/LAN destinations and cloud metadata are blocked.
73
+ - Chromium at 960×720, 2 vCPUs and 2 GiB guest RAM per participant. Docker's
74
+ enclosing memory limit is 3 GiB. Start with a small concurrency for your host;
75
+ these allocations are not a promise of measured peak memory or capacity.
76
+ - Browser-only. Inbox and camera/microphone declarations are rejected until
77
+ integrated. TAP/NAT networking preserves the path to optional media.
78
+ - A 20-minute default and maximum participant session budget, within the runtime
79
+ image's 30-minute process lifetime. A shorter `execution.timeoutMs` is supported.
80
+ - Codex participants currently use `gpt-6-astra` at low effort. Hosted templates,
81
+ device presets and hosted sandbox timeouts do not apply.
82
+
83
+ Normal close removes the owned container and its private state volume. If the
84
+ controller dies, the disconnected guest reboots, Firecracker exits and Docker
85
+ removes both. A small host socket directory can remain after abrupt death.
86
+ Run evidence remains in `.humanish/` under the normal local capture and sharing
87
+ rules. An unconfirmed release is reported as such.
88
+
89
+ ## Runtime maintenance
90
+
91
+ The npm build pins a release URL, byte count, SHA-256 and immutable Docker image
92
+ ID in `src/local-runtime-release.ts`. It has no moving `latest` image dependency.
93
+ Runtime releases include source archives and notices separately; study users do
94
+ not download those archives. Updating a runtime requires a reviewed catalog
95
+ change and a new CLI release.
96
+
97
+ Source builders can use the
98
+ [maintained recipes](../../runtime/local-firecracker/README.md) and set
99
+ `HUMANISH_LOCAL_RUNTIME_IMAGE` to an already-built compatible local image. An
100
+ invalid override fails; it does not cause an implicit registry pull.
@@ -0,0 +1,91 @@
1
+ # Restricted Codex account analysis
2
+
3
+ The optional account analyst uses a new Codex app-server process after participant
4
+ execution, with a separate conversation, process and tool authority. It can use
5
+ the same host Codex login as a local-agent participant. Existing API analysis
6
+ remains a separate provider.
7
+
8
+ The qualified launcher profile is **Codex CLI 0.154.0, Linux x64, file-backed
9
+ ChatGPT login, `gpt-6-astra`, low reasoning effort**. Other versions/platforms,
10
+ keychain-only logins and API-key Codex logins are refused before a model turn.
11
+ Readiness validates the installation and effective profile without submitting a
12
+ model turn; it does not guarantee current quota or model access.
13
+
14
+ ## Authority and request limits
15
+
16
+ The host creates a private temporary Codex home and links only the existing
17
+ `auth.json`. Humanish never reads or copies its values. The native CLI owns
18
+ authentication and provider network traffic. Its environment excludes provider
19
+ keys, target-app variables, alternate endpoints and operator configuration.
20
+ The selected native binary is launched directly; npm wrappers are resolved to
21
+ their native executable before launch.
22
+
23
+ Before creating a thread, Humanish checks the effective config. Nonempty system
24
+ settings, inherited instructions, MCP, plugins, hooks, alternate stores/endpoints
25
+ and unsupported authority are rejected. The thread is ephemeral, has no runtime
26
+ environments or workspace roots, and uses only the supplied text/images and
27
+ closed output schema. No provider/model fallback is allowed.
28
+
29
+ This profile is **not advertised as tool-free**. The CLI retains code-mode
30
+ descriptions, but the qualified `features.code_mode_host=false` setting rejects
31
+ their actual dispatch. `agents.enabled=false` removes delegation; the older
32
+ feature toggle alone did not. Humanish also refuses raw tool calls, unexpected
33
+ host RPCs and asynchronous question messages before accepting any report. The
34
+ actual notification/denial captures and provenance are in
35
+ [`tests/fixtures/restricted-codex`](https://github.com/danielgwilson/humanish/blob/46330116726f74080fa18947c36da4fb4b333805/tests/fixtures/restricted-codex/README.md).
36
+
37
+ Each request owns a separate child process, temporary home and fresh thread;
38
+ participant, analyst and readiness requests may run concurrently. An unresolved
39
+ child process blocks new requests until its exit is confirmed. Each thread receives
40
+ one turn. Evidence is not silently
41
+ downselected: at most 128 images, 20 MiB decoded image data, and 32 MiB serialized
42
+ request data are admitted. Generated report text is limited to 2 MiB. Raw input
43
+ notifications echo image data URLs, so their frame budget is the larger of 2 MiB
44
+ or the admitted serialized packet plus 1 MiB; total stdout is bounded separately
45
+ at the larger of 8 MiB or twice that frame budget plus 4 MiB. Stderr is bounded at
46
+ 2 MiB and is not retained. Notifications are limited to 65,536; aggregate
47
+ generated assistant-text deltas are independently limited to 2 MiB, regardless
48
+ of the input-image wire budget. The request's
49
+ deadline includes startup; individual RPCs also have a 15-second ceiling.
50
+
51
+ Account analysis has unknown dollar cost and no supported generated-token cap.
52
+ Numeric output-token caps are rejected. The integration must likewise reject
53
+ numeric dollar caps for this provider. Known token usage is retained; missing or
54
+ interrupted usage is unknown/partial, not zero. The ordinary analysis validator,
55
+ source-integrity checks and narrative secret scrubber remain responsible for
56
+ accepting and publishing the report.
57
+
58
+ ## Cancellation and auth recovery
59
+
60
+ Cancellation interrupts the turn, then closes the directly owned native child
61
+ and its stdio with bounded termination/kill waits. No stored PID or process group
62
+ is signaled after exit. This proves the direct child's lifecycle, not arbitrary
63
+ descendant-tree reclamation; process-spawning tools are outside this profile.
64
+ If native closure cannot be confirmed, Humanish preserves its private state and
65
+ blocks another session in the same process until that exact child closes.
66
+
67
+ After confirmed closure, normal cleanup removes the owned auth symlink and
68
+ temporary directory. It never deletes or overwrites the operator's original
69
+ login. Unexpected replacement of the symlink is different: it might contain
70
+ rotated auth state. Humanish preserves that private file with mode 0600 inside a
71
+ 0700 task home, removes other scratch/evidence, refuses the report, and returns
72
+ `codex_cleanup_failed`. It does not copy the replacement into the original
73
+ login, which could overwrite a newer concurrent login.
74
+
75
+ Local recovery markers live under
76
+ `$XDG_CACHE_HOME/humanish/codex-analysis-recovery/`, or
77
+ `~/.cache/humanish/codex-analysis-recovery/`. A marker contains only the generated
78
+ task directory name and fixed file names. Find that same directory under the
79
+ system temporary directory (`$TMPDIR` when configured); retained login state is
80
+ inside `home/auth.json`. Do not discard a retained replacement before recovering
81
+ the login. Run `codex login` before retrying if the persistent login is no longer
82
+ usable. Actual private paths and credentials are never included in an analysis
83
+ artifact. An unconfirmed-process marker instead means the private directory is
84
+ retained until the process lifecycle can be inspected safely.
85
+
86
+ Qualification used short, existing-login calls; it did not force token refresh.
87
+ The available Codex file-store source writes through the auth path, but matching
88
+ binary refresh behavior and concurrency with unrelated Codex applications are
89
+ not established by that proof. Recovery deliberately fails closed if storage
90
+ behaves differently. Keychain/other-platform support and whole-process-tree
91
+ leases require their own qualification.
@@ -0,0 +1,30 @@
1
+ # Runtime broker authority core
2
+
3
+ The source-only [broker core](https://github.com/danielgwilson/humanish/blob/main/runtime/broker/README.md)
4
+ defines bounded requests and lease decisions for a future Linux runtime owner.
5
+ It is not an installed service, resource controller, or public runtime mode.
6
+
7
+ Requests cannot supply host paths, service names, commands, user identities,
8
+ resource limits or cleanup claims. The future transport obtains the peer UID
9
+ from the operating system and checks it against owner policy. A separate
10
+ generation capability authorizes each study; default diagnostics and serialized
11
+ ledgers omit the raw capability. Repeating an acquisition or allocation attempt
12
+ does not mint a second resource.
13
+
14
+ The model reserves capacity through uncertain creation and cleanup. Expiry,
15
+ revocation, detected sleep and host-clock discontinuity cannot be undone by a
16
+ late renewal. A saved launch plan is not dispatch authority: the owner must
17
+ revalidate it immediately before starting a resource. Only a separate owner
18
+ attestation that creation has settled and the acquired resources are absent can
19
+ free a reservation. Recovery reads the ledger for reconciliation, never to resume
20
+ a study or adopt resources by their names.
21
+
22
+ The owner must persist intent before consuming effects, advance trusted time
23
+ independently of requests, and bind every resource to actual acquired OS
24
+ identities. The pure model does none of those OS operations. Its tests establish
25
+ protocol and state transitions; they do not establish peer authentication,
26
+ durable writes, process containment, watchdog timing, sleep detection or cleanup.
27
+
28
+ Installation, root-owned storage, authenticated sockets, service supervision,
29
+ artifact verification and VM/network control require separate implementation
30
+ and privileged qualification. The existing npm execution routes are unchanged.
@@ -3,7 +3,7 @@
3
3
  Date: 2026-06-02 (current-state note updated 2026-07-14)
4
4
 
5
5
  Status: reference map for the major contracts shipped through source version
6
- `0.96.1`; it is not an exhaustive inventory of command/result envelopes. Exported types,
6
+ `0.98.0`; it is not an exhaustive inventory of command/result envelopes. Exported types,
7
7
  schema constants, parsers, and validators in `src/` are authoritative. Rows
8
8
  marked "reserved" name layering intent only — no code emits or validates them
9
9
  yet. Do not emit a reserved schema.
@@ -22,10 +22,10 @@ not a participant study. Here, `analyze --dry-run` means checking an existing
22
22
  study's input and admission estimate without credentials, a provider request,
23
23
  or a new analysis artifact.
24
24
 
25
- The default model is `gpt-6-astra`, with high reasoning effort. A request sends selected retained text and
25
+ The default provider is `openai`; its default model is `gpt-6-astra`, with high reasoning effort. A request sends selected retained text and
26
26
  captures to OpenAI, without tools, redirects, provider-side response storage, or
27
27
  automatic retries. `--question` adds a reviewer question; it never changes the
28
- participant assignment. `--max-cost` is required, including for dry-run
28
+ participant assignment. For OpenAI API analysis, `--max-cost` is required, including for dry-run
29
29
  admission. It bounds a conservative estimate, not an exact provider bill.
30
30
  `--timeout-ms` and `--max-output-tokens` bound the request. An exceeded admission
31
31
  estimate retains valid findings and usage but returns a partial result and a
@@ -48,6 +48,48 @@ success. Findings keep reported concerns and observed recovery distinct across
48
48
  participants. Other supported models can be selected explicitly, but evidence
49
49
  reference validation does not certify their interpretation of small visual details.
50
50
 
51
+ ## Explicit Codex account analysis
52
+
53
+ An existing completed recording can use a separate restricted Codex analyst:
54
+
55
+ ```bash
56
+ humanish analyze --run latest --provider codex --dry-run --json
57
+ humanish analyze --run latest --provider codex --json
58
+ ```
59
+
60
+ This branch is qualified on Linux x64 with Codex CLI `0.154.0`, a file-backed
61
+ ChatGPT account login, and `gpt-6-astra` with low reasoning effort. The participant conversation
62
+ is never reused. Selected text and screenshots still go to remote inference;
63
+ this is account authentication, not local inference. No API-key, alternate model
64
+ or configured-provider fallback occurs. Model access and account allowance are
65
+ not established by installation or login alone. Keychain-only login, other
66
+ platforms and CLI versions are refused before a turn; they are not silently
67
+ converted to API authentication.
68
+
69
+ Omit `--max-cost` and `--max-output-tokens` for Codex. Numeric declarations are
70
+ rejected because this transport does not enforce them. `maxCostUsd` and
71
+ `maxOutputTokens` are stored as null. The existing evidence bounds, one analyst
72
+ turn, bounded response bytes and whole-operation timeout still apply. One turn
73
+ is not a claim of one upstream billed request; account limits apply. Reported
74
+ tokens remain inspectable, but dollar estimates, admission dollars and rate dates
75
+ remain null. Interrupted token observations remain explicitly incomplete.
76
+
77
+ The dry-run validates only local evidence and configuration. It does not check
78
+ the CLI, login, model access or quota and does not start a provider request.
79
+ `doctor --lab <lab>` checks the selected analyst setup without a model call.
80
+ Failures leave the recording available; inspect `analyze show` and the attempt's
81
+ accounting before an explicit `analyze --provider codex --rerun`.
82
+
83
+ The persisted identity is the required qualified execution profile: transport,
84
+ authentication and billing class, requested and required resolved model, effort,
85
+ tool-policy revision and CLI version. The launcher must confirm it before the
86
+ turn. A failed pre-dispatch attempt does not prove the CLI or model was observed.
87
+ These fields participate in the configuration digest, preventing reuse across
88
+ providers or changed execution policies. Historical API configurations, hashes
89
+ and corrections are read without inserting new defaults.
90
+
91
+ ## Evidence interpretation
92
+
51
93
  Analysis distinguishes participant actions from harness setup and accounting.
52
94
  Runtime credentials or model usage do not establish that a participant made an
53
95
  external call while performing their task. Observations with an action basis