humanish 0.108.0 → 0.109.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.
- package/ARCHITECTURE.md +58 -59
- package/CHANGELOG.md +13 -0
- package/CONTEXT.md +44 -44
- package/README.md +3 -3
- package/TELEMETRY.md +2 -2
- package/dist/actors/codex/app-server-trace.js +2 -1
- package/dist/actors/codex/restricted-participant.js +12 -12
- package/dist/actors/codex/restricted-session.d.ts +2 -2
- package/dist/actors/computer-use/actor.d.ts +6 -6
- package/dist/actors/computer-use/actor.js +2 -2
- package/dist/actors/computer-use/admission-limit.d.ts +2 -2
- package/dist/actors/computer-use/admission-limit.js +3 -3
- package/dist/actors/computer-use/executor-error.d.ts +2 -2
- package/dist/actors/computer-use/executor-error.js +3 -3
- package/dist/actors/computer-use/loop/actions.js +5 -5
- package/dist/actors/computer-use/loop/debrief.js +2 -2
- package/dist/actors/computer-use/loop/ending.d.ts +1 -1
- package/dist/actors/computer-use/loop/ending.js +12 -11
- package/dist/actors/computer-use/loop/observation.js +6 -5
- package/dist/actors/computer-use/loop/provider-call.js +11 -11
- package/dist/actors/computer-use/loop/session.d.ts +4 -4
- package/dist/actors/computer-use/loop/session.js +2 -2
- package/dist/actors/computer-use/loop/trace.js +3 -2
- package/dist/actors/computer-use/loop/types.d.ts +24 -24
- package/dist/actors/computer-use/loop/usage.d.ts +2 -2
- package/dist/actors/computer-use/loop.d.ts +6 -1
- package/dist/actors/computer-use/loop.js +26 -4
- package/dist/actors/computer-use/openai-provider.d.ts +2 -2
- package/dist/actors/computer-use/openai-provider.js +8 -8
- package/dist/actors/computer-use/provider-error.d.ts +4 -4
- package/dist/actors/computer-use/provider-error.js +6 -6
- package/dist/actors/contract.d.ts +4 -4
- package/dist/actors/contract.js +1 -1
- package/dist/actors/local-agent/claude-session.js +3 -3
- package/dist/actors/local-agent/cli.d.ts +1 -1
- package/dist/actors/local-agent/cli.js +1 -1
- package/dist/actors/reasoning-effort.js +3 -3
- package/dist/actors/registry.d.ts +2 -2
- package/dist/actors/registry.js +3 -3
- package/dist/actors/scripted-browser/actor.d.ts +2 -2
- package/dist/actors/scripted-browser/actor.js +1 -1
- package/dist/analysis/automatic-completion.d.ts +7 -7
- package/dist/analysis/automatic-completion.js +1 -1
- package/dist/analysis/automatic-config.d.ts +6 -6
- package/dist/analysis/automatic-config.js +1 -1
- package/dist/analysis/execute.d.ts +1 -1
- package/dist/analysis/execute.js +1 -1
- package/dist/analysis/types.d.ts +6 -0
- package/dist/browser-control/client.js +16 -16
- package/dist/browser-control/dispatcher.js +4 -4
- package/dist/browser-control/protocol.js +14 -14
- package/dist/browser-control/recording-transfer.js +4 -4
- package/dist/browser-control/transport.js +7 -7
- package/dist/cli/commands/analysis-signals.d.ts +2 -2
- package/dist/cli/commands/comms.js +14 -22
- package/dist/cli/commands/observe.d.ts +0 -1
- package/dist/cli/commands/observe.js +0 -15
- package/dist/cli/commands/run-command.d.ts +2 -2
- package/dist/cli/commands/run-command.js +3 -3
- package/dist/cli/commands/runs.js +3 -5
- package/dist/cli/commands/setup.js +5 -7
- package/dist/cli/commands/study-format.d.ts +9 -0
- package/dist/cli/commands/{lab-format.js → study-format.js} +5 -5
- package/dist/cli/commands/{lab-route-computer-use.d.ts → study-route-computer-use.d.ts} +6 -6
- package/dist/cli/commands/{lab-route-computer-use.js → study-route-computer-use.js} +12 -12
- package/dist/cli/commands/{lab-route-open.d.ts → study-route-open.d.ts} +4 -4
- package/dist/cli/commands/{lab-route-open.js → study-route-open.js} +2 -2
- package/dist/cli/commands/{lab-route-preview.d.ts → study-route-preview.d.ts} +7 -7
- package/dist/cli/commands/{lab-route-preview.js → study-route-preview.js} +3 -3
- package/dist/cli/commands/study-route-run.d.ts +19 -0
- package/dist/cli/commands/{lab-route-run.js → study-route-run.js} +6 -6
- package/dist/cli/commands/study-route-scripted.d.ts +17 -0
- package/dist/cli/commands/{lab-route-scripted.js → study-route-scripted.js} +4 -4
- package/dist/cli/commands/{lab-route-shared-world.d.ts → study-route-shared-world.d.ts} +5 -5
- package/dist/cli/commands/{lab-route-shared-world.js → study-route-shared-world.js} +7 -7
- package/dist/cli/commands/study-route-terminal.d.ts +17 -0
- package/dist/cli/commands/{lab-route-terminal.js → study-route-terminal.js} +4 -4
- package/dist/cli/commands/study-run.d.ts +9 -0
- package/dist/cli/commands/{lab-run.js → study-run.js} +34 -34
- package/dist/cli/commands/{lab-scorer.d.ts → study-scorer.d.ts} +5 -5
- package/dist/cli/commands/{lab-scorer.js → study-scorer.js} +1 -1
- package/dist/cli/commands/study.js +13 -49
- package/dist/cli/commands/tui.js +12 -12
- package/dist/cli/commands/watch.js +30 -65
- package/dist/cli/deprecations.d.ts +1 -13
- package/dist/cli/deprecations.js +0 -30
- package/dist/cli/doctor.d.ts +3 -3
- package/dist/cli/doctor.js +16 -16
- package/dist/cli/first-run-path.d.ts +4 -4
- package/dist/cli/first-run-path.js +7 -7
- package/dist/cli/io.d.ts +3 -3
- package/dist/cli/io.js +2 -2
- package/dist/cli/observer-follow.d.ts +2 -2
- package/dist/cli/observer-follow.js +2 -2
- package/dist/cli/orientation.d.ts +4 -4
- package/dist/cli/orientation.js +58 -20
- package/dist/cli/program.js +3 -4
- package/dist/cli/telemetry.d.ts +1 -1
- package/dist/cli/telemetry.js +14 -20
- package/dist/comms/catch-host.d.ts +1 -1
- package/dist/comms/catch-host.js +3 -3
- package/dist/comms/connections.d.ts +1 -1
- package/dist/comms/connections.js +2 -2
- package/dist/comms/external-evidence.d.ts +5 -5
- package/dist/comms/external-evidence.js +4 -3
- package/dist/comms/fake-inbox.d.ts +2 -2
- package/dist/comms/fake-inbox.js +2 -2
- package/dist/comms/receiving-runtime.d.ts +4 -4
- package/dist/comms/sandbox-catch.d.ts +2 -2
- package/dist/comms/sandbox-catch.js +2 -2
- package/dist/comms/setup.d.ts +2 -2
- package/dist/comms/setup.js +29 -32
- package/dist/feedback/draft.js +2 -2
- package/dist/feedback/export.js +3 -2
- package/dist/feedback/proof.d.ts +1 -1
- package/dist/feedback/proof.js +2 -2
- package/dist/guest/bootstrap.js +6 -6
- package/dist/guest/browser-tools.js +8 -8
- package/dist/guest/chromium-text.js +17 -17
- package/dist/guest/desktop-executor.d.ts +2 -2
- package/dist/guest/desktop-executor.js +20 -20
- package/dist/guest/desktop-keys.js +4 -4
- package/dist/guest/desktop-media.d.ts +2 -2
- package/dist/guest/desktop-media.js +16 -16
- package/dist/guest/desktop-native.js +10 -10
- package/dist/guest/runtime-desktop.js +2 -2
- package/dist/guest/runtime-processes.d.ts +2 -2
- package/dist/guest/runtime-processes.js +2 -2
- package/dist/guest/runtime.js +5 -5
- package/dist/index.d.ts +13 -15
- package/dist/index.js +6 -8
- package/dist/observer/artifact.d.ts +1 -1
- package/dist/observer/artifact.js +1 -1
- package/dist/observer/data.d.ts +1 -1
- package/dist/observer/library.d.ts +2 -0
- package/dist/observer/library.js +4 -1
- package/dist/observer/render.js +7 -1
- package/dist/observer/run-routes.d.ts +1 -0
- package/dist/observer/run-routes.js +37 -12
- package/dist/observer/serve.d.ts +1 -1
- package/dist/observer-app.html +1 -1
- package/dist/routes/computer-use/bundle-parts.js +3 -2
- package/dist/routes/computer-use/bundle.d.ts +2 -2
- package/dist/routes/computer-use/bundle.js +7 -6
- package/dist/routes/computer-use/e2b-desktop/comms.d.ts +5 -5
- package/dist/routes/computer-use/e2b-desktop/comms.js +5 -4
- package/dist/routes/computer-use/e2b-desktop/fidelity.d.ts +1 -1
- package/dist/routes/computer-use/e2b-desktop/prepare.d.ts +1 -1
- package/dist/routes/computer-use/e2b-desktop/prepare.js +3 -3
- package/dist/routes/computer-use/e2b-desktop/start.js +3 -4
- package/dist/routes/computer-use/e2b-desktop/state.d.ts +2 -2
- package/dist/routes/computer-use/e2b-desktop/teardown.js +2 -3
- package/dist/routes/computer-use/external-comms.d.ts +3 -3
- package/dist/routes/computer-use/fanout-bundle.js +11 -10
- package/dist/routes/computer-use/fanout-records.js +2 -2
- package/dist/routes/computer-use/live-flush.d.ts +3 -3
- package/dist/routes/computer-use/live-phase.d.ts +2 -3
- package/dist/routes/computer-use/live-phase.js +3 -3
- package/dist/routes/computer-use/local-tree-pack.d.ts +5 -5
- package/dist/routes/computer-use/local-tree-pack.js +1 -1
- package/dist/routes/computer-use/local-vm.d.ts +8 -8
- package/dist/routes/computer-use/local-vm.js +2 -2
- package/dist/routes/computer-use/participant-desktop.d.ts +3 -3
- package/dist/routes/computer-use/participant-desktop.js +1 -1
- package/dist/routes/computer-use/participant-execution.js +1 -1
- package/dist/routes/computer-use/participant-model.js +3 -3
- package/dist/routes/computer-use/participant-prompt.d.ts +5 -5
- package/dist/routes/computer-use/participant-prompt.js +3 -3
- package/dist/routes/computer-use/participant-runs.d.ts +10 -10
- package/dist/routes/computer-use/participant-runs.js +14 -13
- package/dist/routes/computer-use/plan.d.ts +12 -12
- package/dist/routes/computer-use/plan.js +24 -24
- package/dist/routes/computer-use/preflight.d.ts +5 -5
- package/dist/routes/computer-use/preflight.js +5 -5
- package/dist/routes/computer-use/rerun-selection.d.ts +1 -1
- package/dist/routes/computer-use/rerun-selection.js +3 -2
- package/dist/routes/computer-use/result.d.ts +4 -4
- package/dist/routes/computer-use/result.js +13 -12
- package/dist/routes/computer-use/route.d.ts +12 -12
- package/dist/routes/computer-use/route.js +19 -19
- package/dist/routes/computer-use/self-report.js +1 -1
- package/dist/routes/computer-use/setup.d.ts +22 -22
- package/dist/routes/computer-use/setup.js +15 -15
- package/dist/routes/computer-use/single-bundle.d.ts +4 -4
- package/dist/routes/computer-use/single-bundle.js +14 -13
- package/dist/routes/computer-use/subject-projection.d.ts +3 -3
- package/dist/routes/computer-use/types.d.ts +34 -34
- package/dist/routes/computer-use/types.js +3 -3
- package/dist/routes/preview.d.ts +6 -6
- package/dist/routes/preview.js +5 -5
- package/dist/routes/scripted/bundle.d.ts +6 -6
- package/dist/routes/scripted/bundle.js +10 -9
- package/dist/routes/scripted/plan.d.ts +7 -7
- package/dist/routes/scripted/plan.js +6 -6
- package/dist/routes/scripted/result.d.ts +3 -3
- package/dist/routes/scripted/result.js +9 -9
- package/dist/routes/scripted/route.d.ts +9 -9
- package/dist/routes/scripted/route.js +11 -11
- package/dist/routes/scripted/scenario.d.ts +1 -1
- package/dist/routes/scripted/scenario.js +3 -3
- package/dist/routes/scripted/setup.d.ts +6 -6
- package/dist/routes/scripted/setup.js +4 -4
- package/dist/routes/scripted/subject.d.ts +5 -5
- package/dist/routes/scripted/subject.js +3 -3
- package/dist/routes/scripted/surface-records.d.ts +1 -1
- package/dist/routes/scripted/surface-records.js +2 -2
- package/dist/routes/scripted/surface-sessions.d.ts +3 -3
- package/dist/routes/scripted/types.d.ts +17 -17
- package/dist/routes/scripted/types.js +1 -1
- package/dist/routes/shared-world/bundle-records.js +3 -3
- package/dist/routes/shared-world/bundle.js +15 -14
- package/dist/routes/shared-world/checkpoints.d.ts +3 -3
- package/dist/routes/shared-world/checkpoints.js +1 -1
- package/dist/routes/shared-world/comms.d.ts +9 -9
- package/dist/routes/shared-world/comms.js +6 -5
- package/dist/routes/shared-world/participant-specs.d.ts +3 -3
- package/dist/routes/shared-world/participant-specs.js +7 -7
- package/dist/routes/shared-world/plan.d.ts +9 -9
- package/dist/routes/shared-world/plan.js +9 -9
- package/dist/routes/shared-world/provisioned.d.ts +8 -8
- package/dist/routes/shared-world/provisioned.js +4 -4
- package/dist/routes/shared-world/result.d.ts +6 -6
- package/dist/routes/shared-world/result.js +11 -10
- package/dist/routes/shared-world/route.d.ts +11 -11
- package/dist/routes/shared-world/route.js +19 -19
- package/dist/routes/shared-world/setup.d.ts +13 -13
- package/dist/routes/shared-world/setup.js +19 -19
- package/dist/routes/shared-world/types.d.ts +27 -27
- package/dist/routes/terminal/adapter.d.ts +2 -2
- package/dist/routes/terminal/adapter.js +4 -4
- package/dist/routes/terminal/bundle.d.ts +11 -11
- package/dist/routes/terminal/bundle.js +12 -12
- package/dist/routes/terminal/credentials.d.ts +4 -4
- package/dist/routes/terminal/credentials.js +5 -5
- package/dist/routes/terminal/dry-run.d.ts +4 -4
- package/dist/routes/terminal/dry-run.js +9 -9
- package/dist/routes/terminal/ledger.d.ts +2 -2
- package/dist/routes/terminal/lifetime.d.ts +1 -1
- package/dist/routes/terminal/lifetime.js +1 -1
- package/dist/routes/terminal/live-finish.d.ts +2 -2
- package/dist/routes/terminal/live-finish.js +7 -7
- package/dist/routes/terminal/live-sandbox.d.ts +2 -2
- package/dist/routes/terminal/live-sandbox.js +3 -2
- package/dist/routes/terminal/participant-text.js +2 -1
- package/dist/routes/terminal/persona.d.ts +2 -2
- package/dist/routes/terminal/persona.js +2 -2
- package/dist/routes/terminal/plan.d.ts +7 -7
- package/dist/routes/terminal/plan.js +5 -5
- package/dist/routes/terminal/result.d.ts +5 -5
- package/dist/routes/terminal/result.js +7 -7
- package/dist/routes/terminal/route.d.ts +9 -9
- package/dist/routes/terminal/route.js +14 -14
- package/dist/routes/terminal/session.d.ts +5 -5
- package/dist/routes/terminal/session.js +7 -7
- package/dist/routes/terminal/trace.d.ts +2 -2
- package/dist/routes/terminal/types.d.ts +24 -24
- package/dist/routes/terminal/types.js +2 -2
- package/dist/run/bundle.d.ts +7 -7
- package/dist/run/bundle.js +2 -2
- package/dist/run/costs.d.ts +23 -0
- package/dist/run/costs.js +72 -43
- package/dist/run/dry-run-inputs.d.ts +1 -1
- package/dist/run/dry-run-inputs.js +1 -1
- package/dist/run/dry-run.js +2 -2
- package/dist/run/outcomes.d.ts +1 -1
- package/dist/run/participant.d.ts +1 -1
- package/dist/run/preflight-receipts.js +1 -1
- package/dist/run/pricing.js +2 -2
- package/dist/run/projection.d.ts +32 -32
- package/dist/run/projection.js +44 -44
- package/dist/run/reclaim.d.ts +1 -1
- package/dist/run/reclaim.js +1 -1
- package/dist/run/results.d.ts +2 -2
- package/dist/run/run-cost.d.ts +53 -0
- package/dist/run/run-cost.js +105 -0
- package/dist/run/run-index-analysis.d.ts +15 -0
- package/dist/run/run-index-analysis.js +77 -0
- package/dist/run/run-index.d.ts +11 -1
- package/dist/run/run-index.js +63 -49
- package/dist/run/run.d.ts +3 -3
- package/dist/run/run.js +2 -2
- package/dist/run/shared-world-evidence.d.ts +1 -1
- package/dist/run/shared-world-shape.js +1 -1
- package/dist/run/stats.d.ts +3 -3
- package/dist/run/stats.js +14 -14
- package/dist/run/status.d.ts +10 -2
- package/dist/run/status.js +6 -3
- package/dist/run/streams.d.ts +2 -2
- package/dist/run/study-provenance.d.ts +4 -2
- package/dist/run/study-provenance.js +7 -4
- package/dist/run/study-result.d.ts +0 -5
- package/dist/run/study-result.js +1 -1
- package/dist/run-study.d.ts +112 -0
- package/dist/{run-lab.js → run-study.js} +52 -45
- package/dist/{lab → study}/adapter-extension.d.ts +8 -20
- package/dist/{lab → study}/adapter-extension.js +2 -14
- package/dist/{lab → study}/adapter-scorer-loader.d.ts +10 -10
- package/dist/{lab → study}/adapter-scorer-loader.js +3 -3
- package/dist/study/composition-rules.d.ts +7 -0
- package/dist/{lab → study}/composition-rules.js +12 -12
- package/dist/study/config.d.ts +15 -0
- package/dist/{lab → study}/config.js +37 -20
- package/dist/study/convert.d.ts +1 -1
- package/dist/study/convert.js +15 -15
- package/dist/{lab → study}/device-presets.d.ts +2 -2
- package/dist/{lab → study}/discover.d.ts +29 -23
- package/dist/{lab → study}/discover.js +97 -118
- package/dist/{lab → study}/doctor.d.ts +11 -11
- package/dist/{lab → study}/doctor.js +18 -18
- package/dist/study/files.d.ts +2 -2
- package/dist/study/files.js +6 -5
- package/dist/{lab → study}/init-templates.d.ts +2 -2
- package/dist/{lab → study}/init-templates.js +16 -11
- package/dist/{lab → study}/init.d.ts +1 -1
- package/dist/{lab → study}/init.js +7 -4
- package/dist/{lab → study}/keys.d.ts +2 -2
- package/dist/{lab → study}/keys.js +10 -10
- package/dist/study/migrate.d.ts +1 -1
- package/dist/{lab → study}/parse/actors.d.ts +5 -5
- package/dist/{lab → study}/parse/actors.js +5 -5
- package/dist/study/parse/comms.d.ts +12 -0
- package/dist/study/parse/execution.d.ts +19 -0
- package/dist/{lab → study}/parse/study-v3.d.ts +3 -5
- package/dist/{lab → study}/parse/study-v3.js +3 -3
- package/dist/{lab → study}/parse/subject-state.d.ts +8 -8
- package/dist/{lab → study}/parse/subject-state.js +4 -4
- package/dist/{lab → study}/parse/subject.d.ts +3 -3
- package/dist/{lab → study}/parse/subject.js +8 -8
- package/dist/{lab → study}/parse/values.d.ts +2 -2
- package/dist/{lab → study}/persona-resolve.d.ts +4 -4
- package/dist/{lab → study}/persona-resolve.js +2 -2
- package/dist/{lab → study}/plan-base.d.ts +7 -7
- package/dist/{lab → study}/plan-base.js +1 -1
- package/dist/{lab → study}/plan-participants.d.ts +10 -10
- package/dist/{lab → study}/plan-participants.js +4 -4
- package/dist/{lab → study}/plan-types.d.ts +28 -28
- package/dist/{lab → study}/plan-types.js +2 -2
- package/dist/study/plan.d.ts +13 -0
- package/dist/{lab → study}/plan.js +20 -20
- package/dist/study/preflight-probes.d.ts +3 -0
- package/dist/{lab → study}/preflight-probes.js +9 -8
- package/dist/study/preflight-result.d.ts +8 -0
- package/dist/{lab → study}/preflight-result.js +3 -3
- package/dist/{lab → study}/preflight.d.ts +31 -31
- package/dist/{lab → study}/preflight.js +8 -8
- package/dist/{lab → study}/requirements.d.ts +3 -3
- package/dist/{lab → study}/requirements.js +1 -1
- package/dist/study/route-inputs.d.ts +28 -0
- package/dist/{lab → study}/route-inputs.js +1 -1
- package/dist/{lab → study}/routing.d.ts +12 -12
- package/dist/{lab/run-lab-events.d.ts → study/run-study-events.d.ts} +10 -10
- package/dist/{lab/run-lab-events.js → study/run-study-events.js} +3 -3
- package/dist/{lab/run-lab-homes.d.ts → study/run-study-homes.d.ts} +8 -17
- package/dist/study/run-study-homes.js +3 -0
- package/dist/study/run-study-options.d.ts +28 -0
- package/dist/{lab/run-lab-options.js → study/run-study-options.js} +13 -12
- package/dist/{lab/lab-deps.d.ts → study/study-deps.d.ts} +2 -2
- package/dist/{lab/lab-deps.js → study/study-deps.js} +2 -2
- package/dist/{lab → study}/summary.d.ts +10 -10
- package/dist/{lab → study}/summary.js +15 -15
- package/dist/{lab → study}/tasks.d.ts +3 -3
- package/dist/{lab → study}/tasks.js +1 -1
- package/dist/{lab → study}/types.d.ts +104 -104
- package/dist/{lab → study}/types.js +1 -1
- package/dist/{lab → study}/validation.d.ts +19 -19
- package/dist/{lab → study}/validation.js +13 -13
- package/dist/{lab → study}/warnings.d.ts +4 -4
- package/dist/{lab → study}/warnings.js +1 -1
- package/dist/subject/clone.d.ts +6 -6
- package/dist/subject/clone.js +2 -2
- package/dist/subject/local-tree-archive.d.ts +2 -2
- package/dist/subject/local-tree-archive.js +3 -3
- package/dist/subject/local-tree.d.ts +3 -3
- package/dist/subject/runtime.js +2 -2
- package/dist/subject/serve.d.ts +4 -4
- package/dist/subject/state.d.ts +3 -3
- package/dist/subject/state.js +1 -1
- package/dist/subject/steps.d.ts +1 -1
- package/dist/subject/steps.js +1 -1
- package/dist/substrates/desktop-session.js +2 -2
- package/dist/substrates/detached.d.ts +1 -1
- package/dist/substrates/e2b/desktop-browser.d.ts +4 -4
- package/dist/substrates/e2b/desktop-browser.js +1 -1
- package/dist/substrates/e2b/desktop-cdp.d.ts +1 -1
- package/dist/substrates/e2b/desktop-cdp.js +1 -1
- package/dist/substrates/e2b/desktop-executor.d.ts +1 -1
- package/dist/substrates/e2b/desktop-executor.js +12 -12
- package/dist/substrates/e2b/desktop-geometry.d.ts +1 -1
- package/dist/substrates/e2b/desktop-geometry.js +1 -1
- package/dist/substrates/e2b/desktop-media.d.ts +3 -3
- package/dist/substrates/e2b/lifetime.js +1 -1
- package/dist/substrates/e2b/sandbox.d.ts +3 -3
- package/dist/substrates/e2b/sandbox.js +1 -1
- package/dist/substrates/e2b/sdk.d.ts +1 -1
- package/dist/substrates/e2b/sdk.js +1 -1
- package/dist/substrates/local/runtime-config.d.ts +4 -4
- package/dist/substrates/local/runtime-config.js +4 -4
- package/dist/tui/contract.d.ts +8 -8
- package/dist/tui/contract.js +2 -2
- package/dist/tui/launch.d.ts +3 -3
- package/dist/tui/launch.js +22 -16
- package/dist/tui-app.js +139 -139
- package/dist/verify/subject.d.ts +1 -1
- package/dist/verify/subject.js +1 -1
- package/dist/verify/verify.js +2 -1
- package/docs/architecture/actor-contract.md +5 -5
- package/docs/architecture/browser-control.md +1 -1
- package/docs/architecture/external-public-shared-world.md +8 -7
- package/docs/architecture/github-feedback-loop.md +1 -1
- package/docs/architecture/task-protocol-support.md +1 -1
- package/docs/architecture/terminal-product-route.md +18 -18
- package/docs/contracts/adapter-fixtures.md +2 -2
- package/docs/contracts/errors.md +8 -8
- package/docs/contracts/run-bundle.md +1 -4
- package/docs/contracts/schemas.md +61 -42
- package/docs/contracts/study-analysis.md +4 -1
- package/docs/contracts/study-costs.md +17 -2
- package/examples/README.md +1 -1
- package/examples/scorer/scorer.mjs +3 -3
- package/package.json +1 -1
- package/skills/humanish/SKILL.md +8 -6
- package/skills/humanish/agents/openai.yaml +1 -1
- package/dist/cli/commands/lab-format.d.ts +0 -9
- package/dist/cli/commands/lab-route-run.d.ts +0 -19
- package/dist/cli/commands/lab-route-scripted.d.ts +0 -17
- package/dist/cli/commands/lab-route-terminal.d.ts +0 -17
- package/dist/cli/commands/lab-run.d.ts +0 -9
- package/dist/lab/composition-rules.d.ts +0 -7
- package/dist/lab/config.d.ts +0 -7
- package/dist/lab/deprecated-fields.d.ts +0 -10
- package/dist/lab/deprecated-fields.js +0 -24
- package/dist/lab/parse/comms.d.ts +0 -12
- package/dist/lab/parse/execution.d.ts +0 -19
- package/dist/lab/plan.d.ts +0 -13
- package/dist/lab/preflight-probes.d.ts +0 -3
- package/dist/lab/preflight-result.d.ts +0 -8
- package/dist/lab/route-inputs.d.ts +0 -28
- package/dist/lab/run-lab-homes.js +0 -7
- package/dist/lab/run-lab-options.d.ts +0 -28
- package/dist/library-aliases.d.ts +0 -56
- package/dist/library-aliases.js +0 -22
- package/dist/run-lab.d.ts +0 -112
- /package/dist/{lab → study}/device-presets.js +0 -0
- /package/dist/{lab → study}/init-paths.d.ts +0 -0
- /package/dist/{lab → study}/init-paths.js +0 -0
- /package/dist/{lab → study}/init-plan.d.ts +0 -0
- /package/dist/{lab → study}/init-plan.js +0 -0
- /package/dist/{lab → study}/parse/comms.js +0 -0
- /package/dist/{lab → study}/parse/execution.js +0 -0
- /package/dist/{lab → study}/parse/values.js +0 -0
- /package/dist/{lab → study}/participant-assignment.d.ts +0 -0
- /package/dist/{lab → study}/participant-assignment.js +0 -0
- /package/dist/{lab → study}/persona.d.ts +0 -0
- /package/dist/{lab → study}/persona.js +0 -0
- /package/dist/{lab → study}/routing.js +0 -0
|
@@ -10,21 +10,21 @@ import type { AutomaticAnalysisRefusal } from "../../analysis/job.js";
|
|
|
10
10
|
import { type CuaDiagnostics } from "./diagnostics.js";
|
|
11
11
|
import type { ActorCompletionReason, ActorStatus, ActorStopCause, ActorTokenUsage, ActorTraceItem } from "../../actors/contract.js";
|
|
12
12
|
import { type CuaActorDescriptor } from "../../actors/registry.js";
|
|
13
|
-
import type {
|
|
14
|
-
import type {
|
|
15
|
-
import type { InProcessDriver, ProviderFactory,
|
|
16
|
-
import { type BrowserScorer } from "../../
|
|
13
|
+
import type { StudyDeps } from "../../study/study-deps.js";
|
|
14
|
+
import type { StudyEvent, ParticipantRef } from "../../study/run-study-events.js";
|
|
15
|
+
import type { InProcessDriver, ProviderFactory, RunStudyHomes } from "../../study/run-study-homes.js";
|
|
16
|
+
import { type BrowserScorer } from "../../study/adapter-extension.js";
|
|
17
17
|
import type { CuaActorSessionOptions } from "../../actors/computer-use/actor.js";
|
|
18
18
|
import { type E2BDesktopModule } from "../../substrates/e2b/sdk.js";
|
|
19
19
|
import { type DesktopResourceObservation } from "../../substrates/e2b/desktop-resources.js";
|
|
20
20
|
import { type DetachedTimers } from "../../substrates/detached.js";
|
|
21
|
-
import type { Brain, ComputerUsePlan, ComputerUseRunner, ResidualConfig } from "../../
|
|
22
|
-
import { type
|
|
21
|
+
import type { Brain, ComputerUsePlan, ComputerUseRunner, ResidualConfig } from "../../study/plan-types.js";
|
|
22
|
+
import { type StudyCommsEmail, type StudyConfig } from "../../study/types.js";
|
|
23
23
|
import { type ObserverResult } from "../../observer/render.js";
|
|
24
24
|
import { type BundleRun, type RunBundle, type RunRerunLineage, type RunScorerProvenance, type RunSubjectProvenance, type RunSubjectStateStepRecord } from "../../run/bundle.js";
|
|
25
25
|
import { type RunDesktopGeometry } from "../../run/streams.js";
|
|
26
26
|
import { type PreparedOutputRoot } from "../../run/contained-output.js";
|
|
27
|
-
import type { ComputerUseParticipant, SharedWorldParticipant } from "../../
|
|
27
|
+
import type { ComputerUseParticipant, SharedWorldParticipant } from "../../study/plan-participants.js";
|
|
28
28
|
import type { ResolvedParticipant } from "../../run/participant.js";
|
|
29
29
|
import { type StudyResultIdentity } from "../../run/study-result.js";
|
|
30
30
|
export declare const CUA_FANOUT_STRATEGY: "per-lane-worlds";
|
|
@@ -35,9 +35,9 @@ export declare const MIN_DERIVED_SESSION_TIMEOUT_MS: number;
|
|
|
35
35
|
* What a computer-use run takes besides its plan and config. The count override and rerun go to
|
|
36
36
|
* participant building with the config.
|
|
37
37
|
*/
|
|
38
|
-
export type ComputerUseRunInput = Omit<
|
|
38
|
+
export type ComputerUseRunInput = Omit<RunCuaActorStudyOptions, "config" | "dryRun">;
|
|
39
39
|
/**
|
|
40
|
-
* What
|
|
40
|
+
* What runStudyWith's local VM study gives a computer-use run: the desktop each participant runs on, the
|
|
41
41
|
* reason automatic analysis must not run (the study's cleanup is unconfirmed), and the signal its
|
|
42
42
|
* sessions abort on.
|
|
43
43
|
*/
|
|
@@ -47,11 +47,11 @@ export interface LocalVmInput {
|
|
|
47
47
|
readonly analysisRefusal: () => AutomaticAnalysisRefusal | undefined;
|
|
48
48
|
readonly signal?: AbortSignal;
|
|
49
49
|
}
|
|
50
|
-
export interface
|
|
50
|
+
export interface RunCuaActorStudyOptions {
|
|
51
51
|
/** Cancels post-run analysis only. */
|
|
52
52
|
analysisSignal?: AbortSignal;
|
|
53
53
|
cwd: string;
|
|
54
|
-
config:
|
|
54
|
+
config: StudyConfig;
|
|
55
55
|
/** Resolved upstream (scenario.mode + CLI override); defaults safe (dry-run). */
|
|
56
56
|
dryRun: boolean;
|
|
57
57
|
open?: boolean;
|
|
@@ -67,23 +67,23 @@ export interface RunCuaActorLabOptions {
|
|
|
67
67
|
/** Keys and subject env for the run. Defaults to process.env. */
|
|
68
68
|
env?: Readonly<Record<string, string | undefined>>;
|
|
69
69
|
/** E2B only. Runs on each participant's desktop after it exists and before provisioning. */
|
|
70
|
-
prepareDesktop?: NonNullable<
|
|
71
|
-
/**
|
|
70
|
+
prepareDesktop?: NonNullable<RunStudyHomes["prepareDesktop"]>;
|
|
71
|
+
/** runStudyWith's local VM study, for an app-url study on the local target. */
|
|
72
72
|
localVm?: LocalVmInput;
|
|
73
73
|
onObserverReady?: (observer: ObserverResult & {
|
|
74
74
|
ok: true;
|
|
75
75
|
}) => Promise<void> | void;
|
|
76
76
|
/** Awaited after a participant's live stream starts, and again after its sandbox is gone. */
|
|
77
|
-
onStream?: NonNullable<
|
|
78
|
-
/** The caller's brain for each participant, in place of the
|
|
77
|
+
onStream?: NonNullable<RunStudyHomes["onStream"]>;
|
|
78
|
+
/** The caller's brain for each participant, in place of the study's own. */
|
|
79
79
|
createProvider?: ProviderFactory;
|
|
80
80
|
/** Drives an app-url or local-app subject in this process, with no desktop. Needs createProvider. */
|
|
81
81
|
inProcess?: InProcessDriver;
|
|
82
|
-
/** Reports the plan and subject phases to onEvent; built by
|
|
83
|
-
emit?: (event:
|
|
82
|
+
/** Reports the plan and subject phases to onEvent; built by normalizeRunStudyOptions. */
|
|
83
|
+
emit?: (event: StudyEvent) => void;
|
|
84
84
|
/** Test seams. */
|
|
85
|
-
deps?:
|
|
86
|
-
/** Scores the assembled evidence: `
|
|
85
|
+
deps?: StudyDeps;
|
|
86
|
+
/** Scores the assembled evidence: `RunStudyOptions.scorer`, or the scorer the CLI loads. */
|
|
87
87
|
scorer?: BrowserScorer;
|
|
88
88
|
/** Present only when the scorer was config-declared and loaded by the CLI;
|
|
89
89
|
* core-stamped onto the bundle as evidence. Absent for library callers. */
|
|
@@ -103,7 +103,7 @@ export interface CuaParticipantPlanEntry {
|
|
|
103
103
|
/** Requested E2B/X screen resolution. This is not the measured browser CSS viewport. */
|
|
104
104
|
resolution: [number, number];
|
|
105
105
|
instructionDigest: string;
|
|
106
|
-
/** The declared reasoning effort for this participant, when the
|
|
106
|
+
/** The declared reasoning effort for this participant, when the study declared one. The plan line is what
|
|
107
107
|
* you read before spending money, so a declared per-participant difference has to be visible there. */
|
|
108
108
|
reasoningEffort?: string;
|
|
109
109
|
maxOutputTokens?: number;
|
|
@@ -164,7 +164,7 @@ export interface CuaParticipantResult {
|
|
|
164
164
|
/** Set when the participant was skipped (pinned reason string). */
|
|
165
165
|
skippedReason?: string;
|
|
166
166
|
error?: {
|
|
167
|
-
code:
|
|
167
|
+
code: CuaActorStudyErrorCode;
|
|
168
168
|
message: string;
|
|
169
169
|
};
|
|
170
170
|
}
|
|
@@ -183,7 +183,7 @@ export interface CuaParticipantSummary {
|
|
|
183
183
|
concurrency: number;
|
|
184
184
|
waves: number;
|
|
185
185
|
}
|
|
186
|
-
export type
|
|
186
|
+
export type CuaActorStudyErrorCode = "HUMANISH_STUDY_ANALYSIS_INVALID" | "HUMANISH_STUDY_TASKS_UNSUPPORTED" | "HUMANISH_STUDY_OPTION_UNSUPPORTED" | "HUMANISH_STUDY_V2_UNSUPPORTED" | "HUMANISH_COMPUTER_USE_FAILED" | "HUMANISH_COMPUTER_USE_KEYS_MISSING" | "HUMANISH_COMPUTER_USE_AGENT_MISSING" | "HUMANISH_COMPUTER_USE_AGENT_SIGNIN_REQUIRED" | "HUMANISH_COMPUTER_USE_SUBJECT_ENV_MISSING" | "HUMANISH_COMPUTER_USE_ACTOR_UNSUPPORTED" | "HUMANISH_COMPUTER_USE_SUBJECT_INVALID" | "HUMANISH_COMPUTER_USE_SUBJECT_UNSAFE" | "HUMANISH_COMPUTER_USE_EXECUTOR_NO_PROVIDER" | "HUMANISH_COMPUTER_USE_LOCAL_APP_NO_EXECUTOR" | "HUMANISH_COMPUTER_USE_LOCAL_DESKTOP_MISSING" | "HUMANISH_COMPUTER_USE_FANOUT_INVALID" | "HUMANISH_COMPUTER_USE_RERUN_INVALID" | "HUMANISH_COMPUTER_USE_DEVICE_GEOMETRY" | "HUMANISH_RUN_ID_IN_USE" | "HUMANISH_COMPUTER_USE_UNPRICED_CAP" | "HUMANISH_COMPUTER_USE_COMMS_CATCH_UNREACHABLE" | "HUMANISH_COMPUTER_USE_COMMS_TOKEN_INVALID" | "HUMANISH_WATCH_ALLOW_REQUIRES_OAUTH" | "HUMANISH_WATCH_OAUTH_REQUIRES_TUNNEL" | "HUMANISH_WATCH_OPTION_CONFLICT" | "HUMANISH_WATCH_TUNNEL_REQUIRES_EXPOSE" | "HUMANISH_WATCH_EXPOSE_REQUIRES_EDGE_AUTH" | "HUMANISH_WATCH_EXPOSE_REQUIRES_LIVE_FOLLOW" | "HUMANISH_WATCH_SAFE_NOT_APPLICABLE" | "HUMANISH_SERVE_TUNNEL_NOT_FOUND" | "HUMANISH_SERVE_TUNNEL_START_FAILED";
|
|
187
187
|
/** Subject provenance projection: what the actor actually drove. */
|
|
188
188
|
export interface CuaSubjectProjection {
|
|
189
189
|
source: "app-url" | "clone" | "local-tree";
|
|
@@ -221,7 +221,7 @@ export type CuaSubjectProvenanceArg = {
|
|
|
221
221
|
envNames: string[];
|
|
222
222
|
state: RunSubjectProvenance["state"];
|
|
223
223
|
};
|
|
224
|
-
export interface
|
|
224
|
+
export interface CuaActorStudyResult extends AutomaticAnalysisResult, StudyResultIdentity<"computer-use"> {
|
|
225
225
|
/** True when the Observer verified the bundle, all live participants passed credibility checks
|
|
226
226
|
* (or this is a dry-run), and no declared adapter/scorer verdict failed. */
|
|
227
227
|
ok: boolean;
|
|
@@ -261,7 +261,7 @@ export interface CuaActorLabResult extends AutomaticAnalysisResult, StudyResultI
|
|
|
261
261
|
diagnostics?: CuaDiagnostics;
|
|
262
262
|
warnings: string[];
|
|
263
263
|
error?: {
|
|
264
|
-
code:
|
|
264
|
+
code: CuaActorStudyErrorCode;
|
|
265
265
|
message: string;
|
|
266
266
|
};
|
|
267
267
|
}
|
|
@@ -322,7 +322,7 @@ export declare function participantServeUrl(subject: ParticipantSubject): string
|
|
|
322
322
|
export interface E2BDesktopDeps {
|
|
323
323
|
/** The plan's residual config: comms, policies, the desktop and target, and subject leftovers. */
|
|
324
324
|
residual: Readonly<ResidualConfig>;
|
|
325
|
-
|
|
325
|
+
studyId: string;
|
|
326
326
|
appUrl: string;
|
|
327
327
|
/** What the participant's desktop does with the subject before the participant starts. */
|
|
328
328
|
subject: ParticipantSubject;
|
|
@@ -335,15 +335,15 @@ export interface E2BDesktopDeps {
|
|
|
335
335
|
sandboxMs: number;
|
|
336
336
|
participantCount: number;
|
|
337
337
|
artifactRoot: PreparedOutputRoot;
|
|
338
|
-
/** The
|
|
339
|
-
|
|
338
|
+
/** The study's resolution directory: relative paths in the config (a camera .y4m) resolve here. */
|
|
339
|
+
studyCwd: string;
|
|
340
340
|
scrubKnownValues: (text: string) => string;
|
|
341
341
|
receiving?: CommsReceivingRun;
|
|
342
342
|
/** Adopter-hosted comms plane: present on the app-url route when comms.email.external is
|
|
343
343
|
* declared. Carries the parsed comms block (recipients drive the per-participant inbox instruction)
|
|
344
344
|
* and the inbox URL the persona opens. The drain runs once at run level, not per participant. */
|
|
345
345
|
externalComms?: {
|
|
346
|
-
email:
|
|
346
|
+
email: StudyCommsEmail;
|
|
347
347
|
inboxUrl: string;
|
|
348
348
|
};
|
|
349
349
|
/** Injected clock (ms). It measures the host-side E2B desktop create->teardown span so the
|
|
@@ -352,11 +352,11 @@ export interface E2BDesktopDeps {
|
|
|
352
352
|
/** Loads the E2B SDK for the participant's desktop. Defaults to loadE2BDesktopModule. */
|
|
353
353
|
desktopModule?: () => Promise<E2BDesktopModule>;
|
|
354
354
|
/** The caller's prepareDesktop, called with the participant as its target. */
|
|
355
|
-
prepareDesktop?: NonNullable<
|
|
355
|
+
prepareDesktop?: NonNullable<RunStudyHomes["prepareDesktop"]>;
|
|
356
356
|
/** Clock and sleep for detached provisioning steps. */
|
|
357
357
|
detachedTimers?: DetachedTimers;
|
|
358
358
|
/** Receives each live stream's ready and ended: the Observer's tracker, then the caller's onStream. */
|
|
359
|
-
onStream: NonNullable<
|
|
359
|
+
onStream: NonNullable<RunStudyHomes["onStream"]>;
|
|
360
360
|
/** Reports a subject phase to the phase sink (stderr by default) and to onEvent. */
|
|
361
361
|
reportSubjectPhase: (event: SubjectPhaseEvent, participant: ParticipantRef) => void;
|
|
362
362
|
/**
|
|
@@ -466,17 +466,17 @@ export interface ParticipantRunOutcome {
|
|
|
466
466
|
* external outcome constructors (shared-world, test fakes) stay valid; absent counts as false. */
|
|
467
467
|
reportedFriction?: boolean;
|
|
468
468
|
harnessError: boolean;
|
|
469
|
-
failureCode?:
|
|
469
|
+
failureCode?: CuaActorStudyErrorCode;
|
|
470
470
|
/** Relative run-dir path of the digest-only comms-thread evidence artifact this participant wrote
|
|
471
|
-
* (humanish.comms-thread.v1), when a comms
|
|
472
|
-
* in the participant's stream artifacts. Absent when no comms
|
|
471
|
+
* (humanish.comms-thread.v1), when a comms study captured mail into its in-sandbox catch. Registered
|
|
472
|
+
* in the participant's stream artifacts. Absent when no comms study ran or nothing was captured. */
|
|
473
473
|
commsArtifactPath?: string;
|
|
474
474
|
}
|
|
475
475
|
/** What buildCuaFanoutBundle projects into a fan-out run bundle. */
|
|
476
476
|
export interface CuaFanoutBundleArgs {
|
|
477
477
|
/** The run's verdict, from the judge. */
|
|
478
478
|
verdict: Verdict;
|
|
479
|
-
/** The run this bundle belongs to; the bundle head reads its id, mode, start and
|
|
479
|
+
/** The run this bundle belongs to; the bundle head reads its id, mode, start and study. */
|
|
480
480
|
run: BundleRun;
|
|
481
481
|
specs: DesktopParticipantRun[];
|
|
482
482
|
outcomes?: ParticipantRunOutcome[];
|
|
@@ -2,11 +2,11 @@ import {} from "./participant-desktop.js";
|
|
|
2
2
|
import {} from "../../analysis/automatic-completion.js";
|
|
3
3
|
import {} from "./diagnostics.js";
|
|
4
4
|
import {} from "../../actors/registry.js";
|
|
5
|
-
import {} from "../../
|
|
5
|
+
import {} from "../../study/adapter-extension.js";
|
|
6
6
|
import {} from "../../substrates/e2b/sdk.js";
|
|
7
7
|
import {} from "../../substrates/e2b/desktop-resources.js";
|
|
8
8
|
import {} from "../../substrates/detached.js";
|
|
9
|
-
import {} from "../../
|
|
9
|
+
import {} from "../../study/types.js";
|
|
10
10
|
import {} from "../../observer/render.js";
|
|
11
11
|
import {} from "../../run/bundle.js";
|
|
12
12
|
import {} from "../../run/streams.js";
|
|
@@ -28,7 +28,7 @@ export const CUA_MAX_CONCURRENCY_ENV = "HUMANISH_CUA_MAX_CONCURRENCY";
|
|
|
28
28
|
// App-url and in-process routes default to 30 minutes. Provisioned routes (clone/local-tree)
|
|
29
29
|
// default to whatever the 1-hour sandbox cap leaves after provisioning, declared state seeding,
|
|
30
30
|
// and the teardown buffer (20 minutes on a stateless clone), floored at the old five minutes so
|
|
31
|
-
// a state-heavy
|
|
31
|
+
// a state-heavy study still gets a session at all. An explicit execution.timeoutMs is never
|
|
32
32
|
// adjusted: when it cannot be provisioned, the plan-time cap refusal shows the arithmetic.
|
|
33
33
|
export const DEFAULT_APP_URL_SESSION_TIMEOUT_MS = 30 * 60_000;
|
|
34
34
|
export const MIN_DERIVED_SESSION_TIMEOUT_MS = 5 * 60_000;
|
package/dist/routes/preview.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { AdmittedPlan,
|
|
2
|
-
import type {
|
|
1
|
+
import type { AdmittedPlan, RunStudyOptions } from "../run-study.js";
|
|
2
|
+
import type { StudyPlan, PlanRefusal } from "../study/plan-types.js";
|
|
3
3
|
import type { RunResult } from "../run/results.js";
|
|
4
4
|
import { type StudyResultIdentity } from "../run/study-result.js";
|
|
5
|
-
type PreviewPlan = Extract<
|
|
5
|
+
type PreviewPlan = Extract<StudyPlan, {
|
|
6
6
|
readonly route: "preview";
|
|
7
7
|
}>;
|
|
8
8
|
/**
|
|
@@ -11,9 +11,9 @@ type PreviewPlan = Extract<LabPlan, {
|
|
|
11
11
|
*/
|
|
12
12
|
export type PreviewStudyResult = Omit<RunResult, "schema"> & StudyResultIdentity<"preview">;
|
|
13
13
|
/** A refused preview's result. */
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function previewStudyRefusal(cwd: string, studyId: string, refusal: Extract<PlanRefusal, {
|
|
15
15
|
readonly route: "preview";
|
|
16
16
|
}>): PreviewStudyResult;
|
|
17
|
-
/**
|
|
18
|
-
export declare function admitPreviewPlan(plan: PreviewPlan, input: Pick<
|
|
17
|
+
/** runStudyWith's step for a preview plan: it has no local checks and takes no scorer, so it returns its run. */
|
|
18
|
+
export declare function admitPreviewPlan(plan: PreviewPlan, input: Pick<RunStudyOptions, "cwd" | "runId" | "open">): AdmittedPlan<"preview">;
|
|
19
19
|
export {};
|
package/dist/routes/preview.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// The preview route: a
|
|
1
|
+
// The preview route: a study whose subject is this repo runs the synthetic dry run. planStudy decides
|
|
2
2
|
// the sim count and refuses what a synthetic run would ignore; runPreviewPlan does the rest.
|
|
3
3
|
import { studyResultIdentity } from "../run/study-result.js";
|
|
4
4
|
import { runDryRun } from "../run/dry-run.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
/** A refused preview's result. */
|
|
7
|
-
export function
|
|
7
|
+
export function previewStudyRefusal(cwd, studyId, refusal) {
|
|
8
8
|
return {
|
|
9
9
|
...studyResultIdentity("preview", studyId),
|
|
10
10
|
ok: false,
|
|
@@ -13,7 +13,7 @@ export function previewLabRefusal(cwd, studyId, refusal) {
|
|
|
13
13
|
error: { code: refusal.code, message: refusal.message },
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/** runStudyWith's step for a preview plan: it has no local checks and takes no scorer, so it returns its run. */
|
|
17
17
|
export function admitPreviewPlan(plan, input) {
|
|
18
18
|
return {
|
|
19
19
|
ok: true,
|
|
@@ -21,7 +21,7 @@ export function admitPreviewPlan(plan, input) {
|
|
|
21
21
|
route: "preview",
|
|
22
22
|
result: {
|
|
23
23
|
...(await runPreviewPlan(plan, input)),
|
|
24
|
-
...studyResultIdentity("preview", plan.
|
|
24
|
+
...studyResultIdentity("preview", plan.studyId),
|
|
25
25
|
},
|
|
26
26
|
}),
|
|
27
27
|
};
|
|
@@ -29,7 +29,7 @@ export function admitPreviewPlan(plan, input) {
|
|
|
29
29
|
/** Run a preview plan: the synthetic dry run with the planned sim count. */
|
|
30
30
|
function runPreviewPlan(plan, input) {
|
|
31
31
|
return runDryRun({
|
|
32
|
-
...(plan.
|
|
32
|
+
...(plan.study === undefined ? {} : { study: plan.study }),
|
|
33
33
|
cwd: input.cwd,
|
|
34
34
|
dryRun: true,
|
|
35
35
|
participantCount: plan.participantCount,
|
|
@@ -3,9 +3,9 @@ import type { ScriptedBrowserSessionResult } from "../../actors/scripted-browser
|
|
|
3
3
|
import type { BrowserPersonaJourney, BrowserSurface } from "../../actors/scripted-browser/types.js";
|
|
4
4
|
import type { DesktopResourceObservation } from "../../substrates/e2b/desktop-resources.js";
|
|
5
5
|
import { type ReviewSummary, type RunBundle, type RunSubjectProvenance, type BundleRun } from "../../run/bundle.js";
|
|
6
|
-
/** What the scripted
|
|
6
|
+
/** What the scripted study's bundle is built from. */
|
|
7
7
|
interface ScriptedBundleArgs {
|
|
8
|
-
/** The run this bundle belongs to; the bundle head reads its id, mode, start and
|
|
8
|
+
/** The run this bundle belongs to; the bundle head reads its id, mode, start and study. */
|
|
9
9
|
run: BundleRun;
|
|
10
10
|
actorId: string;
|
|
11
11
|
appUrl: string;
|
|
@@ -13,8 +13,8 @@ interface ScriptedBundleArgs {
|
|
|
13
13
|
dryRun: boolean;
|
|
14
14
|
hostDigest?: string;
|
|
15
15
|
journey: BrowserPersonaJourney;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
studyId: string;
|
|
17
|
+
studyTitle?: string;
|
|
18
18
|
persona: ActorPersonaRef;
|
|
19
19
|
scenarioSource: string;
|
|
20
20
|
scenarioSourceDigest: string;
|
|
@@ -34,11 +34,11 @@ interface ScriptedBundleArgs {
|
|
|
34
34
|
verdict: ReviewSummary["verdict"];
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
* Project the scripted
|
|
37
|
+
* Project the scripted run into a humanish.run-bundle.v1 (no schema change: a new
|
|
38
38
|
* producer only). The key line is `stream.actor = result.trace`: the provider-neutral
|
|
39
39
|
* ActorTrace seam the Observer renders and verifyRun's engagement check reads. Exported for
|
|
40
40
|
* the bundle-builder tests.
|
|
41
41
|
*/
|
|
42
|
-
export declare function
|
|
42
|
+
export declare function buildScriptedStudyBundle(args: ScriptedBundleArgs): RunBundle;
|
|
43
43
|
export declare function renderScriptedReviewMarkdown(bundle: RunBundle): string;
|
|
44
44
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Assemble the scripted-browser
|
|
1
|
+
// Assemble the scripted-browser study's run bundle from its sessions, and the review summary and
|
|
2
2
|
// markdown that ship with it.
|
|
3
3
|
import { verdictText } from "../../run/judge.js";
|
|
4
4
|
import { redactText } from "../../evidence/redaction.js";
|
|
@@ -7,13 +7,14 @@ import { REVIEW_SCHEMA, bundleArtifacts, bundleHead, } from "../../run/bundle.js
|
|
|
7
7
|
import {} from "../../run/streams.js";
|
|
8
8
|
import { participantEvent, recordIdOf } from "../../run/participant-records.js";
|
|
9
9
|
import { scriptedSurfaceIds, scriptedSurfaceRecords } from "./surface-records.js";
|
|
10
|
+
import { plural } from "../../run/text.js";
|
|
10
11
|
/**
|
|
11
|
-
* Project the scripted
|
|
12
|
+
* Project the scripted run into a humanish.run-bundle.v1 (no schema change: a new
|
|
12
13
|
* producer only). The key line is `stream.actor = result.trace`: the provider-neutral
|
|
13
14
|
* ActorTrace seam the Observer renders and verifyRun's engagement check reads. Exported for
|
|
14
15
|
* the bundle-builder tests.
|
|
15
16
|
*/
|
|
16
|
-
export function
|
|
17
|
+
export function buildScriptedStudyBundle(args) {
|
|
17
18
|
const resultBySurface = new Map(args.sessionResults.map((result) => [result.capture.surface.id, result]));
|
|
18
19
|
// Each surface's records are stamped with the run's start.
|
|
19
20
|
const context = { ...args, createdAt: args.run.createdAt };
|
|
@@ -27,7 +28,7 @@ export function buildScriptedLabBundle(args) {
|
|
|
27
28
|
persona: {
|
|
28
29
|
id: args.persona.id,
|
|
29
30
|
name: `Scripted journey persona (${args.persona.id})`,
|
|
30
|
-
source: `study:${args.
|
|
31
|
+
source: `study:${args.studyId}`,
|
|
31
32
|
sourceDigest: args.persona.promptDigest,
|
|
32
33
|
},
|
|
33
34
|
scenario: {
|
|
@@ -41,7 +42,7 @@ export function buildScriptedLabBundle(args) {
|
|
|
41
42
|
{
|
|
42
43
|
at: args.run.createdAt,
|
|
43
44
|
event: "scripted-lab.run.created",
|
|
44
|
-
message: `Created scripted-browser
|
|
45
|
+
message: `Created a scripted-browser run with ${args.surfaces.length} surface${args.surfaces.length === 1 ? "" : "s"} (actor ${args.actorId}).`,
|
|
45
46
|
},
|
|
46
47
|
],
|
|
47
48
|
simulations: records.map((record) => record.simulation),
|
|
@@ -69,14 +70,14 @@ function scriptedEvents(args) {
|
|
|
69
70
|
at: args.run.createdAt,
|
|
70
71
|
level: "info",
|
|
71
72
|
type: "scripted-lab.run.created",
|
|
72
|
-
message: `Created scripted-browser
|
|
73
|
+
message: `Created a scripted-browser run for ${args.studyId} (actor ${args.actorId}, ${args.surfaces.length} surface${args.surfaces.length === 1 ? "" : "s"}).`,
|
|
73
74
|
},
|
|
74
75
|
{
|
|
75
76
|
id: "event-001-subject",
|
|
76
77
|
at: args.run.createdAt,
|
|
77
78
|
level: "info",
|
|
78
79
|
type: "scripted-lab.subject.declared",
|
|
79
|
-
// Provenance is recorded or its absence declared.
|
|
80
|
+
// Provenance is recorded or its absence declared. humanish did not provision
|
|
80
81
|
// this subject on app-url routes; clone routes carry structured subject provenance below.
|
|
81
82
|
message: args.subject
|
|
82
83
|
? `Provisioned synthetic subject: clone of ${args.subject.repo}${args.subject.commit ? `@${args.subject.commit}` : ""}, served + getHost-exposed in-sandbox; env names: ${args.subject.envNames?.join(", ") || "none"} (values never persisted); state provenance: ${args.subject.state.provenance}; evidence host digest: ${args.hostDigest ?? "dry-run"}.`
|
|
@@ -144,7 +145,7 @@ function buildScriptedReview(args) {
|
|
|
144
145
|
return {
|
|
145
146
|
schema: REVIEW_SCHEMA,
|
|
146
147
|
verdict: args.verdict,
|
|
147
|
-
summary: `
|
|
148
|
+
summary: `The scripted run failed before a terminal session verdict: ${args.sessionError}`,
|
|
148
149
|
gaps: [],
|
|
149
150
|
};
|
|
150
151
|
}
|
|
@@ -182,7 +183,7 @@ export function renderScriptedReviewMarkdown(bundle) {
|
|
|
182
183
|
`- scenario: ${bundle.scenario.id} @ ${bundle.scenario.sourceDigest} (${bundle.scenario.source})`,
|
|
183
184
|
...(subject ? [`- subject: ${subject.message}`] : []),
|
|
184
185
|
...(spend ? [`- spend: ${spend.message}`] : []),
|
|
185
|
-
...traces.map(({ stream, trace }) => `- ${recordIdOf(stream)}: ${trace.provider} (${trace.lane}/${trace.protocol}) ${trace.status} (${trace.completionReason}); ${trace.counts.actions ?? 0
|
|
186
|
+
...traces.map(({ stream, trace }) => `- ${recordIdOf(stream)}: ${trace.provider} (${trace.lane}/${trace.protocol}) ${trace.status} (${trace.completionReason}); ${plural(trace.counts.actions ?? 0, "step action")}, ${plural(trace.counts.screenshots ?? 0, "raw screenshot")}`),
|
|
186
187
|
...(bundle.review.gaps.length > 0
|
|
187
188
|
? ["", "## Gaps", ...bundle.review.gaps.map((gap) => `- ${gap}`)]
|
|
188
189
|
: []),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { RoutePlanResult, RouteRefusal, ScriptedPlan } from "../../
|
|
3
|
-
import type {
|
|
4
|
-
/** The error a scripted
|
|
1
|
+
import type { StudyDeps } from "../../study/study-deps.js";
|
|
2
|
+
import type { RoutePlanResult, RouteRefusal, ScriptedPlan } from "../../study/plan-types.js";
|
|
3
|
+
import type { StudyConfig } from "../../study/types.js";
|
|
4
|
+
/** The error a scripted study returns before a run starts. */
|
|
5
5
|
export interface ScriptedRefusal extends RouteRefusal<"scripted", "HUMANISH_STUDY_ANALYSIS_INVALID" | "HUMANISH_STUDY_TASKS_UNSUPPORTED" | "HUMANISH_SCRIPTED_ACTOR_UNSUPPORTED" | "HUMANISH_SCRIPTED_SCENARIO_INVALID" | "HUMANISH_SCRIPTED_SUBJECT_UNSAFE"> {
|
|
6
6
|
/**
|
|
7
7
|
* Set on the receiving, analysis and tasks refusals. The route returns those before it opens its
|
|
@@ -16,12 +16,12 @@ export type ScriptedPlanResult = RoutePlanResult<ScriptedPlan, ScriptedRefusal>;
|
|
|
16
16
|
/** The app URL a run's evidence names: a provisioned subject's getHost URL is never persisted. */
|
|
17
17
|
export declare function evidenceAppUrlOf(subject: ScriptedPlan["subject"]): string;
|
|
18
18
|
/** Whether a test injected the browser, so a live run needs no host browser. */
|
|
19
|
-
export declare function injectedBrowser(deps:
|
|
19
|
+
export declare function injectedBrowser(deps: StudyDeps | undefined): boolean;
|
|
20
20
|
/**
|
|
21
|
-
* Plan a scripted-browser
|
|
21
|
+
* Plan a scripted-browser study. It is called for any config handed to the scripted runner, not only
|
|
22
22
|
* one routeOf sends here, so a config for another route gets this route's refusal.
|
|
23
23
|
*/
|
|
24
|
-
export declare function
|
|
24
|
+
export declare function planScriptedStudy(config: StudyConfig, input: {
|
|
25
25
|
readonly dryRun: boolean;
|
|
26
26
|
/** A test's injected browser means a live run needs no host browser. */
|
|
27
27
|
readonly injectedBrowser?: boolean;
|
|
@@ -5,8 +5,8 @@ import { actorRegistry, isScriptedBrowserActorDescriptor } from "../../actors/re
|
|
|
5
5
|
import { normalizeLocalAppUrl } from "../../actors/scripted-browser/steps.js";
|
|
6
6
|
import { browserSurfaces } from "../../actors/scripted-browser/types.js";
|
|
7
7
|
import { resolveAutomaticAnalysis } from "../../analysis/automatic-config.js";
|
|
8
|
-
import { isNonEmpty, planBase, provisionedSubject } from "../../
|
|
9
|
-
import { cloneTargetValidationReason, desktopMediaValidationReason, taskProtocolValidationReason, } from "../../
|
|
8
|
+
import { isNonEmpty, planBase, provisionedSubject } from "../../study/plan-base.js";
|
|
9
|
+
import { cloneTargetValidationReason, desktopMediaValidationReason, taskProtocolValidationReason, } from "../../study/validation.js";
|
|
10
10
|
// Default surface roster is 1 (desktop only): the defaults-table single-participant row governs;
|
|
11
11
|
// `count: 2` is the declared override that adds the mobile surface.
|
|
12
12
|
const DEFAULT_SURFACE_COUNT = 1;
|
|
@@ -19,17 +19,17 @@ export function injectedBrowser(deps) {
|
|
|
19
19
|
return Boolean(deps?.launchBrowser || deps?.browserCommand);
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Plan a scripted-browser
|
|
22
|
+
* Plan a scripted-browser study. It is called for any config handed to the scripted runner, not only
|
|
23
23
|
* one routeOf sends here, so a config for another route gets this route's refusal.
|
|
24
24
|
*/
|
|
25
|
-
export function
|
|
25
|
+
export function planScriptedStudy(config, input) {
|
|
26
26
|
const refuse = (code, message, extras = {}) => ({
|
|
27
27
|
ok: false,
|
|
28
28
|
refusal: { route: "scripted", code, message, ...extras },
|
|
29
29
|
});
|
|
30
30
|
const beforeScope = { beforeScope: true };
|
|
31
31
|
if (String(config.comms?.email?.kind) === "real")
|
|
32
|
-
return refuse("HUMANISH_SCRIPTED_SCENARIO_INVALID", "Real email receiving is unsupported on the scripted route. Use a supported hosted computer-use browser
|
|
32
|
+
return refuse("HUMANISH_SCRIPTED_SCENARIO_INVALID", "Real email receiving is unsupported on the scripted route. Use a supported hosted computer-use browser study.", beforeScope);
|
|
33
33
|
const analysis = resolveAutomaticAnalysis(config.review?.analysis);
|
|
34
34
|
if (!analysis.ok)
|
|
35
35
|
return refuse("HUMANISH_STUDY_ANALYSIS_INVALID", analysis.message, beforeScope);
|
|
@@ -53,7 +53,7 @@ export function planScriptedLab(config, input) {
|
|
|
53
53
|
if (config.subject.source === "clone") {
|
|
54
54
|
const provisioned = provisionedSubject(config);
|
|
55
55
|
if (provisioned?.kind !== "clone" || !provisioned.repo)
|
|
56
|
-
return refuse("HUMANISH_SCRIPTED_SUBJECT_UNSAFE", "clone scripted-browser
|
|
56
|
+
return refuse("HUMANISH_SCRIPTED_SUBJECT_UNSAFE", "clone scripted-browser studies require one subject repo plus subject.serve; parseStudy should have rejected this config.", { actor, appUrl: "[provisioned-subject]" });
|
|
57
57
|
subject = provisioned;
|
|
58
58
|
}
|
|
59
59
|
else {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ActorPersonaRef } from "../../actors/contract.js";
|
|
2
2
|
import type { ScriptedBrowserSessionResult } from "../../actors/scripted-browser/actor.js";
|
|
3
3
|
import type { BrowserPersonaJourney } from "../../actors/scripted-browser/types.js";
|
|
4
|
-
import type { ScriptedPlan } from "../../
|
|
4
|
+
import type { ScriptedPlan } from "../../study/plan-types.js";
|
|
5
5
|
import type { RunBundle } from "../../run/bundle.js";
|
|
6
6
|
import type { RunScope } from "../../run/run.js";
|
|
7
7
|
import { type ExecutionFailure } from "../../run/judge.js";
|
|
8
8
|
import type { ObserverResult } from "../../observer/render.js";
|
|
9
9
|
import type { ScriptedSubject } from "./subject.js";
|
|
10
|
-
import { type
|
|
10
|
+
import { type ScriptedBrowserStudyResult } from "./types.js";
|
|
11
11
|
/** What the finish reads from the run. */
|
|
12
12
|
export interface ScriptedFinishInputs {
|
|
13
13
|
plan: ScriptedPlan;
|
|
@@ -48,4 +48,4 @@ export declare function scriptedExecutionFailures(args: {
|
|
|
48
48
|
subject: Pick<ScriptedSubject, "sandboxId" | "killed" | "releaseWarning"> | undefined;
|
|
49
49
|
observer: Pick<ObserverResult, "ok" | "error">;
|
|
50
50
|
}): ExecutionFailure[];
|
|
51
|
-
export declare function finishScriptedRun(inputs: ScriptedFinishInputs): Promise<
|
|
51
|
+
export declare function finishScriptedRun(inputs: ScriptedFinishInputs): Promise<ScriptedBrowserStudyResult>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { judgeExecution, sandboxCleanupFailure, judgeScripted, OUTCOME_POLICIES, resultOk, } from "../../run/judge.js";
|
|
2
2
|
import { validatePreparedRunArtifactPaths } from "../../run/paths.js";
|
|
3
3
|
import { resolveSubjectState } from "../computer-use/subject-projection.js";
|
|
4
|
-
import {
|
|
4
|
+
import { buildScriptedStudyBundle } from "./bundle.js";
|
|
5
5
|
import { existingScreenshots } from "./session-result.js";
|
|
6
6
|
import {} from "./types.js";
|
|
7
7
|
import { studyResultIdentity } from "../../run/study-result.js";
|
|
@@ -37,7 +37,7 @@ export function scriptedExecutionFailures(args) {
|
|
|
37
37
|
? [
|
|
38
38
|
{
|
|
39
39
|
kind: "harness",
|
|
40
|
-
message: "
|
|
40
|
+
message: "The scripted run did not produce terminal sessions for every surface.",
|
|
41
41
|
},
|
|
42
42
|
]
|
|
43
43
|
: []),
|
|
@@ -49,7 +49,7 @@ export function scriptedExecutionFailures(args) {
|
|
|
49
49
|
: [
|
|
50
50
|
{
|
|
51
51
|
kind: "evidence",
|
|
52
|
-
message: observer.error?.message ?? "Observer failed for the scripted
|
|
52
|
+
message: observer.error?.message ?? "Observer failed for the scripted run.",
|
|
53
53
|
},
|
|
54
54
|
]),
|
|
55
55
|
];
|
|
@@ -90,14 +90,14 @@ export async function finishScriptedRun(inputs) {
|
|
|
90
90
|
expected: surfaces.length,
|
|
91
91
|
surfaces: sessionResults.map(scriptedSurfaceFacts),
|
|
92
92
|
});
|
|
93
|
-
const bundle =
|
|
93
|
+
const bundle = buildScriptedStudyBundle({
|
|
94
94
|
run,
|
|
95
95
|
actorId: actor,
|
|
96
96
|
appUrl: evidenceAppUrl,
|
|
97
97
|
dryRun,
|
|
98
98
|
journey,
|
|
99
|
-
|
|
100
|
-
...(plan.title ? {
|
|
99
|
+
studyId: plan.studyId,
|
|
100
|
+
...(plan.title ? { studyTitle: plan.title } : {}),
|
|
101
101
|
persona,
|
|
102
102
|
scenarioSource: scenario.source,
|
|
103
103
|
scenarioSourceDigest: scenario.sourceDigest,
|
|
@@ -136,7 +136,7 @@ export async function finishScriptedRun(inputs) {
|
|
|
136
136
|
await finished.recordOutcome({ ok, execution });
|
|
137
137
|
const harnessErrorSession = sessionResults.find((result) => result.completionReason === "harness_error");
|
|
138
138
|
return {
|
|
139
|
-
...studyResultIdentity("scripted", plan.
|
|
139
|
+
...studyResultIdentity("scripted", plan.studyId),
|
|
140
140
|
ok,
|
|
141
141
|
cwd,
|
|
142
142
|
actor,
|
|
@@ -172,8 +172,8 @@ export async function finishScriptedRun(inputs) {
|
|
|
172
172
|
(observer.ok
|
|
173
173
|
? harnessErrorSession
|
|
174
174
|
? `Scripted session ended with a harness error: ${harnessErrorSession.reason}`
|
|
175
|
-
: "
|
|
176
|
-
: (observer.error?.message ?? "Observer failed for the scripted
|
|
175
|
+
: "The scripted run did not produce terminal sessions for every surface."
|
|
176
|
+
: (observer.error?.message ?? "Observer failed for the scripted run.")),
|
|
177
177
|
},
|
|
178
178
|
}),
|
|
179
179
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import type { ScriptedPlan } from "../../
|
|
2
|
-
import type { AdmittedPlan } from "../../run-
|
|
1
|
+
import type { ScriptedPlan } from "../../study/plan-types.js";
|
|
2
|
+
import type { AdmittedPlan } from "../../run-study.js";
|
|
3
3
|
import { type ScriptedRefusal } from "./plan.js";
|
|
4
|
-
import { type
|
|
4
|
+
import { type RunScriptedBrowserStudyOptions, type ScriptedBrowserStudyResult, type ScriptedRunInput } from "./types.js";
|
|
5
5
|
/**
|
|
6
6
|
* The config-taking entry point. It plans, returns a refusal with the envelope the route has always
|
|
7
7
|
* returned at that refusal's stage, and otherwise runs the plan.
|
|
8
8
|
*/
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function runScriptedBrowserStudy(options: RunScriptedBrowserStudyOptions): Promise<ScriptedBrowserStudyResult>;
|
|
10
10
|
/**
|
|
11
|
-
* A refused scripted
|
|
11
|
+
* A refused scripted study's result, at the refusal's stage: a before-scope refusal has its own field
|
|
12
12
|
* order and no analysis record; the others come after the output directory checks.
|
|
13
13
|
*/
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function scriptedStudyRefusal(options: RunScriptedBrowserStudyOptions, refusal: ScriptedRefusal): Promise<ScriptedBrowserStudyResult>;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* runStudyWith's step for a scripted plan. It takes no scorer, and its local checks (keys, a browser)
|
|
17
17
|
* run inside the run, so it returns the run.
|
|
18
18
|
*/
|
|
19
19
|
export declare function admitScriptedPlan(plan: ScriptedPlan, input: ScriptedRunInput): AdmittedPlan<"scripted">;
|
|
20
20
|
/**
|
|
21
21
|
* Run a scripted plan. The run scope gives a direct library caller the same status-record lifetime
|
|
22
22
|
* the CLI gets: returning from this function finalizes any record the run opened, whichever of its
|
|
23
|
-
* fail-closed exits it took. Each route opens its own scope; `
|
|
23
|
+
* fail-closed exits it took. Each route opens its own scope; `runStudyWith` opens none. Without this a
|
|
24
24
|
* test or an adopter calling the route directly leaves
|
|
25
25
|
* the 5s cadence ticking into a directory something else is deleting, which surfaces as an
|
|
26
26
|
* unrelated ENOTEMPTY.
|
|
27
27
|
*/
|
|
28
|
-
export declare function runScriptedPlan(plan: ScriptedPlan, input: ScriptedRunInput): Promise<
|
|
28
|
+
export declare function runScriptedPlan(plan: ScriptedPlan, input: ScriptedRunInput): Promise<ScriptedBrowserStudyResult>;
|