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
|
@@ -4,12 +4,12 @@ import { isNonNegativeSafeInteger, isRecord } from "./type-guards.js";
|
|
|
4
4
|
// The promptDigest convention: sha256 hex, first 16 chars. A "seeded" record without a real
|
|
5
5
|
// digest cannot pin "same recipe" across bundles, so verify treats it as a hollow claim.
|
|
6
6
|
export const COMMAND_DIGEST_PATTERN = /^[0-9a-f]{16}$/;
|
|
7
|
-
// Env var
|
|
8
|
-
// must hold
|
|
7
|
+
// Env var name shape (mirrors ENV_NAME_PATTERN in src/lab/parse/values.ts). externalEnvNames
|
|
8
|
+
// must hold names only: a value sneaking into the list trips this check (a free secret tripwire).
|
|
9
9
|
export const SUBJECT_ENV_NAME_PATTERN = /^[A-Z][A-Z0-9_]*$/;
|
|
10
|
-
//
|
|
10
|
+
// Sequential: the three disclosures a sequential shared-world bundle must pin (verify fails closed
|
|
11
11
|
// if any is absent — omission overclaims): sequential turns only, no concurrency/races handled, and
|
|
12
|
-
// a checkpoint delta is attributed to the
|
|
12
|
+
// a checkpoint delta is attributed to the turn it followed, never a specific action (correlation).
|
|
13
13
|
export const MANDATORY_ATTRIBUTION_LIMITS = [
|
|
14
14
|
"sequential-only",
|
|
15
15
|
"no-concurrent-races",
|
|
@@ -17,11 +17,11 @@ export const MANDATORY_ATTRIBUTION_LIMITS = [
|
|
|
17
17
|
];
|
|
18
18
|
// A shared-world checkpoint record persists DIGEST-ONLY: exactly these keys, nothing value-shaped.
|
|
19
19
|
export const SHARED_WORLD_CHECKPOINT_KEYS = new Set(["kind", "name", "digest", "deltaFromPrev"]);
|
|
20
|
-
//
|
|
20
|
+
// A concurrent stateSeries record is digest-only too: it permits a numeric timestamp + the
|
|
21
21
|
// sha256-16 digest; any other key is a value-shaped leak / a smuggled per-delta→actor field.
|
|
22
22
|
export const SHARED_WORLD_STATESERIES_KEYS = new Set(["timestamp", "digest"]);
|
|
23
23
|
/**
|
|
24
|
-
* Single-plane provenance: every item shares
|
|
24
|
+
* Single-plane provenance: every item shares one (commit, seedDigest), and that pair matches
|
|
25
25
|
* sharedWorld.plane. Only the first item that diverges from the plane is reported. The shape guard
|
|
26
26
|
* has already typed both fields as strings (commit may be absent).
|
|
27
27
|
*/
|
|
@@ -62,7 +62,7 @@ export function sharedWorldCommonFindings(bundle, sw) {
|
|
|
62
62
|
if (isRecord(plane) && Array.isArray(plane.envNames)) {
|
|
63
63
|
for (const name of plane.envNames) {
|
|
64
64
|
if (typeof name !== "string" || !SUBJECT_ENV_NAME_PATTERN.test(name)) {
|
|
65
|
-
//
|
|
65
|
+
// Never echoes the entry: a malformed entry may be a value.
|
|
66
66
|
findings.push("sharedWorld.plane.envNames carries an entry that is not an env var NAME shape (values must never appear in evidence)");
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -70,8 +70,8 @@ export function sharedWorldCommonFindings(bundle, sw) {
|
|
|
70
70
|
return findings;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
* Tolerant
|
|
74
|
-
* types
|
|
73
|
+
* Tolerant shape guard for the shared-world evidence block (#164). Validates required fields +
|
|
74
|
+
* types and tolerates extra keys (additive): the strict value-shape/timeline checks are
|
|
75
75
|
* sharedWorldEvidenceFindings' job (an injected value-shaped checkpoint field must pass the shape
|
|
76
76
|
* guard so verify can catch it fail-closed, not silently bounce off isRunBundle).
|
|
77
77
|
*/
|
|
@@ -109,7 +109,7 @@ export function isSharedWorldEvidence(value) {
|
|
|
109
109
|
if (!(Array.isArray(value.attributionLimits) &&
|
|
110
110
|
value.attributionLimits.every((limit) => typeof limit === "string")))
|
|
111
111
|
return false;
|
|
112
|
-
// Tolerant: validate the
|
|
112
|
+
// Tolerant: validate the type of each present field only (the coherence + topologyMode dispatch
|
|
113
113
|
// are the job of sharedWorldEvidenceFindings — an injected value-shaped field must pass this
|
|
114
114
|
// guard so verify catches it fail-closed). A bundle must carry at least one of the two shapes.
|
|
115
115
|
if (value.sequence !== undefined &&
|
|
@@ -148,7 +148,7 @@ function isSharedWorldTimelineEntry(value) {
|
|
|
148
148
|
}
|
|
149
149
|
return false;
|
|
150
150
|
}
|
|
151
|
-
// Tolerant shape guards for the
|
|
151
|
+
// Tolerant shape guards for the concurrent series (extra keys tolerated; the digest-only /
|
|
152
152
|
// allowed-keys tripwires are the strict job of sharedWorldEvidenceFindings).
|
|
153
153
|
function isSharedWorldLaneWindow(value) {
|
|
154
154
|
return (isRecord(value) &&
|
package/dist/run/stats.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CostTotals, type CostRow } from "./costs.js";
|
|
2
2
|
declare const STATS_SCHEMA = "humanish.stats.v1";
|
|
3
3
|
interface StatsParticipants {
|
|
4
4
|
total: number;
|
|
@@ -24,7 +24,7 @@ interface StatsLabRow {
|
|
|
24
24
|
/** Runs with no estimate: a subscription brain, an interrupted run, an old bundle. Never zero. */
|
|
25
25
|
unpricedRuns: number;
|
|
26
26
|
participants: StatsParticipants;
|
|
27
|
-
costs:
|
|
27
|
+
costs: CostTotals;
|
|
28
28
|
}
|
|
29
29
|
interface StatsDayRow {
|
|
30
30
|
day: string;
|
|
@@ -33,7 +33,7 @@ interface StatsDayRow {
|
|
|
33
33
|
/** Participant and desktop subtotal; `costs` also includes retained analysis. */
|
|
34
34
|
estimatedSpendUsd: number;
|
|
35
35
|
unpricedRuns: number;
|
|
36
|
-
costs:
|
|
36
|
+
costs: CostTotals;
|
|
37
37
|
}
|
|
38
38
|
export interface StatsResult {
|
|
39
39
|
schema: typeof STATS_SCHEMA;
|
|
@@ -51,12 +51,12 @@ export interface StatsResult {
|
|
|
51
51
|
unpricedRuns: number;
|
|
52
52
|
participants: StatsParticipants;
|
|
53
53
|
verdicts: Record<string, number>;
|
|
54
|
-
costs:
|
|
54
|
+
costs: CostTotals;
|
|
55
55
|
};
|
|
56
56
|
labs: StatsLabRow[];
|
|
57
57
|
days: StatsDayRow[];
|
|
58
58
|
/** Same selected runs; individual accounting gaps are inspectable without reading private evidence. */
|
|
59
|
-
costsByRun:
|
|
59
|
+
costsByRun: CostRow[];
|
|
60
60
|
/** Directories that could not be read, by name — surfaced, never silently dropped. */
|
|
61
61
|
unreadable: string[];
|
|
62
62
|
note: string;
|
package/dist/run/stats.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// counts as unknown and never as zero, and every rate has a denominator next to it.
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { readRunIndex } from "./run-index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { addCostTotals, emptyCostTotals, readCostTotals, } from "./costs.js";
|
|
7
7
|
import { round6 } from "./pricing.js";
|
|
8
8
|
const STATS_SCHEMA = "humanish.stats.v1";
|
|
9
9
|
const STATS_NOTE = "Every dollar figure is a retained rate-table estimate, never a provider charge. " +
|
|
@@ -47,7 +47,7 @@ function addToLabRow(labs, entry, priced, costs) {
|
|
|
47
47
|
unpricedRuns: 0,
|
|
48
48
|
participants: emptyParticipants(),
|
|
49
49
|
durations: [],
|
|
50
|
-
costs:
|
|
50
|
+
costs: emptyCostTotals(),
|
|
51
51
|
runCosts: [],
|
|
52
52
|
};
|
|
53
53
|
labs.set(labId, row);
|
|
@@ -69,7 +69,7 @@ function addToLabRow(labs, entry, priced, costs) {
|
|
|
69
69
|
else
|
|
70
70
|
row.unpricedRuns += 1;
|
|
71
71
|
addParticipants(row.participants, entry);
|
|
72
|
-
|
|
72
|
+
addCostTotals(row.costs, costs);
|
|
73
73
|
}
|
|
74
74
|
function addToDayRow(days, entry, priced, costs) {
|
|
75
75
|
const at = entryTime(entry);
|
|
@@ -82,7 +82,7 @@ function addToDayRow(days, entry, priced, costs) {
|
|
|
82
82
|
live: 0,
|
|
83
83
|
estimatedSpendUsd: 0,
|
|
84
84
|
unpricedRuns: 0,
|
|
85
|
-
costs:
|
|
85
|
+
costs: emptyCostTotals(),
|
|
86
86
|
};
|
|
87
87
|
days.set(day, dayRow);
|
|
88
88
|
}
|
|
@@ -93,7 +93,7 @@ function addToDayRow(days, entry, priced, costs) {
|
|
|
93
93
|
dayRow.estimatedSpendUsd += entry.estimatedCostUsd;
|
|
94
94
|
else
|
|
95
95
|
dayRow.unpricedRuns += 1;
|
|
96
|
-
|
|
96
|
+
addCostTotals(dayRow.costs, costs);
|
|
97
97
|
}
|
|
98
98
|
export async function computeStats(cwdInput, options = {}) {
|
|
99
99
|
const cwd = path.resolve(cwdInput);
|
|
@@ -148,15 +148,15 @@ export async function computeStats(cwdInput, options = {}) {
|
|
|
148
148
|
unpricedRuns: 0,
|
|
149
149
|
participants: emptyParticipants(),
|
|
150
150
|
verdicts: {},
|
|
151
|
-
costs:
|
|
151
|
+
costs: emptyCostTotals(),
|
|
152
152
|
};
|
|
153
153
|
const labs = new Map();
|
|
154
154
|
const days = new Map();
|
|
155
155
|
const costsByRun = [];
|
|
156
156
|
for (const entry of selected) {
|
|
157
|
-
const accounting = await
|
|
157
|
+
const accounting = await readCostTotals(cwd, entry);
|
|
158
158
|
costsByRun.push(accounting);
|
|
159
|
-
|
|
159
|
+
addCostTotals(totals.costs, accounting.costs);
|
|
160
160
|
totals.runs += 1;
|
|
161
161
|
if (entry.mode === "live")
|
|
162
162
|
totals.live += 1;
|
package/dist/run/status.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const RUN_STATUS_FILE = "status.json";
|
|
|
7
7
|
/** How often a live run touches `updatedAt`. */
|
|
8
8
|
export declare const RUN_STATUS_TOUCH_MS = 5000;
|
|
9
9
|
/**
|
|
10
|
-
* A `running` record whose `updatedAt` is older than this is
|
|
10
|
+
* A `running` record whose `updatedAt` is older than this is interrupted, not alive: the process
|
|
11
11
|
* died without finalizing (a dropped SSH, a killed terminal, a crash). Three touch intervals of
|
|
12
12
|
* slack so an ordinary scheduling hiccup or a slow disk never mislabels a healthy run.
|
|
13
13
|
*/
|
|
@@ -21,7 +21,9 @@ export interface RunLabProvenance {
|
|
|
21
21
|
/** `committed` = humanish/labs, `ignored` = a local overlay, `explicit` = a path the operator passed. */
|
|
22
22
|
origin?: "committed" | "ignored" | "explicit";
|
|
23
23
|
}
|
|
24
|
-
type RunStatusState = "running" | "finished";
|
|
24
|
+
type RunStatusState = "running" | "finished" | "interrupted";
|
|
25
|
+
/** The signals the CLI's run handler records when it stops a run. */
|
|
26
|
+
export type RunInterruptSignal = "SIGINT" | "SIGTERM" | "SIGHUP";
|
|
25
27
|
/** The outcome summary a finalized record carries. Derived from the bundle; never authoritative. */
|
|
26
28
|
interface RunStatusOutcome {
|
|
27
29
|
/** `review.verdict` verbatim. */
|
|
@@ -55,6 +57,8 @@ export interface RunStatusRecord {
|
|
|
55
57
|
/** Refreshed on a fixed cadence while the run is alive; the staleness signal. */
|
|
56
58
|
updatedAt: string;
|
|
57
59
|
completedAt?: string;
|
|
60
|
+
/** The signal that stopped the run, on an `interrupted` record. */
|
|
61
|
+
signal?: RunInterruptSignal;
|
|
58
62
|
outcome?: RunStatusOutcome;
|
|
59
63
|
}
|
|
60
64
|
export interface RunStatusHandle {
|
|
@@ -72,11 +76,16 @@ export interface RunStatusHandle {
|
|
|
72
76
|
ok: boolean;
|
|
73
77
|
execution: ExecutionOutcome;
|
|
74
78
|
}): Promise<void>;
|
|
79
|
+
/** The process is being stopped by `signal`: state `interrupted`, `completedAt` and the signal.
|
|
80
|
+
* It stops the cadence and makes a later finish or settle a no-op, so the route cannot write
|
|
81
|
+
* `running` or `finished` over it. When the run had finished it writes nothing, waits for the
|
|
82
|
+
* writes already queued and resolves false. */
|
|
83
|
+
interrupt(signal: RunInterruptSignal): Promise<boolean>;
|
|
75
84
|
}
|
|
76
85
|
export interface BeginRunStatusOptions {
|
|
77
86
|
runId: string;
|
|
78
87
|
mode: "dry-run" | "live";
|
|
79
|
-
lab?: RunLabProvenance;
|
|
88
|
+
lab?: RunLabProvenance | undefined;
|
|
80
89
|
}
|
|
81
90
|
/**
|
|
82
91
|
* Start a run's status record and keep it fresh. Fire-and-forget by design: a status write that
|
|
@@ -84,7 +93,8 @@ export interface BeginRunStatusOptions {
|
|
|
84
93
|
* `unref`'d — this file can never be the reason a process stays alive.
|
|
85
94
|
*/
|
|
86
95
|
export declare function beginRunStatus(runPaths: PreparedOutputRoot, options: BeginRunStatusOptions): RunStatusHandle;
|
|
87
|
-
/** The three ways a run reads from disk. `interrupted` is a
|
|
96
|
+
/** The three ways a run reads from disk. `interrupted` is a record its stopped process wrote, or a
|
|
97
|
+
* `running` record gone stale. */
|
|
88
98
|
export type RunLiveness = "running" | "interrupted" | "finished";
|
|
89
99
|
/**
|
|
90
100
|
* Classify a status record. Pure, so the TUI, the CLI and tests share one definition of "alive".
|
|
@@ -94,11 +104,11 @@ export declare function classifyRunStatus(record: Pick<RunStatusRecord, "state"
|
|
|
94
104
|
/** Shape guard for a record read off disk. Unknown extra fields are tolerated (additive contract). */
|
|
95
105
|
export declare function isRunStatusRecord(value: unknown): value is RunStatusRecord;
|
|
96
106
|
/**
|
|
97
|
-
* The legacy bridge: infer a lab id for a bundle written
|
|
107
|
+
* The legacy bridge: infer a lab id for a bundle written before this contract, where the only
|
|
98
108
|
* attribution was the `lab:<id>` convention on persona/scenario source strings. Deliberately
|
|
99
109
|
* conservative — it reads the convention and nothing else, and a `lab:` prefix with an empty
|
|
100
110
|
* remainder is not an id. Ids may contain colons (the removed meta-lab wrote `oss:meta`), so
|
|
101
|
-
* only the
|
|
111
|
+
* only the first segment is stripped. Returns undefined when the bundle carries no such marker.
|
|
102
112
|
*/
|
|
103
113
|
export declare function inferLegacyLabId(bundle: {
|
|
104
114
|
persona?: {
|
package/dist/run/status.js
CHANGED
|
@@ -17,11 +17,12 @@ export const RUN_STATUS_FILE = "status.json";
|
|
|
17
17
|
/** How often a live run touches `updatedAt`. */
|
|
18
18
|
export const RUN_STATUS_TOUCH_MS = 5_000;
|
|
19
19
|
/**
|
|
20
|
-
* A `running` record whose `updatedAt` is older than this is
|
|
20
|
+
* A `running` record whose `updatedAt` is older than this is interrupted, not alive: the process
|
|
21
21
|
* died without finalizing (a dropped SSH, a killed terminal, a crash). Three touch intervals of
|
|
22
22
|
* slack so an ordinary scheduling hiccup or a slow disk never mislabels a healthy run.
|
|
23
23
|
*/
|
|
24
24
|
export const RUN_STATUS_STALE_MS = RUN_STATUS_TOUCH_MS * 3;
|
|
25
|
+
const RUN_INTERRUPT_SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
25
26
|
/** The outcome a finalized status record carries, read from the bundle that was just written. */
|
|
26
27
|
export function runStatusOutcome(bundle) {
|
|
27
28
|
return {
|
|
@@ -102,12 +103,16 @@ export function beginRunStatus(runPaths, options) {
|
|
|
102
103
|
return;
|
|
103
104
|
// The record is public-safe by construction, so each message passes the shape redaction
|
|
104
105
|
// again even though the routes scrubbed it.
|
|
106
|
+
const redacted = (failure) => ({
|
|
107
|
+
kind: failure.kind,
|
|
108
|
+
message: redactText(failure.message),
|
|
109
|
+
});
|
|
105
110
|
const execution = {
|
|
106
111
|
succeeded: result.execution.succeeded,
|
|
107
|
-
failures: result.execution.failures.map(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
failures: result.execution.failures.map(redacted),
|
|
113
|
+
...(result.execution.warnings === undefined
|
|
114
|
+
? {}
|
|
115
|
+
: { warnings: result.execution.warnings.map(redacted) }),
|
|
111
116
|
};
|
|
112
117
|
finishedRecord = {
|
|
113
118
|
...finishedRecord,
|
|
@@ -115,6 +120,19 @@ export function beginRunStatus(runPaths, options) {
|
|
|
115
120
|
};
|
|
116
121
|
await write(finishedRecord);
|
|
117
122
|
},
|
|
123
|
+
async interrupt(signal) {
|
|
124
|
+
// A finish that has not landed yet is in the chain: wait for it so the process does not
|
|
125
|
+
// exit with `running` on disk.
|
|
126
|
+
if (finished) {
|
|
127
|
+
await writing;
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
finished = true;
|
|
131
|
+
clearInterval(timer);
|
|
132
|
+
const completedAt = iso();
|
|
133
|
+
await write({ ...base, state: "interrupted", updatedAt: completedAt, completedAt, signal });
|
|
134
|
+
return true;
|
|
135
|
+
},
|
|
118
136
|
};
|
|
119
137
|
return handle;
|
|
120
138
|
}
|
|
@@ -125,6 +143,8 @@ export function beginRunStatus(runPaths, options) {
|
|
|
125
143
|
export function classifyRunStatus(record, nowMs, staleMs = RUN_STATUS_STALE_MS) {
|
|
126
144
|
if (record.state === "finished")
|
|
127
145
|
return "finished";
|
|
146
|
+
if (record.state === "interrupted")
|
|
147
|
+
return "interrupted";
|
|
128
148
|
const updated = Date.parse(record.updatedAt);
|
|
129
149
|
if (!Number.isFinite(updated))
|
|
130
150
|
return "interrupted";
|
|
@@ -139,7 +159,10 @@ export function isRunStatusRecord(value) {
|
|
|
139
159
|
return false;
|
|
140
160
|
if (typeof record.runId !== "string" || record.runId === "")
|
|
141
161
|
return false;
|
|
142
|
-
if (record.state !== "running" && record.state !== "finished")
|
|
162
|
+
if (record.state !== "running" && record.state !== "finished" && record.state !== "interrupted")
|
|
163
|
+
return false;
|
|
164
|
+
if (record.signal !== undefined &&
|
|
165
|
+
(typeof record.signal !== "string" || !RUN_INTERRUPT_SIGNALS.includes(record.signal)))
|
|
143
166
|
return false;
|
|
144
167
|
if (record.mode !== "dry-run" && record.mode !== "live")
|
|
145
168
|
return false;
|
|
@@ -156,11 +179,11 @@ export function isRunStatusRecord(value) {
|
|
|
156
179
|
return true;
|
|
157
180
|
}
|
|
158
181
|
/**
|
|
159
|
-
* The legacy bridge: infer a lab id for a bundle written
|
|
182
|
+
* The legacy bridge: infer a lab id for a bundle written before this contract, where the only
|
|
160
183
|
* attribution was the `lab:<id>` convention on persona/scenario source strings. Deliberately
|
|
161
184
|
* conservative — it reads the convention and nothing else, and a `lab:` prefix with an empty
|
|
162
185
|
* remainder is not an id. Ids may contain colons (the removed meta-lab wrote `oss:meta`), so
|
|
163
|
-
* only the
|
|
186
|
+
* only the first segment is stripped. Returns undefined when the bundle carries no such marker.
|
|
164
187
|
*/
|
|
165
188
|
export function inferLegacyLabId(bundle) {
|
|
166
189
|
for (const source of [bundle.persona?.source, bundle.scenario?.source]) {
|
package/dist/run/streams.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodexAppServerTrace } from "../actors/codex/app-server-trace.js";
|
|
2
|
-
import type { ActorTrace, ActorTraceItem } from "../actors/contract.js";
|
|
2
|
+
import type { ActorStatus, ActorTrace, ActorTraceItem } from "../actors/contract.js";
|
|
3
3
|
import type { RunDesktopRecording } from "../evidence/desktop-recording-types.js";
|
|
4
4
|
export type RunStreamKind = "ui" | "browser" | "terminal" | "tui" | "codex-ui" | "artifact" | "summary";
|
|
5
5
|
export type RunSimulationStatus = "queued" | "preparing" | "running" | "passed" | "abandoned" | "incomplete" | "complete" | "blocked" | "timed_out" | "failed" | "contract_proof_only";
|
|
@@ -29,10 +29,10 @@ interface RunStreamCompletion {
|
|
|
29
29
|
meaningfulUse?: RunMeaningfulUseScore;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* The
|
|
32
|
+
* The closed set of core meaningful-use scoring components. Closed by design: these are the generic
|
|
33
33
|
* dimensions core itself meters (setup/filesystem/nested/actor/product/feedback). A
|
|
34
|
-
* product-specific scorecard does
|
|
35
|
-
* ships as a thin in-repo extension that emits a namespaced `RunAdapterScore` via the
|
|
34
|
+
* product-specific scorecard does not extend this enum, so adopters' nouns stay out of core. It
|
|
35
|
+
* ships as a thin in-repo extension that emits a namespaced `RunAdapterScore` via the route's
|
|
36
36
|
* `score` hook, leaving its own component breakdown in that score's `data`. Exported so a thin
|
|
37
37
|
* adapter can type against core's score shape without forking.
|
|
38
38
|
*/
|
|
@@ -64,14 +64,14 @@ export interface RunDesktopGeometry {
|
|
|
64
64
|
source: "xdpyinfo";
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
|
-
* The device preset as
|
|
67
|
+
* The device preset as declared by the lab, present only when it differs from `requested`
|
|
68
68
|
* because the rendered width was floored to MIN_DESKTOP_RENDER_WIDTH.
|
|
69
69
|
*
|
|
70
70
|
* Without this, a floored run is indistinguishable from a faithful one: `verified` compares
|
|
71
71
|
* the floored number with itself and reports a match, so a reader of the bundle sees
|
|
72
72
|
* requested 500 / verified 500 and reasonably concludes a 500-wide preset was asked for. A
|
|
73
73
|
* `mobile` (414) and a `small-mobile` (360) seat both render at 500 and look identical here.
|
|
74
|
-
* When this field is set, the preset width did
|
|
74
|
+
* When this field is set, the preset width did not render; see #221.
|
|
75
75
|
*/
|
|
76
76
|
declared?: {
|
|
77
77
|
width: number;
|
|
@@ -121,10 +121,10 @@ export interface RunDesktopGeometry {
|
|
|
121
121
|
source: "cdp";
|
|
122
122
|
};
|
|
123
123
|
/**
|
|
124
|
-
* Page targets the participant drove
|
|
124
|
+
* Page targets the participant drove after the launch page (a link that opened in a new tab)
|
|
125
125
|
* whose own read-back reported the requested viewport width (#623). Absent when the
|
|
126
|
-
* participant never left the launch tab; a later tab that did
|
|
127
|
-
* warning instead.
|
|
126
|
+
* participant never left the launch tab; a later tab that did not report the width is a
|
|
127
|
+
* participant warning instead.
|
|
128
128
|
*/
|
|
129
129
|
laterTargets?: {
|
|
130
130
|
targetId: string;
|
|
@@ -154,20 +154,27 @@ export interface RunParticipantAssignment {
|
|
|
154
154
|
export interface RunStream {
|
|
155
155
|
id: string;
|
|
156
156
|
simId: string;
|
|
157
|
-
/** Adapter-owned
|
|
157
|
+
/** Adapter-owned participant id for fan-out / target-swarm runs. Safe categorical metadata only. */
|
|
158
158
|
laneId?: string;
|
|
159
|
-
/** Adapter-owned actor class for grouping
|
|
159
|
+
/** Adapter-owned actor class for grouping participants, e.g. viewer/reviewer/admin. */
|
|
160
160
|
actorType?: string;
|
|
161
|
-
/** Adapter-owned product surface label for grouping
|
|
161
|
+
/** Adapter-owned product surface label for grouping participants without parsing URLs. */
|
|
162
162
|
surface?: string;
|
|
163
163
|
/** Adapter-owned scenario/case grouping label. */
|
|
164
164
|
caseGroup?: string;
|
|
165
|
-
/** Authored/default mission and
|
|
165
|
+
/** Authored/default mission and participant focus, redacted before persistence. Missing on older
|
|
166
166
|
* bundles and uninstrumented routes; never reconstructed from study context or narration. */
|
|
167
167
|
assignment?: RunParticipantAssignment;
|
|
168
168
|
kind: RunStreamKind;
|
|
169
169
|
label: string;
|
|
170
170
|
status: RunSimulationStatus;
|
|
171
|
+
/**
|
|
172
|
+
* The judge's status for this participant (`judgedStatus` in src/run/judge.ts). It differs from
|
|
173
|
+
* the trace status when a goal_satisfied session reported a blocker or never engaged. Computer-use
|
|
174
|
+
* fan-out writes it for a finished live participant; rerun selection reads it. Absent elsewhere,
|
|
175
|
+
* and in bundles written before it existed.
|
|
176
|
+
*/
|
|
177
|
+
judgedStatus?: ActorStatus;
|
|
171
178
|
transport: "snapshot" | "polling" | "sse" | "pty" | "app-server";
|
|
172
179
|
updatedAt: string;
|
|
173
180
|
url?: string;
|
|
@@ -176,7 +183,7 @@ export interface RunStream {
|
|
|
176
183
|
url?: string;
|
|
177
184
|
title?: string;
|
|
178
185
|
};
|
|
179
|
-
/** Set by the attached watch server when the
|
|
186
|
+
/** Set by the attached watch server when the participant's sandbox is gone: the injected live URL
|
|
180
187
|
* would render a provider error page, so viewers fall back to recorded evidence. Runtime-only
|
|
181
188
|
* and never persisted into bundles; declared here because the served observer-data carries it
|
|
182
189
|
* and the client is typed against this contract. */
|
|
@@ -192,7 +199,7 @@ export interface RunStream {
|
|
|
192
199
|
deviceScaleFactor?: number;
|
|
193
200
|
isMobile?: boolean;
|
|
194
201
|
};
|
|
195
|
-
/** Truthful screen/window/viewport evidence for hosted desktop browser
|
|
202
|
+
/** Truthful screen/window/viewport evidence for hosted desktop browser participants. */
|
|
196
203
|
desktopGeometry?: RunDesktopGeometry;
|
|
197
204
|
terminal?: {
|
|
198
205
|
title: string;
|
|
@@ -227,10 +234,10 @@ export interface RunStream {
|
|
|
227
234
|
};
|
|
228
235
|
actor?: ActorTrace;
|
|
229
236
|
/**
|
|
230
|
-
* Mid-run partial actor evidence (#441): the redacted trace items recorded
|
|
231
|
-
* flushed while a live
|
|
232
|
-
* grow.
|
|
233
|
-
* completionReason, or completedAt, and this shape cannot claim them. Present
|
|
237
|
+
* Mid-run partial actor evidence (#441): the redacted trace items recorded so far,
|
|
238
|
+
* flushed while a live participant is still running so the attached Observer's timeline can
|
|
239
|
+
* grow. It is deliberately not an ActorTrace: a running participant has no honest status,
|
|
240
|
+
* completionReason, or completedAt, and this shape cannot claim them. Present only on
|
|
234
241
|
* `inProgress` bundles; the final write replaces it with the real `actor` and never
|
|
235
242
|
* carries it.
|
|
236
243
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare const TERMINAL_EVENTS_ARTIFACT = "terminal-events.ndjson";
|
|
2
2
|
export declare const TERMINAL_TRANSCRIPT_ARTIFACT = "terminal-transcript.txt";
|
|
3
3
|
export declare const TERMINAL_LEDGERS_ARTIFACT = "terminal-ledgers.json";
|
|
4
|
-
/** The cost categories the
|
|
4
|
+
/** The cost categories the terminal route meters. product/media/payment are adapter signals; core can
|
|
5
5
|
* populate the provider line from the actor trace's tokenUsage.costUsd when present. */
|
|
6
6
|
export type CostCategory = "product" | "media" | "payment" | "provider";
|
|
7
7
|
/** The four cost categories, in a fixed order so the ledger shape is stable across runs. */
|
|
8
8
|
export declare const COST_CATEGORIES: readonly CostCategory[];
|
|
9
9
|
/**
|
|
10
10
|
* Strip ANSI/control noise from a captured terminal transcript into stable, scannable text. Pure
|
|
11
|
-
* (no IO). Exported so the terminal-product
|
|
12
|
-
* its captured exec stream
|
|
11
|
+
* (no IO). Exported so the terminal-product route (src/routes/terminal/live-sandbox.ts) normalizes
|
|
12
|
+
* its captured exec stream exactly as the local-actor routes do: the verdict-nonce scorer is only
|
|
13
13
|
* sound against the same normalization the marker is matched on, so the logic must not diverge.
|
|
14
14
|
*/
|
|
15
15
|
export declare function normalizeLocalActorTranscript(transcript: string): string;
|
|
@@ -18,8 +18,8 @@ type ActorVerdict = "passed" | "blocked" | "failed";
|
|
|
18
18
|
* Extract the per-run verdict from a normalized transcript: the agent must print exactly
|
|
19
19
|
* `HUMANISH_ACTOR_VERDICT=<status> HUMANISH_ACTOR_NONCE=<nonce>`, and the nonce is mandatory so a
|
|
20
20
|
* bare marker (echoed or replayed from untrusted text) can never forge a verdict. Pure (no IO).
|
|
21
|
-
* Exported so the terminal-product
|
|
22
|
-
* divergent verdict logic would let the two
|
|
21
|
+
* Exported so the terminal-product route scores its in-sandbox `codex exec` run by the same marker;
|
|
22
|
+
* divergent verdict logic would let the two routes disagree about what "passed" means.
|
|
23
23
|
*/
|
|
24
24
|
export declare function extractLocalActorVerdict(transcript: string, verdictNonce: string): ActorVerdict | null;
|
|
25
25
|
export {};
|
|
@@ -14,8 +14,8 @@ export const COST_CATEGORIES = [
|
|
|
14
14
|
];
|
|
15
15
|
/**
|
|
16
16
|
* Strip ANSI/control noise from a captured terminal transcript into stable, scannable text. Pure
|
|
17
|
-
* (no IO). Exported so the terminal-product
|
|
18
|
-
* its captured exec stream
|
|
17
|
+
* (no IO). Exported so the terminal-product route (src/routes/terminal/live-sandbox.ts) normalizes
|
|
18
|
+
* its captured exec stream exactly as the local-actor routes do: the verdict-nonce scorer is only
|
|
19
19
|
* sound against the same normalization the marker is matched on, so the logic must not diverge.
|
|
20
20
|
*/
|
|
21
21
|
export function normalizeLocalActorTranscript(transcript) {
|
|
@@ -31,8 +31,8 @@ export function normalizeLocalActorTranscript(transcript) {
|
|
|
31
31
|
* Extract the per-run verdict from a normalized transcript: the agent must print exactly
|
|
32
32
|
* `HUMANISH_ACTOR_VERDICT=<status> HUMANISH_ACTOR_NONCE=<nonce>`, and the nonce is mandatory so a
|
|
33
33
|
* bare marker (echoed or replayed from untrusted text) can never forge a verdict. Pure (no IO).
|
|
34
|
-
* Exported so the terminal-product
|
|
35
|
-
* divergent verdict logic would let the two
|
|
34
|
+
* Exported so the terminal-product route scores its in-sandbox `codex exec` run by the same marker;
|
|
35
|
+
* divergent verdict logic would let the two routes disagree about what "passed" means.
|
|
36
36
|
*/
|
|
37
37
|
export function extractLocalActorVerdict(transcript, verdictNonce) {
|
|
38
38
|
const compactTranscript = transcript.replace(/\s+/g, "");
|
|
@@ -3,3 +3,8 @@ export declare function withTransientCommsSecrets<T>(work: () => Promise<T>): Pr
|
|
|
3
3
|
export declare function registerTransientCommsSecrets(values: string[]): void;
|
|
4
4
|
/** Literal, longest-first replacement in one pass; replacement text is never matched recursively. */
|
|
5
5
|
export declare function scrubTransientCommsText(text: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* The scope's values as a scrubSecretValues scrub, which also finds them percent-encoded, escaped or
|
|
8
|
+
* base64-encoded and returns decoded text. Outside a scope it changes nothing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function transientCommsEncodedScrub(): (text: string) => string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { scrubSecretValues } from "../evidence/secret-scrub.js";
|
|
2
3
|
import { escapeRegExp } from "./text.js";
|
|
3
4
|
const scopes = new AsyncLocalStorage();
|
|
4
5
|
const MAX_VALUES = 8192;
|
|
@@ -70,3 +71,14 @@ export function scrubTransientCommsText(text) {
|
|
|
70
71
|
return fail(scope);
|
|
71
72
|
}
|
|
72
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* The scope's values as a scrubSecretValues scrub, which also finds them percent-encoded, escaped or
|
|
76
|
+
* base64-encoded and returns decoded text. Outside a scope it changes nothing.
|
|
77
|
+
*/
|
|
78
|
+
export function transientCommsEncodedScrub() {
|
|
79
|
+
const scope = scopes.getStore();
|
|
80
|
+
if (!scope)
|
|
81
|
+
return (text) => text;
|
|
82
|
+
usable(scope);
|
|
83
|
+
return scrubSecretValues([...scope.values]);
|
|
84
|
+
}
|