harnery 0.30.0 → 0.31.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/README.md +4 -4
- package/dist/commander.d.ts +8 -0
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +14 -13
- package/dist/commands/adapter.d.ts +12 -0
- package/dist/commands/adapter.d.ts.map +1 -0
- package/dist/commands/{harness.js → adapter.js} +35 -35
- package/dist/commands/agents.d.ts +3 -2
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +61 -60
- package/dist/commands/artifacts.d.ts +4 -0
- package/dist/commands/artifacts.d.ts.map +1 -0
- package/dist/commands/artifacts.js +143 -0
- package/dist/commands/backup.d.ts +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +5 -2
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +310 -7
- package/dist/commands/checkpoint.d.ts +12 -0
- package/dist/commands/checkpoint.d.ts.map +1 -0
- package/dist/commands/checkpoint.js +162 -0
- package/dist/commands/context.d.ts +2 -2
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +3 -151
- package/dist/commands/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +31 -7
- package/dist/commands/deinit.d.ts +2 -2
- package/dist/commands/deinit.js +15 -15
- package/dist/commands/doctor.js +23 -23
- package/dist/commands/governor.d.ts +4 -0
- package/dist/commands/governor.d.ts.map +1 -0
- package/dist/commands/{supervisor.js → governor.js} +133 -108
- package/dist/commands/init.d.ts +12 -12
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +44 -30
- package/dist/commands/{session.d.ts → journal.d.ts} +2 -2
- package/dist/commands/journal.d.ts.map +1 -0
- package/dist/commands/{scratch.js → journal.js} +47 -47
- package/dist/commands/policy.js +1 -1
- package/dist/commands/presence.js +2 -2
- package/dist/commands/sync.d.ts +1 -1
- package/dist/commands/sync.js +3 -3
- package/dist/commands/tunnel.d.ts +16 -0
- package/dist/commands/tunnel.d.ts.map +1 -1
- package/dist/commands/tunnel.js +193 -23
- package/dist/commands/web-fetch.js +1 -1
- package/dist/commands/web.d.ts +19 -0
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +51 -0
- package/dist/commands/work.d.ts.map +1 -1
- package/dist/commands/work.js +38 -22
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +35 -28
- package/dist/core/{harnesses → adapters}/attest-projection.d.ts +2 -2
- package/dist/core/adapters/attest-projection.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/attest.d.ts +16 -16
- package/dist/core/adapters/attest.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/attest.js +9 -9
- package/dist/core/{harnesses → adapters}/attestation.d.ts +16 -16
- package/dist/core/adapters/attestation.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/attestation.js +20 -20
- package/dist/core/{harnesses → adapters}/bench.d.ts +12 -12
- package/dist/core/adapters/bench.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/bench.js +12 -12
- package/dist/core/adapters/index.d.ts +13 -0
- package/dist/core/adapters/index.d.ts.map +1 -0
- package/dist/core/adapters/index.js +6 -0
- package/dist/core/{harnesses → adapters}/profiles.d.ts +11 -11
- package/dist/core/adapters/profiles.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/profiles.js +11 -11
- package/dist/core/adapters/registry.d.ts +15 -0
- package/dist/core/adapters/registry.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/registry.js +11 -11
- package/dist/core/{harnesses → adapters}/types.d.ts +23 -23
- package/dist/core/adapters/types.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/types.js +1 -1
- package/dist/core/agents/canonical-emit.d.ts +4 -4
- package/dist/core/agents/canonical-emit.js +5 -5
- package/dist/core/agents/cli-emit.js +1 -1
- package/dist/core/agents/cli.js +30 -26
- package/dist/core/agents/codex-replay.d.ts +1 -1
- package/dist/core/agents/codex-replay.js +6 -6
- package/dist/core/agents/coord-client.d.ts +21 -2
- package/dist/core/agents/coord-client.d.ts.map +1 -1
- package/dist/core/agents/coord-client.js +122 -27
- package/dist/core/agents/events/consume.d.ts +1 -1
- package/dist/core/agents/events/emit.d.ts +5 -6
- package/dist/core/agents/events/emit.d.ts.map +1 -1
- package/dist/core/agents/events/emit.js +2 -2
- package/dist/core/agents/render/prompt-context.d.ts +21 -9
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +82 -30
- package/dist/core/agents/render/session-context.d.ts +1 -1
- package/dist/core/agents/render/session-context.js +5 -5
- package/dist/core/agents/rules/claim-conflict.d.ts +2 -6
- package/dist/core/agents/rules/claim-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/claim-conflict.js +1 -1
- package/dist/core/agents/rules/commit-conflict.js +98 -22
- package/dist/core/agents/rules/stop-hook.d.ts +9 -9
- package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
- package/dist/core/agents/rules/stop-hook.js +23 -5
- package/dist/core/agents/rules/verdict.d.ts +14 -0
- package/dist/core/agents/rules/verdict.d.ts.map +1 -0
- package/dist/core/agents/rules/verdict.js +1 -0
- package/dist/core/agents/session-events.js +3 -3
- package/dist/core/agents/state/council.d.ts +1 -1
- package/dist/core/agents/state/council.js +1 -1
- package/dist/core/agents/state/heartbeat-projector.d.ts +3 -2
- package/dist/core/agents/state/heartbeat-projector.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-projector.js +14 -10
- package/dist/core/agents/state/heartbeat-writer.d.ts +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +12 -12
- package/dist/core/agents/state/{scratch.d.ts → journal.d.ts} +7 -7
- package/dist/core/agents/state/{scratch.d.ts.map → journal.d.ts.map} +1 -1
- package/dist/core/agents/state/{scratch.js → journal.js} +12 -12
- package/dist/core/agents/state/pidmap.d.ts +28 -4
- package/dist/core/agents/state/pidmap.d.ts.map +1 -1
- package/dist/core/agents/state/pidmap.js +130 -15
- package/dist/core/agents/state/proc-start.d.ts +95 -0
- package/dist/core/agents/state/proc-start.d.ts.map +1 -0
- package/dist/core/agents/state/proc-start.js +199 -0
- package/dist/core/agents/state/shell-mutation.d.ts +1 -1
- package/dist/core/agents/state/shell-mutation.js +1 -1
- package/dist/core/agents/state/stale-sweep.js +7 -7
- package/dist/core/artifacts/index.d.ts +86 -0
- package/dist/core/artifacts/index.d.ts.map +1 -0
- package/dist/core/artifacts/index.js +421 -0
- package/dist/core/config.d.ts +9 -2
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +26 -2
- package/dist/core/context/index.d.ts +12 -12
- package/dist/core/context/index.js +10 -10
- package/dist/core/governor/adapter-spread.d.ts +52 -0
- package/dist/core/governor/adapter-spread.d.ts.map +1 -0
- package/dist/core/governor/adapter-spread.js +52 -0
- package/dist/core/governor/index.d.ts +7 -0
- package/dist/core/governor/index.d.ts.map +1 -0
- package/dist/core/governor/index.js +6 -0
- package/dist/core/governor/plan-api.d.ts +38 -0
- package/dist/core/governor/plan-api.d.ts.map +1 -0
- package/dist/core/governor/plan-api.js +83 -0
- package/dist/core/governor/plan-read.d.ts +5 -0
- package/dist/core/governor/plan-read.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/plan-read.js +66 -52
- package/dist/core/{supervisor → governor}/plan-types.d.ts +57 -56
- package/dist/core/governor/plan-types.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/plan-types.js +4 -4
- package/dist/core/governor/planning.d.ts +48 -0
- package/dist/core/governor/planning.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/planning.js +125 -94
- package/dist/core/governor/read.d.ts +6 -0
- package/dist/core/governor/read.d.ts.map +1 -0
- package/dist/core/governor/read.js +4 -0
- package/dist/core/governor/runner.d.ts +37 -0
- package/dist/core/governor/runner.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/runner.js +15 -15
- package/dist/core/governor/service-read.d.ts +6 -0
- package/dist/core/governor/service-read.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/service-read.js +12 -12
- package/dist/core/governor/service.d.ts +114 -0
- package/dist/core/governor/service.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/service.js +57 -57
- package/dist/core/governor/state.d.ts +116 -0
- package/dist/core/governor/state.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/state.js +228 -108
- package/dist/core/hooks/adapter/detect.d.ts +9 -0
- package/dist/core/hooks/{harness → adapter}/detect.d.ts.map +1 -1
- package/dist/core/hooks/{harness → adapter}/detect.js +8 -8
- package/dist/core/hooks/{harness → adapter}/events.d.ts +15 -14
- package/dist/core/hooks/adapter/events.d.ts.map +1 -0
- package/dist/core/hooks/{harness → adapter}/events.js +5 -5
- package/dist/core/hooks/{harness → adapter}/output.d.ts +20 -14
- package/dist/core/hooks/adapter/output.d.ts.map +1 -0
- package/dist/core/hooks/{harness → adapter}/output.js +30 -22
- package/dist/core/hooks/{harness → adapter}/parse.d.ts +5 -5
- package/dist/core/hooks/{harness → adapter}/parse.d.ts.map +1 -1
- package/dist/core/hooks/{harness → adapter}/parse.js +4 -4
- package/dist/core/hooks/{harness → adapter}/wiring.d.ts +15 -15
- package/dist/core/hooks/{harness → adapter}/wiring.d.ts.map +1 -1
- package/dist/core/hooks/{harness → adapter}/wiring.js +13 -13
- package/dist/core/hooks/cli.d.ts +3 -3
- package/dist/core/hooks/cli.js +175 -151
- package/dist/core/hooks/effects/image-capture.d.ts +5 -5
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -1
- package/dist/core/hooks/effects/image-capture.js +3 -3
- package/dist/core/hooks/effects/index.d.ts +12 -12
- package/dist/core/hooks/effects/index.d.ts.map +1 -1
- package/dist/core/hooks/effects/index.js +17 -17
- package/dist/core/hooks/events/emit.d.ts +2 -2
- package/dist/core/hooks/events/emit.d.ts.map +1 -1
- package/dist/core/hooks/events/emit.js +1 -1
- package/dist/core/hooks/events/rotate.js +1 -1
- package/dist/core/hooks/events/schema.d.ts +13 -5
- package/dist/core/hooks/events/schema.d.ts.map +1 -1
- package/dist/core/hooks/guard-path.d.ts +2 -2
- package/dist/core/hooks/guard-path.js +2 -2
- package/dist/core/hooks/index.d.ts +1 -1
- package/dist/core/hooks/index.d.ts.map +1 -1
- package/dist/core/hooks/resolve/anchor.d.ts +14 -5
- package/dist/core/hooks/resolve/anchor.d.ts.map +1 -1
- package/dist/core/hooks/resolve/anchor.js +64 -7
- package/dist/core/hooks/resolve/coord-root.d.ts +3 -3
- package/dist/core/hooks/resolve/coord-root.js +4 -4
- package/dist/core/hooks/resolve/intent.js +1 -1
- package/dist/core/hooks/resolve/owner.d.ts +1 -1
- package/dist/core/hooks/resolve/owner.d.ts.map +1 -1
- package/dist/core/hooks/resolve/owner.js +11 -5
- package/dist/core/{scratch → journal}/index.d.ts +25 -25
- package/dist/core/{scratch → journal}/index.d.ts.map +1 -1
- package/dist/core/{scratch → journal}/index.js +38 -38
- package/dist/core/policy/evaluate.d.ts +1 -1
- package/dist/core/policy/evaluate.d.ts.map +1 -1
- package/dist/core/policy/evaluate.js +7 -7
- package/dist/core/policy/types.d.ts +3 -3
- package/dist/core/policy/types.d.ts.map +1 -1
- package/dist/core/work/state.d.ts +12 -4
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +50 -17
- package/dist/core/workflow/adapters.d.ts +17 -0
- package/dist/core/workflow/adapters.d.ts.map +1 -0
- package/dist/core/workflow/adapters.js +21 -0
- package/dist/core/workflow/approvals.js +6 -6
- package/dist/core/workflow/billing.d.ts +9 -9
- package/dist/core/workflow/billing.js +9 -9
- package/dist/core/workflow/child-env.d.ts +10 -2
- package/dist/core/workflow/child-env.d.ts.map +1 -1
- package/dist/core/workflow/child-env.js +12 -4
- package/dist/core/workflow/engine.d.ts +15 -5
- package/dist/core/workflow/engine.d.ts.map +1 -1
- package/dist/core/workflow/engine.js +138 -83
- package/dist/core/workflow/evidence-preflight.d.ts +24 -0
- package/dist/core/workflow/evidence-preflight.d.ts.map +1 -0
- package/dist/core/workflow/evidence-preflight.js +134 -0
- package/dist/core/workflow/index.d.ts +1 -1
- package/dist/core/workflow/index.d.ts.map +1 -1
- package/dist/core/workflow/proof.d.ts +11 -5
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +45 -36
- package/dist/core/workflow/run-state.d.ts +1 -1
- package/dist/core/workflow/run-state.js +7 -7
- package/dist/core/workflow/sandbox-projection.d.ts +6 -6
- package/dist/core/workflow/sandbox-projection.d.ts.map +1 -1
- package/dist/core/workflow/sandbox-projection.js +11 -11
- package/dist/core/workflow/spawn-claude.d.ts +3 -3
- package/dist/core/workflow/spawn-claude.d.ts.map +1 -1
- package/dist/core/workflow/spawn-claude.js +9 -6
- package/dist/core/workflow/spawn-codex.d.ts +4 -4
- package/dist/core/workflow/spawn-codex.d.ts.map +1 -1
- package/dist/core/workflow/spawn-codex.js +9 -6
- package/dist/core/workflow/spawn-cursor.d.ts +4 -4
- package/dist/core/workflow/spawn-cursor.d.ts.map +1 -1
- package/dist/core/workflow/spawn-cursor.js +9 -6
- package/dist/core/workflow/spawn-failure.d.ts +1 -1
- package/dist/core/workflow/spawn-failure.js +1 -1
- package/dist/core/workflow/specialists.js +2 -2
- package/dist/core/workflow/{journal.d.ts → transcript.d.ts} +8 -8
- package/dist/core/workflow/transcript.d.ts.map +1 -0
- package/dist/core/workflow/{journal.js → transcript.js} +14 -14
- package/dist/core/workflow/types.d.ts +98 -51
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/dist/core/workflow/types.js +11 -1
- package/dist/core/workflow/validate.d.ts +1 -1
- package/dist/core/workflow/validate.js +1 -1
- package/dist/core/workflow/workspaces/cancellation.js +2 -2
- package/dist/core/workflow/workspaces/cleanup.js +2 -2
- package/dist/core/workflow/workspaces/execution.js +6 -6
- package/dist/core/workflow/workspaces/inspect.js +9 -9
- package/dist/core/workflow/workspaces/integration.js +14 -14
- package/dist/core/workflow/workspaces/lifecycle.d.ts +1 -1
- package/dist/core/workflow/workspaces/lifecycle.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/lifecycle.js +9 -9
- package/dist/core/workflow/workspaces/local-git.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/local-git.js +39 -5
- package/dist/core/workflow/workspaces/recovery.js +3 -3
- package/dist/core/workflow/workspaces/state.d.ts +1 -1
- package/dist/core/workflow/workspaces/state.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/state.js +3 -3
- package/dist/core/workflow/workspaces/types.d.ts +1 -1
- package/dist/core/workflow/workspaces/types.d.ts.map +1 -1
- package/dist/lib/browser/asserts.d.ts +28 -0
- package/dist/lib/browser/asserts.d.ts.map +1 -0
- package/dist/lib/browser/asserts.js +152 -0
- package/dist/lib/browser/client.d.ts +49 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +155 -14
- package/dist/lib/browser/content-checks.d.ts +108 -0
- package/dist/lib/browser/content-checks.d.ts.map +1 -0
- package/dist/lib/browser/content-checks.js +474 -0
- package/dist/lib/browser/critique.d.ts +91 -0
- package/dist/lib/browser/critique.d.ts.map +1 -0
- package/dist/lib/browser/critique.js +167 -0
- package/dist/lib/browser/geometry.d.ts +32 -0
- package/dist/lib/browser/geometry.d.ts.map +1 -1
- package/dist/lib/browser/geometry.js +244 -1
- package/dist/lib/browser/index.d.ts +4 -1
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +2 -0
- package/dist/lib/claude-desktop.d.ts.map +1 -1
- package/dist/lib/claude-desktop.js +4 -1
- package/dist/lib/council/index.d.ts +6 -6
- package/dist/lib/council/index.d.ts.map +1 -1
- package/dist/lib/council/index.js +8 -8
- package/dist/lib/identities/assume.d.ts +2 -2
- package/dist/lib/identities/assume.js +7 -7
- package/dist/lib/instructions/apply.d.ts +3 -3
- package/dist/lib/instructions/apply.d.ts.map +1 -1
- package/dist/lib/instructions/apply.js +75 -27
- package/dist/lib/instructions/host-addendum.d.ts +54 -0
- package/dist/lib/instructions/host-addendum.d.ts.map +1 -0
- package/dist/lib/instructions/host-addendum.js +107 -0
- package/dist/lib/instructions/templates.d.ts +10 -3
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +41 -12
- package/dist/lib/machine.d.ts +2 -2
- package/dist/lib/machine.js +2 -2
- package/package.json +26 -21
- package/schemas/config.schema.json +26 -1
- package/src/commander.ts +22 -13
- package/src/commands/{harness.ts → adapter.ts} +46 -46
- package/src/commands/agents.ts +71 -64
- package/src/commands/artifacts.ts +168 -0
- package/src/commands/backup.ts +47 -33
- package/src/commands/browse.ts +438 -2
- package/src/commands/checkpoint.ts +196 -0
- package/src/commands/context.ts +3 -176
- package/src/commands/decision.ts +41 -7
- package/src/commands/deinit.ts +16 -16
- package/src/commands/doctor.ts +28 -28
- package/src/commands/{supervisor.ts → governor.ts} +184 -154
- package/src/commands/init.ts +50 -34
- package/src/commands/{scratch.ts → journal.ts} +60 -60
- package/src/commands/policy.ts +1 -1
- package/src/commands/presence.ts +2 -2
- package/src/commands/sync.ts +3 -3
- package/src/commands/tunnel.ts +237 -34
- package/src/commands/web-fetch.ts +1 -1
- package/src/commands/web.ts +56 -1
- package/src/commands/work.ts +50 -35
- package/src/commands/workflow.ts +43 -34
- package/src/core/{harnesses → adapters}/attest-projection.ts +2 -2
- package/src/core/{harnesses → adapters}/attest.ts +27 -27
- package/src/core/{harnesses → adapters}/attestation.ts +41 -41
- package/src/core/{harnesses → adapters}/bench.ts +34 -43
- package/src/core/adapters/index.ts +56 -0
- package/src/core/{harnesses → adapters}/profiles.ts +16 -16
- package/src/core/{harnesses → adapters}/registry.ts +23 -23
- package/src/core/{harnesses → adapters}/types.ts +23 -23
- package/src/core/agents/canonical-emit.ts +6 -6
- package/src/core/agents/cli-emit.ts +1 -1
- package/src/core/agents/cli.ts +30 -28
- package/src/core/agents/codex-replay.ts +6 -6
- package/src/core/agents/coord-client.ts +119 -28
- package/src/core/agents/events/consume.ts +1 -1
- package/src/core/agents/events/emit.ts +7 -6
- package/src/core/agents/render/prompt-context.ts +107 -31
- package/src/core/agents/render/session-context.ts +6 -6
- package/src/core/agents/rules/claim-conflict.ts +4 -7
- package/src/core/agents/rules/commit-conflict.ts +103 -22
- package/src/core/agents/rules/stop-hook.ts +33 -17
- package/src/core/agents/rules/verdict.ts +13 -0
- package/src/core/agents/session-events.ts +4 -4
- package/src/core/agents/state/council.ts +1 -1
- package/src/core/agents/state/heartbeat-projector.ts +16 -12
- package/src/core/agents/state/heartbeat-writer.ts +12 -12
- package/src/core/agents/state/{scratch.ts → journal.ts} +12 -12
- package/src/core/agents/state/pidmap.ts +130 -15
- package/src/core/agents/state/proc-start.ts +208 -0
- package/src/core/agents/state/shell-mutation.ts +1 -1
- package/src/core/agents/state/stale-sweep.ts +7 -7
- package/src/core/artifacts/index.ts +557 -0
- package/src/core/config.ts +30 -2
- package/src/core/context/index.ts +15 -15
- package/src/core/governor/adapter-spread.ts +82 -0
- package/src/core/governor/index.ts +91 -0
- package/src/core/governor/plan-api.ts +115 -0
- package/src/core/{supervisor → governor}/plan-read.ts +112 -97
- package/src/core/{supervisor → governor}/plan-types.ts +59 -56
- package/src/core/{supervisor → governor}/planning.ts +223 -192
- package/src/core/governor/read.ts +59 -0
- package/src/core/{supervisor → governor}/runner.ts +39 -39
- package/src/core/{supervisor → governor}/service-read.ts +22 -22
- package/src/core/{supervisor → governor}/service.ts +117 -119
- package/src/core/{supervisor → governor}/state.ts +325 -167
- package/src/core/hooks/adapter/detect.ts +30 -0
- package/src/core/hooks/{harness → adapter}/events.ts +16 -14
- package/src/core/hooks/{harness → adapter}/output.ts +31 -23
- package/src/core/hooks/{harness → adapter}/parse.ts +5 -5
- package/src/core/hooks/{harness → adapter}/wiring.ts +21 -21
- package/src/core/hooks/cli.ts +185 -162
- package/src/core/hooks/effects/image-capture.ts +6 -6
- package/src/core/hooks/effects/index.ts +17 -17
- package/src/core/hooks/events/emit.ts +3 -3
- package/src/core/hooks/events/rotate.ts +1 -1
- package/src/core/hooks/events/schema.ts +15 -7
- package/src/core/hooks/guard-path.ts +2 -2
- package/src/core/hooks/index.ts +1 -1
- package/src/core/hooks/resolve/anchor.ts +63 -8
- package/src/core/hooks/resolve/coord-root.ts +4 -4
- package/src/core/hooks/resolve/intent.ts +1 -1
- package/src/core/hooks/resolve/owner.ts +11 -5
- package/src/core/{scratch → journal}/index.ts +53 -53
- package/src/core/policy/evaluate.ts +8 -8
- package/src/core/policy/types.ts +3 -3
- package/src/core/work/state.ts +65 -23
- package/src/core/workflow/adapters.ts +33 -0
- package/src/core/workflow/approvals.ts +7 -7
- package/src/core/workflow/billing.ts +12 -12
- package/src/core/workflow/child-env.ts +13 -4
- package/src/core/workflow/engine.ts +155 -90
- package/src/core/workflow/evidence-preflight.ts +165 -0
- package/src/core/workflow/index.ts +3 -3
- package/src/core/workflow/proof.ts +60 -50
- package/src/core/workflow/run-state.ts +7 -7
- package/src/core/workflow/sandbox-projection.ts +16 -16
- package/src/core/workflow/spawn-claude.ts +13 -10
- package/src/core/workflow/spawn-codex.ts +13 -10
- package/src/core/workflow/spawn-cursor.ts +13 -10
- package/src/core/workflow/spawn-failure.ts +1 -1
- package/src/core/workflow/specialists.ts +2 -2
- package/src/core/workflow/{journal.ts → transcript.ts} +16 -16
- package/src/core/workflow/types.ts +108 -51
- package/src/core/workflow/validate.ts +1 -1
- package/src/core/workflow/workspaces/cancellation.ts +2 -2
- package/src/core/workflow/workspaces/cleanup.ts +2 -2
- package/src/core/workflow/workspaces/execution.ts +6 -6
- package/src/core/workflow/workspaces/inspect.ts +14 -11
- package/src/core/workflow/workspaces/integration.ts +18 -14
- package/src/core/workflow/workspaces/lifecycle.ts +10 -10
- package/src/core/workflow/workspaces/local-git.ts +47 -5
- package/src/core/workflow/workspaces/recovery.ts +3 -3
- package/src/core/workflow/workspaces/state.ts +4 -3
- package/src/core/workflow/workspaces/types.ts +1 -1
- package/src/lib/browser/asserts.ts +177 -0
- package/src/lib/browser/client.ts +189 -14
- package/src/lib/browser/content-checks.ts +571 -0
- package/src/lib/browser/critique.ts +231 -0
- package/src/lib/browser/geometry.ts +297 -1
- package/src/lib/browser/index.ts +34 -0
- package/src/lib/claude-desktop.ts +4 -1
- package/src/lib/council/index.ts +9 -9
- package/src/lib/identities/assume.ts +7 -7
- package/src/lib/instructions/apply.ts +87 -25
- package/src/lib/instructions/host-addendum.ts +126 -0
- package/src/lib/instructions/templates.ts +44 -15
- package/src/lib/machine.ts +2 -2
- package/dist/commands/harness.d.ts +0 -12
- package/dist/commands/harness.d.ts.map +0 -1
- package/dist/commands/scratch.d.ts +0 -4
- package/dist/commands/scratch.d.ts.map +0 -1
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js +0 -162
- package/dist/commands/supervisor.d.ts +0 -4
- package/dist/commands/supervisor.d.ts.map +0 -1
- package/dist/core/harnesses/attest-projection.d.ts.map +0 -1
- package/dist/core/harnesses/attest.d.ts.map +0 -1
- package/dist/core/harnesses/attestation.d.ts.map +0 -1
- package/dist/core/harnesses/bench.d.ts.map +0 -1
- package/dist/core/harnesses/index.d.ts +0 -13
- package/dist/core/harnesses/index.d.ts.map +0 -1
- package/dist/core/harnesses/index.js +0 -6
- package/dist/core/harnesses/profiles.d.ts.map +0 -1
- package/dist/core/harnesses/registry.d.ts +0 -15
- package/dist/core/harnesses/registry.d.ts.map +0 -1
- package/dist/core/harnesses/types.d.ts.map +0 -1
- package/dist/core/hooks/harness/detect.d.ts +0 -9
- package/dist/core/hooks/harness/events.d.ts.map +0 -1
- package/dist/core/hooks/harness/output.d.ts.map +0 -1
- package/dist/core/supervisor/index.d.ts +0 -7
- package/dist/core/supervisor/index.d.ts.map +0 -1
- package/dist/core/supervisor/index.js +0 -6
- package/dist/core/supervisor/plan-api.d.ts +0 -23
- package/dist/core/supervisor/plan-api.d.ts.map +0 -1
- package/dist/core/supervisor/plan-api.js +0 -50
- package/dist/core/supervisor/plan-read.d.ts +0 -5
- package/dist/core/supervisor/plan-read.d.ts.map +0 -1
- package/dist/core/supervisor/plan-types.d.ts.map +0 -1
- package/dist/core/supervisor/planning.d.ts +0 -33
- package/dist/core/supervisor/planning.d.ts.map +0 -1
- package/dist/core/supervisor/read.d.ts +0 -6
- package/dist/core/supervisor/read.d.ts.map +0 -1
- package/dist/core/supervisor/read.js +0 -4
- package/dist/core/supervisor/runner.d.ts +0 -37
- package/dist/core/supervisor/runner.d.ts.map +0 -1
- package/dist/core/supervisor/service-read.d.ts +0 -6
- package/dist/core/supervisor/service-read.d.ts.map +0 -1
- package/dist/core/supervisor/service.d.ts +0 -114
- package/dist/core/supervisor/service.d.ts.map +0 -1
- package/dist/core/supervisor/state.d.ts +0 -95
- package/dist/core/supervisor/state.d.ts.map +0 -1
- package/dist/core/workflow/harnesses.d.ts +0 -17
- package/dist/core/workflow/harnesses.d.ts.map +0 -1
- package/dist/core/workflow/harnesses.js +0 -21
- package/dist/core/workflow/journal.d.ts.map +0 -1
- package/src/commands/session.ts +0 -187
- package/src/core/harnesses/index.ts +0 -56
- package/src/core/hooks/harness/detect.ts +0 -30
- package/src/core/supervisor/index.ts +0 -89
- package/src/core/supervisor/plan-api.ts +0 -73
- package/src/core/supervisor/read.ts +0 -59
- package/src/core/workflow/harnesses.ts +0 -33
- /package/dist/core/{harnesses → adapters}/attest-projection.js +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* subprocess.
|
|
4
4
|
*
|
|
5
5
|
* Contract notes (LIVE-VERIFIED 2026-07-16 against codex-cli 0.144.5: flags
|
|
6
|
-
* present, schema-gated triage + text stages round-trip via `--
|
|
6
|
+
* present, schema-gated triage + text stages round-trip via `--adapter codex`):
|
|
7
7
|
* - `codex exec "<prompt>"` is the non-interactive mode.
|
|
8
8
|
* - The final assistant message is captured via `--output-last-message <file>`
|
|
9
9
|
* (a temp file), which is far more drift-tolerant than parsing the
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* - No max-turns equivalent → `maxTurns` is accepted and ignored (documented
|
|
15
15
|
* in the CLI docs page).
|
|
16
16
|
*/
|
|
17
|
-
import type {
|
|
17
|
+
import type { AdapterInvocation, AdapterRawResult } from "../adapters/types.js";
|
|
18
18
|
import type { Spawner, SpawnRequest, SpawnResult } from "./types.js";
|
|
19
|
-
export declare function buildCodexInvocation(req: SpawnRequest, resultFile?: string):
|
|
20
|
-
export declare function normalizeCodexResult(raw:
|
|
19
|
+
export declare function buildCodexInvocation(req: SpawnRequest, resultFile?: string): AdapterInvocation;
|
|
20
|
+
export declare function normalizeCodexResult(raw: AdapterRawResult): SpawnResult;
|
|
21
21
|
export declare const codexSpawner: Spawner;
|
|
22
22
|
//# sourceMappingURL=spawn-codex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn-codex.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/spawn-codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"spawn-codex.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/spawn-codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAKhF,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAErE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,iBAAiB,CA8B9F;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,gBAAgB,GAAG,WAAW,CAwCvE;AAED,eAAO,MAAM,YAAY,EAAE,OA8B1B,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* subprocess.
|
|
4
4
|
*
|
|
5
5
|
* Contract notes (LIVE-VERIFIED 2026-07-16 against codex-cli 0.144.5: flags
|
|
6
|
-
* present, schema-gated triage + text stages round-trip via `--
|
|
6
|
+
* present, schema-gated triage + text stages round-trip via `--adapter codex`):
|
|
7
7
|
* - `codex exec "<prompt>"` is the non-interactive mode.
|
|
8
8
|
* - The final assistant message is captured via `--output-last-message <file>`
|
|
9
9
|
* (a temp file), which is far more drift-tolerant than parsing the
|
|
@@ -19,18 +19,18 @@ import { existsSync, readFileSync, rmSync } from "node:fs";
|
|
|
19
19
|
import { tmpdir } from "node:os";
|
|
20
20
|
import { join } from "node:path";
|
|
21
21
|
import { exec } from "../../lib/exec.js";
|
|
22
|
-
import {
|
|
22
|
+
import { builtinAdapterProfile, validateAdapterEffort } from "../adapters/profiles.js";
|
|
23
|
+
import { notFoundError } from "./adapters.js";
|
|
23
24
|
import { buildChildEnv } from "./child-env.js";
|
|
24
|
-
import { notFoundError } from "./harnesses.js";
|
|
25
25
|
import { resolveSandboxProjection } from "./sandbox-projection.js";
|
|
26
26
|
import { isUpstreamFailureText, vendorFailureText } from "./spawn-failure.js";
|
|
27
27
|
export function buildCodexInvocation(req, resultFile) {
|
|
28
|
-
|
|
28
|
+
validateAdapterEffort("codex", req.effort);
|
|
29
29
|
if (!resultFile)
|
|
30
30
|
throw new Error("codex adapter requires a final-message result file");
|
|
31
31
|
// Default stays workspace-write so an unprojected request is unchanged.
|
|
32
32
|
const projection = req.filesystemPolicy
|
|
33
|
-
? resolveSandboxProjection("codex",
|
|
33
|
+
? resolveSandboxProjection("codex", builtinAdapterProfile("codex")?.sandboxProjection, req.filesystemPolicy)
|
|
34
34
|
: undefined;
|
|
35
35
|
const argv = [
|
|
36
36
|
"codex",
|
|
@@ -105,7 +105,10 @@ export const codexSpawner = async (req) => {
|
|
|
105
105
|
}
|
|
106
106
|
const r = await exec(invocation.argv, {
|
|
107
107
|
cwd: req.cwd,
|
|
108
|
-
env: buildChildEnv(req.runId, {
|
|
108
|
+
env: buildChildEnv(req.runId, {
|
|
109
|
+
subscriptionOnly: req.subscriptionOnly,
|
|
110
|
+
agentId: req.agentId,
|
|
111
|
+
}),
|
|
109
112
|
timeout: req.timeoutMs,
|
|
110
113
|
});
|
|
111
114
|
return normalizeCodexResult({
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Contract notes (LIVE-VERIFIED 2026-07-17 against cursor-agent
|
|
6
6
|
* 2026.07.16-899851b: schema-gated triage + text stages round-trip via
|
|
7
|
-
* `--
|
|
7
|
+
* `--adapter cursor`, session_id parses from the envelope):
|
|
8
8
|
* - `cursor-agent -p "<prompt>" --output-format json` prints a single result
|
|
9
9
|
* envelope modeled on Claude Code's (`{type: "result", is_error, result,
|
|
10
10
|
* session_id, …}`).
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* - No per-run cost surface → undefined. No max-turns equivalent → `maxTurns`
|
|
19
19
|
* accepted and ignored (documented in the CLI docs page).
|
|
20
20
|
*/
|
|
21
|
-
import type {
|
|
21
|
+
import type { AdapterInvocation, AdapterRawResult } from "../adapters/types.js";
|
|
22
22
|
import type { Spawner, SpawnRequest, SpawnResult } from "./types.js";
|
|
23
23
|
/** Exported for unit tests (no live binary to test against). */
|
|
24
24
|
export declare function parseCursorOutput(stdout: string): {
|
|
@@ -26,7 +26,7 @@ export declare function parseCursorOutput(stdout: string): {
|
|
|
26
26
|
sessionId?: string;
|
|
27
27
|
isError: boolean;
|
|
28
28
|
};
|
|
29
|
-
export declare function buildCursorInvocation(req: SpawnRequest):
|
|
30
|
-
export declare function normalizeCursorResult(raw:
|
|
29
|
+
export declare function buildCursorInvocation(req: SpawnRequest): AdapterInvocation;
|
|
30
|
+
export declare function normalizeCursorResult(raw: AdapterRawResult): SpawnResult;
|
|
31
31
|
export declare const cursorSpawner: Spawner;
|
|
32
32
|
//# sourceMappingURL=spawn-cursor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn-cursor.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/spawn-cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"spawn-cursor.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/spawn-cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAKhF,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AASrE,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB,CAWA;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,YAAY,GAAG,iBAAiB,CAkB1E;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,GAAG,WAAW,CAqDxE;AAED,eAAO,MAAM,aAAa,EAAE,OAkB3B,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Contract notes (LIVE-VERIFIED 2026-07-17 against cursor-agent
|
|
6
6
|
* 2026.07.16-899851b: schema-gated triage + text stages round-trip via
|
|
7
|
-
* `--
|
|
7
|
+
* `--adapter cursor`, session_id parses from the envelope):
|
|
8
8
|
* - `cursor-agent -p "<prompt>" --output-format json` prints a single result
|
|
9
9
|
* envelope modeled on Claude Code's (`{type: "result", is_error, result,
|
|
10
10
|
* session_id, …}`).
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
* accepted and ignored (documented in the CLI docs page).
|
|
20
20
|
*/
|
|
21
21
|
import { exec } from "../../lib/exec.js";
|
|
22
|
-
import {
|
|
22
|
+
import { builtinAdapterProfile, validateAdapterEffort } from "../adapters/profiles.js";
|
|
23
|
+
import { notFoundError } from "./adapters.js";
|
|
23
24
|
import { buildChildEnv } from "./child-env.js";
|
|
24
|
-
import { notFoundError } from "./harnesses.js";
|
|
25
25
|
import { resolveSandboxProjection } from "./sandbox-projection.js";
|
|
26
26
|
import { isUpstreamFailureText, vendorFailureText } from "./spawn-failure.js";
|
|
27
27
|
/** Exported for unit tests (no live binary to test against). */
|
|
@@ -39,10 +39,10 @@ export function parseCursorOutput(stdout) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
export function buildCursorInvocation(req) {
|
|
42
|
-
|
|
42
|
+
validateAdapterEffort("cursor", req.effort);
|
|
43
43
|
if (req.filesystemPolicy) {
|
|
44
44
|
// Declared unrepresentable: refuse rather than drop it silently (ADR 0039).
|
|
45
|
-
resolveSandboxProjection("cursor",
|
|
45
|
+
resolveSandboxProjection("cursor", builtinAdapterProfile("cursor")?.sandboxProjection, req.filesystemPolicy);
|
|
46
46
|
}
|
|
47
47
|
// --trust: headless cursor-agent refuses untrusted workspaces (exit 1,
|
|
48
48
|
// "Workspace Trust Required"). --force: a print-mode child has no interactive
|
|
@@ -118,7 +118,10 @@ export const cursorSpawner = async (req) => {
|
|
|
118
118
|
}
|
|
119
119
|
const r = await exec(invocation.argv, {
|
|
120
120
|
cwd: req.cwd,
|
|
121
|
-
env: buildChildEnv(req.runId, {
|
|
121
|
+
env: buildChildEnv(req.runId, {
|
|
122
|
+
subscriptionOnly: req.subscriptionOnly,
|
|
123
|
+
agentId: req.agentId,
|
|
124
|
+
}),
|
|
122
125
|
timeout: req.timeoutMs,
|
|
123
126
|
});
|
|
124
127
|
return normalizeCursorResult({ ...r, durationMs: Date.now() - t0 });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared failure-text extraction for the
|
|
2
|
+
* Shared failure-text extraction for the adapter spawn adapters.
|
|
3
3
|
*
|
|
4
4
|
* A vendor CLI prints its banner, resolved config, and startup warnings first,
|
|
5
5
|
* and the reason it actually failed last. Every adapter used to keep the FIRST
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared failure-text extraction for the
|
|
2
|
+
* Shared failure-text extraction for the adapter spawn adapters.
|
|
3
3
|
*
|
|
4
4
|
* A vendor CLI prints its banner, resolved config, and startup warnings first,
|
|
5
5
|
* and the reason it actually failed last. Every adapter used to keep the FIRST
|
|
@@ -21,7 +21,7 @@ export function normalizeWorkflowSpecialists(input) {
|
|
|
21
21
|
}
|
|
22
22
|
normalized[id] = {
|
|
23
23
|
instructions: bounded(profile.instructions, `workflow specialist ${id} instructions`, MAX_INSTRUCTIONS),
|
|
24
|
-
|
|
24
|
+
adapter: optional(profile.adapter, `workflow specialist ${id} adapter`),
|
|
25
25
|
model: optional(profile.model, `workflow specialist ${id} model`),
|
|
26
26
|
effort: optional(profile.effort, `workflow specialist ${id} effort`),
|
|
27
27
|
maxAttempts: positiveOptional(profile.maxAttempts, `workflow specialist ${id} maxAttempts`, 10),
|
|
@@ -44,7 +44,7 @@ export function resolveSpecialistAssignment(profiles, prompt, opts) {
|
|
|
44
44
|
prompt: `${profile.instructions}\n\nAssignment:\n${prompt}`,
|
|
45
45
|
opts: {
|
|
46
46
|
specialist: opts.specialist,
|
|
47
|
-
|
|
47
|
+
adapter: opts.adapter ?? profile.adapter,
|
|
48
48
|
model: opts.model ?? profile.model,
|
|
49
49
|
effort: opts.effort ?? profile.effort,
|
|
50
50
|
maxAttempts: opts.maxAttempts ?? profile.maxAttempts,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const WORKFLOW_TRANSCRIPT_EVENT_BYTES: number;
|
|
2
2
|
/** Key under which a shrunk record names the fields it had to drop. */
|
|
3
|
-
export declare const
|
|
4
|
-
export interface
|
|
3
|
+
export declare const WORKFLOW_TRANSCRIPT_OMITTED = "omitted_fields";
|
|
4
|
+
export interface WorkflowTranscriptOmission {
|
|
5
5
|
field: string;
|
|
6
6
|
bytes: number;
|
|
7
7
|
sha256: string;
|
|
8
8
|
}
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function workflowTranscriptPath(coordRoot: string, runId: string): string;
|
|
10
10
|
/**
|
|
11
|
-
* Append one
|
|
11
|
+
* Append one transcript record, always.
|
|
12
12
|
*
|
|
13
13
|
* A record that would exceed what a reader accepts has its largest fields
|
|
14
14
|
* replaced by a digest and a byte count until it fits, and it names what it
|
|
@@ -20,11 +20,11 @@ export declare function workflowJournalPath(coordRoot: string, runId: string): s
|
|
|
20
20
|
* this limit by construction. Losing detail from a record is recoverable.
|
|
21
21
|
* Losing the run that was writing it is not.
|
|
22
22
|
*/
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function appendWorkflowTranscriptEvent(coordRoot: string, runId: string, event: string, data: Record<string, unknown>): void;
|
|
24
24
|
/**
|
|
25
25
|
* Shrink a record to the reader's limit by dropping its largest fields first.
|
|
26
26
|
* The envelope is never dropped, so a record keeps its run id, timestamp, and
|
|
27
27
|
* event name however much detail it loses. Exported for tests.
|
|
28
28
|
*/
|
|
29
|
-
export declare function
|
|
30
|
-
//# sourceMappingURL=
|
|
29
|
+
export declare function fitWorkflowTranscriptRecord(envelope: Record<string, unknown>, data: Record<string, unknown>): Record<string, unknown>;
|
|
30
|
+
//# sourceMappingURL=transcript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/transcript.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,+BAA+B,QAAY,CAAC;AAEzD,uEAAuE;AACvE,eAAO,MAAM,2BAA2B,mBAAmB,CAAC;AAI5D,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,IAAI,CAiBN;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoBzB"}
|
|
@@ -2,18 +2,18 @@ import { closeSync, existsSync, fsyncSync, mkdirSync, openSync, writeFileSync }
|
|
|
2
2
|
import { dirname, join, resolve } from "node:path";
|
|
3
3
|
import { fsyncParentDirectory, stableDigest } from "./durable-record.js";
|
|
4
4
|
// Limit for the JSON record body. The trailing newline delimiter is outside the
|
|
5
|
-
// record and is not counted by readers after splitting
|
|
6
|
-
export const
|
|
5
|
+
// record and is not counted by readers after splitting transcript lines.
|
|
6
|
+
export const WORKFLOW_TRANSCRIPT_EVENT_BYTES = 16 * 1024;
|
|
7
7
|
/** Key under which a shrunk record names the fields it had to drop. */
|
|
8
|
-
export const
|
|
8
|
+
export const WORKFLOW_TRANSCRIPT_OMITTED = "omitted_fields";
|
|
9
9
|
const RUN_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,199}$/;
|
|
10
|
-
export function
|
|
10
|
+
export function workflowTranscriptPath(coordRoot, runId) {
|
|
11
11
|
if (!RUN_ID.test(runId))
|
|
12
12
|
throw new Error(`invalid workflow run id ${JSON.stringify(runId)}`);
|
|
13
|
-
return join(resolve(coordRoot), ".harnery", "workflows", runId, "
|
|
13
|
+
return join(resolve(coordRoot), ".harnery", "workflows", runId, "transcript.jsonl");
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Append one
|
|
16
|
+
* Append one transcript record, always.
|
|
17
17
|
*
|
|
18
18
|
* A record that would exceed what a reader accepts has its largest fields
|
|
19
19
|
* replaced by a digest and a byte count until it fits, and it names what it
|
|
@@ -25,9 +25,9 @@ export function workflowJournalPath(coordRoot, runId) {
|
|
|
25
25
|
* this limit by construction. Losing detail from a record is recoverable.
|
|
26
26
|
* Losing the run that was writing it is not.
|
|
27
27
|
*/
|
|
28
|
-
export function
|
|
29
|
-
const path =
|
|
30
|
-
const record =
|
|
28
|
+
export function appendWorkflowTranscriptEvent(coordRoot, runId, event, data) {
|
|
29
|
+
const path = workflowTranscriptPath(coordRoot, runId);
|
|
30
|
+
const record = fitWorkflowTranscriptRecord({ schema_version: 1, run_id: runId, ts: new Date().toISOString(), event }, data);
|
|
31
31
|
const line = `${JSON.stringify(record)}\n`;
|
|
32
32
|
mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
|
|
33
33
|
const existed = existsSync(path);
|
|
@@ -47,9 +47,9 @@ export function appendWorkflowJournalEvent(coordRoot, runId, event, data) {
|
|
|
47
47
|
* The envelope is never dropped, so a record keeps its run id, timestamp, and
|
|
48
48
|
* event name however much detail it loses. Exported for tests.
|
|
49
49
|
*/
|
|
50
|
-
export function
|
|
50
|
+
export function fitWorkflowTranscriptRecord(envelope, data) {
|
|
51
51
|
const candidate = { ...envelope, ...data };
|
|
52
|
-
if (Buffer.byteLength(JSON.stringify(candidate)) <=
|
|
52
|
+
if (Buffer.byteLength(JSON.stringify(candidate)) <= WORKFLOW_TRANSCRIPT_EVENT_BYTES) {
|
|
53
53
|
return candidate;
|
|
54
54
|
}
|
|
55
55
|
const kept = { ...data };
|
|
@@ -60,11 +60,11 @@ export function fitWorkflowJournalRecord(envelope, data) {
|
|
|
60
60
|
for (const { field, bytes } of bySize) {
|
|
61
61
|
omitted.push({ field, bytes, sha256: stableDigest(data[field]) });
|
|
62
62
|
delete kept[field];
|
|
63
|
-
const next = { ...envelope, ...kept, [
|
|
64
|
-
if (Buffer.byteLength(JSON.stringify(next)) <=
|
|
63
|
+
const next = { ...envelope, ...kept, [WORKFLOW_TRANSCRIPT_OMITTED]: omitted };
|
|
64
|
+
if (Buffer.byteLength(JSON.stringify(next)) <= WORKFLOW_TRANSCRIPT_EVENT_BYTES)
|
|
65
65
|
return next;
|
|
66
66
|
}
|
|
67
67
|
// Every field dropped and still over: the omission list is itself the excess.
|
|
68
68
|
// Keep the envelope and a count so the record stays parseable and honest.
|
|
69
|
-
return { ...envelope, [
|
|
69
|
+
return { ...envelope, [WORKFLOW_TRANSCRIPT_OMITTED]: omitted.length };
|
|
70
70
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Workflow engine contracts. A workflow is a small throwaway JS script with
|
|
3
|
-
* bounded, schema-gated stages that fan work out to headless
|
|
3
|
+
* bounded, schema-gated stages that fan work out to headless adapter-CLI
|
|
4
4
|
* subagents; the SCRIPT (deterministic code), not any model, decides routing
|
|
5
5
|
* between stages, and the run always terminates when the script returns.
|
|
6
6
|
*
|
|
@@ -12,7 +12,10 @@ import type { WorkspaceBinding, WorkspaceExecutionEvidence, WorkspaceProvider }
|
|
|
12
12
|
export declare const WORKFLOW_PROOF_SCHEMA_VERSION: 1;
|
|
13
13
|
export declare const WORKFLOW_WORK_CONTEXT_SCHEMA_VERSION: 1;
|
|
14
14
|
export declare const WORKFLOW_ATTEMPT_CONTEXT_SCHEMA_VERSION: 1;
|
|
15
|
-
|
|
15
|
+
/** The evidence vocabulary, as a value so the runtime validator and the
|
|
16
|
+
* pre-flight source scan cannot drift from the type or from each other. */
|
|
17
|
+
export declare const EVIDENCE_KINDS: readonly ["test", "command", "artifact", "change", "review", "observation"];
|
|
18
|
+
export type EvidenceKind = (typeof EVIDENCE_KINDS)[number];
|
|
16
19
|
export type EvidenceStatus = "passed" | "failed" | "observed" | "unknown";
|
|
17
20
|
export type EvidenceSource = "workflow" | "engine";
|
|
18
21
|
export type AcceptanceStatus = "satisfied" | "unsatisfied" | "unknown";
|
|
@@ -67,7 +70,7 @@ export interface WorkflowAgentProof {
|
|
|
67
70
|
label: string;
|
|
68
71
|
stage?: string;
|
|
69
72
|
specialist?: string;
|
|
70
|
-
|
|
73
|
+
adapter: AdapterName;
|
|
71
74
|
model?: string;
|
|
72
75
|
status: "succeeded" | "failed" | "cached";
|
|
73
76
|
attempts: number;
|
|
@@ -105,15 +108,15 @@ export interface WorkflowRepoEvidence {
|
|
|
105
108
|
note?: string;
|
|
106
109
|
};
|
|
107
110
|
}
|
|
108
|
-
/** Bounded pointer to the live attestation backing a
|
|
111
|
+
/** Bounded pointer to the live attestation backing a adapter's claims
|
|
109
112
|
* (ADR 0038). Structural facts only: no prompt text, no host paths. */
|
|
110
|
-
export interface
|
|
113
|
+
export interface AdapterAttestationCitation {
|
|
111
114
|
binary_version: string;
|
|
112
115
|
observed_at: string;
|
|
113
116
|
record_digest: string;
|
|
114
117
|
}
|
|
115
|
-
export interface
|
|
116
|
-
|
|
118
|
+
export interface AdapterEvidenceCoverage {
|
|
119
|
+
adapter: AdapterName;
|
|
117
120
|
tool_evidence: {
|
|
118
121
|
support: "supported" | "partial" | "unsupported" | "unknown";
|
|
119
122
|
note?: string;
|
|
@@ -123,10 +126,10 @@ export interface HarnessEvidenceCoverage {
|
|
|
123
126
|
session_ids: number;
|
|
124
127
|
costs: number;
|
|
125
128
|
};
|
|
126
|
-
/** What backs this
|
|
129
|
+
/** What backs this adapter's capability claims (ADR 0038). Absent when the
|
|
127
130
|
* host recorded no live attestation, which is the common case and is not by
|
|
128
131
|
* itself a proof unknown. */
|
|
129
|
-
attestation?:
|
|
132
|
+
attestation?: AdapterAttestationCitation;
|
|
130
133
|
}
|
|
131
134
|
export interface WorkflowSandboxProjectionEvidence {
|
|
132
135
|
mode: SpawnFilesystemPolicy["mode"];
|
|
@@ -135,9 +138,9 @@ export interface WorkflowSandboxProjectionEvidence {
|
|
|
135
138
|
git_grant: GitAdministrativeGrant;
|
|
136
139
|
}
|
|
137
140
|
export interface WorkflowProofUnknown {
|
|
138
|
-
code: "tool_evidence_unavailable" | "
|
|
141
|
+
code: "tool_evidence_unavailable" | "adapter_capability_unregistered" | "agent_cost_unreported" | "agent_session_unreported" | "repository_drift_incomplete";
|
|
139
142
|
message: string;
|
|
140
|
-
|
|
143
|
+
adapter?: AdapterName;
|
|
141
144
|
agent_id?: string;
|
|
142
145
|
}
|
|
143
146
|
export interface WorkflowProof {
|
|
@@ -157,11 +160,16 @@ export interface WorkflowProof {
|
|
|
157
160
|
error?: string;
|
|
158
161
|
result?: ResultDigest;
|
|
159
162
|
/** Set on a failed run that was uninformative about the work (ADR 0046):
|
|
160
|
-
* environment or
|
|
161
|
-
* produced a result;
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
|
|
163
|
+
* environment, upstream, or decision. The first two are derived from the
|
|
164
|
+
* agents' classes when no agent produced a result; `decision` is declared by
|
|
165
|
+
* the script through ctx.blocked(). Absent ⇒ the attempt is charged as
|
|
166
|
+
* before. The durable work projection reads this to decide charging,
|
|
167
|
+
* stopping, and the uncharged-attempt bound. */
|
|
168
|
+
class?: RunFailureClass;
|
|
169
|
+
/** Docket id of the decision this run stopped on. Only ever set alongside
|
|
170
|
+
* class "decision", and only when the script named one. Carried so the work
|
|
171
|
+
* projection can point a human at the exact question rather than at prose. */
|
|
172
|
+
decision_id?: string;
|
|
165
173
|
};
|
|
166
174
|
acceptance: {
|
|
167
175
|
criteria: AcceptanceResult[];
|
|
@@ -177,11 +185,11 @@ export interface WorkflowProof {
|
|
|
177
185
|
* Absent means no projection was applied, which is the default. Present means
|
|
178
186
|
* the run can be audited for exactly what its children could write. */
|
|
179
187
|
sandbox_projection?: WorkflowSandboxProjectionEvidence;
|
|
180
|
-
|
|
188
|
+
adapters: AdapterEvidenceCoverage[];
|
|
181
189
|
unknowns: WorkflowProofUnknown[];
|
|
182
190
|
integrity: {
|
|
183
|
-
|
|
184
|
-
path: "
|
|
191
|
+
transcript: {
|
|
192
|
+
path: "transcript.jsonl";
|
|
185
193
|
sha256: string;
|
|
186
194
|
bytes: number;
|
|
187
195
|
};
|
|
@@ -202,8 +210,8 @@ export interface WorkflowPolicyProof {
|
|
|
202
210
|
total: number;
|
|
203
211
|
};
|
|
204
212
|
}
|
|
205
|
-
export interface
|
|
206
|
-
toolEvidence:
|
|
213
|
+
export interface AdapterEvidenceCapability {
|
|
214
|
+
toolEvidence: AdapterEvidenceCoverage["tool_evidence"];
|
|
207
215
|
}
|
|
208
216
|
/** JSON-schema *subset* accepted by stage gates (see validate.ts). */
|
|
209
217
|
export interface StageSchema {
|
|
@@ -233,34 +241,34 @@ export interface AgentOpts {
|
|
|
233
241
|
* validate; the engine retries with the validation error appended, up to
|
|
234
242
|
* `maxAttempts`. Without it, `agent()` resolves to the raw reply text. */
|
|
235
243
|
schema?: StageSchema;
|
|
236
|
-
/** Model slug passed through to the
|
|
244
|
+
/** Model slug passed through to the adapter CLI (default: the CLI's default). */
|
|
237
245
|
model?: string;
|
|
238
|
-
/** Reasoning effort mapped through the selected
|
|
246
|
+
/** Reasoning effort mapped through the selected adapter profile. Unsupported
|
|
239
247
|
* values fail before the vendor process starts. */
|
|
240
248
|
effort?: string;
|
|
241
249
|
/** Attempt ceiling for the schema-retry loop (default 2). */
|
|
242
250
|
maxAttempts?: number;
|
|
243
251
|
/** Subprocess timeout ms (default 300_000). */
|
|
244
252
|
timeoutMs?: number;
|
|
245
|
-
/**
|
|
253
|
+
/** Adapter-turn ceiling for the child (default 25; use 1 for pure
|
|
246
254
|
* classification stages — cheaper and faster). */
|
|
247
255
|
maxTurns?: number;
|
|
248
|
-
/** Display label in the
|
|
256
|
+
/** Display label in the transcript (default: prompt head). */
|
|
249
257
|
label?: string;
|
|
250
|
-
/** Which
|
|
251
|
-
* Mixed-
|
|
258
|
+
/** Which adapter runs this agent (default: the run's default adapter).
|
|
259
|
+
* Mixed-adapter workflows are legal: triage on one CLI, deep work on
|
|
252
260
|
* another. */
|
|
253
|
-
|
|
261
|
+
adapter?: AdapterName;
|
|
254
262
|
}
|
|
255
263
|
/** Open registry key. The built-in catalog currently contains Claude Code,
|
|
256
264
|
* Codex, and Cursor; consumers may register another adapter without widening
|
|
257
265
|
* a package-owned union first. */
|
|
258
|
-
export type
|
|
259
|
-
/** Durable role defaults supplied by a goal
|
|
266
|
+
export type AdapterName = string;
|
|
267
|
+
/** Durable role defaults supplied by a goal governor or embedding host.
|
|
260
268
|
* Profiles are frozen into a workflow run manifest before the first spawn. */
|
|
261
269
|
export interface WorkflowSpecialistProfile {
|
|
262
270
|
instructions: string;
|
|
263
|
-
|
|
271
|
+
adapter?: AdapterName;
|
|
264
272
|
model?: string;
|
|
265
273
|
effort?: string;
|
|
266
274
|
maxAttempts?: number;
|
|
@@ -279,12 +287,29 @@ export interface WorkflowSpecialistProfile {
|
|
|
279
287
|
* Uncharged, but retry stays available (bounded by max_uncharged_attempts).
|
|
280
288
|
*/
|
|
281
289
|
export type SpawnFailureClass = "environment" | "upstream";
|
|
290
|
+
/**
|
|
291
|
+
* Why a failed run was uninformative about the work. A superset of
|
|
292
|
+
* {@link SpawnFailureClass}: a spawn can fail for reasons outside the work, and
|
|
293
|
+
* so can the script itself.
|
|
294
|
+
*
|
|
295
|
+
* - `decision`: the script reached a correct conclusion and that conclusion is
|
|
296
|
+
* that a human must rule before the work can proceed. Nothing about the work
|
|
297
|
+
* was wrong, so the attempt is uncharged; nothing about a retry can help,
|
|
298
|
+
* because the blocker is a person, so the item stops and names the decision.
|
|
299
|
+
*
|
|
300
|
+
* This class exists because without it a correct refusal and a botched attempt
|
|
301
|
+
* are the same outcome to the engine. Automatic retry then re-issues work an
|
|
302
|
+
* agent already answered correctly, once per attempt budget, and the answer is
|
|
303
|
+
* identical every time — the loop cannot converge, because the thing it is
|
|
304
|
+
* waiting for is a person who was never told.
|
|
305
|
+
*/
|
|
306
|
+
export type RunFailureClass = SpawnFailureClass | "decision";
|
|
282
307
|
/** What a spawn adapter returns for one subagent run. */
|
|
283
308
|
export interface SpawnResult {
|
|
284
309
|
ok: boolean;
|
|
285
310
|
/** The model's final reply text (envelope-unwrapped). */
|
|
286
311
|
text: string;
|
|
287
|
-
/** Child
|
|
312
|
+
/** Child adapter session id when the envelope carries one. */
|
|
288
313
|
sessionId?: string;
|
|
289
314
|
costUsd?: number;
|
|
290
315
|
durationMs: number;
|
|
@@ -304,6 +329,10 @@ export interface SpawnRequest {
|
|
|
304
329
|
/** Run id, stamped into the child env (HARNERY_WORKFLOW_RUN_ID) so the
|
|
305
330
|
* coord layer can associate child sessions with their workflow run. */
|
|
306
331
|
runId?: string;
|
|
332
|
+
/** Transcript agent id (`a1`, `a2`, …), stamped into the child env
|
|
333
|
+
* (HARNERY_WORKFLOW_AGENT_ID) so in-flight child activity attributes to one
|
|
334
|
+
* agent row rather than only to the run. */
|
|
335
|
+
agentId?: string;
|
|
307
336
|
/** Scrub all API-key vars from the child env so it can only authenticate
|
|
308
337
|
* via its stored (subscription) login. See billing.ts. */
|
|
309
338
|
subscriptionOnly?: boolean;
|
|
@@ -349,14 +378,32 @@ export interface WorkflowContext {
|
|
|
349
378
|
agent: (prompt: string, opts?: AgentOpts) => Promise<unknown>;
|
|
350
379
|
/** Run thunks with bounded concurrency; a rejected thunk resolves to null. */
|
|
351
380
|
parallel: <T>(thunks: Array<() => Promise<T>>) => Promise<Array<T | null>>;
|
|
352
|
-
/** Declare the current stage (
|
|
381
|
+
/** Declare the current stage (transcript + progress grouping). */
|
|
353
382
|
stage: (title: string) => void;
|
|
354
|
-
/** Narrate progress (stderr +
|
|
383
|
+
/** Narrate progress (stderr + transcript). */
|
|
355
384
|
log: (message: string) => void;
|
|
356
385
|
/** Attach a bounded, sourced receipt to the run and optional acceptance criteria. */
|
|
357
386
|
evidence: (input: WorkflowEvidenceInput) => string;
|
|
358
387
|
/** Authorize one host-mediated external mutation before performing it. */
|
|
359
388
|
authorize: (input: ExternalMutationRequest) => Promise<PolicyDecision>;
|
|
389
|
+
/** Stop the run because a human must rule before the work can proceed.
|
|
390
|
+
*
|
|
391
|
+
* This is not a failure and must not be used as one. Reach for it only when
|
|
392
|
+
* the script determined something *correct* — that the question in front of
|
|
393
|
+
* it belongs to a person. The run ends uncharged and the work item stops
|
|
394
|
+
* naming the decision, so no automatic retry re-issues work that was already
|
|
395
|
+
* answered correctly. A plain `throw` means the opposite: the work failed and
|
|
396
|
+
* a retry might do better. */
|
|
397
|
+
blocked: (input: BlockedInput) => never;
|
|
398
|
+
}
|
|
399
|
+
/** Why a run stopped on a human. */
|
|
400
|
+
export interface BlockedInput {
|
|
401
|
+
/** What a human has to settle, in one sentence. Shown verbatim to the
|
|
402
|
+
* operator as the work item's reason, so write it for them, not for a log. */
|
|
403
|
+
reason: string;
|
|
404
|
+
/** Docket id of the decision to resolve. Strongly preferred: without it the
|
|
405
|
+
* operator gets prose and has to go find the question themselves. */
|
|
406
|
+
decision?: string;
|
|
360
407
|
}
|
|
361
408
|
export interface WorkflowMeta {
|
|
362
409
|
name: string;
|
|
@@ -408,18 +455,18 @@ export interface WorkflowOperatorFinding {
|
|
|
408
455
|
readonly statement: string;
|
|
409
456
|
}
|
|
410
457
|
export interface EngineOpts {
|
|
411
|
-
/** Repo root whose .harnery/ receives the run
|
|
458
|
+
/** Repo root whose .harnery/ receives the run transcript. */
|
|
412
459
|
coordRoot: string;
|
|
413
|
-
/** Spawner registry keyed by
|
|
414
|
-
* entry and names it in `
|
|
415
|
-
spawners: Readonly<Record<
|
|
416
|
-
/**
|
|
417
|
-
|
|
460
|
+
/** Spawner registry keyed by adapter. A single-adapter caller registers one
|
|
461
|
+
* entry and names it in `defaultAdapter`. */
|
|
462
|
+
spawners: Readonly<Record<AdapterName, Spawner | undefined>>;
|
|
463
|
+
/** Adapter used when an agent() call doesn't name one (default "claude-code"). */
|
|
464
|
+
defaultAdapter?: AdapterName;
|
|
418
465
|
/** Named specialist roles available to agent(..., { specialist }). */
|
|
419
466
|
specialists?: Readonly<Record<string, WorkflowSpecialistProfile>>;
|
|
420
|
-
/** Resume: run id of a prior run whose
|
|
467
|
+
/** Resume: run id of a prior run whose transcript supplies cached results.
|
|
421
468
|
* agent() calls whose (stage, prompt, model, maxTurns, schema) key matches a
|
|
422
|
-
* completed prior agent return the
|
|
469
|
+
* completed prior agent return the transcripted result without spawning. */
|
|
423
470
|
resumeFrom?: string;
|
|
424
471
|
/** Continue a parked run in its original directory after its durable
|
|
425
472
|
* approval has been resolved. The frozen run manifest supplies execution
|
|
@@ -444,7 +491,7 @@ export interface EngineOpts {
|
|
|
444
491
|
/** Progress sink (default: process.stderr). */
|
|
445
492
|
onLog?: (line: string) => void;
|
|
446
493
|
/** Guarantee subscription billing: API-key vars are scrubbed from every
|
|
447
|
-
* child env, and a
|
|
494
|
+
* child env, and a adapter whose stored login is provably absent fails
|
|
448
495
|
* loud before spawning. */
|
|
449
496
|
subscriptionOnly?: boolean;
|
|
450
497
|
/** Permit the api-key-override billing state (an exported API key silently
|
|
@@ -456,10 +503,10 @@ export interface EngineOpts {
|
|
|
456
503
|
probeBilling?: BillingProber;
|
|
457
504
|
/** Capability claims used to state whether adapter-native tool evidence was
|
|
458
505
|
* available. Missing claims remain unknown. */
|
|
459
|
-
|
|
460
|
-
/** Live attestations backing each
|
|
506
|
+
adapterEvidence?: Readonly<Record<AdapterName, AdapterEvidenceCapability | undefined>>;
|
|
507
|
+
/** Live attestations backing each adapter's claims (ADR 0038). Read once by
|
|
461
508
|
* the host and injected, so the engine performs no capability lookups. */
|
|
462
|
-
|
|
509
|
+
adapterAttestations?: Readonly<Record<AdapterName, AdapterAttestationCitation | undefined>>;
|
|
463
510
|
/** Filesystem policy projected into every child's own vendor sandbox
|
|
464
511
|
* (ADR 0039). Validated against the workspace binding before the first spawn,
|
|
465
512
|
* and recorded in proof. Absent leaves every adapter invocation unchanged. */
|
|
@@ -490,7 +537,7 @@ export interface EngineOpts {
|
|
|
490
537
|
approvalAddressee?: string;
|
|
491
538
|
/** Execution boundary created by the host (default shared). */
|
|
492
539
|
isolation?: PolicyIsolation;
|
|
493
|
-
/** Network state of spawned
|
|
540
|
+
/** Network state of spawned adapter subprocesses (default unknown). */
|
|
494
541
|
networkAccess?: PolicyNetworkAccess;
|
|
495
542
|
/** Explicit provider and host-owned roots. Omit for shared or declaration-only execution. */
|
|
496
543
|
workspace?: {
|
|
@@ -505,20 +552,20 @@ export interface RunReport {
|
|
|
505
552
|
/** What the script's default export returned. */
|
|
506
553
|
result: unknown;
|
|
507
554
|
agentsSpawned: number;
|
|
508
|
-
/** agent() calls satisfied from the resumeFrom
|
|
555
|
+
/** agent() calls satisfied from the resumeFrom transcript without spawning. */
|
|
509
556
|
agentsCached: number;
|
|
510
557
|
costUsd: number;
|
|
511
558
|
durationMs: number;
|
|
512
|
-
|
|
559
|
+
transcriptPath: string;
|
|
513
560
|
proofPath: string;
|
|
514
561
|
acceptance: AcceptanceSummary;
|
|
515
562
|
/** Estimated tokens of repo instructions (CLAUDE.md/AGENTS.md at the child
|
|
516
563
|
* cwd) that EVERY child cache-writes on spawn — the fixed per-child context
|
|
517
564
|
* overhead a fan-out multiplies. bytes/4 heuristic; 0 when no such file. */
|
|
518
565
|
contextTokensPerChildEstimate: number;
|
|
519
|
-
/** Billing mode per
|
|
566
|
+
/** Billing mode per adapter actually used this run (probed on first use). */
|
|
520
567
|
billing: Array<{
|
|
521
|
-
|
|
568
|
+
adapter: AdapterName;
|
|
522
569
|
mode: BillingMode;
|
|
523
570
|
}>;
|
|
524
571
|
/** Policy verdict totals when the host supplied a policy. */
|