oh-my-knowledge 0.53.0 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -15
- package/README.zh.md +49 -15
- package/dist/assets/agent-skills/omk/SKILL.md +35 -12
- package/dist/assets/agent-skills/omk/references/commands.md +45 -53
- package/dist/cli/commands/doctor.js +39 -36
- package/dist/cli/commands/eval/gold/compare.d.ts +5 -2
- package/dist/cli/commands/eval/gold/compare.js +57 -28
- package/dist/cli/commands/eval/gold/init.js +1 -1
- package/dist/cli/commands/eval/gold/validate.js +1 -1
- package/dist/cli/commands/eval/index.js +38 -360
- package/dist/cli/commands/evolve.d.ts +2 -12
- package/dist/cli/commands/evolve.js +67 -142
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.js +55 -65
- package/dist/cli/commands/install.js +2 -2
- package/dist/cli/commands/list.d.ts +1 -1
- package/dist/cli/commands/list.js +2 -2
- package/dist/cli/commands/observe/inbox.js +6 -6
- package/dist/cli/commands/observe/index.d.ts +4 -4
- package/dist/cli/commands/observe/index.js +22 -20
- package/dist/cli/commands/observe/ingest.d.ts +1 -1
- package/dist/cli/commands/observe/ingest.js +7 -7
- package/dist/cli/commands/observe/show.js +3 -3
- package/dist/cli/commands/promote.js +10 -18
- package/dist/cli/commands/rollback.js +2 -2
- package/dist/cli/commands/sample.d.ts +3 -20
- package/dist/cli/commands/sample.js +38 -306
- package/dist/cli/commands/studio.js +32 -42
- package/dist/cli/lib/cli-exit.d.ts +1 -1
- package/dist/cli/lib/cli-exit.js +1 -1
- package/dist/cli/lib/cmd-flags.d.ts +1 -14
- package/dist/cli/lib/i18n-dict/common.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/common.js +5 -5
- package/dist/cli/lib/i18n-dict/evolve.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/evolve.js +3 -27
- package/dist/cli/lib/i18n-dict/gen.js +4 -4
- package/dist/cli/lib/i18n-dict/help.js +26 -26
- package/dist/cli/lib/i18n-dict/init.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/init.js +15 -3
- package/dist/cli/lib/i18n-dict/promote.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/promote.js +2 -10
- package/dist/cli/lib/i18n-dict.d.ts +1 -1
- package/dist/cli/lib/i18n-dict.js +1 -1
- package/dist/cli/lib/i18n.d.ts +1 -1
- package/dist/cli/lib/localized-sample-discovery.d.ts +3 -0
- package/dist/cli/lib/localized-sample-discovery.js +16 -0
- package/dist/cli/lib/open-workbench.d.ts +2 -0
- package/dist/cli/lib/open-workbench.js +19 -0
- package/dist/cli/lib/parse-run-config/judge-models.d.ts +1 -1
- package/dist/cli/lib/parse-run-config/samples-discovery.d.ts +6 -7
- package/dist/cli/lib/parse-run-config/samples-discovery.js +19 -18
- package/dist/cli/lib/parse-run-config/variant-resolution.d.ts +2 -1
- package/dist/cli/lib/parse-run-config/variant-resolution.js +2 -2
- package/dist/cli/lib/parse-run-config.d.ts +5 -6
- package/dist/cli/lib/parse-run-config.js +10 -10
- package/dist/cli/lib/progress.d.ts +1 -1
- package/dist/cli/lib/record-evolve-outcome.d.ts +10 -25
- package/dist/cli/lib/record-evolve-outcome.js +26 -103
- package/dist/cli/lib/resolve-skill-input.js +8 -9
- package/dist/cli/lib/run-core-evaluation.d.ts +21 -0
- package/dist/cli/lib/run-core-evaluation.js +340 -0
- package/dist/cli/lib/shared.d.ts +0 -7
- package/dist/cli/lib/shared.js +0 -15
- package/dist/cli/lib/source-probe.d.ts +2 -2
- package/dist/cli/lib/source-probe.js +2 -2
- package/dist/cli/lib/update-check.d.ts +2 -3
- package/dist/cli/lib/update-check.js +4 -5
- package/dist/cli/lib/update-fetch-worker.js +2 -1
- package/dist/cli/templates/init-samples.d.ts +4 -0
- package/dist/cli/templates/init-samples.js +328 -0
- package/dist/diagnosis/contracts/parser.d.ts +9 -0
- package/dist/diagnosis/contracts/parser.js +181 -0
- package/dist/diagnosis/lifecycle.d.ts +4 -0
- package/dist/diagnosis/observe-mapper.d.ts +1 -1
- package/dist/diagnosis/observe-mapper.js +1 -1
- package/dist/diagnosis/observe-producer.d.ts +3 -3
- package/dist/diagnosis/observe-producer.js +2 -2
- package/dist/diagnosis/studio-projection.d.ts +1 -1
- package/dist/diagnosis/studio-projection.js +1 -1
- package/dist/dsh-plugin/cordis.patch.yml +1 -1
- package/dist/dsh-plugin/core-adapter.d.ts +26 -0
- package/dist/dsh-plugin/core-adapter.js +737 -0
- package/dist/dsh-plugin/core-command.d.ts +22 -0
- package/dist/dsh-plugin/core-command.js +305 -0
- package/dist/dsh-plugin/core-protocol.d.ts +16 -0
- package/dist/dsh-plugin/core-protocol.js +250 -0
- package/dist/dsh-plugin/host-executor.d.ts +7 -2
- package/dist/dsh-plugin/host-executor.js +1 -1
- package/dist/dsh-plugin/index.d.ts +5 -3
- package/dist/dsh-plugin/index.js +158 -100
- package/dist/dsh-plugin/observe.d.ts +47 -0
- package/dist/dsh-plugin/observe.js +359 -0
- package/dist/dsh-plugin/protocol.d.ts +1 -1
- package/dist/dsh-plugin/protocol.js +3 -3
- package/dist/dsh-plugin/trace-adapter.d.ts +49 -0
- package/dist/dsh-plugin/trace-adapter.js +590 -0
- package/dist/eval-core/analysis/builtins.d.ts +88 -0
- package/dist/eval-core/analysis/builtins.js +771 -0
- package/dist/eval-core/analysis/decision.d.ts +8 -0
- package/dist/eval-core/analysis/decision.js +488 -0
- package/dist/eval-core/analysis/index.d.ts +4 -0
- package/dist/eval-core/analysis/index.js +4 -0
- package/dist/eval-core/analysis/runtime.d.ts +6 -0
- package/dist/eval-core/analysis/runtime.js +908 -0
- package/dist/eval-core/analysis/types.d.ts +254 -0
- package/dist/eval-core/analysis/types.js +65 -0
- package/dist/eval-core/budget/index.d.ts +44 -0
- package/dist/eval-core/budget/index.js +577 -0
- package/dist/eval-core/compiler/errors.d.ts +24 -0
- package/dist/eval-core/compiler/errors.js +35 -0
- package/dist/eval-core/compiler/immutability.d.ts +2 -0
- package/dist/eval-core/compiler/immutability.js +17 -0
- package/dist/eval-core/compiler/index.d.ts +9 -0
- package/dist/eval-core/compiler/index.js +1013 -0
- package/dist/eval-core/compiler/types.d.ts +334 -0
- package/dist/eval-core/compiler/types.js +110 -0
- package/dist/eval-core/compiler/validation.d.ts +4 -0
- package/dist/eval-core/compiler/validation.js +566 -0
- package/dist/eval-core/contracts/analysis-bundle.d.ts +83 -0
- package/dist/eval-core/contracts/analysis-bundle.js +513 -0
- package/dist/eval-core/contracts/analysis-identities.d.ts +10 -0
- package/dist/eval-core/contracts/analysis-identities.js +24 -0
- package/dist/eval-core/contracts/artifacts.d.ts +9168 -0
- package/dist/eval-core/contracts/artifacts.js +468 -0
- package/dist/eval-core/contracts/budget.d.ts +299 -0
- package/dist/eval-core/contracts/budget.js +323 -0
- package/dist/eval-core/contracts/common.d.ts +191 -0
- package/dist/eval-core/contracts/common.js +132 -0
- package/dist/eval-core/contracts/comparability.d.ts +595 -0
- package/dist/eval-core/contracts/comparability.js +1208 -0
- package/dist/eval-core/contracts/definition.d.ts +1415 -0
- package/dist/eval-core/contracts/definition.js +335 -0
- package/dist/eval-core/contracts/digests.d.ts +118 -0
- package/dist/eval-core/contracts/digests.js +401 -0
- package/dist/eval-core/contracts/evaluation-bundle.d.ts +180 -0
- package/dist/eval-core/contracts/evaluation-bundle.js +862 -0
- package/dist/eval-core/contracts/evaluation-identities.d.ts +46 -0
- package/dist/eval-core/contracts/evaluation-identities.js +82 -0
- package/dist/eval-core/contracts/evaluation-report.d.ts +62 -0
- package/dist/eval-core/contracts/evaluation-report.js +233 -0
- package/dist/eval-core/contracts/execution-bundle.d.ts +150 -0
- package/dist/eval-core/contracts/execution-bundle.js +657 -0
- package/dist/eval-core/contracts/execution-controls.d.ts +147 -0
- package/dist/eval-core/contracts/execution-controls.js +77 -0
- package/dist/eval-core/contracts/execution-facts.d.ts +191 -0
- package/dist/eval-core/contracts/execution-facts.js +349 -0
- package/dist/eval-core/contracts/execution-identities.d.ts +96 -0
- package/dist/eval-core/contracts/execution-identities.js +374 -0
- package/dist/eval-core/contracts/index.d.ts +20 -0
- package/dist/eval-core/contracts/index.js +20 -0
- package/dist/eval-core/contracts/json-schema.d.ts +13 -0
- package/dist/eval-core/contracts/json-schema.js +183 -0
- package/dist/eval-core/contracts/json.d.ts +18 -0
- package/dist/eval-core/contracts/json.js +154 -0
- package/dist/eval-core/contracts/plans.d.ts +2562 -0
- package/dist/eval-core/contracts/plans.js +137 -0
- package/dist/eval-core/contracts/runtime-capabilities.d.ts +203 -0
- package/dist/eval-core/contracts/runtime-capabilities.js +48 -0
- package/dist/eval-core/contracts/schemas/v1/analysis-bundle.schema.json +991 -0
- package/dist/eval-core/contracts/schemas/v1/analysis-plan.schema.json +889 -0
- package/dist/eval-core/contracts/schemas/v1/budget-summary.schema.json +462 -0
- package/dist/eval-core/contracts/schemas/v1/comparability-assessment.schema.json +452 -0
- package/dist/eval-core/contracts/schemas/v1/comparability-policy.schema.json +84 -0
- package/dist/eval-core/contracts/schemas/v1/decision-plan.schema.json +389 -0
- package/dist/eval-core/contracts/schemas/v1/evaluation-bundle.schema.json +1793 -0
- package/dist/eval-core/contracts/schemas/v1/evaluation-definition.schema.json +1243 -0
- package/dist/eval-core/contracts/schemas/v1/evaluation-event.schema.json +144 -0
- package/dist/eval-core/contracts/schemas/v1/evaluation-plan.schema.json +789 -0
- package/dist/eval-core/contracts/schemas/v1/evaluation-report.schema.json +1041 -0
- package/dist/eval-core/contracts/schemas/v1/evaluation-series-definition.schema.json +333 -0
- package/dist/eval-core/contracts/schemas/v1/evaluation-series-plan.schema.json +573 -0
- package/dist/eval-core/contracts/schemas/v1/evaluation-series-report.schema.json +513 -0
- package/dist/eval-core/contracts/schemas/v1/execution-bundle.schema.json +1512 -0
- package/dist/eval-core/contracts/schemas/v1/execution-facts.schema.json +460 -0
- package/dist/eval-core/contracts/schemas/v1/execution-plan.schema.json +1007 -0
- package/dist/eval-core/contracts/schemas/v1/executor-capabilities.schema.json +307 -0
- package/dist/eval-core/contracts/schemas/v1/measurement-policy.schema.json +473 -0
- package/dist/eval-core/contracts/schemas/v1/run-plan.schema.json +2514 -0
- package/dist/eval-core/contracts/schemas/v1/series-analysis-bundle.schema.json +1299 -0
- package/dist/eval-core/contracts/series.d.ts +1924 -0
- package/dist/eval-core/contracts/series.js +686 -0
- package/dist/eval-core/engine/index.d.ts +7 -0
- package/dist/eval-core/engine/index.js +570 -0
- package/dist/eval-core/engine/types.d.ts +148 -0
- package/dist/eval-core/evaluation/index.d.ts +3 -0
- package/dist/eval-core/evaluation/index.js +3 -0
- package/dist/eval-core/evaluation/runtime.d.ts +6 -0
- package/dist/eval-core/evaluation/runtime.js +1224 -0
- package/dist/eval-core/evaluation/types.d.ts +163 -0
- package/dist/eval-core/evaluation/types.js +33 -0
- package/dist/eval-core/execution/index.d.ts +4 -0
- package/dist/eval-core/execution/index.js +4 -0
- package/dist/eval-core/execution/runtime.d.ts +6 -0
- package/dist/eval-core/execution/runtime.js +1140 -0
- package/dist/eval-core/execution/scheduler.d.ts +7 -0
- package/dist/eval-core/execution/scheduler.js +102 -0
- package/dist/eval-core/execution/semaphore.d.ts +6 -0
- package/dist/eval-core/execution/semaphore.js +54 -0
- package/dist/eval-core/execution/types.d.ts +115 -0
- package/dist/eval-core/execution/types.js +34 -0
- package/dist/eval-core/facade.d.ts +8 -0
- package/dist/eval-core/facade.js +2 -0
- package/dist/eval-core/index.d.ts +14 -0
- package/dist/eval-core/index.js +6 -0
- package/dist/eval-core/internal/sealed-run-plan.d.ts +14 -0
- package/dist/eval-core/internal/sealed-run-plan.js +12 -0
- package/dist/eval-core/runtime/event-stream.d.ts +8 -0
- package/dist/eval-core/runtime/event-stream.js +51 -0
- package/dist/eval-core/runtime/events.d.ts +30 -0
- package/dist/eval-core/runtime/events.js +102 -0
- package/dist/eval-core/runtime/snapshot.d.ts +6 -0
- package/dist/eval-core/runtime/snapshot.js +23 -0
- package/dist/eval-core/schema-url.d.ts +4 -0
- package/dist/eval-core/schema-url.js +10 -0
- package/dist/eval-core/schemas.d.ts +2 -0
- package/dist/eval-core/schemas.js +23 -0
- package/dist/eval-core/series/index.d.ts +1 -0
- package/dist/eval-core/series/index.js +1 -0
- package/dist/eval-core/series/runtime.d.ts +146 -0
- package/dist/eval-core/series/runtime.js +758 -0
- package/dist/eval-workflows/analysis/bootstrap.d.ts +145 -0
- package/dist/eval-workflows/analysis/bootstrap.js +274 -0
- package/dist/eval-workflows/artifact-store/batch-contracts.d.ts +117 -0
- package/dist/eval-workflows/artifact-store/batch-contracts.js +70 -0
- package/dist/eval-workflows/artifact-store/contracts.d.ts +161 -0
- package/dist/eval-workflows/artifact-store/contracts.js +115 -0
- package/dist/eval-workflows/artifact-store/index.d.ts +6 -0
- package/dist/eval-workflows/artifact-store/index.js +6 -0
- package/dist/eval-workflows/artifact-store/node-batch-store.d.ts +8 -0
- package/dist/eval-workflows/artifact-store/node-batch-store.js +187 -0
- package/dist/eval-workflows/artifact-store/node-content-store.d.ts +13 -0
- package/dist/eval-workflows/artifact-store/node-content-store.js +157 -0
- package/dist/eval-workflows/artifact-store/node-run-store.d.ts +12 -0
- package/dist/eval-workflows/artifact-store/node-run-store.js +516 -0
- package/dist/eval-workflows/artifact-store/overlay-store.d.ts +12 -0
- package/dist/eval-workflows/artifact-store/overlay-store.js +112 -0
- package/dist/eval-workflows/artifact-store/private-json-file.d.ts +4 -0
- package/dist/eval-workflows/artifact-store/private-json-file.js +50 -0
- package/dist/eval-workflows/assertions/deterministic.d.ts +31 -0
- package/dist/eval-workflows/assertions/deterministic.js +301 -0
- package/dist/eval-workflows/assertions/layers.d.ts +5 -0
- package/dist/eval-workflows/assertions/layers.js +55 -0
- package/dist/eval-workflows/evaluation-defaults.d.ts +4 -0
- package/dist/eval-workflows/evaluation-defaults.js +4 -0
- package/dist/eval-workflows/gold/cli.d.ts +9 -0
- package/dist/eval-workflows/gold/cli.js +61 -0
- package/dist/eval-workflows/gold/human.d.ts +103 -0
- package/dist/eval-workflows/gold/human.js +189 -0
- package/dist/eval-workflows/input-compilation/compile.d.ts +6 -0
- package/dist/eval-workflows/input-compilation/compile.js +1108 -0
- package/dist/eval-workflows/input-compilation/error.d.ts +16 -0
- package/dist/eval-workflows/input-compilation/error.js +14 -0
- package/dist/eval-workflows/input-compilation/index.d.ts +5 -0
- package/dist/eval-workflows/input-compilation/index.js +5 -0
- package/dist/eval-workflows/input-compilation/parse.d.ts +25 -0
- package/dist/eval-workflows/input-compilation/parse.js +546 -0
- package/dist/eval-workflows/input-compilation/registry.d.ts +35 -0
- package/dist/eval-workflows/input-compilation/registry.js +274 -0
- package/dist/eval-workflows/input-compilation/types.d.ts +396 -0
- package/dist/eval-workflows/input-compilation/types.js +4 -0
- package/dist/eval-workflows/inputs/assertion-types.d.ts +6 -0
- package/dist/eval-workflows/inputs/contracts/assertion-kind.d.ts +3 -0
- package/dist/eval-workflows/inputs/contracts/assertion.d.ts +25 -0
- package/dist/eval-workflows/inputs/contracts/config.d.ts +68 -0
- package/dist/eval-workflows/inputs/contracts/index.d.ts +5 -0
- package/dist/eval-workflows/inputs/contracts/sample.d.ts +78 -0
- package/dist/eval-workflows/inputs/contracts/schemas/v1/eval-sample-set.schema.json +620 -0
- package/dist/eval-workflows/inputs/contracts/variant.d.ts +16 -0
- package/dist/eval-workflows/inputs/eval-config.d.ts +19 -0
- package/dist/eval-workflows/inputs/eval-config.js +340 -0
- package/dist/eval-workflows/inputs/eval-samples.d.ts +8 -0
- package/dist/eval-workflows/inputs/eval-samples.js +12 -0
- package/dist/eval-workflows/inputs/load-samples.d.ts +43 -0
- package/dist/eval-workflows/inputs/load-samples.js +290 -0
- package/dist/eval-workflows/inputs/materialize-copy.js +193 -0
- package/dist/eval-workflows/inputs/sample-contract.d.ts +3 -0
- package/dist/eval-workflows/inputs/sample-contract.js +361 -0
- package/dist/eval-workflows/inputs/sample-document.d.ts +10 -0
- package/dist/eval-workflows/inputs/sample-document.js +94 -0
- package/dist/eval-workflows/inputs/sample-locator.d.ts +27 -0
- package/dist/eval-workflows/inputs/sample-locator.js +160 -0
- package/dist/eval-workflows/inputs/schemas/assertion.d.ts +4 -0
- package/dist/eval-workflows/inputs/schemas/assertion.js +23 -0
- package/dist/eval-workflows/inputs/schemas/error.d.ts +8 -0
- package/dist/eval-workflows/inputs/schemas/error.js +36 -0
- package/dist/eval-workflows/inputs/schemas/json-schema.d.ts +1 -0
- package/dist/eval-workflows/inputs/schemas/json-schema.js +27 -0
- package/dist/eval-workflows/inputs/schemas/mock.d.ts +6 -0
- package/dist/eval-workflows/inputs/schemas/mock.js +27 -0
- package/dist/eval-workflows/inputs/schemas/sample-set.d.ts +15 -0
- package/dist/eval-workflows/inputs/schemas/sample-set.js +60 -0
- package/dist/eval-workflows/inputs/skill-loader.d.ts +191 -0
- package/dist/eval-workflows/inputs/skill-loader.js +836 -0
- package/dist/eval-workflows/instruments/contracts/config.d.ts +7 -0
- package/dist/eval-workflows/instruments/contracts/index.d.ts +2 -0
- package/dist/eval-workflows/instruments/contracts/result.d.ts +54 -0
- package/dist/eval-workflows/instruments/judge-trace.d.ts +8 -0
- package/dist/eval-workflows/instruments/judge-trace.js +94 -0
- package/dist/eval-workflows/instruments/judge.d.ts +78 -0
- package/dist/eval-workflows/instruments/judge.js +323 -0
- package/dist/eval-workflows/instruments/prompts/debias-instructions.js +43 -0
- package/dist/eval-workflows/instruments/prompts/judge-prompts.d.ts +30 -0
- package/dist/eval-workflows/instruments/prompts/judge-prompts.js +205 -0
- package/dist/eval-workflows/messages.d.ts +1 -1
- package/dist/eval-workflows/production-host/artifact-graph-persistence.d.ts +11 -0
- package/dist/eval-workflows/production-host/artifact-graph-persistence.js +66 -0
- package/dist/eval-workflows/production-host/environment.d.ts +9 -0
- package/dist/eval-workflows/production-host/environment.js +34 -0
- package/dist/eval-workflows/production-host/holdout.d.ts +8 -0
- package/dist/eval-workflows/production-host/holdout.js +25 -0
- package/dist/eval-workflows/production-host/index.d.ts +9 -0
- package/dist/eval-workflows/production-host/index.js +9 -0
- package/dist/eval-workflows/production-host/measurement-design.d.ts +21 -0
- package/dist/eval-workflows/production-host/measurement-design.js +562 -0
- package/dist/eval-workflows/production-host/node-cli-composition.d.ts +26 -0
- package/dist/eval-workflows/production-host/node-cli-composition.js +474 -0
- package/dist/eval-workflows/production-host/node-cli-evaluation-resolver.d.ts +20 -0
- package/dist/eval-workflows/production-host/node-cli-evaluation-resolver.js +755 -0
- package/dist/eval-workflows/production-host/node-sample-content-resolver.d.ts +43 -0
- package/dist/eval-workflows/production-host/node-sample-content-resolver.js +270 -0
- package/dist/eval-workflows/production-host/orchestration.d.ts +78 -0
- package/dist/eval-workflows/production-host/orchestration.js +274 -0
- package/dist/eval-workflows/production-host/runtime-registry.d.ts +57 -0
- package/dist/eval-workflows/production-host/runtime-registry.js +270 -0
- package/dist/eval-workflows/production-host/safe-http-content-resolver.d.ts +4 -0
- package/dist/eval-workflows/production-host/safe-http-content-resolver.js +219 -0
- package/dist/eval-workflows/production-host/sample-content-resolution.d.ts +44 -0
- package/dist/eval-workflows/production-host/sample-content-resolution.js +242 -0
- package/dist/eval-workflows/production-host/workflow.d.ts +76 -0
- package/dist/eval-workflows/production-host/workflow.js +200 -0
- package/dist/eval-workflows/projections/artifact-graph.d.ts +15 -0
- package/dist/eval-workflows/projections/artifact-graph.js +388 -0
- package/dist/eval-workflows/projections/cli-gate.d.ts +3 -0
- package/dist/eval-workflows/projections/cli-gate.js +45 -0
- package/dist/eval-workflows/projections/cli.d.ts +39 -0
- package/dist/eval-workflows/projections/cli.js +334 -0
- package/dist/eval-workflows/projections/contracts.d.ts +332 -0
- package/dist/eval-workflows/projections/contracts.js +16 -0
- package/dist/eval-workflows/projections/decision.d.ts +4 -0
- package/dist/eval-workflows/projections/decision.js +27 -0
- package/dist/eval-workflows/projections/diagnostic.d.ts +7 -0
- package/dist/eval-workflows/projections/diagnostic.js +160 -0
- package/dist/eval-workflows/projections/evolution.d.ts +13 -0
- package/dist/eval-workflows/projections/evolution.js +144 -0
- package/dist/eval-workflows/projections/gold.d.ts +21 -0
- package/dist/eval-workflows/projections/gold.js +204 -0
- package/dist/eval-workflows/projections/index.d.ts +9 -0
- package/dist/eval-workflows/projections/index.js +9 -0
- package/dist/eval-workflows/projections/managed.d.ts +8 -0
- package/dist/eval-workflows/projections/managed.js +105 -0
- package/dist/eval-workflows/projections/source.d.ts +2 -0
- package/dist/eval-workflows/projections/source.js +48 -0
- package/dist/eval-workflows/resume-admission/admit.d.ts +8 -0
- package/dist/eval-workflows/resume-admission/admit.js +180 -0
- package/dist/eval-workflows/resume-admission/contracts.d.ts +81 -0
- package/dist/eval-workflows/resume-admission/contracts.js +22 -0
- package/dist/eval-workflows/resume-admission/index.d.ts +2 -0
- package/dist/eval-workflows/resume-admission/index.js +2 -0
- package/dist/eval-workflows/runtime-adapter/adapters/anthropic/api.d.ts +31 -0
- package/dist/eval-workflows/runtime-adapter/adapters/anthropic/api.js +286 -0
- package/dist/eval-workflows/runtime-adapter/adapters/anthropic/protocol.d.ts +67 -0
- package/dist/eval-workflows/runtime-adapter/adapters/anthropic/protocol.js +192 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/cli-protocol.d.ts +19 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/cli-protocol.js +322 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/cli.d.ts +48 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/cli.js +607 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/resources.d.ts +151 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/resources.js +664 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk-protocol.d.ts +7 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk-protocol.js +84 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk-runtime.d.ts +40 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk-runtime.js +163 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk.d.ts +29 -0
- package/dist/eval-workflows/runtime-adapter/adapters/claude/sdk.js +507 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/cli-protocol.d.ts +61 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/cli-protocol.js +36 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/cli-resources.d.ts +13 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/cli-resources.js +16 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/cli.d.ts +44 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/cli.js +348 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/content-identity.d.ts +5 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/content-identity.js +3 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/environment.d.ts +4 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/environment.js +2 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/protocol-core.d.ts +21 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/protocol-core.js +232 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/resources.d.ts +108 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/resources.js +331 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk-protocol.d.ts +61 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk-protocol.js +20 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk-runtime.d.ts +33 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk-runtime.js +169 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk.d.ts +32 -0
- package/dist/eval-workflows/runtime-adapter/adapters/codex/sdk.js +375 -0
- package/dist/eval-workflows/runtime-adapter/adapters/custom/command.d.ts +207 -0
- package/dist/eval-workflows/runtime-adapter/adapters/custom/command.js +696 -0
- package/dist/eval-workflows/runtime-adapter/adapters/index.d.ts +8 -0
- package/dist/eval-workflows/runtime-adapter/adapters/index.js +8 -0
- package/dist/eval-workflows/runtime-adapter/adapters/openai/api.d.ts +31 -0
- package/dist/eval-workflows/runtime-adapter/adapters/openai/api.js +292 -0
- package/dist/eval-workflows/runtime-adapter/adapters/openai/protocol.d.ts +67 -0
- package/dist/eval-workflows/runtime-adapter/adapters/openai/protocol.js +236 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/api-http.d.ts +53 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/api-http.js +167 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/api-protocol-core.d.ts +7 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/api-protocol-core.js +96 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/classified-environment.d.ts +21 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/classified-environment.js +43 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/content-identity.d.ts +16 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/content-identity.js +101 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/same-process.d.ts +109 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/same-process.js +322 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/stateless-api-resources.d.ts +80 -0
- package/dist/eval-workflows/runtime-adapter/adapters/shared/stateless-api-resources.js +230 -0
- package/dist/eval-workflows/runtime-adapter/analysis/agreement-node-contract.d.ts +10 -0
- package/dist/eval-workflows/runtime-adapter/analysis/agreement-node-contract.js +78 -0
- package/dist/eval-workflows/runtime-adapter/analysis/agreement-node.d.ts +3 -0
- package/dist/eval-workflows/runtime-adapter/analysis/agreement-node.js +29 -0
- package/dist/eval-workflows/runtime-adapter/analysis/agreement-parameters.d.ts +31 -0
- package/dist/eval-workflows/runtime-adapter/analysis/agreement-parameters.js +65 -0
- package/dist/eval-workflows/runtime-adapter/analysis/agreement-source-adapter.d.ts +11 -0
- package/dist/eval-workflows/runtime-adapter/analysis/agreement-source-adapter.js +114 -0
- package/dist/eval-workflows/runtime-adapter/analysis/agreement-table.d.ts +259 -0
- package/dist/eval-workflows/runtime-adapter/analysis/agreement-table.js +303 -0
- package/dist/eval-workflows/runtime-adapter/analysis/analysis-support.d.ts +14 -0
- package/dist/eval-workflows/runtime-adapter/analysis/analysis-support.js +44 -0
- package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer-node.d.ts +5 -0
- package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer-node.js +218 -0
- package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer-parameters.d.ts +39 -0
- package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer-parameters.js +49 -0
- package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer.d.ts +552 -0
- package/dist/eval-workflows/runtime-adapter/analysis/assertion-layer.js +289 -0
- package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-node-contract.d.ts +10 -0
- package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-node-contract.js +89 -0
- package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-node.d.ts +3 -0
- package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-node.js +35 -0
- package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-parameters.d.ts +41 -0
- package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-parameters.js +111 -0
- package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-source-adapter.d.ts +9 -0
- package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-source-adapter.js +28 -0
- package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-table.d.ts +240 -0
- package/dist/eval-workflows/runtime-adapter/analysis/bootstrap-family-table.js +368 -0
- package/dist/eval-workflows/runtime-adapter/analysis/composite-node-contract.d.ts +10 -0
- package/dist/eval-workflows/runtime-adapter/analysis/composite-node-contract.js +80 -0
- package/dist/eval-workflows/runtime-adapter/analysis/composite-node.d.ts +3 -0
- package/dist/eval-workflows/runtime-adapter/analysis/composite-node.js +79 -0
- package/dist/eval-workflows/runtime-adapter/analysis/composite-parameters.d.ts +56 -0
- package/dist/eval-workflows/runtime-adapter/analysis/composite-parameters.js +92 -0
- package/dist/eval-workflows/runtime-adapter/analysis/composite-source-adapter.d.ts +13 -0
- package/dist/eval-workflows/runtime-adapter/analysis/composite-source-adapter.js +60 -0
- package/dist/eval-workflows/runtime-adapter/analysis/composite-table.d.ts +244 -0
- package/dist/eval-workflows/runtime-adapter/analysis/composite-table.js +199 -0
- package/dist/eval-workflows/runtime-adapter/analysis/dimension-node.d.ts +5 -0
- package/dist/eval-workflows/runtime-adapter/analysis/dimension-node.js +169 -0
- package/dist/eval-workflows/runtime-adapter/analysis/dimension-parameters.d.ts +24 -0
- package/dist/eval-workflows/runtime-adapter/analysis/dimension-parameters.js +44 -0
- package/dist/eval-workflows/runtime-adapter/analysis/dimension-table.d.ts +135 -0
- package/dist/eval-workflows/runtime-adapter/analysis/dimension-table.js +195 -0
- package/dist/eval-workflows/runtime-adapter/analysis/index.d.ts +21 -0
- package/dist/eval-workflows/runtime-adapter/analysis/index.js +21 -0
- package/dist/eval-workflows/runtime-adapter/analysis/judge-aggregation.d.ts +343 -0
- package/dist/eval-workflows/runtime-adapter/analysis/judge-aggregation.js +731 -0
- package/dist/eval-workflows/runtime-adapter/analysis/release-decision-parameters.d.ts +36 -0
- package/dist/eval-workflows/runtime-adapter/analysis/release-decision-parameters.js +114 -0
- package/dist/eval-workflows/runtime-adapter/analysis/release-decision.d.ts +6 -0
- package/dist/eval-workflows/runtime-adapter/analysis/release-decision.js +406 -0
- package/dist/eval-workflows/runtime-adapter/assembly.d.ts +6 -0
- package/dist/eval-workflows/runtime-adapter/assembly.js +787 -0
- package/dist/eval-workflows/runtime-adapter/builtins.d.ts +7 -0
- package/dist/eval-workflows/runtime-adapter/builtins.js +106 -0
- package/dist/eval-workflows/runtime-adapter/composition.d.ts +82 -0
- package/dist/eval-workflows/runtime-adapter/composition.js +824 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/assertion-common.d.ts +17 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/assertion-common.js +72 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/execution-assertions.d.ts +38 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/execution-assertions.js +307 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/index.d.ts +5 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/index.js +5 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/llm-assertions.d.ts +71 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/llm-assertions.js +493 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/llm-judge-invocation.d.ts +49 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/llm-judge-invocation.js +72 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/output-assertions.d.ts +33 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/output-assertions.js +168 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/rubric-judge.d.ts +73 -0
- package/dist/eval-workflows/runtime-adapter/evaluators/rubric-judge.js +431 -0
- package/dist/eval-workflows/runtime-adapter/event-projection.d.ts +34 -0
- package/dist/eval-workflows/runtime-adapter/event-projection.js +175 -0
- package/dist/eval-workflows/runtime-adapter/index.d.ts +11 -0
- package/dist/eval-workflows/runtime-adapter/index.js +11 -0
- package/dist/eval-workflows/runtime-adapter/preflight.d.ts +54 -0
- package/dist/eval-workflows/runtime-adapter/preflight.js +248 -0
- package/dist/eval-workflows/runtime-adapter/resource-leases/access.d.ts +14 -0
- package/dist/eval-workflows/runtime-adapter/resource-leases/access.js +173 -0
- package/dist/eval-workflows/runtime-adapter/resource-leases/index.d.ts +3 -0
- package/dist/eval-workflows/runtime-adapter/resource-leases/index.js +3 -0
- package/dist/eval-workflows/runtime-adapter/resource-leases/node.d.ts +24 -0
- package/dist/eval-workflows/runtime-adapter/resource-leases/node.js +803 -0
- package/dist/eval-workflows/runtime-adapter/resource-leases/types.d.ts +105 -0
- package/dist/eval-workflows/runtime-adapter/resource-leases/types.js +25 -0
- package/dist/eval-workflows/runtime-adapter/series-variance.d.ts +6 -0
- package/dist/eval-workflows/runtime-adapter/series-variance.js +94 -0
- package/dist/eval-workflows/runtime-adapter/source-neutral-trace.d.ts +57 -0
- package/dist/eval-workflows/runtime-adapter/source-neutral-trace.js +66 -0
- package/dist/eval-workflows/runtime-adapter/types.d.ts +159 -0
- package/dist/eval-workflows/runtime-adapter/types.js +12 -0
- package/dist/evidence/graph/contracts.d.ts +93 -0
- package/dist/evidence/graph/doctor.d.ts +22 -0
- package/dist/evidence/graph/doctor.js +572 -0
- package/dist/evidence/graph/schema.d.ts +3 -0
- package/dist/evidence/graph/schema.js +233 -0
- package/dist/evidence/storage/default-dirs.d.ts +34 -0
- package/dist/evidence/storage/default-dirs.js +35 -0
- package/dist/evidence/storage/directories.js +65 -0
- package/dist/evidence/storage/discovery-index.d.ts +88 -0
- package/dist/evidence/storage/discovery-index.js +307 -0
- package/dist/evidence/storage/file-names.d.ts +14 -0
- package/dist/evidence/storage/file-names.js +57 -0
- package/dist/evidence/storage/layout.d.ts +35 -0
- package/dist/evidence/storage/layout.js +50 -0
- package/dist/evidence/storage/report-bundle.d.ts +35 -0
- package/dist/evidence/storage/report-bundle.js +122 -0
- package/dist/evidence/storage/run-id.d.ts +2 -0
- package/dist/evidence/storage/run-id.js +19 -0
- package/dist/executors/anthropic/api.d.ts +3 -2
- package/dist/executors/anthropic/api.js +5 -3
- package/dist/executors/anthropic/claude/cli.d.ts +3 -2
- package/dist/executors/anthropic/claude/cli.js +3 -2
- package/dist/executors/anthropic/claude/protocol.d.ts +1 -1
- package/dist/executors/anthropic/claude/protocol.js +1 -1
- package/dist/executors/anthropic/claude/sdk.d.ts +3 -2
- package/dist/executors/anthropic/claude/sdk.js +7 -2
- package/dist/executors/anthropic/claude/trace.d.ts +1 -1
- package/dist/executors/anthropic/claude/trace.js +4 -4
- package/dist/executors/contracts/index.d.ts +4 -0
- package/dist/executors/contracts/index.js +1 -0
- package/dist/executors/contracts/mock.d.ts +65 -0
- package/dist/executors/contracts/mock.js +1 -0
- package/dist/executors/contracts/ports.d.ts +63 -0
- package/dist/executors/contracts/ports.js +1 -0
- package/dist/executors/contracts/result.d.ts +41 -0
- package/dist/executors/contracts/result.js +1 -0
- package/dist/executors/contracts/runtime.d.ts +40 -0
- package/dist/executors/contracts/runtime.js +1 -0
- package/dist/executors/contracts/trace-source.d.ts +2 -0
- package/dist/executors/contracts/trace-source.js +1 -0
- package/dist/executors/contracts/trace.d.ts +36 -0
- package/dist/executors/contracts/trace.js +1 -0
- package/dist/executors/core/capabilities.d.ts +6 -2
- package/dist/executors/core/runtime-fingerprint.d.ts +2 -1
- package/dist/executors/core/runtime.d.ts +1 -1
- package/dist/executors/core/subprocess.d.ts +1 -0
- package/dist/executors/core/subprocess.js +9 -8
- package/dist/executors/core/trace-source-kind.d.ts +4 -0
- package/dist/executors/core/trace-source-kind.js +13 -0
- package/dist/executors/index.d.ts +1 -1
- package/dist/executors/mock-runtime/mock-hook.cjs +271 -0
- package/dist/executors/mock-runtime/runtime.d.ts +103 -0
- package/dist/executors/mock-runtime/runtime.js +638 -0
- package/dist/executors/openai/api.d.ts +3 -2
- package/dist/executors/openai/api.js +5 -3
- package/dist/executors/openai/codex/cli.d.ts +3 -2
- package/dist/executors/openai/codex/cli.js +3 -1
- package/dist/executors/openai/codex/protocol.d.ts +2 -1
- package/dist/executors/openai/codex/protocol.js +1 -1
- package/dist/executors/openai/codex/sdk.d.ts +3 -2
- package/dist/executors/openai/codex/sdk.js +6 -1
- package/dist/executors/openai/codex/trace.d.ts +1 -1
- package/dist/executors/openai/codex/trace.js +2 -2
- package/dist/executors/preflight/contracts.d.ts +40 -0
- package/dist/executors/preflight/contracts.js +1 -0
- package/dist/executors/preflight/dependencies.d.ts +36 -0
- package/dist/executors/result-validation.d.ts +18 -0
- package/dist/executors/result-validation.js +221 -0
- package/dist/executors/script/index.d.ts +1 -1
- package/dist/executors/script/index.js +2 -2
- package/dist/executors/tool-call-status.d.ts +9 -0
- package/dist/executors/tool-call-status.js +79 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/knowledge-artifacts/authoring/core-evolver.d.ts +65 -0
- package/dist/knowledge-artifacts/authoring/core-evolver.js +277 -0
- package/dist/knowledge-artifacts/authoring/generator.d.ts +100 -0
- package/dist/knowledge-artifacts/authoring/generator.js +1019 -0
- package/dist/knowledge-artifacts/authoring/improvement.d.ts +15 -0
- package/dist/knowledge-artifacts/authoring/improvement.js +52 -0
- package/dist/knowledge-artifacts/contracts.d.ts +18 -0
- package/dist/knowledge-artifacts/contracts.js +1 -0
- package/dist/knowledge-artifacts/doctor/contracts.d.ts +199 -0
- package/dist/knowledge-artifacts/doctor/contracts.js +1 -0
- package/dist/knowledge-artifacts/doctor/endpoint-rule.d.ts +60 -0
- package/dist/knowledge-artifacts/doctor/endpoint-rule.js +382 -0
- package/dist/knowledge-artifacts/doctor/fixer.d.ts +11 -0
- package/dist/knowledge-artifacts/doctor/fixer.js +337 -0
- package/dist/knowledge-artifacts/doctor/health/composer.d.ts +18 -0
- package/dist/knowledge-artifacts/doctor/health/composer.js +407 -0
- package/dist/knowledge-artifacts/doctor/health/dimension-spec.d.ts +52 -0
- package/dist/knowledge-artifacts/doctor/health/merge-prompt.d.ts +22 -0
- package/dist/knowledge-artifacts/doctor/health/prompt-builder.d.ts +21 -0
- package/dist/knowledge-artifacts/doctor/index.d.ts +19 -0
- package/dist/knowledge-artifacts/doctor/index.js +274 -0
- package/dist/knowledge-artifacts/doctor/messages.d.ts +20 -0
- package/dist/knowledge-artifacts/doctor/preflight.d.ts +32 -0
- package/dist/knowledge-artifacts/doctor/preflight.js +31 -0
- package/dist/knowledge-artifacts/doctor/renderer.d.ts +17 -0
- package/dist/knowledge-artifacts/doctor/report-parser.d.ts +3 -0
- package/dist/knowledge-artifacts/doctor/report-parser.js +103 -0
- package/dist/knowledge-artifacts/doctor/report-schema.d.ts +3 -0
- package/dist/knowledge-artifacts/doctor/report-schema.js +3 -0
- package/dist/knowledge-artifacts/doctor/rule-kind.d.ts +2 -0
- package/dist/knowledge-artifacts/doctor/rule-kind.js +3 -0
- package/dist/knowledge-artifacts/doctor/rules.d.ts +32 -0
- package/dist/knowledge-artifacts/doctor/rules.js +290 -0
- package/dist/knowledge-artifacts/governance/contracts.d.ts +158 -0
- package/dist/knowledge-artifacts/governance/contracts.js +1 -0
- package/dist/knowledge-artifacts/governance/evidence.d.ts +24 -0
- package/dist/knowledge-artifacts/governance/evidence.js +109 -0
- package/dist/knowledge-artifacts/governance/index.d.ts +11 -0
- package/dist/knowledge-artifacts/governance/index.js +11 -0
- package/dist/knowledge-artifacts/governance/list-view.d.ts +67 -0
- package/dist/knowledge-artifacts/governance/list-view.js +77 -0
- package/dist/knowledge-artifacts/governance/observe-feedback.d.ts +60 -0
- package/dist/knowledge-artifacts/governance/promote-gate.d.ts +34 -0
- package/dist/knowledge-artifacts/governance/promote-gate.js +32 -0
- package/dist/knowledge-artifacts/governance/source-probe.d.ts +15 -0
- package/dist/knowledge-artifacts/governance/source-probe.js +129 -0
- package/dist/knowledge-artifacts/governance/store.d.ts +141 -0
- package/dist/knowledge-artifacts/governance/store.js +585 -0
- package/dist/knowledge-artifacts/skills/contracts.d.ts +35 -0
- package/dist/knowledge-artifacts/skills/contracts.js +1 -0
- package/dist/knowledge-artifacts/skills/hard-rules.d.ts +7 -0
- package/dist/knowledge-artifacts/sources/content-hash.d.ts +31 -0
- package/dist/knowledge-artifacts/sources/content-hash.js +121 -0
- package/dist/mcp/capture-store.d.ts +25 -0
- package/dist/mcp/capture-store.js +48 -0
- package/dist/mcp/feedback-store.d.ts +78 -0
- package/dist/mcp/feedback-store.js +241 -0
- package/dist/mcp/http.d.ts +26 -0
- package/dist/mcp/http.js +225 -0
- package/dist/mcp/index.d.ts +7 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/mcp-server.d.ts +14 -0
- package/dist/mcp/mcp-server.js +293 -0
- package/dist/mcp/principal.d.ts +25 -0
- package/dist/mcp/principal.js +83 -0
- package/dist/mcp/review-component.d.ts +11 -0
- package/dist/mcp/review-component.js +846 -0
- package/dist/mcp/stdio.d.ts +2 -0
- package/dist/mcp/stdio.js +16 -0
- package/dist/observability/analysis/contracts.d.ts +57 -0
- package/dist/observability/analysis/contracts.js +1 -0
- package/dist/observability/analysis/coverage-analyzer.d.ts +53 -0
- package/dist/observability/analysis/coverage-analyzer.js +306 -0
- package/dist/observability/analysis/gap-analyzer.d.ts +118 -0
- package/dist/observability/analysis/gap-analyzer.js +470 -0
- package/dist/observability/analysis/hedging-classifier.d.ts +34 -0
- package/dist/observability/contracts/experience.d.ts +651 -0
- package/dist/observability/contracts/experience.js +1 -0
- package/dist/observability/contracts/inbox.d.ts +181 -0
- package/dist/observability/contracts/inbox.js +1 -0
- package/dist/observability/contracts/index.d.ts +7 -0
- package/dist/observability/contracts/index.js +1 -0
- package/dist/observability/contracts/problem-patterns.d.ts +50 -0
- package/dist/observability/contracts/problem-patterns.js +1 -0
- package/dist/observability/contracts/review.d.ts +47 -0
- package/dist/observability/contracts/review.js +1 -0
- package/dist/observability/contracts/skill-chain-advisories.d.ts +8 -0
- package/dist/observability/contracts/skill-chain-advisories.js +1 -0
- package/dist/observability/contracts/skill-chain.d.ts +114 -0
- package/dist/observability/contracts/skill-chain.js +1 -0
- package/dist/observability/contracts/trace.d.ts +22 -0
- package/dist/observability/contracts/trace.js +1 -0
- package/dist/observability/conversation/catalog.d.ts +42 -0
- package/dist/observability/conversation/catalog.js +575 -0
- package/dist/observability/conversation/index-process.d.ts +1 -0
- package/dist/observability/conversation/index-process.js +31 -0
- package/dist/observability/conversation/knowledge-debugger.d.ts +7 -0
- package/dist/observability/conversation/knowledge-debugger.js +397 -0
- package/dist/observability/conversation/task-semantic-projection.d.ts +11 -0
- package/dist/observability/conversation/task-window.d.ts +10 -0
- package/dist/observability/conversation/task-window.js +57 -0
- package/dist/observability/conversation/turn-index.d.ts +3 -0
- package/dist/observability/conversation/turn-index.js +255 -0
- package/dist/observability/conversation/view-model.d.ts +5 -0
- package/dist/observability/conversation/view-model.js +100 -0
- package/dist/observability/experience/primitives.d.ts +11 -0
- package/dist/observability/experience/primitives.js +75 -0
- package/dist/observability/experience/report-codec.d.ts +33 -0
- package/dist/observability/experience/report-codec.js +235 -0
- package/dist/observability/experience/report-derivations.d.ts +35 -0
- package/dist/observability/experience/report-derivations.js +283 -0
- package/dist/observability/experience/report-reference-validator.d.ts +18 -0
- package/dist/observability/experience/report-reference-validator.js +596 -0
- package/dist/observability/experience/report-structure.d.ts +9 -0
- package/dist/observability/experience/report-structure.js +93 -0
- package/dist/observability/experience/report-value-guards.d.ts +65 -0
- package/dist/observability/experience/report-value-guards.js +1224 -0
- package/dist/observability/experience/review-checklist.d.ts +43 -0
- package/dist/observability/experience/review-checklist.js +630 -0
- package/dist/observability/experience/reviewer-report.d.ts +17 -0
- package/dist/observability/experience/reviewer-report.js +281 -0
- package/dist/observability/experience/session-story.d.ts +93 -0
- package/dist/observability/experience/session-story.js +1351 -0
- package/dist/observability/experience/text-signals.d.ts +7 -0
- package/dist/observability/experience/text-signals.js +30 -0
- package/dist/observability/experience/timeline.d.ts +29 -0
- package/dist/observability/experience/timeline.js +495 -0
- package/dist/observability/experience.d.ts +13 -43
- package/dist/observability/experience.js +177 -5378
- package/dist/observability/inbox/capture-coverage.d.ts +3 -0
- package/dist/observability/inbox/capture-coverage.js +34 -0
- package/dist/observability/inbox/explicit-capture.d.ts +50 -0
- package/dist/observability/inbox/explicit-capture.js +223 -0
- package/dist/observability/inbox/feedback-projection.d.ts +20 -0
- package/dist/observability/inbox/identity.d.ts +6 -0
- package/dist/observability/inbox/identity.js +44 -0
- package/dist/observability/inbox/index.d.ts +36 -0
- package/dist/observability/inbox/index.js +1339 -0
- package/dist/observability/inbox/paths.d.ts +10 -0
- package/dist/observability/inbox/paths.js +65 -0
- package/dist/observability/inbox/problem-patterns.d.ts +11 -0
- package/dist/observability/inbox/problem-patterns.js +246 -0
- package/dist/observability/inbox/resolved-review.d.ts +36 -0
- package/dist/observability/inbox/review-state.d.ts +25 -0
- package/dist/observability/inbox/review-state.js +352 -0
- package/dist/observability/inbox/source-record-archive.d.ts +14 -0
- package/dist/observability/inbox/source-record-archive.js +328 -0
- package/dist/observability/inbox/view-model.d.ts +44 -0
- package/dist/observability/inbox/view-model.js +186 -0
- package/dist/observability/prompts/document.js +21 -0
- package/dist/observability/skill-health/advisories.d.ts +15 -0
- package/dist/observability/skill-health/analyzer.d.ts +129 -0
- package/dist/observability/skill-health/analyzer.js +328 -0
- package/dist/observability/skill-health/experience-frontmatter.d.ts +36 -0
- package/dist/observability/skill-health/experience-frontmatter.js +99 -0
- package/dist/observability/skill-health/report.d.ts +10 -0
- package/dist/observability/skill-health/report.js +620 -0
- package/dist/observability/skill-health/skill-chain.d.ts +7 -0
- package/dist/observability/skill-health/skill-chain.js +486 -0
- package/dist/observability/soft-standards/llm-extractor.js +1 -1
- package/dist/observability/soft-standards/runtime-evaluator.d.ts +1 -1
- package/dist/observability/soft-standards/skill-standards-store.d.ts +1 -1
- package/dist/observability/soft-standards/skill-standards-store.js +4 -3
- package/dist/observability/soft-standards/types.d.ts +2 -2
- package/dist/observability/trace/adapters/codex/conversation-index.d.ts +92 -0
- package/dist/observability/trace/adapters/codex/conversation-index.js +600 -0
- package/dist/observability/trace/adapters/codex/tool-status.d.ts +16 -0
- package/dist/observability/trace/adapters/codex/tool-status.js +114 -0
- package/dist/observability/trace/adapters/codex/trace.d.ts +5 -0
- package/dist/observability/trace/adapters/codex/trace.js +1091 -0
- package/dist/observability/trace/attribution.d.ts +63 -0
- package/dist/observability/trace/attribution.js +397 -0
- package/dist/observability/trace/index.d.ts +26 -0
- package/dist/observability/trace/index.js +20 -0
- package/dist/observability/trace/ingestion.d.ts +9 -0
- package/dist/observability/trace/ingestion.js +80 -0
- package/dist/observability/trace/message-classification.d.ts +6 -0
- package/dist/observability/trace/message-classification.js +34 -0
- package/dist/observability/trace/projection.d.ts +5 -0
- package/dist/observability/trace/projection.js +20 -0
- package/dist/observability/trace/segmentation.d.ts +66 -0
- package/dist/observability/trace/segmentation.js +496 -0
- package/dist/observability/trace/source.d.ts +100 -0
- package/dist/observability/trace/source.js +1233 -0
- package/dist/observability/trace/tool-search.d.ts +8 -0
- package/dist/observability/trace/tool-search.js +160 -0
- package/dist/observability/trace/trace-ir.d.ts +187 -0
- package/dist/observability/trace/trace-ir.js +87 -0
- package/dist/observability/view-models/conversation.d.ts +51 -0
- package/dist/observability/view-models/conversation.js +1 -0
- package/dist/observability/view-models/index.d.ts +3 -0
- package/dist/observability/view-models/index.js +1 -0
- package/dist/observability/view-models/knowledge-debugger.d.ts +84 -0
- package/dist/observability/view-models/knowledge-debugger.js +1 -0
- package/dist/shared/content-hash.d.ts +1 -0
- package/dist/shared/content-hash.js +4 -0
- package/dist/shared/language.d.ts +2 -0
- package/dist/shared/language.js +1 -0
- package/dist/studio/application/index.d.ts +2 -0
- package/dist/studio/application/index.js +2 -0
- package/dist/studio/application/skill-index.d.ts +9 -0
- package/dist/studio/application/skill-index.js +347 -0
- package/dist/studio/application/skill-insights.d.ts +6 -0
- package/dist/studio/application/skill-insights.js +231 -0
- package/dist/studio/core-runs/catalog.d.ts +3 -0
- package/dist/studio/core-runs/catalog.js +15 -0
- package/dist/studio/core-runs/contracts.d.ts +227 -0
- package/dist/studio/core-runs/contracts.js +2 -0
- package/dist/studio/core-runs/index.d.ts +5 -0
- package/dist/studio/core-runs/index.js +5 -0
- package/dist/studio/core-runs/projection.d.ts +4 -0
- package/dist/studio/core-runs/projection.js +307 -0
- package/dist/studio/core-runs/renderer.d.ts +11 -0
- package/dist/studio/core-runs/renderer.js +414 -0
- package/dist/studio/core-runs/route-handler.d.ts +19 -0
- package/dist/studio/core-runs/route-handler.js +122 -0
- package/dist/studio/http/contracts.d.ts +28 -0
- package/dist/studio/http/contracts.js +1 -0
- package/dist/studio/http/errors.d.ts +1 -0
- package/dist/studio/http/errors.js +3 -0
- package/dist/studio/http/report-server.d.ts +4 -0
- package/dist/studio/http/report-server.js +106 -0
- package/dist/studio/http/request-errors.d.ts +8 -0
- package/dist/studio/http/request-errors.js +77 -0
- package/dist/studio/http/request-handler.d.ts +12 -0
- package/dist/studio/http/request-handler.js +137 -0
- package/dist/studio/http/routes/contracts.d.ts +14 -0
- package/dist/studio/http/routes/contracts.js +1 -0
- package/dist/studio/http/routes/conversations.d.ts +8 -0
- package/dist/studio/http/routes/conversations.js +220 -0
- package/dist/studio/http/routes/knowledge.d.ts +14 -0
- package/dist/studio/http/routes/knowledge.js +781 -0
- package/dist/studio/http/routes/observations.d.ts +13 -0
- package/dist/studio/http/routes/observations.js +193 -0
- package/dist/studio/index.d.ts +1 -0
- package/dist/studio/index.js +1 -0
- package/dist/studio/presentation/conversation-renderer.d.ts +17 -0
- package/dist/studio/presentation/conversation-renderer.js +526 -0
- package/dist/studio/presentation/doctor-detail-renderer.d.ts +10 -0
- package/dist/studio/presentation/knowledge-debugger-renderer.d.ts +9 -0
- package/dist/studio/presentation/knowledge-debugger-renderer.js +2393 -0
- package/dist/studio/presentation/layout.d.ts +16 -0
- package/dist/studio/presentation/layout.js +788 -0
- package/dist/studio/presentation/managed-history-renderer.d.ts +5 -0
- package/dist/studio/presentation/managed-history-renderer.js +333 -0
- package/dist/studio/presentation/observation-inbox/client-script.d.ts +2 -0
- package/dist/studio/presentation/observation-inbox/client-script.js +1795 -0
- package/dist/studio/presentation/observation-inbox/experience-workspace-renderer.d.ts +35 -0
- package/dist/studio/presentation/observation-inbox/experience-workspace-renderer.js +1799 -0
- package/dist/studio/presentation/observation-inbox/helpers.d.ts +13 -0
- package/dist/studio/presentation/observation-inbox/metric-renderer.d.ts +50 -0
- package/dist/studio/presentation/observation-inbox/metric-renderer.js +750 -0
- package/dist/studio/presentation/observation-inbox/page-renderer.d.ts +12 -0
- package/dist/studio/presentation/observation-inbox/page-renderer.js +275 -0
- package/dist/studio/presentation/observation-inbox/process-workspace-renderer.d.ts +52 -0
- package/dist/studio/presentation/observation-inbox/process-workspace-renderer.js +380 -0
- package/dist/studio/presentation/observation-inbox/review-renderer.d.ts +28 -0
- package/dist/studio/presentation/observation-inbox/review-renderer.js +323 -0
- package/dist/studio/presentation/observation-inbox/reviewer-report.d.ts +8 -0
- package/dist/studio/presentation/observation-inbox/reviewer-report.js +449 -0
- package/dist/studio/presentation/observation-inbox/signal-renderer.d.ts +20 -0
- package/dist/studio/presentation/observation-inbox/signal-renderer.js +133 -0
- package/dist/studio/presentation/observation-inbox/skill-chain-renderer.d.ts +17 -0
- package/dist/studio/presentation/observation-inbox/skill-chain-renderer.js +738 -0
- package/dist/studio/presentation/observation-inbox/timeline.d.ts +18 -0
- package/dist/studio/presentation/observation-inbox/timeline.js +772 -0
- package/dist/studio/presentation/observation-inbox-renderer.d.ts +4 -0
- package/dist/studio/presentation/observation-inbox-renderer.js +130 -0
- package/dist/studio/presentation/report-shell.d.ts +77 -0
- package/dist/studio/presentation/skill-detail-renderer.d.ts +12 -0
- package/dist/studio/presentation/skill-detail-renderer.js +71 -0
- package/dist/studio/presentation/skill-health-renderer.d.ts +19 -0
- package/dist/studio/presentation/skill-health-renderer.js +315 -0
- package/dist/studio/presentation/skill-list-renderer.d.ts +3 -0
- package/dist/studio/presentation/skill-list-renderer.js +36 -0
- package/dist/studio/presentation/trajectory-evidence.d.ts +8 -0
- package/dist/studio/presentation/trajectory-live.d.ts +43 -0
- package/dist/studio/presentation/trajectory-live.js +261 -0
- package/dist/studio/view-models/index.d.ts +2 -0
- package/dist/studio/view-models/index.js +1 -0
- package/dist/studio/view-models/insight.d.ts +68 -0
- package/dist/studio/view-models/insight.js +1 -0
- package/dist/studio/view-models/skill-index.d.ts +110 -0
- package/dist/studio/view-models/skill-index.js +1 -0
- package/package.json +52 -7
- package/dist/analysis/coverage-analyzer.d.ts +0 -57
- package/dist/analysis/coverage-analyzer.js +0 -324
- package/dist/analysis/failure-clusterer.d.ts +0 -95
- package/dist/analysis/failure-clusterer.js +0 -298
- package/dist/analysis/gap-analyzer.d.ts +0 -120
- package/dist/analysis/gap-analyzer.js +0 -480
- package/dist/analysis/hedging-classifier.d.ts +0 -33
- package/dist/analysis/report-diagnostics.d.ts +0 -40
- package/dist/analysis/report-diagnostics.js +0 -862
- package/dist/analysis/sample-diagnostics.d.ts +0 -84
- package/dist/analysis/sample-diagnostics.js +0 -457
- package/dist/analysis/saturation.d.ts +0 -92
- package/dist/analysis/saturation.js +0 -181
- package/dist/artifact-graph/doctor.d.ts +0 -21
- package/dist/artifact-graph/doctor.js +0 -577
- package/dist/artifact-graph/eval.d.ts +0 -16
- package/dist/artifact-graph/eval.js +0 -471
- package/dist/authoring/evolver.d.ts +0 -263
- package/dist/authoring/evolver.js +0 -1333
- package/dist/authoring/generator.d.ts +0 -99
- package/dist/authoring/generator.js +0 -1018
- package/dist/authoring/sample-fixer.d.ts +0 -54
- package/dist/authoring/sample-fixer.js +0 -297
- package/dist/cli/lib/run-tally.d.ts +0 -17
- package/dist/cli/lib/run-tally.js +0 -30
- package/dist/diagnosis/types.d.ts +0 -5
- package/dist/doctor/endpoint-rule.d.ts +0 -60
- package/dist/doctor/endpoint-rule.js +0 -382
- package/dist/doctor/fixer.d.ts +0 -11
- package/dist/doctor/fixer.js +0 -325
- package/dist/doctor/health/composer.d.ts +0 -18
- package/dist/doctor/health/composer.js +0 -407
- package/dist/doctor/health/dimension-spec.d.ts +0 -52
- package/dist/doctor/health/prompt-builder.d.ts +0 -2
- package/dist/doctor/health/prompt-builder.js +0 -1
- package/dist/doctor/index.d.ts +0 -18
- package/dist/doctor/index.js +0 -273
- package/dist/doctor/messages.d.ts +0 -20
- package/dist/doctor/preflight.d.ts +0 -31
- package/dist/doctor/preflight.js +0 -31
- package/dist/doctor/renderer.d.ts +0 -17
- package/dist/doctor/rules.d.ts +0 -32
- package/dist/doctor/rules.js +0 -290
- package/dist/eval-core/artifact-file-names.d.ts +0 -15
- package/dist/eval-core/artifact-file-names.js +0 -62
- package/dist/eval-core/artifact-index.d.ts +0 -102
- package/dist/eval-core/artifact-index.js +0 -336
- package/dist/eval-core/bootstrap.d.ts +0 -130
- package/dist/eval-core/bootstrap.js +0 -258
- package/dist/eval-core/cache.d.ts +0 -47
- package/dist/eval-core/cache.js +0 -205
- package/dist/eval-core/comparability.d.ts +0 -10
- package/dist/eval-core/comparability.js +0 -302
- package/dist/eval-core/default-dirs.d.ts +0 -34
- package/dist/eval-core/default-dirs.js +0 -36
- package/dist/eval-core/dependency-checker.d.ts +0 -36
- package/dist/eval-core/evaluation-execution.d.ts +0 -66
- package/dist/eval-core/evaluation-execution.js +0 -424
- package/dist/eval-core/evaluation-job.d.ts +0 -57
- package/dist/eval-core/evaluation-job.js +0 -121
- package/dist/eval-core/evaluation-reporting.d.ts +0 -48
- package/dist/eval-core/evaluation-reporting.js +0 -353
- package/dist/eval-core/execution-strategy.d.ts +0 -12
- package/dist/eval-core/execution-strategy.js +0 -174
- package/dist/eval-core/fact-checker.d.ts +0 -37
- package/dist/eval-core/fact-checker.js +0 -128
- package/dist/eval-core/holdout.d.ts +0 -66
- package/dist/eval-core/holdout.js +0 -119
- package/dist/eval-core/judge-independence.d.ts +0 -28
- package/dist/eval-core/judge-independence.js +0 -29
- package/dist/eval-core/layer-gates.d.ts +0 -16
- package/dist/eval-core/layer-gates.js +0 -41
- package/dist/eval-core/measurement-dirs.js +0 -82
- package/dist/eval-core/mock-hook.cjs +0 -271
- package/dist/eval-core/mocks-runtime.d.ts +0 -99
- package/dist/eval-core/mocks-runtime.js +0 -617
- package/dist/eval-core/report-document.d.ts +0 -12
- package/dist/eval-core/report-document.js +0 -1157
- package/dist/eval-core/report-extensions.d.ts +0 -4
- package/dist/eval-core/report-extensions.js +0 -500
- package/dist/eval-core/report-file-migration.d.ts +0 -10
- package/dist/eval-core/report-file-migration.js +0 -95
- package/dist/eval-core/resume-compatibility.d.ts +0 -32
- package/dist/eval-core/resume-compatibility.js +0 -142
- package/dist/eval-core/sample-fingerprint.d.ts +0 -12
- package/dist/eval-core/sample-fingerprint.js +0 -193
- package/dist/eval-core/schema.d.ts +0 -29
- package/dist/eval-core/schema.js +0 -365
- package/dist/eval-core/statistics.d.ts +0 -85
- package/dist/eval-core/statistics.js +0 -209
- package/dist/eval-core/task-planner.d.ts +0 -11
- package/dist/eval-core/task-planner.js +0 -72
- package/dist/eval-core/verdict.d.ts +0 -179
- package/dist/eval-core/verdict.js +0 -669
- package/dist/eval-workflows/batch-evaluation-workflow.d.ts +0 -146
- package/dist/eval-workflows/batch-evaluation-workflow.js +0 -259
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.d.ts +0 -26
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.js +0 -105
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.d.ts +0 -27
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.js +0 -69
- package/dist/eval-workflows/evaluation-pipeline/run-state.d.ts +0 -62
- package/dist/eval-workflows/evaluation-pipeline/run-state.js +0 -91
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.d.ts +0 -21
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.js +0 -52
- package/dist/eval-workflows/evaluation-pipeline.d.ts +0 -99
- package/dist/eval-workflows/evaluation-pipeline.js +0 -188
- package/dist/eval-workflows/evaluation-preparation.d.ts +0 -56
- package/dist/eval-workflows/evaluation-preparation.js +0 -83
- package/dist/eval-workflows/run-evaluation.d.ts +0 -152
- package/dist/eval-workflows/run-evaluation.js +0 -556
- package/dist/grading/assertions.d.ts +0 -38
- package/dist/grading/assertions.js +0 -475
- package/dist/grading/diagnostic.d.ts +0 -46
- package/dist/grading/diagnostic.js +0 -472
- package/dist/grading/gold-cli.d.ts +0 -84
- package/dist/grading/gold-cli.js +0 -246
- package/dist/grading/human-gold.d.ts +0 -103
- package/dist/grading/human-gold.js +0 -189
- package/dist/grading/index.d.ts +0 -60
- package/dist/grading/index.js +0 -150
- package/dist/grading/judge.d.ts +0 -67
- package/dist/grading/judge.js +0 -405
- package/dist/grading/layered-scores.d.ts +0 -26
- package/dist/grading/layered-scores.js +0 -87
- package/dist/inputs/content-hash.d.ts +0 -28
- package/dist/inputs/content-hash.js +0 -106
- package/dist/inputs/eval-config.d.ts +0 -12
- package/dist/inputs/eval-config.js +0 -295
- package/dist/inputs/load-samples.d.ts +0 -39
- package/dist/inputs/load-samples.js +0 -298
- package/dist/inputs/materialize-copy.js +0 -193
- package/dist/inputs/mcp-resolver.d.ts +0 -49
- package/dist/inputs/mcp-resolver.js +0 -309
- package/dist/inputs/sample-document.d.ts +0 -11
- package/dist/inputs/sample-document.js +0 -96
- package/dist/inputs/sample-locator.d.ts +0 -23
- package/dist/inputs/sample-locator.js +0 -195
- package/dist/inputs/skill-loader.d.ts +0 -190
- package/dist/inputs/skill-loader.js +0 -852
- package/dist/inputs/url-fetcher.d.ts +0 -18
- package/dist/inputs/url-fetcher.js +0 -240
- package/dist/managed/evidence.d.ts +0 -24
- package/dist/managed/evidence.js +0 -155
- package/dist/managed/index.d.ts +0 -12
- package/dist/managed/index.js +0 -12
- package/dist/managed/list-view.d.ts +0 -72
- package/dist/managed/list-view.js +0 -78
- package/dist/managed/observe-feedback.d.ts +0 -60
- package/dist/managed/promote-gate.d.ts +0 -40
- package/dist/managed/promote-gate.js +0 -37
- package/dist/managed/source-probe.d.ts +0 -15
- package/dist/managed/source-probe.js +0 -129
- package/dist/managed/store.d.ts +0 -142
- package/dist/managed/store.js +0 -595
- package/dist/managed/version-scores.d.ts +0 -33
- package/dist/managed/version-scores.js +0 -70
- package/dist/observability/codex-conversation-index.d.ts +0 -92
- package/dist/observability/codex-conversation-index.js +0 -600
- package/dist/observability/codex-tool-status.d.ts +0 -16
- package/dist/observability/codex-tool-status.js +0 -114
- package/dist/observability/codex-trace-adapter.d.ts +0 -5
- package/dist/observability/codex-trace-adapter.js +0 -1091
- package/dist/observability/conversation-catalog.d.ts +0 -38
- package/dist/observability/conversation-catalog.js +0 -575
- package/dist/observability/conversation-index-process.js +0 -31
- package/dist/observability/conversation-view-model.d.ts +0 -5
- package/dist/observability/conversation-view-model.js +0 -100
- package/dist/observability/experience-frontmatter.d.ts +0 -36
- package/dist/observability/experience-frontmatter.js +0 -99
- package/dist/observability/feedback-projection.d.ts +0 -20
- package/dist/observability/inbox-view-model.d.ts +0 -43
- package/dist/observability/inbox-view-model.js +0 -185
- package/dist/observability/inbox.d.ts +0 -33
- package/dist/observability/inbox.js +0 -1343
- package/dist/observability/knowledge-debugger.d.ts +0 -4
- package/dist/observability/knowledge-debugger.js +0 -397
- package/dist/observability/problem-patterns.d.ts +0 -11
- package/dist/observability/problem-patterns.js +0 -245
- package/dist/observability/resolved-review.d.ts +0 -36
- package/dist/observability/review-state.d.ts +0 -25
- package/dist/observability/review-state.js +0 -351
- package/dist/observability/skill-chain-advisories.d.ts +0 -15
- package/dist/observability/skill-chain.d.ts +0 -6
- package/dist/observability/skill-chain.js +0 -486
- package/dist/observability/skill-health-analyzer.d.ts +0 -128
- package/dist/observability/skill-health-analyzer.js +0 -328
- package/dist/observability/skill-health-report.d.ts +0 -10
- package/dist/observability/skill-health-report.js +0 -620
- package/dist/observability/source-record-archive.d.ts +0 -13
- package/dist/observability/source-record-archive.js +0 -324
- package/dist/observability/task-semantic-projection.d.ts +0 -11
- package/dist/observability/task-window.d.ts +0 -9
- package/dist/observability/task-window.js +0 -57
- package/dist/observability/text-signals.d.ts +0 -13
- package/dist/observability/text-signals.js +0 -115
- package/dist/observability/trace-adapter.d.ts +0 -27
- package/dist/observability/trace-adapter.js +0 -22
- package/dist/observability/trace-attribution.d.ts +0 -63
- package/dist/observability/trace-attribution.js +0 -397
- package/dist/observability/trace-ingestion.d.ts +0 -9
- package/dist/observability/trace-ingestion.js +0 -80
- package/dist/observability/trace-ir.d.ts +0 -184
- package/dist/observability/trace-ir.js +0 -87
- package/dist/observability/trace-segmenter.d.ts +0 -64
- package/dist/observability/trace-segmenter.js +0 -502
- package/dist/observability/trace-source.d.ts +0 -100
- package/dist/observability/trace-source.js +0 -1232
- package/dist/observability/turn-index.d.ts +0 -3
- package/dist/observability/turn-index.js +0 -251
- package/dist/renderer/conversation-renderer.d.ts +0 -16
- package/dist/renderer/conversation-renderer.js +0 -512
- package/dist/renderer/doctor-detail-renderer.d.ts +0 -9
- package/dist/renderer/html-renderer.d.ts +0 -10
- package/dist/renderer/html-renderer.js +0 -706
- package/dist/renderer/knowledge-debugger-renderer.d.ts +0 -9
- package/dist/renderer/knowledge-debugger-renderer.js +0 -2388
- package/dist/renderer/layout.d.ts +0 -13
- package/dist/renderer/layout.js +0 -788
- package/dist/renderer/managed-history-renderer.d.ts +0 -5
- package/dist/renderer/managed-history-renderer.js +0 -437
- package/dist/renderer/observation-inbox/helpers.d.ts +0 -13
- package/dist/renderer/observation-inbox-renderer.d.ts +0 -4
- package/dist/renderer/observation-inbox-renderer.js +0 -7326
- package/dist/renderer/report-shell.d.ts +0 -77
- package/dist/renderer/skill-detail-renderer.d.ts +0 -12
- package/dist/renderer/skill-detail-renderer.js +0 -3115
- package/dist/renderer/skill-health-renderer.d.ts +0 -19
- package/dist/renderer/skill-health-renderer.js +0 -315
- package/dist/renderer/skill-list-renderer.d.ts +0 -2
- package/dist/renderer/skill-list-renderer.js +0 -394
- package/dist/renderer/summary.d.ts +0 -67
- package/dist/renderer/summary.js +0 -2094
- package/dist/renderer/table.d.ts +0 -2
- package/dist/renderer/table.js +0 -257
- package/dist/renderer/test-view.d.ts +0 -67
- package/dist/renderer/test-view.js +0 -1190
- package/dist/renderer/trajectory-evidence.d.ts +0 -8
- package/dist/renderer/trajectory-live.d.ts +0 -42
- package/dist/renderer/trajectory-live.js +0 -258
- package/dist/renderer/trends.d.ts +0 -5
- package/dist/renderer/trends.js +0 -130
- package/dist/server/indexed-report-store.d.ts +0 -8
- package/dist/server/indexed-report-store.js +0 -126
- package/dist/server/job-store.d.ts +0 -2
- package/dist/server/job-store.js +0 -103
- package/dist/server/report-server.d.ts +0 -39
- package/dist/server/report-server.js +0 -1610
- package/dist/server/report-store.d.ts +0 -51
- package/dist/server/report-store.js +0 -281
- package/dist/server/skill-index.d.ts +0 -25
- package/dist/server/skill-index.js +0 -955
- package/dist/server/skill-insights.d.ts +0 -31
- package/dist/server/skill-insights.js +0 -854
- package/dist/shared/artifact-graph.d.ts +0 -3
- package/dist/shared/artifact-graph.js +0 -224
- package/dist/shared/assertion-types.d.ts +0 -8
- package/dist/shared/diagnosis-schema.d.ts +0 -9
- package/dist/shared/diagnosis-schema.js +0 -181
- package/dist/shared/doctor-report.d.ts +0 -3
- package/dist/shared/doctor-report.js +0 -103
- package/dist/shared/evaluation-job.d.ts +0 -6
- package/dist/shared/evaluation-job.js +0 -217
- package/dist/shared/executor-result.d.ts +0 -17
- package/dist/shared/executor-result.js +0 -221
- package/dist/shared/hard-rules.d.ts +0 -41
- package/dist/shared/llm-prompts/debias-instructions.js +0 -44
- package/dist/shared/llm-prompts/index.js +0 -21
- package/dist/shared/llm-prompts/judge-prompts.d.ts +0 -30
- package/dist/shared/llm-prompts/judge-prompts.js +0 -205
- package/dist/shared/llm-prompts/registry.d.ts +0 -27
- package/dist/shared/llm-prompts/registry.js +0 -70
- package/dist/shared/llm-prompts/skill-health-merge.d.ts +0 -22
- package/dist/shared/llm-prompts/skill-health.d.ts +0 -21
- package/dist/shared/sample-contract.d.ts +0 -4
- package/dist/shared/sample-contract.js +0 -367
- package/dist/shared/tool-call-status.d.ts +0 -8
- package/dist/shared/tool-call-status.js +0 -28
- package/dist/shared/tool-search.d.ts +0 -8
- package/dist/shared/tool-search.js +0 -160
- package/dist/shared/trace-projection.d.ts +0 -5
- package/dist/shared/trace-projection.js +0 -20
- package/dist/shared/trace-source-kind.d.ts +0 -3
- package/dist/shared/trace-source-kind.js +0 -12
- package/dist/types/artifact-graph.d.ts +0 -93
- package/dist/types/dependencies.d.ts +0 -22
- package/dist/types/doctor.d.ts +0 -202
- package/dist/types/doctor.js +0 -6
- package/dist/types/eval.d.ts +0 -413
- package/dist/types/executor.d.ts +0 -191
- package/dist/types/index.d.ts +0 -14
- package/dist/types/index.js +0 -14
- package/dist/types/judge.d.ts +0 -204
- package/dist/types/judge.js +0 -3
- package/dist/types/managed.d.ts +0 -164
- package/dist/types/observability.d.ts +0 -1199
- package/dist/types/observability.js +0 -13
- package/dist/types/report.d.ts +0 -704
- package/dist/types/shared.d.ts +0 -1
- package/dist/types/skill-index.d.ts +0 -206
- package/dist/types/storage.d.ts +0 -20
- package/dist/types/trace.d.ts +0 -2
- /package/dist/{types/diagnosis.d.ts → diagnosis/contracts.d.ts} +0 -0
- /package/dist/{observability/conversation-index-process.d.ts → diagnosis/contracts.js} +0 -0
- /package/dist/diagnosis/{types.js → lifecycle.js} +0 -0
- /package/dist/{types/artifact-graph.js → eval-core/engine/types.js} +0 -0
- /package/dist/{grading/gold-dataset.d.ts → eval-workflows/gold/dataset.d.ts} +0 -0
- /package/dist/{grading/gold-dataset.js → eval-workflows/gold/dataset.js} +0 -0
- /package/dist/{shared → eval-workflows/inputs}/assertion-types.js +0 -0
- /package/dist/{types/dependencies.js → eval-workflows/inputs/contracts/assertion-kind.js} +0 -0
- /package/dist/{types/diagnosis.js → eval-workflows/inputs/contracts/assertion.js} +0 -0
- /package/dist/{types/eval.js → eval-workflows/inputs/contracts/config.js} +0 -0
- /package/dist/{types/executor.js → eval-workflows/inputs/contracts/index.js} +0 -0
- /package/dist/{types/managed.js → eval-workflows/inputs/contracts/sample.js} +0 -0
- /package/dist/{types/report.js → eval-workflows/inputs/contracts/variant.js} +0 -0
- /package/dist/{inputs → eval-workflows/inputs}/materialize-copy.d.ts +0 -0
- /package/dist/{inputs → eval-workflows/inputs}/source-resolver.d.ts +0 -0
- /package/dist/{inputs → eval-workflows/inputs}/source-resolver.js +0 -0
- /package/dist/{types/shared.js → eval-workflows/instruments/contracts/config.js} +0 -0
- /package/dist/{types/skill-index.js → eval-workflows/instruments/contracts/index.js} +0 -0
- /package/dist/{types/storage.js → eval-workflows/instruments/contracts/result.js} +0 -0
- /package/dist/{shared/llm-prompts → eval-workflows/instruments/prompts}/debias-instructions.d.ts +0 -0
- /package/dist/{types/trace.js → evidence/graph/contracts.js} +0 -0
- /package/dist/{eval-core/measurement-dirs.d.ts → evidence/storage/directories.d.ts} +0 -0
- /package/dist/{shared → executors/core}/token-usage.d.ts +0 -0
- /package/dist/{shared → executors/core}/token-usage.js +0 -0
- /package/dist/{shared → executors/core}/tool-identity.d.ts +0 -0
- /package/dist/{shared → executors/core}/tool-identity.js +0 -0
- /package/dist/{eval-core/dependency-checker.js → executors/preflight/dependencies.js} +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/builtin-dimensions.d.ts +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/builtin-dimensions.js +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/consensus.d.ts +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/consensus.js +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/dimension-registry.d.ts +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/dimension-registry.js +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/dimension-spec.js +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/load-custom-dimensions.d.ts +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/load-custom-dimensions.js +0 -0
- /package/dist/{shared/llm-prompts/skill-health-merge.js → knowledge-artifacts/doctor/health/merge-prompt.js} +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/parser.d.ts +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/parser.js +0 -0
- /package/dist/{shared/llm-prompts/skill-health.js → knowledge-artifacts/doctor/health/prompt-builder.js} +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/register.d.ts +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/health/register.js +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/messages.js +0 -0
- /package/dist/{doctor → knowledge-artifacts/doctor}/renderer.js +0 -0
- /package/dist/{managed → knowledge-artifacts/governance}/list-query.d.ts +0 -0
- /package/dist/{managed → knowledge-artifacts/governance}/list-query.js +0 -0
- /package/dist/{managed → knowledge-artifacts/governance}/observe-feedback.js +0 -0
- /package/dist/{shared → knowledge-artifacts/skills}/hard-rules.js +0 -0
- /package/dist/{analysis → observability/analysis}/hedging-classifier.js +0 -0
- /package/dist/observability/{polling-subscription-hub.d.ts → conversation/polling-subscription-hub.d.ts} +0 -0
- /package/dist/observability/{polling-subscription-hub.js → conversation/polling-subscription-hub.js} +0 -0
- /package/dist/observability/{task-semantic-projection.js → conversation/task-semantic-projection.js} +0 -0
- /package/dist/observability/{feedback-matchers.d.ts → inbox/feedback-matchers.d.ts} +0 -0
- /package/dist/observability/{feedback-matchers.js → inbox/feedback-matchers.js} +0 -0
- /package/dist/observability/{feedback-projection.js → inbox/feedback-projection.js} +0 -0
- /package/dist/observability/{resolved-review.js → inbox/resolved-review.js} +0 -0
- /package/dist/{shared/llm-prompts/index.d.ts → observability/prompts/document.d.ts} +0 -0
- /package/dist/observability/{skill-chain-advisories.js → skill-health/advisories.js} +0 -0
- /package/dist/observability/{codex-exec-command.d.ts → trace/adapters/codex/exec-command.d.ts} +0 -0
- /package/dist/observability/{codex-exec-command.js → trace/adapters/codex/exec-command.js} +0 -0
- /package/dist/observability/{codex-protocol.d.ts → trace/adapters/codex/protocol.d.ts} +0 -0
- /package/dist/observability/{codex-protocol.js → trace/adapters/codex/protocol.js} +0 -0
- /package/dist/observability/{trace-session-index.d.ts → trace/session-index.d.ts} +0 -0
- /package/dist/observability/{trace-session-index.js → trace/session-index.js} +0 -0
- /package/dist/{util/safe-slice.d.ts → shared/json-safe-truncation.d.ts} +0 -0
- /package/dist/{util/safe-slice.js → shared/json-safe-truncation.js} +0 -0
- /package/dist/{renderer → studio/presentation}/doctor-detail-renderer.js +0 -0
- /package/dist/{renderer → studio/presentation}/icons.d.ts +0 -0
- /package/dist/{renderer → studio/presentation}/icons.js +0 -0
- /package/dist/{renderer → studio/presentation}/inline-markdown.d.ts +0 -0
- /package/dist/{renderer → studio/presentation}/inline-markdown.js +0 -0
- /package/dist/{renderer → studio/presentation}/observation-inbox/helpers.js +0 -0
- /package/dist/{renderer → studio/presentation}/observation-inbox/styles.d.ts +0 -0
- /package/dist/{renderer → studio/presentation}/observation-inbox/styles.js +0 -0
- /package/dist/{renderer → studio/presentation}/report-shell.js +0 -0
- /package/dist/{renderer → studio/presentation}/trajectory-evidence.js +0 -0
- /package/dist/{renderer → studio/presentation}/trajectory-routing.d.ts +0 -0
- /package/dist/{renderer → studio/presentation}/trajectory-routing.js +0 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { drawBootstrapMetric, summarizeBootstrapMetric, } from '../../analysis/bootstrap.js';
|
|
3
|
+
import { computeKrippendorffAlpha, computePearson, computeWeightedKappa, } from '../../gold/human.js';
|
|
4
|
+
import { IdentifierSchema, Sha256DigestSchema, canonicalizeJson, schemaIdentityKey, } from '../../../eval-core/contracts/index.js';
|
|
5
|
+
import { analysisJsonSchema, analysisSchemaIdentity, createAnalysisSchemaValidator, } from './analysis-support.js';
|
|
6
|
+
import { AgreementParametersSchema, parseAgreementParameters, } from './agreement-parameters.js';
|
|
7
|
+
export const AGREEMENT_TABLE_SCHEMA_VERSION = 'omk.agreement-table/v1';
|
|
8
|
+
export const AGREEMENT_STATISTIC_DECIMALS = 4;
|
|
9
|
+
const CountSchema = z.number().int().nonnegative().safe();
|
|
10
|
+
const PositiveCountSchema = z.number().int().positive().safe();
|
|
11
|
+
const RatingSchema = z.number().finite();
|
|
12
|
+
const RoundedStatisticSchema = z.number().finite().refine((value) => Math.round(value * 10 ** AGREEMENT_STATISTIC_DECIMALS)
|
|
13
|
+
/ 10 ** AGREEMENT_STATISTIC_DECIMALS === value, { message: 'Agreement statistics must use four-decimal precision.' });
|
|
14
|
+
const ObservedGoldRatingSchema = z.object({
|
|
15
|
+
ratingStatus: z.literal('observed'),
|
|
16
|
+
score: RatingSchema,
|
|
17
|
+
}).strict();
|
|
18
|
+
const UnavailableGoldRatingSchema = z.object({
|
|
19
|
+
ratingStatus: z.literal('unavailable'),
|
|
20
|
+
reasonCode: z.literal('gold-rating-unavailable'),
|
|
21
|
+
}).strict();
|
|
22
|
+
const GoldRatingSchema = z.discriminatedUnion('ratingStatus', [
|
|
23
|
+
ObservedGoldRatingSchema,
|
|
24
|
+
UnavailableGoldRatingSchema,
|
|
25
|
+
]);
|
|
26
|
+
const JudgeCoverageSchema = z.object({
|
|
27
|
+
plannedGroups: CountSchema,
|
|
28
|
+
observedGroups: CountSchema,
|
|
29
|
+
missingGroups: CountSchema,
|
|
30
|
+
}).strict();
|
|
31
|
+
const ObservedJudgeRatingSchema = z.object({
|
|
32
|
+
ratingStatus: z.literal('observed'),
|
|
33
|
+
score: RatingSchema,
|
|
34
|
+
sourceGroupIds: z.array(Sha256DigestSchema).min(1),
|
|
35
|
+
coverage: JudgeCoverageSchema,
|
|
36
|
+
}).strict();
|
|
37
|
+
const MissingJudgeRatingSchema = z.object({
|
|
38
|
+
ratingStatus: z.literal('missing'),
|
|
39
|
+
reasonCode: z.literal('dimension-unobserved'),
|
|
40
|
+
sourceGroupIds: z.array(Sha256DigestSchema).min(1),
|
|
41
|
+
coverage: JudgeCoverageSchema,
|
|
42
|
+
}).strict();
|
|
43
|
+
const UnavailableJudgeRatingSchema = z.object({
|
|
44
|
+
ratingStatus: z.literal('unavailable'),
|
|
45
|
+
reasonCode: z.literal('dimension-group-unavailable'),
|
|
46
|
+
sourceGroupIds: z.tuple([]),
|
|
47
|
+
coverage: z.object({
|
|
48
|
+
plannedGroups: z.literal(0),
|
|
49
|
+
observedGroups: z.literal(0),
|
|
50
|
+
missingGroups: z.literal(0),
|
|
51
|
+
}).strict(),
|
|
52
|
+
}).strict();
|
|
53
|
+
const JudgeRatingSchema = z.discriminatedUnion('ratingStatus', [
|
|
54
|
+
ObservedJudgeRatingSchema,
|
|
55
|
+
MissingJudgeRatingSchema,
|
|
56
|
+
UnavailableJudgeRatingSchema,
|
|
57
|
+
]);
|
|
58
|
+
export const AgreementPairSchema = z.object({
|
|
59
|
+
sampleId: IdentifierSchema,
|
|
60
|
+
gold: GoldRatingSchema,
|
|
61
|
+
judge: JudgeRatingSchema,
|
|
62
|
+
}).strict();
|
|
63
|
+
const AgreementCoverageSchema = z.object({
|
|
64
|
+
plannedPairs: PositiveCountSchema,
|
|
65
|
+
comparablePairs: CountSchema,
|
|
66
|
+
goldObservedPairs: CountSchema,
|
|
67
|
+
goldUnavailablePairs: CountSchema,
|
|
68
|
+
judgeObservedPairs: CountSchema,
|
|
69
|
+
judgeMissingPairs: CountSchema,
|
|
70
|
+
judgeUnavailablePairs: CountSchema,
|
|
71
|
+
}).strict();
|
|
72
|
+
const ObservedStatisticSchema = z.object({
|
|
73
|
+
statisticStatus: z.literal('observed'),
|
|
74
|
+
value: RoundedStatisticSchema,
|
|
75
|
+
}).strict();
|
|
76
|
+
const MissingStatisticSchema = z.object({
|
|
77
|
+
statisticStatus: z.literal('missing'),
|
|
78
|
+
reasonCode: z.enum([
|
|
79
|
+
'agreement-insufficient-pairs',
|
|
80
|
+
'agreement-zero-expected-disagreement',
|
|
81
|
+
'agreement-statistic-undefined',
|
|
82
|
+
]),
|
|
83
|
+
}).strict();
|
|
84
|
+
const AgreementStatisticSchema = z.discriminatedUnion('statisticStatus', [
|
|
85
|
+
ObservedStatisticSchema,
|
|
86
|
+
MissingStatisticSchema,
|
|
87
|
+
]);
|
|
88
|
+
const DrawCoverageSchema = z.object({
|
|
89
|
+
plannedDraws: PositiveCountSchema,
|
|
90
|
+
observedDraws: CountSchema,
|
|
91
|
+
missingDraws: CountSchema,
|
|
92
|
+
}).strict();
|
|
93
|
+
const ObservedAlphaIntervalSchema = z.object({
|
|
94
|
+
intervalStatus: z.literal('observed'),
|
|
95
|
+
lower: RoundedStatisticSchema,
|
|
96
|
+
upper: RoundedStatisticSchema,
|
|
97
|
+
estimate: RoundedStatisticSchema,
|
|
98
|
+
samples: PositiveCountSchema,
|
|
99
|
+
confidenceLevel: z.number().finite().gt(0).lt(1),
|
|
100
|
+
drawCoverage: DrawCoverageSchema,
|
|
101
|
+
}).strict();
|
|
102
|
+
const MissingAlphaIntervalSchema = z.object({
|
|
103
|
+
intervalStatus: z.literal('missing'),
|
|
104
|
+
reasonCode: z.enum([
|
|
105
|
+
'agreement-point-unobserved',
|
|
106
|
+
'agreement-no-valid-bootstrap-draws',
|
|
107
|
+
]),
|
|
108
|
+
drawCoverage: DrawCoverageSchema,
|
|
109
|
+
}).strict();
|
|
110
|
+
const AlphaIntervalSchema = z.discriminatedUnion('intervalStatus', [
|
|
111
|
+
ObservedAlphaIntervalSchema,
|
|
112
|
+
MissingAlphaIntervalSchema,
|
|
113
|
+
]);
|
|
114
|
+
const AgreementStatisticsSchema = z.object({
|
|
115
|
+
krippendorffAlpha: AgreementStatisticSchema,
|
|
116
|
+
alphaInterval: AlphaIntervalSchema,
|
|
117
|
+
weightedKappa: AgreementStatisticSchema,
|
|
118
|
+
pearson: AgreementStatisticSchema,
|
|
119
|
+
}).strict();
|
|
120
|
+
const AgreementTableValueSchema = z.object({
|
|
121
|
+
schemaVersion: z.literal(AGREEMENT_TABLE_SCHEMA_VERSION),
|
|
122
|
+
configuration: AgreementParametersSchema,
|
|
123
|
+
pairs: z.array(AgreementPairSchema).min(1),
|
|
124
|
+
coverage: AgreementCoverageSchema,
|
|
125
|
+
statistics: AgreementStatisticsSchema,
|
|
126
|
+
}).strict();
|
|
127
|
+
function legacyRound4(value) {
|
|
128
|
+
return Math.round(value * 10_000) / 10_000;
|
|
129
|
+
}
|
|
130
|
+
function parsePairs(parameters, rawPairs) {
|
|
131
|
+
const pairs = rawPairs.map((pair) => AgreementPairSchema.parse(pair));
|
|
132
|
+
const order = new Map(parameters.sampleIds.map((sampleId, index) => [sampleId, index]));
|
|
133
|
+
const pairIds = pairs.map((pair) => pair.sampleId);
|
|
134
|
+
if (new Set(pairIds).size !== pairIds.length
|
|
135
|
+
|| canonicalizeJson([...pairIds].sort())
|
|
136
|
+
!== canonicalizeJson([...parameters.sampleIds].sort())) {
|
|
137
|
+
throw new TypeError('Agreement pairs must map every sealed sample exactly once.');
|
|
138
|
+
}
|
|
139
|
+
const sourceGroupIds = pairs.flatMap((pair) => pair.judge.sourceGroupIds);
|
|
140
|
+
if (new Set(sourceGroupIds).size !== sourceGroupIds.length) {
|
|
141
|
+
throw new TypeError('Agreement judge source group identities must be globally unique.');
|
|
142
|
+
}
|
|
143
|
+
for (const pair of pairs) {
|
|
144
|
+
for (const rating of [pair.gold, pair.judge]) {
|
|
145
|
+
if (rating.ratingStatus === 'observed'
|
|
146
|
+
&& (rating.score < parameters.gold.scale.min
|
|
147
|
+
|| rating.score > parameters.gold.scale.max)) {
|
|
148
|
+
throw new TypeError('Agreement ratings must stay inside the sealed scale.');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const coverage = pair.judge.coverage;
|
|
152
|
+
if (coverage.observedGroups + coverage.missingGroups !== coverage.plannedGroups
|
|
153
|
+
|| pair.judge.sourceGroupIds.length !== coverage.plannedGroups
|
|
154
|
+
|| (pair.judge.ratingStatus === 'observed' && coverage.observedGroups === 0)
|
|
155
|
+
|| (pair.judge.ratingStatus === 'missing'
|
|
156
|
+
&& (coverage.plannedGroups === 0 || coverage.observedGroups !== 0))
|
|
157
|
+
|| (pair.judge.ratingStatus === 'unavailable' && coverage.plannedGroups !== 0)) {
|
|
158
|
+
throw new TypeError('Agreement judge coverage does not match its rating status.');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return pairs.sort((left, right) => ((order.get(left.sampleId) ?? -1) - (order.get(right.sampleId) ?? -1)));
|
|
162
|
+
}
|
|
163
|
+
export function agreementCoverage(pairs) {
|
|
164
|
+
return {
|
|
165
|
+
plannedPairs: pairs.length,
|
|
166
|
+
comparablePairs: pairs.filter((pair) => (pair.gold.ratingStatus === 'observed' && pair.judge.ratingStatus === 'observed')).length,
|
|
167
|
+
goldObservedPairs: pairs.filter((pair) => pair.gold.ratingStatus === 'observed').length,
|
|
168
|
+
goldUnavailablePairs: pairs.filter((pair) => pair.gold.ratingStatus === 'unavailable').length,
|
|
169
|
+
judgeObservedPairs: pairs.filter((pair) => pair.judge.ratingStatus === 'observed').length,
|
|
170
|
+
judgeMissingPairs: pairs.filter((pair) => pair.judge.ratingStatus === 'missing').length,
|
|
171
|
+
judgeUnavailablePairs: pairs.filter((pair) => pair.judge.ratingStatus === 'unavailable').length,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function observedOrMissing(value, insufficient, undefinedReason) {
|
|
175
|
+
if (insufficient) {
|
|
176
|
+
return { statisticStatus: 'missing', reasonCode: 'agreement-insufficient-pairs' };
|
|
177
|
+
}
|
|
178
|
+
return Number.isFinite(value)
|
|
179
|
+
? { statisticStatus: 'observed', value: legacyRound4(value) }
|
|
180
|
+
: { statisticStatus: 'missing', reasonCode: undefinedReason };
|
|
181
|
+
}
|
|
182
|
+
export function agreementStatistics(parameters, pairs) {
|
|
183
|
+
const ratings = pairs.flatMap((pair) => (pair.gold.ratingStatus === 'observed' && pair.judge.ratingStatus === 'observed'
|
|
184
|
+
? [{ unitId: pair.sampleId, coderA: pair.gold.score, coderB: pair.judge.score }]
|
|
185
|
+
: []));
|
|
186
|
+
const insufficient = ratings.length < 2;
|
|
187
|
+
const rawAlpha = insufficient ? Number.NaN : computeKrippendorffAlpha(ratings);
|
|
188
|
+
const krippendorffAlpha = observedOrMissing(rawAlpha, insufficient, 'agreement-zero-expected-disagreement');
|
|
189
|
+
const weightedKappa = observedOrMissing(insufficient ? Number.NaN : computeWeightedKappa(ratings, parameters.gold.scale), insufficient, 'agreement-statistic-undefined');
|
|
190
|
+
const pearson = observedOrMissing(insufficient ? Number.NaN : computePearson(ratings), insufficient, 'agreement-statistic-undefined');
|
|
191
|
+
const emptyDrawCoverage = {
|
|
192
|
+
plannedDraws: parameters.resamples,
|
|
193
|
+
observedDraws: 0,
|
|
194
|
+
missingDraws: parameters.resamples,
|
|
195
|
+
};
|
|
196
|
+
if (krippendorffAlpha.statisticStatus !== 'observed') {
|
|
197
|
+
return {
|
|
198
|
+
krippendorffAlpha,
|
|
199
|
+
alphaInterval: {
|
|
200
|
+
intervalStatus: 'missing',
|
|
201
|
+
reasonCode: 'agreement-point-unobserved',
|
|
202
|
+
drawCoverage: emptyDrawCoverage,
|
|
203
|
+
},
|
|
204
|
+
weightedKappa,
|
|
205
|
+
pearson,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const indices = ratings.map((_, index) => index);
|
|
209
|
+
const distribution = drawBootstrapMetric(indices, (resampled) => computeKrippendorffAlpha(resampled.map((index) => ratings[index])), parameters.resamples, parameters.seed);
|
|
210
|
+
const finiteDraws = distribution.draws.filter(Number.isFinite);
|
|
211
|
+
const drawCoverage = {
|
|
212
|
+
plannedDraws: parameters.resamples,
|
|
213
|
+
observedDraws: finiteDraws.length,
|
|
214
|
+
missingDraws: parameters.resamples - finiteDraws.length,
|
|
215
|
+
};
|
|
216
|
+
const alphaInterval = finiteDraws.length === 0
|
|
217
|
+
? {
|
|
218
|
+
intervalStatus: 'missing',
|
|
219
|
+
reasonCode: 'agreement-no-valid-bootstrap-draws',
|
|
220
|
+
drawCoverage,
|
|
221
|
+
}
|
|
222
|
+
: (() => {
|
|
223
|
+
const interval = summarizeBootstrapMetric(rawAlpha, finiteDraws, parameters.alpha, finiteDraws.length);
|
|
224
|
+
return {
|
|
225
|
+
intervalStatus: 'observed',
|
|
226
|
+
lower: interval.low,
|
|
227
|
+
upper: interval.high,
|
|
228
|
+
estimate: interval.estimate,
|
|
229
|
+
samples: interval.samples,
|
|
230
|
+
confidenceLevel: 1 - parameters.alpha,
|
|
231
|
+
drawCoverage,
|
|
232
|
+
};
|
|
233
|
+
})();
|
|
234
|
+
return { krippendorffAlpha, alphaInterval, weightedKappa, pearson };
|
|
235
|
+
}
|
|
236
|
+
export function buildAgreementTable(rawParameters, rawPairs) {
|
|
237
|
+
const parameters = parseAgreementParameters(rawParameters);
|
|
238
|
+
const pairs = parsePairs(parameters, rawPairs);
|
|
239
|
+
return {
|
|
240
|
+
schemaVersion: AGREEMENT_TABLE_SCHEMA_VERSION,
|
|
241
|
+
configuration: parameters,
|
|
242
|
+
pairs,
|
|
243
|
+
coverage: agreementCoverage(pairs),
|
|
244
|
+
statistics: agreementStatistics(parameters, pairs),
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function validateAgreementTable(value, context) {
|
|
248
|
+
let expected;
|
|
249
|
+
try {
|
|
250
|
+
expected = buildAgreementTable(value.configuration, value.pairs);
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
context.addIssue({
|
|
254
|
+
code: 'custom',
|
|
255
|
+
path: ['pairs'],
|
|
256
|
+
message: error instanceof Error ? error.message : 'Agreement pairs are invalid.',
|
|
257
|
+
});
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (canonicalizeJson(value) !== canonicalizeJson(expected)) {
|
|
261
|
+
context.addIssue({
|
|
262
|
+
code: 'custom',
|
|
263
|
+
path: [],
|
|
264
|
+
message: 'Agreement table is not canonically ordered or statistically recomputable.',
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
const AgreementTableEnvelopeSchema = z.object({
|
|
269
|
+
resultType: z.literal('table'),
|
|
270
|
+
value: AgreementTableValueSchema,
|
|
271
|
+
}).strict().superRefine((envelope, context) => {
|
|
272
|
+
validateAgreementTable(envelope.value, context);
|
|
273
|
+
});
|
|
274
|
+
export const AGREEMENT_TABLE_SCHEMA = analysisSchemaIdentity(AGREEMENT_TABLE_SCHEMA_VERSION, 'urn:omk:analysis-result:agreement-table:v1', analysisJsonSchema(AgreementTableEnvelopeSchema, [
|
|
275
|
+
'pairs map every sealed sample exactly once and preserve gold and Dimension availability separately',
|
|
276
|
+
'judge group coverage, globally unique source lineage, pair coverage, and sample ordering are recomputable',
|
|
277
|
+
'all observed ratings stay within the sealed external-annotation scale',
|
|
278
|
+
'Krippendorff alpha uses interval distance squared and requires at least two comparable rating pairs',
|
|
279
|
+
'quadratic-weighted kappa and Pearson are auxiliary statistics over the identical comparable pair set',
|
|
280
|
+
'bootstrap resamples complete pair indices using the sealed Mulberry32 stream',
|
|
281
|
+
'undefined alpha draws are excluded from interval quantiles and retained as missing draw coverage',
|
|
282
|
+
'zero finite draws, zero expected disagreement, and insufficient pairs produce structured missing rather than NaN or zero',
|
|
283
|
+
'finite point estimates and percentile bounds use the legacy four-decimal persistence rounding',
|
|
284
|
+
'the complete table is statistically recomputable during live and transported validation',
|
|
285
|
+
]));
|
|
286
|
+
export function parseAgreementTableEnvelope(value) {
|
|
287
|
+
return AgreementTableEnvelopeSchema.parse(value);
|
|
288
|
+
}
|
|
289
|
+
function validateSealedConfiguration(value, context) {
|
|
290
|
+
const parsed = parseAgreementTableEnvelope(value);
|
|
291
|
+
if (context?.validationKind !== 'analysis-output') {
|
|
292
|
+
throw new TypeError('Agreement Analysis output validation requires sealed node parameters.');
|
|
293
|
+
}
|
|
294
|
+
const sealed = parseAgreementParameters(context.parameters);
|
|
295
|
+
if (canonicalizeJson(parsed.value.configuration) !== canonicalizeJson(sealed)) {
|
|
296
|
+
throw new TypeError('Agreement table configuration does not match sealed node parameters.');
|
|
297
|
+
}
|
|
298
|
+
return parsed;
|
|
299
|
+
}
|
|
300
|
+
export function createAgreementTableSchemaValidators() {
|
|
301
|
+
const validator = createAnalysisSchemaValidator(AGREEMENT_TABLE_SCHEMA, validateSealedConfiguration);
|
|
302
|
+
return new Map([[schemaIdentityKey(validator.schema), validator]]);
|
|
303
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type CoreSchemaValidationContext, type CoreSchemaValidator, type JsonValue, type RuntimeIdentity, type SchemaIdentity } from '../../../eval-core/contracts/index.js';
|
|
3
|
+
import type { AnalysisNodeExecutionContext, AnalysisNodeExecutionResult, AnalysisNodeImplementation } from '../../../eval-core/analysis/index.js';
|
|
4
|
+
export declare function compareStrings(left: string, right: string): number;
|
|
5
|
+
export declare function round(value: number, decimals: number): number;
|
|
6
|
+
export declare function analysisJsonSchema(schema: z.ZodType, invariants: readonly string[]): JsonValue;
|
|
7
|
+
export declare function analysisSchemaIdentity(schemaVersion: string, schemaUri: string, schema: JsonValue): SchemaIdentity;
|
|
8
|
+
export declare function createAnalysisSchemaValidator(schema: SchemaIdentity, parse: (value: unknown, context?: Readonly<CoreSchemaValidationContext>) => JsonValue): CoreSchemaValidator;
|
|
9
|
+
export declare function createStatelessAnalysisImplementation(input: Readonly<{
|
|
10
|
+
identity: RuntimeIdentity;
|
|
11
|
+
outputSchema: SchemaIdentity;
|
|
12
|
+
parseParameters(parameters: unknown): void;
|
|
13
|
+
execute(context: AnalysisNodeExecutionContext): AnalysisNodeExecutionResult | Promise<AnalysisNodeExecutionResult>;
|
|
14
|
+
}>): AnalysisNodeImplementation;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { deepFreezeCanonicalJson, digestCanonicalJson, } from '../../../eval-core/contracts/index.js';
|
|
3
|
+
export function compareStrings(left, right) {
|
|
4
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
5
|
+
}
|
|
6
|
+
export function round(value, decimals) {
|
|
7
|
+
return Number(value.toFixed(decimals));
|
|
8
|
+
}
|
|
9
|
+
export function analysisJsonSchema(schema, invariants) {
|
|
10
|
+
const generated = z.toJSONSchema(schema, {
|
|
11
|
+
target: 'draft-2020-12',
|
|
12
|
+
unrepresentable: 'throw',
|
|
13
|
+
cycles: 'ref',
|
|
14
|
+
reused: 'ref',
|
|
15
|
+
});
|
|
16
|
+
return { ...generated, 'x-omk-invariants': [...invariants] };
|
|
17
|
+
}
|
|
18
|
+
export function analysisSchemaIdentity(schemaVersion, schemaUri, schema) {
|
|
19
|
+
return deepFreezeCanonicalJson({
|
|
20
|
+
schemaVersion,
|
|
21
|
+
schemaUri,
|
|
22
|
+
schemaDigest: digestCanonicalJson(schema),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export function createAnalysisSchemaValidator(schema, parse) {
|
|
26
|
+
return Object.freeze({ schema, parse });
|
|
27
|
+
}
|
|
28
|
+
export function createStatelessAnalysisImplementation(input) {
|
|
29
|
+
return Object.freeze({
|
|
30
|
+
identity: input.identity,
|
|
31
|
+
outputSchema: input.outputSchema,
|
|
32
|
+
async openRun() {
|
|
33
|
+
return {
|
|
34
|
+
async execute(context) {
|
|
35
|
+
if (context.signal.aborted)
|
|
36
|
+
throw context.signal.reason;
|
|
37
|
+
input.parseParameters(context.node.parameters);
|
|
38
|
+
return input.execute(context);
|
|
39
|
+
},
|
|
40
|
+
dispose() { },
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type RuntimeIdentity } from '../../../eval-core/contracts/index.js';
|
|
2
|
+
import type { AnalysisNodeImplementation } from '../../../eval-core/analysis/index.js';
|
|
3
|
+
export declare const ASSERTION_LAYER_ANALYSIS_IMPLEMENTATION_ID: "omk.assertion-layer-table/v1";
|
|
4
|
+
export declare const ASSERTION_LAYER_ANALYSIS_IDENTITY: RuntimeIdentity;
|
|
5
|
+
export declare function createAssertionLayerAnalysisNodes(): ReadonlyMap<string, AnalysisNodeImplementation>;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { RuntimeIdentitySchema, canonicalizeJson, deepFreezeCanonicalJson, digestCanonicalJson, } from '../../../eval-core/contracts/index.js';
|
|
2
|
+
import { ASSERTION_LAYER_PARAMETERS_SCHEMA, parseAssertionLayerParameters, } from './assertion-layer-parameters.js';
|
|
3
|
+
import { ASSERTION_LAYER_SCORE_DECIMALS, ASSERTION_LAYER_SCORE_MAX, ASSERTION_LAYER_SCORE_MIN, ASSERTION_LAYER_TABLE_SCHEMA, ASSERTION_LAYER_TABLE_SCHEMA_VERSION, ASSERTION_NOT_APPLICABLE_REASON, assertionLayerAggregate, assertionLayerCoverage, assertionLayerGroupId, compareAssertionLayerGroups, parseAssertionLayerTableValue, } from './assertion-layer.js';
|
|
4
|
+
import { compareStrings, createStatelessAnalysisImplementation, } from './analysis-support.js';
|
|
5
|
+
export const ASSERTION_LAYER_ANALYSIS_IMPLEMENTATION_ID = 'omk.assertion-layer-table/v1';
|
|
6
|
+
const ALGORITHM_VERSION = 'omk.assertion-layer-aggregation/v1';
|
|
7
|
+
const ASSERTION_LAYER_CAPABILITIES = {
|
|
8
|
+
capabilityKind: 'analysis-node',
|
|
9
|
+
analysisNodeKinds: ['reducer'],
|
|
10
|
+
inputDomains: [{
|
|
11
|
+
inputKind: 'metric-observations',
|
|
12
|
+
valueTypes: ['boolean'],
|
|
13
|
+
missingPolicyIds: ['exclude/v1'],
|
|
14
|
+
}],
|
|
15
|
+
outputSchema: ASSERTION_LAYER_TABLE_SCHEMA,
|
|
16
|
+
parameterSchema: ASSERTION_LAYER_PARAMETERS_SCHEMA,
|
|
17
|
+
inputCardinalities: {
|
|
18
|
+
metricObservations: { min: 1 },
|
|
19
|
+
analysisResults: { min: 0, max: 0 },
|
|
20
|
+
comparisons: { min: 0, max: 0 },
|
|
21
|
+
},
|
|
22
|
+
schemas: [],
|
|
23
|
+
};
|
|
24
|
+
export const ASSERTION_LAYER_ANALYSIS_IDENTITY = deepFreezeCanonicalJson(RuntimeIdentitySchema.parse({
|
|
25
|
+
implementationId: ASSERTION_LAYER_ANALYSIS_IMPLEMENTATION_ID,
|
|
26
|
+
version: '1.0.0',
|
|
27
|
+
fingerprint: digestCanonicalJson({
|
|
28
|
+
implementationId: ASSERTION_LAYER_ANALYSIS_IMPLEMENTATION_ID,
|
|
29
|
+
algorithmVersion: ALGORITHM_VERSION,
|
|
30
|
+
scoreMapping: {
|
|
31
|
+
min: ASSERTION_LAYER_SCORE_MIN,
|
|
32
|
+
max: ASSERTION_LAYER_SCORE_MAX,
|
|
33
|
+
decimals: ASSERTION_LAYER_SCORE_DECIMALS,
|
|
34
|
+
},
|
|
35
|
+
missingPolicyId: 'exclude/v1',
|
|
36
|
+
metricContract: { scope: 'sample', direction: 'higher-is-better' },
|
|
37
|
+
structuralNotApplicableReason: ASSERTION_NOT_APPLICABLE_REASON,
|
|
38
|
+
samplingUnitLineage: 'preserved-from-analysis-metric-rows',
|
|
39
|
+
criterionDesign: 'sealed-explicit-parameters',
|
|
40
|
+
outputSchema: ASSERTION_LAYER_TABLE_SCHEMA,
|
|
41
|
+
parameterSchema: ASSERTION_LAYER_PARAMETERS_SCHEMA,
|
|
42
|
+
declaredCapabilities: ASSERTION_LAYER_CAPABILITIES,
|
|
43
|
+
}),
|
|
44
|
+
fingerprintBasis: 'self-reported',
|
|
45
|
+
assuranceLevel: 'declared',
|
|
46
|
+
capabilities: ASSERTION_LAYER_CAPABILITIES,
|
|
47
|
+
implementationManifest: { coverageKind: 'fingerprint-complete' },
|
|
48
|
+
}));
|
|
49
|
+
function metricInputs(context) {
|
|
50
|
+
const inputs = context.inputs.filter((input) => (input.inputKind === 'metric-observations'));
|
|
51
|
+
if (inputs.length === 0 || inputs.length !== context.inputs.length) {
|
|
52
|
+
throw new TypeError('Assertion-layer Analysis requires one or more Metric inputs only.');
|
|
53
|
+
}
|
|
54
|
+
for (const input of inputs) {
|
|
55
|
+
if (input.referenceId !== input.metric.metricId
|
|
56
|
+
|| input.metric.valueType !== 'boolean'
|
|
57
|
+
|| input.metric.scope !== 'sample'
|
|
58
|
+
|| input.metric.direction !== 'higher-is-better'
|
|
59
|
+
|| input.metric.missingPolicyId !== 'exclude/v1') {
|
|
60
|
+
throw new TypeError('Assertion-layer Analysis requires reference-aligned, sample-scoped, '
|
|
61
|
+
+ 'higher-is-better, exclude/v1 Boolean Metrics.');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return inputs;
|
|
65
|
+
}
|
|
66
|
+
function baseUnitKey(row) {
|
|
67
|
+
return canonicalizeJson([row.targetId, row.sampleId, row.trialIndex, row.trialId]);
|
|
68
|
+
}
|
|
69
|
+
function entryFromRow(row, criterion) {
|
|
70
|
+
const base = {
|
|
71
|
+
...criterion,
|
|
72
|
+
rowId: row.rowId,
|
|
73
|
+
evaluatorId: row.evaluatorId,
|
|
74
|
+
censored: row.censored,
|
|
75
|
+
};
|
|
76
|
+
if (row.rowStatus === 'observed') {
|
|
77
|
+
if (typeof row.value !== 'boolean') {
|
|
78
|
+
throw new TypeError('Observed assertion reading must be Boolean.');
|
|
79
|
+
}
|
|
80
|
+
return { ...base, applicability: 'applicable', rowStatus: 'observed', value: row.value };
|
|
81
|
+
}
|
|
82
|
+
if (row.reasonCode === ASSERTION_NOT_APPLICABLE_REASON) {
|
|
83
|
+
if (row.rowStatus !== 'missing' || row.censored) {
|
|
84
|
+
throw new TypeError('criterion-not-applicable must be a non-censored missing row.');
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
...base,
|
|
88
|
+
censored: false,
|
|
89
|
+
applicability: 'not-applicable',
|
|
90
|
+
rowStatus: 'missing',
|
|
91
|
+
reasonCode: ASSERTION_NOT_APPLICABLE_REASON,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
...base,
|
|
96
|
+
applicability: 'applicable',
|
|
97
|
+
rowStatus: row.rowStatus,
|
|
98
|
+
reasonCode: row.reasonCode,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function validateInputDesign(inputs, parameters) {
|
|
102
|
+
const criteriaByMetric = new Map(parameters.criteria.map((criterion) => [
|
|
103
|
+
criterion.metricId,
|
|
104
|
+
criterion,
|
|
105
|
+
]));
|
|
106
|
+
const inputMetricIds = inputs.map((input) => input.metric.metricId);
|
|
107
|
+
if (new Set(inputMetricIds).size !== inputMetricIds.length
|
|
108
|
+
|| canonicalizeJson([...inputMetricIds].sort(compareStrings))
|
|
109
|
+
!== canonicalizeJson(parameters.criteria.map((criterion) => criterion.metricId))) {
|
|
110
|
+
throw new TypeError('Assertion-layer parameters must map every input Metric exactly once and no others.');
|
|
111
|
+
}
|
|
112
|
+
return criteriaByMetric;
|
|
113
|
+
}
|
|
114
|
+
function buildAssertionLayerTable(inputs, parameters, signal) {
|
|
115
|
+
const criteriaByMetric = validateInputDesign(inputs, parameters);
|
|
116
|
+
const groupedRows = new Map();
|
|
117
|
+
for (const input of inputs) {
|
|
118
|
+
for (const row of input.rows) {
|
|
119
|
+
if (signal.aborted)
|
|
120
|
+
throw signal.reason;
|
|
121
|
+
if (row.metricId !== input.metric.metricId || row.valueType !== 'boolean') {
|
|
122
|
+
throw new TypeError('Assertion-layer row identity or value type disagrees with its Metric.');
|
|
123
|
+
}
|
|
124
|
+
const key = baseUnitKey(row);
|
|
125
|
+
const members = groupedRows.get(key) ?? [];
|
|
126
|
+
members.push(row);
|
|
127
|
+
groupedRows.set(key, members);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const groups = [...groupedRows.entries()]
|
|
131
|
+
.sort(([left], [right]) => compareStrings(left, right))
|
|
132
|
+
.map(([, rows]) => {
|
|
133
|
+
const orderedRows = [...rows].sort((left, right) => (compareStrings(left.metricId, right.metricId)));
|
|
134
|
+
const first = orderedRows[0];
|
|
135
|
+
if (orderedRows.length !== parameters.criteria.length
|
|
136
|
+
|| new Set(orderedRows.map((row) => row.metricId)).size !== orderedRows.length) {
|
|
137
|
+
throw new TypeError('Every assertion measurement unit must contain exactly one row per Metric.');
|
|
138
|
+
}
|
|
139
|
+
if (new Set(orderedRows.map((row) => canonicalizeJson(row.samplingUnitIds))).size !== 1) {
|
|
140
|
+
throw new TypeError('Assertion rows disagree on sealed sampling-unit lineage.');
|
|
141
|
+
}
|
|
142
|
+
const entries = orderedRows.map((row) => {
|
|
143
|
+
const criterion = criteriaByMetric.get(row.metricId);
|
|
144
|
+
if (criterion === undefined) {
|
|
145
|
+
throw new TypeError(`Assertion Metric "${row.metricId}" is not mapped by parameters.`);
|
|
146
|
+
}
|
|
147
|
+
return entryFromRow(row, criterion);
|
|
148
|
+
});
|
|
149
|
+
const fact = entries.filter((entry) => entry.layerDisposition === 'fact');
|
|
150
|
+
const behavior = entries.filter((entry) => entry.layerDisposition === 'behavior');
|
|
151
|
+
const excluded = entries.filter((entry) => (entry.layerDisposition === 'excluded-mixed-layer'));
|
|
152
|
+
const withoutGroupId = {
|
|
153
|
+
targetId: first.targetId,
|
|
154
|
+
sampleId: first.sampleId,
|
|
155
|
+
trialIndex: first.trialIndex,
|
|
156
|
+
trialId: first.trialId,
|
|
157
|
+
samplingUnitIds: first.samplingUnitIds,
|
|
158
|
+
entries,
|
|
159
|
+
layers: {
|
|
160
|
+
fact: assertionLayerAggregate(fact),
|
|
161
|
+
behavior: assertionLayerAggregate(behavior),
|
|
162
|
+
},
|
|
163
|
+
excludedMixedLayer: { coverage: assertionLayerCoverage(excluded) },
|
|
164
|
+
};
|
|
165
|
+
return { groupId: assertionLayerGroupId(withoutGroupId), ...withoutGroupId };
|
|
166
|
+
});
|
|
167
|
+
groups.sort(compareAssertionLayerGroups);
|
|
168
|
+
return parseAssertionLayerTableValue({
|
|
169
|
+
schemaVersion: ASSERTION_LAYER_TABLE_SCHEMA_VERSION,
|
|
170
|
+
groups,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
export function createAssertionLayerAnalysisNodes() {
|
|
174
|
+
const implementation = createStatelessAnalysisImplementation({
|
|
175
|
+
identity: ASSERTION_LAYER_ANALYSIS_IDENTITY,
|
|
176
|
+
outputSchema: ASSERTION_LAYER_TABLE_SCHEMA,
|
|
177
|
+
parseParameters: (parameters) => { parseAssertionLayerParameters(parameters); },
|
|
178
|
+
execute(context) {
|
|
179
|
+
const parameters = parseAssertionLayerParameters(context.node.parameters);
|
|
180
|
+
const inputs = metricInputs(context);
|
|
181
|
+
validateInputDesign(inputs, parameters);
|
|
182
|
+
if (inputs.every((input) => input.rows.length === 0)) {
|
|
183
|
+
return {
|
|
184
|
+
analysisStatus: 'inconclusive',
|
|
185
|
+
reasonCodes: ['assertion-layer-no-planned-rows'],
|
|
186
|
+
includedRowIds: [],
|
|
187
|
+
comparableRowIds: [],
|
|
188
|
+
assumptionChecks: [{
|
|
189
|
+
assumptionId: 'assertion-layer-contract',
|
|
190
|
+
checkStatus: 'failed',
|
|
191
|
+
reasonCode: 'assertion-layer-no-planned-rows',
|
|
192
|
+
}],
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
const table = buildAssertionLayerTable(inputs, parameters, context.signal);
|
|
196
|
+
const dispositionByMetric = new Map(parameters.criteria.map((criterion) => [
|
|
197
|
+
criterion.metricId,
|
|
198
|
+
criterion.layerDisposition,
|
|
199
|
+
]));
|
|
200
|
+
const includedRowIds = inputs.flatMap((input) => input.rows.flatMap((row) => (row.rowStatus === 'observed'
|
|
201
|
+
&& dispositionByMetric.get(row.metricId) !== 'excluded-mixed-layer'
|
|
202
|
+
? [row.rowId]
|
|
203
|
+
: []))).sort(compareStrings);
|
|
204
|
+
return {
|
|
205
|
+
analysisStatus: 'completed',
|
|
206
|
+
resultType: 'table',
|
|
207
|
+
value: table,
|
|
208
|
+
includedRowIds,
|
|
209
|
+
comparableRowIds: includedRowIds,
|
|
210
|
+
assumptionChecks: [{
|
|
211
|
+
assumptionId: 'assertion-layer-contract',
|
|
212
|
+
checkStatus: 'passed',
|
|
213
|
+
}],
|
|
214
|
+
};
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
return new Map([[ASSERTION_LAYER_ANALYSIS_IMPLEMENTATION_ID, implementation]]);
|
|
218
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type CoreSchemaValidator } from '../../../eval-core/contracts/index.js';
|
|
3
|
+
export declare const AssertionLayerDispositionSchema: z.ZodEnum<{
|
|
4
|
+
behavior: "behavior";
|
|
5
|
+
fact: "fact";
|
|
6
|
+
"excluded-mixed-layer": "excluded-mixed-layer";
|
|
7
|
+
}>;
|
|
8
|
+
export declare const AssertionLayerCriterionParameterSchema: z.ZodObject<{
|
|
9
|
+
criterionId: z.ZodString;
|
|
10
|
+
metricId: z.ZodString;
|
|
11
|
+
layerDisposition: z.ZodEnum<{
|
|
12
|
+
behavior: "behavior";
|
|
13
|
+
fact: "fact";
|
|
14
|
+
"excluded-mixed-layer": "excluded-mixed-layer";
|
|
15
|
+
}>;
|
|
16
|
+
weight: z.ZodNumber;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
declare const AssertionLayerParametersSchema: z.ZodObject<{
|
|
19
|
+
criteria: z.ZodArray<z.ZodObject<{
|
|
20
|
+
criterionId: z.ZodString;
|
|
21
|
+
metricId: z.ZodString;
|
|
22
|
+
layerDisposition: z.ZodEnum<{
|
|
23
|
+
behavior: "behavior";
|
|
24
|
+
fact: "fact";
|
|
25
|
+
"excluded-mixed-layer": "excluded-mixed-layer";
|
|
26
|
+
}>;
|
|
27
|
+
weight: z.ZodNumber;
|
|
28
|
+
}, z.core.$strict>>;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
export type AssertionLayerParameters = z.infer<typeof AssertionLayerParametersSchema>;
|
|
31
|
+
export type AssertionLayerCriterionParameter = z.infer<typeof AssertionLayerCriterionParameterSchema>;
|
|
32
|
+
export declare function parseAssertionLayerParameters(value: unknown): AssertionLayerParameters;
|
|
33
|
+
export declare const ASSERTION_LAYER_PARAMETERS_SCHEMA: {
|
|
34
|
+
schemaVersion: string;
|
|
35
|
+
schemaUri: string;
|
|
36
|
+
schemaDigest: string;
|
|
37
|
+
};
|
|
38
|
+
export declare function createAssertionLayerParameterSchemaValidators(): ReadonlyMap<string, CoreSchemaValidator>;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IdentifierSchema, schemaIdentityKey, } from '../../../eval-core/contracts/index.js';
|
|
3
|
+
import { analysisJsonSchema, analysisSchemaIdentity, compareStrings, createAnalysisSchemaValidator, } from './analysis-support.js';
|
|
4
|
+
const PARAMETERS_SCHEMA_VERSION = 'omk.parameters.assertion-layer/v1';
|
|
5
|
+
export const AssertionLayerDispositionSchema = z.enum([
|
|
6
|
+
'fact',
|
|
7
|
+
'behavior',
|
|
8
|
+
'excluded-mixed-layer',
|
|
9
|
+
]);
|
|
10
|
+
export const AssertionLayerCriterionParameterSchema = z.object({
|
|
11
|
+
criterionId: IdentifierSchema,
|
|
12
|
+
metricId: IdentifierSchema,
|
|
13
|
+
layerDisposition: AssertionLayerDispositionSchema,
|
|
14
|
+
weight: z.number().finite().positive(),
|
|
15
|
+
}).strict();
|
|
16
|
+
const AssertionLayerParametersSchema = z.object({
|
|
17
|
+
criteria: z.array(AssertionLayerCriterionParameterSchema).min(1),
|
|
18
|
+
}).strict().superRefine((parameters, context) => {
|
|
19
|
+
for (const field of ['criterionId', 'metricId']) {
|
|
20
|
+
const values = parameters.criteria.map((criterion) => criterion[field]);
|
|
21
|
+
if (new Set(values).size !== values.length) {
|
|
22
|
+
context.addIssue({
|
|
23
|
+
code: 'custom',
|
|
24
|
+
path: ['criteria'],
|
|
25
|
+
message: `Assertion-layer ${field} values must be unique.`,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
function compareCriteria(left, right) {
|
|
31
|
+
return compareStrings(left.metricId, right.metricId)
|
|
32
|
+
|| compareStrings(left.criterionId, right.criterionId);
|
|
33
|
+
}
|
|
34
|
+
export function parseAssertionLayerParameters(value) {
|
|
35
|
+
const parsed = AssertionLayerParametersSchema.parse(value);
|
|
36
|
+
return {
|
|
37
|
+
criteria: [...parsed.criteria].sort(compareCriteria),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export const ASSERTION_LAYER_PARAMETERS_SCHEMA = analysisSchemaIdentity(PARAMETERS_SCHEMA_VERSION, 'urn:omk:parameters:assertion-layer:v1', analysisJsonSchema(AssertionLayerParametersSchema, [
|
|
41
|
+
'criteria are normalized by metricId and criterionId before plan sealing',
|
|
42
|
+
'criterionId and metricId are independently unique',
|
|
43
|
+
'layer disposition is explicit and never inferred from evaluator or assertion strings',
|
|
44
|
+
'weights are finite and strictly positive',
|
|
45
|
+
]));
|
|
46
|
+
export function createAssertionLayerParameterSchemaValidators() {
|
|
47
|
+
const validator = createAnalysisSchemaValidator(ASSERTION_LAYER_PARAMETERS_SCHEMA, (value) => parseAssertionLayerParameters(value));
|
|
48
|
+
return new Map([[schemaIdentityKey(validator.schema), validator]]);
|
|
49
|
+
}
|