niceeval 0.18.0 → 0.19.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/INDEX.md +4 -2
- package/dist/adapter-usage.cjs.map +1 -1
- package/dist/adapter-usage.d.cts +1 -1
- package/dist/adapter-usage.d.mts +1 -1
- package/dist/adapter-usage.d.ts +1 -1
- package/dist/adapter.cjs +8 -7
- package/dist/adapter.cjs.map +1 -1
- package/dist/adapter.d.cts +21 -21
- package/dist/adapter.d.mts +21 -21
- package/dist/adapter.d.ts +21 -21
- package/dist/agents/{effect-runtime.cjs → agent-effects.cjs} +12 -18
- package/dist/agents/agent-effects.cjs.map +1 -0
- package/dist/agents/agent-effects.d.cts +23 -0
- package/dist/agents/agent-effects.d.mts +23 -0
- package/dist/agents/agent-effects.d.ts +23 -0
- package/dist/agents/agent-effects.js +16 -0
- package/dist/agents/agent-effects.js.map +1 -0
- package/dist/agents/ai-sdk.cjs +1 -1
- package/dist/agents/ai-sdk.cjs.map +1 -1
- package/dist/agents/bub.cjs +31 -18
- package/dist/agents/bub.cjs.map +1 -1
- package/dist/agents/bub.d.cts +9 -12
- package/dist/agents/bub.d.mts +9 -12
- package/dist/agents/bub.d.ts +9 -12
- package/dist/agents/claude-code-native.cjs +2 -2
- package/dist/agents/claude-code-native.cjs.map +1 -1
- package/dist/agents/claude-code.cjs +17 -11
- package/dist/agents/claude-code.cjs.map +1 -1
- package/dist/agents/claude-code.d.cts +11 -11
- package/dist/agents/claude-code.d.mts +11 -11
- package/dist/agents/claude-code.d.ts +11 -11
- package/dist/agents/codex-app-server.cjs +2 -2
- package/dist/agents/codex-app-server.cjs.map +1 -1
- package/dist/agents/codex.cjs +18 -12
- package/dist/agents/codex.cjs.map +1 -1
- package/dist/agents/codex.d.cts +12 -12
- package/dist/agents/codex.d.mts +12 -12
- package/dist/agents/codex.d.ts +12 -12
- package/dist/agents/deepseek-harness.cjs +2 -2
- package/dist/agents/deepseek-harness.cjs.map +1 -1
- package/dist/agents/hermes.cjs +3 -3
- package/dist/agents/hermes.cjs.map +1 -1
- package/dist/agents/index.cjs +3 -3
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +3 -3
- package/dist/agents/index.d.mts +3 -3
- package/dist/agents/index.d.ts +3 -3
- package/dist/agents/index.js +2 -2
- package/dist/agents/index.mjs +2 -2
- package/dist/agents/mcp.cjs.map +1 -1
- package/dist/agents/mcp.d.cts +2 -2
- package/dist/agents/mcp.d.mts +2 -2
- package/dist/agents/mcp.d.ts +2 -2
- package/dist/agents/omp.cjs +2 -2
- package/dist/agents/omp.cjs.map +1 -1
- package/dist/agents/openai-compat.cjs +2 -2
- package/dist/agents/openai-compat.cjs.map +1 -1
- package/dist/agents/openclaw.cjs +3 -3
- package/dist/agents/openclaw.cjs.map +1 -1
- package/dist/agents/opencode.cjs +16 -4
- package/dist/agents/opencode.cjs.map +1 -1
- package/dist/agents/plugin-extensions.cjs +71 -0
- package/dist/agents/plugin-extensions.cjs.map +1 -0
- package/dist/agents/plugin-extensions.d.cts +26 -0
- package/dist/agents/plugin-extensions.d.mts +26 -0
- package/dist/agents/plugin-extensions.d.ts +26 -0
- package/dist/agents/plugin-extensions.js +8 -0
- package/dist/agents/plugin-extensions.js.map +1 -0
- package/dist/agents/post-setup.cjs +14 -3
- package/dist/agents/post-setup.cjs.map +1 -1
- package/dist/agents/post-setup.d.cts +4 -2
- package/dist/agents/post-setup.d.mts +4 -2
- package/dist/agents/post-setup.d.ts +4 -2
- package/dist/agents/post-setup.js +8 -6
- package/dist/agents/sdk-streams.cjs +3 -3
- package/dist/agents/sdk-streams.cjs.map +1 -1
- package/dist/agents/{session-slot.cjs → session-key.cjs} +4 -4
- package/dist/agents/session-key.cjs.map +1 -0
- package/dist/agents/session-key.d.cts +12 -0
- package/dist/agents/session-key.d.mts +12 -0
- package/dist/agents/session-key.d.ts +12 -0
- package/dist/agents/session-key.js +6 -0
- package/dist/agents/session-key.js.map +1 -0
- package/dist/agents/shared.cjs +2 -2
- package/dist/agents/shared.cjs.map +1 -1
- package/dist/agents/shared.d.cts +4 -4
- package/dist/agents/shared.d.mts +4 -4
- package/dist/agents/shared.d.ts +4 -4
- package/dist/agents/skills.cjs.map +1 -1
- package/dist/agents/skills.d.cts +3 -3
- package/dist/agents/skills.d.mts +3 -3
- package/dist/agents/skills.d.ts +3 -3
- package/dist/agents/types.cjs.map +1 -1
- package/dist/agents/types.d.cts +55 -54
- package/dist/agents/types.d.mts +55 -54
- package/dist/agents/types.d.ts +55 -54
- package/dist/agents/ui-message-stream.cjs +4 -4
- package/dist/agents/ui-message-stream.cjs.map +1 -1
- package/dist/agents/unrecognized-events.cjs +32 -0
- package/dist/agents/unrecognized-events.cjs.map +1 -0
- package/dist/agents/unrecognized-events.d.cts +8 -0
- package/dist/agents/unrecognized-events.d.mts +8 -0
- package/dist/agents/unrecognized-events.d.ts +8 -0
- package/dist/agents/unrecognized-events.js +6 -0
- package/dist/agents/unrecognized-events.js.map +1 -0
- package/dist/assertions/api.cjs.map +1 -1
- package/dist/assertions/api.d.cts +3 -0
- package/dist/assertions/api.d.mts +3 -0
- package/dist/assertions/api.d.ts +3 -0
- package/dist/assertions/collection.cjs +1 -1
- package/dist/assertions/collection.cjs.map +1 -1
- package/dist/assertions/judge.cjs +1 -1
- package/dist/assertions/judge.cjs.map +1 -1
- package/dist/assertions/match.cjs +52 -21
- package/dist/assertions/match.cjs.map +1 -1
- package/dist/assertions/match.d.cts +16 -5
- package/dist/assertions/match.d.mts +16 -5
- package/dist/assertions/match.d.ts +16 -5
- package/dist/assertions/match.js +96 -94
- package/dist/assertions/measurements.cjs +22 -6
- package/dist/assertions/measurements.cjs.map +1 -1
- package/dist/assertions/measurements.d.cts +8 -1
- package/dist/assertions/measurements.d.mts +8 -1
- package/dist/assertions/measurements.d.ts +8 -1
- package/dist/assertions/numeric.cjs +2 -0
- package/dist/assertions/numeric.cjs.map +1 -1
- package/dist/assertions/numeric.d.cts +1 -1
- package/dist/assertions/numeric.d.mts +1 -1
- package/dist/assertions/numeric.d.ts +1 -1
- package/dist/assertions/quantity.cjs +42 -0
- package/dist/assertions/quantity.cjs.map +1 -0
- package/dist/assertions/quantity.d.cts +18 -0
- package/dist/assertions/quantity.d.mts +18 -0
- package/dist/assertions/quantity.d.ts +18 -0
- package/dist/assertions/quantity.js +22 -0
- package/dist/assertions/quantity.js.map +1 -0
- package/dist/assertions/record/attachment.cjs +2 -0
- package/dist/assertions/record/attachment.cjs.map +1 -1
- package/dist/assertions/record/codec.cjs +5 -1
- package/dist/assertions/record/codec.cjs.map +1 -1
- package/dist/assertions/record/model.cjs.map +1 -1
- package/dist/assertions/record/model.d.cts +3 -1
- package/dist/assertions/record/model.d.mts +3 -1
- package/dist/assertions/record/model.d.ts +3 -1
- package/dist/assertions/runtime.cjs +11 -6
- package/dist/assertions/runtime.cjs.map +1 -1
- package/dist/cli/program.cjs +3 -0
- package/dist/cli/program.cjs.map +1 -1
- package/dist/context/assert-first.cjs +6 -4
- package/dist/context/assert-first.cjs.map +1 -1
- package/dist/context/assert-first.d.cts +9 -3
- package/dist/context/assert-first.d.mts +9 -3
- package/dist/context/assert-first.d.ts +9 -3
- package/dist/context/notes.cjs +47 -0
- package/dist/context/notes.cjs.map +1 -0
- package/dist/context/notes.d.cts +10 -0
- package/dist/context/notes.d.mts +10 -0
- package/dist/context/notes.d.ts +10 -0
- package/dist/context/notes.js +6 -0
- package/dist/context/notes.js.map +1 -0
- package/dist/context/send-failures.cjs +1 -7
- package/dist/context/send-failures.cjs.map +1 -1
- package/dist/context/send-failures.d.cts +2 -3
- package/dist/context/send-failures.d.mts +2 -3
- package/dist/context/send-failures.d.ts +2 -3
- package/dist/context/send-retry.cjs +0 -1
- package/dist/context/send-retry.cjs.map +1 -1
- package/dist/context/send-retry.d.cts +1 -2
- package/dist/context/send-retry.d.mts +1 -2
- package/dist/context/send-retry.d.ts +1 -2
- package/dist/context/session.cjs +10 -17
- package/dist/context/session.cjs.map +1 -1
- package/dist/context/session.d.cts +4 -10
- package/dist/context/session.d.mts +4 -10
- package/dist/context/session.d.ts +4 -10
- package/dist/define.cjs +88 -65
- package/dist/define.cjs.map +1 -1
- package/dist/define.d.cts +3 -3
- package/dist/define.d.mts +3 -3
- package/dist/define.d.ts +3 -3
- package/dist/eval/cli/contribution.cjs +1 -1
- package/dist/eval/cli/contribution.cjs.map +1 -1
- package/dist/eval/host/index.cjs +1 -1
- package/dist/eval/host/index.cjs.map +1 -1
- package/dist/eval/record/evaluation.cjs +1 -1
- package/dist/eval/record/evaluation.cjs.map +1 -1
- package/dist/eval/record/membership-provenance.d.cts +3 -3
- package/dist/eval/record/membership-provenance.d.mts +3 -3
- package/dist/eval/record/membership-provenance.d.ts +3 -3
- package/dist/eval/record/score.cjs +2 -2
- package/dist/eval/record/score.cjs.map +1 -1
- package/dist/eval/record/sealed-assertion.cjs +1 -1
- package/dist/eval/record/sealed-assertion.cjs.map +1 -1
- package/dist/eval/record/verdict.cjs +2 -2
- package/dist/eval/record/verdict.cjs.map +1 -1
- package/dist/expect/index.cjs +10 -1
- package/dist/expect/index.cjs.map +1 -1
- package/dist/expect/index.d.cts +3 -1
- package/dist/expect/index.d.mts +3 -1
- package/dist/expect/index.d.ts +3 -1
- package/dist/expect/index.js +92 -76
- package/dist/expect/index.mjs +92 -76
- package/dist/experiment/host/cli/contribution.cjs +52 -39
- package/dist/experiment/host/cli/contribution.cjs.map +1 -1
- package/dist/experiment/host/cli/contribution.d.cts +18 -4
- package/dist/experiment/host/cli/contribution.d.mts +18 -4
- package/dist/experiment/host/cli/contribution.d.ts +18 -4
- package/dist/experiment/host/cli/contribution.js +2 -2
- package/dist/experiment/host/cli/debug-protocol.cjs +2 -2
- package/dist/experiment/host/cli/debug-protocol.cjs.map +1 -1
- package/dist/experiment/host/cli/debug-protocol.d.cts +2 -2
- package/dist/experiment/host/cli/debug-protocol.d.mts +2 -2
- package/dist/experiment/host/cli/debug-protocol.d.ts +2 -2
- package/dist/experiment/host/cli/output-protocol.cjs +1 -1
- package/dist/experiment/host/cli/output-protocol.cjs.map +1 -1
- package/dist/experiment/host/cli/output-protocol.d.cts +2 -2
- package/dist/experiment/host/cli/output-protocol.d.mts +2 -2
- package/dist/experiment/host/cli/output-protocol.d.ts +2 -2
- package/dist/experiment/host/current.cjs +2 -2
- package/dist/experiment/host/current.cjs.map +1 -1
- package/dist/experiment/host/index.cjs +1 -1
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/experiment/host/operations.cjs +21 -22
- package/dist/experiment/host/operations.cjs.map +1 -1
- package/dist/experiment/host/runtime.cjs +8 -9
- package/dist/experiment/host/runtime.cjs.map +1 -1
- package/dist/experiment/host/runtime.d.cts +3 -3
- package/dist/experiment/host/runtime.d.mts +3 -3
- package/dist/experiment/host/runtime.d.ts +3 -3
- package/dist/experiment/host/teardown.cjs +3 -3
- package/dist/experiment/host/teardown.cjs.map +1 -1
- package/dist/experiment/host/teardown.d.cts +3 -3
- package/dist/experiment/host/teardown.d.mts +3 -3
- package/dist/experiment/host/teardown.d.ts +3 -3
- package/dist/experiment/host/types.cjs.map +1 -1
- package/dist/experiment/host/types.d.cts +19 -19
- package/dist/experiment/host/types.d.mts +19 -19
- package/dist/experiment/host/types.d.ts +19 -19
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/inspection/assertions.cjs +1 -1
- package/dist/inspection/assertions.cjs.map +1 -1
- package/dist/inspection/cli/contribution.cjs +8 -7
- package/dist/inspection/cli/contribution.cjs.map +1 -1
- package/dist/inspection/facts.cjs +4 -4
- package/dist/inspection/facts.cjs.map +1 -1
- package/dist/inspection/index.cjs +1 -5
- package/dist/inspection/index.cjs.map +1 -1
- package/dist/inspection/index.d.cts +1 -2
- package/dist/inspection/index.d.mts +1 -2
- package/dist/inspection/index.d.ts +1 -2
- package/dist/inspection/index.js +20 -26
- package/dist/inspection/lifecycle.cjs +7 -0
- package/dist/inspection/lifecycle.cjs.map +1 -0
- package/dist/inspection/lifecycle.d.cts +4 -0
- package/dist/inspection/lifecycle.d.mts +4 -0
- package/dist/inspection/lifecycle.d.ts +4 -0
- package/dist/inspection/lifecycle.js +6 -0
- package/dist/inspection/lifecycle.js.map +1 -0
- package/dist/inspection/notes.cjs +40 -0
- package/dist/inspection/notes.cjs.map +1 -0
- package/dist/inspection/notes.d.cts +12 -0
- package/dist/inspection/notes.d.mts +12 -0
- package/dist/inspection/notes.d.ts +12 -0
- package/dist/inspection/notes.js +8 -0
- package/dist/inspection/notes.js.map +1 -0
- package/dist/inspection/overview.cjs +12 -15
- package/dist/inspection/overview.cjs.map +1 -1
- package/dist/inspection/overview.d.cts +8 -6
- package/dist/inspection/overview.d.mts +8 -6
- package/dist/inspection/overview.d.ts +8 -6
- package/dist/inspection/planned-attempt.cjs +45 -0
- package/dist/inspection/planned-attempt.cjs.map +1 -0
- package/dist/inspection/planned-attempt.d.cts +109 -0
- package/dist/inspection/planned-attempt.d.mts +109 -0
- package/dist/inspection/planned-attempt.d.ts +109 -0
- package/dist/inspection/planned-attempt.js +24 -0
- package/dist/inspection/planned-attempt.js.map +1 -0
- package/dist/inspection/project-result.cjs +5 -5
- package/dist/inspection/project-result.cjs.map +1 -1
- package/dist/inspection/project-result.d.cts +58 -57
- package/dist/inspection/project-result.d.mts +58 -57
- package/dist/inspection/project-result.d.ts +58 -57
- package/dist/inspection/project-result.js +4 -4
- package/dist/inspection/project.cjs +3 -3
- package/dist/inspection/project.cjs.map +1 -1
- package/dist/inspection/protocol-values.cjs +1 -1
- package/dist/inspection/protocol-values.cjs.map +1 -1
- package/dist/inspection/protocol-values.d.cts +1 -1
- package/dist/inspection/protocol-values.d.mts +1 -1
- package/dist/inspection/protocol-values.d.ts +1 -1
- package/dist/inspection/protocol.cjs +8 -8
- package/dist/inspection/protocol.cjs.map +1 -1
- package/dist/inspection/protocol.d.cts +237 -219
- package/dist/inspection/protocol.d.mts +237 -219
- package/dist/inspection/protocol.d.ts +237 -219
- package/dist/inspection/public.cjs +1 -5
- package/dist/inspection/public.cjs.map +1 -1
- package/dist/inspection/public.d.cts +1 -2
- package/dist/inspection/public.d.mts +1 -2
- package/dist/inspection/public.d.ts +1 -2
- package/dist/inspection/public.js +14 -20
- package/dist/inspection/public.mjs +166 -129
- package/dist/inspection/query.cjs +1 -1
- package/dist/inspection/query.cjs.map +1 -1
- package/dist/inspection/results.cjs +61 -52
- package/dist/inspection/results.cjs.map +1 -1
- package/dist/inspection/results.d.cts +157 -140
- package/dist/inspection/results.d.mts +157 -140
- package/dist/inspection/results.d.ts +157 -140
- package/dist/inspection/select.cjs +33 -28
- package/dist/inspection/select.cjs.map +1 -1
- package/dist/inspection/source.cjs +1 -1
- package/dist/inspection/source.cjs.map +1 -1
- package/dist/inspection/sources.cjs +2 -2
- package/dist/inspection/sources.cjs.map +1 -1
- package/dist/inspection/trace.cjs +9 -8
- package/dist/inspection/trace.cjs.map +1 -1
- package/dist/inspection/trace.d.cts +4 -4
- package/dist/inspection/trace.d.mts +4 -4
- package/dist/inspection/trace.d.ts +4 -4
- package/dist/loaders/index.cjs +7 -279
- package/dist/loaders/index.cjs.map +1 -1
- package/dist/loaders/index.d.cts +2 -95
- package/dist/loaders/index.d.mts +2 -95
- package/dist/loaders/index.d.ts +2 -95
- package/dist/loaders/index.js +10 -12
- package/dist/loaders/index.mjs +10 -12
- package/dist/loaders/runtime.cjs +283 -0
- package/dist/loaders/runtime.cjs.map +1 -0
- package/dist/loaders/runtime.d.cts +95 -0
- package/dist/loaders/runtime.d.mts +95 -0
- package/dist/loaders/runtime.d.ts +95 -0
- package/dist/loaders/runtime.js +16 -0
- package/dist/loaders/runtime.js.map +1 -0
- package/dist/migrations/judge-provider.md +6 -6
- package/dist/{model-slots.cjs → model-roles.cjs} +12 -12
- package/dist/{model-slots.cjs.map → model-roles.cjs.map} +1 -1
- package/dist/{model-slots.d.cts → model-roles.d.cts} +10 -10
- package/dist/{model-slots.d.mts → model-roles.d.mts} +10 -10
- package/dist/{model-slots.d.ts → model-roles.d.ts} +10 -10
- package/dist/model-roles.js +14 -0
- package/dist/model-roles.js.map +1 -0
- package/dist/o11y/adapter-usage-projection.cjs +9 -8
- package/dist/o11y/adapter-usage-projection.cjs.map +1 -1
- package/dist/o11y/adapter-usage-projection.d.cts +23 -15
- package/dist/o11y/adapter-usage-projection.d.mts +23 -15
- package/dist/o11y/adapter-usage-projection.d.ts +23 -15
- package/dist/o11y/cache-read.cjs +14 -14
- package/dist/o11y/cache-read.cjs.map +1 -1
- package/dist/o11y/cache-read.d.cts +5 -5
- package/dist/o11y/cache-read.d.mts +5 -5
- package/dist/o11y/cache-read.d.ts +5 -5
- package/dist/o11y/derive.cjs.map +1 -1
- package/dist/o11y/derive.d.cts +2 -2
- package/dist/o11y/derive.d.mts +2 -2
- package/dist/o11y/derive.d.ts +2 -2
- package/dist/o11y/eval-usage.cjs +9 -9
- package/dist/o11y/eval-usage.cjs.map +1 -1
- package/dist/o11y/eval-usage.d.cts +7 -7
- package/dist/o11y/eval-usage.d.mts +7 -7
- package/dist/o11y/eval-usage.d.ts +7 -7
- package/dist/o11y/parsers/bub.cjs +57 -81
- package/dist/o11y/parsers/bub.cjs.map +1 -1
- package/dist/o11y/parsers/index.cjs.map +1 -1
- package/dist/o11y/parsers/index.d.cts +2 -0
- package/dist/o11y/parsers/index.d.mts +2 -0
- package/dist/o11y/parsers/index.d.ts +2 -0
- package/dist/o11y/parsers/opencode.cjs +129 -217
- package/dist/o11y/parsers/opencode.cjs.map +1 -1
- package/dist/o11y/parsers/opencode.d.cts +2 -5
- package/dist/o11y/parsers/opencode.d.mts +2 -5
- package/dist/o11y/parsers/opencode.d.ts +2 -5
- package/dist/o11y/types.cjs.map +1 -1
- package/dist/o11y/types.d.cts +1 -1
- package/dist/o11y/types.d.mts +1 -1
- package/dist/o11y/types.d.ts +1 -1
- package/dist/plugin/contracts.cjs +170 -120
- package/dist/plugin/contracts.cjs.map +1 -1
- package/dist/plugin/contracts.d.cts +102 -90
- package/dist/plugin/contracts.d.mts +102 -90
- package/dist/plugin/contracts.d.ts +102 -90
- package/dist/plugin/contracts.js +16 -12
- package/dist/plugin/index.cjs.map +1 -1
- package/dist/plugin/index.d.cts +1 -1
- package/dist/plugin/index.d.mts +1 -1
- package/dist/plugin/index.d.ts +1 -1
- package/dist/plugin/link.cjs +69 -64
- package/dist/plugin/link.cjs.map +1 -1
- package/dist/plugin/link.d.cts +5 -3
- package/dist/plugin/link.d.mts +5 -3
- package/dist/plugin/link.d.ts +5 -3
- package/dist/plugin/link.js +12 -8
- package/dist/record/codec/seal-manifest.d.cts +3 -3
- package/dist/record/codec/seal-manifest.d.mts +3 -3
- package/dist/record/codec/seal-manifest.d.ts +3 -3
- package/dist/record/family/attempt-note/definition.cjs +12 -0
- package/dist/record/family/attempt-note/definition.cjs.map +1 -0
- package/dist/record/family/attempt-note/definition.d.cts +6 -0
- package/dist/record/family/attempt-note/definition.d.mts +6 -0
- package/dist/record/family/attempt-note/definition.d.ts +6 -0
- package/dist/record/family/attempt-note/definition.js +6 -0
- package/dist/record/family/attempt-note/definition.js.map +1 -0
- package/dist/record/family/attempt-note/persistence.cjs +10 -0
- package/dist/record/family/attempt-note/persistence.cjs.map +1 -0
- package/dist/record/family/attempt-note/persistence.d.cts +6 -0
- package/dist/record/family/attempt-note/persistence.d.mts +6 -0
- package/dist/record/family/attempt-note/persistence.d.ts +6 -0
- package/dist/record/family/attempt-note/persistence.js +6 -0
- package/dist/record/family/attempt-note/persistence.js.map +1 -0
- package/dist/record/family/attempt-note/schema.cjs +20 -0
- package/dist/record/family/attempt-note/schema.cjs.map +1 -0
- package/dist/record/family/attempt-note/schema.d.cts +21 -0
- package/dist/record/family/attempt-note/schema.d.mts +21 -0
- package/dist/record/family/attempt-note/schema.d.ts +21 -0
- package/dist/record/family/attempt-note/schema.js +10 -0
- package/dist/record/family/attempt-note/schema.js.map +1 -0
- package/dist/record/family/catalog.cjs +32 -29
- package/dist/record/family/catalog.cjs.map +1 -1
- package/dist/record/family/catalog.d.cts +7 -2
- package/dist/record/family/catalog.d.mts +7 -2
- package/dist/record/family/catalog.d.ts +7 -2
- package/dist/record/family/current.cjs +48 -45
- package/dist/record/family/current.cjs.map +1 -1
- package/dist/record/family/current.d.cts +15 -0
- package/dist/record/family/current.d.mts +15 -0
- package/dist/record/family/current.d.ts +15 -0
- package/dist/record/model/index.js +66 -64
- package/dist/record/model/run-context.cjs +9 -3
- package/dist/record/model/run-context.cjs.map +1 -1
- package/dist/record/model/run-context.d.cts +9 -2
- package/dist/record/model/run-context.d.mts +9 -2
- package/dist/record/model/run-context.d.ts +9 -2
- package/dist/record/model/run-context.js +8 -6
- package/dist/record/model/seal-manifest.d.cts +1 -1
- package/dist/record/model/seal-manifest.d.mts +1 -1
- package/dist/record/model/seal-manifest.d.ts +1 -1
- package/dist/run/cli/contribution.cjs +6 -32
- package/dist/run/cli/contribution.cjs.map +1 -1
- package/dist/run/host/runtime.cjs +1 -1
- package/dist/run/host/runtime.cjs.map +1 -1
- package/dist/run/storage/sqlite.cjs +7 -7
- package/dist/run/storage/sqlite.cjs.map +1 -1
- package/dist/runner/adapter-usage.cjs +5 -3
- package/dist/runner/adapter-usage.cjs.map +1 -1
- package/dist/runner/adapter-usage.d.cts +2 -2
- package/dist/runner/adapter-usage.d.mts +2 -2
- package/dist/runner/adapter-usage.d.ts +2 -2
- package/dist/runner/adoption.cjs +9 -12
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/attempt-notes.cjs +8 -0
- package/dist/runner/attempt-notes.cjs.map +1 -0
- package/dist/runner/attempt-notes.d.cts +4 -0
- package/dist/runner/attempt-notes.d.mts +4 -0
- package/dist/runner/attempt-notes.d.ts +4 -0
- package/dist/runner/attempt-notes.js +8 -0
- package/dist/runner/attempt-notes.js.map +1 -0
- package/dist/runner/attempt.cjs +61 -73
- package/dist/runner/attempt.cjs.map +1 -1
- package/dist/runner/attempt.d.cts +3 -3
- package/dist/runner/attempt.d.mts +3 -3
- package/dist/runner/attempt.d.ts +3 -3
- package/dist/runner/command-plan.cjs +21 -26
- package/dist/runner/command-plan.cjs.map +1 -1
- package/dist/runner/command-plan.d.cts +4 -4
- package/dist/runner/command-plan.d.mts +4 -4
- package/dist/runner/command-plan.d.ts +4 -4
- package/dist/runner/command-plan.js +4 -4
- package/dist/runner/config-identity.cjs.map +1 -1
- package/dist/runner/config-identity.d.cts +2 -2
- package/dist/runner/config-identity.d.mts +2 -2
- package/dist/runner/config-identity.d.ts +2 -2
- package/dist/runner/discover.cjs +6 -6
- package/dist/runner/discover.cjs.map +1 -1
- package/dist/runner/eval-selection.cjs +2 -2
- package/dist/runner/eval-selection.cjs.map +1 -1
- package/dist/runner/eval-selection.d.cts +2 -2
- package/dist/runner/eval-selection.d.mts +2 -2
- package/dist/runner/eval-selection.d.ts +2 -2
- package/dist/runner/feedback/human.cjs +1 -1
- package/dist/runner/feedback/human.cjs.map +1 -1
- package/dist/runner/feedback/json.cjs +4 -2
- package/dist/runner/feedback/json.cjs.map +1 -1
- package/dist/runner/feedback/json.d.cts +1 -1
- package/dist/runner/feedback/json.d.mts +1 -1
- package/dist/runner/feedback/json.d.ts +1 -1
- package/dist/runner/feedback/sink.cjs +1 -1
- package/dist/runner/feedback/sink.cjs.map +1 -1
- package/dist/runner/feedback/sink.d.cts +1 -1
- package/dist/runner/feedback/sink.d.mts +1 -1
- package/dist/runner/feedback/sink.d.ts +1 -1
- package/dist/runner/fingerprint.cjs +1 -1
- package/dist/runner/fingerprint.cjs.map +1 -1
- package/dist/runner/project-target.cjs.map +1 -1
- package/dist/runner/project-target.d.cts +2 -2
- package/dist/runner/project-target.d.mts +2 -2
- package/dist/runner/project-target.d.ts +2 -2
- package/dist/runner/record/attachments.cjs +2 -2
- package/dist/runner/record/attachments.cjs.map +1 -1
- package/dist/runner/record/planning.cjs +8 -2
- package/dist/runner/record/planning.cjs.map +1 -1
- package/dist/runner/record.cjs +2 -0
- package/dist/runner/record.cjs.map +1 -1
- package/dist/runner/report.cjs +3 -3
- package/dist/runner/report.cjs.map +1 -1
- package/dist/runner/report.d.cts +1 -1
- package/dist/runner/report.d.mts +1 -1
- package/dist/runner/report.d.ts +1 -1
- package/dist/runner/reuse-plan.cjs +2 -2
- package/dist/runner/reuse-plan.cjs.map +1 -1
- package/dist/runner/run.cjs +10 -45
- package/dist/runner/run.cjs.map +1 -1
- package/dist/runner/sandbox-pool.cjs +1 -2
- package/dist/runner/sandbox-pool.cjs.map +1 -1
- package/dist/runner/setup-prefix-preparation.cjs +1 -1
- package/dist/runner/setup-prefix-preparation.cjs.map +1 -1
- package/dist/runner/teardown-registry.cjs +2 -2
- package/dist/runner/teardown-registry.cjs.map +1 -1
- package/dist/runner/teardown-registry.d.cts +1 -1
- package/dist/runner/teardown-registry.d.mts +1 -1
- package/dist/runner/teardown-registry.d.ts +1 -1
- package/dist/runner/types.cjs +4 -4
- package/dist/runner/types.cjs.map +1 -1
- package/dist/runner/types.d.cts +64 -93
- package/dist/runner/types.d.mts +64 -93
- package/dist/runner/types.d.ts +64 -93
- package/dist/runner/types.js +2 -2
- package/dist/sandbox/action.cjs +1 -1
- package/dist/sandbox/action.cjs.map +1 -1
- package/dist/sandbox/cli/contribution.cjs +17 -14
- package/dist/sandbox/cli/contribution.cjs.map +1 -1
- package/dist/sandbox/cli/contribution.d.cts +1 -1
- package/dist/sandbox/cli/contribution.d.mts +1 -1
- package/dist/sandbox/cli/contribution.d.ts +1 -1
- package/dist/sandbox/commands.cjs +1 -1
- package/dist/sandbox/commands.cjs.map +1 -1
- package/dist/sandbox/commands.d.cts +1 -1
- package/dist/sandbox/commands.d.mts +1 -1
- package/dist/sandbox/commands.d.ts +1 -1
- package/dist/sandbox/compose.cjs +2 -2
- package/dist/sandbox/compose.cjs.map +1 -1
- package/dist/sandbox/docker-profile/registry.cjs +5 -9
- package/dist/sandbox/docker-profile/registry.cjs.map +1 -1
- package/dist/sandbox/docker-profile/registry.d.cts +0 -3
- package/dist/sandbox/docker-profile/registry.d.mts +0 -3
- package/dist/sandbox/docker-profile/registry.d.ts +0 -3
- package/dist/sandbox/docker-profile/registry.js +6 -12
- package/dist/sandbox/docker-profile/runtime.cjs +1 -1
- package/dist/sandbox/docker-profile/runtime.cjs.map +1 -1
- package/dist/sandbox/docker-profile/schema.cjs +12 -16
- package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
- package/dist/sandbox/docker-profile/schema.d.cts +2 -6
- package/dist/sandbox/docker-profile/schema.d.mts +2 -6
- package/dist/sandbox/docker-profile/schema.d.ts +2 -6
- package/dist/sandbox/docker-profile/schema.js +24 -32
- package/dist/sandbox/incus.cjs +2 -2
- package/dist/sandbox/incus.cjs.map +1 -1
- package/dist/sandbox/index.cjs +4 -35
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +4 -8
- package/dist/sandbox/index.d.mts +4 -8
- package/dist/sandbox/index.d.ts +4 -8
- package/dist/sandbox/index.js +116 -172
- package/dist/sandbox/index.mjs +116 -172
- package/dist/sandbox/layer.cjs +3 -3
- package/dist/sandbox/layer.cjs.map +1 -1
- package/dist/sandbox/link.cjs +5 -0
- package/dist/sandbox/link.cjs.map +1 -1
- package/dist/sandbox/link.d.cts +3 -0
- package/dist/sandbox/link.d.mts +3 -0
- package/dist/sandbox/link.d.ts +3 -0
- package/dist/sandbox/runtime.cjs +9 -4
- package/dist/sandbox/runtime.cjs.map +1 -1
- package/dist/shared/failure-class.cjs +5 -5
- package/dist/shared/failure-class.cjs.map +1 -1
- package/dist/shared/failure-class.d.cts +4 -10
- package/dist/shared/failure-class.d.mts +4 -10
- package/dist/shared/failure-class.d.ts +4 -10
- package/dist/shared/types.cjs.map +1 -1
- package/dist/shared/types.d.cts +1 -1
- package/dist/shared/types.d.mts +1 -1
- package/dist/shared/types.d.ts +1 -1
- package/dist/show/contribution.cjs +17 -2
- package/dist/show/contribution.cjs.map +1 -1
- package/dist/show/contribution.d.cts +14 -0
- package/dist/show/contribution.d.mts +14 -0
- package/dist/show/contribution.d.ts +14 -0
- package/dist/show/model.cjs +8 -5
- package/dist/show/model.cjs.map +1 -1
- package/dist/show/model.d.cts +11 -8
- package/dist/show/model.d.mts +11 -8
- package/dist/show/model.d.ts +11 -8
- package/dist/show/render.cjs +34 -22
- package/dist/show/render.cjs.map +1 -1
- package/dist/sources/projector.cjs +1 -1
- package/dist/sources/projector.cjs.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +2 -2
- package/dist/view/app-dist/.vite/manifest.json +2 -2
- package/dist/view/app-dist/assets/{index-B3ijZRph.js → index-CxrOUvHC.js} +17 -17
- package/dist/view/app-dist/assets/{quality-cost-scatter-B--DfJ9s.js → quality-cost-scatter-B6Aiss7x.js} +1 -1
- package/dist/view/app-dist/index.html +1 -1
- package/dist/view/cli/contribution.cjs +1 -1
- package/dist/view/cli/contribution.cjs.map +1 -1
- package/dist/view/function-runtime.mjs +318 -121
- package/dist/view/http-protocol.d.cts +1 -1
- package/dist/view/http-protocol.d.mts +1 -1
- package/dist/view/http-protocol.d.ts +1 -1
- package/dist/view/inspection-host.cjs +2 -2
- package/dist/view/inspection-host.cjs.map +1 -1
- package/dist/view/inspection-host.d.cts +349 -331
- package/dist/view/inspection-host.d.mts +349 -331
- package/dist/view/inspection-host.d.ts +349 -331
- package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +6 -6
- package/docs-site/zh/examples/integrations/claude-sdk.mdx +5 -5
- package/docs-site/zh/examples/integrations/codex-sdk.mdx +4 -4
- package/docs-site/zh/examples/integrations/langgraph.mdx +4 -4
- package/docs-site/zh/examples/integrations/pi-sdk.mdx +5 -5
- package/docs-site/zh/explanation/adapter.mdx +6 -6
- package/docs-site/zh/explanation/assert.mdx +7 -7
- package/docs-site/zh/explanation/drive.mdx +4 -4
- package/docs-site/zh/explanation/hitl.mdx +2 -2
- package/docs-site/zh/explanation/judge.mdx +2 -2
- package/docs-site/zh/introduction.mdx +2 -2
- package/docs-site/zh/reference/builtin-agents.mdx +46 -49
- package/docs-site/zh/reference/cli.mdx +16 -14
- package/docs-site/zh/reference/define-agent.mdx +19 -19
- package/docs-site/zh/reference/define-config.mdx +7 -15
- package/docs-site/zh/reference/define-eval.mdx +20 -14
- package/docs-site/zh/reference/define-experiment.mdx +18 -39
- package/docs-site/zh/reference/events.mdx +1 -1
- package/docs-site/zh/reference/expect.mdx +21 -0
- package/docs-site/zh/reference/official-adapters.mdx +12 -5
- package/docs-site/zh/troubleshooting/debugging.mdx +2 -2
- package/docs-site/zh/troubleshooting/recover-after-kill.mdx +1 -1
- package/docs-site/zh/tutorials/agent-onboarding.mdx +2 -2
- package/docs-site/zh/tutorials/authoring.mdx +2 -2
- package/docs-site/zh/tutorials/compare-runs.mdx +1 -1
- package/docs-site/zh/tutorials/concurrency.mdx +8 -8
- package/docs-site/zh/tutorials/configuration.mdx +5 -5
- package/docs-site/zh/tutorials/control-run-cost.mdx +19 -19
- package/docs-site/zh/tutorials/eval-groups.mdx +1 -1
- package/docs-site/zh/tutorials/evaluation-kinds.mdx +5 -5
- package/docs-site/zh/tutorials/experiment-services.mdx +32 -32
- package/docs-site/zh/tutorials/handle-execution-failures.mdx +2 -28
- package/docs-site/zh/tutorials/plugins.mdx +49 -143
- package/docs-site/zh/tutorials/sandbox-agent.mdx +1 -1
- package/docs-site/zh/tutorials/sandbox-reuse.mdx +7 -7
- package/docs-site/zh/tutorials/upgrade-0-18.mdx +1 -1
- package/docs-site/zh/tutorials/upgrade-0-19.mdx +121 -0
- package/docs-site/zh/tutorials/upgrade-0-20.mdx +12 -0
- package/docs-site/zh/tutorials/verify-judge.mdx +2 -2
- package/docs-site/zh/tutorials/viewing-results.mdx +2 -2
- package/docs-site/zh/tutorials/write-experiment.mdx +1 -1
- package/docs-site/zh/tutorials/write-send.mdx +13 -13
- package/package.json +1 -1
- package/dist/agents/effect-runtime.cjs.map +0 -1
- package/dist/agents/effect-runtime.d.cts +0 -29
- package/dist/agents/effect-runtime.d.mts +0 -29
- package/dist/agents/effect-runtime.d.ts +0 -29
- package/dist/agents/effect-runtime.js +0 -16
- package/dist/agents/effect-runtime.js.map +0 -1
- package/dist/agents/session-slot.cjs.map +0 -1
- package/dist/agents/session-slot.d.cts +0 -12
- package/dist/agents/session-slot.d.mts +0 -12
- package/dist/agents/session-slot.d.ts +0 -12
- package/dist/agents/session-slot.js +0 -6
- package/dist/agents/session-slot.js.map +0 -1
- package/dist/model-slots.js +0 -14
- package/dist/model-slots.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,yCAAoC;AACpC,mCAAwC;AACxC,6DAAiH;AACjH,+DAAyF;AACzF,0CAA8a;AAC9a,4CAA0D;AAC1D,6DAAkE;AAClE,iFAA0E;AAC1E,iEAA4E;AAC5E,4DAAgE;AAChE,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAiB,EAAE,CAAC,CAAC;AAC5F,MAAM,MAAM,GAAG,CAAC,KAA0B,EAAuB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5E,QAAA,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,sDAAsD,CAAC,EAAE,CAAC;IACvG,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,2CAA2C,CAAC,EAAE,CAAC;IAC3F,IAAI,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C,MAAM,CAAC;IAChG,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,4CAA4C;IACrD,OAAO,EAAE,yBAAiB;IAC1B,GAAG,EAAE,QAAQ;CAChB,CAAC,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { Effect, Result } from \"effect\";\nimport { CliArguments, CliInvocationFacts, CliOutput, type CliOptionDefinition } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution } from \"../../cli/contribution.ts\";\nimport { canonicalInspectionJson, canonicalJsonValue, decodeInspectionRequest, INSPECTION_OPERATION_IDS, InspectionIntegrityError, InspectionOperationError, InspectionSourceError, QUERY_PROTOCOL, externalInspectionSource, openInspectionSource, operationalInspectionSource, selectInspectionOperation, type InspectionDocument, type InspectionFailureDocument, type InspectionOperationId, type InspectionRequest, } from \"../index.ts\";\nimport { explainInspectionOperation } from \"../select.ts\";\nimport { SqliteRecordError } from \"../../record/sqlite/errors.ts\";\nimport { ProjectConfiguration } from \"../../cli/project-configuration.ts\";\nimport { CurrentTargetUnavailable } from \"../../experiment/host/current.ts\";\nimport { openCurrentProjectSource } from \"../project-source.ts\";\nconst help = (summary: string) => Object.freeze({ summary, visibility: \"public\" as const });\nconst option = (value: CliOptionDefinition): CliOptionDefinition => Object.freeze(value);\nexport const QUERY_CLI_OPTIONS = Object.freeze({\n request: option({ type: \"string\", help: help(\"Read one niceeval.query/v1 request from a file or -.\") }),\n record: option({ type: \"string\", help: help(\"Read an external canonical SQLite Record.\") }),\n help: option({ type: \"boolean\", short: \"h\", help: help(\"Print query help.\") }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\nconst QUERY_HELP = `niceeval query — execute one fixed Inspection operation\n\nUsage:\n niceeval query discover\n niceeval query explain [--record <file>] --request <file|->\n niceeval query run [--record <file>] --request <file|->\n`;\ntype Requirements = CliArguments | CliInvocationFacts | CliOutput | ProjectConfiguration;\ntype Error = CliFeatureError;\nconst QUERY_FAILURE_EXIT_CODE = 2;\nfunction failure(operation: string, cause: unknown): Error {\n return new CliFeatureError({ feature: \"inspection query\", operation, cause, exitCode: 1 });\n}\nfunction write(channel: \"stdout\" | \"stderr\", text: string) {\n return Effect.flatMap(CliOutput, (output) => channel === \"stdout\" ? output.writeStdout(text) : output.writeStderr(text)).pipe(Effect.mapError((cause) => failure(`write ${channel}`, cause)));\n}\nfunction usage(message: string) {\n return writeQueryFailure(failure(\"parse arguments\", new Error(message)));\n}\nfunction runQuery(argv: readonly string[]): Effect.Effect<number, Error, Requirements> {\n return Effect.gen(function* () {\n const parser = yield* CliArguments;\n const parsedResult = yield* Effect.try({\n try: () => parser.parse(argv, QUERY_CLI_OPTIONS),\n catch: (cause) => failure(\"parse arguments\", cause),\n }).pipe(Effect.result);\n if (Result.isFailure(parsedResult))\n return yield* writeQueryFailure(parsedResult.failure);\n const parsed = parsedResult.success;\n if (parsed.values.help === true) {\n yield* write(\"stdout\", QUERY_HELP);\n return 0;\n }\n const action = parsed.positionals[0];\n if (parsed.positionals.length !== 1 || (action !== \"discover\" && action !== \"explain\" && action !== \"run\")) {\n return yield* usage(\"niceeval query expects exactly one of discover, explain, or run.\");\n }\n if (action === \"discover\") {\n if (parsed.values.request !== undefined)\n return yield* usage(\"query discover does not accept --request.\");\n if (parsed.values.record !== undefined)\n return yield* usage(\"query discover does not accept --record.\");\n const encoded = canonicalJsonValue(Object.freeze({\n protocol: QUERY_PROTOCOL,\n outcome: \"discovery\" as const,\n operations: INSPECTION_OPERATION_IDS.map((id) => Object.freeze({ id })),\n }));\n if (Result.isFailure(encoded))\n return yield* writeQueryFailure(failure(\"encode discovery\", encoded.failure));\n yield* write(\"stdout\", encoded.success);\n return 0;\n }\n if (typeof parsed.values.request !== \"string\")\n return yield* usage(`query ${action} requires --request <file|->.`);\n let operation: InspectionOperationId | undefined;\n const result = yield* Effect.gen(function* () {\n const facts = yield* invocationFacts();\n const request = yield* readQueryRequest(parsed.values.request as string, facts.cwd);\n operation = request.operation.kind;\n const source = typeof parsed.values.record === \"string\"\n ? externalInspectionSource(facts.cwd, parsed.values.record)\n : operationalInspectionSource(facts.cwd);\n const document = yield* Effect.scoped(Effect.gen(function* () {\n const prepare = request.operation.kind === \"project.get\" && source.kind === \"project-record\"\n ? Effect.gen(function* () {\n const project = yield* ProjectConfiguration;\n const config = yield* project.load(facts.cwd).pipe(Effect.mapError((cause) => new CurrentTargetUnavailable({ code: \"current-target-unavailable\", reason: String(cause), cause })));\n return yield* openCurrentProjectSource({ cwd: facts.cwd, config });\n })\n : openInspectionSource(source);\n const inspectionFacts = yield* prepare.pipe(Effect.mapError((cause) => failure(\"open Record source\", cause)));\n return yield* Effect.try({\n try: () => action === \"explain\"\n ? explainInspectionOperation(inspectionFacts, request.operation)\n : selectInspectionOperation(inspectionFacts, request.operation),\n catch: (cause) => failure(`${action} Inspection operation`, cause),\n });\n }));\n yield* writeDocument(document);\n return 0;\n }).pipe(Effect.result);\n return Result.isSuccess(result)\n ? result.success\n : yield* writeQueryFailure(result.failure, operation);\n });\n}\nfunction invocationFacts() {\n return Effect.flatMap(CliInvocationFacts, ({ facts }) => facts).pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n}\nfunction readQueryRequest(pathname: string, cwd: string): Effect.Effect<InspectionRequest, Error> {\n return Effect.gen(function* () {\n const text = yield* Effect.tryPromise({\n try: () => pathname === \"-\" ? readStandardInput() : readFile(resolve(cwd, pathname), \"utf8\"),\n catch: (cause) => failure(\"read request\", cause),\n });\n if (Buffer.byteLength(text, \"utf8\") > 1048576)\n return yield* Effect.fail(failure(\"read request\", \"request exceeds 1 MiB\"));\n const value = yield* Effect.try({ try: () => JSON.parse(text) as unknown, catch: (cause) => failure(\"parse request JSON\", cause) });\n const decoded = decodeInspectionRequest(value);\n return Result.isFailure(decoded) ? yield* Effect.fail(failure(\"decode request\", decoded.failure)) : decoded.success;\n });\n}\nfunction readStandardInput(): Promise<string> {\n return new Promise((resolveInput, rejectInput) => {\n const chunks: Buffer[] = [];\n let byteLength = 0;\n const cleanup = (): void => {\n process.stdin.off(\"data\", onData);\n process.stdin.off(\"end\", onEnd);\n process.stdin.off(\"error\", onError);\n };\n const onData = (chunk: Buffer | string): void => {\n const bytes = typeof chunk === \"string\" ? Buffer.from(chunk) : chunk;\n byteLength += bytes.byteLength;\n if (byteLength > 1048576) {\n cleanup();\n rejectInput(new Error(\"request exceeds 1 MiB\"));\n }\n else\n chunks.push(bytes);\n };\n const onEnd = (): void => { cleanup(); resolveInput(Buffer.concat(chunks).toString(\"utf8\")); };\n const onError = (cause: Error): void => { cleanup(); rejectInput(cause); };\n process.stdin.on(\"data\", onData);\n process.stdin.once(\"end\", onEnd);\n process.stdin.once(\"error\", onError);\n process.stdin.resume();\n });\n}\nfunction writeDocument(document: InspectionDocument) {\n const encoded = canonicalInspectionJson(document);\n return Result.isFailure(encoded) ? Effect.fail(failure(\"encode result\", encoded.failure)) : write(\"stdout\", encoded.success);\n}\nfunction writeQueryFailure(error: Error, operation?: InspectionOperationId): Effect.Effect<number, Error, CliOutput> {\n const document = queryFailureDocument(error, operation);\n const encoded = canonicalJsonValue(document);\n if (Result.isFailure(encoded))\n return Effect.fail(failure(\"encode failure document\", encoded.failure));\n return Effect.gen(function* () {\n yield* write(\"stdout\", encoded.success);\n yield* write(\"stderr\", `niceeval query failed: ${document.failure.code}\\n`);\n return QUERY_FAILURE_EXIT_CODE;\n });\n}\nfunction queryFailureDocument(error: Error, operation?: InspectionOperationId): InspectionFailureDocument {\n const detail = queryFailureDetail(error);\n return Object.freeze({\n protocol: \"niceeval.query/v1\" as const,\n outcome: \"failure\" as const,\n operation: operation ?? null,\n failure: Object.freeze(detail),\n });\n}\nfunction queryFailureDetail(error: Error): InspectionFailureDocument[\"failure\"] {\n const cause = error.cause;\n if (cause instanceof CurrentTargetUnavailable || cause instanceof InspectionOperationError && cause.code === \"current-target-unavailable\")\n return {\n code: \"current-target-unavailable\", reason: `${cause.reason} Use overview.get or an exact run.get to read recorded results.`, correction: \"fix-request\",\n };\n if (cause instanceof InspectionOperationError) {\n if (cause.code === \"inspection-selection-missing\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"choose-existing-selection\" as const,\n });\n }\n if (cause.code === \"inspection-result-invalid\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"upgrade-or-report\" as const,\n });\n }\n if (cause.code === \"inspection-record-integrity-failure\") {\n return Object.freeze({\n code: cause.code,\n reason: \"The selected sealed Run does not form a closed Record publication.\",\n identity: cause.identity,\n correction: \"fix-record-source\" as const,\n });\n }\n if (cause.code === \"restart-required\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"restart\" as const,\n });\n }\n if (cause.code === \"evidence-budget-exceeded\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"retry\" as const,\n });\n }\n return Object.freeze({\n code: cause.code,\n reason: \"The fixed Inspection operation could not be completed.\",\n correction: \"retry\" as const,\n });\n }\n if (cause instanceof InspectionIntegrityError) {\n return Object.freeze({\n code: cause.code,\n reason: \"The selected sealed Run does not form a closed Record publication.\",\n identity: Object.freeze({ runId: cause.runId }),\n correction: \"fix-record-source\" as const,\n });\n }\n if (cause instanceof InspectionSourceError) {\n const recordError = cause.cause instanceof SqliteRecordError ? cause.cause : undefined;\n const operationalFailure = recordError?.code === \"record-write-busy\" || recordError?.code === \"record-resource-limit-exceeded\";\n const migrationRequired = recordError?.code === \"record-schema-migration-required\";\n const diagnostic = recordError === undefined ? cause.reason : `[${recordError.code}; ${recordError.operation}] ${cause.reason}`;\n return Object.freeze({\n code: operationalFailure ? \"inspection-operation-failed\" as const : \"inspection-source-invalid\" as const,\n reason: `The selected Record source could not be opened: ${diagnostic}${migrationRequired\n ? \" Stop old NiceEval processes and run a normal experiment in the original project to upgrade this supported format. External Records are never migrated in place.\"\n : \"\"}`,\n correction: recordError?.code === \"record-write-busy\" ? \"retry\" as const\n : recordError?.code === \"record-resource-limit-exceeded\" || recordError?.code === \"record-runtime-unsupported\"\n ? \"upgrade-or-report\" as const : \"fix-record-source\" as const,\n });\n }\n if (isInspectionCodecFailure(cause)) {\n return Object.freeze({\n code: cause.code,\n reason: cause.code === \"inspection-request-invalid\"\n ? \"The query request does not match niceeval.query/v1.\"\n : \"NiceEval could not encode the fixed Inspection result.\",\n correction: cause.code === \"inspection-request-invalid\"\n ? \"fix-request\" as const\n : \"upgrade-or-report\" as const,\n });\n }\n const requestFailure = [\"parse arguments\", \"read request\", \"parse request JSON\", \"decode request\"].includes(error.operation);\n return requestFailure\n ? Object.freeze({\n code: \"inspection-request-invalid\" as const,\n reason: \"The query request could not be read as niceeval.query/v1.\",\n correction: \"fix-request\" as const,\n })\n : Object.freeze({\n code: \"inspection-operation-failed\" as const,\n reason: \"The fixed Inspection operation could not be completed.\",\n correction: \"retry\" as const,\n });\n}\nfunction isInspectionCodecFailure(value: unknown): value is {\n readonly code: \"inspection-request-invalid\" | \"inspection-result-invalid\";\n} {\n return typeof value === \"object\" && value !== null &&\n (Reflect.get(value, \"code\") === \"inspection-request-invalid\" ||\n Reflect.get(value, \"code\") === \"inspection-result-invalid\");\n}\nexport const inspectionQueryCliCommand: CliCommandContribution<Requirements, Error> = Object.freeze({\n name: \"query\",\n summary: \"run one fixed machine Inspection operation\",\n options: QUERY_CLI_OPTIONS,\n run: runQuery,\n});\n"]}
|
|
1
|
+
{"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,yCAAoC;AACpC,mCAAwC;AACxC,6DAAiH;AACjH,+DAAyF;AACzF,0CAAiY;AACjY,kDAA8E;AAC9E,4CAA0D;AAC1D,6DAAkE;AAClE,iFAA0E;AAC1E,iEAA4E;AAC5E,4DAAgE;AAChE,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAiB,EAAE,CAAC,CAAC;AAC5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sC;YAC5C,MAAM,EAAE,wDAAwD;YAChE,UAAU,EAAE,OAAgB;SAC/B,CAAC,CAAC;AACX,CAAC;AACD,SAAS,wBAAwB,CAAC,KAAc;IAG5C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAC9C,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,4BAA4B;YACxD,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,2BAA2B,CAAC,CAAC;AACxE,CAAC;AACY,QAAA,yBAAyB,GAAgD,MAAM,CAAC,MAAM,CAAC;IAChG,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,4CAA4C;IACrD,OAAO,EAAE,yBAAiB;IAC1B,GAAG,EAAE,QAAQ;CAChB,CAAC,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { Effect, Result } from \"effect\";\nimport { CliArguments, CliInvocationFacts, CliOutput, type CliOptionDefinition } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution } from \"../../cli/contribution.ts\";\nimport { decodeInspectionRequest, INSPECTION_OPERATION_IDS, InspectionIntegrityError, InspectionOperationError, InspectionSourceError, QUERY_PROTOCOL, externalInspectionSource, openInspectionSource, operationalInspectionSource, selectInspectionOperation, type InspectionDocument, type InspectionFailureDocument, type InspectionOperationId, type InspectionRequest, } from \"../index.ts\";\nimport { canonicalInspectionJson, canonicalJsonValue } from \"../canonical.ts\";\nimport { explainInspectionOperation } from \"../select.ts\";\nimport { SqliteRecordError } from \"../../record/sqlite/errors.ts\";\nimport { ProjectConfiguration } from \"../../cli/project-configuration.ts\";\nimport { CurrentTargetUnavailable } from \"../../experiment/host/current.ts\";\nimport { openCurrentProjectSource } from \"../project-source.ts\";\nconst help = (summary: string) => Object.freeze({ summary, visibility: \"public\" as const });\nconst option = (value: CliOptionDefinition): CliOptionDefinition => Object.freeze(value);\nexport const QUERY_CLI_OPTIONS = Object.freeze({\n request: option({ type: \"string\", help: help(\"Read one niceeval.query/v2 request from a file or -.\") }),\n record: option({ type: \"string\", help: help(\"Read an external canonical SQLite Record.\") }),\n help: option({ type: \"boolean\", short: \"h\", help: help(\"Print query help.\") }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\nconst QUERY_HELP = `niceeval query — execute one fixed Inspection operation\n\nUsage:\n niceeval query discover\n niceeval query explain [--record <file>] --request <file|->\n niceeval query run [--record <file>] --request <file|->\n`;\ntype Requirements = CliArguments | CliInvocationFacts | CliOutput | ProjectConfiguration;\ntype Error = CliFeatureError;\nconst QUERY_FAILURE_EXIT_CODE = 2;\nfunction failure(operation: string, cause: unknown): Error {\n return new CliFeatureError({ feature: \"inspection query\", operation, cause, exitCode: 1 });\n}\nfunction write(channel: \"stdout\" | \"stderr\", text: string) {\n return Effect.flatMap(CliOutput, (output) => channel === \"stdout\" ? output.writeStdout(text) : output.writeStderr(text)).pipe(Effect.mapError((cause) => failure(`write ${channel}`, cause)));\n}\nfunction usage(message: string) {\n return writeQueryFailure(failure(\"parse arguments\", new Error(message)));\n}\nfunction runQuery(argv: readonly string[]): Effect.Effect<number, Error, Requirements> {\n return Effect.gen(function* () {\n const parser = yield* CliArguments;\n const parsedResult = yield* Effect.try({\n try: () => parser.parse(argv, QUERY_CLI_OPTIONS),\n catch: (cause) => failure(\"parse arguments\", cause),\n }).pipe(Effect.result);\n if (Result.isFailure(parsedResult))\n return yield* writeQueryFailure(parsedResult.failure);\n const parsed = parsedResult.success;\n if (parsed.values.help === true) {\n yield* write(\"stdout\", QUERY_HELP);\n return 0;\n }\n const action = parsed.positionals[0];\n if (parsed.positionals.length !== 1 || (action !== \"discover\" && action !== \"explain\" && action !== \"run\")) {\n return yield* usage(\"niceeval query expects exactly one of discover, explain, or run.\");\n }\n if (action === \"discover\") {\n if (parsed.values.request !== undefined)\n return yield* usage(\"query discover does not accept --request.\");\n if (parsed.values.record !== undefined)\n return yield* usage(\"query discover does not accept --record.\");\n const encoded = canonicalJsonValue(Object.freeze({\n protocol: QUERY_PROTOCOL,\n outcome: \"discovery\" as const,\n operations: INSPECTION_OPERATION_IDS.map((id) => Object.freeze({ id })),\n }));\n if (Result.isFailure(encoded))\n return yield* writeQueryFailure(failure(\"encode discovery\", encoded.failure));\n yield* write(\"stdout\", encoded.success);\n return 0;\n }\n if (typeof parsed.values.request !== \"string\")\n return yield* usage(`query ${action} requires --request <file|->.`);\n let operation: InspectionOperationId | undefined;\n const result = yield* Effect.gen(function* () {\n const facts = yield* invocationFacts();\n const request = yield* readQueryRequest(parsed.values.request as string, facts.cwd);\n operation = request.operation.kind;\n const source = typeof parsed.values.record === \"string\"\n ? externalInspectionSource(facts.cwd, parsed.values.record)\n : operationalInspectionSource(facts.cwd);\n const document = yield* Effect.scoped(Effect.gen(function* () {\n const prepare = request.operation.kind === \"project.get\" && source.kind === \"project-record\"\n ? Effect.gen(function* () {\n const project = yield* ProjectConfiguration;\n const config = yield* project.load(facts.cwd).pipe(Effect.mapError((cause) => new CurrentTargetUnavailable({ code: \"current-target-unavailable\", reason: String(cause), cause })));\n return yield* openCurrentProjectSource({ cwd: facts.cwd, config });\n })\n : openInspectionSource(source);\n const inspectionFacts = yield* prepare.pipe(Effect.mapError((cause) => failure(\"open Record source\", cause)));\n return yield* Effect.try({\n try: () => action === \"explain\"\n ? explainInspectionOperation(inspectionFacts, request.operation)\n : selectInspectionOperation(inspectionFacts, request.operation),\n catch: (cause) => failure(`${action} Inspection operation`, cause),\n });\n }));\n yield* writeDocument(document);\n return 0;\n }).pipe(Effect.result);\n return Result.isSuccess(result)\n ? result.success\n : yield* writeQueryFailure(result.failure, operation);\n });\n}\nfunction invocationFacts() {\n return Effect.flatMap(CliInvocationFacts, ({ facts }) => facts).pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n}\nfunction readQueryRequest(pathname: string, cwd: string): Effect.Effect<InspectionRequest, Error> {\n return Effect.gen(function* () {\n const text = yield* Effect.tryPromise({\n try: () => pathname === \"-\" ? readStandardInput() : readFile(resolve(cwd, pathname), \"utf8\"),\n catch: (cause) => failure(\"read request\", cause),\n });\n if (Buffer.byteLength(text, \"utf8\") > 1048576)\n return yield* Effect.fail(failure(\"read request\", \"request exceeds 1 MiB\"));\n const value = yield* Effect.try({ try: () => JSON.parse(text) as unknown, catch: (cause) => failure(\"parse request JSON\", cause) });\n const decoded = decodeInspectionRequest(value);\n return Result.isFailure(decoded) ? yield* Effect.fail(failure(\"decode request\", decoded.failure)) : decoded.success;\n });\n}\nfunction readStandardInput(): Promise<string> {\n return new Promise((resolveInput, rejectInput) => {\n const chunks: Buffer[] = [];\n let byteLength = 0;\n const cleanup = (): void => {\n process.stdin.off(\"data\", onData);\n process.stdin.off(\"end\", onEnd);\n process.stdin.off(\"error\", onError);\n };\n const onData = (chunk: Buffer | string): void => {\n const bytes = typeof chunk === \"string\" ? Buffer.from(chunk) : chunk;\n byteLength += bytes.byteLength;\n if (byteLength > 1048576) {\n cleanup();\n rejectInput(new Error(\"request exceeds 1 MiB\"));\n }\n else\n chunks.push(bytes);\n };\n const onEnd = (): void => { cleanup(); resolveInput(Buffer.concat(chunks).toString(\"utf8\")); };\n const onError = (cause: Error): void => { cleanup(); rejectInput(cause); };\n process.stdin.on(\"data\", onData);\n process.stdin.once(\"end\", onEnd);\n process.stdin.once(\"error\", onError);\n process.stdin.resume();\n });\n}\nfunction writeDocument(document: InspectionDocument) {\n const encoded = canonicalInspectionJson(document);\n return Result.isFailure(encoded) ? Effect.fail(failure(\"encode result\", encoded.failure)) : write(\"stdout\", encoded.success);\n}\nfunction writeQueryFailure(error: Error, operation?: InspectionOperationId): Effect.Effect<number, Error, CliOutput> {\n const document = queryFailureDocument(error, operation);\n const encoded = canonicalJsonValue(document);\n if (Result.isFailure(encoded))\n return Effect.fail(failure(\"encode failure document\", encoded.failure));\n return Effect.gen(function* () {\n yield* write(\"stdout\", encoded.success);\n yield* write(\"stderr\", `niceeval query failed: ${document.failure.code}\\n`);\n return QUERY_FAILURE_EXIT_CODE;\n });\n}\nfunction queryFailureDocument(error: Error, operation?: InspectionOperationId): InspectionFailureDocument {\n const detail = queryFailureDetail(error);\n return Object.freeze({\n protocol: \"niceeval.query/v2\" as const,\n outcome: \"failure\" as const,\n operation: operation ?? null,\n failure: Object.freeze(detail),\n });\n}\nfunction queryFailureDetail(error: Error): InspectionFailureDocument[\"failure\"] {\n const cause = error.cause;\n if (cause instanceof CurrentTargetUnavailable || cause instanceof InspectionOperationError && cause.code === \"current-target-unavailable\")\n return {\n code: \"current-target-unavailable\", reason: `${cause.reason} Use overview.get or an exact run.get to read recorded results.`, correction: \"fix-request\",\n };\n if (cause instanceof InspectionOperationError) {\n if (cause.code === \"inspection-selection-missing\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"choose-existing-selection\" as const,\n });\n }\n if (cause.code === \"inspection-result-invalid\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"upgrade-or-report\" as const,\n });\n }\n if (cause.code === \"inspection-record-integrity-failure\") {\n return Object.freeze({\n code: cause.code,\n reason: \"The selected sealed Run does not form a closed Record publication.\",\n identity: cause.identity,\n correction: \"fix-record-source\" as const,\n });\n }\n if (cause.code === \"restart-required\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"restart\" as const,\n });\n }\n if (cause.code === \"evidence-budget-exceeded\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"retry\" as const,\n });\n }\n return Object.freeze({\n code: cause.code,\n reason: \"The fixed Inspection operation could not be completed.\",\n correction: \"retry\" as const,\n });\n }\n if (cause instanceof InspectionIntegrityError) {\n return Object.freeze({\n code: cause.code,\n reason: \"The selected sealed Run does not form a closed Record publication.\",\n identity: Object.freeze({ runId: cause.runId }),\n correction: \"fix-record-source\" as const,\n });\n }\n if (cause instanceof InspectionSourceError) {\n const recordError = cause.cause instanceof SqliteRecordError ? cause.cause : undefined;\n const operationalFailure = recordError?.code === \"record-write-busy\" || recordError?.code === \"record-resource-limit-exceeded\";\n const migrationRequired = recordError?.code === \"record-schema-migration-required\";\n const diagnostic = recordError === undefined ? cause.reason : `[${recordError.code}; ${recordError.operation}] ${cause.reason}`;\n return Object.freeze({\n code: operationalFailure ? \"inspection-operation-failed\" as const : \"inspection-source-invalid\" as const,\n reason: `The selected Record source could not be opened: ${diagnostic}${migrationRequired\n ? \" Stop old NiceEval processes and run a normal experiment in the original project to upgrade this supported format. External Records are never migrated in place.\"\n : \"\"}`,\n correction: recordError?.code === \"record-write-busy\" ? \"retry\" as const\n : recordError?.code === \"record-resource-limit-exceeded\" || recordError?.code === \"record-runtime-unsupported\"\n ? \"upgrade-or-report\" as const : \"fix-record-source\" as const,\n });\n }\n if (isInspectionCodecFailure(cause)) {\n return Object.freeze({\n code: cause.code,\n reason: cause.code === \"inspection-request-invalid\"\n ? \"The query request does not match niceeval.query/v2.\"\n : \"NiceEval could not encode the fixed Inspection result.\",\n correction: cause.code === \"inspection-request-invalid\"\n ? \"fix-request\" as const\n : \"upgrade-or-report\" as const,\n });\n }\n const requestFailure = [\"parse arguments\", \"read request\", \"parse request JSON\", \"decode request\"].includes(error.operation);\n return requestFailure\n ? Object.freeze({\n code: \"inspection-request-invalid\" as const,\n reason: \"The query request could not be read as niceeval.query/v2.\",\n correction: \"fix-request\" as const,\n })\n : Object.freeze({\n code: \"inspection-operation-failed\" as const,\n reason: \"The fixed Inspection operation could not be completed.\",\n correction: \"retry\" as const,\n });\n}\nfunction isInspectionCodecFailure(value: unknown): value is {\n readonly code: \"inspection-request-invalid\" | \"inspection-result-invalid\";\n} {\n return typeof value === \"object\" && value !== null &&\n (Reflect.get(value, \"code\") === \"inspection-request-invalid\" ||\n Reflect.get(value, \"code\") === \"inspection-result-invalid\");\n}\nexport const inspectionQueryCliCommand: CliCommandContribution<Requirements, Error> = Object.freeze({\n name: \"query\",\n summary: \"run one fixed machine Inspection operation\",\n options: QUERY_CLI_OPTIONS,\n run: runQuery,\n});\n"]}
|
|
@@ -10,7 +10,7 @@ exports.resolveInspectionResourceMemberAttempt = resolveInspectionResourceMember
|
|
|
10
10
|
exports.attemptAttachment = attemptAttachment;
|
|
11
11
|
exports.runAttachment = runAttachment;
|
|
12
12
|
exports.readInspectionAssertions = readInspectionAssertions;
|
|
13
|
-
// @concord-file
|
|
13
|
+
// @concord-file
|
|
14
14
|
// @concord-implements docs/feature/inspection/README.md
|
|
15
15
|
// @concord-implements docs/feature/inspection/architecture.md
|
|
16
16
|
// @concord-implements docs/feature/inspection/use-case/inspection-check-completeness.md
|
|
@@ -44,7 +44,7 @@ function readInspectionRun(source, runId) {
|
|
|
44
44
|
* Pins the source cutoff, exhausts the fixed Run-summary pagination, then
|
|
45
45
|
* reads and strictly decodes every Run Core in that exact sealed generation.
|
|
46
46
|
*/
|
|
47
|
-
// @concord-code
|
|
47
|
+
// @concord-code
|
|
48
48
|
// @concord-implements docs/feature/inspection/architecture.md
|
|
49
49
|
// @concord-implements docs/feature/inspection/use-case/inspection-check-completeness.md
|
|
50
50
|
function loadInspectionRuns(source) {
|
|
@@ -254,7 +254,7 @@ function decodeInspectionRun(source, physical) {
|
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
256
|
/** Resolves a public locator through the source's bounded exact index. */
|
|
257
|
-
// @concord-code
|
|
257
|
+
// @concord-code
|
|
258
258
|
// @concord-implements docs/feature/inspection/architecture.md
|
|
259
259
|
function resolveInspectionAttempt(source, locator) {
|
|
260
260
|
const projection = source.findAttemptLocatorCandidates(locator, ATTEMPT_CANDIDATE_RUN_LIMIT);
|
|
@@ -372,7 +372,7 @@ function runAttachment(run, family) {
|
|
|
372
372
|
return run.attachments.find(({ physical }) => physical.ownerKind === "run" && physical.family === family);
|
|
373
373
|
}
|
|
374
374
|
/** Reads only the current logical Assertions family, preserving failure state. */
|
|
375
|
-
// @concord-code
|
|
375
|
+
// @concord-code
|
|
376
376
|
// @concord-implements docs/feature/assertions/README.md
|
|
377
377
|
// @concord-implements docs/feature/inspection/README.md
|
|
378
378
|
function readInspectionAssertions(resolved) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facts.js","sourceRoot":"","sources":["facts.ts"],"names":[],"mappings":";;AAqFA,gDA4CC;AAED,gEAUC;AAED,8DAoDC;AAqBD,kDA0EC;AAID,4DAiDC;AAwCD,wEAaC;AAED,wFAUC;AACD,8CAIC;AACD,sCAEC;AAKD,4DA+BC;AApcD,gDAAgD;AAChD,wDAAwD;AACxD,8DAA8D;AAC9D,wFAAwF;AACxF,mCAAwC;AACxC,8DAA6D;AAC7D,gEAAqG;AACrG,kEAA8M;AAC9M,qDAA6J;AAC7J,4DAA2G;AAI3G,yCAA+F;AAE/F,yCAA8C;AA6C9C,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,2BAA2B,GAAG,EAAE,CAAC;AACvC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AACxC,MAAM,WAAW,GAAG,IAAI,OAAO,EAA0D,CAAC;AAC1F,SAAS,iBAAiB,CAAC,MAA4B,EAAE,KAAa;IAClE,IAAI,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,KAAK,KAAK,SAAS;QACnB,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,MAAM,KAAK,SAAS;QACpB,OAAO,MAAM,CAAC;IAClB,MAAM,QAAQ,GAAG,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACjD,IAAI,QAAQ,KAAK,SAAS;QACtB,OAAO,SAAS,CAAC;IACrB,MAAM,OAAO,GAAG,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtD,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC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BAAgB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,KAAK,MAAM;QAC3D,MAAM,UAAU,CAAC,GAAG,KAAK,oBAAoB,CAAC,CAAC;AACvD,CAAC;AACD,SAAS,iBAAiB,CAAC,KAAiB,EAAE,MAAc,EAAE,KAAa;IACvE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACnC,OAAO,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC","sourcesContent":["// @concord-file ne-eval-inspection-facts-reader\n// @concord-implements docs/feature/inspection/README.md\n// @concord-implements docs/feature/inspection/architecture.md\n// @concord-implements docs/feature/inspection/use-case/inspection-check-completeness.md\nimport { Result, Schema } from \"effect\";\nimport { encodeAttemptLocator } from \"../attempt-locator.ts\";\nimport { mintRecordContentHandle, type RecordContentHandle, } from \"../record/attachment/content.ts\";\nimport { enumerateRecordAttachmentClosure, hydrateRecordAttachmentCurrent, mintRecordAttachmentReference, RecordAttachmentReference, recordAttachmentReferenceWire, } from \"../record/attachment/protocol.ts\";\nimport { decodeAttemptDocument, decodeMemberDocument, decodeRunDocument, RecordExactParseOptions, RecordSlotIdentitySchema, } from \"../record/codec/core.ts\";\nimport { NiceEvalCurrentRecordAttachments, NiceEvalRecordAttachments, } from \"../record/family/current.ts\";\nimport type { AssertionsAttachment } from \"../record/family/assertions/definition.ts\";\nimport type { AttemptDocument, MemberDocument, RunDocument, } from \"../record/model/core.ts\";\nimport type { PersistedContentMetadata, SealedAttachmentMetadata, SealedRunCore, SealedRunSummary, } from \"../record/sqlite/types.ts\";\nimport { closeInspectionJson, isInspectionCodecError, type InspectionJson, } from \"./codec.ts\";\nimport type { InspectionFactSource } from \"./source.ts\";\nimport { InspectionSha256 } from \"./bytes.ts\";\nimport type { ReadableRunResource } from \"../run/storage/types.ts\";\nexport interface DecodedInspectionAttachment {\n readonly physical: SealedAttachmentMetadata;\n readonly value: InspectionJson;\n}\n/** A strictly decoded sealed Run with its browser-neutral reader capability. */\nexport interface LoadedInspectionRun {\n readonly source: InspectionFactSource;\n readonly physical: SealedRunCore;\n readonly run: RunDocument;\n readonly members: readonly MemberDocument[];\n readonly attempts: readonly AttemptDocument[];\n readonly attachments: readonly DecodedInspectionAttachment[];\n}\n/** Exact lifecycle resource plus its optional published Core at one cutoff. */\nexport interface LoadedInspectionRunResource {\n readonly source: InspectionFactSource;\n readonly resource: ReadableRunResource;\n readonly members: readonly MemberDocument[];\n readonly supporting: readonly LoadedInspectionRun[];\n readonly published?: LoadedInspectionRun;\n}\nexport interface InspectionAttemptTarget {\n readonly run: LoadedInspectionRun;\n readonly member: MemberDocument;\n}\n/** Exact origin Attempt plus every target membership visible to the resolver. */\nexport interface ResolvedInspectionAttempt {\n readonly attempt: AttemptDocument;\n readonly origin: LoadedInspectionRun;\n readonly locator: string;\n readonly targets: readonly InspectionAttemptTarget[];\n}\nexport type InspectionAssertionsRead = {\n readonly state: \"available\";\n readonly attachment: DecodedInspectionAttachment;\n readonly value: AssertionsAttachment;\n readonly contents: WeakMap<object, PersistedContentMetadata>;\n readonly issues: readonly InspectionJson[];\n} | {\n readonly state: \"not-recorded\" | \"unsupported\" | \"failed\";\n readonly attachment?: DecodedInspectionAttachment;\n readonly issues: readonly InspectionJson[];\n};\nconst RUN_PAGE_SIZE = 100;\nconst ATTEMPT_CANDIDATE_RUN_LIMIT = 64;\nconst ATTEMPT_TARGET_MEMBER_LIMIT = 256;\nconst decodedRuns = new WeakMap<InspectionFactSource, Map<string, LoadedInspectionRun>>();\nfunction readInspectionRun(source: InspectionFactSource, runId: string): LoadedInspectionRun | undefined {\n let cache = decodedRuns.get(source);\n if (cache === undefined)\n decodedRuns.set(source, cache = new Map());\n const cached = cache.get(runId);\n if (cached !== undefined)\n return cached;\n const physical = source.readSealedRunCore(runId);\n if (physical === undefined)\n return undefined;\n const decoded = decodeInspectionRun(source, physical);\n cache.set(runId, decoded);\n return decoded;\n}\n/**\n * Pins the source cutoff, exhausts the fixed Run-summary pagination, then\n * reads and strictly decodes every Run Core in that exact sealed generation.\n */\n// @concord-code ne-eval-inspection-load-runs\n// @concord-implements docs/feature/inspection/architecture.md\n// @concord-implements docs/feature/inspection/use-case/inspection-check-completeness.md\nexport function loadInspectionRuns(source: InspectionFactSource): readonly LoadedInspectionRun[] {\n const cutoff = source.cutoff();\n const summaries: SealedRunSummary[] = [];\n const seen = new Set<string>();\n let expectedRunCount: number | undefined;\n let afterRunId = \"\";\n for (;;) {\n const page = source.readSealedRunSummaryPage(afterRunId, RUN_PAGE_SIZE, cutoff.identity);\n if (page.cutoff.identity !== cutoff.identity ||\n expectedRunCount !== undefined && page.cutoff.runCount !== expectedRunCount) {\n throw factsError(\"Run inventory changed its pinned cutoff or count\");\n }\n expectedRunCount ??= page.cutoff.runCount;\n if (page.afterRunId !== afterRunId) {\n throw factsError(\"Run pagination returned a different cursor\");\n }\n let previous = afterRunId;\n for (const summary of page.summaries) {\n if (summary.runId <= previous || seen.has(summary.runId)) {\n throw factsError(\"Run pagination is not strictly ordered\");\n }\n seen.add(summary.runId);\n summaries.push(summary);\n previous = summary.runId;\n }\n if (page.nextAfterRunId === null)\n break;\n if (page.summaries.length === 0 ||\n page.nextAfterRunId !== page.summaries.at(-1)!.runId ||\n page.nextAfterRunId === afterRunId) {\n throw factsError(\"Run pagination returned an invalid continuation cursor\");\n }\n afterRunId = page.nextAfterRunId;\n }\n if (summaries.length !== expectedRunCount) {\n throw factsError(\"Run pagination did not close the pinned sealed cutoff\");\n }\n return Object.freeze(summaries.map((summary) => {\n const run = readInspectionRun(source, summary.runId);\n if (run === undefined) {\n throw factsError(`Sealed Run ${summary.runId} disappeared from the pinned cutoff`);\n }\n return run;\n }));\n}\n/** Reads a bounded, explicit Run selection without changing its caller order. */\nexport function loadSelectedInspectionRuns(source: InspectionFactSource, runIds: readonly string[]): readonly LoadedInspectionRun[] {\n const cutoff = source.cutoff();\n const loaded: LoadedInspectionRun[] = [];\n for (const runId of new Set(runIds)) {\n const run = readInspectionRun(source, runId);\n if (run !== undefined)\n loaded.push(run);\n }\n requireCutoff(source.cutoff(), cutoff);\n return Object.freeze(loaded);\n}\n/** Reads Run create/close facts even when no Attempt Core has been published. */\nexport function loadInspectionRunResource(source: InspectionFactSource, runId: string): LoadedInspectionRunResource | undefined {\n const cutoff = source.cutoff();\n const resource = source.readRunResource(runId);\n if (resource === undefined)\n return undefined;\n const published = readInspectionRun(source, runId);\n if (published !== undefined)\n validateRunResourceCore(resource, published);\n const originIds = resource.slots.flatMap(({ publication }) => publication.state === \"published\" ? [publication.originRunId] : []);\n const supporting = loadSelectedInspectionRuns(source, [\n ...(published === undefined ? [] : [runId]), ...originIds,\n ]);\n const index = memberIndex(supporting);\n const publications = new Map<string, SealedRunCore[\"attempts\"][number]>(supporting.flatMap((origin) => origin.physical.attempts.map((attempt) => [\n `${origin.run.runId}\\u0000${attempt.attemptId}`, attempt,\n ] as const)));\n const members = resource.slots.flatMap(({ slotId, publication }): readonly MemberDocument[] => {\n if (publication.state === \"pending\")\n return [];\n if (publication.state === \"absent\") {\n return [decodedRight(decodeMemberDocument({\n slotId,\n action: publication.reason === \"interrupted-before-publication\" || publication.reason === \"dispatch-failed\"\n ? \"interrupted\" : \"not-dispatched\",\n attempt: null,\n absenceReason: publication.reason,\n }), \"Run resource absence is invalid\")];\n }\n const origin = index.origins.get(publication.originRunId);\n const attempt = origin?.attempts.get(publication.attemptId);\n const stored = publications.get(`${publication.originRunId}\\u0000${publication.attemptId}`);\n if (attempt === undefined || stored === undefined ||\n attempt.slotId !== publication.originSlotId ||\n stored.attemptLocator !== publication.attemptLocator ||\n stored.publicationIdentity?.originRunId !== publication.publicationIdentity.originRunId ||\n stored.publicationIdentity?.attemptId !== publication.publicationIdentity.attemptId ||\n stored.publicationIdentity?.revision !== publication.publicationIdentity.revision ||\n publication.publicationIdentity.originRunId !== publication.originRunId ||\n publication.publicationIdentity.attemptId !== publication.attemptId ||\n publication.action === \"executed\" && publication.originRunId !== runId) {\n throw factsError(`Run ${runId} Slot ${slotId} does not bind a matching published origin Attempt`);\n }\n return [decodedRight(decodeMemberDocument({\n slotId, action: publication.action,\n attempt: { originRunId: publication.originRunId, attemptId: publication.attemptId },\n }), \"Run resource binding is invalid\")];\n }).sort((left, right) => compareText(left.slotId, right.slotId));\n requireCutoff(source.cutoff(), cutoff);\n return Object.freeze({\n source, resource, members: Object.freeze(members), supporting,\n ...(published === undefined ? {} : { published }),\n });\n}\nfunction validateRunResourceCore(resource: ReadableRunResource, published: LoadedInspectionRun): void {\n const run = published.run;\n if (run.runId !== resource.runId ||\n run.experimentId !== resource.experimentId ||\n run.startedAt !== Date.parse(resource.startedAt) ||\n run.expectedSlots.length !== resource.slots.length) {\n throw factsError(`Run ${resource.runId} lifecycle resource does not match its published Core`);\n }\n for (const [index, slot] of run.expectedSlots.entries()) {\n const expected = resource.slots[index];\n if (expected === undefined ||\n slot.slotId !== expected.slotId ||\n slot.evalId !== expected.evalId ||\n slot.attemptOrdinal !== expected.attemptOrdinal ||\n slot.executionIdentityDigest !== expected.executionIdentityDigest) {\n throw factsError(`Run ${resource.runId} expected Slot does not match its published Core`);\n }\n }\n}\n/** Strictly decodes Core, then decodes each Attachment only on first use. */\nexport function decodeInspectionRun(source: InspectionFactSource, physical: SealedRunCore): LoadedInspectionRun {\n const run = decodedRight(decodeRunDocument(parseVerifiedJson(physical.runCoreBytes, physical.runCoreDigest, \"Run Core\")), \"Run Core is invalid\");\n if (run.runId !== physical.runId) {\n throw factsError(\"Run Core identity does not match its sealed row\");\n }\n if (physical.slots.length !== run.expectedSlots.length) {\n throw factsError(\"Run Core Slot rows do not match its expected denominator\");\n }\n for (const [index, stored] of physical.slots.entries()) {\n const decoded = Schema.decodeUnknownResult(RecordSlotIdentitySchema, RecordExactParseOptions)(parseVerifiedJson(stored.coreBytes, stored.coreDigest, \"Slot Core\"));\n const slot = decodedRight(decoded, \"Slot Core is invalid\");\n const expected = run.expectedSlots[index];\n if (expected === undefined ||\n stored.ordinal !== index ||\n stored.slotId !== slot.slotId ||\n slot.slotId !== expected.slotId ||\n slot.evalId !== expected.evalId ||\n slot.attemptOrdinal !== expected.attemptOrdinal ||\n slot.executionIdentityDigest !== expected.executionIdentityDigest) {\n throw factsError(\"Slot Core does not match its sealed Run denominator\");\n }\n }\n const members = physical.members.map((stored) => {\n const member = decodedRight(decodeMemberDocument(parseVerifiedJson(stored.coreBytes, stored.coreDigest, \"Member Core\")), \"Member Core is invalid\");\n if (member.slotId !== stored.slotId ||\n member.action !== stored.action ||\n (member.attempt?.originRunId ?? undefined) !== stored.originRunId ||\n (member.attempt?.attemptId ?? undefined) !== stored.attemptId) {\n throw factsError(\"Member Core does not match its sealed row\");\n }\n return member;\n });\n const attempts = physical.attempts.map((stored) => {\n const attempt = decodedRight(decodeAttemptDocument(parseVerifiedJson(stored.coreBytes, stored.coreDigest, \"Attempt Core\")), \"Attempt Core is invalid\");\n if (attempt.attemptId !== stored.attemptId ||\n attempt.originRunId !== run.runId ||\n encodeAttemptLocator(attempt.attemptId) !== stored.attemptLocator) {\n throw factsError(\"Attempt Core does not match its sealed row\");\n }\n return attempt;\n });\n validateCoreRelations(run, members, attempts, physical.publicationManaged === true);\n const localAttemptIds = new Set<string>(attempts.map(({ attemptId }) => attemptId));\n const attachments = physical.attachments.map((attachment): DecodedInspectionAttachment => {\n if (attachment.ownerRunId !== run.runId ||\n attachment.ownerKind === \"run\" && attachment.ownerAttemptId !== undefined ||\n attachment.ownerKind === \"attempt\" &&\n (attachment.ownerAttemptId === undefined ||\n !localAttemptIds.has(attachment.ownerAttemptId))) {\n throw factsError(\"Attachment ownership does not match its sealed Run\");\n }\n let value: InspectionJson | undefined;\n let decoded = false;\n return Object.freeze({\n physical: attachment,\n get value(): InspectionJson {\n if (!decoded) {\n verifyDigest(attachment.canonicalBytes, attachment.canonicalDigest, \"Attachment\");\n verifyDigest(attachment.logicalInventoryBytes, attachment.inventoryDigest, \"Attachment inventory\");\n value = parseInspectionJson(attachment.canonicalBytes, \"Attachment\");\n decoded = true;\n }\n return value!;\n },\n });\n });\n return Object.freeze({\n source,\n physical,\n run,\n members: Object.freeze(members),\n attempts: Object.freeze(attempts),\n attachments: Object.freeze(attachments),\n });\n}\n/** Resolves a public locator through the source's bounded exact index. */\n// @concord-code ne-eval-inspection-resolve-attempt\n// @concord-implements docs/feature/inspection/architecture.md\nexport function resolveInspectionAttempt(source: InspectionFactSource, locator: string): ResolvedInspectionAttempt | undefined {\n const projection = source.findAttemptLocatorCandidates(locator, ATTEMPT_CANDIDATE_RUN_LIMIT);\n if (projection.candidates.length === 0)\n return undefined;\n if (projection.ambiguous)\n return undefined;\n const origins = projection.candidates.filter(({ relation }) => relation === \"origin\");\n if (origins.length !== 1) {\n throw factsError(`Attempt ${locator} indexed projection is invalid`);\n }\n const identity = origins[0]!;\n const runs = loadSelectedInspectionRuns(source, projection.candidates.map(({ runId }) => runId));\n const byRunId = new Map<string, LoadedInspectionRun>(runs.map((run) => [run.run.runId, run] as const));\n const origin = byRunId.get(identity.originRunId);\n if (origin === undefined) {\n throw factsError(`Attempt ${locator} origin is not a sealed Run`);\n }\n const attempt = origin.attempts.find((candidate) => candidate.attemptId === identity.attemptId &&\n candidate.originRunId === identity.originRunId &&\n encodeAttemptLocator(candidate.attemptId) === locator);\n if (attempt === undefined) {\n throw factsError(`Attempt ${locator} origin Core is invalid`);\n }\n const targets: InspectionAttemptTarget[] = [];\n const targetRunIds = new Set(projection.candidates.flatMap((candidate) => candidate.relation === \"target\" &&\n candidate.originRunId === identity.originRunId &&\n candidate.attemptId === identity.attemptId\n ? [candidate.runId]\n : []));\n for (const runId of targetRunIds) {\n const run = byRunId.get(runId);\n if (run === undefined) {\n throw factsError(`Attempt ${locator} target is not a sealed Run`);\n }\n const members = targetMembers(run, attempt);\n if (members.length === 0) {\n throw factsError(`Attempt ${locator} target Core is invalid`);\n }\n if (targets.length + members.length > ATTEMPT_TARGET_MEMBER_LIMIT) {\n throw factsError(`Attempt ${locator} exceeds its fixed target member limit`);\n }\n targets.push(...members.map((member) => Object.freeze({ run, member })));\n }\n return Object.freeze({\n attempt,\n origin,\n locator,\n targets: Object.freeze(targets),\n });\n}\ninterface InspectionMemberIndex {\n readonly origins: ReadonlyMap<string, {\n readonly run: LoadedInspectionRun;\n readonly attempts: ReadonlyMap<string, AttemptDocument>;\n readonly members: ReadonlyMap<string, MemberDocument>;\n }>;\n readonly targets: ReadonlyMap<string, ReadonlyMap<string, readonly InspectionAttemptTarget[]>>;\n}\nconst memberIndexes = new WeakMap<readonly LoadedInspectionRun[], InspectionMemberIndex>();\nfunction memberIndex(runs: readonly LoadedInspectionRun[]): InspectionMemberIndex {\n const cached = memberIndexes.get(runs);\n if (cached !== undefined)\n return cached;\n const origins = new Map(runs.map((run) => [run.run.runId, {\n run, attempts: new Map(run.attempts.map((attempt) => [attempt.attemptId, attempt])),\n members: new Map(run.members.map((member) => [member.slotId, member])),\n }]));\n const targets = new Map<string, Map<string, InspectionAttemptTarget[]>>();\n for (const run of runs)\n for (const member of run.members) {\n if (member.attempt === null)\n continue;\n const { originRunId, attemptId } = member.attempt;\n let byAttempt = targets.get(originRunId);\n if (byAttempt === undefined)\n targets.set(originRunId, byAttempt = new Map());\n let members = byAttempt.get(attemptId);\n if (members === undefined)\n byAttempt.set(attemptId, members = []);\n members.push(Object.freeze({ run, member }));\n }\n for (const byAttempt of targets.values())\n for (const members of byAttempt.values())\n Object.freeze(members);\n const index = { origins, targets };\n memberIndexes.set(runs, index);\n return index;\n}\n/** Resolves already loaded facts through one shared identity index. */\nexport function resolveInspectionMemberAttempt(runs: readonly LoadedInspectionRun[], target: LoadedInspectionRun, member: MemberDocument): ResolvedInspectionAttempt | undefined {\n if (member.attempt === null)\n return undefined;\n const index = memberIndex(runs);\n const origin = index.origins.get(member.attempt.originRunId);\n const attempt = origin?.attempts.get(member.attempt.attemptId);\n if (origin === undefined || attempt === undefined || attempt.originRunId !== member.attempt.originRunId)\n return undefined;\n const targets = index.targets.get(attempt.originRunId)?.get(attempt.attemptId) ?? [];\n const targetMember = index.origins.get(target.run.runId)?.members.get(member.slotId);\n if (targetMember?.attempt?.originRunId !== attempt.originRunId || targetMember.attempt.attemptId !== attempt.attemptId)\n return undefined;\n return Object.freeze({ attempt, origin: origin.run, locator: encodeAttemptLocator(attempt.attemptId), targets });\n}\n/** A target binding does not require the target to have published its own Run Core. */\nexport function resolveInspectionResourceMemberAttempt(target: LoadedInspectionRunResource, member: MemberDocument): ResolvedInspectionAttempt | undefined {\n if (member.attempt === null)\n return undefined;\n const index = memberIndex(target.supporting);\n const origin = index.origins.get(member.attempt.originRunId);\n const attempt = origin?.attempts.get(member.attempt.attemptId);\n if (origin === undefined || attempt === undefined)\n return undefined;\n const targets = index.targets.get(attempt.originRunId)?.get(attempt.attemptId) ?? [];\n return Object.freeze({ attempt, origin: origin.run, locator: encodeAttemptLocator(attempt.attemptId), targets });\n}\nexport function attemptAttachment(resolved: ResolvedInspectionAttempt, family: string): DecodedInspectionAttachment | undefined {\n return resolved.origin.attachments.find(({ physical }) => physical.ownerKind === \"attempt\" &&\n physical.ownerAttemptId === resolved.attempt.attemptId &&\n physical.family === family);\n}\nexport function runAttachment(run: LoadedInspectionRun, family: string): DecodedInspectionAttachment | undefined {\n return run.attachments.find(({ physical }) => physical.ownerKind === \"run\" && physical.family === family);\n}\n/** Reads only the current logical Assertions family, preserving failure state. */\n// @concord-code ne-eval-inspection-read-assertions\n// @concord-implements docs/feature/assertions/README.md\n// @concord-implements docs/feature/inspection/README.md\nexport function readInspectionAssertions(resolved: ResolvedInspectionAttempt): InspectionAssertionsRead {\n const attachment = attemptAttachment(resolved, NiceEvalRecordAttachments.assertions.family);\n if (attachment === undefined) {\n return Object.freeze({\n state: \"not-recorded\" as const,\n issues: Object.freeze([issue(\"assertions-not-recorded\", resolved.locator)]),\n });\n }\n if (attachment.physical.familyRevision !==\n NiceEvalCurrentRecordAttachments.assertions.revision) {\n return Object.freeze({\n state: \"unsupported\" as const,\n attachment,\n issues: Object.freeze([issue(\"assertions-revision-unsupported\", resolved.locator)]),\n });\n }\n const decoded = decodeCurrentAssertions(attachment);\n if (decoded === undefined) {\n return Object.freeze({\n state: \"failed\" as const,\n attachment,\n issues: Object.freeze([issue(\"assertions-current-invalid\", resolved.locator)]),\n });\n }\n return Object.freeze({\n state: \"available\" as const,\n attachment,\n value: decoded.value,\n contents: decoded.contents,\n issues: Object.freeze([]),\n });\n}\nfunction decodeCurrentAssertions(attachment: DecodedInspectionAttachment): {\n readonly value: AssertionsAttachment;\n readonly contents: WeakMap<object, PersistedContentMetadata>;\n} | undefined {\n const definition = NiceEvalRecordAttachments.assertions;\n const byHandle = new Map(attachment.physical.contents.map((content) => [content.logicalHandle, content]));\n const handles = new Map<string, RecordContentHandle>();\n const contents = new WeakMap<object, PersistedContentMetadata>();\n const usedContent = new Set<string>();\n const hydrated = hydrateRecordAttachmentCurrent(definition, attachment.value, {\n content: (token, declaration) => {\n const logicalHandle = exactMarker(token, \"$niceeval.record.content\");\n if (logicalHandle === undefined &&\n !hasOwnMarker(token, \"$niceeval.record.content\")) {\n return Result.succeed(undefined);\n }\n if (typeof logicalHandle !== \"string\") {\n return Result.fail({ code: \"current-content-bind-failed\" as const });\n }\n const metadata = byHandle.get(logicalHandle);\n if (metadata === undefined ||\n declaration.maximumBytes !== undefined &&\n metadata.byteLength > declaration.maximumBytes) {\n return Result.fail({ code: \"current-content-bind-failed\" as const });\n }\n let handle = handles.get(logicalHandle);\n if (handle === undefined) {\n handle = mintRecordContentHandle(declaration.kind);\n handles.set(logicalHandle, handle);\n contents.set(handle, metadata);\n }\n usedContent.add(logicalHandle);\n return Result.succeed(handle);\n },\n reference: (token, declaration) => {\n const marker = exactMarker(token, \"$niceeval.record.reference\");\n if (marker === undefined &&\n !hasOwnMarker(token, \"$niceeval.record.reference\")) {\n return Result.succeed(undefined);\n }\n if (typeof marker !== \"object\" || marker === null || Array.isArray(marker)) {\n return Result.fail({ code: \"current-reference-bind-failed\" as const });\n }\n const value = marker as Record<string, unknown>;\n if (Reflect.ownKeys(value).length !== 3 ||\n value.owner !== declaration.definition.owner ||\n value.family !== declaration.definition.family ||\n !(\"value\" in value)) {\n return Result.fail({ code: \"current-reference-bind-failed\" as const });\n }\n return Result.succeed(mintRecordAttachmentReference(RecordAttachmentReference.to(declaration.definition, declaration.valueSchema), value.value));\n },\n });\n if (Result.isFailure(hydrated) ||\n usedContent.size !== attachment.physical.contents.length) {\n return undefined;\n }\n const closure = enumerateRecordAttachmentClosure(definition, hydrated.success);\n if (Result.isFailure(closure))\n return undefined;\n const references = new Map<string, {\n readonly owner: string;\n readonly family: string;\n }>();\n for (const reference of closure.success.references) {\n const wire = recordAttachmentReferenceWire(reference);\n if (wire === undefined)\n return undefined;\n references.set(`${wire.owner}\\u0000${wire.family}`, Object.freeze({ owner: wire.owner, family: wire.family }));\n }\n const ordered = [...references.values()].sort((left, right) => compareText(left.owner, right.owner) || compareText(left.family, right.family));\n if (ordered.length !== attachment.physical.references.length)\n return undefined;\n for (let ordinal = 0; ordinal < ordered.length; ordinal += 1) {\n const logical = ordered[ordinal]!;\n const physical = attachment.physical.references[ordinal]!;\n if (physical.ordinal !== ordinal ||\n physical.owner !== logical.owner ||\n physical.family !== logical.family) {\n return undefined;\n }\n }\n return Object.freeze({ value: hydrated.success, contents });\n}\nfunction validateCoreRelations(run: RunDocument, members: readonly MemberDocument[], attempts: readonly AttemptDocument[], allowPendingSlots = false): void {\n const slots = new Map(run.expectedSlots.map((slot) => [slot.slotId, slot] as const));\n if (slots.size !== run.expectedSlots.length || (!allowPendingSlots && members.length !== slots.size) || members.length > slots.size) {\n throw factsError(\"Run Core does not close its expected Slot membership\");\n }\n const memberSlots = new Set<string>();\n for (const member of members) {\n if (!slots.has(member.slotId) || memberSlots.has(member.slotId)) {\n throw factsError(\"Run Core contains an invalid Member Slot\");\n }\n memberSlots.add(member.slotId);\n }\n const attemptIds = new Set<string>();\n for (const attempt of attempts) {\n const slot = slots.get(attempt.slotId);\n if (attemptIds.has(attempt.attemptId) ||\n slot === undefined ||\n attempt.evalId !== slot.evalId ||\n attempt.executionIdentityDigest !== slot.executionIdentityDigest) {\n throw factsError(\"Run Core contains an invalid origin Attempt\");\n }\n attemptIds.add(attempt.attemptId);\n }\n for (const member of members) {\n if (member.action === \"executed\" &&\n (member.attempt === null ||\n member.attempt.originRunId !== run.runId ||\n !attemptIds.has(member.attempt.attemptId))) {\n throw factsError(\"Executed Member does not name a local origin Attempt\");\n }\n }\n}\nfunction targetMembers(run: LoadedInspectionRun, attempt: AttemptDocument): readonly MemberDocument[] {\n return run.members.filter((member) => member.attempt !== null &&\n member.attempt.originRunId === attempt.originRunId &&\n member.attempt.attemptId === attempt.attemptId);\n}\nfunction requireCutoff(actual: ReturnType<InspectionFactSource[\"cutoff\"]>, expected: ReturnType<InspectionFactSource[\"cutoff\"]>): void {\n if (actual.storeGeneration !== expected.storeGeneration ||\n actual.revision !== expected.revision) {\n throw factsError(\"Inspection source changed its pinned sealed cutoff\");\n }\n}\nfunction parseJson(bytes: Uint8Array, owner: string): unknown {\n try {\n return JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes)) as unknown;\n }\n catch (cause) {\n throw factsError(`${owner} is not canonical UTF-8 JSON`, cause);\n }\n}\nfunction parseInspectionJson(bytes: Uint8Array, owner: string): InspectionJson {\n const closed = closeInspectionJson(parseJson(bytes, owner));\n if (isInspectionCodecError(closed)) {\n throw factsError(`${owner} is invalid: ${closed.reason}`);\n }\n return closed;\n}\nfunction decodedRight<A>(decoded: Result.Result<A, unknown>, reason: string): A {\n if (Result.isFailure(decoded))\n throw factsError(reason, decoded.failure);\n return decoded.success;\n}\nfunction exactMarker(value: unknown, key: string): unknown | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return undefined;\n }\n const keys = Reflect.ownKeys(value);\n if (keys.length !== 1 || keys[0] !== key)\n return undefined;\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n return descriptor?.enumerable === true && \"value\" in descriptor\n ? descriptor.value\n : undefined;\n}\nfunction hasOwnMarker(value: unknown, key: string): boolean {\n return typeof value === \"object\" && value !== null && !Array.isArray(value) &&\n Object.prototype.hasOwnProperty.call(value, key);\n}\nfunction issue(code: string, locator: string): InspectionJson {\n return Object.freeze({ code, locator });\n}\nfunction factsError(reason: string, cause?: unknown): Error {\n return new Error(reason, cause === undefined ? undefined : { cause });\n}\nfunction compareText(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\nfunction verifyDigest(bytes: Uint8Array, digest: string, label: string): void {\n if (new InspectionSha256().update(bytes).digestHex() !== digest)\n throw factsError(`${label} digest is invalid`);\n}\nfunction parseVerifiedJson(bytes: Uint8Array, digest: string, label: string): unknown {\n verifyDigest(bytes, digest, label);\n return parseJson(bytes, label);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"facts.js","sourceRoot":"","sources":["facts.ts"],"names":[],"mappings":";;AAqFA,gDA4CC;AAED,gEAUC;AAED,8DAoDC;AAqBD,kDA0EC;AAID,4DAiDC;AAwCD,wEAaC;AAED,wFAUC;AACD,8CAIC;AACD,sCAEC;AAKD,4DA+BC;AApcD,gBAAgB;AAChB,wDAAwD;AACxD,8DAA8D;AAC9D,wFAAwF;AACxF,mCAAwC;AACxC,8DAA6D;AAC7D,gEAAqG;AACrG,kEAA8M;AAC9M,qDAA6J;AAC7J,4DAA2G;AAI3G,yCAA+F;AAE/F,yCAA8C;AA6C9C,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,2BAA2B,GAAG,EAAE,CAAC;AACvC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AACxC,MAAM,WAAW,GAAG,IAAI,OAAO,EAA0D,CAAC;AAC1F,SAAS,iBAAiB,CAAC,MAA4B,EAAE,KAAa;IAClE,IAAI,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,KAAK,KAAK,SAAS;QACnB,WAAW,CAAC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AC,MAAc,EAAE,KAAe;IAC/C,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1E,CAAC;AACD,SAAS,WAAW,CAAC,IAAY,EAAE,KAAa;IAC5C,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AACD,SAAS,YAAY,CAAC,KAAiB,EAAE,MAAc,EAAE,KAAa;IAClE,IAAI,IAAI,2BAAgB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,KAAK,MAAM;QAC3D,MAAM,UAAU,CAAC,GAAG,KAAK,oBAAoB,CAAC,CAAC;AACvD,CAAC;AACD,SAAS,iBAAiB,CAAC,KAAiB,EAAE,MAAc,EAAE,KAAa;IACvE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACnC,OAAO,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC","sourcesContent":["// @concord-file\n// @concord-implements docs/feature/inspection/README.md\n// @concord-implements docs/feature/inspection/architecture.md\n// @concord-implements docs/feature/inspection/use-case/inspection-check-completeness.md\nimport { Result, Schema } from \"effect\";\nimport { encodeAttemptLocator } from \"../attempt-locator.ts\";\nimport { mintRecordContentHandle, type RecordContentHandle, } from \"../record/attachment/content.ts\";\nimport { enumerateRecordAttachmentClosure, hydrateRecordAttachmentCurrent, mintRecordAttachmentReference, RecordAttachmentReference, recordAttachmentReferenceWire, } from \"../record/attachment/protocol.ts\";\nimport { decodeAttemptDocument, decodeMemberDocument, decodeRunDocument, RecordExactParseOptions, RecordSlotIdentitySchema, } from \"../record/codec/core.ts\";\nimport { NiceEvalCurrentRecordAttachments, NiceEvalRecordAttachments, } from \"../record/family/current.ts\";\nimport type { AssertionsAttachment } from \"../record/family/assertions/definition.ts\";\nimport type { AttemptDocument, MemberDocument, RunDocument, } from \"../record/model/core.ts\";\nimport type { PersistedContentMetadata, SealedAttachmentMetadata, SealedRunCore, SealedRunSummary, } from \"../record/sqlite/types.ts\";\nimport { closeInspectionJson, isInspectionCodecError, type InspectionJson, } from \"./codec.ts\";\nimport type { InspectionFactSource } from \"./source.ts\";\nimport { InspectionSha256 } from \"./bytes.ts\";\nimport type { ReadableRunResource } from \"../run/storage/types.ts\";\nexport interface DecodedInspectionAttachment {\n readonly physical: SealedAttachmentMetadata;\n readonly value: InspectionJson;\n}\n/** A strictly decoded sealed Run with its browser-neutral reader capability. */\nexport interface LoadedInspectionRun {\n readonly source: InspectionFactSource;\n readonly physical: SealedRunCore;\n readonly run: RunDocument;\n readonly members: readonly MemberDocument[];\n readonly attempts: readonly AttemptDocument[];\n readonly attachments: readonly DecodedInspectionAttachment[];\n}\n/** Exact lifecycle resource plus its optional published Core at one cutoff. */\nexport interface LoadedInspectionRunResource {\n readonly source: InspectionFactSource;\n readonly resource: ReadableRunResource;\n readonly members: readonly MemberDocument[];\n readonly supporting: readonly LoadedInspectionRun[];\n readonly published?: LoadedInspectionRun;\n}\nexport interface InspectionAttemptTarget {\n readonly run: LoadedInspectionRun;\n readonly member: MemberDocument;\n}\n/** Exact origin Attempt plus every target membership visible to the resolver. */\nexport interface ResolvedInspectionAttempt {\n readonly attempt: AttemptDocument;\n readonly origin: LoadedInspectionRun;\n readonly locator: string;\n readonly targets: readonly InspectionAttemptTarget[];\n}\nexport type InspectionAssertionsRead = {\n readonly state: \"available\";\n readonly attachment: DecodedInspectionAttachment;\n readonly value: AssertionsAttachment;\n readonly contents: WeakMap<object, PersistedContentMetadata>;\n readonly issues: readonly InspectionJson[];\n} | {\n readonly state: \"not-recorded\" | \"unsupported\" | \"failed\";\n readonly attachment?: DecodedInspectionAttachment;\n readonly issues: readonly InspectionJson[];\n};\nconst RUN_PAGE_SIZE = 100;\nconst ATTEMPT_CANDIDATE_RUN_LIMIT = 64;\nconst ATTEMPT_TARGET_MEMBER_LIMIT = 256;\nconst decodedRuns = new WeakMap<InspectionFactSource, Map<string, LoadedInspectionRun>>();\nfunction readInspectionRun(source: InspectionFactSource, runId: string): LoadedInspectionRun | undefined {\n let cache = decodedRuns.get(source);\n if (cache === undefined)\n decodedRuns.set(source, cache = new Map());\n const cached = cache.get(runId);\n if (cached !== undefined)\n return cached;\n const physical = source.readSealedRunCore(runId);\n if (physical === undefined)\n return undefined;\n const decoded = decodeInspectionRun(source, physical);\n cache.set(runId, decoded);\n return decoded;\n}\n/**\n * Pins the source cutoff, exhausts the fixed Run-summary pagination, then\n * reads and strictly decodes every Run Core in that exact sealed generation.\n */\n// @concord-code\n// @concord-implements docs/feature/inspection/architecture.md\n// @concord-implements docs/feature/inspection/use-case/inspection-check-completeness.md\nexport function loadInspectionRuns(source: InspectionFactSource): readonly LoadedInspectionRun[] {\n const cutoff = source.cutoff();\n const summaries: SealedRunSummary[] = [];\n const seen = new Set<string>();\n let expectedRunCount: number | undefined;\n let afterRunId = \"\";\n for (;;) {\n const page = source.readSealedRunSummaryPage(afterRunId, RUN_PAGE_SIZE, cutoff.identity);\n if (page.cutoff.identity !== cutoff.identity ||\n expectedRunCount !== undefined && page.cutoff.runCount !== expectedRunCount) {\n throw factsError(\"Run inventory changed its pinned cutoff or count\");\n }\n expectedRunCount ??= page.cutoff.runCount;\n if (page.afterRunId !== afterRunId) {\n throw factsError(\"Run pagination returned a different cursor\");\n }\n let previous = afterRunId;\n for (const summary of page.summaries) {\n if (summary.runId <= previous || seen.has(summary.runId)) {\n throw factsError(\"Run pagination is not strictly ordered\");\n }\n seen.add(summary.runId);\n summaries.push(summary);\n previous = summary.runId;\n }\n if (page.nextAfterRunId === null)\n break;\n if (page.summaries.length === 0 ||\n page.nextAfterRunId !== page.summaries.at(-1)!.runId ||\n page.nextAfterRunId === afterRunId) {\n throw factsError(\"Run pagination returned an invalid continuation cursor\");\n }\n afterRunId = page.nextAfterRunId;\n }\n if (summaries.length !== expectedRunCount) {\n throw factsError(\"Run pagination did not close the pinned sealed cutoff\");\n }\n return Object.freeze(summaries.map((summary) => {\n const run = readInspectionRun(source, summary.runId);\n if (run === undefined) {\n throw factsError(`Sealed Run ${summary.runId} disappeared from the pinned cutoff`);\n }\n return run;\n }));\n}\n/** Reads a bounded, explicit Run selection without changing its caller order. */\nexport function loadSelectedInspectionRuns(source: InspectionFactSource, runIds: readonly string[]): readonly LoadedInspectionRun[] {\n const cutoff = source.cutoff();\n const loaded: LoadedInspectionRun[] = [];\n for (const runId of new Set(runIds)) {\n const run = readInspectionRun(source, runId);\n if (run !== undefined)\n loaded.push(run);\n }\n requireCutoff(source.cutoff(), cutoff);\n return Object.freeze(loaded);\n}\n/** Reads Run create/close facts even when no Attempt Core has been published. */\nexport function loadInspectionRunResource(source: InspectionFactSource, runId: string): LoadedInspectionRunResource | undefined {\n const cutoff = source.cutoff();\n const resource = source.readRunResource(runId);\n if (resource === undefined)\n return undefined;\n const published = readInspectionRun(source, runId);\n if (published !== undefined)\n validateRunResourceCore(resource, published);\n const originIds = resource.slots.flatMap(({ publication }) => publication.state === \"published\" ? [publication.originRunId] : []);\n const supporting = loadSelectedInspectionRuns(source, [\n ...(published === undefined ? [] : [runId]), ...originIds,\n ]);\n const index = memberIndex(supporting);\n const publications = new Map<string, SealedRunCore[\"attempts\"][number]>(supporting.flatMap((origin) => origin.physical.attempts.map((attempt) => [\n `${origin.run.runId}\\u0000${attempt.attemptId}`, attempt,\n ] as const)));\n const members = resource.slots.flatMap(({ slotId, publication }): readonly MemberDocument[] => {\n if (publication.state === \"pending\")\n return [];\n if (publication.state === \"absent\") {\n return [decodedRight(decodeMemberDocument({\n slotId,\n action: publication.reason === \"interrupted-before-publication\" || publication.reason === \"dispatch-failed\"\n ? \"interrupted\" : \"not-dispatched\",\n attempt: null,\n absenceReason: publication.reason,\n }), \"Run resource absence is invalid\")];\n }\n const origin = index.origins.get(publication.originRunId);\n const attempt = origin?.attempts.get(publication.attemptId);\n const stored = publications.get(`${publication.originRunId}\\u0000${publication.attemptId}`);\n if (attempt === undefined || stored === undefined ||\n attempt.slotId !== publication.originSlotId ||\n stored.attemptLocator !== publication.attemptLocator ||\n stored.publicationIdentity?.originRunId !== publication.publicationIdentity.originRunId ||\n stored.publicationIdentity?.attemptId !== publication.publicationIdentity.attemptId ||\n stored.publicationIdentity?.revision !== publication.publicationIdentity.revision ||\n publication.publicationIdentity.originRunId !== publication.originRunId ||\n publication.publicationIdentity.attemptId !== publication.attemptId ||\n publication.action === \"executed\" && publication.originRunId !== runId) {\n throw factsError(`Run ${runId} Slot ${slotId} does not bind a matching published origin Attempt`);\n }\n return [decodedRight(decodeMemberDocument({\n slotId, action: publication.action,\n attempt: { originRunId: publication.originRunId, attemptId: publication.attemptId },\n }), \"Run resource binding is invalid\")];\n }).sort((left, right) => compareText(left.slotId, right.slotId));\n requireCutoff(source.cutoff(), cutoff);\n return Object.freeze({\n source, resource, members: Object.freeze(members), supporting,\n ...(published === undefined ? {} : { published }),\n });\n}\nfunction validateRunResourceCore(resource: ReadableRunResource, published: LoadedInspectionRun): void {\n const run = published.run;\n if (run.runId !== resource.runId ||\n run.experimentId !== resource.experimentId ||\n run.startedAt !== Date.parse(resource.startedAt) ||\n run.expectedSlots.length !== resource.slots.length) {\n throw factsError(`Run ${resource.runId} lifecycle resource does not match its published Core`);\n }\n for (const [index, slot] of run.expectedSlots.entries()) {\n const expected = resource.slots[index];\n if (expected === undefined ||\n slot.slotId !== expected.slotId ||\n slot.evalId !== expected.evalId ||\n slot.attemptOrdinal !== expected.attemptOrdinal ||\n slot.executionIdentityDigest !== expected.executionIdentityDigest) {\n throw factsError(`Run ${resource.runId} expected Slot does not match its published Core`);\n }\n }\n}\n/** Strictly decodes Core, then decodes each Attachment only on first use. */\nexport function decodeInspectionRun(source: InspectionFactSource, physical: SealedRunCore): LoadedInspectionRun {\n const run = decodedRight(decodeRunDocument(parseVerifiedJson(physical.runCoreBytes, physical.runCoreDigest, \"Run Core\")), \"Run Core is invalid\");\n if (run.runId !== physical.runId) {\n throw factsError(\"Run Core identity does not match its sealed row\");\n }\n if (physical.slots.length !== run.expectedSlots.length) {\n throw factsError(\"Run Core Slot rows do not match its expected denominator\");\n }\n for (const [index, stored] of physical.slots.entries()) {\n const decoded = Schema.decodeUnknownResult(RecordSlotIdentitySchema, RecordExactParseOptions)(parseVerifiedJson(stored.coreBytes, stored.coreDigest, \"Slot Core\"));\n const slot = decodedRight(decoded, \"Slot Core is invalid\");\n const expected = run.expectedSlots[index];\n if (expected === undefined ||\n stored.ordinal !== index ||\n stored.slotId !== slot.slotId ||\n slot.slotId !== expected.slotId ||\n slot.evalId !== expected.evalId ||\n slot.attemptOrdinal !== expected.attemptOrdinal ||\n slot.executionIdentityDigest !== expected.executionIdentityDigest) {\n throw factsError(\"Slot Core does not match its sealed Run denominator\");\n }\n }\n const members = physical.members.map((stored) => {\n const member = decodedRight(decodeMemberDocument(parseVerifiedJson(stored.coreBytes, stored.coreDigest, \"Member Core\")), \"Member Core is invalid\");\n if (member.slotId !== stored.slotId ||\n member.action !== stored.action ||\n (member.attempt?.originRunId ?? undefined) !== stored.originRunId ||\n (member.attempt?.attemptId ?? undefined) !== stored.attemptId) {\n throw factsError(\"Member Core does not match its sealed row\");\n }\n return member;\n });\n const attempts = physical.attempts.map((stored) => {\n const attempt = decodedRight(decodeAttemptDocument(parseVerifiedJson(stored.coreBytes, stored.coreDigest, \"Attempt Core\")), \"Attempt Core is invalid\");\n if (attempt.attemptId !== stored.attemptId ||\n attempt.originRunId !== run.runId ||\n encodeAttemptLocator(attempt.attemptId) !== stored.attemptLocator) {\n throw factsError(\"Attempt Core does not match its sealed row\");\n }\n return attempt;\n });\n validateCoreRelations(run, members, attempts, physical.publicationManaged === true);\n const localAttemptIds = new Set<string>(attempts.map(({ attemptId }) => attemptId));\n const attachments = physical.attachments.map((attachment): DecodedInspectionAttachment => {\n if (attachment.ownerRunId !== run.runId ||\n attachment.ownerKind === \"run\" && attachment.ownerAttemptId !== undefined ||\n attachment.ownerKind === \"attempt\" &&\n (attachment.ownerAttemptId === undefined ||\n !localAttemptIds.has(attachment.ownerAttemptId))) {\n throw factsError(\"Attachment ownership does not match its sealed Run\");\n }\n let value: InspectionJson | undefined;\n let decoded = false;\n return Object.freeze({\n physical: attachment,\n get value(): InspectionJson {\n if (!decoded) {\n verifyDigest(attachment.canonicalBytes, attachment.canonicalDigest, \"Attachment\");\n verifyDigest(attachment.logicalInventoryBytes, attachment.inventoryDigest, \"Attachment inventory\");\n value = parseInspectionJson(attachment.canonicalBytes, \"Attachment\");\n decoded = true;\n }\n return value!;\n },\n });\n });\n return Object.freeze({\n source,\n physical,\n run,\n members: Object.freeze(members),\n attempts: Object.freeze(attempts),\n attachments: Object.freeze(attachments),\n });\n}\n/** Resolves a public locator through the source's bounded exact index. */\n// @concord-code\n// @concord-implements docs/feature/inspection/architecture.md\nexport function resolveInspectionAttempt(source: InspectionFactSource, locator: string): ResolvedInspectionAttempt | undefined {\n const projection = source.findAttemptLocatorCandidates(locator, ATTEMPT_CANDIDATE_RUN_LIMIT);\n if (projection.candidates.length === 0)\n return undefined;\n if (projection.ambiguous)\n return undefined;\n const origins = projection.candidates.filter(({ relation }) => relation === \"origin\");\n if (origins.length !== 1) {\n throw factsError(`Attempt ${locator} indexed projection is invalid`);\n }\n const identity = origins[0]!;\n const runs = loadSelectedInspectionRuns(source, projection.candidates.map(({ runId }) => runId));\n const byRunId = new Map<string, LoadedInspectionRun>(runs.map((run) => [run.run.runId, run] as const));\n const origin = byRunId.get(identity.originRunId);\n if (origin === undefined) {\n throw factsError(`Attempt ${locator} origin is not a sealed Run`);\n }\n const attempt = origin.attempts.find((candidate) => candidate.attemptId === identity.attemptId &&\n candidate.originRunId === identity.originRunId &&\n encodeAttemptLocator(candidate.attemptId) === locator);\n if (attempt === undefined) {\n throw factsError(`Attempt ${locator} origin Core is invalid`);\n }\n const targets: InspectionAttemptTarget[] = [];\n const targetRunIds = new Set(projection.candidates.flatMap((candidate) => candidate.relation === \"target\" &&\n candidate.originRunId === identity.originRunId &&\n candidate.attemptId === identity.attemptId\n ? [candidate.runId]\n : []));\n for (const runId of targetRunIds) {\n const run = byRunId.get(runId);\n if (run === undefined) {\n throw factsError(`Attempt ${locator} target is not a sealed Run`);\n }\n const members = targetMembers(run, attempt);\n if (members.length === 0) {\n throw factsError(`Attempt ${locator} target Core is invalid`);\n }\n if (targets.length + members.length > ATTEMPT_TARGET_MEMBER_LIMIT) {\n throw factsError(`Attempt ${locator} exceeds its fixed target member limit`);\n }\n targets.push(...members.map((member) => Object.freeze({ run, member })));\n }\n return Object.freeze({\n attempt,\n origin,\n locator,\n targets: Object.freeze(targets),\n });\n}\ninterface InspectionMemberIndex {\n readonly origins: ReadonlyMap<string, {\n readonly run: LoadedInspectionRun;\n readonly attempts: ReadonlyMap<string, AttemptDocument>;\n readonly members: ReadonlyMap<string, MemberDocument>;\n }>;\n readonly targets: ReadonlyMap<string, ReadonlyMap<string, readonly InspectionAttemptTarget[]>>;\n}\nconst memberIndexes = new WeakMap<readonly LoadedInspectionRun[], InspectionMemberIndex>();\nfunction memberIndex(runs: readonly LoadedInspectionRun[]): InspectionMemberIndex {\n const cached = memberIndexes.get(runs);\n if (cached !== undefined)\n return cached;\n const origins = new Map(runs.map((run) => [run.run.runId, {\n run, attempts: new Map(run.attempts.map((attempt) => [attempt.attemptId, attempt])),\n members: new Map(run.members.map((member) => [member.slotId, member])),\n }]));\n const targets = new Map<string, Map<string, InspectionAttemptTarget[]>>();\n for (const run of runs)\n for (const member of run.members) {\n if (member.attempt === null)\n continue;\n const { originRunId, attemptId } = member.attempt;\n let byAttempt = targets.get(originRunId);\n if (byAttempt === undefined)\n targets.set(originRunId, byAttempt = new Map());\n let members = byAttempt.get(attemptId);\n if (members === undefined)\n byAttempt.set(attemptId, members = []);\n members.push(Object.freeze({ run, member }));\n }\n for (const byAttempt of targets.values())\n for (const members of byAttempt.values())\n Object.freeze(members);\n const index = { origins, targets };\n memberIndexes.set(runs, index);\n return index;\n}\n/** Resolves already loaded facts through one shared identity index. */\nexport function resolveInspectionMemberAttempt(runs: readonly LoadedInspectionRun[], target: LoadedInspectionRun, member: MemberDocument): ResolvedInspectionAttempt | undefined {\n if (member.attempt === null)\n return undefined;\n const index = memberIndex(runs);\n const origin = index.origins.get(member.attempt.originRunId);\n const attempt = origin?.attempts.get(member.attempt.attemptId);\n if (origin === undefined || attempt === undefined || attempt.originRunId !== member.attempt.originRunId)\n return undefined;\n const targets = index.targets.get(attempt.originRunId)?.get(attempt.attemptId) ?? [];\n const targetMember = index.origins.get(target.run.runId)?.members.get(member.slotId);\n if (targetMember?.attempt?.originRunId !== attempt.originRunId || targetMember.attempt.attemptId !== attempt.attemptId)\n return undefined;\n return Object.freeze({ attempt, origin: origin.run, locator: encodeAttemptLocator(attempt.attemptId), targets });\n}\n/** A target binding does not require the target to have published its own Run Core. */\nexport function resolveInspectionResourceMemberAttempt(target: LoadedInspectionRunResource, member: MemberDocument): ResolvedInspectionAttempt | undefined {\n if (member.attempt === null)\n return undefined;\n const index = memberIndex(target.supporting);\n const origin = index.origins.get(member.attempt.originRunId);\n const attempt = origin?.attempts.get(member.attempt.attemptId);\n if (origin === undefined || attempt === undefined)\n return undefined;\n const targets = index.targets.get(attempt.originRunId)?.get(attempt.attemptId) ?? [];\n return Object.freeze({ attempt, origin: origin.run, locator: encodeAttemptLocator(attempt.attemptId), targets });\n}\nexport function attemptAttachment(resolved: ResolvedInspectionAttempt, family: string): DecodedInspectionAttachment | undefined {\n return resolved.origin.attachments.find(({ physical }) => physical.ownerKind === \"attempt\" &&\n physical.ownerAttemptId === resolved.attempt.attemptId &&\n physical.family === family);\n}\nexport function runAttachment(run: LoadedInspectionRun, family: string): DecodedInspectionAttachment | undefined {\n return run.attachments.find(({ physical }) => physical.ownerKind === \"run\" && physical.family === family);\n}\n/** Reads only the current logical Assertions family, preserving failure state. */\n// @concord-code\n// @concord-implements docs/feature/assertions/README.md\n// @concord-implements docs/feature/inspection/README.md\nexport function readInspectionAssertions(resolved: ResolvedInspectionAttempt): InspectionAssertionsRead {\n const attachment = attemptAttachment(resolved, NiceEvalRecordAttachments.assertions.family);\n if (attachment === undefined) {\n return Object.freeze({\n state: \"not-recorded\" as const,\n issues: Object.freeze([issue(\"assertions-not-recorded\", resolved.locator)]),\n });\n }\n if (attachment.physical.familyRevision !==\n NiceEvalCurrentRecordAttachments.assertions.revision) {\n return Object.freeze({\n state: \"unsupported\" as const,\n attachment,\n issues: Object.freeze([issue(\"assertions-revision-unsupported\", resolved.locator)]),\n });\n }\n const decoded = decodeCurrentAssertions(attachment);\n if (decoded === undefined) {\n return Object.freeze({\n state: \"failed\" as const,\n attachment,\n issues: Object.freeze([issue(\"assertions-current-invalid\", resolved.locator)]),\n });\n }\n return Object.freeze({\n state: \"available\" as const,\n attachment,\n value: decoded.value,\n contents: decoded.contents,\n issues: Object.freeze([]),\n });\n}\nfunction decodeCurrentAssertions(attachment: DecodedInspectionAttachment): {\n readonly value: AssertionsAttachment;\n readonly contents: WeakMap<object, PersistedContentMetadata>;\n} | undefined {\n const definition = NiceEvalRecordAttachments.assertions;\n const byHandle = new Map(attachment.physical.contents.map((content) => [content.logicalHandle, content]));\n const handles = new Map<string, RecordContentHandle>();\n const contents = new WeakMap<object, PersistedContentMetadata>();\n const usedContent = new Set<string>();\n const hydrated = hydrateRecordAttachmentCurrent(definition, attachment.value, {\n content: (token, declaration) => {\n const logicalHandle = exactMarker(token, \"$niceeval.record.content\");\n if (logicalHandle === undefined &&\n !hasOwnMarker(token, \"$niceeval.record.content\")) {\n return Result.succeed(undefined);\n }\n if (typeof logicalHandle !== \"string\") {\n return Result.fail({ code: \"current-content-bind-failed\" as const });\n }\n const metadata = byHandle.get(logicalHandle);\n if (metadata === undefined ||\n declaration.maximumBytes !== undefined &&\n metadata.byteLength > declaration.maximumBytes) {\n return Result.fail({ code: \"current-content-bind-failed\" as const });\n }\n let handle = handles.get(logicalHandle);\n if (handle === undefined) {\n handle = mintRecordContentHandle(declaration.kind);\n handles.set(logicalHandle, handle);\n contents.set(handle, metadata);\n }\n usedContent.add(logicalHandle);\n return Result.succeed(handle);\n },\n reference: (token, declaration) => {\n const marker = exactMarker(token, \"$niceeval.record.reference\");\n if (marker === undefined &&\n !hasOwnMarker(token, \"$niceeval.record.reference\")) {\n return Result.succeed(undefined);\n }\n if (typeof marker !== \"object\" || marker === null || Array.isArray(marker)) {\n return Result.fail({ code: \"current-reference-bind-failed\" as const });\n }\n const value = marker as Record<string, unknown>;\n if (Reflect.ownKeys(value).length !== 3 ||\n value.owner !== declaration.definition.owner ||\n value.family !== declaration.definition.family ||\n !(\"value\" in value)) {\n return Result.fail({ code: \"current-reference-bind-failed\" as const });\n }\n return Result.succeed(mintRecordAttachmentReference(RecordAttachmentReference.to(declaration.definition, declaration.valueSchema), value.value));\n },\n });\n if (Result.isFailure(hydrated) ||\n usedContent.size !== attachment.physical.contents.length) {\n return undefined;\n }\n const closure = enumerateRecordAttachmentClosure(definition, hydrated.success);\n if (Result.isFailure(closure))\n return undefined;\n const references = new Map<string, {\n readonly owner: string;\n readonly family: string;\n }>();\n for (const reference of closure.success.references) {\n const wire = recordAttachmentReferenceWire(reference);\n if (wire === undefined)\n return undefined;\n references.set(`${wire.owner}\\u0000${wire.family}`, Object.freeze({ owner: wire.owner, family: wire.family }));\n }\n const ordered = [...references.values()].sort((left, right) => compareText(left.owner, right.owner) || compareText(left.family, right.family));\n if (ordered.length !== attachment.physical.references.length)\n return undefined;\n for (let ordinal = 0; ordinal < ordered.length; ordinal += 1) {\n const logical = ordered[ordinal]!;\n const physical = attachment.physical.references[ordinal]!;\n if (physical.ordinal !== ordinal ||\n physical.owner !== logical.owner ||\n physical.family !== logical.family) {\n return undefined;\n }\n }\n return Object.freeze({ value: hydrated.success, contents });\n}\nfunction validateCoreRelations(run: RunDocument, members: readonly MemberDocument[], attempts: readonly AttemptDocument[], allowPendingSlots = false): void {\n const slots = new Map(run.expectedSlots.map((slot) => [slot.slotId, slot] as const));\n if (slots.size !== run.expectedSlots.length || (!allowPendingSlots && members.length !== slots.size) || members.length > slots.size) {\n throw factsError(\"Run Core does not close its expected Slot membership\");\n }\n const memberSlots = new Set<string>();\n for (const member of members) {\n if (!slots.has(member.slotId) || memberSlots.has(member.slotId)) {\n throw factsError(\"Run Core contains an invalid Member Slot\");\n }\n memberSlots.add(member.slotId);\n }\n const attemptIds = new Set<string>();\n for (const attempt of attempts) {\n const slot = slots.get(attempt.slotId);\n if (attemptIds.has(attempt.attemptId) ||\n slot === undefined ||\n attempt.evalId !== slot.evalId ||\n attempt.executionIdentityDigest !== slot.executionIdentityDigest) {\n throw factsError(\"Run Core contains an invalid origin Attempt\");\n }\n attemptIds.add(attempt.attemptId);\n }\n for (const member of members) {\n if (member.action === \"executed\" &&\n (member.attempt === null ||\n member.attempt.originRunId !== run.runId ||\n !attemptIds.has(member.attempt.attemptId))) {\n throw factsError(\"Executed Member does not name a local origin Attempt\");\n }\n }\n}\nfunction targetMembers(run: LoadedInspectionRun, attempt: AttemptDocument): readonly MemberDocument[] {\n return run.members.filter((member) => member.attempt !== null &&\n member.attempt.originRunId === attempt.originRunId &&\n member.attempt.attemptId === attempt.attemptId);\n}\nfunction requireCutoff(actual: ReturnType<InspectionFactSource[\"cutoff\"]>, expected: ReturnType<InspectionFactSource[\"cutoff\"]>): void {\n if (actual.storeGeneration !== expected.storeGeneration ||\n actual.revision !== expected.revision) {\n throw factsError(\"Inspection source changed its pinned sealed cutoff\");\n }\n}\nfunction parseJson(bytes: Uint8Array, owner: string): unknown {\n try {\n return JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes)) as unknown;\n }\n catch (cause) {\n throw factsError(`${owner} is not canonical UTF-8 JSON`, cause);\n }\n}\nfunction parseInspectionJson(bytes: Uint8Array, owner: string): InspectionJson {\n const closed = closeInspectionJson(parseJson(bytes, owner));\n if (isInspectionCodecError(closed)) {\n throw factsError(`${owner} is invalid: ${closed.reason}`);\n }\n return closed;\n}\nfunction decodedRight<A>(decoded: Result.Result<A, unknown>, reason: string): A {\n if (Result.isFailure(decoded))\n throw factsError(reason, decoded.failure);\n return decoded.success;\n}\nfunction exactMarker(value: unknown, key: string): unknown | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return undefined;\n }\n const keys = Reflect.ownKeys(value);\n if (keys.length !== 1 || keys[0] !== key)\n return undefined;\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n return descriptor?.enumerable === true && \"value\" in descriptor\n ? descriptor.value\n : undefined;\n}\nfunction hasOwnMarker(value: unknown, key: string): boolean {\n return typeof value === \"object\" && value !== null && !Array.isArray(value) &&\n Object.prototype.hasOwnProperty.call(value, key);\n}\nfunction issue(code: string, locator: string): InspectionJson {\n return Object.freeze({ code, locator });\n}\nfunction factsError(reason: string, cause?: unknown): Error {\n return new Error(reason, cause === undefined ? undefined : { cause });\n}\nfunction compareText(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\nfunction verifyDigest(bytes: Uint8Array, digest: string, label: string): void {\n if (new InspectionSha256().update(bytes).digestHex() !== digest)\n throw factsError(`${label} digest is invalid`);\n}\nfunction parseVerifiedJson(bytes: Uint8Array, digest: string, label: string): unknown {\n verifyDigest(bytes, digest, label);\n return parseJson(bytes, label);\n}\n"]}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InspectionTraceResultSchema = exports.InspectionTraceDetailResultSchema = exports.InspectionSourcesResultSchema = exports.InspectionScoredValueSchema = exports.InspectionRunValueSchema = exports.InspectionRunListResultSchema = exports.InspectionRunResultSchema = exports.InspectionOverviewResultSchema = exports.InspectionExperimentResultSchema = exports.InspectionAttemptUsageResultSchema = exports.InspectionAttemptTimingResultSchema = exports.InspectionAttemptResultSchema = exports.InspectionAttemptDiffResultSchema = exports.InspectionSourceError = exports.InspectionIntegrityError = exports.operationalInspectionSource = exports.externalInspectionSource = exports.openHostOwnedInspectionSource = exports.openInspectionSource = exports.InspectionOperationError = exports.selectInspectionOperation = exports.inspectionProtocolRegistry = exports.decodeInspectionDocument = exports.InspectionSuccessDocumentSchema = exports.InspectionFailureDocumentSchema = exports.InspectionExplanationDocumentSchema = exports.InspectionDiscoveryDocumentSchema = exports.InspectionDocumentSchema = exports.decodeInspectionOperation = exports.readScoreMatchAudit = exports.
|
|
3
|
+
exports.InspectionTraceResultSchema = exports.InspectionTraceDetailResultSchema = exports.InspectionSourcesResultSchema = exports.InspectionScoredValueSchema = exports.InspectionRunValueSchema = exports.InspectionRunListResultSchema = exports.InspectionRunResultSchema = exports.InspectionOverviewResultSchema = exports.InspectionExperimentResultSchema = exports.InspectionAttemptUsageResultSchema = exports.InspectionAttemptTimingResultSchema = exports.InspectionAttemptResultSchema = exports.InspectionAttemptDiffResultSchema = exports.InspectionSourceError = exports.InspectionIntegrityError = exports.operationalInspectionSource = exports.externalInspectionSource = exports.openHostOwnedInspectionSource = exports.openInspectionSource = exports.InspectionOperationError = exports.selectInspectionOperation = exports.inspectionProtocolRegistry = exports.decodeInspectionDocument = exports.InspectionSuccessDocumentSchema = exports.InspectionFailureDocumentSchema = exports.InspectionExplanationDocumentSchema = exports.InspectionDiscoveryDocumentSchema = exports.InspectionDocumentSchema = exports.decodeInspectionOperation = exports.readScoreMatchAudit = exports.decodeInspectionRequest = exports.QUERY_PROTOCOL = exports.INSPECTION_OPERATION_IDS = void 0;
|
|
4
4
|
var codec_ts_1 = require("./codec.cjs");
|
|
5
5
|
Object.defineProperty(exports, "INSPECTION_OPERATION_IDS", { enumerable: true, get: function () { return codec_ts_1.INSPECTION_OPERATION_IDS; } });
|
|
6
6
|
Object.defineProperty(exports, "QUERY_PROTOCOL", { enumerable: true, get: function () { return codec_ts_1.QUERY_PROTOCOL; } });
|
|
7
|
-
Object.defineProperty(exports, "closeInspectionJson", { enumerable: true, get: function () { return codec_ts_1.closeInspectionJson; } });
|
|
8
7
|
Object.defineProperty(exports, "decodeInspectionRequest", { enumerable: true, get: function () { return codec_ts_1.decodeInspectionRequest; } });
|
|
9
|
-
var canonical_ts_1 = require("./canonical.cjs");
|
|
10
|
-
Object.defineProperty(exports, "canonicalInspectionJson", { enumerable: true, get: function () { return canonical_ts_1.canonicalInspectionJson; } });
|
|
11
|
-
Object.defineProperty(exports, "canonicalJsonValue", { enumerable: true, get: function () { return canonical_ts_1.canonicalJsonValue; } });
|
|
12
8
|
var score_match_audit_ts_1 = require("../assertions/score-match-audit.cjs");
|
|
13
9
|
Object.defineProperty(exports, "readScoreMatchAudit", { enumerable: true, get: function () { return score_match_audit_ts_1.readScoreMatchAudit; } });
|
|
14
10
|
var query_ts_1 = require("./query.cjs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,uCAA2R;AAAlR,oHAAA,wBAAwB,OAAA;AAAE,0GAAA,cAAc,OAAA;AAAE,mHAAA,uBAAuB,OAAA;AAC1E,2EAAwN;AAA/M,2HAAA,mBAAmB,OAAA;AAC5B,uCAAqN;AAA5M,qHAAA,yBAAyB,OAAA;AAClC,6CAAqiB;AAA5hB,uHAAA,wBAAwB,OAAA;AAAE,gIAAA,iCAAiC,OAAA;AAAE,kIAAA,mCAAmC,OAAA;AAAE,8HAAA,+BAA+B,OAAA;AAAE,8HAAA,+BAA+B,OAAA;AAAE,uHAAA,wBAAwB,OAAA;AAAE,yHAAA,0BAA0B,OAAA;AACjO,yCAAmF;AAA1E,sHAAA,yBAAyB,OAAA;AAAE,qHAAA,wBAAwB,OAAA;AAC5D,yCAA6O;AAApO,iHAAA,oBAAoB,OAAA;AAAE,0HAAA,6BAA6B,OAAA;AAAE,qHAAA,wBAAwB,OAAA;AAAE,wHAAA,2BAA2B,OAAA;AAAE,qHAAA,wBAAwB,OAAA;AAAE,kHAAA,qBAAqB,OAAA;AACpK,2CAA6zC;AAApzC,+HAAA,iCAAiC,OAAA;AAAE,2HAAA,6BAA6B,OAAA;AAAE,iIAAA,mCAAmC,OAAA;AAAE,gIAAA,kCAAkC,OAAA;AAAE,8HAAA,gCAAgC,OAAA;AAAE,4HAAA,8BAA8B,OAAA;AAAE,uHAAA,yBAAyB,OAAA;AAAE,2HAAA,6BAA6B,OAAA;AAAE,sHAAA,wBAAwB,OAAA;AAAE,yHAAA,2BAA2B,OAAA;AAAE,2HAAA,6BAA6B,OAAA;AAAE,+HAAA,iCAAiC,OAAA;AAAE,yHAAA,2BAA2B,OAAA","sourcesContent":["export { INSPECTION_OPERATION_IDS, QUERY_PROTOCOL, decodeInspectionRequest, type InspectionCodecError, type InspectionFailureCode, type InspectionJson, type InspectionOperation, type InspectionOperationId, type InspectionRequest, type InspectionSourceProvenance, } from \"./codec.ts\";\nexport { readScoreMatchAudit, type ScoreMatchAudit, type ScoreMatchAuditV3, type ScoreMatchAuditImageContent, type ScoreMatchAuditEnvelope, type ScoreMatchAuditReadResult, } from \"../assertions/score-match-audit.ts\";\nexport { decodeInspectionOperation, type InspectionOperationDecodeError, type InspectionQuery, type InspectionQueryError, type InspectionQueryProtocolError, type InspectionQuerySelectionError, } from \"./query.ts\";\nexport { InspectionDocumentSchema, InspectionDiscoveryDocumentSchema, InspectionExplanationDocumentSchema, InspectionFailureDocumentSchema, InspectionSuccessDocumentSchema, decodeInspectionDocument, inspectionProtocolRegistry, type InspectionDiscoveryDocument, type InspectionDocument, type InspectionExplanationDocument, type InspectionExplanationDocumentFor, type InspectionFailureDocument, type InspectionOperationFor, type InspectionProtocolDecodeResult, type InspectionSuccessDocument, type InspectionSuccessDocumentFor, } from \"./protocol.ts\";\nexport { selectInspectionOperation, InspectionOperationError, } from \"./select.ts\";\nexport { openInspectionSource, openHostOwnedInspectionSource, externalInspectionSource, operationalInspectionSource, InspectionIntegrityError, InspectionSourceError, type InspectionFactSource, type InspectionSource, } from \"./source.ts\";\nexport { InspectionAttemptDiffResultSchema, InspectionAttemptResultSchema, InspectionAttemptTimingResultSchema, InspectionAttemptUsageResultSchema, InspectionExperimentResultSchema, InspectionOverviewResultSchema, InspectionRunResultSchema, InspectionRunListResultSchema, InspectionRunValueSchema, InspectionScoredValueSchema, InspectionSourcesResultSchema, InspectionTraceDetailResultSchema, InspectionTraceResultSchema, type InspectionAttemptDiffDocument, type InspectionAttemptDiffResult, type InspectionAttemptDocument, type InspectionAttemptResult, type InspectionAttemptSourcesDocument, type InspectionAttemptTimingDocument, type InspectionAttemptTimingResult, type InspectionAttemptTraceDetailDocument, type InspectionAttemptTraceDocument, type InspectionAttemptUsageDocument, type InspectionAttemptUsageResult, type InspectionExperimentDocument, type InspectionExperimentResult, type InspectionOverviewDocument, type InspectionOverviewResult, type InspectionResultByOperation, type InspectionResultDocumentByOperation, type InspectionResultMetadata, type InspectionRunDocument, type InspectionRunListDocument, type InspectionRunListResult, type InspectionRunResult, type InspectionRunValue, type InspectionScoredValue, type InspectionSourcesResult, type InspectionTraceDetailResult, type InspectionTraceResult, } from \"./results.ts\";\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { INSPECTION_OPERATION_IDS, QUERY_PROTOCOL,
|
|
2
|
-
export { canonicalInspectionJson, canonicalJsonValue } from "./canonical.cjs";
|
|
1
|
+
export { INSPECTION_OPERATION_IDS, QUERY_PROTOCOL, decodeInspectionRequest, type InspectionCodecError, type InspectionFailureCode, type InspectionJson, type InspectionOperation, type InspectionOperationId, type InspectionRequest, type InspectionSourceProvenance, } from "./codec.cjs";
|
|
3
2
|
export { readScoreMatchAudit, type ScoreMatchAudit, type ScoreMatchAuditV3, type ScoreMatchAuditImageContent, type ScoreMatchAuditEnvelope, type ScoreMatchAuditReadResult, } from "../assertions/score-match-audit.cjs";
|
|
4
3
|
export { decodeInspectionOperation, type InspectionOperationDecodeError, type InspectionQuery, type InspectionQueryError, type InspectionQueryProtocolError, type InspectionQuerySelectionError, } from "./query.cjs";
|
|
5
4
|
export { InspectionDocumentSchema, InspectionDiscoveryDocumentSchema, InspectionExplanationDocumentSchema, InspectionFailureDocumentSchema, InspectionSuccessDocumentSchema, decodeInspectionDocument, inspectionProtocolRegistry, type InspectionDiscoveryDocument, type InspectionDocument, type InspectionExplanationDocument, type InspectionExplanationDocumentFor, type InspectionFailureDocument, type InspectionOperationFor, type InspectionProtocolDecodeResult, type InspectionSuccessDocument, type InspectionSuccessDocumentFor, } from "./protocol.cjs";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { INSPECTION_OPERATION_IDS, QUERY_PROTOCOL,
|
|
2
|
-
export { canonicalInspectionJson, canonicalJsonValue } from "./canonical.mjs";
|
|
1
|
+
export { INSPECTION_OPERATION_IDS, QUERY_PROTOCOL, decodeInspectionRequest, type InspectionCodecError, type InspectionFailureCode, type InspectionJson, type InspectionOperation, type InspectionOperationId, type InspectionRequest, type InspectionSourceProvenance, } from "./codec.mjs";
|
|
3
2
|
export { readScoreMatchAudit, type ScoreMatchAudit, type ScoreMatchAuditV3, type ScoreMatchAuditImageContent, type ScoreMatchAuditEnvelope, type ScoreMatchAuditReadResult, } from "../assertions/score-match-audit.mjs";
|
|
4
3
|
export { decodeInspectionOperation, type InspectionOperationDecodeError, type InspectionQuery, type InspectionQueryError, type InspectionQueryProtocolError, type InspectionQuerySelectionError, } from "./query.mjs";
|
|
5
4
|
export { InspectionDocumentSchema, InspectionDiscoveryDocumentSchema, InspectionExplanationDocumentSchema, InspectionFailureDocumentSchema, InspectionSuccessDocumentSchema, decodeInspectionDocument, inspectionProtocolRegistry, type InspectionDiscoveryDocument, type InspectionDocument, type InspectionExplanationDocument, type InspectionExplanationDocumentFor, type InspectionFailureDocument, type InspectionOperationFor, type InspectionProtocolDecodeResult, type InspectionSuccessDocument, type InspectionSuccessDocumentFor, } from "./protocol.mjs";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { INSPECTION_OPERATION_IDS, QUERY_PROTOCOL,
|
|
2
|
-
export { canonicalInspectionJson, canonicalJsonValue } from "./canonical.js";
|
|
1
|
+
export { INSPECTION_OPERATION_IDS, QUERY_PROTOCOL, decodeInspectionRequest, type InspectionCodecError, type InspectionFailureCode, type InspectionJson, type InspectionOperation, type InspectionOperationId, type InspectionRequest, type InspectionSourceProvenance, } from "./codec.js";
|
|
3
2
|
export { readScoreMatchAudit, type ScoreMatchAudit, type ScoreMatchAuditV3, type ScoreMatchAuditImageContent, type ScoreMatchAuditEnvelope, type ScoreMatchAuditReadResult, } from "../assertions/score-match-audit.js";
|
|
4
3
|
export { decodeInspectionOperation, type InspectionOperationDecodeError, type InspectionQuery, type InspectionQueryError, type InspectionQueryProtocolError, type InspectionQuerySelectionError, } from "./query.js";
|
|
5
4
|
export { InspectionDocumentSchema, InspectionDiscoveryDocumentSchema, InspectionExplanationDocumentSchema, InspectionFailureDocumentSchema, InspectionSuccessDocumentSchema, decodeInspectionDocument, inspectionProtocolRegistry, type InspectionDiscoveryDocument, type InspectionDocument, type InspectionExplanationDocument, type InspectionExplanationDocumentFor, type InspectionFailureDocument, type InspectionOperationFor, type InspectionProtocolDecodeResult, type InspectionSuccessDocument, type InspectionSuccessDocumentFor, } from "./protocol.js";
|
package/dist/inspection/index.js
CHANGED
|
@@ -47,30 +47,24 @@ const __niceevalExport21 = __niceevalCanonical["InspectionTraceResultSchema"];
|
|
|
47
47
|
export { __niceevalExport21 as InspectionTraceResultSchema };
|
|
48
48
|
const __niceevalExport22 = __niceevalCanonical["QUERY_PROTOCOL"];
|
|
49
49
|
export { __niceevalExport22 as QUERY_PROTOCOL };
|
|
50
|
-
const __niceevalExport23 = __niceevalCanonical["
|
|
51
|
-
export { __niceevalExport23 as
|
|
52
|
-
const __niceevalExport24 = __niceevalCanonical["
|
|
53
|
-
export { __niceevalExport24 as
|
|
54
|
-
const __niceevalExport25 = __niceevalCanonical["
|
|
55
|
-
export { __niceevalExport25 as
|
|
56
|
-
const __niceevalExport26 = __niceevalCanonical["
|
|
57
|
-
export { __niceevalExport26 as
|
|
58
|
-
const __niceevalExport27 = __niceevalCanonical["
|
|
59
|
-
export { __niceevalExport27 as
|
|
60
|
-
const __niceevalExport28 = __niceevalCanonical["
|
|
61
|
-
export { __niceevalExport28 as
|
|
62
|
-
const __niceevalExport29 = __niceevalCanonical["
|
|
63
|
-
export { __niceevalExport29 as
|
|
64
|
-
const __niceevalExport30 = __niceevalCanonical["
|
|
65
|
-
export { __niceevalExport30 as
|
|
66
|
-
const __niceevalExport31 = __niceevalCanonical["
|
|
67
|
-
export { __niceevalExport31 as
|
|
68
|
-
const __niceevalExport32 = __niceevalCanonical["
|
|
69
|
-
export { __niceevalExport32 as
|
|
70
|
-
const __niceevalExport33 = __niceevalCanonical["operationalInspectionSource"];
|
|
71
|
-
export { __niceevalExport33 as operationalInspectionSource };
|
|
72
|
-
const __niceevalExport34 = __niceevalCanonical["readScoreMatchAudit"];
|
|
73
|
-
export { __niceevalExport34 as readScoreMatchAudit };
|
|
74
|
-
const __niceevalExport35 = __niceevalCanonical["selectInspectionOperation"];
|
|
75
|
-
export { __niceevalExport35 as selectInspectionOperation };
|
|
50
|
+
const __niceevalExport23 = __niceevalCanonical["decodeInspectionDocument"];
|
|
51
|
+
export { __niceevalExport23 as decodeInspectionDocument };
|
|
52
|
+
const __niceevalExport24 = __niceevalCanonical["decodeInspectionOperation"];
|
|
53
|
+
export { __niceevalExport24 as decodeInspectionOperation };
|
|
54
|
+
const __niceevalExport25 = __niceevalCanonical["decodeInspectionRequest"];
|
|
55
|
+
export { __niceevalExport25 as decodeInspectionRequest };
|
|
56
|
+
const __niceevalExport26 = __niceevalCanonical["externalInspectionSource"];
|
|
57
|
+
export { __niceevalExport26 as externalInspectionSource };
|
|
58
|
+
const __niceevalExport27 = __niceevalCanonical["inspectionProtocolRegistry"];
|
|
59
|
+
export { __niceevalExport27 as inspectionProtocolRegistry };
|
|
60
|
+
const __niceevalExport28 = __niceevalCanonical["openHostOwnedInspectionSource"];
|
|
61
|
+
export { __niceevalExport28 as openHostOwnedInspectionSource };
|
|
62
|
+
const __niceevalExport29 = __niceevalCanonical["openInspectionSource"];
|
|
63
|
+
export { __niceevalExport29 as openInspectionSource };
|
|
64
|
+
const __niceevalExport30 = __niceevalCanonical["operationalInspectionSource"];
|
|
65
|
+
export { __niceevalExport30 as operationalInspectionSource };
|
|
66
|
+
const __niceevalExport31 = __niceevalCanonical["readScoreMatchAudit"];
|
|
67
|
+
export { __niceevalExport31 as readScoreMatchAudit };
|
|
68
|
+
const __niceevalExport32 = __niceevalCanonical["selectInspectionOperation"];
|
|
69
|
+
export { __niceevalExport32 as selectInspectionOperation };
|
|
76
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.projectLifecyclePhase = projectLifecyclePhase;
|
|
4
|
+
function projectLifecyclePhase(phase) {
|
|
5
|
+
return phase.replace(/\.setup$/, ".before").replace(/\.teardown$/, ".after");
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=lifecycle.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["lifecycle.ts"],"names":[],"mappings":";;AAEA,sDAEC;AAFD,SAAgB,qBAAqB,CAAuB,KAAY;IACpE,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAgC,CAAC;AAChH,CAAC","sourcesContent":["/** Public projections use current lifecycle names while Record keeps its stable encoding. */\ntype PublicLifecyclePhase<Phase extends string> = Phase extends `${infer Owner}.setup` ? `${Owner}.before` : Phase extends `${infer Owner}.teardown` ? `${Owner}.after` : Phase;\nexport function projectLifecyclePhase<Phase extends string>(phase: Phase): PublicLifecyclePhase<Phase> {\n return phase.replace(/\\.setup$/, \".before\").replace(/\\.teardown$/, \".after\") as PublicLifecyclePhase<Phase>;\n}\n"]}
|