humanish 0.106.0 → 0.107.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -2
- package/ARCHITECTURE.md +17 -16
- package/CHANGELOG.md +24 -0
- package/CONTEXT.md +42 -39
- package/CONTRIBUTING.md +8 -6
- package/README.md +8 -3
- package/dist/actors/codex/app-server-client.js +2 -1
- package/dist/actors/codex/app-server-trace.d.ts +0 -1
- package/dist/actors/codex/app-server-trace.js +1 -3
- package/dist/actors/codex/app-server.js +2 -1
- package/dist/actors/codex/protocol-compat.d.ts +27 -0
- package/dist/actors/codex/protocol-compat.js +357 -0
- package/dist/actors/codex/protocol-contract.d.ts +61 -0
- package/dist/actors/codex/protocol-contract.js +471 -0
- package/dist/actors/codex/qualified-versions.d.ts +31 -4
- package/dist/actors/codex/qualified-versions.js +51 -6
- package/dist/actors/codex/restricted-executable.d.ts +24 -0
- package/dist/actors/codex/restricted-executable.js +97 -22
- package/dist/actors/codex/restricted-launch.d.ts +7 -1
- package/dist/actors/codex/restricted-launch.js +42 -3
- package/dist/actors/codex/restricted-notifications.d.ts +101 -0
- package/dist/actors/codex/restricted-notifications.js +277 -0
- package/dist/actors/codex/restricted-participant.d.ts +30 -0
- package/dist/actors/codex/restricted-participant.js +60 -2
- package/dist/actors/codex/restricted-policy.d.ts +9 -1
- package/dist/actors/codex/restricted-session.d.ts +14 -1
- package/dist/actors/codex/restricted-session.js +50 -17
- package/dist/actors/codex/restricted-transport.d.ts +29 -0
- package/dist/actors/codex/restricted-transport.js +139 -27
- package/dist/actors/codex/restricted-turn.d.ts +19 -4
- package/dist/actors/codex/restricted-turn.js +43 -30
- package/dist/actors/computer-use/actor.d.ts +1 -1
- package/dist/actors/computer-use/actor.js +4 -4
- package/dist/actors/computer-use/loop/backstop.js +1 -1
- package/dist/actors/computer-use/loop/ending.d.ts +2 -2
- package/dist/actors/computer-use/loop/ending.js +2 -2
- package/dist/actors/computer-use/loop/spend.d.ts +1 -1
- package/dist/actors/computer-use/loop/spend.js +3 -3
- package/dist/actors/computer-use/loop/trace.js +2 -2
- package/dist/actors/computer-use/loop/types.d.ts +14 -5
- package/dist/actors/computer-use/loop.js +4 -4
- package/dist/actors/computer-use/openai-provider.d.ts +1 -1
- package/dist/actors/computer-use/openai-provider.js +2 -2
- package/dist/actors/contract.d.ts +10 -8
- package/dist/actors/contract.js +7 -1
- package/dist/actors/local-agent/cli.js +1 -1
- package/dist/actors/scripted-browser/actor.d.ts +2 -2
- package/dist/actors/scripted-browser/journey.js +15 -4
- package/dist/actors/scripted-browser/steps.js +18 -0
- package/dist/actors/scripted-browser/types.d.ts +11 -1
- package/dist/actors/stop-conditions.js +1 -3
- package/dist/analysis/automatic-completion.d.ts +13 -8
- package/dist/analysis/automatic-completion.js +14 -8
- package/dist/analysis/automatic-config.d.ts +1 -1
- package/dist/analysis/automatic-config.js +2 -2
- package/dist/analysis/automatic.d.ts +10 -4
- package/dist/analysis/automatic.js +17 -13
- package/dist/analysis/diagnostics.d.ts +23 -0
- package/dist/analysis/diagnostics.js +112 -0
- package/dist/analysis/evidence-sources.js +2 -2
- package/dist/analysis/evidence.js +6 -6
- package/dist/analysis/execute.d.ts +7 -1
- package/dist/analysis/execute.js +39 -12
- package/dist/analysis/job.d.ts +8 -5
- package/dist/analysis/job.js +15 -14
- package/dist/analysis/load.d.ts +1 -1
- package/dist/analysis/load.js +5 -5
- package/dist/analysis/provider.d.ts +9 -1
- package/dist/analysis/restricted-codex.d.ts +2 -0
- package/dist/analysis/restricted-codex.js +10 -1
- package/dist/analysis/service.d.ts +2 -0
- package/dist/analysis/service.js +31 -12
- package/dist/analysis/sharing.d.ts +2 -2
- package/dist/analysis/sharing.js +5 -5
- package/dist/analysis/store-executions.d.ts +5 -5
- package/dist/analysis/store-executions.js +12 -12
- package/dist/analysis/store.d.ts +4 -4
- package/dist/analysis/store.js +13 -13
- package/dist/cli/commands/analysis-signals.d.ts +2 -1
- package/dist/cli/commands/analysis-signals.js +4 -1
- package/dist/cli/commands/analyze.js +4 -2
- package/dist/cli/commands/comms.js +8 -1
- package/dist/cli/commands/lab-route-computer-use.d.ts +0 -2
- package/dist/cli/commands/lab-route-computer-use.js +26 -14
- package/dist/cli/commands/lab-route-preview.d.ts +1 -3
- package/dist/cli/commands/lab-route-preview.js +3 -4
- package/dist/cli/commands/lab-route-run.d.ts +6 -4
- package/dist/cli/commands/lab-route-run.js +6 -2
- package/dist/cli/commands/lab-route-scripted.d.ts +0 -2
- package/dist/cli/commands/lab-route-scripted.js +0 -1
- package/dist/cli/commands/lab-route-shared-world.d.ts +0 -2
- package/dist/cli/commands/lab-route-shared-world.js +0 -1
- package/dist/cli/commands/lab-route-terminal.d.ts +0 -2
- package/dist/cli/commands/lab-route-terminal.js +0 -1
- package/dist/cli/commands/lab-run.js +76 -45
- package/dist/cli/commands/lab-scorer.d.ts +0 -2
- package/dist/cli/commands/lab.js +12 -6
- package/dist/cli/commands/observe.js +22 -0
- package/dist/cli/commands/run-signals.d.ts +30 -0
- package/dist/cli/commands/run-signals.js +146 -0
- package/dist/cli/commands/runs.js +10 -8
- package/dist/cli/commands/watch.js +12 -10
- package/dist/cli/doctor.d.ts +3 -0
- package/dist/cli/doctor.js +10 -2
- package/dist/cli/io.d.ts +5 -4
- package/dist/cli/io.js +12 -8
- package/dist/cli/program.js +3 -3
- package/dist/cli/renamed-options.d.ts +11 -0
- package/dist/cli/renamed-options.js +18 -0
- package/dist/cli/telemetry.d.ts +2 -2
- package/dist/cli/telemetry.js +1 -1
- package/dist/comms/capture-surface.d.ts +1 -1
- package/dist/comms/catch-host.d.ts +1 -1
- package/dist/comms/connections.js +4 -4
- package/dist/comms/external-evidence.d.ts +27 -0
- package/dist/comms/external-evidence.js +93 -0
- package/dist/comms/lease-store.js +7 -7
- package/dist/comms/types.js +1 -1
- package/dist/evidence/browser-hygiene.d.ts +1 -1
- package/dist/evidence/browser-hygiene.js +1 -1
- package/dist/evidence/redaction.js +1 -1
- package/dist/evidence/secret-scrub.d.ts +9 -0
- package/dist/evidence/secret-scrub.js +96 -0
- package/dist/feedback/draft.js +7 -9
- package/dist/feedback/export-bundle.js +4 -4
- package/dist/feedback/export.js +9 -9
- package/dist/feedback/feedback.d.ts +1 -1
- package/dist/index.d.ts +3 -6
- package/dist/index.js +3 -6
- package/dist/keys/key-resolution.d.ts +3 -1
- package/dist/keys/key-resolution.js +18 -16
- package/dist/lab/adapter-extension.d.ts +28 -6
- package/dist/lab/adapter-extension.js +65 -126
- package/dist/lab/adapter-scorer-loader.d.ts +25 -5
- package/dist/lab/adapter-scorer-loader.js +24 -0
- package/dist/lab/composition-rules.d.ts +2 -0
- package/dist/lab/composition-rules.js +35 -26
- package/dist/lab/config.js +28 -26
- package/dist/lab/device-presets.d.ts +2 -2
- package/dist/lab/discover.js +1 -3
- package/dist/lab/doctor.d.ts +44 -9
- package/dist/lab/doctor.js +149 -41
- package/dist/lab/init-plan.js +1 -3
- package/dist/lab/keys.js +1 -1
- package/dist/lab/lab-deps.d.ts +85 -0
- package/dist/lab/lab-deps.js +4 -0
- package/dist/lab/parse/actors.js +8 -7
- package/dist/lab/parse/comms.js +3 -2
- package/dist/lab/parse/execution.js +3 -2
- package/dist/lab/parse/subject-state.js +2 -1
- package/dist/lab/parse/subject.js +2 -1
- package/dist/lab/parse/values.d.ts +0 -1
- package/dist/lab/parse/values.js +0 -3
- package/dist/lab/persona-resolve.d.ts +3 -3
- package/dist/lab/persona-resolve.js +4 -4
- package/dist/lab/persona.js +1 -3
- package/dist/lab/plan-base.d.ts +6 -2
- package/dist/lab/plan-base.js +22 -7
- package/dist/lab/plan-participants.d.ts +5 -5
- package/dist/lab/plan-participants.js +2 -2
- package/dist/lab/plan-types.d.ts +33 -7
- package/dist/lab/plan.d.ts +3 -11
- package/dist/lab/plan.js +18 -42
- package/dist/lab/preflight-result.js +0 -2
- package/dist/lab/preflight.d.ts +0 -3
- package/dist/lab/preflight.js +1 -1
- package/dist/lab/requirements.d.ts +20 -0
- package/dist/lab/requirements.js +54 -0
- package/dist/lab/route-inputs.d.ts +23 -12
- package/dist/lab/route-inputs.js +48 -51
- package/dist/lab/routing.d.ts +19 -24
- package/dist/lab/routing.js +14 -47
- package/dist/lab/run-lab-events.d.ts +6 -11
- package/dist/lab/run-lab-events.js +3 -11
- package/dist/lab/run-lab-homes.d.ts +64 -0
- package/dist/lab/run-lab-homes.js +3 -0
- package/dist/lab/run-lab-options.d.ts +12 -66
- package/dist/lab/run-lab-options.js +45 -275
- package/dist/lab/summary.d.ts +9 -4
- package/dist/lab/summary.js +15 -8
- package/dist/lab/types.d.ts +132 -132
- package/dist/lab/validation.d.ts +15 -15
- package/dist/lab/validation.js +28 -28
- package/dist/lab/warnings.js +20 -19
- package/dist/observer/artifact.d.ts +1 -1
- package/dist/observer/artifact.js +3 -3
- package/dist/observer/data.js +2 -2
- package/dist/observer/render.js +2 -2
- package/dist/observer/run-routes.d.ts +1 -1
- package/dist/observer/run-routes.js +5 -5
- package/dist/observer/serve.d.ts +17 -0
- package/dist/observer/serve.js +34 -3
- package/dist/observer-app.html +1 -1
- package/dist/routes/computer-use/bundle-parts.d.ts +1 -1
- package/dist/routes/computer-use/bundle-parts.js +10 -3
- package/dist/routes/computer-use/bundle.d.ts +4 -11
- package/dist/routes/computer-use/bundle.js +9 -15
- package/dist/routes/computer-use/diagnostics.d.ts +1 -1
- package/dist/routes/computer-use/diagnostics.js +1 -1
- package/dist/routes/computer-use/e2b-desktop/comms.d.ts +10 -10
- package/dist/routes/computer-use/e2b-desktop/comms.js +11 -14
- package/dist/routes/computer-use/e2b-desktop/desktop.d.ts +2 -2
- package/dist/routes/computer-use/e2b-desktop/desktop.js +4 -7
- package/dist/routes/computer-use/e2b-desktop/fidelity.d.ts +13 -13
- package/dist/routes/computer-use/e2b-desktop/fidelity.js +11 -11
- package/dist/routes/computer-use/e2b-desktop/prepare.d.ts +3 -3
- package/dist/routes/computer-use/e2b-desktop/prepare.js +33 -36
- package/dist/routes/computer-use/e2b-desktop/start.d.ts +1 -1
- package/dist/routes/computer-use/e2b-desktop/start.js +24 -23
- package/dist/routes/computer-use/e2b-desktop/state.d.ts +5 -4
- package/dist/routes/computer-use/e2b-desktop/state.js +5 -3
- package/dist/routes/computer-use/e2b-desktop/teardown.d.ts +1 -1
- package/dist/routes/computer-use/e2b-desktop/teardown.js +29 -17
- package/dist/routes/computer-use/external-comms.d.ts +4 -4
- package/dist/routes/computer-use/external-comms.js +19 -43
- package/dist/routes/computer-use/fanout-bundle.d.ts +3 -3
- package/dist/routes/computer-use/fanout-bundle.js +25 -29
- package/dist/routes/computer-use/{fanout-lanes.js → fanout-records.js} +25 -19
- package/dist/routes/computer-use/in-process-desktop.d.ts +3 -10
- package/dist/routes/computer-use/in-process-desktop.js +3 -9
- package/dist/routes/computer-use/live-flush.d.ts +7 -5
- package/dist/routes/computer-use/live-flush.js +19 -27
- package/dist/routes/computer-use/{run-lanes.js → live-phase.js} +14 -13
- package/dist/routes/computer-use/local-tree-pack.d.ts +3 -3
- package/dist/routes/computer-use/local-tree-pack.js +4 -5
- package/dist/routes/computer-use/local-vm.d.ts +11 -8
- package/dist/routes/computer-use/local-vm.js +39 -66
- package/dist/routes/computer-use/participant-desktop.d.ts +8 -23
- package/dist/routes/computer-use/participant-desktop.js +5 -25
- package/dist/routes/computer-use/{lanes.d.ts → participant-execution.d.ts} +10 -10
- package/dist/routes/computer-use/{lanes.js → participant-execution.js} +35 -22
- package/dist/routes/computer-use/participant-facts.d.ts +7 -1
- package/dist/routes/computer-use/participant-facts.js +12 -1
- package/dist/routes/computer-use/participant-model.d.ts +19 -11
- package/dist/routes/computer-use/participant-model.js +58 -33
- package/dist/routes/computer-use/participant-prompt.d.ts +3 -3
- package/dist/routes/computer-use/participant-prompt.js +4 -4
- package/dist/routes/computer-use/participant-runs.d.ts +6 -6
- package/dist/routes/computer-use/participant-runs.js +8 -8
- package/dist/routes/computer-use/plan.d.ts +21 -29
- package/dist/routes/computer-use/plan.js +59 -65
- package/dist/routes/computer-use/preflight.d.ts +6 -11
- package/dist/routes/computer-use/preflight.js +26 -18
- package/dist/routes/computer-use/rerun-selection.js +10 -6
- package/dist/routes/computer-use/result.d.ts +1 -1
- package/dist/routes/computer-use/result.js +40 -30
- package/dist/routes/computer-use/route.d.ts +3 -4
- package/dist/routes/computer-use/route.js +21 -19
- package/dist/routes/computer-use/self-report.d.ts +2 -2
- package/dist/routes/computer-use/self-report.js +4 -4
- package/dist/routes/computer-use/setup.d.ts +8 -17
- package/dist/routes/computer-use/setup.js +98 -86
- package/dist/routes/computer-use/single-bundle.d.ts +8 -11
- package/dist/routes/computer-use/single-bundle.js +20 -25
- package/dist/routes/computer-use/subject-projection.d.ts +5 -7
- package/dist/routes/computer-use/subject-projection.js +20 -19
- package/dist/routes/computer-use/types.d.ts +169 -211
- package/dist/routes/computer-use/types.js +13 -6
- package/dist/routes/preview.js +0 -1
- package/dist/routes/scripted/bundle.d.ts +3 -6
- package/dist/routes/scripted/bundle.js +11 -16
- package/dist/routes/scripted/plan.d.ts +5 -7
- package/dist/routes/scripted/plan.js +6 -4
- package/dist/routes/scripted/result.d.ts +4 -1
- package/dist/routes/scripted/result.js +10 -6
- package/dist/routes/scripted/route.js +10 -11
- package/dist/routes/scripted/scenario.d.ts +1 -1
- package/dist/routes/scripted/scenario.js +1 -1
- package/dist/routes/scripted/setup.d.ts +3 -2
- package/dist/routes/scripted/setup.js +22 -21
- package/dist/routes/scripted/subject.d.ts +8 -3
- package/dist/routes/scripted/subject.js +11 -6
- package/dist/routes/scripted/surface-records.js +1 -1
- package/dist/routes/scripted/surface-sessions.d.ts +2 -2
- package/dist/routes/scripted/surface-sessions.js +4 -4
- package/dist/routes/scripted/types.d.ts +19 -36
- package/dist/routes/scripted/types.js +1 -2
- package/dist/routes/shared-world/{seat-records.js → bundle-records.js} +8 -8
- package/dist/routes/shared-world/bundle.d.ts +2 -2
- package/dist/routes/shared-world/bundle.js +22 -26
- package/dist/routes/shared-world/checkpoints.d.ts +4 -4
- package/dist/routes/shared-world/checkpoints.js +4 -4
- package/dist/routes/shared-world/comms.d.ts +5 -4
- package/dist/routes/shared-world/comms.js +28 -41
- package/dist/routes/shared-world/external-public.d.ts +5 -5
- package/dist/routes/shared-world/external-public.js +19 -20
- package/dist/routes/shared-world/handoff.d.ts +4 -4
- package/dist/routes/shared-world/handoff.js +50 -50
- package/dist/routes/shared-world/lobby-code.d.ts +5 -5
- package/dist/routes/shared-world/lobby-code.js +13 -13
- package/dist/routes/shared-world/{seats.d.ts → participant-specs.d.ts} +8 -6
- package/dist/routes/shared-world/{seats.js → participant-specs.js} +46 -51
- package/dist/routes/shared-world/plan.d.ts +2 -6
- package/dist/routes/shared-world/plan.js +1 -2
- package/dist/routes/shared-world/provenance.d.ts +4 -4
- package/dist/routes/shared-world/provenance.js +4 -4
- package/dist/routes/shared-world/provisioned.d.ts +3 -2
- package/dist/routes/shared-world/provisioned.js +48 -41
- package/dist/routes/shared-world/result.js +31 -19
- package/dist/routes/shared-world/route.js +37 -41
- package/dist/routes/shared-world/setup.d.ts +5 -4
- package/dist/routes/shared-world/setup.js +12 -14
- package/dist/routes/shared-world/types.d.ts +53 -126
- package/dist/routes/shared-world/types.js +2 -2
- package/dist/routes/terminal/adapter.d.ts +8 -8
- package/dist/routes/terminal/adapter.js +28 -125
- package/dist/routes/terminal/bundle.d.ts +7 -12
- package/dist/routes/terminal/bundle.js +24 -34
- package/dist/routes/terminal/credentials.d.ts +2 -2
- package/dist/routes/terminal/credentials.js +16 -16
- package/dist/routes/terminal/dry-run.d.ts +1 -1
- package/dist/routes/terminal/dry-run.js +9 -11
- package/dist/routes/terminal/encoding.d.ts +1 -1
- package/dist/routes/terminal/encoding.js +2 -2
- package/dist/routes/terminal/ledger.d.ts +6 -6
- package/dist/routes/terminal/ledger.js +9 -9
- package/dist/routes/terminal/live-finish.d.ts +1 -2
- package/dist/routes/terminal/live-finish.js +21 -20
- package/dist/routes/terminal/live-sandbox.d.ts +4 -2
- package/dist/routes/terminal/live-sandbox.js +25 -21
- package/dist/routes/terminal/participant-text.d.ts +23 -0
- package/dist/routes/terminal/participant-text.js +165 -0
- package/dist/routes/terminal/plan.d.ts +2 -6
- package/dist/routes/terminal/plan.js +13 -9
- package/dist/routes/terminal/recorder.d.ts +6 -1
- package/dist/routes/terminal/recorder.js +12 -4
- package/dist/routes/terminal/result.js +4 -4
- package/dist/routes/terminal/route.js +26 -26
- package/dist/routes/terminal/runtime.d.ts +3 -2
- package/dist/routes/terminal/runtime.js +3 -3
- package/dist/routes/terminal/sandbox.d.ts +5 -3
- package/dist/routes/terminal/sandbox.js +13 -16
- package/dist/routes/terminal/session.js +16 -14
- package/dist/routes/terminal/token-usage.js +5 -5
- package/dist/routes/terminal/trace.d.ts +5 -8
- package/dist/routes/terminal/trace.js +9 -64
- package/dist/routes/terminal/types.d.ts +85 -93
- package/dist/routes/terminal/types.js +9 -4
- package/dist/run/active-runs.d.ts +13 -0
- package/dist/run/active-runs.js +12 -0
- package/dist/run/bundle-shape.d.ts +2 -1
- package/dist/run/bundle-shape.js +4 -4
- package/dist/run/bundle.d.ts +63 -56
- package/dist/run/bundle.js +9 -8
- package/dist/run/cost-summary.js +3 -2
- package/dist/run/costs.d.ts +6 -6
- package/dist/run/costs.js +10 -10
- package/dist/run/detail.d.ts +5 -5
- package/dist/run/detail.js +6 -6
- package/dist/run/dry-run.js +5 -12
- package/dist/run/{study-files.d.ts → evidence-files.d.ts} +4 -4
- package/dist/run/{study-files.js → evidence-files.js} +5 -5
- package/dist/run/feedback-shape.js +1 -1
- package/dist/run/judge.d.ts +16 -4
- package/dist/run/judge.js +24 -7
- package/dist/run/locate.d.ts +2 -0
- package/dist/run/locate.js +3 -1
- package/dist/run/outcomes.d.ts +3 -3
- package/dist/run/outcomes.js +3 -3
- package/dist/run/participant-records.d.ts +2 -2
- package/dist/run/participant-records.js +2 -2
- package/dist/run/paths.js +1 -1
- package/dist/run/pricing.d.ts +19 -9
- package/dist/run/pricing.js +30 -18
- package/dist/run/projection.d.ts +13 -13
- package/dist/run/projection.js +8 -8
- package/dist/run/reclaim.d.ts +7 -1
- package/dist/run/reclaim.js +24 -4
- package/dist/run/results.d.ts +1 -1
- package/dist/run/run-index.d.ts +1 -1
- package/dist/run/run-index.js +11 -11
- package/dist/run/run.d.ts +4 -2
- package/dist/run/run.js +9 -5
- package/dist/run/sandbox-receipts.d.ts +4 -4
- package/dist/run/sandbox-receipts.js +4 -4
- package/dist/run/shared-world-evidence.d.ts +47 -47
- package/dist/run/shared-world-shape.d.ts +3 -3
- package/dist/run/shared-world-shape.js +11 -11
- package/dist/run/stats.d.ts +5 -5
- package/dist/run/stats.js +8 -8
- package/dist/run/status.d.ts +16 -6
- package/dist/run/status.js +31 -8
- package/dist/run/streams.d.ts +26 -19
- package/dist/run/terminal-contract.d.ts +5 -5
- package/dist/run/terminal-contract.js +4 -4
- package/dist/run/transient-comms-secrets.d.ts +5 -0
- package/dist/run/transient-comms-secrets.js +12 -0
- package/dist/run-lab.d.ts +36 -34
- package/dist/run-lab.js +41 -37
- package/dist/subject/desktop-cli.d.ts +1 -1
- package/dist/subject/desktop-cli.js +1 -1
- package/dist/subject/local-tree-archive.d.ts +1 -1
- package/dist/subject/local-tree-archive.js +4 -4
- package/dist/subject/local-tree.d.ts +2 -2
- package/dist/subject/local-tree.js +1 -1
- package/dist/subject/node-bootstrap.d.ts +1 -1
- package/dist/subject/node-bootstrap.js +4 -4
- package/dist/subject/runtime.js +5 -5
- package/dist/subject/serve.js +1 -1
- package/dist/subject/steps.d.ts +4 -4
- package/dist/subject/steps.js +5 -5
- package/dist/substrates/desktop-session.d.ts +2 -0
- package/dist/substrates/e2b/cdp-probe.d.ts +2 -2
- package/dist/substrates/e2b/cdp-probe.js +1 -1
- package/dist/substrates/e2b/desktop-browser.d.ts +3 -3
- package/dist/substrates/e2b/desktop-browser.js +4 -4
- package/dist/substrates/e2b/desktop-cdp.d.ts +7 -7
- package/dist/substrates/e2b/desktop-cdp.js +4 -4
- package/dist/substrates/e2b/desktop-geometry.d.ts +4 -4
- package/dist/substrates/e2b/desktop-geometry.js +3 -3
- package/dist/substrates/e2b/desktop-media.js +2 -2
- package/dist/substrates/e2b/sandbox.d.ts +2 -0
- package/dist/substrates/e2b/sandbox.js +22 -8
- package/dist/substrates/e2b/sdk.d.ts +12 -1
- package/dist/substrates/e2b/sdk.js +30 -9
- package/dist/substrates/local/runtime-host.d.ts +2 -0
- package/dist/substrates/local/runtime-host.js +6 -0
- package/dist/tui/actions.d.ts +7 -5
- package/dist/tui/actions.js +18 -9
- package/dist/tui-app.js +42 -42
- package/dist/verify/actor.d.ts +10 -10
- package/dist/verify/actor.js +15 -15
- package/dist/verify/artifacts.d.ts +1 -1
- package/dist/verify/artifacts.js +3 -3
- package/dist/verify/costs.d.ts +2 -2
- package/dist/verify/costs.js +2 -2
- package/dist/verify/liveness.d.ts +1 -1
- package/dist/verify/liveness.js +4 -1
- package/dist/verify/rerun.d.ts +1 -1
- package/dist/verify/rerun.js +1 -1
- package/dist/verify/shared-world.js +2 -2
- package/dist/verify/verify.js +6 -6
- package/docs/README.md +1 -1
- package/docs/architecture/actor-contract.md +60 -22
- package/docs/architecture/desktop-sessions.md +9 -9
- package/docs/architecture/external-public-shared-world.md +5 -0
- package/docs/architecture/observer.md +4 -4
- package/docs/architecture/restricted-codex-analysis.md +40 -4
- package/docs/architecture/state-driven-executor.md +4 -5
- package/docs/architecture/task-protocol-support.md +3 -5
- package/docs/architecture/{terminal-product-lane.md → terminal-product-route.md} +24 -16
- package/docs/contracts/run-bundle.md +10 -8
- package/docs/contracts/schemas.md +109 -53
- package/docs/contracts/study-analysis.md +24 -0
- package/docs/decisions/0004-participant-desktops-stay-in-the-route.md +2 -1
- package/docs/product/automatic-analysis.md +1 -0
- package/docs/ramp/README.md +2 -1
- package/package.json +4 -4
- package/skills/humanish/SKILL.md +3 -2
- package/skills/humanish/agents/openai.yaml +1 -1
- package/dist/deprecated.d.ts +0 -90
- package/dist/deprecated.js +0 -106
- package/dist/lab/bag-overrides.d.ts +0 -18
- package/dist/lab/bag-overrides.js +0 -121
- package/dist/routes/computer-use/legacy-lane-spec.d.ts +0 -62
- package/dist/routes/computer-use/legacy-lane-spec.js +0 -39
- /package/dist/routes/computer-use/{fanout-lanes.d.ts → fanout-records.d.ts} +0 -0
- /package/dist/routes/computer-use/{run-lanes.d.ts → live-phase.d.ts} +0 -0
- /package/dist/routes/shared-world/{seat-records.d.ts → bundle-records.d.ts} +0 -0
package/dist/run/bundle.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ export declare const PUBLIC_TARGET_CWD = "[target-cwd]";
|
|
|
14
14
|
* #8). Core never reads its `data` and knows none of the adopter's nouns — the `namespace` (e.g.
|
|
15
15
|
* `"acme-pixelforge"`) scopes the whole record so core schemas stay product-agnostic and a future
|
|
16
16
|
* inert-field audit does not misfire on a noun core never owned. The adopter's real scorecard
|
|
17
|
-
* (component weights, product rubric) lives in
|
|
18
|
-
* status/score/summary; everything product-specific rides under `data`.
|
|
19
|
-
* product scorer
|
|
17
|
+
* (component weights, product rubric) lives in the adopter's repo and is summarized into the generic
|
|
18
|
+
* status/score/summary; everything product-specific rides under `data`. Core ships no built-in
|
|
19
|
+
* product scorer; this is the seam the adopter's scorer plugs into without forking core.
|
|
20
20
|
*/
|
|
21
21
|
export interface RunAdapterScore {
|
|
22
22
|
schema: "humanish.adapter-score.v1";
|
|
@@ -56,14 +56,14 @@ export interface RunFeedbackCandidate {
|
|
|
56
56
|
proposed_next_state: "watch" | "adapter-hardening" | "target-app-setup" | "actor-auth" | "setup-quality-review" | "study-quality-review";
|
|
57
57
|
acceptance_proof: string[];
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* Optional, adapter-namespaced product-noun block (the layer-6 extension seam, issue #154
|
|
60
60
|
* acceptance #8 + the "record product-specific concepts as NON-core nouns" list). A thin adapter
|
|
61
61
|
* records product-specific concepts — public CLI/product command observed, hosted product
|
|
62
62
|
* success-or-blocker, feedback id/draft observed, media/job/asset ids, explicit
|
|
63
|
-
* no-media/no-provider-spend proof, defection/friction risk
|
|
63
|
+
* no-media/no-provider-spend proof, defection/friction risk, without making any of them core
|
|
64
64
|
* primitives. They ride under a single namespaced field so core's feedback enums
|
|
65
65
|
* (`evidence.kind`, `proposed_next_state`) stay product-agnostic and a future inert-field audit
|
|
66
|
-
* never misfires on a noun core never owned. Core validates only the
|
|
66
|
+
* never misfires on a noun core never owned. Core validates only the shape (a non-empty
|
|
67
67
|
* `namespace` + a `data` record); the keys inside `data` are the adapter's, never core's.
|
|
68
68
|
*/
|
|
69
69
|
adapter?: {
|
|
@@ -89,19 +89,19 @@ export interface RunAdapterArtifact {
|
|
|
89
89
|
/**
|
|
90
90
|
* Provenance for a CONFIG-DECLARED adopter scorer (#316): the repo-relative entry path and a digest
|
|
91
91
|
* of its ENTRY-MODULE bytes, recorded so a `review.scorer.ref`/`--scorer` run honestly states which
|
|
92
|
-
* out-of-tree judgment it attached. Core-computed (path + digest), never adopter-supplied. A
|
|
93
|
-
* caller (hooks passed directly through RunLabOptions) has implicit provenance
|
|
94
|
-
* provenance
|
|
92
|
+
* out-of-tree judgment it attached. Core-computed (path + digest), never adopter-supplied. A library
|
|
93
|
+
* caller (hooks passed directly through RunLabOptions) has implicit provenance, because its code is its
|
|
94
|
+
* provenance, so this block is absent there and every pre-#316 bundle stays byte-stable + verifiable.
|
|
95
95
|
*
|
|
96
|
-
* The digest pins the entry file's
|
|
96
|
+
* The digest pins the entry file's identity only; modules it loads are outside it: a `export { score } from
|
|
97
97
|
* "../outside.mjs"` re-export is not captured, and `import()` re-opens the path (a benign same-author
|
|
98
|
-
* TOCTOU). Treat it as evidence-not-gate, and do
|
|
98
|
+
* TOCTOU). Treat it as evidence-not-gate, and do not extend the loader to less-trusted config.
|
|
99
99
|
*/
|
|
100
100
|
export interface RunScorerProvenance {
|
|
101
101
|
schema: "humanish.scorer-provenance.v1";
|
|
102
102
|
/** Repo-relative entry path (e.g. "scorers/example.mjs"), clamped inside the target cwd. */
|
|
103
103
|
ref: string;
|
|
104
|
-
/** digestText over the readContainedRegularFile
|
|
104
|
+
/** digestText over the readContainedRegularFile entry bytes: the entry module only, with no lockfile of the executed graph. */
|
|
105
105
|
digest: string;
|
|
106
106
|
/** Which door declared it: the committed manifest, or the CLI `--scorer` override. */
|
|
107
107
|
source: "manifest" | "cli-flag";
|
|
@@ -135,7 +135,7 @@ export interface RunEvent {
|
|
|
135
135
|
/**
|
|
136
136
|
* One executed (or declared) subject-state seed step. Live records carry execution fields
|
|
137
137
|
* (ok/exitCode/timedOut/durationMs); dry-run "declared, not run" records carry only the
|
|
138
|
-
* declaration (name, phase, command
|
|
138
|
+
* declaration (name, phase, command digest). The command itself never persists; the digest
|
|
139
139
|
* pins "same recipe" across bundles while the lab YAML in the consumer's repo stays the
|
|
140
140
|
* plaintext source of truth (publish-safe by construction).
|
|
141
141
|
*/
|
|
@@ -151,8 +151,8 @@ export interface RunSubjectStateStepRecord {
|
|
|
151
151
|
durationMs?: number;
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
|
-
* Structured subject provenance (invariant 5): what the subject
|
|
155
|
-
* or a local-tree archive digest)
|
|
154
|
+
* Structured subject provenance (invariant 5): what the subject was, as a code pin (repo/commit,
|
|
155
|
+
* or a local-tree archive digest) and state story. Optional additive field on
|
|
156
156
|
* humanish.run-bundle.v1; absent on bundles from backends that have not adopted it (and on all
|
|
157
157
|
* pre-existing bundles).
|
|
158
158
|
*/
|
|
@@ -165,7 +165,7 @@ export interface RunSubjectProvenance {
|
|
|
165
165
|
commit?: string;
|
|
166
166
|
/**
|
|
167
167
|
* Local-tree-route only (additive): 64 lowercase-hex sha256 over the sorted packed-entries
|
|
168
|
-
* list (docs/contracts/schemas.md). This is the provenance
|
|
168
|
+
* list (docs/contracts/schemas.md). This is the provenance pin for the local-tree route: a
|
|
169
169
|
* dirty working tree cannot be commit-pinned, so the archive content digest stands in for it.
|
|
170
170
|
*/
|
|
171
171
|
archiveSha256?: string;
|
|
@@ -174,11 +174,11 @@ export interface RunSubjectProvenance {
|
|
|
174
174
|
* at pack time. Absent when the packed root was not a git work tree at all.
|
|
175
175
|
*/
|
|
176
176
|
dirty?: boolean;
|
|
177
|
-
/** Declared env
|
|
177
|
+
/** Declared env names provisioned for the subject; names only, never values. */
|
|
178
178
|
envNames?: string[];
|
|
179
179
|
state: {
|
|
180
180
|
/**
|
|
181
|
-
* seeded: live run, steps declared,
|
|
181
|
+
* seeded: live run, steps declared, all ran ok, no external state declared.
|
|
182
182
|
* unpinned: external state declared (seed records, if any, still attached — migrating
|
|
183
183
|
* an external DB is still unpinned overall).
|
|
184
184
|
* declared-not-run: steps declared but not (all) executed ok — dry-run contract bundles
|
|
@@ -187,7 +187,7 @@ export interface RunSubjectProvenance {
|
|
|
187
187
|
* "absence declared" marker invariant 5 requires.
|
|
188
188
|
* external-public: (#164 phase 2) an operator-DECLARED, operator-OWNED public deployment used
|
|
189
189
|
* directly as the shared plane — humanish neither provisioned nor seeded it (no getHost, no
|
|
190
|
-
* clone, no in-sandbox filesystem).
|
|
190
|
+
* clone, no in-sandbox filesystem). It is not "seeded" (nothing was seeded) and not "unpinned" (this is
|
|
191
191
|
* an owned target, not an uncontrolled external DB). The honest marker for the external-public
|
|
192
192
|
* plane class; verify asserts it in place of the getHost seeded gate.
|
|
193
193
|
*/
|
|
@@ -197,10 +197,10 @@ export interface RunSubjectProvenance {
|
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
/**
|
|
200
|
-
* How well a run attributed
|
|
200
|
+
* How well a run attributed interaction between actors: a separate honesty axis, orthogonal to the
|
|
201
201
|
* persona-sampling evidence classes (which answer "how representative is the actor?"). Absent ==
|
|
202
|
-
* `isolated` (every existing bundle byte-stable). `shared-world` means N
|
|
203
|
-
* plane and their per-
|
|
202
|
+
* `isolated` (every existing bundle byte-stable). `shared-world` means N participants drove one
|
|
203
|
+
* mutable plane and their per-participant attribution is weaker (its ceiling is pinned in `sharedWorld.attributionLimits`).
|
|
204
204
|
*/
|
|
205
205
|
type RunAttributionClass = "isolated" | "shared-world";
|
|
206
206
|
export interface RunBundle {
|
|
@@ -259,15 +259,15 @@ export interface RunBundle {
|
|
|
259
259
|
* everywhere else. */
|
|
260
260
|
subject?: RunSubjectProvenance;
|
|
261
261
|
/**
|
|
262
|
-
* The custom E2B desktop
|
|
263
|
-
* `execution.desktop.template
|
|
262
|
+
* The custom E2B desktop template (image) the run's sandbox(es) actually launched on, from
|
|
263
|
+
* `execution.desktop.template`, so the evidence shows which image ran (a subject needing
|
|
264
264
|
* runtimes the stock `desktop` image lacks runs on an adopter's template). Optional + additive:
|
|
265
265
|
* present only when a template was configured (absent == the stock `desktop` template, every
|
|
266
266
|
* pre-existing bundle byte-stable). A template name is public-safe (not a secret).
|
|
267
267
|
*/
|
|
268
268
|
desktopTemplate?: string;
|
|
269
269
|
/**
|
|
270
|
-
* Browser family requested for hosted desktop
|
|
270
|
+
* Browser family requested for hosted desktop participants and the in-sandbox command that opened
|
|
271
271
|
* it, when explicitly configured. Optional + additive; absent means the historical default opener
|
|
272
272
|
* path was used or the backend does not create a headed desktop.
|
|
273
273
|
*/
|
|
@@ -291,8 +291,8 @@ export interface RunBundle {
|
|
|
291
291
|
};
|
|
292
292
|
};
|
|
293
293
|
/**
|
|
294
|
-
* Optional lineage for a run that intentionally re-executes selected
|
|
295
|
-
* multi-
|
|
294
|
+
* Optional lineage for a run that intentionally re-executes selected participants from a
|
|
295
|
+
* prior multi-participant run. This keeps retry-like workflows explicit: the new run is linked to the old
|
|
296
296
|
* evidence, but it never mutates or silently "fixes" the original verdict.
|
|
297
297
|
*/
|
|
298
298
|
rerun?: RunRerunLineage;
|
|
@@ -307,20 +307,20 @@ export interface RunBundle {
|
|
|
307
307
|
*/
|
|
308
308
|
sharedWorld?: SharedWorldEvidence;
|
|
309
309
|
/**
|
|
310
|
-
*
|
|
311
|
-
* #8). A thin adapter's `score` hook returns a `RunAdapterScore`; the
|
|
312
|
-
*
|
|
310
|
+
* Optional, adapter-namespaced product score (the layer-6 extension seam, issue #154 acceptance
|
|
311
|
+
* #8). A thin adapter's `score` hook returns a `RunAdapterScore`; the route attaches it here
|
|
312
|
+
* without core knowing any product noun (the score is namespaced + its breakdown lives in `data`).
|
|
313
313
|
* The default mission-based verdict (`review`) is unchanged when no scorer hook is given.
|
|
314
314
|
*/
|
|
315
315
|
adapterScore?: RunAdapterScore;
|
|
316
316
|
/**
|
|
317
|
-
*
|
|
317
|
+
* Optional provenance for a config-declared scorer (#316). Present only when the scorer was loaded
|
|
318
318
|
* from `review.scorer.ref` / `--scorer`; absent for library callers and every pre-#316 bundle
|
|
319
319
|
* (tolerated-absent in isRunBundle so those still verify). Evidence, not a gate.
|
|
320
320
|
*/
|
|
321
321
|
scorerProvenance?: RunScorerProvenance;
|
|
322
322
|
/**
|
|
323
|
-
*
|
|
323
|
+
* Optional, adapter-namespaced product/state proof artifacts. Core validates
|
|
324
324
|
* shape and local relative artifact references, then verifies the referenced
|
|
325
325
|
* files exist. The adapter owns the payload schema under `namespace`.
|
|
326
326
|
*/
|
|
@@ -339,31 +339,33 @@ export interface RunBundle {
|
|
|
339
339
|
*/
|
|
340
340
|
lab?: RunLabProvenance;
|
|
341
341
|
/**
|
|
342
|
-
*
|
|
343
|
-
*
|
|
342
|
+
* Optional, additive run-level cost estimate (humanish.run-cost-summary.v1): the sum of every
|
|
343
|
+
* participant's model-token estimate plus the E2B desktop-minute estimate, carrying the same
|
|
344
344
|
* null-discipline the terminal cost ledger already ships. Absent on pre-existing bundles and
|
|
345
|
-
* dry runs; a live run that spends nothing records an explicit zero with no lines. Every dollar figure here is an
|
|
345
|
+
* dry runs; a live run that spends nothing records an explicit zero with no lines. Every dollar figure here is an estimate,
|
|
346
346
|
* never an authoritative charge; verify asserts its LABELING/provenance, never its magnitude.
|
|
347
347
|
*/
|
|
348
348
|
cost?: RunCostSummary;
|
|
349
349
|
}
|
|
350
350
|
/**
|
|
351
|
-
* One contributing cost line of a RunCostSummary. A line is
|
|
352
|
-
* (records that we
|
|
353
|
-
* `reason` and contributes
|
|
351
|
+
* One contributing cost line of a RunCostSummary. A line is present even when it cannot be priced
|
|
352
|
+
* (it records that we tried and could not): an unpriceable line carries estimatedCostUsd: null + a
|
|
353
|
+
* `reason` and contributes nothing to the summary total (invariant 5). `estimatedCostUsd` is never
|
|
354
354
|
* coerced to 0.
|
|
355
355
|
*/
|
|
356
356
|
export interface RunCostLine {
|
|
357
357
|
kind: "model-tokens" | "desktop-minutes";
|
|
358
358
|
laneId?: string;
|
|
359
359
|
modelId?: string;
|
|
360
|
-
/** null =
|
|
360
|
+
/** null = not measured / no rate; never coerced to 0. */
|
|
361
361
|
estimatedCostUsd: number | null;
|
|
362
362
|
reason?: "no_rate_for_model" | "no_rate_for_desktop" | "no_token_usage" | "no_duration" | "closing_usage_unreported" | "interaction_usage_unreported" | "no_desktop_resources" | "desktop_lifetime_incomplete" | "account_billing_unknown";
|
|
363
363
|
/** Pricing provenance date; non-null iff estimatedCostUsd is non-null. */
|
|
364
364
|
ratesAsOf: string | null;
|
|
365
365
|
source?: string;
|
|
366
366
|
placeholder?: boolean;
|
|
367
|
+
/** A model-tokens line priced from runtime-turn totals at the base tier (ActorEstimatedCost). */
|
|
368
|
+
basis?: "aggregated_turns_base_rate";
|
|
367
369
|
/** Optional allocation evidence on newer desktop lines; older aggregate lines remain valid. */
|
|
368
370
|
desktop?: {
|
|
369
371
|
minutes: number | null;
|
|
@@ -378,15 +380,15 @@ export interface RunCostLine {
|
|
|
378
380
|
};
|
|
379
381
|
}
|
|
380
382
|
/**
|
|
381
|
-
* The run-level cost
|
|
382
|
-
* `breakdown` lines; it is null iff
|
|
383
|
-
* false when any applicable line is null (the total is then a
|
|
383
|
+
* The run-level cost estimate. `estimatedTotalUsd` is the rounded sum of only the non-null
|
|
384
|
+
* `breakdown` lines; it is null iff every line is null (never 0-coerced). `fullyEstimated` is
|
|
385
|
+
* false when any applicable line is null (the total is then a lower bound). Every non-null dollar
|
|
384
386
|
* figure carries `ratesAsOf`; `placeholder` is true when any contributing rate is a stand-in.
|
|
385
387
|
*/
|
|
386
388
|
export interface RunCostSummary {
|
|
387
389
|
schema: "humanish.run-cost-summary.v1";
|
|
388
390
|
currency: "usd";
|
|
389
|
-
/** Sum of the
|
|
391
|
+
/** Sum of the known (non-null) lines; null iff every applicable line is null; 0 with no lines
|
|
390
392
|
* for a spend-free run. */
|
|
391
393
|
estimatedTotalUsd: number | null;
|
|
392
394
|
/** Oldest asOf across contributing rates; null when nothing was priced. */
|
|
@@ -436,14 +438,14 @@ export interface RunRerunLineage {
|
|
|
436
438
|
}>;
|
|
437
439
|
}
|
|
438
440
|
/**
|
|
439
|
-
* What happened to the
|
|
441
|
+
* What happened to the participants in a study, with the denominator attached.
|
|
440
442
|
*
|
|
441
443
|
* A stakeholder watching through the glass forms conclusions from vivid moments — that is the
|
|
442
444
|
* classic failure of the viewing room, and it is why researchers synthesize rather than letting the
|
|
443
445
|
* room decide. So anything shown to a stakeholder carries its count, or it becomes a machine for
|
|
444
446
|
* manufacturing certainty from n=1 (docs/principles/three-roles.md).
|
|
445
447
|
*
|
|
446
|
-
* These are
|
|
448
|
+
* These are outcomes, not scores. `abandoned` is the most valuable thing a usability study
|
|
447
449
|
* produces, and `harnessFailed` is the only member that says the instrument, rather than the
|
|
448
450
|
* product, is what went wrong.
|
|
449
451
|
*/
|
|
@@ -463,7 +465,7 @@ export interface ParticipantOutcomes {
|
|
|
463
465
|
/**
|
|
464
466
|
* Participants who reported friction or a defect on the way, whatever their outcome.
|
|
465
467
|
*
|
|
466
|
-
* This is
|
|
468
|
+
* This is not a failure count, and it overlaps the others on purpose: someone can reach the goal
|
|
467
469
|
* and still tell you the road there was broken. A live two-persona run made the case: both
|
|
468
470
|
* participants signed in, so "2/2 reached the goal" was true, and the keyboard-first one also
|
|
469
471
|
* reported that the signature step could not be completed without a mouse. Reporting only the
|
|
@@ -491,18 +493,18 @@ export interface ReviewSummary {
|
|
|
491
493
|
* and at least one session produced a funnel. Absent means no protocol was measured, never that
|
|
492
494
|
* everyone finished.
|
|
493
495
|
*/
|
|
494
|
-
tasks?:
|
|
496
|
+
tasks?: RunTaskFunnel;
|
|
495
497
|
}
|
|
496
498
|
/**
|
|
497
499
|
* The study's task funnel: for each declared task, how many participants completed it, out of how
|
|
498
500
|
* many sessions produced a funnel. This is "where did people get stuck" as data — the number a
|
|
499
501
|
* researcher reads first — where the per-participant funnels answer it one journey at a time.
|
|
500
502
|
*
|
|
501
|
-
* Aggregated by task id in declaration order. Every
|
|
503
|
+
* Aggregated by task id in declaration order. Every participant in a run shares the actor's protocol, so
|
|
502
504
|
* ids line up across participants; a funnel missing a task id (a future mixed-protocol route)
|
|
503
505
|
* simply does not count toward that task's denominator.
|
|
504
506
|
*/
|
|
505
|
-
export interface
|
|
507
|
+
export interface RunTaskFunnel {
|
|
506
508
|
/** Sessions that produced a funnel — the denominator for every count below. */
|
|
507
509
|
sessions: number;
|
|
508
510
|
tasks: Array<{
|
|
@@ -519,20 +521,25 @@ export interface StudyTaskFunnel {
|
|
|
519
521
|
unmeasured: number;
|
|
520
522
|
}>;
|
|
521
523
|
}
|
|
524
|
+
/** The run a bundle belongs to: the Run startRun returned, or a test's stand-in. */
|
|
525
|
+
export interface BundleRun {
|
|
526
|
+
readonly runId: string;
|
|
527
|
+
readonly mode: RunBundle["mode"];
|
|
528
|
+
readonly createdAt: string;
|
|
529
|
+
/** The manifest the run came from (#455), as the plan carried it to startRun. */
|
|
530
|
+
readonly lab?: RunLabProvenance | undefined;
|
|
531
|
+
}
|
|
522
532
|
/**
|
|
523
|
-
* The fields every run bundle starts with, in the saved order.
|
|
524
|
-
*
|
|
533
|
+
* The fields every run bundle starts with, in the saved order. The run supplies its id, mode,
|
|
534
|
+
* start time and lab; the route passes the participant count and source. The public target cwd
|
|
535
|
+
* and the run's own artifact root are the defaults.
|
|
525
536
|
*/
|
|
526
|
-
export declare function bundleHead(args: {
|
|
537
|
+
export declare function bundleHead(run: BundleRun, args: {
|
|
527
538
|
/** Publication restrictions (real communications), saved right after the schema. */
|
|
528
539
|
publication?: RunBundle["publication"];
|
|
529
|
-
runId: string;
|
|
530
|
-
mode: RunBundle["mode"];
|
|
531
540
|
participants: number;
|
|
532
|
-
createdAt: string;
|
|
533
541
|
cwd?: string;
|
|
534
542
|
artifactRoot?: string;
|
|
535
|
-
lab?: RunLabProvenance;
|
|
536
543
|
source: RunBundle["source"];
|
|
537
544
|
}): Pick<RunBundle, "schema" | "publication" | "runId" | "mode" | "simCount" | "createdAt" | "cwd" | "artifactRoot" | "lab" | "source">;
|
|
538
545
|
/** The files every run directory holds, as the bundle names them. */
|
package/dist/run/bundle.js
CHANGED
|
@@ -6,20 +6,21 @@ export const RUN_BUNDLE_FILE = "run.json";
|
|
|
6
6
|
export const REVIEW_SCHEMA = "humanish.review.v1";
|
|
7
7
|
export const PUBLIC_TARGET_CWD = "[target-cwd]";
|
|
8
8
|
/**
|
|
9
|
-
* The fields every run bundle starts with, in the saved order.
|
|
10
|
-
*
|
|
9
|
+
* The fields every run bundle starts with, in the saved order. The run supplies its id, mode,
|
|
10
|
+
* start time and lab; the route passes the participant count and source. The public target cwd
|
|
11
|
+
* and the run's own artifact root are the defaults.
|
|
11
12
|
*/
|
|
12
|
-
export function bundleHead(args) {
|
|
13
|
+
export function bundleHead(run, args) {
|
|
13
14
|
return {
|
|
14
15
|
schema: RUN_BUNDLE_SCHEMA,
|
|
15
16
|
...(args.publication === undefined ? {} : { publication: args.publication }),
|
|
16
|
-
runId:
|
|
17
|
-
mode:
|
|
17
|
+
runId: run.runId,
|
|
18
|
+
mode: run.mode,
|
|
18
19
|
simCount: args.participants,
|
|
19
|
-
createdAt:
|
|
20
|
+
createdAt: run.createdAt,
|
|
20
21
|
cwd: args.cwd ?? PUBLIC_TARGET_CWD,
|
|
21
|
-
artifactRoot: args.artifactRoot ?? path.join(".humanish", "runs",
|
|
22
|
-
...(
|
|
22
|
+
artifactRoot: args.artifactRoot ?? path.join(".humanish", "runs", run.runId),
|
|
23
|
+
...(run.lab === undefined ? {} : { lab: run.lab }),
|
|
23
24
|
source: args.source,
|
|
24
25
|
};
|
|
25
26
|
}
|
package/dist/run/cost-summary.js
CHANGED
|
@@ -66,6 +66,7 @@ function modelCostLines(participants) {
|
|
|
66
66
|
ratesAsOf: est.ratesAsOf,
|
|
67
67
|
...(est.source === undefined ? {} : { source: est.source }),
|
|
68
68
|
...(est.placeholder ? { placeholder: true } : {}),
|
|
69
|
+
...(est.basis === undefined ? {} : { basis: est.basis }),
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
72
|
return breakdown;
|
|
@@ -123,8 +124,8 @@ function costTotals(breakdown) {
|
|
|
123
124
|
let anyKnown = false;
|
|
124
125
|
let anyNull = false;
|
|
125
126
|
let placeholder = false;
|
|
126
|
-
// Aggregate freshness is
|
|
127
|
-
// contributing rate, so ratesAsOf takes the
|
|
127
|
+
// Aggregate freshness is conservative: an aggregate estimate is only as current as its oldest
|
|
128
|
+
// contributing rate, so ratesAsOf takes the minimum (oldest) asOf; the maximum would overclaim freshness the
|
|
128
129
|
// moment operator-edited rates in src/run/pricing.ts diverge. Each breakdown line keeps its own true asOf.
|
|
129
130
|
let minRatesAsOf = null;
|
|
130
131
|
for (const line of breakdown) {
|
package/dist/run/costs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RunIndexEntry } from "./run-index.js";
|
|
2
2
|
/** Additive accounting for retained attempts. Null means no estimate, never an invented zero. */
|
|
3
|
-
export interface
|
|
3
|
+
export interface CostTotals {
|
|
4
4
|
estimatedTotalUsd: number | null;
|
|
5
5
|
runEstimatedUsd: number | null;
|
|
6
6
|
analysisEstimatedUsd: number | null;
|
|
@@ -16,12 +16,12 @@ export interface StudyCosts {
|
|
|
16
16
|
/** No retained history, legacy report-only usage, or unreadable/conflicting accounting. */
|
|
17
17
|
analysisHistoryUncertainRuns: number;
|
|
18
18
|
}
|
|
19
|
-
export interface
|
|
19
|
+
export interface CostRow {
|
|
20
20
|
runId: string;
|
|
21
|
-
costs:
|
|
21
|
+
costs: CostTotals;
|
|
22
22
|
warnings: string[];
|
|
23
23
|
}
|
|
24
|
-
export declare function
|
|
25
|
-
export declare function
|
|
24
|
+
export declare function emptyCostTotals(): CostTotals;
|
|
25
|
+
export declare function addCostTotals(into: CostTotals, next: CostTotals): void;
|
|
26
26
|
/** A read-only, bounded accounting pass. Never validates findings, dispatches, repairs or writes. */
|
|
27
|
-
export declare function
|
|
27
|
+
export declare function readCostTotals(cwd: string, entry: RunIndexEntry): Promise<CostRow>;
|
package/dist/run/costs.js
CHANGED
|
@@ -2,11 +2,11 @@ import { round6 } from "./pricing.js";
|
|
|
2
2
|
import { bindExistingRunArtifactPaths } from "./paths.js";
|
|
3
3
|
import { contradictsAccountBilling } from "../verify/costs.js";
|
|
4
4
|
import { EVIDENCE_LIMITS } from "../analysis/evidence.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { readBoundedFile } from "./evidence-files.js";
|
|
6
|
+
import { readAutomaticAnalysisAccounting } from "../analysis/job.js";
|
|
7
|
+
import { readAnalysisAccountingRecords } from "../analysis/store-executions.js";
|
|
8
8
|
import { RUN_BUNDLE_FILE } from "./bundle.js";
|
|
9
|
-
export function
|
|
9
|
+
export function emptyCostTotals() {
|
|
10
10
|
return {
|
|
11
11
|
estimatedTotalUsd: null,
|
|
12
12
|
runEstimatedUsd: null,
|
|
@@ -24,7 +24,7 @@ const isKnownUsd = (value) => typeof value === "number" && Number.isFinite(value
|
|
|
24
24
|
function sumKnown(a, b) {
|
|
25
25
|
return a === null && b === null ? null : round6((a ?? 0) + (b ?? 0));
|
|
26
26
|
}
|
|
27
|
-
export function
|
|
27
|
+
export function addCostTotals(into, next) {
|
|
28
28
|
for (const key of ["estimatedTotalUsd", "runEstimatedUsd", "analysisEstimatedUsd"]) {
|
|
29
29
|
into[key] = sumKnown(into[key], next[key]);
|
|
30
30
|
}
|
|
@@ -41,8 +41,8 @@ export function addStudyCosts(into, next) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
/** A read-only, bounded accounting pass. Never validates findings, dispatches, repairs or writes. */
|
|
44
|
-
export async function
|
|
45
|
-
const costs =
|
|
44
|
+
export async function readCostTotals(cwd, entry) {
|
|
45
|
+
const costs = emptyCostTotals();
|
|
46
46
|
// Run-cost and analysis-history warnings stay apart: only the second kind makes the history
|
|
47
47
|
// uncertain, whatever a run-cost warning is named.
|
|
48
48
|
const runWarnings = [];
|
|
@@ -50,7 +50,7 @@ export async function readStudyCosts(cwd, entry) {
|
|
|
50
50
|
costs.runEstimatedUsd = isKnownUsd(entry.estimatedCostUsd) ? entry.estimatedCostUsd : null;
|
|
51
51
|
try {
|
|
52
52
|
const prepared = await bindExistingRunArtifactPaths(cwd, entry.runId);
|
|
53
|
-
const bytes = await
|
|
53
|
+
const bytes = await readBoundedFile(prepared, RUN_BUNDLE_FILE, EVIDENCE_LIMITS.sourceBytes);
|
|
54
54
|
let bundle = null;
|
|
55
55
|
try {
|
|
56
56
|
bundle = bytes ? JSON.parse(bytes.toString("utf8")) : null;
|
|
@@ -82,8 +82,8 @@ export async function readStudyCosts(cwd, entry) {
|
|
|
82
82
|
runWarnings.push("RUN_COST_COMPLETENESS_UNKNOWN");
|
|
83
83
|
}
|
|
84
84
|
const [history, automatic] = await Promise.all([
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
readAnalysisAccountingRecords(prepared),
|
|
86
|
+
readAutomaticAnalysisAccounting(prepared),
|
|
87
87
|
]);
|
|
88
88
|
analysisWarnings.push(...history.warnings);
|
|
89
89
|
const records = new Map(history.records.map((record) => [record.id, record]));
|
package/dist/run/detail.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ interface RunThought {
|
|
|
9
9
|
at?: string;
|
|
10
10
|
}
|
|
11
11
|
export interface RunParticipant {
|
|
12
|
-
/** Stream id — stable within a run, and what distinguishes
|
|
12
|
+
/** Stream id — stable within a run, and what distinguishes participants of one study. */
|
|
13
13
|
id: string;
|
|
14
|
-
/** What to call them on screen: the
|
|
14
|
+
/** What to call them on screen: the participant's own label, else the persona id. */
|
|
15
15
|
label: string;
|
|
16
16
|
/** The persona id, when the trace recorded one. */
|
|
17
17
|
personaId?: string;
|
|
@@ -21,7 +21,7 @@ export interface RunParticipant {
|
|
|
21
21
|
* name alone does not.
|
|
22
22
|
*/
|
|
23
23
|
traits: string[];
|
|
24
|
-
/** `running`, `passed`, `failed`, `contract_proof_only` — the
|
|
24
|
+
/** `running`, `passed`, `failed`, `contract_proof_only` — the participant's own word for itself. */
|
|
25
25
|
status?: string;
|
|
26
26
|
/** Why the actor stopped, when it has. */
|
|
27
27
|
completionReason?: string;
|
|
@@ -29,7 +29,7 @@ export interface RunParticipant {
|
|
|
29
29
|
turns?: number;
|
|
30
30
|
actions?: number;
|
|
31
31
|
/**
|
|
32
|
-
* Thoughts recorded so far. The mid-run flush carries the trace
|
|
32
|
+
* Thoughts recorded so far. The mid-run flush carries the trace items but not the `counts` block,
|
|
33
33
|
* so a live participant has no turn count to show — but the thoughts can be counted directly, and
|
|
34
34
|
* "8 thoughts" is a true statement about progress rather than an inferred turn number.
|
|
35
35
|
*/
|
|
@@ -52,7 +52,7 @@ export interface RunDetail {
|
|
|
52
52
|
* Read one run's participants. Returns null when the run has no readable bundle yet — an ordinary
|
|
53
53
|
* state for a run that has just started, not a failure.
|
|
54
54
|
*
|
|
55
|
-
* Reads the bundle
|
|
55
|
+
* Reads the bundle narrowly rather than through `loadRunBundle`, which applies the strict
|
|
56
56
|
* evidence-of-record guard. That guard is right for verification and wrong here: a mid-run flush is
|
|
57
57
|
* a partial document by definition, so validating it as a complete bundle would make the live view
|
|
58
58
|
* — the only view that needs this — the one case that never renders. Nothing read here is treated
|
package/dist/run/detail.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// What
|
|
1
|
+
// What one run is doing right now: who is in it, what they are thinking, how far they have got.
|
|
2
2
|
// Unlike the run index, it opens the bundle, which is affordable for the one run someone is
|
|
3
3
|
// looking at.
|
|
4
4
|
//
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// - `stream.actor` once it has finished.
|
|
8
8
|
// Reading both means the same screen renders a run the whole way through rather than going blank
|
|
9
9
|
// at the moment it completes.
|
|
10
|
-
import {
|
|
10
|
+
import { readAutomaticAnalysis } from "../analysis/automatic.js";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { estimateActorCostForExecution } from "./pricing.js";
|
|
13
13
|
import { resolveRunPath } from "./locate.js";
|
|
@@ -18,7 +18,7 @@ const RUN_DETAIL_SCHEMA = "humanish.run-detail.v1";
|
|
|
18
18
|
/**
|
|
19
19
|
* The latest reasoning a participant has recorded.
|
|
20
20
|
*
|
|
21
|
-
* Takes the
|
|
21
|
+
* Takes the last reasoning item rather than the newest by timestamp: the trace is append-ordered by
|
|
22
22
|
* construction, and half of a live flush may not carry `at` yet. An item still in flight is skipped
|
|
23
23
|
* — a partial thought read mid-write would be quoted as though the participant had finished it.
|
|
24
24
|
*/
|
|
@@ -68,7 +68,7 @@ function participantFrom(stream, index) {
|
|
|
68
68
|
/**
|
|
69
69
|
* What a participant has spent, priced the same way whether the run is finished or in flight.
|
|
70
70
|
*
|
|
71
|
-
* A finished trace carries its own `estimatedCost`. A live one carries the
|
|
71
|
+
* A finished trace carries its own `estimatedCost`. A live one carries the running usage and the
|
|
72
72
|
* model it prices at, so the same estimator gives a figure mid-run instead of the screen reporting
|
|
73
73
|
* the cost as unknown until the moment the run ends — which is the half of a run where knowing what
|
|
74
74
|
* it is costing actually changes what you do.
|
|
@@ -98,7 +98,7 @@ function costOf(trace) {
|
|
|
98
98
|
* Read one run's participants. Returns null when the run has no readable bundle yet — an ordinary
|
|
99
99
|
* state for a run that has just started, not a failure.
|
|
100
100
|
*
|
|
101
|
-
* Reads the bundle
|
|
101
|
+
* Reads the bundle narrowly rather than through `loadRunBundle`, which applies the strict
|
|
102
102
|
* evidence-of-record guard. That guard is right for verification and wrong here: a mid-run flush is
|
|
103
103
|
* a partial document by definition, so validating it as a complete bundle would make the live view
|
|
104
104
|
* — the only view that needs this — the one case that never renders. Nothing read here is treated
|
|
@@ -126,7 +126,7 @@ export async function readRunDetail(cwdInput, runId) {
|
|
|
126
126
|
}
|
|
127
127
|
const streams = Array.isArray(bundle.streams) ? bundle.streams : [];
|
|
128
128
|
const observerAbsolute = path.join(runPaths.absoluteRunRoot, "observer", "index.html");
|
|
129
|
-
const automaticAnalysis = await
|
|
129
|
+
const automaticAnalysis = await readAutomaticAnalysis(cwd, runId);
|
|
130
130
|
return {
|
|
131
131
|
...(automaticAnalysis === undefined ? {} : { automaticAnalysis }),
|
|
132
132
|
schema: RUN_DETAIL_SCHEMA,
|
package/dist/run/dry-run.js
CHANGED
|
@@ -37,7 +37,7 @@ async function runDryRunInScope(options, scope) {
|
|
|
37
37
|
if (participants === null) {
|
|
38
38
|
return refused(requestedCwd, warnings, {
|
|
39
39
|
code: "HUMANISH_INVALID_SIM_COUNT",
|
|
40
|
-
message: "--
|
|
40
|
+
message: "--count must be a positive integer.",
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
// Bind the physical project, as the lab routes do: a symlinked cwd retargeted mid-run cannot
|
|
@@ -66,6 +66,8 @@ async function runDryRunInScope(options, scope) {
|
|
|
66
66
|
mode: options.dryRun ? "dry-run" : "live",
|
|
67
67
|
lab: options.lab,
|
|
68
68
|
renderReview: renderReviewMarkdown,
|
|
69
|
+
// The run starts at the time its id and source were stamped with.
|
|
70
|
+
now: () => Date.parse(createdAt),
|
|
69
71
|
...(options.observer === undefined ? {} : { observer: { open: options.observer.open } }),
|
|
70
72
|
});
|
|
71
73
|
if (!started.ok)
|
|
@@ -85,16 +87,7 @@ async function runDryRunInScope(options, scope) {
|
|
|
85
87
|
});
|
|
86
88
|
const judgment = judgePreview();
|
|
87
89
|
const bundle = {
|
|
88
|
-
...bundleHead({
|
|
89
|
-
runId,
|
|
90
|
-
mode: "dry-run",
|
|
91
|
-
participants,
|
|
92
|
-
createdAt,
|
|
93
|
-
cwd,
|
|
94
|
-
artifactRoot,
|
|
95
|
-
...(options.lab === undefined ? {} : { lab: options.lab }),
|
|
96
|
-
source,
|
|
97
|
-
}),
|
|
90
|
+
...bundleHead(run, { participants, cwd, artifactRoot, source }),
|
|
98
91
|
persona: inputs.persona,
|
|
99
92
|
scenario: inputs.scenario,
|
|
100
93
|
lifecycle: [
|
|
@@ -211,7 +204,7 @@ async function renderPreviewObserver(finished, warnings) {
|
|
|
211
204
|
return undefined;
|
|
212
205
|
}
|
|
213
206
|
}
|
|
214
|
-
/** One synthetic stream per
|
|
207
|
+
/** One synthetic stream per stream kind (UI, terminal and the rest); the preview cycles through them. */
|
|
215
208
|
const SYNTHETIC_STREAM_TEMPLATES = [
|
|
216
209
|
{
|
|
217
210
|
kind: "ui",
|
|
@@ -4,7 +4,7 @@ import { type PreparedOutputRoot } from "./contained-output.js";
|
|
|
4
4
|
* percent-decoded up to five times, and each round must still be a plain relative path, so an
|
|
5
5
|
* encoded `..` or separator cannot survive into a later decode.
|
|
6
6
|
*/
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function isEvidencePath(value: string): boolean;
|
|
8
8
|
/**
|
|
9
9
|
* True when `value` (at most `maxLength` characters) stays a plain relative path through up to five
|
|
10
10
|
* rounds of percent-decoding: no round may match `unsafe`, have an empty, `.` or `..` segment, or
|
|
@@ -16,13 +16,13 @@ export declare function decodesToPlainRelativePath(value: string, maxLength: num
|
|
|
16
16
|
* not turn an analysis budget into an unbounded read. No returned bytes have
|
|
17
17
|
* authority to select another file or initiate a network request.
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function readBoundedFile(root: PreparedOutputRoot, relativePath: string, maxBytes: number): Promise<Buffer | null>;
|
|
20
20
|
/**
|
|
21
21
|
* After a bounded read returned nothing: true when the file is absent, false when something is
|
|
22
22
|
* there that could not be read. Errors other than ENOENT propagate.
|
|
23
23
|
*/
|
|
24
24
|
export declare function pathMissing(filePath: string): Promise<boolean>;
|
|
25
|
-
export type
|
|
25
|
+
export type BoundedFileResult = {
|
|
26
26
|
state: "read";
|
|
27
27
|
bytes: Buffer;
|
|
28
28
|
} | {
|
|
@@ -32,4 +32,4 @@ export type BoundedStudyFileResult = {
|
|
|
32
32
|
state: "unavailable";
|
|
33
33
|
};
|
|
34
34
|
/** Size refusals are distinguished only after the same contained regular-file checks. */
|
|
35
|
-
export declare function
|
|
35
|
+
export declare function readBoundedFileResult(root: PreparedOutputRoot, relativePath: string, maxBytes: number): Promise<BoundedFileResult>;
|