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
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
|
+
import { adapterProofInputs, createBuiltinAdapterRegistry, probeBinaryVersion, } from "../core/adapters/index.js";
|
|
3
4
|
import { resolveBinName, workflowSubscriptionOnly } from "../core/config.js";
|
|
4
|
-
import { createBuiltinHarnessRegistry, harnessProofInputs, probeBinaryVersion, } from "../core/harnesses/index.js";
|
|
5
5
|
import { findCoordRoot } from "../core/hooks/resolve/coord-root.js";
|
|
6
6
|
import { loadPolicyFile } from "../core/policy/index.js";
|
|
7
7
|
import { WorkflowParkedError } from "../core/workflow/engine.js";
|
|
8
8
|
export function registerWorkflowCommand(program, emit) {
|
|
9
|
-
const registry =
|
|
10
|
-
const
|
|
9
|
+
const registry = createBuiltinAdapterRegistry();
|
|
10
|
+
const adapters = registry.ids();
|
|
11
11
|
const workflow = program
|
|
12
|
-
.command("
|
|
13
|
-
.description("
|
|
12
|
+
.command("run")
|
|
13
|
+
.description("Execute one bounded, schema-gated multi-subagent script. Subagents spawn as headless " +
|
|
14
|
+
"adapter-CLI subprocesses, born coordination-registered.")
|
|
15
|
+
// An option has to bind to whichever command name precedes it, so that a
|
|
16
|
+
// subcommand's own --policy / --json reach the subcommand and not `run`.
|
|
17
|
+
.enablePositionalOptions();
|
|
18
|
+
// Executing a script is `run`'s default, so `harn run ./wf.js` works with no
|
|
19
|
+
// second verb. It has to be a real (hidden) subcommand rather than an action
|
|
20
|
+
// on `run` itself: `run` and several of its subcommands declare the same
|
|
21
|
+
// option names, and a parent-level declaration swallows the child's copy.
|
|
14
22
|
workflow
|
|
15
|
-
.command("
|
|
16
|
-
.description("
|
|
17
|
-
"Subagents spawn as headless harness-CLI subprocesses, coordination-registered.")
|
|
23
|
+
.command("script <script>", { isDefault: true, hidden: true })
|
|
24
|
+
.description("Workflow script (plain JS: `export default async ({agent, parallel, stage, log, evidence, authorize}) => …`)")
|
|
18
25
|
.option("--max-agents <n>", "Total-agent ceiling for the run (default 50)")
|
|
19
26
|
.option("--concurrency <n>", "Concurrent-subagent cap (default 4)")
|
|
20
27
|
.option("--cwd <dir>", "Working directory children spawn in (default: coord root)")
|
|
21
|
-
.option("--
|
|
22
|
-
.option("--resume-from <run-id>", "Reuse completed agent results from a prior run's
|
|
28
|
+
.option("--adapter <name>", `Default adapter for agent() calls: ${adapters.join(" | ")} (default claude-code); scripts can override per agent via opts.adapter`)
|
|
29
|
+
.option("--resume-from <run-id>", "Reuse completed agent results from a prior run's transcript; only changed/failed calls re-run")
|
|
23
30
|
.option("--subscription-only", "Guarantee subscription billing: scrub API-key vars from child envs; fail loud when a " +
|
|
24
|
-
"
|
|
31
|
+
"adapter has no stored login (repo default via config.jsonc workflow.subscriptionOnly)")
|
|
25
32
|
.option("--allow-api-billing", "Permit an exported API key to override a stored subscription login (per-token billing); " +
|
|
26
33
|
"without this the engine refuses that silent-override state")
|
|
27
34
|
.option("--policy <file>", "Host policy JSON/JSONC applied before dispatch and external mutation")
|
|
@@ -38,10 +45,10 @@ export function registerWorkflowCommand(program, emit) {
|
|
|
38
45
|
});
|
|
39
46
|
process.exit(1);
|
|
40
47
|
}
|
|
41
|
-
if (opts.
|
|
48
|
+
if (opts.adapter && !registry.get(opts.adapter)) {
|
|
42
49
|
emit.error({
|
|
43
|
-
code: "
|
|
44
|
-
message: `unknown
|
|
50
|
+
code: "bad_adapter",
|
|
51
|
+
message: `unknown adapter "${opts.adapter}" (expected: ${adapters.join(" | ")})`,
|
|
45
52
|
});
|
|
46
53
|
process.exit(1);
|
|
47
54
|
}
|
|
@@ -81,20 +88,20 @@ export function registerWorkflowCommand(program, emit) {
|
|
|
81
88
|
const report = await runWorkflow(script, {
|
|
82
89
|
coordRoot,
|
|
83
90
|
spawners: registry.spawners(),
|
|
84
|
-
|
|
91
|
+
defaultAdapter: opts.adapter,
|
|
85
92
|
resumeFrom: opts.resumeFrom,
|
|
86
93
|
subscriptionOnly,
|
|
87
94
|
allowApiBilling: opts.allowApiBilling,
|
|
88
95
|
maxAgents: opts.maxAgents ? Number.parseInt(opts.maxAgents, 10) : undefined,
|
|
89
96
|
concurrency: opts.concurrency ? Number.parseInt(opts.concurrency, 10) : undefined,
|
|
90
97
|
cwd: opts.cwd,
|
|
91
|
-
...
|
|
98
|
+
...adapterProofInputs(registry.list().map((adapter) => adapter.profile), { versionProbe: probeBinaryVersion }),
|
|
92
99
|
policy: opts.policy ? loadPolicyFile(opts.policy) : undefined,
|
|
93
100
|
approvalMode: "park",
|
|
94
101
|
approvalAddressee: opts.approvalTo,
|
|
95
102
|
isolation: opts.isolation,
|
|
96
103
|
workspace,
|
|
97
|
-
// CLI
|
|
104
|
+
// CLI adapter subprocesses inherit the host network. A policy that
|
|
98
105
|
// forbids network must therefore deny dispatch unless a future host
|
|
99
106
|
// adapter creates and declares a network-disabled boundary.
|
|
100
107
|
networkAccess: "enabled",
|
|
@@ -106,13 +113,13 @@ export function registerWorkflowCommand(program, emit) {
|
|
|
106
113
|
}
|
|
107
114
|
const cachedPart = report.agentsCached > 0 ? ` (+${report.agentsCached} cached)` : "";
|
|
108
115
|
const billingPart = report.billing.length
|
|
109
|
-
? `billing: ${report.billing.map((b) => `${b.
|
|
116
|
+
? `billing: ${report.billing.map((b) => `${b.adapter}=${b.mode}`).join(", ")}\n`
|
|
110
117
|
: "";
|
|
111
118
|
emit.text(`run ${report.runId} (${report.name}) finished: ${report.agentsSpawned} agent(s)${cachedPart}, ` +
|
|
112
119
|
`$${report.costUsd.toFixed(4)}, ${Math.round(report.durationMs / 1000)}s\n${billingPart}` +
|
|
113
120
|
`acceptance: ${report.acceptance.satisfied} satisfied, ${report.acceptance.unsatisfied} unsatisfied, ` +
|
|
114
121
|
`${report.acceptance.unknown} unknown\n` +
|
|
115
|
-
`
|
|
122
|
+
`transcript: ${report.transcriptPath}\n` +
|
|
116
123
|
`proof: ${report.proofPath}\n` +
|
|
117
124
|
`result: ${typeof report.result === "string" ? report.result : JSON.stringify(report.result, null, 2)}\n`);
|
|
118
125
|
}
|
|
@@ -124,12 +131,12 @@ export function registerWorkflowCommand(program, emit) {
|
|
|
124
131
|
status: "parked",
|
|
125
132
|
runId: err.runId,
|
|
126
133
|
approvalId: err.approvalId,
|
|
127
|
-
|
|
134
|
+
transcriptPath: err.transcriptPath,
|
|
128
135
|
});
|
|
129
136
|
}
|
|
130
137
|
else {
|
|
131
138
|
emit.text(`run ${err.runId} parked\napproval: ${err.approvalId}\n` +
|
|
132
|
-
`
|
|
139
|
+
`transcript: ${err.transcriptPath}\n` +
|
|
133
140
|
`resume after resolution: ${resolveBinName()} workflow resume ${err.runId}\n`);
|
|
134
141
|
}
|
|
135
142
|
return;
|
|
@@ -174,7 +181,7 @@ export function registerWorkflowCommand(program, emit) {
|
|
|
174
181
|
writableRoots: [binding.writable_root.configured],
|
|
175
182
|
}
|
|
176
183
|
: undefined,
|
|
177
|
-
...
|
|
184
|
+
...adapterProofInputs(registry.list().map((adapter) => adapter.profile), { versionProbe: probeBinaryVersion }),
|
|
178
185
|
});
|
|
179
186
|
if (opts.json) {
|
|
180
187
|
emit.config({ format: "json" });
|
|
@@ -186,7 +193,7 @@ export function registerWorkflowCommand(program, emit) {
|
|
|
186
193
|
`$${report.costUsd.toFixed(4)}, ${Math.round(report.durationMs / 1000)}s\n` +
|
|
187
194
|
`acceptance: ${report.acceptance.satisfied} satisfied, ${report.acceptance.unsatisfied} unsatisfied, ` +
|
|
188
195
|
`${report.acceptance.unknown} unknown\n` +
|
|
189
|
-
`
|
|
196
|
+
`transcript: ${report.transcriptPath}\nproof: ${report.proofPath}\n` +
|
|
190
197
|
`result: ${typeof report.result === "string" ? report.result : JSON.stringify(report.result, null, 2)}\n`);
|
|
191
198
|
}
|
|
192
199
|
catch (err) {
|
|
@@ -197,12 +204,12 @@ export function registerWorkflowCommand(program, emit) {
|
|
|
197
204
|
status: "parked",
|
|
198
205
|
runId: err.runId,
|
|
199
206
|
approvalId: err.approvalId,
|
|
200
|
-
|
|
207
|
+
transcriptPath: err.transcriptPath,
|
|
201
208
|
});
|
|
202
209
|
}
|
|
203
210
|
else {
|
|
204
211
|
emit.text(`run ${err.runId} parked again\napproval: ${err.approvalId}\n` +
|
|
205
|
-
`
|
|
212
|
+
`transcript: ${err.transcriptPath}\n`);
|
|
206
213
|
}
|
|
207
214
|
return;
|
|
208
215
|
}
|
|
@@ -523,9 +530,9 @@ export function registerWorkflowCommand(program, emit) {
|
|
|
523
530
|
process.exit(1);
|
|
524
531
|
}
|
|
525
532
|
});
|
|
526
|
-
const approvals =
|
|
527
|
-
.command("
|
|
528
|
-
.description("Inspect and resolve durable
|
|
533
|
+
const approvals = program
|
|
534
|
+
.command("approval")
|
|
535
|
+
.description("Inspect and resolve durable run-policy approvals.");
|
|
529
536
|
approvals
|
|
530
537
|
.command("list")
|
|
531
538
|
.description("List durable workflow approvals.")
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* rule the main attestation applies to a failed turn.
|
|
18
18
|
*/
|
|
19
19
|
import type { SpawnRequest, SpawnResult } from "../workflow/types.js";
|
|
20
|
-
import type {
|
|
20
|
+
import type { Adapter } from "./types.js";
|
|
21
21
|
export declare function projectionPrompt(sentinel: string): string;
|
|
22
22
|
export type ProjectionObservation = "supported" | "unsupported" | "inconclusive";
|
|
23
23
|
export interface ProjectionProbeResult {
|
|
@@ -40,5 +40,5 @@ export interface ProjectionProbeOptions {
|
|
|
40
40
|
* probe that cannot reach a verdict degrades into "nothing recorded" instead of
|
|
41
41
|
* failing the whole attestation sweep.
|
|
42
42
|
*/
|
|
43
|
-
export declare function probeFilesystemProjection(adapter:
|
|
43
|
+
export declare function probeFilesystemProjection(adapter: Adapter, opts: ProjectionProbeOptions): Promise<ProjectionProbeResult>;
|
|
44
44
|
//# sourceMappingURL=attest-projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attest-projection.d.ts","sourceRoot":"","sources":["../../../src/core/adapters/attest-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAW1C,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAEjF,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,qBAAqB,CAAC;IACnC,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,+DAA+D;IAC/D,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IACxD,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,qBAAqB,CAAC,CAoDhC"}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The opt-in live probe that produces an attestation (ADR 0038).
|
|
3
3
|
*
|
|
4
|
-
* One bounded turn per
|
|
4
|
+
* One bounded turn per adapter, through the same `spawn` the workflow engine
|
|
5
5
|
* uses, so what gets attested is the path production takes rather than a
|
|
6
6
|
* parallel test rig.
|
|
7
7
|
*/
|
|
8
8
|
import type { SpawnResult } from "../workflow/types.js";
|
|
9
9
|
import { probeFilesystemProjection } from "./attest-projection.js";
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
10
|
+
import type { AdapterAttestation, AttestableDimension } from "./attestation.js";
|
|
11
|
+
import type { AdapterRegistry } from "./registry.js";
|
|
12
|
+
import type { AdapterId, CapabilitySupport } from "./types.js";
|
|
13
13
|
/** Fixed and content-free, so nothing user-supplied can reach the record and
|
|
14
14
|
* the turn stays as cheap as a turn can be. */
|
|
15
15
|
export declare const ATTESTATION_PROMPT = "Reply with the single word: ok";
|
|
16
16
|
export declare const DEFAULT_ATTESTATION_TIMEOUT_MS = 120000;
|
|
17
17
|
export type AttestationOutcome = "recorded" | "skipped" | "unreachable" | "failed";
|
|
18
|
-
export interface
|
|
19
|
-
|
|
18
|
+
export interface AdapterAttestationResult {
|
|
19
|
+
adapter: AdapterId;
|
|
20
20
|
outcome: AttestationOutcome;
|
|
21
21
|
binaryVersion?: string;
|
|
22
22
|
observations?: Partial<Record<AttestableDimension, CapabilitySupport>>;
|
|
23
23
|
durationMs?: number;
|
|
24
24
|
note: string;
|
|
25
25
|
}
|
|
26
|
-
export interface
|
|
26
|
+
export interface AdapterAttestationReport {
|
|
27
27
|
generatedAt: string;
|
|
28
|
-
|
|
29
|
-
results:
|
|
28
|
+
adapters: AdapterId[];
|
|
29
|
+
results: AdapterAttestationResult[];
|
|
30
30
|
recorded: number;
|
|
31
|
-
/** True when at least one selected
|
|
31
|
+
/** True when at least one selected adapter could not be attested, so a
|
|
32
32
|
* caller can tell a partial sweep from a complete one. */
|
|
33
33
|
incomplete: boolean;
|
|
34
34
|
}
|
|
35
|
-
export interface
|
|
36
|
-
|
|
35
|
+
export interface RunAdapterAttestationOptions {
|
|
36
|
+
adapters?: readonly string[];
|
|
37
37
|
timeoutMs?: number;
|
|
38
38
|
cwd?: string;
|
|
39
39
|
coordRoot?: string;
|
|
@@ -45,12 +45,12 @@ export interface RunHarnessAttestationOptions {
|
|
|
45
45
|
/** Test seam and alternate host probe. A null version means unavailable. */
|
|
46
46
|
versionProbe?: (binary: string) => string | null;
|
|
47
47
|
/** Test seam. Defaults to the adapter's production spawner. */
|
|
48
|
-
spawn?: (
|
|
48
|
+
spawn?: (adapter: AdapterId, prompt: string, timeoutMs: number) => Promise<SpawnResult>;
|
|
49
49
|
/** Test seam. Defaults to writing under the coord root. */
|
|
50
|
-
persist?: (record:
|
|
50
|
+
persist?: (record: AdapterAttestation) => void;
|
|
51
51
|
/**
|
|
52
52
|
* Also probe `filesystemPolicyProjection` (ADR 0041). Off by default because
|
|
53
|
-
* it costs two extra turns per capable
|
|
53
|
+
* it costs two extra turns per capable adapter, against one for everything
|
|
54
54
|
* else: the observation needs a control run to be readable at all.
|
|
55
55
|
*/
|
|
56
56
|
projection?: boolean;
|
|
@@ -58,5 +58,5 @@ export interface RunHarnessAttestationOptions {
|
|
|
58
58
|
probeProjection?: typeof probeFilesystemProjection;
|
|
59
59
|
now?: () => Date;
|
|
60
60
|
}
|
|
61
|
-
export declare function
|
|
61
|
+
export declare function runAdapterAttestation(registry: AdapterRegistry, opts?: RunAdapterAttestationOptions): Promise<AdapterAttestationReport>;
|
|
62
62
|
//# sourceMappingURL=attest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attest.d.ts","sourceRoot":"","sources":["../../../src/core/adapters/attest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQhF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/D;+CAC+C;AAC/C,eAAO,MAAM,kBAAkB,mCAAmC,CAAC;AAEnE,eAAO,MAAM,8BAA8B,SAAU,CAAC;AAqBtD,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,QAAQ,CAAC;AAEnF,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB;8DAC0D;IAC1D,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;mDAG+C;IAC/C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACjD,+DAA+D;IAC/D,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IACxF,2DAA2D;IAC3D,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0CAA0C;IAC1C,eAAe,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACnD,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,eAAe,EACzB,IAAI,GAAE,4BAAiC,GACtC,OAAO,CAAC,wBAAwB,CAAC,CAyGnC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The opt-in live probe that produces an attestation (ADR 0038).
|
|
3
3
|
*
|
|
4
|
-
* One bounded turn per
|
|
4
|
+
* One bounded turn per adapter, through the same `spawn` the workflow engine
|
|
5
5
|
* uses, so what gets attested is the path production takes rather than a
|
|
6
6
|
* parallel test rig.
|
|
7
7
|
*/
|
|
@@ -31,8 +31,8 @@ function boundedReason(reason) {
|
|
|
31
31
|
? `…${collapsed.slice(-MAX_NOTE_REASON_CHARS)}`
|
|
32
32
|
: collapsed;
|
|
33
33
|
}
|
|
34
|
-
export async function
|
|
35
|
-
const ids = opts.
|
|
34
|
+
export async function runAdapterAttestation(registry, opts = {}) {
|
|
35
|
+
const ids = opts.adapters?.length ? [...opts.adapters] : registry.ids();
|
|
36
36
|
const timeoutMs = opts.timeoutMs ?? DEFAULT_ATTESTATION_TIMEOUT_MS;
|
|
37
37
|
const cwd = opts.cwd ?? process.cwd();
|
|
38
38
|
const subscriptionOnly = opts.subscriptionOnly === true;
|
|
@@ -44,7 +44,7 @@ export async function runHarnessAttestation(registry, opts = {}) {
|
|
|
44
44
|
const binaryVersion = versionProbe(adapter.profile.binary);
|
|
45
45
|
if (!binaryVersion) {
|
|
46
46
|
results.push({
|
|
47
|
-
|
|
47
|
+
adapter: id,
|
|
48
48
|
outcome: "skipped",
|
|
49
49
|
note: `${adapter.profile.binary} not found on PATH`,
|
|
50
50
|
});
|
|
@@ -64,7 +64,7 @@ export async function runHarnessAttestation(registry, opts = {}) {
|
|
|
64
64
|
}
|
|
65
65
|
catch (error) {
|
|
66
66
|
results.push({
|
|
67
|
-
|
|
67
|
+
adapter: id,
|
|
68
68
|
outcome: "failed",
|
|
69
69
|
binaryVersion,
|
|
70
70
|
note: `probe threw: ${boundedReason(error.message)}`,
|
|
@@ -75,7 +75,7 @@ export async function runHarnessAttestation(registry, opts = {}) {
|
|
|
75
75
|
// failed turn records nothing at all rather than a page of `unsupported`.
|
|
76
76
|
if (!result.ok) {
|
|
77
77
|
results.push({
|
|
78
|
-
|
|
78
|
+
adapter: id,
|
|
79
79
|
outcome: "unreachable",
|
|
80
80
|
binaryVersion,
|
|
81
81
|
durationMs: result.durationMs,
|
|
@@ -103,7 +103,7 @@ export async function runHarnessAttestation(registry, opts = {}) {
|
|
|
103
103
|
}
|
|
104
104
|
const record = sealAttestation({
|
|
105
105
|
schema_version: ATTESTATION_SCHEMA_VERSION,
|
|
106
|
-
|
|
106
|
+
adapter: id,
|
|
107
107
|
binary_version: binaryVersion,
|
|
108
108
|
profile_digest: profileDigest(adapter.profile),
|
|
109
109
|
subscription_only: subscriptionOnly,
|
|
@@ -115,7 +115,7 @@ export async function runHarnessAttestation(registry, opts = {}) {
|
|
|
115
115
|
else
|
|
116
116
|
writeAttestation(record, { coordRoot: opts.coordRoot });
|
|
117
117
|
results.push({
|
|
118
|
-
|
|
118
|
+
adapter: id,
|
|
119
119
|
outcome: "recorded",
|
|
120
120
|
binaryVersion,
|
|
121
121
|
observations,
|
|
@@ -125,7 +125,7 @@ export async function runHarnessAttestation(registry, opts = {}) {
|
|
|
125
125
|
}
|
|
126
126
|
return {
|
|
127
127
|
generatedAt: now().toISOString(),
|
|
128
|
-
|
|
128
|
+
adapters: ids,
|
|
129
129
|
results,
|
|
130
130
|
recorded: results.filter((row) => row.outcome === "recorded").length,
|
|
131
131
|
incomplete: results.some((row) => row.outcome !== "recorded"),
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
* no host paths. It lives under the host's coordination directory and is never
|
|
12
12
|
* published.
|
|
13
13
|
*/
|
|
14
|
-
import type {
|
|
14
|
+
import type { AdapterId, AdapterProfile, CapabilitySupport } from "./types.js";
|
|
15
15
|
export declare const ATTESTATION_SCHEMA_VERSION = 2;
|
|
16
16
|
/** Dimensions one minimal live turn can honestly establish. Everything else
|
|
17
17
|
* needs a purpose-built scenario and stays outside the record rather than
|
|
18
18
|
* being guessed at. */
|
|
19
19
|
export declare const ATTESTABLE_DIMENSIONS: readonly ["invocation", "finalResult", "sessionId", "cost", "filesystemPolicyProjection"];
|
|
20
20
|
export type AttestableDimension = (typeof ATTESTABLE_DIMENSIONS)[number];
|
|
21
|
-
export interface
|
|
21
|
+
export interface AdapterAttestation {
|
|
22
22
|
schema_version: number;
|
|
23
|
-
|
|
23
|
+
adapter: AdapterId;
|
|
24
24
|
/** What the vendor binary reported when this was recorded. Staleness is
|
|
25
25
|
* keyed on this, so a vendor upgrade invalidates the record automatically. */
|
|
26
26
|
binary_version: string;
|
|
@@ -45,35 +45,35 @@ export interface AttestationStoreOptions {
|
|
|
45
45
|
export declare function attestationsDir(opts?: AttestationStoreOptions): string;
|
|
46
46
|
/** Stable identity of a declaration, so editing a claim invalidates the
|
|
47
47
|
* attestation that was recorded against the old one. */
|
|
48
|
-
export declare function profileDigest(profile:
|
|
49
|
-
export declare function sealAttestation(record: Omit<
|
|
48
|
+
export declare function profileDigest(profile: AdapterProfile): string;
|
|
49
|
+
export declare function sealAttestation(record: Omit<AdapterAttestation, "record_digest">): AdapterAttestation;
|
|
50
50
|
/** Replace-in-place write. Unlike a workflow record an attestation is meant to
|
|
51
51
|
* be re-recorded, so this is a mutable atomic swap rather than an immutable
|
|
52
52
|
* create. */
|
|
53
|
-
export declare function writeAttestation(record:
|
|
53
|
+
export declare function writeAttestation(record: AdapterAttestation, opts?: AttestationStoreOptions): string;
|
|
54
54
|
/** Null for absent, unreadable, malformed, wrong-schema, or tampered records.
|
|
55
55
|
* A record that fails its own digest is discarded rather than trusted, because
|
|
56
56
|
* the whole point of the file is that it was not hand-written. */
|
|
57
|
-
export declare function readAttestation(
|
|
58
|
-
export declare function validateAttestation(value: unknown,
|
|
57
|
+
export declare function readAttestation(adapter: AdapterId, opts?: AttestationStoreOptions): AdapterAttestation | null;
|
|
58
|
+
export declare function validateAttestation(value: unknown, adapter?: AdapterId): AdapterAttestation | null;
|
|
59
59
|
/** An attestation speaks only for the vendor version and declaration it was
|
|
60
60
|
* recorded against. */
|
|
61
|
-
export declare function isAttestationCurrent(record:
|
|
62
|
-
export declare function listAttestations(opts?: AttestationStoreOptions):
|
|
63
|
-
/** Both
|
|
61
|
+
export declare function isAttestationCurrent(record: AdapterAttestation | null, binaryVersion: string | null, profile: AdapterProfile, subscriptionOnly?: boolean): record is AdapterAttestation;
|
|
62
|
+
export declare function listAttestations(opts?: AttestationStoreOptions): AdapterAttestation[];
|
|
63
|
+
/** Both adapter-derived proof inputs, read once, for a workflow run
|
|
64
64
|
* (ADR 0038). Callers inject the result so the engine performs no capability
|
|
65
|
-
* lookups of its own. A
|
|
65
|
+
* lookups of its own. A adapter with no current attestation simply has no
|
|
66
66
|
* citation; that absence is not a proof unknown. */
|
|
67
|
-
export declare function
|
|
67
|
+
export declare function adapterProofInputs(profiles: readonly AdapterProfile[], opts: AttestationStoreOptions & {
|
|
68
68
|
versionProbe: (binary: string) => string | null;
|
|
69
69
|
/** Billing policy this run will use, so a record made under the other mode
|
|
70
70
|
* is not cited as if it applied. */
|
|
71
71
|
subscriptionOnly?: boolean;
|
|
72
72
|
}): {
|
|
73
|
-
|
|
74
|
-
toolEvidence:
|
|
73
|
+
adapterEvidence: Record<string, {
|
|
74
|
+
toolEvidence: AdapterProfile["capabilities"]["toolEvidence"];
|
|
75
75
|
}>;
|
|
76
|
-
|
|
76
|
+
adapterAttestations: Record<string, {
|
|
77
77
|
binary_version: string;
|
|
78
78
|
observed_at: string;
|
|
79
79
|
record_digest: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attestation.d.ts","sourceRoot":"","sources":["../../../src/core/adapters/attestation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAaH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/E,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C;;uBAEuB;AACvB,eAAO,MAAM,qBAAqB,2FAMxB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB;kFAC8E;IAC9E,cAAc,EAAE,MAAM,CAAC;IACvB;kDAC8C;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB;;8DAE0D;IAC1D,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB;6DACyD;IACzD,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IACtE,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,IAAI,GAAE,uBAA4B,GAAG,MAAM,CAI1E;AAED;wDACwD;AACxD,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAM7D;AAMD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,eAAe,CAAC,GAChD,kBAAkB,CAEpB;AASD;;aAEa;AACb,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,kBAAkB,EAC1B,IAAI,GAAE,uBAA4B,GACjC,MAAM,CAmBR;AAED;;kEAEkE;AAClE,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,EAClB,IAAI,GAAE,uBAA4B,GACjC,kBAAkB,GAAG,IAAI,CAc3B;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,SAAS,GAClB,kBAAkB,GAAG,IAAI,CAe3B;AAED;uBACuB;AACvB,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,kBAAkB,GAAG,IAAI,EACjC,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,OAAO,EAAE,cAAc,EACvB,gBAAgB,CAAC,EAAE,OAAO,GACzB,MAAM,IAAI,kBAAkB,CAK9B;AAED,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,uBAA4B,GAAG,kBAAkB,EAAE,CAczF;AAED;;;oDAGoD;AACpD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,SAAS,cAAc,EAAE,EACnC,IAAI,EAAE,uBAAuB,GAAG;IAC9B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAChD;wCACoC;IACpC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GACA;IACD,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,CAAA;KAAE,CAAC,CAAC;IAClG,mBAAmB,EAAE,MAAM,CACzB,MAAM,EACN;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CACvE,CAAC;CACH,CAoCA"}
|
|
@@ -30,7 +30,7 @@ export function attestationsDir(opts = {}) {
|
|
|
30
30
|
const root = opts.coordRoot ?? monorepoRoot();
|
|
31
31
|
if (!root)
|
|
32
32
|
throw new Error("Not in a coord-aware repo (coord root resolved to null).");
|
|
33
|
-
return resolve(root, ".harnery", "
|
|
33
|
+
return resolve(root, ".harnery", "adapters", "attestations");
|
|
34
34
|
}
|
|
35
35
|
/** Stable identity of a declaration, so editing a claim invalidates the
|
|
36
36
|
* attestation that was recorded against the old one. */
|
|
@@ -47,17 +47,17 @@ function digestOf(record) {
|
|
|
47
47
|
export function sealAttestation(record) {
|
|
48
48
|
return { ...record, record_digest: digestOf(record) };
|
|
49
49
|
}
|
|
50
|
-
function attestationPath(
|
|
51
|
-
if (!/^[a-z0-9][a-z0-9._-]*$/i.test(
|
|
52
|
-
throw new Error(`unsafe
|
|
50
|
+
function attestationPath(adapter, opts) {
|
|
51
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/i.test(adapter)) {
|
|
52
|
+
throw new Error(`unsafe adapter id for an attestation path: ${adapter}`);
|
|
53
53
|
}
|
|
54
|
-
return resolve(attestationsDir(opts), `${
|
|
54
|
+
return resolve(attestationsDir(opts), `${adapter}.json`);
|
|
55
55
|
}
|
|
56
56
|
/** Replace-in-place write. Unlike a workflow record an attestation is meant to
|
|
57
57
|
* be re-recorded, so this is a mutable atomic swap rather than an immutable
|
|
58
58
|
* create. */
|
|
59
59
|
export function writeAttestation(record, opts = {}) {
|
|
60
|
-
const path = attestationPath(record.
|
|
60
|
+
const path = attestationPath(record.adapter, opts);
|
|
61
61
|
mkdirSync(attestationsDir(opts), { recursive: true, mode: 0o700 });
|
|
62
62
|
const temporary = `${path}.tmp-${process.pid}`;
|
|
63
63
|
try {
|
|
@@ -81,10 +81,10 @@ export function writeAttestation(record, opts = {}) {
|
|
|
81
81
|
/** Null for absent, unreadable, malformed, wrong-schema, or tampered records.
|
|
82
82
|
* A record that fails its own digest is discarded rather than trusted, because
|
|
83
83
|
* the whole point of the file is that it was not hand-written. */
|
|
84
|
-
export function readAttestation(
|
|
84
|
+
export function readAttestation(adapter, opts = {}) {
|
|
85
85
|
let raw;
|
|
86
86
|
try {
|
|
87
|
-
raw = readFileSync(attestationPath(
|
|
87
|
+
raw = readFileSync(attestationPath(adapter, opts), "utf8");
|
|
88
88
|
}
|
|
89
89
|
catch {
|
|
90
90
|
return null;
|
|
@@ -96,15 +96,15 @@ export function readAttestation(harness, opts = {}) {
|
|
|
96
96
|
catch {
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
|
-
return validateAttestation(parsed,
|
|
99
|
+
return validateAttestation(parsed, adapter);
|
|
100
100
|
}
|
|
101
|
-
export function validateAttestation(value,
|
|
101
|
+
export function validateAttestation(value, adapter) {
|
|
102
102
|
if (!value || typeof value !== "object")
|
|
103
103
|
return null;
|
|
104
104
|
const record = value;
|
|
105
105
|
if (record.schema_version !== ATTESTATION_SCHEMA_VERSION)
|
|
106
106
|
return null;
|
|
107
|
-
if (typeof record.
|
|
107
|
+
if (typeof record.adapter !== "string" || (adapter && record.adapter !== adapter))
|
|
108
108
|
return null;
|
|
109
109
|
if (typeof record.binary_version !== "string" || typeof record.profile_digest !== "string") {
|
|
110
110
|
return null;
|
|
@@ -145,17 +145,17 @@ export function listAttestations(opts = {}) {
|
|
|
145
145
|
if (record)
|
|
146
146
|
records.push(record);
|
|
147
147
|
}
|
|
148
|
-
return records.sort((a, b) => a.
|
|
148
|
+
return records.sort((a, b) => a.adapter.localeCompare(b.adapter));
|
|
149
149
|
}
|
|
150
|
-
/** Both
|
|
150
|
+
/** Both adapter-derived proof inputs, read once, for a workflow run
|
|
151
151
|
* (ADR 0038). Callers inject the result so the engine performs no capability
|
|
152
|
-
* lookups of its own. A
|
|
152
|
+
* lookups of its own. A adapter with no current attestation simply has no
|
|
153
153
|
* citation; that absence is not a proof unknown. */
|
|
154
|
-
export function
|
|
155
|
-
const
|
|
156
|
-
const
|
|
154
|
+
export function adapterProofInputs(profiles, opts) {
|
|
155
|
+
const adapterEvidence = {};
|
|
156
|
+
const adapterAttestations = {};
|
|
157
157
|
for (const profile of profiles) {
|
|
158
|
-
|
|
158
|
+
adapterEvidence[profile.id] = { toolEvidence: profile.capabilities.toolEvidence };
|
|
159
159
|
let record = null;
|
|
160
160
|
try {
|
|
161
161
|
record = readAttestation(profile.id, opts);
|
|
@@ -167,11 +167,11 @@ export function harnessProofInputs(profiles, opts) {
|
|
|
167
167
|
if (!isAttestationCurrent(record, opts.versionProbe(profile.binary), profile, opts.subscriptionOnly)) {
|
|
168
168
|
continue;
|
|
169
169
|
}
|
|
170
|
-
|
|
170
|
+
adapterAttestations[profile.id] = {
|
|
171
171
|
binary_version: record.binary_version,
|
|
172
172
|
observed_at: record.observed_at,
|
|
173
173
|
record_digest: record.record_digest,
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
return {
|
|
176
|
+
return { adapterEvidence, adapterAttestations };
|
|
177
177
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { AdapterAttestation } from "./attestation.js";
|
|
2
|
+
import type { AdapterRegistry } from "./registry.js";
|
|
3
|
+
import type { AdapterCapabilityDimension, AdapterId, CapabilitySupport } from "./types.js";
|
|
4
4
|
export type BenchVerdict = "supported" | "partial" | "unsupported" | "not_applicable" | "unknown" | "skipped" | "drift";
|
|
5
|
-
export type BenchDimension = "registration" | "binary" | "contract" |
|
|
5
|
+
export type BenchDimension = "registration" | "binary" | "contract" | AdapterCapabilityDimension;
|
|
6
6
|
/** How a result was established (ADR 0037). Orthogonal to the verdict: this
|
|
7
7
|
* answers "how do we know", not "what is true".
|
|
8
8
|
*
|
|
@@ -12,7 +12,7 @@ export type BenchDimension = "registration" | "binary" | "contract" | HarnessCap
|
|
|
12
12
|
* - `declared`: not checked. The value is the declaration, repeated. */
|
|
13
13
|
export type BenchBasis = "adapter" | "attested" | "declared";
|
|
14
14
|
export interface BenchResult {
|
|
15
|
-
|
|
15
|
+
adapter: AdapterId;
|
|
16
16
|
dimension: BenchDimension;
|
|
17
17
|
declared: CapabilitySupport | "not_applicable";
|
|
18
18
|
observed: BenchVerdict;
|
|
@@ -20,10 +20,10 @@ export interface BenchResult {
|
|
|
20
20
|
basis: BenchBasis;
|
|
21
21
|
note?: string;
|
|
22
22
|
}
|
|
23
|
-
export interface
|
|
23
|
+
export interface AdapterBenchReport {
|
|
24
24
|
generatedAt: string;
|
|
25
25
|
mode: "offline";
|
|
26
|
-
|
|
26
|
+
adapters: AdapterId[];
|
|
27
27
|
results: BenchResult[];
|
|
28
28
|
summary: Record<BenchVerdict, number>;
|
|
29
29
|
/** Result counts per basis, so a caller can tell a clean report from an
|
|
@@ -32,21 +32,21 @@ export interface HarnessBenchReport {
|
|
|
32
32
|
drift: boolean;
|
|
33
33
|
skipped: boolean;
|
|
34
34
|
}
|
|
35
|
-
export interface
|
|
36
|
-
|
|
37
|
-
dimensions?: readonly
|
|
35
|
+
export interface AdapterBenchOptions {
|
|
36
|
+
adapters?: readonly string[];
|
|
37
|
+
dimensions?: readonly AdapterCapabilityDimension[];
|
|
38
38
|
/** Test seam and alternate host probe. A null version means unavailable. */
|
|
39
39
|
versionProbe?: (binary: string) => string | null;
|
|
40
40
|
/** Where to look for live attestations (ADR 0038). Defaults to the coord
|
|
41
41
|
* root. Reading them never runs a model turn. */
|
|
42
42
|
coordRoot?: string;
|
|
43
43
|
/** Test seam. Defaults to reading the attestation store. */
|
|
44
|
-
attestationReader?: (
|
|
44
|
+
attestationReader?: (adapter: AdapterId) => AdapterAttestation | null;
|
|
45
45
|
/** Only cite attestations recorded under this billing mode. Omitted means
|
|
46
46
|
* any mode is acceptable for reporting purposes. */
|
|
47
47
|
subscriptionOnly?: boolean;
|
|
48
48
|
}
|
|
49
|
-
export declare function
|
|
49
|
+
export declare function runAdapterBench(registry: AdapterRegistry, opts?: AdapterBenchOptions): AdapterBenchReport;
|
|
50
50
|
/** Ask an installed vendor CLI what version it is. Null when it is absent or
|
|
51
51
|
* refuses to answer. Shared with the live attestation probe so both halves of
|
|
52
52
|
* the capability story key on the same string. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bench.d.ts","sourceRoot":"","sources":["../../../src/core/adapters/bench.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAuB,MAAM,kBAAkB,CAAC;AAEhF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAW,0BAA0B,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpG,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,SAAS,GACT,aAAa,GACb,gBAAgB,GAChB,SAAS,GACT,SAAS,GACT,OAAO,CAAC;AAEZ,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,QAAQ,GAAG,UAAU,GAAG,0BAA0B,CAAC;AAEjG;;;;;;wEAMwE;AACxE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,EAAE,cAAc,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,GAAG,gBAAgB,CAAC;IAC/C,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACtC;sDACkD;IAClD,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACzC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,SAAS,0BAA0B,EAAE,CAAC;IACnD,4EAA4E;IAC5E,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACjD;qDACiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,KAAK,kBAAkB,GAAG,IAAI,CAAC;IACtE;wDACoD;IACpD,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAkDD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,eAAe,EACzB,IAAI,GAAE,mBAAwB,GAC7B,kBAAkB,CAwEpB;AAuLD;;kDAEkD;AAClD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIhE"}
|