humanish 0.81.0 → 0.82.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 (51) hide show
  1. package/README.md +121 -621
  2. package/dist/actor-contract.d.ts +14 -0
  3. package/dist/actor-contract.js.map +1 -1
  4. package/dist/computer-use.d.ts +6 -2
  5. package/dist/computer-use.js +23 -2
  6. package/dist/computer-use.js.map +1 -1
  7. package/dist/cua-actor-lab.d.ts +13 -2
  8. package/dist/cua-actor-lab.js +59 -28
  9. package/dist/cua-actor-lab.js.map +1 -1
  10. package/dist/e2b-desktop-executor.d.ts +9 -1
  11. package/dist/e2b-desktop-executor.js +67 -4
  12. package/dist/e2b-desktop-executor.js.map +1 -1
  13. package/dist/e2b-desktop-launch.d.ts +8 -0
  14. package/dist/e2b-desktop-launch.js.map +1 -1
  15. package/dist/e2b-desktop-resources.d.ts +11 -0
  16. package/dist/e2b-desktop-resources.js +33 -0
  17. package/dist/e2b-desktop-resources.js.map +1 -0
  18. package/dist/e2b-terminal-lab.d.ts +2 -0
  19. package/dist/e2b-terminal-lab.js +64 -3
  20. package/dist/e2b-terminal-lab.js.map +1 -1
  21. package/dist/index.d.ts +3 -3
  22. package/dist/index.js +1 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/lab-config.d.ts +4 -0
  25. package/dist/lab-config.js +9 -0
  26. package/dist/lab-config.js.map +1 -1
  27. package/dist/observer-data.d.ts +2 -0
  28. package/dist/observer-data.js +10 -1
  29. package/dist/observer-data.js.map +1 -1
  30. package/dist/pricing.d.ts +19 -1
  31. package/dist/pricing.js +43 -10
  32. package/dist/pricing.js.map +1 -1
  33. package/dist/program.js +1 -1
  34. package/dist/program.js.map +1 -1
  35. package/dist/redaction.js +9 -2
  36. package/dist/redaction.js.map +1 -1
  37. package/dist/run.d.ts +14 -2
  38. package/dist/run.js.map +1 -1
  39. package/dist/terminal-runtime.d.ts +16 -0
  40. package/dist/terminal-runtime.js +42 -0
  41. package/dist/terminal-runtime.js.map +1 -0
  42. package/dist/terminal-token-usage.d.ts +2 -1
  43. package/dist/terminal-token-usage.js +3 -2
  44. package/dist/terminal-token-usage.js.map +1 -1
  45. package/docs/architecture/state-driven-executor.md +10 -1
  46. package/docs/architecture/terminal-product-lane.md +35 -0
  47. package/docs/contracts/run-bundle.md +5 -1
  48. package/docs/contracts/schemas.md +17 -8
  49. package/docs/goals/current.md +17 -1
  50. package/docs/ramp/README.md +1 -1
  51. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ import type { ActorRuntimeProvenance } from "./actor-contract.js";
2
+ import type { ReasoningEffort } from "./reasoning-effort.js";
3
+ export declare const TERMINAL_RUNTIME_PACKAGE = "@openai/codex";
4
+ export declare const TERMINAL_RUNTIME_VERSION_TIMEOUT_MS = 60000;
5
+ /** Exact semver only: no registry tags, ranges, URLs, or shell syntax. */
6
+ export declare function isExactRuntimeVersion(value: unknown): value is string;
7
+ /** Captured Codex CLI output: `codex-cli 0.153.3\n`. Other shapes fail closed. */
8
+ export declare function parseTerminalRuntimeVersion(stdout: string): string | undefined;
9
+ export declare function shellQuote(value: string): string;
10
+ export declare function buildRuntimeVersionCommand(requestedVersion?: string): string;
11
+ export declare function buildRuntimeExecPrefix(version: string, model?: string, reasoningEffort?: ReasoningEffort): string;
12
+ export declare function declaredRuntimeProvenance(args: {
13
+ version?: string;
14
+ model?: string;
15
+ reasoningEffort?: ReasoningEffort;
16
+ }): ActorRuntimeProvenance;
@@ -0,0 +1,42 @@
1
+ export const TERMINAL_RUNTIME_PACKAGE = "@openai/codex";
2
+ export const TERMINAL_RUNTIME_VERSION_TIMEOUT_MS = 60_000;
3
+ /** Exact semver only: no registry tags, ranges, URLs, or shell syntax. */
4
+ export function isExactRuntimeVersion(value) {
5
+ if (typeof value !== "string" || value.length > 120)
6
+ return false;
7
+ const match = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/.exec(value);
8
+ return match !== null && (match[4]?.split(".").every((part) => !/^\d+$/.test(part) || part === "0" || !part.startsWith("0")) ?? true);
9
+ }
10
+ /** Captured Codex CLI output: `codex-cli 0.153.3\n`. Other shapes fail closed. */
11
+ export function parseTerminalRuntimeVersion(stdout) {
12
+ const match = /^codex-cli ([^\s]+)$/.exec(stdout.trim());
13
+ return match && isExactRuntimeVersion(match[1]) ? match[1] : undefined;
14
+ }
15
+ export function shellQuote(value) {
16
+ return `'${value.replace(/'/g, "'\\''")}'`;
17
+ }
18
+ export function buildRuntimeVersionCommand(requestedVersion) {
19
+ if (requestedVersion !== undefined && !isExactRuntimeVersion(requestedVersion))
20
+ throw new Error("Invalid exact Codex runtime version.");
21
+ return `npm_config_update_notifier=false npx -y ${TERMINAL_RUNTIME_PACKAGE}@${requestedVersion ?? "latest"} --version`;
22
+ }
23
+ export function buildRuntimeExecPrefix(version, model, reasoningEffort) {
24
+ if (!isExactRuntimeVersion(version))
25
+ throw new Error("Codex execution requires a verified exact runtime version.");
26
+ return `npm_config_update_notifier=false npx -y ${TERMINAL_RUNTIME_PACKAGE}@${version} exec`
27
+ + (model === undefined ? "" : ` --model ${shellQuote(model)}`)
28
+ + (reasoningEffort === undefined ? "" : ` -c ${shellQuote(`model_reasoning_effort=${JSON.stringify(reasoningEffort)}`)}`);
29
+ }
30
+ export function declaredRuntimeProvenance(args) {
31
+ return {
32
+ schema: "humanish.actor-runtime.v1",
33
+ package: TERMINAL_RUNTIME_PACKAGE,
34
+ requestedVersion: args.version ?? "latest",
35
+ versionStatus: "unobserved",
36
+ ...(args.model === undefined ? {} : { requestedModel: args.model }),
37
+ modelStatus: args.model === undefined ? "runtime_default_unobserved" : "declared",
38
+ ...(args.reasoningEffort === undefined ? {} : { requestedReasoningEffort: args.reasoningEffort }),
39
+ usageGranularity: "runtime_turn"
40
+ };
41
+ }
42
+ //# sourceMappingURL=ter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AAE,cAAc;KACjC,CAAC;AACJ,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import type { ActorTokenUsage } from "./actor-contract.js";
2
2
  /**
3
- * Accumulate per-turn provider token usage from a captured `codex exec --json` stream.
3
+ * Accumulate runtime-turn usage from a captured `codex exec --json` stream. A Codex turn may
4
+ * include multiple provider requests; these records cannot establish per-request pricing tiers.
4
5
  *
5
6
  * Returns undefined when the stream carried no usage record at all, which is the honest "no
6
7
  * signal" case and must stay distinguishable from a measured zero. Per-turn records are preserved
@@ -21,7 +21,8 @@ function num(value) {
21
21
  return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : undefined;
22
22
  }
23
23
  /**
24
- * Accumulate per-turn provider token usage from a captured `codex exec --json` stream.
24
+ * Accumulate runtime-turn usage from a captured `codex exec --json` stream. A Codex turn may
25
+ * include multiple provider requests; these records cannot establish per-request pricing tiers.
25
26
  *
26
27
  * Returns undefined when the stream carried no usage record at all, which is the honest "no
27
28
  * signal" case and must stay distinguishable from a measured zero. Per-turn records are preserved
@@ -88,6 +89,6 @@ export function describeTokenUsage(usage) {
88
89
  if (usage.output !== undefined)
89
90
  parts.push(`${usage.output.toLocaleString("en-US")} output`);
90
91
  const turns = usage.turns?.length ?? 0;
91
- return `${parts.join(", ")} tokens over ${turns} provider turn${turns === 1 ? "" : "s"}`;
92
+ return `${parts.join(", ")} tokens over ${turns} Codex turn${turns === 1 ? "" : "s"}`;
92
93
  }
93
94
  //# sourceMappingURL=terminal-token-usage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"terminal-token-usage.js","sourceRoot":"","sources":["../src/terminal-token-usage.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,6FAA6F;AAC7F,iGAAiG;AACjG,+FAA+F;AAC/F,kGAAkG;AAClG,6FAA6F;AAC7F,EAAE;AACF,8FAA8F;AAC9F,0FAA0F;AAC1F,2FAA2F;AAC3F,EAAE;AACF,mGAAmG;AACnG,iGAAiG;AACjG,wFAAwF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C,GAAG,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7F,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC;IACvC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,KAAK,cAAc,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AACxF,CAAC"}
@@ -28,7 +28,7 @@ This is the "plural harnesses / transport-agnostic" intent of
28
28
  ```ts
29
29
  interface CuaExecutor {
30
30
  observe(): Promise<CuaObservation>; // capture current state
31
- execute(action: CuaAction): Promise<void>; // perform one action
31
+ execute(action: CuaAction, signal?: AbortSignal): Promise<void>; // perform one action
32
32
  }
33
33
 
34
34
  interface CuaObservation {
@@ -38,6 +38,15 @@ interface CuaObservation {
38
38
  }
39
39
  ```
40
40
 
41
+ The loop aborts an action's optional signal when its wait ends, including cancellation or a
42
+ deadline. An executor that prepares asynchronously should check the signal before dispatching
43
+ an input; wrappers must forward it (`execute: (...args) => inner.execute(...args)`). Existing
44
+ one-argument executors remain compatible. This does not cancel already-dispatched substrate
45
+ operations. The desktop executor uses this boundary while reading the current cursor before
46
+ left/double clicks: an exact integer match avoids redundant movement; uncertain or fractional
47
+ coordinates retain the original SDK path. The cursor read adds at most 500 ms of preparation
48
+ wait and does not cache a previous action's position.
49
+
41
50
  - **`screenshot` is optional.** A non-vision (state) executor omits it. The loop
42
51
  persists no screenshot that turn; `counts.screenshots` stays 0, so the trace's
43
52
  `redaction.screenshots` resolves to `"n/a"`. No fabricated `Buffer.alloc(0)`
@@ -37,6 +37,8 @@ fail-closed cross-validation, and forward-declared warnings.
37
37
  | `execution.target` | `e2b-terminal` (or absent → implied) |
38
38
  | `execution.terminal` | `{ transport: exec-stream, stdin: disabled }` |
39
39
  | `execution.runtimeAuth` | `openai-env` (default) or opt-in `openai-egress`; names-only durable evidence |
40
+ | `execution.runtime.version` | Optional exact `@openai/codex` version; observed before keyed execution |
41
+ | `actors[0].model` / `reasoningEffort` | Forwarded to Codex; retained as declarations, not observed provider identity |
40
42
  | `scenario.caps` | `{ maxUsd, maxJobs, maxMinutes }` — the blast-radius budget |
41
43
  | `policies` | `allowPrivateRepoAccess` / `allowProviderCredentials` / `allowPaymentCredentials` / `allowGitHubMutation`, all DEFAULT FALSE |
42
44
  | `actors[0].type` | `codex-exec` — a registered terminal actor (`keyPlacement: in-sandbox-command-scoped`) |
@@ -46,6 +48,39 @@ Routing is `routesToTerminalProduct(config)` — the single source of truth that
46
48
  both `selectLabBackend` and the forward-declared-warning logic consume, mirroring
47
49
  `routesToComputerUse` / `routesToScriptedBrowser`.
48
50
 
51
+ ## Repeating a terminal study with the same runtime
52
+
53
+ ```yaml
54
+ actors:
55
+ - type: codex-exec
56
+ model: gpt-5.6-sol
57
+ reasoningEffort: low
58
+ execution:
59
+ target: e2b-terminal
60
+ runtime:
61
+ version: 0.153.3
62
+ ```
63
+
64
+ An explicit version must be exact semver; tags, ranges, URLs, and extra runtime
65
+ fields fail at parsing. Before the keyed actor command, Humanish runs an unkeyed
66
+ `npx @openai/codex@<selector> --version` command with a 60-second deadline.
67
+ A malformed result, nonzero exit, or requested/observed mismatch fails the lane
68
+ and reclaims its owned sandbox. When the version is omitted, the probe resolves
69
+ `latest` once and execution uses the exact version it reported.
70
+
71
+ `actor.json`, the bundle's terminal actor, and `terminal-ledgers.json` retain
72
+ `humanish.actor-runtime.v1`: requested and observed versions, verification status,
73
+ declared model/effort, and the usage granularity. The observed executable version
74
+ also appears as `providerVersion`. An undeclared model stays explicitly
75
+ `runtime_default_unobserved`; Humanish does not label the runtime name as a model.
76
+ Dry runs record declarations only, in a `terminal-lab.runtime.declared` event.
77
+
78
+ These settings make a study's request reproducible, but do not attest the actual
79
+ provider model or add a provider spending limit. Codex `turn.completed` usage can
80
+ aggregate several model requests, so Humanish does not use a declared model to
81
+ infer per-request pricing tiers or fill in unknown costs. Runtime-token costs
82
+ and the studied product's no-spend boundary still need separate interpretation.
83
+
49
84
  ## Runtime auth: raw-key placement and remaining provider access
50
85
 
51
86
  `execution.runtimeAuth: openai-env` remains the compatible default. It supplies
@@ -126,7 +126,11 @@ enters this field; identity is digests, a sha, a boolean, and counts.
126
126
 
127
127
  `cost` is optional and additive (`humanish.run-cost-summary.v1`): the
128
128
  computer-use lane's run-level cost ESTIMATE — the sum of each lane's
129
- token-derived model cost plus one aggregate E2B desktop-minute figure. It is an
129
+ token-derived model cost plus E2B desktop compute lines. New independent CUA runs
130
+ emit one line per owned desktop, keyed by public lane ID and carrying observed CPU/memory,
131
+ resource source, host-measured minutes, and the derived per-second rate. Older
132
+ single aggregate desktop lines remain valid. Missing resource metadata stays
133
+ unpriced; unconfirmed cleanup adds an unknown remaining-lifetime line. It is an
130
134
  ESTIMATE, never authoritative: every dollar is a rate-table multiply from the
131
135
  operator-editable `src/pricing.ts`, carries the pricing `ratesAsOf` date and
132
136
  `source`, and is surfaced with the "estimated (rates as of `<date>`)" label —
@@ -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.81.0`; it is not an exhaustive inventory of command/result envelopes. Exported types,
6
+ `0.82.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.
@@ -978,16 +978,16 @@ never authoritative: every dollar figure is a rate-table multiply, labeled
978
978
  `humanish.run-bundle.v1` stays v1 and every pre-existing bundle is byte-stable:
979
979
 
980
980
  - `humanish.pricing.v1` — the OPERATOR-EDITABLE rate table in `src/pricing.ts`:
981
- dated per-model input/output USD-per-token rates and an E2B desktop
982
- USD-per-minute rate, each with a public pricing-page `source` and an `asOf`
981
+ dated per-model input/output USD-per-token rates and E2B CPU/GiB-second
982
+ rates, each with a public pricing-page `source` and an `asOf`
983
983
  date. A prominent banner says these are estimates to update when providers
984
984
  change pricing. Model rates may carry a `cacheWriteUsdPerToken` (OpenAI 5.6+
985
985
  bills cache writes at 1.25x input as the total rate for written tokens) and a
986
986
  `longContext` tier (a per-request input threshold that re-prices the whole
987
987
  request; priced exactly only from the trace's per-request `turns` ledger —
988
988
  totals alone never re-tier, which is the under-estimate direction). Some
989
- entries are `placeholder: true` stand-ins (the E2B desktop rate, pending a
990
- live RAM-spec confirmation) — an operator MUST confirm them before trusting
989
+ entries are `placeholder: true` stand-ins (the legacy desktop helper's
990
+ 8-vCPU/8-GiB planning assumption) — an operator MUST confirm them before trusting
991
991
  the magnitude; the flag propagates into every estimate so a stand-in is never
992
992
  mistaken for a live rate. An UNKNOWN model/desktop rate is DECLARED ABSENT
993
993
  (`estimatedCostUsd: null` + a `reason`), never guessed.
@@ -996,7 +996,14 @@ never authoritative: every dollar figure is a rate-table multiply, labeled
996
996
  `no_rate_for_model`/`no_token_usage`), `ratesAsOf`, `source`, `modelId`,
997
997
  optional `placeholder`, and a `breakdown`.
998
998
  - `humanish.run-cost-summary.v1` — `RunBundle.cost`: the sum of every lane's
999
- `model-tokens` line PLUS one aggregate `desktop-minutes` line.
999
+ `model-tokens` lines PLUS `desktop-minutes` lines. New independent CUA runs
1000
+ price each owned desktop separately; older single aggregate lines remain readable.
1001
+ A desktop line's optional `desktop` object records `minutes`,
1002
+ `durationBasis: host-acquired-to-cleanup`, observed `resources` (`cpuCount`,
1003
+ `memoryMiB`), `resourceSource: e2b.getInfo`, and `usdPerSecond` when priceable.
1004
+ Failed metadata reads record `resourceUnavailableReason`; no resource guess is used.
1005
+ Resource metadata and missing/unsupported rates produce a null line. A kept or
1006
+ unconfirmed allocation adds `desktop_lifetime_incomplete` as a second null line.
1000
1007
 
1001
1008
  The summary follows the SAME null discipline as the terminal cost ledger above.
1002
1009
  `estimatedTotalUsd` sums ONLY the non-null `breakdown` lines and is `null` iff
@@ -1008,8 +1015,10 @@ tried and could not price it) and contributes nothing. `fullyEstimated` is
1008
1015
  the MIN (oldest) `asOf` across contributing rates — an aggregate is only as fresh
1009
1016
  as its stalest input, so MAX would overclaim freshness (each `breakdown` line
1010
1017
  keeps its own true `asOf`). `desktopMinutes` is a HOST-SIDE
1011
- createteardown span an approximation of E2B's server-side billed lifetime, so
1012
- the desktop dollar figure is doubly an estimate.
1018
+ acquired-handlecleanup span, excluding allocation/startup before handle acquisition.
1019
+ It approximates E2B's server-side billed lifetime. Plan fees, credits, and negotiated
1020
+ prices are excluded; unknown remaining lifetime makes `fullyEstimated` false.
1021
+ Shared-world, scripted-browser, and terminal routes do not yet emit these desktop lines.
1013
1022
 
1014
1023
  ```yaml
1015
1024
  schema: humanish.run-cost-summary.v1
@@ -29,7 +29,7 @@ study completed, reproduced, and produced a real accessibility finding via a
29
29
  keyboard-first participant
30
30
  ([docs/goals/email-gated-signup/receipts/](email-gated-signup/receipts/)).
31
31
 
32
- ## Current Program Truth (source `0.81.0`)
32
+ ## Current Program Truth (source `0.82.0`)
33
33
 
34
34
  The package source and repository implementation in this tree agree on these
35
35
  points:
@@ -471,6 +471,22 @@ Stop and correct course if:
471
471
 
472
472
  ## Best Next Work
473
473
 
474
+ **2026-09-05 (0.82.0).** Computer-use desktop estimates now use observed CPU and RAM,
475
+ with missing resources and incomplete lifetimes left unknown (#687). Repeated clicks avoid
476
+ the redundant cursor move when a fresh position check confirms the pointer is already there
477
+ (#685). Terminal studies accept an exact Codex package version and forward the declared model
478
+ and reasoning effort; evidence records the executed version without presenting runtime defaults
479
+ as observed model usage (#688). Local-path redaction preserves nested terminal JSON framing,
480
+ and the release report reader exposes skipped malformed lines (#686). Observer cards and reports
481
+ show typed participant blockers as Blocked while retaining the original protocol trace (#691).
482
+
483
+ The new [TodoMVC comparison](https://github.com/danielgwilson/humanish/blob/main/docs/goals/computer-use-actor/receipts/todomvc-edit-confirmation-2026-09-05.md)
484
+ connects a keyboard blocker to a reproducible local patch: uninterrupted keyboard completion was
485
+ 0/2 before and 2/2 after, with one provider interruption in each version retained in the twelve
486
+ attempts. This descriptive synthetic comparison does not establish human completion rates.
487
+ The public field notes and shorter reference-linked README make the method easier to inspect
488
+ (#673, #682, #689).
489
+
474
490
  **2026-09-05 (0.81.0).** First use now distinguishes the free evidence preview
475
491
  from a live participant study, with concise successful setup output and complete JSON details
476
492
  (#660). The website has runnable docs and a generated CLI reference (#661, #668). Retained participant
@@ -2,7 +2,7 @@
2
2
 
3
3
  Status: public-safe contributor and agent ramp.
4
4
 
5
- Package/source version in this tree: `0.81.0` (2026-09-05). The Observer is phone-usable as a stated requirement (observer/AGENTS.md); interactive primitives start from Base UI. The Observer renderer is the observer/ workspace artifact only; the legacy string-concat renderer was deleted at cutover (#426), and rollback is a version pin to 0.42.0. The containment boundary introduced in
5
+ Package/source version in this tree: `0.82.0` (2026-09-05). The Observer is phone-usable as a stated requirement (observer/AGENTS.md); interactive primitives start from Base UI. The Observer renderer is the observer/ workspace artifact only; the legacy string-concat renderer was deleted at cutover (#426), and rollback is a version pin to 0.42.0. The containment boundary introduced in
6
6
  `0.15.1` remains in force: managed run and output paths bind to validated
7
7
  physical filesystem identities, and stored provider IDs are evidence, not
8
8
  cleanup authority. The bundled OSS meta-lab is dry-run only until
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "humanish",
3
- "version": "0.81.0",
3
+ "version": "0.82.0",
4
4
  "description": "Open-source-safe CLI for persona simulation, observer review, and public-safe feedback drafts.",
5
5
  "author": "Daniel G Wilson <daniel@danielgwilson.com>",
6
6
  "keywords": [