oh-my-knowledge 1.0.0-beta.9 → 1.0.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 +27 -75
- package/README.zh.md +27 -75
- package/dist/assets/agent-skills/omk/SKILL.md +98 -47
- package/dist/assets/agent-skills/omk/references/commands.md +494 -118
- package/dist/assets/agent-skills/omk/references/knowledge-maintenance.md +33 -0
- package/dist/assets/agent-skills/omk/references/knowledge-reuse.md +69 -0
- package/dist/cli/commands/agents.d.ts +21 -0
- package/dist/cli/commands/agents.js +251 -0
- package/dist/cli/commands/doctor.d.ts +1 -1
- package/dist/cli/commands/doctor.js +17 -11
- package/dist/cli/commands/eval/gold/compare.d.ts +1 -1
- package/dist/cli/commands/eval/gold/compare.js +1 -1
- package/dist/cli/commands/eval/gold/index.d.ts +1 -1
- package/dist/cli/commands/eval/gold/init.d.ts +1 -1
- package/dist/cli/commands/eval/gold/validate.d.ts +1 -1
- package/dist/cli/commands/eval/index.d.ts +1 -2
- package/dist/cli/commands/eval/index.js +4 -26
- package/dist/cli/commands/eval/task.d.ts +13 -0
- package/dist/cli/commands/eval/task.js +42 -0
- package/dist/cli/commands/evolve.d.ts +1 -1
- package/dist/cli/commands/evolve.js +6 -44
- package/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/init.js +57 -18
- package/dist/cli/commands/install.d.ts +2 -2
- package/dist/cli/commands/install.js +50 -132
- package/dist/cli/commands/know/extract.d.ts +34 -0
- package/dist/cli/commands/know/extract.js +285 -0
- package/dist/cli/commands/know/index.d.ts +8 -0
- package/dist/cli/commands/know/index.js +16 -0
- package/dist/cli/commands/know/list.d.ts +10 -0
- package/dist/cli/commands/know/list.js +10 -0
- package/dist/cli/commands/know/migrate.d.ts +23 -0
- package/dist/cli/commands/know/migrate.js +131 -0
- package/dist/cli/commands/know/retrieve.d.ts +20 -0
- package/dist/cli/commands/know/retrieve.js +38 -0
- package/dist/cli/commands/know/review.d.ts +24 -0
- package/dist/cli/commands/know/review.js +98 -0
- package/dist/cli/commands/know/revise.d.ts +21 -0
- package/dist/cli/commands/know/revise.js +63 -0
- package/dist/cli/commands/know/runs.d.ts +28 -0
- package/dist/cli/commands/know/runs.js +115 -0
- package/dist/cli/commands/know/show.d.ts +24 -0
- package/dist/cli/commands/know/show.js +68 -0
- package/dist/cli/commands/know/sources.d.ts +20 -0
- package/dist/cli/commands/know/sources.js +98 -0
- package/dist/cli/commands/observe/entity-links.d.ts +37 -0
- package/dist/cli/commands/observe/entity-links.js +240 -0
- package/dist/cli/commands/observe/inbox.d.ts +1 -1
- package/dist/cli/commands/observe/inbox.js +11 -9
- package/dist/cli/commands/observe/index.d.ts +2 -3
- package/dist/cli/commands/observe/index.js +9 -71
- package/dist/cli/commands/observe/ingest.d.ts +2 -2
- package/dist/cli/commands/observe/ingest.js +12 -9
- package/dist/cli/commands/observe/show.d.ts +1 -1
- package/dist/cli/commands/observe/show.js +3 -3
- package/dist/cli/commands/sample.d.ts +1 -1
- package/dist/cli/commands/sample.js +4 -4
- package/dist/cli/commands/studio.d.ts +4 -1
- package/dist/cli/commands/studio.js +72 -48
- package/dist/cli/index.js +4 -5
- package/dist/cli/lib/cell-format.d.ts +1 -5
- package/dist/cli/lib/cell-format.js +1 -5
- package/dist/cli/lib/codex-model-hint.js +5 -14
- package/dist/cli/lib/core-report-service.js +1 -1
- package/dist/cli/lib/entity-link-output.d.ts +450 -0
- package/dist/cli/lib/entity-link-output.js +79 -0
- package/dist/cli/lib/eval-output.js +0 -5
- package/dist/cli/lib/generation-failure-hint.js +0 -21
- package/dist/cli/lib/i18n-dict/common.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/common.js +12 -8
- package/dist/cli/lib/i18n-dict/evolve.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/evolve.js +2 -6
- package/dist/cli/lib/i18n-dict/gen.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/gen.js +8 -20
- package/dist/cli/lib/i18n-dict/init.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/init.js +6 -0
- package/dist/cli/lib/i18n-dict/install.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/install.js +4 -20
- package/dist/cli/lib/i18n-dict/run.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/run.js +4 -24
- package/dist/cli/lib/i18n-dict.d.ts +1 -4
- package/dist/cli/lib/i18n-dict.js +0 -6
- package/dist/cli/lib/i18n.d.ts +6 -3
- package/dist/cli/lib/i18n.js +18 -10
- package/dist/cli/lib/know-command.d.ts +60 -0
- package/dist/cli/lib/know-command.js +198 -0
- package/dist/cli/lib/knowledge-output.d.ts +4 -0
- package/dist/cli/lib/knowledge-output.js +39 -0
- package/dist/cli/lib/knowledge-review-actor.d.ts +3 -0
- package/dist/cli/lib/knowledge-review-actor.js +8 -0
- package/dist/cli/lib/prepare-evaluation.js +2 -2
- package/dist/cli/lib/progress.d.ts +1 -1
- package/dist/cli/lib/resolve-skill-input.d.ts +0 -1
- package/dist/cli/lib/run-core-evaluation.js +1 -13
- package/dist/cli/lib/runtime-defaults.d.ts +2 -6
- package/dist/cli/lib/runtime-defaults.js +15 -49
- package/dist/cli/lib/update-check.js +1 -1
- package/dist/cli/oclif/base-command.d.ts +6 -2
- package/dist/cli/oclif/base-command.js +32 -7
- package/dist/cli/oclif/i18n.d.ts +5 -2
- package/dist/cli/oclif/i18n.js +10 -5
- package/dist/cli/oclif/run.js +2 -1
- package/dist/cli/runtime/entity-capture.d.ts +10 -0
- package/dist/cli/runtime/entity-capture.js +15 -0
- package/dist/cli/templates/init-samples.d.ts +2 -1
- package/dist/cli/templates/init-samples.js +74 -2
- package/dist/dsh-plugin/cleanup.d.ts +3 -0
- package/dist/dsh-plugin/cleanup.js +22 -0
- package/dist/dsh-plugin/core-adapter.d.ts +2 -0
- package/dist/dsh-plugin/core-adapter.js +42 -48
- package/dist/dsh-plugin/core-command.js +2 -9
- package/dist/dsh-plugin/core-protocol.d.ts +1 -1
- package/dist/dsh-plugin/core-protocol.js +1 -1
- package/dist/dsh-plugin/host-executor.js +65 -50
- package/dist/dsh-plugin/index.js +50 -21
- package/dist/dsh-plugin/observe.d.ts +2 -2
- package/dist/dsh-plugin/observe.js +3 -3
- package/dist/dsh-plugin/protocol.js +2 -2
- package/dist/dsh-plugin/resources.d.ts +86 -0
- package/dist/dsh-plugin/resources.js +392 -0
- package/dist/dsh-plugin/trace-adapter.d.ts +2 -2
- package/dist/dsh-plugin/trace-adapter.js +4 -7
- package/dist/eval-core/analysis/bootstrap-kernel.d.ts +19 -0
- package/dist/eval-core/analysis/bootstrap-kernel.js +55 -0
- package/dist/eval-core/analysis/bootstrap.d.ts +158 -0
- package/dist/eval-core/analysis/bootstrap.js +205 -0
- package/dist/eval-core/analysis/builtin-aggregation.d.ts +28 -0
- package/dist/eval-core/analysis/builtin-aggregation.js +131 -0
- package/dist/eval-core/analysis/builtin-bootstrap.d.ts +16 -0
- package/dist/eval-core/analysis/builtin-bootstrap.js +447 -0
- package/dist/eval-core/analysis/builtin-composite.d.ts +25 -0
- package/dist/eval-core/analysis/builtin-composite.js +211 -0
- package/dist/eval-core/analysis/builtin-decisions.d.ts +38 -0
- package/dist/eval-core/analysis/builtin-decisions.js +177 -0
- package/dist/eval-core/analysis/builtin-hypothesis.d.ts +41 -0
- package/dist/eval-core/analysis/builtin-hypothesis.js +155 -0
- package/dist/eval-core/analysis/builtin-identity.d.ts +32 -0
- package/dist/eval-core/analysis/builtin-identity.js +134 -0
- package/dist/eval-core/analysis/builtin-primitives.d.ts +32 -0
- package/dist/eval-core/analysis/builtin-primitives.js +158 -0
- package/dist/eval-core/analysis/builtin-registry.d.ts +2 -0
- package/dist/eval-core/analysis/builtin-registry.js +235 -0
- package/dist/eval-core/analysis/builtin-schemas.d.ts +297 -0
- package/dist/eval-core/analysis/builtin-schemas.js +308 -0
- package/dist/eval-core/analysis/builtin-validation.d.ts +23 -0
- package/dist/eval-core/analysis/builtin-validation.js +74 -0
- package/dist/eval-core/analysis/builtins.d.ts +5 -60
- package/dist/eval-core/analysis/builtins.js +17 -1974
- package/dist/eval-core/analysis/decision.js +10 -9
- package/dist/eval-core/analysis/runtime.js +10 -35
- package/dist/eval-core/budget/index.js +5 -42
- package/dist/eval-core/compiler/index.d.ts +1 -3
- package/dist/eval-core/compiler/index.js +8 -895
- package/dist/eval-core/compiler/preparation/capabilities.d.ts +8 -0
- package/dist/eval-core/compiler/preparation/capabilities.js +175 -0
- package/dist/eval-core/compiler/preparation/definition.d.ts +5 -0
- package/dist/eval-core/compiler/preparation/definition.js +105 -0
- package/dist/eval-core/compiler/preparation/extensions.d.ts +11 -0
- package/dist/eval-core/compiler/preparation/extensions.js +74 -0
- package/dist/eval-core/compiler/preparation/runtimes.d.ts +7 -0
- package/dist/eval-core/compiler/preparation/runtimes.js +433 -0
- package/dist/eval-core/compiler/preparation/schemas.d.ts +9 -0
- package/dist/eval-core/compiler/preparation/schemas.js +122 -0
- package/dist/eval-core/compiler/types.d.ts +1 -1
- package/dist/eval-core/compiler/validation/analysis.d.ts +8 -0
- package/dist/eval-core/compiler/validation/analysis.js +304 -0
- package/dist/eval-core/compiler/validation/bindings.d.ts +4 -0
- package/dist/eval-core/compiler/validation/bindings.js +110 -0
- package/dist/eval-core/compiler/validation/policy.d.ts +2 -0
- package/dist/eval-core/compiler/validation/policy.js +56 -0
- package/dist/eval-core/compiler/validation/sampling.d.ts +2 -0
- package/dist/eval-core/compiler/validation/sampling.js +140 -0
- package/dist/eval-core/compiler/validation/shared.d.ts +3 -0
- package/dist/eval-core/compiler/validation/shared.js +19 -0
- package/dist/eval-core/compiler/validation.d.ts +2 -6
- package/dist/eval-core/compiler/validation.js +12 -621
- package/dist/eval-core/contracts/analysis-bundle.d.ts +17 -13
- package/dist/eval-core/contracts/analysis-bundle.js +0 -563
- package/dist/eval-core/contracts/analysis-input-matching.js +2 -2
- package/dist/eval-core/contracts/artifacts.js +2 -2
- package/dist/eval-core/contracts/budget.d.ts +18 -0
- package/dist/eval-core/contracts/budget.js +93 -83
- package/dist/eval-core/contracts/common.js +1 -1
- package/dist/eval-core/contracts/comparability.d.ts +15 -7
- package/dist/eval-core/contracts/comparability.js +11 -816
- package/dist/eval-core/contracts/definition.d.ts +10 -0
- package/dist/eval-core/contracts/definition.js +8 -2
- package/dist/eval-core/contracts/digests.d.ts +2 -2
- package/dist/eval-core/contracts/digests.js +8 -31
- package/dist/eval-core/contracts/evaluation-bundle.d.ts +13 -31
- package/dist/eval-core/contracts/evaluation-bundle.js +0 -843
- package/dist/eval-core/contracts/evaluation-identities.js +2 -2
- package/dist/eval-core/contracts/evaluation-report.d.ts +3 -17
- package/dist/eval-core/contracts/evaluation-report.js +2 -202
- package/dist/eval-core/contracts/execution-bundle.d.ts +6 -36
- package/dist/eval-core/contracts/execution-bundle.js +0 -649
- package/dist/eval-core/contracts/execution-controls.js +1 -3
- package/dist/eval-core/contracts/execution-facts.d.ts +2 -7
- package/dist/eval-core/contracts/execution-facts.js +1 -1
- package/dist/eval-core/contracts/execution-identities.d.ts +1 -1
- package/dist/eval-core/contracts/execution-identities.js +9 -31
- package/dist/eval-core/contracts/json-schema.d.ts +4 -1
- package/dist/eval-core/contracts/json-schema.js +10 -1
- package/dist/eval-core/contracts/json.js +3 -2
- package/dist/eval-core/contracts/plans.d.ts +5 -0
- package/dist/eval-core/contracts/runtime-capabilities.js +1 -1
- package/dist/eval-core/contracts/schemas/v1/measurement-policy.schema.json +8 -0
- package/dist/eval-core/contracts/schemas/v5/run-plan.schema.json +8 -0
- package/dist/eval-core/contracts/sealed-run-plan.d.ts +2 -2
- package/dist/eval-core/contracts/sealed-run-plan.js +1 -1
- package/dist/eval-core/contracts/series.d.ts +14 -24
- package/dist/eval-core/contracts/series.js +11 -387
- package/dist/eval-core/engine/index.js +6 -3
- package/dist/eval-core/evaluation/bundle.d.ts +4 -0
- package/dist/eval-core/evaluation/bundle.js +96 -0
- package/dist/eval-core/evaluation/coordinate.d.ts +34 -0
- package/dist/eval-core/evaluation/coordinate.js +776 -0
- package/dist/eval-core/evaluation/preparation.d.ts +6 -0
- package/dist/eval-core/evaluation/preparation.js +74 -0
- package/dist/eval-core/evaluation/runtime-state.d.ts +34 -0
- package/dist/eval-core/evaluation/runtime.js +73 -1009
- package/dist/eval-core/evaluation/types.d.ts +1 -1
- package/dist/eval-core/evaluation/types.js +1 -0
- package/dist/eval-core/execution/bundle.d.ts +4 -0
- package/dist/eval-core/execution/bundle.js +90 -0
- package/dist/eval-core/execution/coordinate.d.ts +27 -0
- package/dist/eval-core/execution/coordinate.js +669 -0
- package/dist/eval-core/execution/preparation.d.ts +4 -0
- package/dist/eval-core/execution/preparation.js +104 -0
- package/dist/eval-core/execution/runtime-state.d.ts +40 -0
- package/dist/eval-core/execution/runtime.js +20 -930
- package/dist/eval-core/execution/scheduler.js +1 -7
- package/dist/eval-core/index.d.ts +6 -5
- package/dist/eval-core/index.js +3 -2
- package/dist/eval-core/primitives/budget-outcome.d.ts +11 -0
- package/dist/eval-core/primitives/budget-outcome.js +8 -0
- package/dist/eval-core/primitives/graph.d.ts +2 -0
- package/dist/eval-core/primitives/graph.js +17 -0
- package/dist/eval-core/primitives/json-pointer.d.ts +12 -0
- package/dist/eval-core/primitives/json-pointer.js +31 -0
- package/dist/eval-core/primitives/ordering.d.ts +2 -0
- package/dist/eval-core/primitives/ordering.js +8 -0
- package/dist/eval-core/primitives/provenance.d.ts +11 -0
- package/dist/eval-core/primitives/provenance.js +19 -0
- package/dist/eval-core/runtime/abort.d.ts +2 -0
- package/dist/eval-core/runtime/abort.js +12 -0
- package/dist/eval-core/runtime/clock.d.ts +2 -0
- package/dist/eval-core/runtime/clock.js +4 -0
- package/dist/eval-core/runtime/event-stream.d.ts +1 -0
- package/dist/eval-core/runtime/event-stream.js +1 -0
- package/dist/eval-core/runtime/run-resources.d.ts +12 -0
- package/dist/eval-core/runtime/run-resources.js +39 -0
- package/dist/eval-core/schemas.js +2 -16
- package/dist/eval-core/series/runtime.js +21 -38
- package/dist/eval-core/verify/analysis-bundle.d.ts +13 -0
- package/dist/eval-core/verify/analysis-bundle.js +553 -0
- package/dist/eval-core/verify/comparability.d.ts +4 -0
- package/dist/eval-core/verify/comparability.js +804 -0
- package/dist/eval-core/verify/evaluation-bundle.d.ts +28 -0
- package/dist/eval-core/verify/evaluation-bundle.js +813 -0
- package/dist/eval-core/verify/evaluation-report.d.ts +18 -0
- package/dist/eval-core/verify/evaluation-report.js +201 -0
- package/dist/eval-core/verify/execution-bundle.d.ts +33 -0
- package/dist/eval-core/verify/execution-bundle.js +635 -0
- package/dist/eval-core/verify/index.d.ts +6 -0
- package/dist/eval-core/verify/index.js +6 -0
- package/dist/eval-core/verify/series.d.ts +24 -0
- package/dist/eval-core/verify/series.js +373 -0
- package/dist/eval-runtime/adapters/json-executor.d.ts +3 -4
- package/dist/eval-runtime/adapters/json-executor.js +122 -222
- package/dist/eval-runtime/adapters/resource-lease.d.ts +56 -0
- package/dist/eval-runtime/adapters/resource-lease.js +107 -0
- package/dist/eval-runtime/builders/custom-evaluator.d.ts +49 -0
- package/dist/eval-runtime/builders/custom-evaluator.js +67 -0
- package/dist/eval-runtime/builders/paired-comparison.js +2 -2
- package/dist/eval-runtime/builders/policy.d.ts +19 -1
- package/dist/eval-runtime/builders/policy.js +11 -0
- package/dist/eval-runtime/builders/rubric-evaluator.d.ts +7 -0
- package/dist/eval-runtime/builders/rubric-evaluator.js +46 -0
- package/dist/eval-runtime/conformance/cache.d.ts +1 -1
- package/dist/eval-runtime/conformance/cache.js +15 -8
- package/dist/eval-runtime/conformance/content-store.d.ts +1 -1
- package/dist/eval-runtime/conformance/evaluator.d.ts +3 -3
- package/dist/eval-runtime/conformance/evaluator.js +28 -17
- package/dist/eval-runtime/conformance/executor.js +2 -2
- package/dist/eval-runtime/conformance/judge.js +5 -6
- package/dist/eval-runtime/conformance/runtime.d.ts +1 -1
- package/dist/eval-runtime/conformance/runtime.js +1 -1
- package/dist/eval-runtime/conformance/workspace-provider.d.ts +1 -1
- package/dist/eval-runtime/conformance/workspace-provider.js +1 -1
- package/dist/eval-runtime/content/executed-store.d.ts +48 -0
- package/dist/eval-runtime/content/executed-store.js +257 -0
- package/dist/eval-runtime/content/infrastructure.d.ts +51 -0
- package/dist/eval-runtime/content/infrastructure.js +89 -0
- package/dist/eval-runtime/content/result-store.d.ts +45 -0
- package/dist/eval-runtime/content/result-store.js +249 -0
- package/dist/eval-runtime/custom-evaluator.d.ts +14 -7
- package/dist/eval-runtime/custom-evaluator.js +173 -96
- package/dist/eval-runtime/debug/evaluator.d.ts +26 -0
- package/dist/eval-runtime/debug/evaluator.js +65 -0
- package/dist/eval-runtime/debug/rubric.d.ts +29 -0
- package/dist/eval-runtime/debug/rubric.js +92 -0
- package/dist/eval-runtime/evaluate.d.ts +2 -2
- package/dist/eval-runtime/evaluate.js +1 -1
- package/dist/eval-runtime/evaluation/capture-evaluators.d.ts +1 -1
- package/dist/eval-runtime/evaluation/capture-evaluators.js +29 -119
- package/dist/eval-runtime/evaluation/capture-input.d.ts +4 -4
- package/dist/eval-runtime/evaluation/capture-input.js +4 -4
- package/dist/eval-runtime/evaluation/capture-judge.d.ts +39 -0
- package/dist/eval-runtime/evaluation/capture-judge.js +45 -0
- package/dist/eval-runtime/evaluation/conformance.js +1 -1
- package/dist/eval-runtime/evaluation/contracts.d.ts +13 -9
- package/dist/eval-runtime/evaluation/definition.js +8 -8
- package/dist/eval-runtime/evaluation/errors.d.ts +9 -1
- package/dist/eval-runtime/evaluation/errors.js +7 -1
- package/dist/eval-runtime/evaluation/prepare.js +9 -6
- package/dist/eval-runtime/evaluation/result-state.d.ts +2 -2
- package/dist/eval-runtime/evaluation/result-state.js +1 -1
- package/dist/eval-runtime/evaluation/reuse.d.ts +2 -2
- package/dist/eval-runtime/evaluation/reuse.js +13 -8
- package/dist/eval-runtime/evaluation/rubric-declaration.d.ts +17 -0
- package/dist/eval-runtime/evaluation/rubric-declaration.js +118 -0
- package/dist/eval-runtime/evaluation/schemas.d.ts +15 -0
- package/dist/eval-runtime/evaluation/stage-session.js +1 -2
- package/dist/eval-runtime/evaluators/formula.d.ts +28 -0
- package/dist/eval-runtime/evaluators/formula.js +208 -0
- package/dist/eval-runtime/execution/assembly.d.ts +35 -0
- package/dist/eval-runtime/execution/assembly.js +111 -0
- package/dist/eval-runtime/execution/clock.d.ts +3 -0
- package/dist/eval-runtime/execution/controls.d.ts +6 -0
- package/dist/eval-runtime/execution/controls.js +55 -0
- package/dist/eval-runtime/execution/lifecycle.d.ts +60 -0
- package/dist/eval-runtime/execution/lifecycle.js +183 -0
- package/dist/eval-runtime/execution/provider.d.ts +39 -0
- package/dist/eval-runtime/execution/provider.js +13 -0
- package/dist/eval-runtime/execution/run.d.ts +47 -0
- package/dist/eval-runtime/execution/run.js +116 -0
- package/dist/eval-runtime/index.d.ts +27 -18
- package/dist/eval-runtime/index.js +10 -6
- package/dist/eval-runtime/judges/rubric-contracts.d.ts +6 -5
- package/dist/eval-runtime/judges/rubric-contracts.js +25 -19
- package/dist/eval-runtime/judges/rubric-judge.d.ts +6 -5
- package/dist/eval-runtime/judges/rubric-judge.js +47 -62
- package/dist/eval-runtime/judges/rubric-kit.d.ts +6 -5
- package/dist/eval-runtime/judges/rubric-kit.js +9 -18
- package/dist/eval-runtime/judges/rubric-prompt.d.ts +2 -1
- package/dist/eval-runtime/judges/rubric-prompt.js +10 -12
- package/dist/eval-runtime/judges/rubric-readings.d.ts +13 -0
- package/dist/eval-runtime/judges/rubric-readings.js +44 -0
- package/dist/eval-runtime/resources/mcp-config.d.ts +48 -0
- package/dist/eval-runtime/resources/mcp-config.js +91 -0
- package/dist/eval-runtime/resources/mock-interception.d.ts +65 -0
- package/dist/eval-runtime/resources/mock-interception.js +110 -0
- package/dist/eval-runtime/resources/tool-policy.js +67 -0
- package/dist/eval-runtime/resources/workspace.d.ts +49 -0
- package/dist/eval-runtime/resources/workspace.js +85 -0
- package/dist/eval-runtime/series.js +3 -2
- package/dist/eval-runtime/traces/source-neutral.js +1 -1
- package/dist/eval-workflows/artifact-store/node-run-store.js +20 -15
- package/dist/eval-workflows/artifact-store/overlay-store.js +12 -10
- package/dist/eval-workflows/artifact-store/run-id.js +19 -0
- package/dist/eval-workflows/gold/dataset.js +15 -1
- package/dist/eval-workflows/gold/human.js +1 -1
- package/dist/eval-workflows/hosts/adapters/codex/cli.d.ts +1 -1
- package/dist/eval-workflows/hosts/adapters/codex/cli.js +19 -22
- package/dist/eval-workflows/hosts/adapters/codex/environment.d.ts +1 -2
- package/dist/eval-workflows/hosts/adapters/codex/environment.js +1 -1
- package/dist/eval-workflows/hosts/adapters/codex/reference-evaluator.d.ts +7 -0
- package/dist/eval-workflows/hosts/adapters/codex/reference-evaluator.js +48 -0
- package/dist/eval-workflows/hosts/adapters/codex/reference-executor.d.ts +23 -3
- package/dist/eval-workflows/hosts/adapters/codex/reference-executor.js +83 -56
- package/dist/eval-workflows/hosts/adapters/codex/reference-model.d.ts +3 -0
- package/dist/eval-workflows/hosts/adapters/codex/reference-model.js +37 -0
- package/dist/eval-workflows/hosts/adapters/codex/resources.js +3 -2
- package/dist/eval-workflows/hosts/adapters/codex/sdk-runtime.js +6 -32
- package/dist/eval-workflows/hosts/adapters/codex/sdk.d.ts +1 -1
- package/dist/eval-workflows/hosts/adapters/codex/sdk.js +19 -22
- package/dist/eval-workflows/hosts/adapters/custom/executor.js +13 -23
- package/dist/eval-workflows/hosts/adapters/openai/api.js +13 -7
- package/dist/eval-workflows/hosts/adapters/shared/classified-environment.js +2 -1
- package/dist/eval-workflows/hosts/adapters/shared/content-identity.d.ts +12 -0
- package/dist/eval-workflows/hosts/adapters/shared/content-identity.js +38 -3
- package/dist/eval-workflows/hosts/adapters/shared/stateless-api-resources.js +3 -2
- package/dist/eval-workflows/hosts/adapters/shared/trial-lifecycle.d.ts +44 -0
- package/dist/eval-workflows/hosts/adapters/shared/trial-lifecycle.js +41 -0
- package/dist/eval-workflows/hosts/application.d.ts +4 -10
- package/dist/eval-workflows/hosts/application.js +4 -19
- package/dist/eval-workflows/hosts/carrier-measurement.d.ts +18 -0
- package/dist/eval-workflows/hosts/carrier-measurement.js +249 -0
- package/dist/eval-workflows/hosts/composition/assembly.js +1 -3
- package/dist/eval-workflows/hosts/composition/evolution-evaluation.js +0 -1
- package/dist/eval-workflows/hosts/composition/judge-provider-identity.d.ts +2 -1
- package/dist/eval-workflows/hosts/composition/judge-provider-identity.js +8 -2
- package/dist/eval-workflows/hosts/composition/node-preflight.js +2 -2
- package/dist/eval-workflows/hosts/composition/node-runtime.d.ts +1 -1
- package/dist/eval-workflows/hosts/composition/node-runtime.js +17 -33
- package/dist/eval-workflows/hosts/composition/preflight.js +1 -3
- package/dist/eval-workflows/hosts/composition/registered-runtime.d.ts +1 -1
- package/dist/eval-workflows/hosts/composition/runtime-registry.d.ts +1 -13
- package/dist/eval-workflows/hosts/composition/runtime-registry.js +2 -17
- package/dist/eval-workflows/hosts/composition/runtime.d.ts +3 -3
- package/dist/eval-workflows/hosts/composition/runtime.js +5 -4
- package/dist/eval-workflows/hosts/input-resolution/content-materialization.d.ts +27 -0
- package/dist/eval-workflows/hosts/input-resolution/content-materialization.js +85 -0
- package/dist/eval-workflows/hosts/input-resolution/node-cli-evaluation-resolver.js +29 -758
- package/dist/eval-workflows/hosts/input-resolution/resolution-artifacts.d.ts +21 -0
- package/dist/eval-workflows/hosts/input-resolution/resolution-artifacts.js +187 -0
- package/dist/eval-workflows/hosts/input-resolution/resolution-execution.d.ts +16 -0
- package/dist/eval-workflows/hosts/input-resolution/resolution-execution.js +201 -0
- package/dist/eval-workflows/hosts/input-resolution/resolution-resources.d.ts +29 -0
- package/dist/eval-workflows/hosts/input-resolution/resolution-resources.js +193 -0
- package/dist/eval-workflows/hosts/input-resolution/resolution-samples.d.ts +22 -0
- package/dist/eval-workflows/hosts/input-resolution/resolution-samples.js +130 -0
- package/dist/eval-workflows/hosts/local-task/acceptance.d.ts +13 -0
- package/dist/eval-workflows/hosts/local-task/acceptance.js +101 -0
- package/dist/eval-workflows/hosts/local-task/application.d.ts +99 -0
- package/dist/eval-workflows/hosts/local-task/application.js +177 -0
- package/dist/eval-workflows/hosts/local-task/diagnostics.d.ts +27 -0
- package/dist/eval-workflows/hosts/local-task/diagnostics.js +30 -0
- package/dist/eval-workflows/hosts/local-task/executor.d.ts +19 -0
- package/dist/eval-workflows/hosts/local-task/executor.js +135 -0
- package/dist/eval-workflows/hosts/local-task/files.d.ts +15 -0
- package/dist/eval-workflows/hosts/local-task/files.js +88 -0
- package/dist/eval-workflows/hosts/local-task/workspace.d.ts +6 -0
- package/dist/eval-workflows/hosts/local-task/workspace.js +32 -0
- package/dist/eval-workflows/hosts/node-environment.d.ts +3 -0
- package/dist/eval-workflows/hosts/node-environment.js +94 -0
- package/dist/eval-workflows/hosts/reference-executors.d.ts +1 -0
- package/dist/eval-workflows/hosts/reference-executors.js +1 -0
- package/dist/eval-workflows/hosts/resource-leases/access.js +1 -3
- package/dist/eval-workflows/hosts/resource-leases/node.js +1 -3
- package/dist/eval-workflows/hosts/resource-leases/types.d.ts +1 -1
- package/dist/eval-workflows/hosts/resource-leases/types.js +1 -1
- package/dist/eval-workflows/input-compilation/compile/binding.d.ts +3 -0
- package/dist/eval-workflows/input-compilation/compile/binding.js +190 -0
- package/dist/eval-workflows/input-compilation/compile/definition.d.ts +3 -0
- package/dist/eval-workflows/input-compilation/compile/definition.js +280 -0
- package/dist/eval-workflows/input-compilation/compile/policy.d.ts +4 -0
- package/dist/eval-workflows/input-compilation/compile/policy.js +155 -0
- package/dist/eval-workflows/input-compilation/compile/resources.d.ts +7 -0
- package/dist/eval-workflows/input-compilation/compile/resources.js +346 -0
- package/dist/eval-workflows/input-compilation/compile/values.d.ts +5 -0
- package/dist/eval-workflows/input-compilation/compile/values.js +95 -0
- package/dist/eval-workflows/input-compilation/compile.js +9 -1058
- package/dist/eval-workflows/input-compilation/parse.js +0 -6
- package/dist/eval-workflows/input-compilation/registry.d.ts +1 -1
- package/dist/eval-workflows/input-compilation/registry.js +0 -3
- package/dist/eval-workflows/input-compilation/types.d.ts +3 -4
- package/dist/eval-workflows/input-compilation/types.js +2 -2
- package/dist/eval-workflows/inputs/contracts/config-schema.js +4 -4
- package/dist/eval-workflows/inputs/contracts/local-task-evidence.d.ts +46 -0
- package/dist/eval-workflows/inputs/contracts/local-task-evidence.js +26 -0
- package/dist/eval-workflows/inputs/contracts/local-task.d.ts +50 -0
- package/dist/eval-workflows/inputs/contracts/local-task.js +33 -0
- package/dist/eval-workflows/inputs/contracts/sample.d.ts +2 -2
- package/dist/eval-workflows/inputs/contracts/variant.d.ts +1 -1
- package/dist/eval-workflows/inputs/eval-samples.d.ts +0 -4
- package/dist/eval-workflows/inputs/eval-samples.js +0 -11
- package/dist/eval-workflows/inputs/sample-contract.js +3 -10
- package/dist/eval-workflows/instruments/contracts/config.d.ts +1 -1
- package/dist/eval-workflows/instruments/prompts/judge-prompts.d.ts +1 -1
- package/dist/eval-workflows/instruments/prompts/judge-prompts.js +7 -1
- package/dist/eval-workflows/measurement/analysis/agreement-source-pairs.js +3 -26
- package/dist/eval-workflows/measurement/analysis/agreement-table.js +1 -1
- package/dist/eval-workflows/measurement/analysis/analysis-support.d.ts +0 -1
- package/dist/eval-workflows/measurement/analysis/analysis-support.js +0 -3
- package/dist/eval-workflows/measurement/analysis/assertion-layer-node.js +2 -1
- package/dist/eval-workflows/measurement/analysis/assertion-layer-parameters.d.ts +3 -3
- package/dist/eval-workflows/measurement/analysis/assertion-layer-parameters.js +2 -1
- package/dist/eval-workflows/measurement/analysis/assertion-layer.d.ts +9 -9
- package/dist/eval-workflows/measurement/analysis/assertion-layer.js +2 -1
- package/dist/eval-workflows/measurement/analysis/bootstrap-family-parameters.js +3 -2
- package/dist/eval-workflows/measurement/analysis/bootstrap-family-table-v2.d.ts +1 -1
- package/dist/eval-workflows/measurement/analysis/bootstrap-family-table-v2.js +1 -1
- package/dist/eval-workflows/measurement/analysis/bootstrap-family-table.js +3 -2
- package/dist/eval-workflows/measurement/analysis/composite-node-contract.d.ts +1 -0
- package/dist/eval-workflows/measurement/analysis/composite-node-contract.js +2 -1
- package/dist/eval-workflows/measurement/analysis/composite-table.js +2 -1
- package/dist/eval-workflows/measurement/analysis/dimension-node.js +2 -1
- package/dist/eval-workflows/measurement/analysis/dimension-parameters.js +2 -1
- package/dist/eval-workflows/measurement/analysis/dimension-table-v1.js +2 -1
- package/dist/eval-workflows/measurement/analysis/dimension-table.js +2 -1
- package/dist/eval-workflows/measurement/analysis/judge-aggregation.js +2 -1
- package/dist/eval-workflows/measurement/analysis/release-decision-parameters.js +2 -1
- package/dist/eval-workflows/measurement/analysis/release-decision.js +2 -1
- package/dist/eval-workflows/orchestration/artifact-graph-persistence.js +3 -2
- package/dist/eval-workflows/orchestration/evaluation-service.d.ts +2 -0
- package/dist/eval-workflows/orchestration/evaluation-service.js +9 -5
- package/dist/eval-workflows/orchestration/measurement-design.js +44 -22
- package/dist/eval-workflows/orchestration/orchestration.d.ts +2 -2
- package/dist/eval-workflows/orchestration/orchestration.js +6 -1
- package/dist/eval-workflows/orchestration/sample-content-resolution.js +8 -11
- package/dist/eval-workflows/orchestration/workflow.d.ts +5 -5
- package/dist/eval-workflows/orchestration/workflow.js +6 -6
- package/dist/eval-workflows/projections/artifact-graph.d.ts +1 -1
- package/dist/eval-workflows/projections/artifact-graph.js +1 -1
- package/dist/eval-workflows/projections/carrier-measurement.d.ts +72 -0
- package/dist/eval-workflows/projections/contracts.d.ts +1 -47
- package/dist/eval-workflows/projections/contracts.js +0 -1
- package/dist/eval-workflows/projections/diagnostic.js +4 -6
- package/dist/eval-workflows/projections/evolution.js +2 -1
- package/dist/eval-workflows/projections/index.d.ts +0 -1
- package/dist/eval-workflows/projections/index.js +0 -1
- package/dist/eval-workflows/projections/local-task.d.ts +23 -0
- package/dist/eval-workflows/projections/local-task.js +25 -0
- package/dist/eval-workflows/resume-disposition/contracts.d.ts +80 -0
- package/dist/eval-workflows/resume-disposition/contracts.js +22 -0
- package/dist/eval-workflows/resume-disposition/disposition.d.ts +8 -0
- package/dist/eval-workflows/resume-disposition/disposition.js +176 -0
- package/dist/eval-workflows/resume-disposition/index.d.ts +2 -0
- package/dist/eval-workflows/resume-disposition/index.js +2 -0
- package/dist/eval-workflows/sample-generation/generator.d.ts +1 -1
- package/dist/eval-workflows/sample-generation/generator.js +7 -8
- package/dist/eval-workflows/sample-generation/trace-drafts.d.ts +2 -2
- package/dist/eval-workflows/sample-generation/trace-drafts.js +4 -4
- package/dist/executors/archive.d.ts +3 -0
- package/dist/executors/archive.js +18 -0
- package/dist/executors/contracts/archive.d.ts +23 -0
- package/dist/executors/contracts/mock.d.ts +1 -2
- package/dist/executors/contracts/openai-chat.d.ts +3 -0
- package/dist/executors/contracts/openai-chat.js +16 -0
- package/dist/executors/contracts/ports.d.ts +17 -31
- package/dist/executors/contracts/result.d.ts +11 -0
- package/dist/executors/contracts/token-budget.d.ts +25 -0
- package/dist/executors/contracts/token-budget.js +29 -0
- package/dist/executors/contracts/tool-call-status.d.ts +8 -0
- package/dist/executors/contracts/tool-call-status.js +71 -0
- package/dist/executors/contracts/tool-identity.d.ts +21 -0
- package/dist/executors/contracts/trace-source-kind.d.ts +4 -0
- package/dist/executors/contracts/trace-source-kind.js +5 -0
- package/dist/executors/contracts/trace-source-schema.d.ts +1 -0
- package/dist/executors/contracts/trace-source-schema.js +1 -0
- package/dist/executors/contracts/trace.d.ts +9 -0
- package/dist/executors/core/capabilities.d.ts +5 -1
- package/dist/executors/core/capabilities.js +30 -3
- package/dist/executors/core/diagnostics.d.ts +2 -0
- package/dist/executors/core/diagnostics.js +13 -0
- package/dist/executors/core/http.d.ts +6 -0
- package/dist/executors/core/http.js +46 -1
- package/dist/executors/core/optional-dependencies.js +1 -5
- package/dist/executors/core/registry.d.ts +8 -56
- package/dist/executors/core/registry.js +3 -45
- package/dist/executors/core/runtime-fingerprint.js +0 -27
- package/dist/executors/core/runtime.d.ts +1 -1
- package/dist/executors/core/runtime.js +2 -5
- package/dist/executors/core/subprocess.d.ts +2 -2
- package/dist/executors/core/subprocess.js +36 -16
- package/dist/executors/index.d.ts +7 -4
- package/dist/executors/index.js +13 -19
- package/dist/executors/mock-runtime/runtime.d.ts +5 -85
- package/dist/executors/mock-runtime/runtime.js +77 -335
- package/dist/executors/openai/api.d.ts +4 -1
- package/dist/executors/openai/api.js +115 -82
- package/dist/executors/openai/archive.d.ts +10 -0
- package/dist/executors/openai/archive.js +70 -0
- package/dist/executors/openai/codex/archive.d.ts +8 -0
- package/dist/executors/openai/codex/archive.js +231 -0
- package/dist/executors/openai/codex/cli-arguments.d.ts +1 -0
- package/dist/executors/openai/codex/cli-arguments.js +1 -0
- package/dist/executors/openai/codex/cli.d.ts +4 -6
- package/dist/executors/openai/codex/cli.js +77 -42
- package/dist/executors/openai/codex/config.d.ts +16 -0
- package/dist/executors/openai/codex/config.js +37 -0
- package/dist/executors/openai/codex/protocol.d.ts +4 -1
- package/dist/executors/openai/codex/protocol.js +12 -4
- package/dist/executors/openai/codex/sdk.d.ts +4 -6
- package/dist/executors/openai/codex/sdk.js +12 -9
- package/dist/executors/openai/codex/trace.js +2 -4
- package/dist/executors/openai/request.d.ts +14 -0
- package/dist/executors/openai/request.js +8 -0
- package/dist/executors/result-validation.js +21 -3
- package/dist/executors/script/index.d.ts +1 -1
- package/dist/executors/script/index.js +14 -17
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/knowledge/adapters/association-migration.d.ts +41 -0
- package/dist/knowledge/adapters/association-migration.js +205 -0
- package/dist/knowledge/adapters/association-store.d.ts +21 -0
- package/dist/knowledge/adapters/association-store.js +111 -0
- package/dist/knowledge/adapters/body-digest.d.ts +5 -0
- package/dist/knowledge/adapters/body-digest.js +20 -0
- package/dist/knowledge/adapters/conversation-source.d.ts +30 -0
- package/dist/knowledge/adapters/conversation-source.js +82 -0
- package/dist/knowledge/adapters/durable-publication.d.ts +6 -0
- package/dist/knowledge/adapters/durable-publication.js +118 -0
- package/dist/knowledge/adapters/entity-link-api-producer.d.ts +31 -0
- package/dist/knowledge/adapters/entity-link-api-producer.js +27 -0
- package/dist/knowledge/adapters/entity-link-executor.d.ts +51 -0
- package/dist/knowledge/adapters/entity-link-executor.js +70 -0
- package/dist/knowledge/adapters/entity-link-store.d.ts +20 -0
- package/dist/knowledge/adapters/entity-link-store.js +131 -0
- package/dist/knowledge/adapters/entity-store.d.ts +14 -0
- package/dist/knowledge/adapters/entity-store.js +94 -0
- package/dist/knowledge/adapters/generation-executor.d.ts +14 -0
- package/dist/knowledge/adapters/generation-executor.js +65 -0
- package/dist/knowledge/adapters/generation-host.d.ts +11 -0
- package/dist/knowledge/adapters/generation-host.js +36 -0
- package/dist/knowledge/adapters/generation-journal-store.d.ts +25 -0
- package/dist/knowledge/adapters/generation-journal-store.js +470 -0
- package/dist/knowledge/adapters/knowledge-migration.d.ts +65 -0
- package/dist/knowledge/adapters/knowledge-migration.js +258 -0
- package/dist/knowledge/adapters/knowledge-store.d.ts +16 -0
- package/dist/knowledge/adapters/knowledge-store.js +88 -0
- package/dist/knowledge/adapters/knowledge-tags.d.ts +13 -0
- package/dist/knowledge/adapters/knowledge-tags.js +70 -0
- package/dist/knowledge/adapters/library-store.d.ts +14 -0
- package/dist/knowledge/adapters/library-store.js +95 -0
- package/dist/knowledge/adapters/project-source-reader.d.ts +36 -0
- package/dist/knowledge/adapters/project-source-reader.js +269 -0
- package/dist/knowledge/adapters/relation-store.d.ts +17 -0
- package/dist/knowledge/adapters/relation-store.js +164 -0
- package/dist/knowledge/adapters/review-store.d.ts +16 -0
- package/dist/knowledge/adapters/review-store.js +89 -0
- package/dist/knowledge/adapters/run-store.d.ts +45 -0
- package/dist/knowledge/adapters/run-store.js +684 -0
- package/dist/knowledge/adapters/source-migration.d.ts +102 -0
- package/dist/knowledge/adapters/source-migration.js +774 -0
- package/dist/knowledge/adapters/source-review-original.d.ts +8 -0
- package/dist/knowledge/adapters/source-review-original.js +24 -0
- package/dist/knowledge/adapters/source-review-store.d.ts +16 -0
- package/dist/knowledge/adapters/source-review-store.js +134 -0
- package/dist/knowledge/adapters/source-store.d.ts +29 -0
- package/dist/knowledge/adapters/source-store.js +348 -0
- package/dist/knowledge/adapters/source-workspace.d.ts +2 -0
- package/dist/knowledge/adapters/source-workspace.js +15 -0
- package/dist/knowledge/adapters/storage-state.d.ts +1 -0
- package/dist/knowledge/adapters/storage-state.js +9 -0
- package/dist/knowledge/adapters/trace-evidence.d.ts +14 -0
- package/dist/knowledge/adapters/trace-evidence.js +174 -0
- package/dist/knowledge/adapters/trace-source-reader.d.ts +55 -0
- package/dist/knowledge/adapters/trace-source-reader.js +252 -0
- package/dist/knowledge/adapters/workflow-migration.d.ts +70 -0
- package/dist/knowledge/adapters/workflow-migration.js +444 -0
- package/dist/knowledge/adapters/workspace-guard.d.ts +44 -0
- package/dist/knowledge/adapters/workspace-guard.js +230 -0
- package/dist/knowledge/application/application.d.ts +10349 -0
- package/dist/knowledge/application/application.js +198 -0
- package/dist/knowledge/application/auto-extraction.d.ts +43 -0
- package/dist/knowledge/application/auto-extraction.js +51 -0
- package/dist/knowledge/application/body-generation.d.ts +5403 -0
- package/dist/knowledge/application/body-generation.js +624 -0
- package/dist/knowledge/application/entity-catalog.d.ts +86 -0
- package/dist/knowledge/application/entity-catalog.js +25 -0
- package/dist/knowledge/application/entity-link-source.d.ts +585 -0
- package/dist/knowledge/application/entity-link-source.js +27 -0
- package/dist/knowledge/application/entity-links.d.ts +3567 -0
- package/dist/knowledge/application/entity-links.js +422 -0
- package/dist/knowledge/application/graph.d.ts +184 -0
- package/dist/knowledge/application/graph.js +364 -0
- package/dist/knowledge/application/library.d.ts +520 -0
- package/dist/knowledge/application/library.js +258 -0
- package/dist/knowledge/application/local-source-host.d.ts +51 -0
- package/dist/knowledge/application/local-source-host.js +99 -0
- package/dist/knowledge/application/local-source-updates.d.ts +4 -0
- package/dist/knowledge/application/local-source-updates.js +197 -0
- package/dist/knowledge/application/local.d.ts +202 -0
- package/dist/knowledge/application/local.js +159 -0
- package/dist/knowledge/application/operations.d.ts +788 -0
- package/dist/knowledge/application/operations.js +157 -0
- package/dist/knowledge/application/read-context.d.ts +2508 -0
- package/dist/knowledge/application/read-context.js +294 -0
- package/dist/knowledge/application/relation-operations.d.ts +702 -0
- package/dist/knowledge/application/relation-operations.js +45 -0
- package/dist/knowledge/application/relations.d.ts +743 -0
- package/dist/knowledge/application/relations.js +142 -0
- package/dist/knowledge/application/retrieval-text.d.ts +5 -0
- package/dist/knowledge/application/retrieval-text.js +45 -0
- package/dist/knowledge/application/retrieval.d.ts +108 -0
- package/dist/knowledge/application/retrieval.js +195 -0
- package/dist/knowledge/application/review-operations.d.ts +650 -0
- package/dist/knowledge/application/review-operations.js +33 -0
- package/dist/knowledge/application/review.d.ts +394 -0
- package/dist/knowledge/application/review.js +114 -0
- package/dist/knowledge/application/source-capture.d.ts +355 -0
- package/dist/knowledge/application/source-capture.js +261 -0
- package/dist/knowledge/application/source-evidence-search.d.ts +37 -0
- package/dist/knowledge/application/source-evidence-search.js +129 -0
- package/dist/knowledge/application/source-review.d.ts +886 -0
- package/dist/knowledge/application/source-review.js +135 -0
- package/dist/knowledge/application/source-summary.d.ts +130 -0
- package/dist/knowledge/application/source-summary.js +11 -0
- package/dist/knowledge/application/source-updates.d.ts +583 -0
- package/dist/knowledge/application/source-updates.js +208 -0
- package/dist/knowledge/artifacts/authoring/application.d.ts +125 -0
- package/dist/knowledge/artifacts/authoring/application.js +83 -0
- package/dist/knowledge/artifacts/authoring/carrier-contracts.d.ts +98 -0
- package/dist/knowledge/artifacts/authoring/carrier-library.d.ts +19 -0
- package/dist/knowledge/artifacts/authoring/carrier-library.js +167 -0
- package/dist/knowledge/artifacts/authoring/core-evolver.d.ts +65 -0
- package/dist/knowledge/artifacts/authoring/core-evolver.js +313 -0
- package/dist/knowledge/artifacts/authoring/knowledge-content.d.ts +17 -0
- package/dist/knowledge/artifacts/authoring/knowledge-content.js +139 -0
- package/dist/knowledge/artifacts/authoring/knowledge-review.d.ts +9 -0
- package/dist/knowledge/artifacts/authoring/knowledge-review.js +39 -0
- package/dist/knowledge/artifacts/authoring/scaffold.js +109 -0
- package/dist/knowledge/artifacts/authoring/text-edits.d.ts +6 -0
- package/dist/knowledge/artifacts/authoring/text-edits.js +31 -0
- package/dist/knowledge/artifacts/doctor/contracts.d.ts +201 -0
- package/dist/knowledge/artifacts/doctor/endpoint-rule.js +382 -0
- package/dist/knowledge/artifacts/doctor/fixer.js +338 -0
- package/dist/knowledge/artifacts/doctor/graph.d.ts +22 -0
- package/dist/knowledge/artifacts/doctor/graph.js +570 -0
- package/dist/knowledge/artifacts/doctor/health/composer.d.ts +18 -0
- package/dist/knowledge/artifacts/doctor/health/composer.js +411 -0
- package/dist/knowledge/artifacts/doctor/index.js +277 -0
- package/dist/knowledge/artifacts/doctor/messages.d.ts +20 -0
- package/dist/knowledge/artifacts/doctor/messages.js +224 -0
- package/dist/knowledge/artifacts/doctor/persistence.js +126 -0
- package/dist/knowledge/artifacts/doctor/renderer.d.ts +17 -0
- package/dist/knowledge/artifacts/doctor/report-parser.js +103 -0
- package/dist/knowledge/artifacts/doctor/rules.d.ts +32 -0
- package/dist/knowledge/artifacts/doctor/rules.js +290 -0
- package/dist/knowledge/artifacts/sources/artifact-resolution.d.ts +180 -0
- package/dist/knowledge/artifacts/sources/artifact-resolution.js +804 -0
- package/dist/knowledge/artifacts/sources/content-hash.js +117 -0
- package/dist/knowledge/artifacts/sources/deploy-artifact.js +65 -0
- package/dist/knowledge/artifacts/sources/install-source.d.ts +27 -0
- package/dist/knowledge/artifacts/sources/install-source.js +116 -0
- package/dist/knowledge/artifacts/sources/materialize-copy.d.ts +37 -0
- package/dist/knowledge/artifacts/sources/materialize-copy.js +193 -0
- package/dist/knowledge/associations.d.ts +350 -0
- package/dist/knowledge/associations.js +160 -0
- package/dist/knowledge/contracts.d.ts +237 -0
- package/dist/knowledge/contracts.js +65 -0
- package/dist/knowledge/entities/association-references.d.ts +5 -0
- package/dist/knowledge/entities/association-references.js +17 -0
- package/dist/knowledge/entities/contracts.d.ts +331 -0
- package/dist/knowledge/entities/contracts.js +50 -0
- package/dist/knowledge/entities/history.d.ts +4 -0
- package/dist/knowledge/entities/history.js +63 -0
- package/dist/knowledge/entities/identity.d.ts +53 -0
- package/dist/knowledge/entities/identity.js +106 -0
- package/dist/knowledge/entities/link-invocation-state.d.ts +375 -0
- package/dist/knowledge/entities/link-invocation-state.js +316 -0
- package/dist/knowledge/entities/link-invocation.d.ts +2320 -0
- package/dist/knowledge/entities/link-invocation.js +113 -0
- package/dist/knowledge/entities/links.d.ts +72 -0
- package/dist/knowledge/entities/links.js +39 -0
- package/dist/knowledge/entities/validation.d.ts +10 -0
- package/dist/knowledge/entities/validation.js +72 -0
- package/dist/knowledge/entity-library/contracts.d.ts +161 -0
- package/dist/knowledge/entity-library/contracts.js +38 -0
- package/dist/knowledge/entity-library/history.d.ts +3 -0
- package/dist/knowledge/entity-library/history.js +51 -0
- package/dist/knowledge/entity-library/write-errors.d.ts +8 -0
- package/dist/knowledge/entity-library/write-errors.js +11 -0
- package/dist/knowledge/entity-linking/entity-link-hash.d.ts +3 -0
- package/dist/knowledge/entity-linking/entity-link-hash.js +4 -0
- package/dist/knowledge/entity-linking/entity-link-prompt.d.ts +21 -0
- package/dist/knowledge/entity-linking/entity-link-prompt.js +35 -0
- package/dist/knowledge/entity-linking/entity-link-quality.d.ts +111 -0
- package/dist/knowledge/entity-linking/entity-link-quality.js +139 -0
- package/dist/knowledge/extraction/association-catalog.d.ts +15 -0
- package/dist/knowledge/extraction/association-catalog.js +53 -0
- package/dist/knowledge/extraction/body-generation-wire.d.ts +177 -0
- package/dist/knowledge/extraction/body-generation-wire.js +250 -0
- package/dist/knowledge/extraction/entities.d.ts +66 -0
- package/dist/knowledge/extraction/entities.js +124 -0
- package/dist/knowledge/extraction/entity-only-prompt.d.ts +9 -0
- package/dist/knowledge/extraction/entity-only-prompt.js +50 -0
- package/dist/knowledge/extraction/evidence.d.ts +61 -0
- package/dist/knowledge/extraction/evidence.js +24 -0
- package/dist/knowledge/extraction/generation-journal.d.ts +1290 -0
- package/dist/knowledge/extraction/generation-journal.js +48 -0
- package/dist/knowledge/extraction/generation-policy.d.ts +108 -0
- package/dist/knowledge/extraction/generation-policy.js +58 -0
- package/dist/knowledge/extraction/generation.d.ts +74 -0
- package/dist/knowledge/extraction/generation.js +211 -0
- package/dist/knowledge/extraction/knowledge-semantic-policy.d.ts +15 -0
- package/dist/knowledge/extraction/knowledge-semantic-policy.js +31 -0
- package/dist/knowledge/extraction/long-body.d.ts +92 -0
- package/dist/knowledge/extraction/long-body.js +210 -0
- package/dist/knowledge/extraction/model-wire.d.ts +69 -0
- package/dist/knowledge/extraction/model-wire.js +248 -0
- package/dist/knowledge/extraction/native-outcome.d.ts +42 -0
- package/dist/knowledge/extraction/native-outcome.js +152 -0
- package/dist/knowledge/extraction/occurrence-guided-prompt.d.ts +9 -0
- package/dist/knowledge/extraction/occurrence-guided-prompt.js +20 -0
- package/dist/knowledge/extraction/prompt.d.ts +2 -0
- package/dist/knowledge/extraction/prompt.js +42 -0
- package/dist/knowledge/extraction/proposals.d.ts +24 -0
- package/dist/knowledge/extraction/proposals.js +24 -0
- package/dist/knowledge/extraction/quote-context.d.ts +11 -0
- package/dist/knowledge/extraction/quote-context.js +33 -0
- package/dist/knowledge/extraction/quote-occurrence.d.ts +9 -0
- package/dist/knowledge/extraction/quote-occurrence.js +31 -0
- package/dist/knowledge/extraction/run-sealing.d.ts +89 -0
- package/dist/knowledge/extraction/run-sealing.js +42 -0
- package/dist/knowledge/extraction/runs.d.ts +695 -0
- package/dist/knowledge/extraction/runs.js +268 -0
- package/dist/knowledge/extraction/source-input.d.ts +524 -0
- package/dist/knowledge/extraction/source-input.js +61 -0
- package/dist/knowledge/extraction/source-passages.d.ts +63 -0
- package/dist/knowledge/extraction/source-passages.js +94 -0
- package/dist/knowledge/extraction/source-review-input.d.ts +57 -0
- package/dist/knowledge/extraction/source-review-input.js +81 -0
- package/dist/knowledge/extraction/source-review-wire.d.ts +137 -0
- package/dist/knowledge/extraction/source-review-wire.js +248 -0
- package/dist/knowledge/extraction/strict-fewshot.d.ts +1032 -0
- package/dist/knowledge/extraction/strict-fewshot.js +1240 -0
- package/dist/knowledge/extraction/strict-prompt.d.ts +3 -0
- package/dist/knowledge/extraction/strict-prompt.js +18 -0
- package/dist/knowledge/extraction/window-proposals.d.ts +342 -0
- package/dist/knowledge/extraction/window-proposals.js +93 -0
- package/dist/knowledge/extraction/writing-draft.d.ts +6 -0
- package/dist/knowledge/extraction/writing-draft.js +37 -0
- package/dist/knowledge/history.d.ts +4 -0
- package/dist/knowledge/history.js +79 -0
- package/dist/knowledge/measurement/typed-contracts.d.ts +477 -0
- package/dist/knowledge/measurement/typed-contracts.js +88 -0
- package/dist/knowledge/measurement/typed-grounding.d.ts +40 -0
- package/dist/knowledge/measurement/typed-grounding.js +14 -0
- package/dist/knowledge/measurement/typed-quote-locator.d.ts +6 -0
- package/dist/knowledge/measurement/typed-quote-locator.js +8 -0
- package/dist/knowledge/measurement/typed-validation.d.ts +19 -0
- package/dist/knowledge/measurement/typed-validation.js +111 -0
- package/dist/knowledge/migration/associations-v1.d.ts +186 -0
- package/dist/knowledge/migration/associations-v1.js +34 -0
- package/dist/knowledge/migration/legacy-v2.d.ts +242 -0
- package/dist/knowledge/migration/legacy-v2.js +282 -0
- package/dist/knowledge/relations/relation-history.d.ts +96 -0
- package/dist/knowledge/relations/relation-history.js +95 -0
- package/dist/knowledge/relations/relations.d.ts +602 -0
- package/dist/knowledge/relations/relations.js +65 -0
- package/dist/knowledge/reviews/review-history.d.ts +8 -0
- package/dist/knowledge/reviews/review-history.js +86 -0
- package/dist/knowledge/reviews/reviews.d.ts +946 -0
- package/dist/knowledge/reviews/reviews.js +121 -0
- package/dist/knowledge/sources/source-review-history.d.ts +59 -0
- package/dist/knowledge/sources/source-review-history.js +283 -0
- package/dist/knowledge/sources/source-review.d.ts +1725 -0
- package/dist/knowledge/sources/source-review.js +94 -0
- package/dist/knowledge/sources/source-store.d.ts +24 -0
- package/dist/knowledge/sources/sources.d.ts +1882 -0
- package/dist/knowledge/sources/sources.js +278 -0
- package/dist/knowledge/store.d.ts +239 -0
- package/dist/knowledge/store.js +34 -0
- package/dist/knowledge/tags.d.ts +12 -0
- package/dist/knowledge/tags.js +6 -0
- package/dist/knowledge/validation.d.ts +19 -0
- package/dist/knowledge/validation.js +46 -0
- package/dist/mcp/capture-store.d.ts +3 -2
- package/dist/mcp/capture-store.js +7 -5
- package/dist/mcp/feedback-store.d.ts +2 -2
- package/dist/mcp/feedback-store.js +3 -3
- package/dist/mcp/http.js +65 -27
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/mcp-server.d.ts +5 -3
- package/dist/mcp/mcp-server.js +12 -28
- package/dist/mcp/review-component.d.ts +2 -1
- package/dist/mcp/review-component.js +39 -16
- package/dist/mcp/tool-copy.d.ts +25 -0
- package/dist/mcp/tool-copy.js +122 -0
- package/dist/observe/agents/collect.d.ts +105 -0
- package/dist/observe/agents/collect.js +686 -0
- package/dist/observe/agents/contracts.d.ts +369 -0
- package/dist/observe/agents/contracts.js +160 -0
- package/dist/observe/agents/detect.d.ts +39 -0
- package/dist/observe/agents/detect.js +144 -0
- package/dist/observe/agents/fs-ports.d.ts +44 -0
- package/dist/observe/agents/fs-ports.js +77 -0
- package/dist/observe/agents/index.d.ts +19 -0
- package/dist/observe/agents/index.js +13 -0
- package/dist/observe/agents/local-catalog.d.ts +40 -0
- package/dist/observe/agents/local-catalog.js +101 -0
- package/dist/observe/agents/registry.d.ts +31 -0
- package/dist/observe/agents/registry.js +187 -0
- package/dist/observe/agents/scan.d.ts +31 -0
- package/dist/observe/agents/scan.js +160 -0
- package/dist/observe/analysis/coverage-analyzer.js +258 -0
- package/dist/observe/analysis/gap-analyzer.d.ts +110 -0
- package/dist/observe/analysis/gap-analyzer.js +455 -0
- package/dist/observe/analysis/hedging-classifier.js +142 -0
- package/dist/observe/application.d.ts +15 -0
- package/dist/observe/application.js +11 -0
- package/dist/observe/contracts/experience-enums.d.ts +228 -0
- package/dist/observe/contracts/experience-enums.js +228 -0
- package/dist/observe/contracts/experience-evidence-schema.d.ts +33532 -0
- package/dist/observe/contracts/experience-evidence-schema.js +707 -0
- package/dist/observe/contracts/experience.d.ts +79 -0
- package/dist/observe/contracts/inbox.d.ts +181 -0
- package/dist/observe/contracts/skill-chain.d.ts +114 -0
- package/dist/observe/conversation/catalog.d.ts +57 -0
- package/dist/observe/conversation/catalog.js +614 -0
- package/dist/observe/conversation/polling-subscription-hub.js +167 -0
- package/dist/observe/conversation/project.d.ts +3 -0
- package/dist/observe/conversation/project.js +47 -0
- package/dist/observe/diagnosis/contracts/parser.js +181 -0
- package/dist/observe/diagnosis/lifecycle.js +31 -0
- package/dist/observe/diagnosis/observe-mapper.js +265 -0
- package/dist/observe/diagnosis/studio-projection.js +90 -0
- package/dist/observe/experience/primitives.d.ts +14 -0
- package/dist/observe/experience/primitives.js +86 -0
- package/dist/observe/experience/report-assembly.d.ts +33 -0
- package/dist/observe/experience/report-assembly.js +808 -0
- package/dist/observe/experience/report-derivations.js +283 -0
- package/dist/observe/experience/report-structure.d.ts +9 -0
- package/dist/observe/experience/session-story-episodes.d.ts +17 -0
- package/dist/observe/experience/session-story-episodes.js +242 -0
- package/dist/observe/experience/session-story-evidence.d.ts +11 -0
- package/dist/observe/experience/session-story-evidence.js +88 -0
- package/dist/observe/experience/session-story-feedback.d.ts +14 -0
- package/dist/observe/experience/session-story-feedback.js +330 -0
- package/dist/observe/experience/session-story-orchestration.d.ts +13 -0
- package/dist/observe/experience/session-story-orchestration.js +266 -0
- package/dist/observe/experience/session-story-segments.d.ts +8 -0
- package/dist/observe/experience/session-story-segments.js +128 -0
- package/dist/observe/experience/session-story.d.ts +11 -0
- package/dist/observe/experience/session-story.js +302 -0
- package/dist/observe/experience/text-signals.d.ts +6 -0
- package/dist/observe/experience/text-signals.js +29 -0
- package/dist/observe/experience/timeline.d.ts +28 -0
- package/dist/observe/experience/timeline.js +513 -0
- package/dist/observe/experience.d.ts +12 -0
- package/dist/observe/experience.js +7 -0
- package/dist/observe/inbox/diagnosis-producer.d.ts +8 -0
- package/dist/observe/inbox/diagnosis-producer.js +132 -0
- package/dist/observe/inbox/explicit-capture.js +223 -0
- package/dist/observe/inbox/feedback-matchers.d.ts +40 -0
- package/dist/observe/inbox/feedback-matchers.js +260 -0
- package/dist/observe/inbox/index.d.ts +14 -0
- package/dist/observe/inbox/index.js +7 -0
- package/dist/observe/inbox/paths.d.ts +30 -0
- package/dist/observe/inbox/paths.js +87 -0
- package/dist/observe/inbox/problem-patterns.js +249 -0
- package/dist/observe/inbox/report-building.d.ts +18 -0
- package/dist/observe/inbox/report-building.js +595 -0
- package/dist/observe/inbox/report-presentation.d.ts +6 -0
- package/dist/observe/inbox/report-presentation.js +83 -0
- package/dist/observe/inbox/report-primitives.d.ts +17 -0
- package/dist/observe/inbox/report-primitives.js +88 -0
- package/dist/observe/inbox/report-store.d.ts +7 -0
- package/dist/observe/inbox/report-store.js +516 -0
- package/dist/observe/inbox/review-state.d.ts +25 -0
- package/dist/observe/inbox/review-state.js +357 -0
- package/dist/observe/inbox/signal-semantics.d.ts +27 -0
- package/dist/observe/inbox/skill-chains.d.ts +20 -0
- package/dist/observe/inbox/skill-chains.js +65 -0
- package/dist/observe/inbox/source-record-archive.d.ts +9 -0
- package/dist/observe/inbox/source-record-archive.js +311 -0
- package/dist/observe/inbox/view-model.d.ts +30 -0
- package/dist/observe/inbox/view-model.js +140 -0
- package/dist/observe/presentation.d.ts +8 -0
- package/dist/observe/presentation.js +5 -0
- package/dist/observe/skill-health/analyzer.d.ts +128 -0
- package/dist/observe/skill-health/analyzer.js +327 -0
- package/dist/observe/skill-health/experience-frontmatter.js +99 -0
- package/dist/observe/skill-health/persistence.d.ts +10 -0
- package/dist/observe/skill-health/persistence.js +21 -0
- package/dist/observe/skill-health/skill-chain.js +530 -0
- package/dist/observe/soft-standards/constants.d.ts +4 -0
- package/dist/observe/soft-standards/constants.js +9 -0
- package/dist/observe/soft-standards/llm-extractor.js +698 -0
- package/dist/observe/soft-standards/runtime-evaluator.js +384 -0
- package/dist/observe/soft-standards/skill-standards-store.d.ts +10 -0
- package/dist/observe/soft-standards/skill-standards-store.js +230 -0
- package/dist/observe/soft-standards/types.d.ts +213 -0
- package/dist/observe/trace/adapters/claude/record-events.d.ts +4 -0
- package/dist/observe/trace/adapters/claude/record-events.js +297 -0
- package/dist/observe/trace/adapters/claude/record-schema.d.ts +60 -0
- package/dist/observe/trace/adapters/claude/record-schema.js +2 -0
- package/dist/observe/trace/adapters/claude/trace.d.ts +13 -0
- package/dist/observe/trace/adapters/claude/trace.js +48 -0
- package/dist/observe/trace/adapters/codex/context-events.d.ts +4 -0
- package/dist/observe/trace/adapters/codex/context-events.js +166 -0
- package/dist/observe/trace/adapters/codex/conversation-events.d.ts +4 -0
- package/dist/observe/trace/adapters/codex/conversation-events.js +143 -0
- package/dist/observe/trace/adapters/codex/conversion-contract.d.ts +66 -0
- package/dist/observe/trace/adapters/codex/conversion-contract.js +10 -0
- package/dist/observe/trace/adapters/codex/item-views.d.ts +81 -0
- package/dist/observe/trace/adapters/codex/item-views.js +303 -0
- package/dist/observe/trace/adapters/codex/pending-tool-events.d.ts +7 -0
- package/dist/observe/trace/adapters/codex/pending-tool-events.js +100 -0
- package/dist/observe/trace/adapters/codex/record-conversion.d.ts +14 -0
- package/dist/observe/trace/adapters/codex/record-conversion.js +167 -0
- package/dist/observe/trace/adapters/codex/record-fields.d.ts +13 -0
- package/dist/observe/trace/adapters/codex/record-fields.js +35 -0
- package/dist/observe/trace/adapters/codex/record-indexes.d.ts +75 -0
- package/dist/observe/trace/adapters/codex/record-indexes.js +309 -0
- package/dist/observe/trace/adapters/codex/record-text.d.ts +8 -0
- package/dist/observe/trace/adapters/codex/record-text.js +52 -0
- package/dist/observe/trace/adapters/codex/tool-event-factory.d.ts +16 -0
- package/dist/observe/trace/adapters/codex/tool-event-factory.js +20 -0
- package/dist/observe/trace/adapters/codex/tool-events.d.ts +4 -0
- package/dist/observe/trace/adapters/codex/tool-events.js +183 -0
- package/dist/observe/trace/adapters/codex/tool-status.js +114 -0
- package/dist/observe/trace/adapters/codex/trace.d.ts +9 -0
- package/dist/observe/trace/adapters/codex/trace.js +123 -0
- package/dist/observe/trace/adapters/codex/turn-events.d.ts +4 -0
- package/dist/observe/trace/adapters/codex/turn-events.js +126 -0
- package/dist/observe/trace/adapters/dsh/trace.d.ts +17 -0
- package/dist/observe/trace/adapters/dsh/trace.js +352 -0
- package/dist/observe/trace/adapters/jsonl-records.d.ts +6 -0
- package/dist/observe/trace/adapters/jsonl-records.js +67 -0
- package/dist/observe/trace/adapters/markdown/trace.d.ts +8 -0
- package/dist/observe/trace/adapters/markdown/trace.js +132 -0
- package/dist/observe/trace/adapters/openclaw/record-events.d.ts +10 -0
- package/dist/observe/trace/adapters/openclaw/record-events.js +192 -0
- package/dist/observe/trace/adapters/openclaw/trace.d.ts +9 -0
- package/dist/observe/trace/adapters/openclaw/trace.js +129 -0
- package/dist/observe/trace/adapters/qoder/trace.d.ts +8 -0
- package/dist/observe/trace/adapters/qoder/trace.js +477 -0
- package/dist/observe/trace/segmentation.js +491 -0
- package/dist/observe/trace/source.d.ts +64 -0
- package/dist/observe/trace/source.js +592 -0
- package/dist/observe/trace/streamed-records.d.ts +16 -0
- package/dist/observe/trace/streamed-records.js +228 -0
- package/dist/observe/trace/tool-search.js +160 -0
- package/dist/observe/trace/trace-ir.d.ts +236 -0
- package/dist/observe/trace/trace-ir.js +147 -0
- package/dist/observe/trace/unknown-disposition.d.ts +36 -0
- package/dist/observe/trace/unknown-disposition.js +233 -0
- package/dist/observe/trace/zstd-frames.d.ts +18 -0
- package/dist/observe/trace/zstd-frames.js +167 -0
- package/dist/observe/view-models/conversation.d.ts +57 -0
- package/dist/observe/view-models/index.d.ts +8 -0
- package/dist/settings/user-settings.d.ts +43 -0
- package/dist/settings/user-settings.js +59 -0
- package/dist/shared/content-hash.d.ts +5 -1
- package/dist/shared/content-hash.js +6 -2
- package/dist/shared/file-lock.d.ts +6 -0
- package/dist/shared/file-lock.js +53 -22
- package/dist/shared/language-preference.d.ts +36 -0
- package/dist/shared/language-preference.js +48 -0
- package/dist/shared/llm-json.d.ts +2 -0
- package/dist/shared/llm-json.js +36 -0
- package/dist/storage/atomic-text.d.ts +4 -0
- package/dist/storage/atomic-text.js +71 -0
- package/dist/storage/default-dirs.d.ts +26 -0
- package/dist/storage/default-dirs.js +27 -0
- package/dist/storage/directories.d.ts +18 -0
- package/dist/storage/directories.js +60 -0
- package/dist/storage/discovery-index.d.ts +86 -0
- package/dist/storage/discovery-index.js +297 -0
- package/dist/storage/file-names.d.ts +13 -0
- package/dist/storage/file-names.js +54 -0
- package/dist/storage/layout.d.ts +39 -0
- package/dist/storage/layout.js +52 -0
- package/dist/storage/report-bundle.js +120 -0
- package/dist/studio/application/agents/agents-view.d.ts +34 -0
- package/dist/studio/application/agents/agents-view.js +36 -0
- package/dist/studio/application/conversations/conversation-activity.d.ts +4 -0
- package/dist/studio/application/conversations/conversation-extraction.d.ts +1 -0
- package/dist/studio/application/conversations/conversation-extraction.js +1 -0
- package/dist/studio/application/conversations/conversation-reader.d.ts +7 -0
- package/dist/studio/application/conversations/conversation-reader.js +26 -0
- package/dist/studio/application/conversations/list-states.d.ts +11 -0
- package/dist/studio/application/conversations/list-states.js +9 -0
- package/dist/studio/application/conversations/reader-states.d.ts +14 -0
- package/dist/studio/application/conversations/reader-states.js +17 -0
- package/dist/studio/application/conversations/reader-viewport.d.ts +36 -0
- package/dist/studio/application/conversations/reader-viewport.js +35 -0
- package/dist/studio/application/conversations/replay/format.d.ts +7 -0
- package/dist/studio/application/conversations/replay/format.js +39 -0
- package/dist/studio/application/conversations/replay/layout.d.ts +15 -0
- package/dist/studio/application/conversations/replay/layout.js +171 -0
- package/dist/studio/application/conversations/replay/projection.d.ts +4 -0
- package/dist/studio/application/conversations/replay/projection.js +292 -0
- package/dist/studio/application/conversations/replay/routing.d.ts +3 -0
- package/dist/studio/application/conversations/replay/summary.d.ts +25 -0
- package/dist/studio/application/conversations/sidebar-window.d.ts +24 -0
- package/dist/studio/application/conversations/sidebar-window.js +26 -0
- package/dist/studio/application/conversations/trajectory-evidence.d.ts +3 -0
- package/dist/studio/application/directory-sources.d.ts +47 -0
- package/dist/studio/application/directory-sources.js +44 -0
- package/dist/studio/application/display/conversation-label.d.ts +13 -0
- package/dist/studio/application/display/conversation-label.js +30 -0
- package/dist/studio/application/display/format.d.ts +40 -0
- package/dist/studio/application/display/format.js +101 -0
- package/dist/studio/application/display/tone.d.ts +10 -0
- package/dist/studio/application/display/tone.js +10 -0
- package/dist/studio/application/knowledge/artifact-authoring.d.ts +41 -0
- package/dist/studio/application/knowledge/artifact-authoring.js +16 -0
- package/dist/studio/application/knowledge/auto-extraction.d.ts +4 -0
- package/dist/studio/application/knowledge/auto-extraction.js +23 -0
- package/dist/studio/application/knowledge/candidate-review.d.ts +5 -0
- package/dist/studio/application/knowledge/candidate-review.js +20 -0
- package/dist/studio/application/knowledge/candidate-status.d.ts +9 -0
- package/dist/studio/application/knowledge/candidate-status.js +19 -0
- package/dist/studio/application/knowledge/doctor-format.d.ts +84 -0
- package/dist/studio/application/knowledge/doctor-format.js +115 -0
- package/dist/studio/application/knowledge/entity-links.d.ts +14 -0
- package/dist/studio/application/knowledge/entity-links.js +178 -0
- package/dist/studio/application/knowledge/knowledge-candidates.d.ts +3 -0
- package/dist/studio/application/knowledge/knowledge-candidates.js +226 -0
- package/dist/studio/application/knowledge/knowledge-library.d.ts +424 -0
- package/dist/studio/application/knowledge/knowledge-library.js +24 -0
- package/dist/studio/application/knowledge/knowledge-query.d.ts +30 -0
- package/dist/studio/application/knowledge/knowledge-query.js +30 -0
- package/dist/studio/application/knowledge/knowledge-relations.d.ts +471 -0
- package/dist/studio/application/knowledge/knowledge-relations.js +14 -0
- package/dist/studio/application/knowledge/knowledge-reports.d.ts +17 -0
- package/dist/studio/application/knowledge/knowledge-reports.js +231 -0
- package/dist/studio/application/knowledge/knowledge-reviews.d.ts +356 -0
- package/dist/studio/application/knowledge/knowledge-reviews.js +15 -0
- package/dist/studio/application/knowledge/library-view.d.ts +23 -0
- package/dist/studio/application/knowledge/library-view.js +7 -0
- package/dist/studio/application/knowledge/skill-health.d.ts +11 -0
- package/dist/studio/application/knowledge/skill-health.js +50 -0
- package/dist/studio/application/knowledge/skill-index.d.ts +27 -0
- package/dist/studio/application/knowledge/skill-index.js +359 -0
- package/dist/studio/application/knowledge/skill-insights.d.ts +3 -0
- package/dist/studio/application/knowledge/skill-insights.js +284 -0
- package/dist/studio/application/knowledge/source-picker.d.ts +368 -0
- package/dist/studio/application/knowledge/source-picker.js +54 -0
- package/dist/studio/application/knowledge/source-view.d.ts +4 -0
- package/dist/studio/application/knowledge/source-view.js +8 -0
- package/dist/studio/application/measure/carrier-measurement.d.ts +20 -0
- package/dist/studio/application/measure/carrier-measurement.js +51 -0
- package/dist/studio/application/measure/core-run-catalog.d.ts +3 -0
- package/dist/studio/application/measure/core-run-format.d.ts +33 -0
- package/dist/studio/application/measure/core-run-format.js +164 -0
- package/dist/studio/application/measure/core-run-projection.d.ts +6 -0
- package/dist/studio/application/measure/core-run-projection.js +320 -0
- package/dist/studio/application/observe/health-format.d.ts +158 -0
- package/dist/studio/application/observe/health-format.js +239 -0
- package/dist/studio/application/settings/settings.d.ts +35 -0
- package/dist/studio/application/settings/settings.js +13 -0
- package/dist/studio/http/contracts.d.ts +29 -6
- package/dist/studio/http/errors.d.ts +1 -1
- package/dist/studio/http/errors.js +8 -1
- package/dist/studio/http/language.d.ts +10 -0
- package/dist/studio/http/language.js +18 -0
- package/dist/studio/http/next-context.d.ts +13 -9
- package/dist/studio/http/next-context.js +4 -2
- package/dist/studio/http/next-server.d.ts +1 -1
- package/dist/studio/http/next-server.js +88 -101
- package/dist/studio/http/page-fault.d.ts +3 -0
- package/dist/studio/http/page-fault.js +23 -0
- package/dist/studio/http/page-params.d.ts +32 -0
- package/dist/studio/http/page-params.js +32 -0
- package/dist/studio/http/page-paths.d.ts +36 -0
- package/dist/studio/http/page-paths.js +36 -0
- package/dist/studio/http/pages/agents-page.d.ts +12 -0
- package/dist/studio/http/pages/agents-page.js +13 -0
- package/dist/studio/http/pages/health-page.d.ts +38 -0
- package/dist/studio/http/pages/health-page.js +49 -0
- package/dist/studio/http/pages/inbox-page.d.ts +13 -0
- package/dist/studio/http/pages/inbox-page.js +14 -0
- package/dist/studio/http/pages/knowledge-page.d.ts +39 -0
- package/dist/studio/http/pages/knowledge-page.js +59 -0
- package/dist/studio/http/pages/measure-page.d.ts +18 -0
- package/dist/studio/http/pages/measure-page.js +30 -0
- package/dist/studio/http/pages/observe-page.d.ts +29 -0
- package/dist/studio/http/pages/observe-page.js +45 -0
- package/dist/studio/http/report-server.d.ts +1 -2
- package/dist/studio/http/report-server.js +74 -28
- package/dist/studio/http/request-errors.js +61 -28
- package/dist/studio/http/request-handler.d.ts +3 -4
- package/dist/studio/http/request-handler.js +52 -25
- package/dist/studio/http/routes/artifact-authoring.d.ts +1 -0
- package/dist/studio/http/routes/artifact-authoring.js +35 -0
- package/dist/studio/http/routes/carrier-measurement.d.ts +8 -0
- package/dist/studio/http/routes/carrier-measurement.js +34 -0
- package/dist/studio/http/routes/contracts.d.ts +3 -1
- package/dist/studio/http/routes/conversations.d.ts +1 -1
- package/dist/studio/http/routes/conversations.js +38 -2
- package/dist/studio/http/routes/core-runs.d.ts +6 -5
- package/dist/studio/http/routes/core-runs.js +8 -5
- package/dist/studio/http/routes/entity-links.d.ts +3 -0
- package/dist/studio/http/routes/entity-links.js +39 -0
- package/dist/studio/http/routes/knowledge-candidates.d.ts +6 -0
- package/dist/studio/http/routes/knowledge-candidates.js +47 -0
- package/dist/studio/http/routes/knowledge-relations.d.ts +3 -0
- package/dist/studio/http/routes/knowledge-relations.js +32 -0
- package/dist/studio/http/routes/knowledge-reviews.d.ts +3 -0
- package/dist/studio/http/routes/knowledge-reviews.js +30 -0
- package/dist/studio/http/routes/knowledge.d.ts +4 -5
- package/dist/studio/http/routes/knowledge.js +5 -73
- package/dist/studio/http/routes/observations.d.ts +3 -9
- package/dist/studio/http/routes/observations.js +3 -38
- package/dist/studio/http/routes/router.d.ts +2 -1
- package/dist/studio/http/routes/router.js +2 -8
- package/dist/studio/http/routes/settings.d.ts +1 -0
- package/dist/studio/http/routes/settings.js +36 -0
- package/dist/studio/http/server-addresses.d.ts +5 -0
- package/dist/studio/http/server-addresses.js +16 -0
- package/dist/studio/view-models/conversations/conversation-reader.d.ts +15 -0
- package/dist/studio/view-models/conversations/replay.d.ts +85 -0
- package/dist/studio/view-models/display/tone.d.ts +7 -0
- package/dist/studio/view-models/display/tone.js +1 -0
- package/dist/studio/view-models/knowledge/artifact-authoring.d.ts +2 -0
- package/dist/studio/view-models/knowledge/artifact-authoring.js +1 -0
- package/dist/studio/view-models/knowledge/entity-links.d.ts +17 -0
- package/dist/studio/view-models/knowledge/entity-links.js +1 -0
- package/dist/studio/view-models/knowledge/health-assessment.d.ts +16 -0
- package/dist/studio/view-models/knowledge/health-assessment.js +1 -0
- package/dist/studio/view-models/knowledge/insight.d.ts +75 -0
- package/dist/studio/view-models/knowledge/insight.js +1 -0
- package/dist/studio/view-models/knowledge/knowledge-candidates.d.ts +135 -0
- package/dist/studio/view-models/knowledge/knowledge-candidates.js +1 -0
- package/dist/studio/view-models/knowledge/knowledge-library.d.ts +4 -0
- package/dist/studio/view-models/knowledge/knowledge-library.js +1 -0
- package/dist/studio/view-models/knowledge/knowledge-relations.d.ts +2 -0
- package/dist/studio/view-models/knowledge/knowledge-relations.js +1 -0
- package/dist/studio/view-models/knowledge/knowledge-reports.js +1 -0
- package/dist/studio/view-models/knowledge/knowledge-reviews.d.ts +2 -0
- package/dist/studio/view-models/knowledge/knowledge-reviews.js +1 -0
- package/dist/studio/view-models/knowledge/skill-index.d.ts +113 -0
- package/dist/studio/view-models/knowledge/skill-index.js +1 -0
- package/dist/studio/view-models/measure/carrier-measurement.d.ts +1 -0
- package/dist/studio/view-models/measure/carrier-measurement.js +1 -0
- package/dist/studio/view-models/measure/core-runs.d.ts +263 -0
- package/dist/studio/view-models/measure/core-runs.js +1 -0
- package/dist/studio/view-models/page-fault.d.ts +9 -0
- package/dist/studio/view-models/page-fault.js +1 -0
- package/dist/studio/view-models/settings/settings.d.ts +12 -0
- package/dist/studio/view-models/settings/settings.js +1 -0
- package/dist/studio/web/.next/BUILD_ID +1 -1
- package/dist/studio/web/.next/app-path-routes-manifest.json +11 -8
- package/dist/studio/web/.next/build-manifest.json +5 -5
- package/dist/studio/web/.next/next-minimal-server.js.nft.json +1 -1
- package/dist/studio/web/.next/next-server.js.nft.json +1 -1
- package/dist/studio/web/.next/prerender-manifest.json +4 -4
- package/dist/studio/web/.next/required-server-files.js +35 -2
- package/dist/studio/web/.next/required-server-files.json +35 -2
- package/dist/studio/web/.next/routes-manifest.json +42 -22
- package/dist/studio/web/.next/server/app/_global-error/page.js +2 -2
- package/dist/studio/web/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/_global-error.html +1 -1
- package/dist/studio/web/.next/server/app/_global-error.meta +8 -0
- package/dist/studio/web/.next/server/app/_global-error.rsc +30 -20
- package/dist/studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +30 -20
- package/dist/studio/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +36 -24
- package/dist/studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +3 -1
- package/dist/studio/web/.next/server/app/_not-found/page.js +1 -1
- package/dist/studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/agents/page.js +1 -0
- package/dist/studio/web/.next/server/app/agents/page.js.nft.json +1 -0
- package/dist/studio/web/.next/server/app/agents/page_client-reference-manifest.js +1 -0
- package/dist/studio/web/.next/server/app/knowledge/candidates/page.js +1 -0
- package/dist/studio/web/.next/server/app/knowledge/candidates/page.js.nft.json +1 -0
- package/dist/studio/web/.next/server/app/knowledge/candidates/page_client-reference-manifest.js +1 -0
- package/dist/studio/web/.next/server/app/knowledge/entities/page.js +1 -0
- package/dist/studio/web/.next/server/app/knowledge/entities/page.js.nft.json +1 -0
- package/dist/studio/web/.next/server/app/knowledge/entities/page_client-reference-manifest.js +1 -0
- package/dist/studio/web/.next/server/app/knowledge/library/page.js +55 -0
- package/dist/studio/web/.next/server/app/knowledge/library/page.js.nft.json +1 -0
- package/dist/studio/web/.next/server/app/knowledge/library/page_client-reference-manifest.js +1 -0
- package/dist/studio/web/.next/server/app/knowledge/page.js +1 -1
- package/dist/studio/web/.next/server/app/knowledge/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/knowledge/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/knowledge/skills/[skillName]/page.js +1 -1
- package/dist/studio/web/.next/server/app/knowledge/skills/[skillName]/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/knowledge/skills/[skillName]/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/measure/[runId]/page.js +1 -1
- package/dist/studio/web/.next/server/app/measure/[runId]/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/measure/[runId]/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/measure/page.js +1 -1
- package/dist/studio/web/.next/server/app/measure/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/measure/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/observe/conversations/[threadId]/page.js +1 -1
- package/dist/studio/web/.next/server/app/observe/conversations/[threadId]/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/observe/conversations/[threadId]/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/observe/conversations/[threadId]/tasks/[turnId]/page.js +1 -1
- package/dist/studio/web/.next/server/app/observe/conversations/[threadId]/tasks/[turnId]/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/observe/conversations/[threadId]/tasks/[turnId]/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/observe/health/[analysisId]/page.js +1 -1
- package/dist/studio/web/.next/server/app/observe/health/[analysisId]/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/observe/health/[analysisId]/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/observe/health/page.js +1 -1
- package/dist/studio/web/.next/server/app/observe/health/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/observe/health/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/observe/health-diff/page.js +1 -1
- package/dist/studio/web/.next/server/app/observe/health-diff/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/observe/health-diff/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/observe/inbox/page.js +7 -10
- package/dist/studio/web/.next/server/app/observe/inbox/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/observe/inbox/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/observe/page.js +1 -1
- package/dist/studio/web/.next/server/app/observe/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/observe/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/observe/skill-trend/[skillName]/page.js +1 -1
- package/dist/studio/web/.next/server/app/observe/skill-trend/[skillName]/page.js.nft.json +1 -1
- package/dist/studio/web/.next/server/app/observe/skill-trend/[skillName]/page_client-reference-manifest.js +1 -1
- package/dist/studio/web/.next/server/app/studio-fault/page.js +1 -0
- package/dist/studio/web/.next/server/app/studio-fault/page.js.nft.json +1 -0
- package/dist/studio/web/.next/server/app/studio-fault/page_client-reference-manifest.js +1 -0
- package/dist/studio/web/.next/server/app-paths-manifest.json +11 -8
- package/dist/studio/web/.next/server/chunks/158.js +4 -0
- package/dist/studio/web/.next/server/chunks/173.js +23 -0
- package/dist/studio/web/.next/server/chunks/197.js +1 -0
- package/dist/studio/web/.next/server/chunks/241.js +1 -0
- package/dist/studio/web/.next/server/chunks/276.js +55 -0
- package/dist/studio/web/.next/server/chunks/278.js +4 -0
- package/dist/studio/web/.next/server/chunks/285.js +16 -0
- package/dist/studio/web/.next/server/chunks/3.js +1 -0
- package/dist/studio/web/.next/server/chunks/464.js +3 -3
- package/dist/studio/web/.next/server/chunks/475.js +1 -0
- package/dist/studio/web/.next/server/chunks/499.js +1 -0
- package/dist/studio/web/.next/server/chunks/5.js +1 -0
- package/dist/studio/web/.next/server/chunks/520.js +1 -0
- package/dist/studio/web/.next/server/chunks/644.js +16 -0
- package/dist/studio/web/.next/server/chunks/647.js +41 -0
- package/dist/studio/web/.next/server/chunks/704.js +1 -0
- package/dist/studio/web/.next/server/chunks/757.js +4 -0
- package/dist/studio/web/.next/server/chunks/758.js +1 -0
- package/dist/studio/web/.next/server/chunks/772.js +8 -0
- package/dist/studio/web/.next/server/chunks/777.js +1 -0
- package/dist/studio/web/.next/server/chunks/78.js +1 -0
- package/dist/studio/web/.next/server/chunks/845.js +6 -0
- package/dist/studio/web/.next/server/chunks/907.js +471 -0
- package/dist/studio/web/.next/server/chunks/952.js +10 -0
- package/dist/studio/web/.next/server/chunks/996.js +1 -0
- package/dist/studio/web/.next/server/middleware-build-manifest.js +1 -1
- package/dist/studio/web/.next/server/pages/500.html +1 -1
- package/dist/studio/web/.next/server/preview-props.json +5 -0
- package/dist/studio/web/.next/server/server-reference-manifest.json +1 -1
- package/dist/studio/web/.next/server/webpack-runtime.js +1 -1
- package/dist/studio/web/.next/static/chunks/0937d497-cb7a9ff884a082ab.js +1 -0
- package/dist/studio/web/.next/static/chunks/1046-d6406775bf6e4e56.js +10 -0
- package/dist/studio/web/.next/static/chunks/130-893cf722c2625b17.js +126 -0
- package/dist/studio/web/.next/static/chunks/1492-bad4ed42c0e250f4.js +1 -0
- package/dist/studio/web/.next/static/chunks/1858-c1e4347ec29d9975.js +52 -0
- package/dist/studio/web/.next/static/chunks/2038-6693f44ecf63822c.js +1 -0
- package/dist/studio/web/.next/static/chunks/2192-3018e652a8614c1a.js +16 -0
- package/dist/studio/web/.next/static/chunks/2519-4e2ef8a5f4329f8f.js +1 -0
- package/dist/studio/web/.next/static/chunks/2974-4e69b5f46cfb7dcf.js +41 -0
- package/dist/studio/web/.next/static/chunks/3596-edc23b1335d9e066.js +16 -0
- package/dist/studio/web/.next/static/chunks/3958-a0c0cdf3f949cce5.js +1 -0
- package/dist/studio/web/.next/static/chunks/3978-7aa1fe441f992fbc.js +1 -0
- package/dist/studio/web/.next/static/chunks/4994-f4341c8b63e0b273.js +23 -0
- package/dist/studio/web/.next/static/chunks/5014-5f3f743dbdca752b.js +1 -0
- package/dist/studio/web/.next/static/chunks/5382-1b919cde624bb761.js +1 -0
- package/dist/studio/web/.next/static/chunks/5669-9c97987efcbb436b.js +4 -0
- package/dist/studio/web/.next/static/chunks/5686-ca88fb679f990180.js +7 -0
- package/dist/studio/web/.next/static/chunks/5810-175f6442bf41f93f.js +8 -0
- package/dist/studio/web/.next/static/chunks/5834-a15c5aca742e8dfe.js +1 -0
- package/dist/studio/web/.next/static/chunks/5888-7fcdb8113bad0a83.js +55 -0
- package/dist/studio/web/.next/static/chunks/6238-d5503cb2b71c7dac.js +1 -0
- package/dist/studio/web/.next/static/chunks/6722-e64d7dff19ba05f4.js +4 -0
- package/dist/studio/web/.next/static/chunks/7754-35adc2934225f819.js +4 -0
- package/dist/studio/web/.next/static/chunks/7936-e4a0d3ac28eb54cc.js +164 -0
- package/dist/studio/web/.next/static/chunks/7956-5d0381b62a26fe4d.js +6 -0
- package/dist/studio/web/.next/static/chunks/8093-42784c8dd11cb2f7.js +1 -0
- package/dist/studio/web/.next/static/chunks/8284-7f5a979f042ab2fa.js +1 -0
- package/dist/studio/web/.next/static/chunks/8791-c05283fd8a8fdb82.js +1 -0
- package/dist/studio/web/.next/static/chunks/9688-4bdad39f3387b49a.js +1 -0
- package/dist/studio/web/.next/static/chunks/9978-5c07c696f9455dda.js +9 -0
- package/dist/studio/web/.next/static/chunks/app/agents/page-d4eaa6a8179b7b19.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/error-edb0db1072d1d73f.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/knowledge/candidates/page-9526538d0b68d6f4.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/knowledge/entities/page-aff10fb4087e2ead.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/knowledge/library/page-94bff0d5847f1372.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/knowledge/page-a0f3756f1167905f.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/knowledge/skills/[skillName]/page-6dba56e2cc7bf391.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/layout-238de1f5bd3b0186.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/loading-bafa7dd71ac593fb.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/measure/[runId]/page-18d8cdad7fbd3103.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/measure/page-ef11f68b9809a459.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/not-found-2ea031c66ca97f78.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/observe/conversations/[threadId]/page-bcc0e0e84f975fe2.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/observe/conversations/[threadId]/tasks/[turnId]/page-f0f71def8fed4edb.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/observe/health/[analysisId]/page-b9ee172f2f50b703.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/observe/health/page-4786159a2715cfc0.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/observe/health-diff/page-82c559a9f9f00e46.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/observe/inbox/page-1aeba2d85fcdb064.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/observe/page-85aa6e5ef7030a53.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/observe/skill-trend/[skillName]/page-81db0784463726ef.js +1 -0
- package/dist/studio/web/.next/static/chunks/app/studio-fault/page-c1a55437331aa91a.js +1 -0
- package/dist/studio/web/.next/static/chunks/framework-c65554ff3488f9ae.js +1 -0
- package/dist/studio/web/.next/static/chunks/main-6fb9fe9da7afc450.js +5 -0
- package/dist/studio/web/.next/static/chunks/webpack-ac24233801701b11.js +1 -0
- package/dist/studio/web/.next/static/css/9037c4f39a77549b.css +1 -0
- package/dist/studio/web/.next/static/scyR1oH1_xcujwAsrOo96/_buildManifest.js +1 -0
- package/dist/studio/web/.next/trace +108 -3
- package/dist/studio/web/.next/trace-build +1 -1
- package/dist/studio/web/next.config.mjs +7 -0
- package/package.json +31 -27
- package/dist/cli/commands/list.d.ts +0 -26
- package/dist/cli/commands/list.js +0 -121
- package/dist/cli/commands/promote.d.ts +0 -24
- package/dist/cli/commands/promote.js +0 -141
- package/dist/cli/commands/rollback.d.ts +0 -20
- package/dist/cli/commands/rollback.js +0 -87
- package/dist/cli/lib/actor.d.ts +0 -2
- package/dist/cli/lib/actor.js +0 -13
- package/dist/cli/lib/evaluation-composition.d.ts +0 -3
- package/dist/cli/lib/evaluation-composition.js +0 -96
- package/dist/cli/lib/i18n-dict/list.d.ts +0 -3
- package/dist/cli/lib/i18n-dict/list.js +0 -40
- package/dist/cli/lib/i18n-dict/promote.d.ts +0 -3
- package/dist/cli/lib/i18n-dict/promote.js +0 -46
- package/dist/cli/lib/i18n-dict/rollback.d.ts +0 -3
- package/dist/cli/lib/i18n-dict/rollback.js +0 -22
- package/dist/diagnosis/contracts/parser.js +0 -181
- package/dist/diagnosis/lifecycle.js +0 -31
- package/dist/diagnosis/observe-mapper.js +0 -265
- package/dist/diagnosis/observe-producer.d.ts +0 -8
- package/dist/diagnosis/observe-producer.js +0 -200
- package/dist/diagnosis/studio-projection.js +0 -90
- package/dist/eval-runtime/clock.d.ts +0 -3
- package/dist/eval-runtime/evaluation/ordering.d.ts +0 -1
- package/dist/eval-runtime/evaluation/ordering.js +0 -3
- package/dist/eval-runtime/executed-store.d.ts +0 -48
- package/dist/eval-runtime/executed-store.js +0 -256
- package/dist/eval-runtime/execution-controls.d.ts +0 -6
- package/dist/eval-runtime/execution-controls.js +0 -57
- package/dist/eval-runtime/execution.d.ts +0 -60
- package/dist/eval-runtime/execution.js +0 -183
- package/dist/eval-runtime/infrastructure.d.ts +0 -51
- package/dist/eval-runtime/infrastructure.js +0 -89
- package/dist/eval-runtime/mcp-config.d.ts +0 -48
- package/dist/eval-runtime/mcp-config.js +0 -90
- package/dist/eval-runtime/mock-interception.d.ts +0 -65
- package/dist/eval-runtime/mock-interception.js +0 -109
- package/dist/eval-runtime/provider.d.ts +0 -38
- package/dist/eval-runtime/provider.js +0 -13
- package/dist/eval-runtime/result-store.d.ts +0 -45
- package/dist/eval-runtime/result-store.js +0 -247
- package/dist/eval-runtime/runner.d.ts +0 -47
- package/dist/eval-runtime/runner.js +0 -116
- package/dist/eval-runtime/runtime.d.ts +0 -35
- package/dist/eval-runtime/runtime.js +0 -111
- package/dist/eval-runtime/tool-policy.js +0 -69
- package/dist/eval-runtime/workspace.d.ts +0 -49
- package/dist/eval-runtime/workspace.js +0 -84
- package/dist/eval-workflows/analysis/bootstrap.d.ts +0 -150
- package/dist/eval-workflows/analysis/bootstrap.js +0 -307
- package/dist/eval-workflows/hosts/adapters/anthropic/api.d.ts +0 -31
- package/dist/eval-workflows/hosts/adapters/anthropic/api.js +0 -286
- package/dist/eval-workflows/hosts/adapters/anthropic/input.d.ts +0 -7
- package/dist/eval-workflows/hosts/adapters/anthropic/input.js +0 -28
- package/dist/eval-workflows/hosts/adapters/anthropic/protocol.d.ts +0 -67
- package/dist/eval-workflows/hosts/adapters/anthropic/protocol.js +0 -192
- package/dist/eval-workflows/hosts/adapters/claude/cli-protocol.d.ts +0 -19
- package/dist/eval-workflows/hosts/adapters/claude/cli-protocol.js +0 -274
- package/dist/eval-workflows/hosts/adapters/claude/cli.d.ts +0 -48
- package/dist/eval-workflows/hosts/adapters/claude/cli.js +0 -607
- package/dist/eval-workflows/hosts/adapters/claude/core-protocol-contract.d.ts +0 -5
- package/dist/eval-workflows/hosts/adapters/claude/core-protocol-contract.js +0 -57
- package/dist/eval-workflows/hosts/adapters/claude/resources.d.ts +0 -125
- package/dist/eval-workflows/hosts/adapters/claude/resources.js +0 -713
- package/dist/eval-workflows/hosts/adapters/claude/sdk-protocol.d.ts +0 -7
- package/dist/eval-workflows/hosts/adapters/claude/sdk-protocol.js +0 -36
- package/dist/eval-workflows/hosts/adapters/claude/sdk-runtime.d.ts +0 -40
- package/dist/eval-workflows/hosts/adapters/claude/sdk-runtime.js +0 -163
- package/dist/eval-workflows/hosts/adapters/claude/sdk.d.ts +0 -29
- package/dist/eval-workflows/hosts/adapters/claude/sdk.js +0 -507
- package/dist/eval-workflows/projections/managed.d.ts +0 -8
- package/dist/eval-workflows/projections/managed.js +0 -105
- package/dist/eval-workflows/resume-admission/admit.d.ts +0 -8
- package/dist/eval-workflows/resume-admission/admit.js +0 -180
- package/dist/eval-workflows/resume-admission/contracts.d.ts +0 -81
- package/dist/eval-workflows/resume-admission/contracts.js +0 -22
- package/dist/eval-workflows/resume-admission/index.d.ts +0 -2
- package/dist/eval-workflows/resume-admission/index.js +0 -2
- package/dist/evidence/graph/doctor.d.ts +0 -22
- package/dist/evidence/graph/doctor.js +0 -572
- package/dist/evidence/storage/default-dirs.d.ts +0 -32
- package/dist/evidence/storage/default-dirs.js +0 -33
- package/dist/evidence/storage/directories.d.ts +0 -18
- package/dist/evidence/storage/directories.js +0 -60
- package/dist/evidence/storage/discovery-index.d.ts +0 -86
- package/dist/evidence/storage/discovery-index.js +0 -303
- package/dist/evidence/storage/file-names.d.ts +0 -12
- package/dist/evidence/storage/file-names.js +0 -51
- package/dist/evidence/storage/layout.d.ts +0 -35
- package/dist/evidence/storage/layout.js +0 -50
- package/dist/evidence/storage/report-bundle.js +0 -122
- package/dist/evidence/storage/run-id.js +0 -19
- package/dist/executors/anthropic/api.d.ts +0 -3
- package/dist/executors/anthropic/api.js +0 -102
- package/dist/executors/anthropic/claude/cli.d.ts +0 -3
- package/dist/executors/anthropic/claude/cli.js +0 -119
- package/dist/executors/anthropic/claude/protocol.d.ts +0 -87
- package/dist/executors/anthropic/claude/protocol.js +0 -180
- package/dist/executors/anthropic/claude/sdk.d.ts +0 -20
- package/dist/executors/anthropic/claude/sdk.js +0 -159
- package/dist/executors/anthropic/claude/trace.d.ts +0 -9
- package/dist/executors/anthropic/claude/trace.js +0 -133
- package/dist/executors/core/tool-identity.d.ts +0 -29
- package/dist/executors/core/trace-source-kind.d.ts +0 -4
- package/dist/executors/core/trace-source-kind.js +0 -5
- package/dist/executors/mock-runtime/mock-hook.cjs +0 -271
- package/dist/executors/tool-call-status.d.ts +0 -8
- package/dist/executors/tool-call-status.js +0 -71
- package/dist/knowledge-artifacts/authoring/core-evolver.d.ts +0 -66
- package/dist/knowledge-artifacts/authoring/core-evolver.js +0 -283
- package/dist/knowledge-artifacts/authoring/scaffold.js +0 -109
- package/dist/knowledge-artifacts/doctor/contracts.d.ts +0 -201
- package/dist/knowledge-artifacts/doctor/endpoint-rule.js +0 -382
- package/dist/knowledge-artifacts/doctor/fixer.js +0 -345
- package/dist/knowledge-artifacts/doctor/health/composer.d.ts +0 -18
- package/dist/knowledge-artifacts/doctor/health/composer.js +0 -411
- package/dist/knowledge-artifacts/doctor/index.js +0 -277
- package/dist/knowledge-artifacts/doctor/messages.d.ts +0 -20
- package/dist/knowledge-artifacts/doctor/messages.js +0 -224
- package/dist/knowledge-artifacts/doctor/persistence.js +0 -126
- package/dist/knowledge-artifacts/doctor/renderer.d.ts +0 -17
- package/dist/knowledge-artifacts/doctor/report-parser.js +0 -103
- package/dist/knowledge-artifacts/doctor/rules.d.ts +0 -32
- package/dist/knowledge-artifacts/doctor/rules.js +0 -290
- package/dist/knowledge-artifacts/governance/contracts.d.ts +0 -158
- package/dist/knowledge-artifacts/governance/evidence.d.ts +0 -25
- package/dist/knowledge-artifacts/governance/evidence.js +0 -111
- package/dist/knowledge-artifacts/governance/evolve-outcome.d.ts +0 -16
- package/dist/knowledge-artifacts/governance/evolve-outcome.js +0 -41
- package/dist/knowledge-artifacts/governance/index.d.ts +0 -11
- package/dist/knowledge-artifacts/governance/index.js +0 -11
- package/dist/knowledge-artifacts/governance/install.d.ts +0 -29
- package/dist/knowledge-artifacts/governance/install.js +0 -63
- package/dist/knowledge-artifacts/governance/list-query.d.ts +0 -7
- package/dist/knowledge-artifacts/governance/list-query.js +0 -11
- package/dist/knowledge-artifacts/governance/list-view.d.ts +0 -67
- package/dist/knowledge-artifacts/governance/list-view.js +0 -77
- package/dist/knowledge-artifacts/governance/observe-feedback.d.ts +0 -73
- package/dist/knowledge-artifacts/governance/observe-feedback.js +0 -59
- package/dist/knowledge-artifacts/governance/promote-gate.d.ts +0 -34
- package/dist/knowledge-artifacts/governance/promote-gate.js +0 -32
- package/dist/knowledge-artifacts/governance/source-probe.d.ts +0 -15
- package/dist/knowledge-artifacts/governance/source-probe.js +0 -129
- package/dist/knowledge-artifacts/governance/store.d.ts +0 -145
- package/dist/knowledge-artifacts/governance/store.js +0 -594
- package/dist/knowledge-artifacts/sources/artifact-resolution.d.ts +0 -184
- package/dist/knowledge-artifacts/sources/artifact-resolution.js +0 -818
- package/dist/knowledge-artifacts/sources/content-hash.js +0 -117
- package/dist/knowledge-artifacts/sources/deploy-artifact.js +0 -65
- package/dist/knowledge-artifacts/sources/install-source.d.ts +0 -37
- package/dist/knowledge-artifacts/sources/install-source.js +0 -124
- package/dist/knowledge-artifacts/sources/materialize-copy.d.ts +0 -37
- package/dist/knowledge-artifacts/sources/materialize-copy.js +0 -193
- package/dist/observability/analysis/coverage-analyzer.js +0 -258
- package/dist/observability/analysis/gap-analyzer.d.ts +0 -110
- package/dist/observability/analysis/gap-analyzer.js +0 -455
- package/dist/observability/analysis/hedging-classifier.js +0 -142
- package/dist/observability/contracts/experience-enums.d.ts +0 -227
- package/dist/observability/contracts/experience-enums.js +0 -227
- package/dist/observability/contracts/experience-evidence-schema.d.ts +0 -33130
- package/dist/observability/contracts/experience-evidence-schema.js +0 -704
- package/dist/observability/contracts/experience.d.ts +0 -80
- package/dist/observability/contracts/inbox.d.ts +0 -181
- package/dist/observability/contracts/skill-chain.d.ts +0 -114
- package/dist/observability/conversation/catalog.d.ts +0 -41
- package/dist/observability/conversation/catalog.js +0 -572
- package/dist/observability/conversation/polling-subscription-hub.js +0 -149
- package/dist/observability/experience/primitives.d.ts +0 -11
- package/dist/observability/experience/primitives.js +0 -75
- package/dist/observability/experience/report-derivations.js +0 -283
- package/dist/observability/experience/report-structure.d.ts +0 -9
- package/dist/observability/experience/session-story.d.ts +0 -93
- package/dist/observability/experience/session-story.js +0 -1349
- package/dist/observability/experience/text-signals.d.ts +0 -7
- package/dist/observability/experience/text-signals.js +0 -30
- package/dist/observability/experience/timeline.d.ts +0 -29
- package/dist/observability/experience/timeline.js +0 -495
- package/dist/observability/experience.d.ts +0 -41
- package/dist/observability/experience.js +0 -812
- package/dist/observability/inbox/explicit-capture.js +0 -223
- package/dist/observability/inbox/feedback-matchers.d.ts +0 -40
- package/dist/observability/inbox/feedback-matchers.js +0 -260
- package/dist/observability/inbox/index.d.ts +0 -34
- package/dist/observability/inbox/index.js +0 -1260
- package/dist/observability/inbox/paths.d.ts +0 -10
- package/dist/observability/inbox/paths.js +0 -64
- package/dist/observability/inbox/problem-patterns.js +0 -246
- package/dist/observability/inbox/review-state.d.ts +0 -25
- package/dist/observability/inbox/review-state.js +0 -352
- package/dist/observability/inbox/signal-semantics.d.ts +0 -27
- package/dist/observability/inbox/source-record-archive.d.ts +0 -14
- package/dist/observability/inbox/source-record-archive.js +0 -328
- package/dist/observability/inbox/view-model.d.ts +0 -31
- package/dist/observability/inbox/view-model.js +0 -143
- package/dist/observability/skill-health/analyzer.d.ts +0 -129
- package/dist/observability/skill-health/analyzer.js +0 -328
- package/dist/observability/skill-health/experience-frontmatter.js +0 -99
- package/dist/observability/skill-health/persistence.d.ts +0 -18
- package/dist/observability/skill-health/persistence.js +0 -43
- package/dist/observability/skill-health/skill-chain.js +0 -486
- package/dist/observability/soft-standards/constants.d.ts +0 -3
- package/dist/observability/soft-standards/constants.js +0 -8
- package/dist/observability/soft-standards/llm-extractor.js +0 -692
- package/dist/observability/soft-standards/runtime-evaluator.js +0 -384
- package/dist/observability/soft-standards/skill-standards-store.d.ts +0 -11
- package/dist/observability/soft-standards/skill-standards-store.js +0 -240
- package/dist/observability/soft-standards/types.d.ts +0 -212
- package/dist/observability/trace/adapters/codex/tool-status.js +0 -114
- package/dist/observability/trace/adapters/codex/trace.d.ts +0 -5
- package/dist/observability/trace/adapters/codex/trace.js +0 -1091
- package/dist/observability/trace/segmentation.js +0 -491
- package/dist/observability/trace/source.d.ts +0 -69
- package/dist/observability/trace/source.js +0 -1199
- package/dist/observability/trace/tool-search.js +0 -160
- package/dist/observability/trace/trace-ir.d.ts +0 -185
- package/dist/observability/trace/trace-ir.js +0 -81
- package/dist/observability/view-models/conversation.d.ts +0 -51
- package/dist/observability/view-models/index.d.ts +0 -3
- package/dist/studio/application/conversation-activity.d.ts +0 -4
- package/dist/studio/application/core-run-catalog.d.ts +0 -3
- package/dist/studio/application/core-run-format.d.ts +0 -28
- package/dist/studio/application/core-run-format.js +0 -99
- package/dist/studio/application/core-run-projection.d.ts +0 -6
- package/dist/studio/application/core-run-projection.js +0 -308
- package/dist/studio/application/doctor-format.d.ts +0 -49
- package/dist/studio/application/doctor-format.js +0 -73
- package/dist/studio/application/health-format.d.ts +0 -154
- package/dist/studio/application/health-format.js +0 -231
- package/dist/studio/application/index.d.ts +0 -2
- package/dist/studio/application/index.js +0 -2
- package/dist/studio/application/knowledge-query.d.ts +0 -24
- package/dist/studio/application/knowledge-query.js +0 -30
- package/dist/studio/application/knowledge-reports.d.ts +0 -17
- package/dist/studio/application/knowledge-reports.js +0 -232
- package/dist/studio/application/managed-format.d.ts +0 -59
- package/dist/studio/application/managed-format.js +0 -113
- package/dist/studio/application/replay/format.d.ts +0 -7
- package/dist/studio/application/replay/format.js +0 -52
- package/dist/studio/application/replay/layout.d.ts +0 -15
- package/dist/studio/application/replay/layout.js +0 -171
- package/dist/studio/application/replay/projection.d.ts +0 -4
- package/dist/studio/application/replay/projection.js +0 -291
- package/dist/studio/application/replay/routing.d.ts +0 -3
- package/dist/studio/application/replay/summary.d.ts +0 -25
- package/dist/studio/application/skill-health.d.ts +0 -6
- package/dist/studio/application/skill-health.js +0 -41
- package/dist/studio/application/skill-index.d.ts +0 -24
- package/dist/studio/application/skill-index.js +0 -360
- package/dist/studio/application/skill-insights.d.ts +0 -5
- package/dist/studio/application/skill-insights.js +0 -218
- package/dist/studio/application/trajectory-evidence.d.ts +0 -3
- package/dist/studio/http/health-page.d.ts +0 -37
- package/dist/studio/http/health-page.js +0 -52
- package/dist/studio/http/inbox-page.d.ts +0 -11
- package/dist/studio/http/inbox-page.js +0 -9
- package/dist/studio/http/knowledge-page.d.ts +0 -29
- package/dist/studio/http/knowledge-page.js +0 -49
- package/dist/studio/http/managed-page.d.ts +0 -29
- package/dist/studio/http/managed-page.js +0 -45
- package/dist/studio/http/managed-root.d.ts +0 -12
- package/dist/studio/http/managed-root.js +0 -19
- package/dist/studio/http/observe-page.d.ts +0 -26
- package/dist/studio/http/observe-page.js +0 -36
- package/dist/studio/index.d.ts +0 -4
- package/dist/studio/index.js +0 -4
- package/dist/studio/view-models/core-runs.d.ts +0 -225
- package/dist/studio/view-models/health-assessment.d.ts +0 -8
- package/dist/studio/view-models/index.d.ts +0 -2
- package/dist/studio/view-models/insight.d.ts +0 -68
- package/dist/studio/view-models/replay.d.ts +0 -85
- package/dist/studio/view-models/skill-index.d.ts +0 -111
- package/dist/studio/web/.next/server/app/knowledge/managed/[managedId]/page.js +0 -1
- package/dist/studio/web/.next/server/app/knowledge/managed/[managedId]/page.js.nft.json +0 -1
- package/dist/studio/web/.next/server/app/knowledge/managed/[managedId]/page_client-reference-manifest.js +0 -1
- package/dist/studio/web/.next/server/app/knowledge/managed/page.js +0 -1
- package/dist/studio/web/.next/server/app/knowledge/managed/page.js.nft.json +0 -1
- package/dist/studio/web/.next/server/app/knowledge/managed/page_client-reference-manifest.js +0 -1
- package/dist/studio/web/.next/server/chunks/211.js +0 -153
- package/dist/studio/web/.next/server/chunks/340.js +0 -1
- package/dist/studio/web/.next/server/chunks/428.js +0 -1
- package/dist/studio/web/.next/server/chunks/60.js +0 -1
- package/dist/studio/web/.next/server/chunks/629.js +0 -24
- package/dist/studio/web/.next/server/chunks/634.js +0 -8
- package/dist/studio/web/.next/server/chunks/761.js +0 -1
- package/dist/studio/web/.next/server/chunks/781.js +0 -6
- package/dist/studio/web/.next/server/chunks/820.js +0 -1
- package/dist/studio/web/.next/server/chunks/843.js +0 -16
- package/dist/studio/web/.next/server/chunks/864.js +0 -1
- package/dist/studio/web/.next/server/chunks/881.js +0 -1
- package/dist/studio/web/.next/server/chunks/944.js +0 -478
- package/dist/studio/web/.next/static/chunks/0937d497-e4b3c577da4da67b.js +0 -1
- package/dist/studio/web/.next/static/chunks/1794-b0b73323eb0b61cd.js +0 -1
- package/dist/studio/web/.next/static/chunks/1858-53aecb176156ec2f.js +0 -52
- package/dist/studio/web/.next/static/chunks/1987-971296df54e43ab1.js +0 -16
- package/dist/studio/web/.next/static/chunks/2038-ccf8a4a844645002.js +0 -1
- package/dist/studio/web/.next/static/chunks/258-98725438cc459d4c.js +0 -10
- package/dist/studio/web/.next/static/chunks/2765-54f4c40540e205f1.js +0 -153
- package/dist/studio/web/.next/static/chunks/3230-60c074bff83af5ae.js +0 -9
- package/dist/studio/web/.next/static/chunks/3884-e86dedc2ed19774a.js +0 -1
- package/dist/studio/web/.next/static/chunks/4684-581ca8c487980c6e.js +0 -1
- package/dist/studio/web/.next/static/chunks/5810-c7b66ea2d2c8dad9.js +0 -8
- package/dist/studio/web/.next/static/chunks/5834-a9faf21ab3427baa.js +0 -1
- package/dist/studio/web/.next/static/chunks/6250-ec299731b6849371.js +0 -1
- package/dist/studio/web/.next/static/chunks/6868-16b9a6bb44398ac2.js +0 -6
- package/dist/studio/web/.next/static/chunks/7210-bb171d6e87b8aaf8.js +0 -4
- package/dist/studio/web/.next/static/chunks/7492-e0a1f9bb373f8e34.js +0 -57
- package/dist/studio/web/.next/static/chunks/805-21d1a5581dbcc7b9.js +0 -13
- package/dist/studio/web/.next/static/chunks/8202-d22828e45db31cd7.js +0 -1
- package/dist/studio/web/.next/static/chunks/9321-39cec3eb17db7d45.js +0 -1
- package/dist/studio/web/.next/static/chunks/9658-ca86f15af46ed3b6.js +0 -66
- package/dist/studio/web/.next/static/chunks/9688-a11fe7d1bb540a55.js +0 -1
- package/dist/studio/web/.next/static/chunks/9934-c067935398279115.js +0 -1
- package/dist/studio/web/.next/static/chunks/9953-16d4db818b625532.js +0 -1
- package/dist/studio/web/.next/static/chunks/9978-b4a2af6d5c721928.js +0 -9
- package/dist/studio/web/.next/static/chunks/app/error-55e2496e263eb053.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/knowledge/managed/[managedId]/page-5fa90f6251a53a66.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/knowledge/managed/page-d6b23d06985b27be.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/knowledge/page-401b42b337f35cb2.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/knowledge/skills/[skillName]/page-89a6aae95545c30f.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/layout-3ac390eeabe225ae.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/loading-cf7b92a0b9a3d539.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/measure/[runId]/page-759183f4a8355396.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/measure/page-d105ed6e46b66203.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/not-found-845deb67422d6b1c.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/observe/conversations/[threadId]/page-0389657b0e5738fe.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/observe/conversations/[threadId]/tasks/[turnId]/page-779abb5f7c49f132.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/observe/health/[analysisId]/page-85d38aa58d79b97f.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/observe/health/page-b725a73a0d71a14d.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/observe/health-diff/page-4c28b86850c88ca1.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/observe/inbox/page-73887f7fd8fe691e.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/observe/page-81dc705ad95f7bb2.js +0 -1
- package/dist/studio/web/.next/static/chunks/app/observe/skill-trend/[skillName]/page-c7c42d498385dd11.js +0 -1
- package/dist/studio/web/.next/static/chunks/framework-5229529bf08fbe0d.js +0 -1
- package/dist/studio/web/.next/static/chunks/main-c86d24af6df62a67.js +0 -5
- package/dist/studio/web/.next/static/chunks/webpack-040077c7c5b63775.js +0 -1
- package/dist/studio/web/.next/static/css/5161ba759fc0d07f.css +0 -1
- package/dist/studio/web/.next/static/z5Z1oaZbCQ47WIPuI9Vg-/_buildManifest.js +0 -1
- /package/dist/{diagnosis/contracts.js → eval-core/evaluation/runtime-state.js} +0 -0
- /package/dist/{evidence/graph/contracts.js → eval-core/execution/runtime-state.js} +0 -0
- /package/dist/eval-runtime/{clock.js → execution/clock.js} +0 -0
- /package/dist/eval-runtime/{tool-policy.d.ts → resources/tool-policy.d.ts} +0 -0
- /package/dist/{evidence/storage → eval-workflows/artifact-store}/run-id.d.ts +0 -0
- /package/dist/{knowledge-artifacts/contracts.js → eval-workflows/projections/carrier-measurement.js} +0 -0
- /package/dist/{knowledge-artifacts/doctor/contracts.js → executors/contracts/archive.js} +0 -0
- /package/dist/executors/{core → contracts}/token-usage.d.ts +0 -0
- /package/dist/executors/{core → contracts}/token-usage.js +0 -0
- /package/dist/executors/{core → contracts}/tool-identity.js +0 -0
- /package/dist/{knowledge-artifacts/governance/contracts.js → knowledge/artifacts/authoring/carrier-contracts.js} +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/authoring/improvement.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/authoring/improvement.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/authoring/scaffold.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/contracts.d.ts +0 -0
- /package/dist/{knowledge-artifacts/skills → knowledge/artifacts}/contracts.js +0 -0
- /package/dist/{observability/analysis → knowledge/artifacts/doctor}/contracts.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/endpoint-rule.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/fixer.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/builtin-dimensions.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/builtin-dimensions.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/consensus.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/consensus.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/dimension-registry.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/dimension-registry.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/dimension-spec.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/dimension-spec.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/load-custom-dimensions.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/load-custom-dimensions.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/merge-prompt.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/merge-prompt.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/parser.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/parser.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/prompt-builder.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/prompt-builder.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/register.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/health/register.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/index.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/persistence.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/renderer.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/report-parser.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/report-schema.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/report-schema.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/rule-kind.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/doctor/rule-kind.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/skills/contracts.d.ts +0 -0
- /package/dist/{observability/contracts/experience.js → knowledge/artifacts/skills/contracts.js} +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/skills/hard-rules.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/skills/hard-rules.js +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/sources/content-hash.d.ts +0 -0
- /package/dist/{knowledge-artifacts → knowledge/artifacts}/sources/deploy-artifact.d.ts +0 -0
- /package/dist/{observability/contracts/inbox.js → knowledge/sources/source-store.js} +0 -0
- /package/dist/{observability → observe}/analysis/contracts.d.ts +0 -0
- /package/dist/{observability/contracts/problem-patterns.js → observe/analysis/contracts.js} +0 -0
- /package/dist/{observability → observe}/analysis/coverage-analyzer.d.ts +0 -0
- /package/dist/{observability → observe}/analysis/hedging-classifier.d.ts +0 -0
- /package/dist/{observability/contracts/review.js → observe/contracts/experience.js} +0 -0
- /package/dist/{observability/contracts/skill-chain-advisories.js → observe/contracts/inbox.js} +0 -0
- /package/dist/{observability → observe}/contracts/problem-patterns.d.ts +0 -0
- /package/dist/{observability/contracts/skill-chain.js → observe/contracts/problem-patterns.js} +0 -0
- /package/dist/{observability → observe}/contracts/review.d.ts +0 -0
- /package/dist/{observability/contracts/trace.js → observe/contracts/review.js} +0 -0
- /package/dist/{observability → observe}/contracts/skill-chain-advisories.d.ts +0 -0
- /package/dist/{observability/conversation/index-process.d.ts → observe/contracts/skill-chain-advisories.js} +0 -0
- /package/dist/{observability/soft-standards/types.js → observe/contracts/skill-chain.js} +0 -0
- /package/dist/{observability → observe}/contracts/trace-metadata-schema.d.ts +0 -0
- /package/dist/{observability → observe}/contracts/trace-metadata-schema.js +0 -0
- /package/dist/{observability → observe}/contracts/trace.d.ts +0 -0
- /package/dist/{observability/view-models/conversation.js → observe/contracts/trace.js} +0 -0
- /package/dist/{observability/view-models/index.js → observe/conversation/index-process.d.ts} +0 -0
- /package/dist/{observability → observe}/conversation/index-process.js +0 -0
- /package/dist/{observability → observe}/conversation/knowledge-debugger.d.ts +0 -0
- /package/dist/{observability → observe}/conversation/knowledge-debugger.js +0 -0
- /package/dist/{observability → observe}/conversation/polling-subscription-hub.d.ts +0 -0
- /package/dist/{observability → observe}/conversation/task-semantic-projection.d.ts +0 -0
- /package/dist/{observability → observe}/conversation/task-semantic-projection.js +0 -0
- /package/dist/{observability → observe}/conversation/task-window.d.ts +0 -0
- /package/dist/{observability → observe}/conversation/task-window.js +0 -0
- /package/dist/{observability → observe}/conversation/turn-index.d.ts +0 -0
- /package/dist/{observability → observe}/conversation/turn-index.js +0 -0
- /package/dist/{diagnosis → observe/diagnosis}/contracts/parser.d.ts +0 -0
- /package/dist/{diagnosis → observe/diagnosis}/contracts.d.ts +0 -0
- /package/dist/{observability/view-models/knowledge-debugger.js → observe/diagnosis/contracts.js} +0 -0
- /package/dist/{diagnosis → observe/diagnosis}/lifecycle.d.ts +0 -0
- /package/dist/{diagnosis → observe/diagnosis}/observe-mapper.d.ts +0 -0
- /package/dist/{diagnosis → observe/diagnosis}/studio-projection.d.ts +0 -0
- /package/dist/{observability → observe}/experience/report-codec.d.ts +0 -0
- /package/dist/{observability → observe}/experience/report-codec.js +0 -0
- /package/dist/{observability → observe}/experience/report-derivations.d.ts +0 -0
- /package/dist/{observability → observe}/experience/report-reference-validator.d.ts +0 -0
- /package/dist/{observability → observe}/experience/report-reference-validator.js +0 -0
- /package/dist/{observability → observe}/experience/report-structure.js +0 -0
- /package/dist/{observability → observe}/experience/report-value-guards.d.ts +0 -0
- /package/dist/{observability → observe}/experience/report-value-guards.js +0 -0
- /package/dist/{observability → observe}/experience/review-checklist.d.ts +0 -0
- /package/dist/{observability → observe}/experience/review-checklist.js +0 -0
- /package/dist/{observability → observe}/experience/reviewer-report.d.ts +0 -0
- /package/dist/{observability → observe}/experience/reviewer-report.js +0 -0
- /package/dist/{observability → observe}/inbox/capture-coverage.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/capture-coverage.js +0 -0
- /package/dist/{observability → observe}/inbox/effective-review.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/effective-review.js +0 -0
- /package/dist/{observability → observe}/inbox/explicit-capture.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/identity.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/identity.js +0 -0
- /package/dist/{observability → observe}/inbox/metric-semantics.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/metric-semantics.js +0 -0
- /package/dist/{observability → observe}/inbox/problem-patterns.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/report-filter.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/report-filter.js +0 -0
- /package/dist/{observability → observe}/inbox/resolved-review.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/resolved-review.js +0 -0
- /package/dist/{observability → observe}/inbox/review-semantics.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/review-semantics.js +0 -0
- /package/dist/{observability → observe}/inbox/session-time-range.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/session-time-range.js +0 -0
- /package/dist/{observability → observe}/inbox/severity-reason.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/severity-reason.js +0 -0
- /package/dist/{observability → observe}/inbox/signal-semantics.js +0 -0
- /package/dist/{observability → observe}/inbox/skill-rollups.d.ts +0 -0
- /package/dist/{observability → observe}/inbox/skill-rollups.js +0 -0
- /package/dist/{observability → observe}/prompts/document.d.ts +0 -0
- /package/dist/{observability → observe}/prompts/document.js +0 -0
- /package/dist/{observability → observe}/prompts/llm-enhanced-review.prompt.md +0 -0
- /package/dist/{observability → observe}/skill-health/advisories.d.ts +0 -0
- /package/dist/{observability → observe}/skill-health/advisories.js +0 -0
- /package/dist/{observability → observe}/skill-health/experience-frontmatter.d.ts +0 -0
- /package/dist/{observability → observe}/skill-health/report.d.ts +0 -0
- /package/dist/{observability → observe}/skill-health/report.js +0 -0
- /package/dist/{observability → observe}/skill-health/skill-chain.d.ts +0 -0
- /package/dist/{observability → observe}/soft-standards/index.d.ts +0 -0
- /package/dist/{observability → observe}/soft-standards/index.js +0 -0
- /package/dist/{observability → observe}/soft-standards/llm-extractor.d.ts +0 -0
- /package/dist/{observability → observe}/soft-standards/runtime-evaluator.d.ts +0 -0
- /package/dist/{observability → observe}/soft-standards/runtime-evidence.d.ts +0 -0
- /package/dist/{observability → observe}/soft-standards/runtime-evidence.js +0 -0
- /package/dist/{studio/view-models/conversation-activity.js → observe/soft-standards/types.js} +0 -0
- /package/dist/{observability → observe}/trace/adapters/codex/conversation-index.d.ts +0 -0
- /package/dist/{observability → observe}/trace/adapters/codex/conversation-index.js +0 -0
- /package/dist/{observability → observe}/trace/adapters/codex/exec-command.d.ts +0 -0
- /package/dist/{observability → observe}/trace/adapters/codex/exec-command.js +0 -0
- /package/dist/{observability → observe}/trace/adapters/codex/protocol.d.ts +0 -0
- /package/dist/{observability → observe}/trace/adapters/codex/protocol.js +0 -0
- /package/dist/{observability → observe}/trace/adapters/codex/tool-status.d.ts +0 -0
- /package/dist/{observability → observe}/trace/attribution.d.ts +0 -0
- /package/dist/{observability → observe}/trace/attribution.js +0 -0
- /package/dist/{observability → observe}/trace/index.d.ts +0 -0
- /package/dist/{observability → observe}/trace/index.js +0 -0
- /package/dist/{observability → observe}/trace/ingestion.d.ts +0 -0
- /package/dist/{observability → observe}/trace/ingestion.js +0 -0
- /package/dist/{observability → observe}/trace/message-classification.d.ts +0 -0
- /package/dist/{observability → observe}/trace/message-classification.js +0 -0
- /package/dist/{observability → observe}/trace/projection.d.ts +0 -0
- /package/dist/{observability → observe}/trace/projection.js +0 -0
- /package/dist/{observability → observe}/trace/segmentation.d.ts +0 -0
- /package/dist/{observability → observe}/trace/session-index.d.ts +0 -0
- /package/dist/{observability → observe}/trace/session-index.js +0 -0
- /package/dist/{observability → observe}/trace/tool-search.d.ts +0 -0
- /package/dist/{studio/view-models/core-runs.js → observe/view-models/conversation.js} +0 -0
- /package/dist/{studio → observe}/view-models/index.js +0 -0
- /package/dist/{observability → observe}/view-models/knowledge-debugger.d.ts +0 -0
- /package/dist/{studio/view-models/health-assessment.js → observe/view-models/knowledge-debugger.js} +0 -0
- /package/dist/{evidence/graph → storage/artifact-graph}/contracts.d.ts +0 -0
- /package/dist/{studio/view-models/inline-markdown.js → storage/artifact-graph/contracts.js} +0 -0
- /package/dist/{evidence/graph → storage/artifact-graph}/schema.d.ts +0 -0
- /package/dist/{evidence/graph → storage/artifact-graph}/schema.js +0 -0
- /package/dist/{evidence/storage → storage}/directory-selection.d.ts +0 -0
- /package/dist/{evidence/storage → storage}/directory-selection.js +0 -0
- /package/dist/{evidence/storage → storage}/report-bundle.d.ts +0 -0
- /package/dist/studio/application/{conversation-activity.js → conversations/conversation-activity.js} +0 -0
- /package/dist/studio/application/{inline-markdown.d.ts → conversations/replay/inline-markdown.d.ts} +0 -0
- /package/dist/studio/application/{inline-markdown.js → conversations/replay/inline-markdown.js} +0 -0
- /package/dist/studio/application/{replay → conversations/replay}/routing.js +0 -0
- /package/dist/studio/application/{replay → conversations/replay}/summary.js +0 -0
- /package/dist/studio/application/{trajectory-evidence.js → conversations/trajectory-evidence.js} +0 -0
- /package/dist/studio/application/{core-run-catalog.js → measure/core-run-catalog.js} +0 -0
- /package/dist/studio/view-models/{conversation-activity.d.ts → conversations/conversation-activity.d.ts} +0 -0
- /package/dist/studio/view-models/{insight.js → conversations/conversation-activity.js} +0 -0
- /package/dist/studio/view-models/{knowledge-reports.js → conversations/conversation-reader.js} +0 -0
- /package/dist/studio/view-models/{inline-markdown.d.ts → conversations/inline-markdown.d.ts} +0 -0
- /package/dist/studio/view-models/{replay.js → conversations/inline-markdown.js} +0 -0
- /package/dist/studio/view-models/{skill-index.js → conversations/replay.js} +0 -0
- /package/dist/studio/view-models/{trajectory-evidence.d.ts → conversations/trajectory-evidence.d.ts} +0 -0
- /package/dist/studio/view-models/{trajectory-evidence.js → conversations/trajectory-evidence.js} +0 -0
- /package/dist/studio/view-models/{trajectory-routing.d.ts → conversations/trajectory-routing.d.ts} +0 -0
- /package/dist/studio/view-models/{trajectory-routing.js → conversations/trajectory-routing.js} +0 -0
- /package/dist/studio/view-models/{knowledge-reports.d.ts → knowledge/knowledge-reports.d.ts} +0 -0
- /package/dist/studio/web/.next/static/{z5Z1oaZbCQ47WIPuI9Vg- → scyR1oH1_xcujwAsrOo96}/_ssgManifest.js +0 -0
|
@@ -1,1975 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 内建分析入口:只留五个公开工厂与转口,实现按族分住 builtin-* 模块。
|
|
3
|
+
*
|
|
4
|
+
* 实现按族分住 builtin-* 模块;本入口只留公开工厂与转口,公开名与拆分前逐字一致。
|
|
5
|
+
*/
|
|
6
|
+
import { compareStrings } from '../primitives/ordering.js';
|
|
7
|
+
import { schemaIdentityKey, } from '../contracts/index.js';
|
|
8
|
+
import { BUILTIN_EXCLUDE_MISSING_POLICY, BUILTIN_FAMILY_RELEASE_DECISION_POLICY, BUILTIN_INTERVAL_PROGRESS_DECISION_POLICY, BUILTIN_PROGRESS_DECISION_POLICY, } from './builtin-decisions.js';
|
|
9
|
+
import { BUILTIN_HYPOTHESIS_INPUT_SCHEMA, BUILTIN_HYPOTHESIS_TABLE_SCHEMA, HypothesisInputEnvelopeSchema, HypothesisTableEnvelopeSchema, } from './builtin-hypothesis.js';
|
|
10
|
+
import { BUILTIN_DEFINITIONS, } from './builtin-registry.js';
|
|
11
|
+
import { BONFERRONI_PARAMETERS_SCHEMA, BOOTSTRAP_PARAMETERS_SCHEMA, BUILTIN_INTERVAL_RESULT_SCHEMA, BUILTIN_SCALAR_RESULT_SCHEMA, BUILTIN_SIMULTANEOUS_INTERVAL_FAMILY_RESULT_SCHEMA, BonferroniParametersSchema, BootstrapParametersSchema, COMPOSITE_BOOTSTRAP_PARAMETERS_SCHEMA, CompositeBootstrapParametersSchema, EMPTY_PARAMETERS_SCHEMA, FAMILY_RELEASE_PARAMETERS_SCHEMA, FamilyReleaseParametersSchema, HIERARCHICAL_BOOTSTRAP_PARAMETERS_SCHEMA, HIERARCHICAL_QUANTILE_PARAMETERS_SCHEMA, HIERARCHICAL_REDUCER_PARAMETERS_SCHEMA, HierarchicalBootstrapParametersSchema, HierarchicalQuantileParametersSchema, HierarchicalReducerParametersSchema, IntervalEnvelopeSchema, PROGRESS_PARAMETERS_SCHEMA, ProgressParametersSchema, QUANTILE_PARAMETERS_SCHEMA, QuantileParametersSchema, SIMULTANEOUS_INTERVAL_FAMILY_PARAMETERS_SCHEMA, ScalarEnvelopeSchema, SimultaneousIntervalFamilyEnvelopeSchema, SimultaneousIntervalFamilyParametersSchema, StrictEmptyParametersSchema, } from './builtin-schemas.js';
|
|
12
|
+
import { BuiltinNodeImplementation, BuiltinSchemaValidator, validateBonferroniContext, validateIntervalContext, validateSimultaneousIntervalFamilyContext, } from './builtin-validation.js';
|
|
3
13
|
export { bonferroniMarginalAlpha, bonferroniMarginalConfidenceLevel, } from '../contracts/statistics.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const QuantileParametersSchema = z.object({
|
|
8
|
-
probability: ProbabilitySchema.default(0.5),
|
|
9
|
-
}).strict();
|
|
10
|
-
const BootstrapParametersSchema = z.object({
|
|
11
|
-
resamples: z.number().int().positive().safe().default(1_000),
|
|
12
|
-
alpha: FiniteNumberSchema.gt(0).lt(1).default(0.05),
|
|
13
|
-
}).strict();
|
|
14
|
-
const MeasurementReplicateSchema = z.object({
|
|
15
|
-
evaluatorId: z.string().min(1).max(256),
|
|
16
|
-
instrumentId: z.string().min(1).max(256),
|
|
17
|
-
replicateIndex: z.number().int().nonnegative().safe(),
|
|
18
|
-
}).strict();
|
|
19
|
-
const MeasurementMemberBaseSchema = z.object({
|
|
20
|
-
ensembleMemberId: z.string().min(1).max(256),
|
|
21
|
-
replicates: z.array(MeasurementReplicateSchema).min(1),
|
|
22
|
-
}).strict();
|
|
23
|
-
const MeasurementAggregationSchema = z.discriminatedUnion('method', [
|
|
24
|
-
z.object({
|
|
25
|
-
method: z.literal('mean'),
|
|
26
|
-
missing: z.literal('require-complete'),
|
|
27
|
-
replicateGroupId: z.string().min(1).max(256),
|
|
28
|
-
members: z.array(MeasurementMemberBaseSchema).min(1),
|
|
29
|
-
}).strict(),
|
|
30
|
-
z.object({
|
|
31
|
-
method: z.literal('weighted-mean'),
|
|
32
|
-
missing: z.literal('require-complete'),
|
|
33
|
-
replicateGroupId: z.string().min(1).max(256),
|
|
34
|
-
members: z.array(MeasurementMemberBaseSchema.extend({
|
|
35
|
-
weight: FiniteNumberSchema.positive(),
|
|
36
|
-
}).strict()).min(1),
|
|
37
|
-
}).strict(),
|
|
38
|
-
]).superRefine((aggregation, context) => {
|
|
39
|
-
const memberIds = aggregation.members.map((member) => member.ensembleMemberId);
|
|
40
|
-
if (new Set(memberIds).size !== memberIds.length) {
|
|
41
|
-
context.addIssue({ code: 'custom', path: ['members'], message: 'Member IDs must be unique' });
|
|
42
|
-
}
|
|
43
|
-
if (canonicalizeJson(memberIds) !== canonicalizeJson([...memberIds].sort())) {
|
|
44
|
-
context.addIssue({
|
|
45
|
-
code: 'custom',
|
|
46
|
-
path: ['members'],
|
|
47
|
-
message: 'Members must be ordered by ensembleMemberId',
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
const evaluatorIds = [];
|
|
51
|
-
const instrumentIds = new Set();
|
|
52
|
-
for (const [memberIndex, member] of aggregation.members.entries()) {
|
|
53
|
-
const indexes = member.replicates.map((replicate) => replicate.replicateIndex);
|
|
54
|
-
if (new Set(indexes).size !== indexes.length
|
|
55
|
-
|| indexes.some((value, index) => value !== index)) {
|
|
56
|
-
context.addIssue({
|
|
57
|
-
code: 'custom',
|
|
58
|
-
path: ['members', memberIndex, 'replicates'],
|
|
59
|
-
message: 'Replicate indexes must be unique and contiguous from zero',
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
for (const replicate of member.replicates) {
|
|
63
|
-
evaluatorIds.push(replicate.evaluatorId);
|
|
64
|
-
instrumentIds.add(replicate.instrumentId);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (new Set(evaluatorIds).size !== evaluatorIds.length) {
|
|
68
|
-
context.addIssue({ code: 'custom', path: ['members'], message: 'Evaluator IDs must be unique' });
|
|
69
|
-
}
|
|
70
|
-
if (instrumentIds.size !== 1) {
|
|
71
|
-
context.addIssue({ code: 'custom', path: ['members'], message: 'One panel must use one instrument' });
|
|
72
|
-
}
|
|
73
|
-
if (aggregation.method === 'weighted-mean') {
|
|
74
|
-
const total = aggregation.members.reduce((sum, member) => sum + member.weight, 0);
|
|
75
|
-
if (Math.abs(total - 1) > 1e-12) {
|
|
76
|
-
context.addIssue({ code: 'custom', path: ['members'], message: 'Member weights must sum to one' });
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
const HierarchicalBootstrapParametersSchema = z.object({
|
|
81
|
-
resamples: z.number().int().positive().safe().default(1_000),
|
|
82
|
-
alpha: FiniteNumberSchema.gt(0).lt(1).default(0.05),
|
|
83
|
-
measurementAggregation: MeasurementAggregationSchema,
|
|
84
|
-
}).strict();
|
|
85
|
-
const HierarchicalReducerParametersSchema = z.object({
|
|
86
|
-
measurementAggregation: MeasurementAggregationSchema,
|
|
87
|
-
}).strict();
|
|
88
|
-
const HierarchicalQuantileParametersSchema = z.object({
|
|
89
|
-
probability: ProbabilitySchema,
|
|
90
|
-
measurementAggregation: MeasurementAggregationSchema,
|
|
91
|
-
}).strict();
|
|
92
|
-
const CompositeComponentSchema = z.object({
|
|
93
|
-
metricId: z.string().min(1).max(256),
|
|
94
|
-
weight: FiniteNumberSchema.positive(),
|
|
95
|
-
measurementAggregation: MeasurementAggregationSchema.optional(),
|
|
96
|
-
}).strict();
|
|
97
|
-
const CompositeBootstrapParametersSchema = z.object({
|
|
98
|
-
compositeMetricId: z.string().min(1).max(256),
|
|
99
|
-
components: z.array(CompositeComponentSchema).min(2),
|
|
100
|
-
aggregation: z.object({
|
|
101
|
-
method: z.literal('weighted-mean'),
|
|
102
|
-
missing: z.literal('require-complete'),
|
|
103
|
-
}).strict(),
|
|
104
|
-
resamples: z.number().int().positive().safe().default(1_000),
|
|
105
|
-
alpha: FiniteNumberSchema.gt(0).lt(1).default(0.05),
|
|
106
|
-
}).strict().superRefine((parameters, context) => {
|
|
107
|
-
const metricIds = parameters.components.map((component) => component.metricId);
|
|
108
|
-
if (new Set(metricIds).size !== metricIds.length) {
|
|
109
|
-
context.addIssue({
|
|
110
|
-
code: 'custom',
|
|
111
|
-
path: ['components'],
|
|
112
|
-
message: 'Composite component Metric IDs must be unique',
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
if (metricIds.includes(parameters.compositeMetricId)) {
|
|
116
|
-
context.addIssue({
|
|
117
|
-
code: 'custom',
|
|
118
|
-
path: ['compositeMetricId'],
|
|
119
|
-
message: 'Composite Metric cannot also be a source component',
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
const total = parameters.components.reduce((sum, component) => sum + component.weight, 0);
|
|
123
|
-
if (total !== 1) {
|
|
124
|
-
context.addIssue({
|
|
125
|
-
code: 'custom',
|
|
126
|
-
path: ['components'],
|
|
127
|
-
message: 'Composite component weights must sum to one',
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
const BonferroniParametersSchema = z.object({
|
|
132
|
-
alpha: FiniteNumberSchema.gt(0).lt(1).default(0.05),
|
|
133
|
-
}).strict();
|
|
134
|
-
const SimultaneousIntervalFamilyParametersSchema = z.object({
|
|
135
|
-
familyConfidenceLevel: FiniteNumberSchema.gt(0).lt(1),
|
|
136
|
-
resamples: z.number().int().positive().safe(),
|
|
137
|
-
}).strict();
|
|
138
|
-
const ProgressParametersSchema = z.object({
|
|
139
|
-
threshold: FiniteNumberSchema.default(0),
|
|
140
|
-
equivalence: FiniteNumberSchema.nonnegative().default(0),
|
|
141
|
-
}).strict();
|
|
142
|
-
const FamilyReleaseCriterionSchema = z.object({
|
|
143
|
-
analysisResultId: z.string().min(1).max(256),
|
|
144
|
-
minimumEffect: FiniteNumberSchema.optional(),
|
|
145
|
-
maximumEffect: FiniteNumberSchema.optional(),
|
|
146
|
-
}).strict().superRefine((criterion, context) => {
|
|
147
|
-
if (criterion.minimumEffect === undefined && criterion.maximumEffect === undefined) {
|
|
148
|
-
context.addIssue({
|
|
149
|
-
code: 'custom',
|
|
150
|
-
path: [],
|
|
151
|
-
message: 'A family release criterion requires at least one effect boundary',
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
if (criterion.minimumEffect !== undefined
|
|
155
|
-
&& criterion.maximumEffect !== undefined
|
|
156
|
-
&& criterion.minimumEffect > criterion.maximumEffect) {
|
|
157
|
-
context.addIssue({
|
|
158
|
-
code: 'custom',
|
|
159
|
-
path: ['minimumEffect'],
|
|
160
|
-
message: 'minimumEffect must not exceed maximumEffect',
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
const FamilyReleaseParametersSchema = z.object({
|
|
165
|
-
rule: z.literal('all'),
|
|
166
|
-
criteria: z.array(FamilyReleaseCriterionSchema).min(2),
|
|
167
|
-
}).strict().superRefine((parameters, context) => {
|
|
168
|
-
const resultIds = parameters.criteria.map((criterion) => criterion.analysisResultId);
|
|
169
|
-
if (new Set(resultIds).size !== resultIds.length) {
|
|
170
|
-
context.addIssue({
|
|
171
|
-
code: 'custom',
|
|
172
|
-
path: ['criteria'],
|
|
173
|
-
message: 'Family release criteria must be unique',
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
const ScalarEnvelopeSchema = z.object({
|
|
178
|
-
resultType: z.literal('scalar'),
|
|
179
|
-
value: FiniteNumberSchema,
|
|
180
|
-
}).strict();
|
|
181
|
-
const PercentileIntervalValueSchema = z.object({
|
|
182
|
-
estimate: FiniteNumberSchema,
|
|
183
|
-
lower: FiniteNumberSchema,
|
|
184
|
-
upper: FiniteNumberSchema,
|
|
185
|
-
confidenceLevel: FiniteNumberSchema.gt(0).lt(1),
|
|
186
|
-
resamples: z.number().int().positive().safe(),
|
|
187
|
-
unitCount: z.number().int().positive().safe(),
|
|
188
|
-
method: z.literal('percentile'),
|
|
189
|
-
}).strict();
|
|
190
|
-
const IntervalEnvelopeSchema = z.object({
|
|
191
|
-
resultType: z.literal('interval'),
|
|
192
|
-
value: PercentileIntervalValueSchema,
|
|
193
|
-
}).strict().superRefine((envelope, context) => {
|
|
194
|
-
if (envelope.value.lower > envelope.value.upper) {
|
|
195
|
-
context.addIssue({
|
|
196
|
-
code: 'custom',
|
|
197
|
-
path: ['value'],
|
|
198
|
-
message: 'Interval bounds must satisfy lower <= upper',
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
const SimultaneousIntervalFamilyEnvelopeSchema = z.object({
|
|
203
|
-
resultType: z.literal('table'),
|
|
204
|
-
value: z.object({
|
|
205
|
-
adjustmentMethod: z.literal('bonferroni'),
|
|
206
|
-
familyConfidenceLevel: FiniteNumberSchema.gt(0).lt(1),
|
|
207
|
-
marginalConfidenceLevel: FiniteNumberSchema.gt(0).lt(1),
|
|
208
|
-
familySize: z.number().int().min(2).safe(),
|
|
209
|
-
resamples: z.number().int().positive().safe(),
|
|
210
|
-
members: z.array(z.object({
|
|
211
|
-
analysisResultId: z.string().min(1).max(256),
|
|
212
|
-
interval: PercentileIntervalValueSchema,
|
|
213
|
-
}).strict()).min(2),
|
|
214
|
-
}).strict(),
|
|
215
|
-
}).strict().superRefine((envelope, context) => {
|
|
216
|
-
const { value } = envelope;
|
|
217
|
-
const memberIds = value.members.map((member) => member.analysisResultId);
|
|
218
|
-
if (value.familySize !== value.members.length) {
|
|
219
|
-
context.addIssue({ code: 'custom', path: ['value', 'familySize'], message: 'familySize mismatch' });
|
|
220
|
-
}
|
|
221
|
-
if (new Set(memberIds).size !== memberIds.length
|
|
222
|
-
|| canonicalizeJson(memberIds) !== canonicalizeJson([...memberIds].sort())) {
|
|
223
|
-
context.addIssue({
|
|
224
|
-
code: 'custom',
|
|
225
|
-
path: ['value', 'members'],
|
|
226
|
-
message: 'Member IDs must be unique and canonical',
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
const expectedConfidence = bonferroniMarginalConfidenceLevel(value.familyConfidenceLevel, value.familySize);
|
|
230
|
-
if (value.marginalConfidenceLevel !== expectedConfidence
|
|
231
|
-
|| value.members.some((member) => (member.interval.confidenceLevel !== expectedConfidence
|
|
232
|
-
|| member.interval.resamples !== value.resamples))) {
|
|
233
|
-
context.addIssue({
|
|
234
|
-
code: 'custom',
|
|
235
|
-
path: ['value', 'members'],
|
|
236
|
-
message: 'Member interval metadata does not match the Bonferroni family',
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
const HypothesisInputEnvelopeSchema = z.object({
|
|
241
|
-
resultType: z.literal('table'),
|
|
242
|
-
value: z.object({
|
|
243
|
-
hypotheses: z.array(z.object({
|
|
244
|
-
hypothesisId: z.string().min(1),
|
|
245
|
-
pValue: ProbabilitySchema,
|
|
246
|
-
}).strict()).min(1),
|
|
247
|
-
}).strict(),
|
|
248
|
-
}).strict();
|
|
249
|
-
const HypothesisTableEnvelopeSchema = z.object({
|
|
250
|
-
resultType: z.literal('table'),
|
|
251
|
-
value: z.object({
|
|
252
|
-
familySize: z.number().int().positive().safe(),
|
|
253
|
-
alpha: FiniteNumberSchema.gt(0).lt(1),
|
|
254
|
-
hypotheses: z.array(z.object({
|
|
255
|
-
hypothesisId: z.string().min(1),
|
|
256
|
-
rawPValue: ProbabilitySchema,
|
|
257
|
-
adjustedPValue: ProbabilitySchema,
|
|
258
|
-
rejected: z.boolean(),
|
|
259
|
-
}).strict()).min(1),
|
|
260
|
-
}).strict(),
|
|
261
|
-
}).strict().superRefine((envelope, context) => {
|
|
262
|
-
const { familySize, alpha, hypotheses } = envelope.value;
|
|
263
|
-
if (familySize !== hypotheses.length) {
|
|
264
|
-
context.addIssue({ code: 'custom', path: ['value', 'familySize'], message: 'familySize mismatch' });
|
|
265
|
-
}
|
|
266
|
-
const ids = hypotheses.map((entry) => entry.hypothesisId);
|
|
267
|
-
if (new Set(ids).size !== ids.length || canonicalizeJson(ids) !== canonicalizeJson([...ids].sort())) {
|
|
268
|
-
context.addIssue({ code: 'custom', path: ['value', 'hypotheses'], message: 'IDs must be unique and canonical' });
|
|
269
|
-
}
|
|
270
|
-
for (const [index, entry] of hypotheses.entries()) {
|
|
271
|
-
if (entry.adjustedPValue !== Math.min(1, entry.rawPValue * familySize)
|
|
272
|
-
|| entry.rejected !== (entry.rawPValue <= alpha / familySize)) {
|
|
273
|
-
context.addIssue({ code: 'custom', path: ['value', 'hypotheses', index], message: 'Bonferroni invariant mismatch' });
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
function jsonSchema(schema, invariants) {
|
|
278
|
-
const generated = z.toJSONSchema(schema, {
|
|
279
|
-
target: 'draft-2020-12',
|
|
280
|
-
unrepresentable: 'throw',
|
|
281
|
-
cycles: 'ref',
|
|
282
|
-
reused: 'ref',
|
|
283
|
-
});
|
|
284
|
-
const plain = { ...generated };
|
|
285
|
-
return invariants === undefined ? plain : { ...plain, 'x-omk-invariants': [...invariants] };
|
|
286
|
-
}
|
|
287
|
-
function schemaIdentity(schemaVersion, schemaUri, schema) {
|
|
288
|
-
return {
|
|
289
|
-
schemaVersion,
|
|
290
|
-
schemaUri,
|
|
291
|
-
schemaDigest: digestCanonicalJson(schema),
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
export const BUILTIN_SCALAR_RESULT_SCHEMA = schemaIdentity('omk.analysis-result.scalar-number/v1', 'urn:omk:analysis-result:scalar-number:v1', jsonSchema(ScalarEnvelopeSchema));
|
|
295
|
-
export const BUILTIN_INTERVAL_RESULT_SCHEMA = schemaIdentity('omk.analysis-result.percentile-interval/v1', 'urn:omk:analysis-result:percentile-interval:v1', jsonSchema(IntervalEnvelopeSchema, [
|
|
296
|
-
'lower<=upper',
|
|
297
|
-
'resamples equals the sealed node parameter resamples',
|
|
298
|
-
'confidenceLevel equals 1 minus the sealed node parameter alpha',
|
|
299
|
-
'unitCount equals the Core-derived count of included resampling units',
|
|
300
|
-
]));
|
|
301
|
-
export const BUILTIN_SIMULTANEOUS_INTERVAL_FAMILY_RESULT_SCHEMA = schemaIdentity('omk.analysis-result.simultaneous-interval-family/v1', 'urn:omk:analysis-result:simultaneous-interval-family:v1', jsonSchema(SimultaneousIntervalFamilyEnvelopeSchema, [
|
|
302
|
-
'familySize equals members.length and is at least two',
|
|
303
|
-
'analysisResultId values are unique and lexicographically sorted',
|
|
304
|
-
'marginalConfidenceLevel equals 1 - (1 - familyConfidenceLevel) / familySize',
|
|
305
|
-
'every member interval confidence and resamples match the sealed family parameters',
|
|
306
|
-
'every member interval is identical to its referenced Core Analysis result',
|
|
307
|
-
]));
|
|
308
|
-
export const BUILTIN_HYPOTHESIS_TABLE_SCHEMA = schemaIdentity('omk.analysis-result.hypothesis-table/v1', 'urn:omk:analysis-result:hypothesis-table:v1', jsonSchema(HypothesisTableEnvelopeSchema, [
|
|
309
|
-
'familySize equals hypotheses.length',
|
|
310
|
-
'hypothesisId values are unique and lexicographically sorted',
|
|
311
|
-
'adjustedPValue=min(1,rawPValue*familySize)',
|
|
312
|
-
'rejected=(rawPValue<=alpha/familySize)',
|
|
313
|
-
'alpha equals the sealed node parameter alpha',
|
|
314
|
-
]));
|
|
315
|
-
export const BUILTIN_HYPOTHESIS_INPUT_SCHEMA = schemaIdentity('omk.analysis-result.hypothesis-input/v1', 'urn:omk:analysis-result:hypothesis-input:v1', jsonSchema(HypothesisInputEnvelopeSchema));
|
|
316
|
-
const EMPTY_PARAMETERS_SCHEMA = schemaIdentity('omk.parameters.empty/v1', 'urn:omk:parameters:empty:v1', jsonSchema(StrictEmptyParametersSchema));
|
|
317
|
-
const QUANTILE_PARAMETERS_SCHEMA = schemaIdentity('omk.parameters.quantile/v1', 'urn:omk:parameters:quantile:v1', jsonSchema(QuantileParametersSchema));
|
|
318
|
-
const BOOTSTRAP_PARAMETERS_SCHEMA = schemaIdentity('omk.parameters.bootstrap/v1', 'urn:omk:parameters:bootstrap:v1', jsonSchema(BootstrapParametersSchema));
|
|
319
|
-
const HIERARCHICAL_BOOTSTRAP_PARAMETERS_SCHEMA = schemaIdentity('omk.parameters.hierarchical-measurement-bootstrap/v1', 'urn:omk:parameters:hierarchical-measurement-bootstrap:v1', jsonSchema(HierarchicalBootstrapParametersSchema, [
|
|
320
|
-
'replicate indexes are unique and contiguous from zero within each member',
|
|
321
|
-
'evaluator IDs and member IDs are unique, with members and replicates canonically ordered',
|
|
322
|
-
'all panel coordinates use one instrument and one replicate group',
|
|
323
|
-
'weighted-mean member weights are positive and sum to one',
|
|
324
|
-
'a target/sample/trial contributes only when every sealed coordinate is observed',
|
|
325
|
-
]));
|
|
326
|
-
const HIERARCHICAL_REDUCER_PARAMETERS_SCHEMA = schemaIdentity('omk.parameters.hierarchical-measurement-reducer/v1', 'urn:omk:parameters:hierarchical-measurement-reducer:v1', jsonSchema(HierarchicalReducerParametersSchema));
|
|
327
|
-
const HIERARCHICAL_QUANTILE_PARAMETERS_SCHEMA = schemaIdentity('omk.parameters.hierarchical-measurement-quantile/v1', 'urn:omk:parameters:hierarchical-measurement-quantile:v1', jsonSchema(HierarchicalQuantileParametersSchema));
|
|
328
|
-
const COMPOSITE_BOOTSTRAP_PARAMETERS_SCHEMA = schemaIdentity('omk.parameters.composite-bootstrap/v1', 'urn:omk:parameters:composite-bootstrap:v1', jsonSchema(CompositeBootstrapParametersSchema, [
|
|
329
|
-
'components contain at least two unique Metric IDs in lexicographic order',
|
|
330
|
-
'component weights are positive and sum to one',
|
|
331
|
-
'the composite Metric is not a source component',
|
|
332
|
-
'each target/sample/trial contributes only when every component coordinate is observed',
|
|
333
|
-
'component utilities are combined before repeated-measure and resampling aggregation',
|
|
334
|
-
]));
|
|
335
|
-
const BONFERRONI_PARAMETERS_SCHEMA = schemaIdentity('omk.parameters.bonferroni/v1', 'urn:omk:parameters:bonferroni:v1', jsonSchema(BonferroniParametersSchema));
|
|
336
|
-
const SIMULTANEOUS_INTERVAL_FAMILY_PARAMETERS_SCHEMA = schemaIdentity('omk.parameters.simultaneous-interval-family/v1', 'urn:omk:parameters:simultaneous-interval-family:v1', jsonSchema(SimultaneousIntervalFamilyParametersSchema, [
|
|
337
|
-
'familyConfidenceLevel is the simultaneous coverage target',
|
|
338
|
-
'member alpha equals (1 - familyConfidenceLevel) divided by the sealed input count',
|
|
339
|
-
]));
|
|
340
|
-
const PROGRESS_PARAMETERS_SCHEMA = schemaIdentity('omk.parameters.progress/v1', 'urn:omk:parameters:progress:v1', jsonSchema(ProgressParametersSchema));
|
|
341
|
-
const FAMILY_RELEASE_PARAMETERS_SCHEMA = schemaIdentity('omk.parameters.family-release/v1', 'urn:omk:parameters:family-release:v1', jsonSchema(FamilyReleaseParametersSchema, [
|
|
342
|
-
'rule is explicitly all',
|
|
343
|
-
'criteria are unique and sealed in canonical analysisResultId order',
|
|
344
|
-
'every criterion declares at least one finite effect boundary',
|
|
345
|
-
'minimumEffect is less than or equal to maximumEffect when both are present',
|
|
346
|
-
]));
|
|
347
|
-
function runtimeIdentity(implementationId, capabilities, fingerprintFacets) {
|
|
348
|
-
const version = '1.0.0';
|
|
349
|
-
return {
|
|
350
|
-
implementationId,
|
|
351
|
-
version,
|
|
352
|
-
fingerprint: digestCanonicalJson({
|
|
353
|
-
implementationId,
|
|
354
|
-
version,
|
|
355
|
-
capabilities,
|
|
356
|
-
...(fingerprintFacets === undefined ? {} : { fingerprintFacets }),
|
|
357
|
-
}),
|
|
358
|
-
// A builtin can declare its release identity, but it cannot independently
|
|
359
|
-
// attest that the executing code matches that declaration.
|
|
360
|
-
fingerprintBasis: 'self-reported',
|
|
361
|
-
assuranceLevel: 'declared',
|
|
362
|
-
capabilities,
|
|
363
|
-
implementationManifest: { coverageKind: 'fingerprint-complete' },
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
function nodeCapabilities(input) {
|
|
367
|
-
const inputDomains = [];
|
|
368
|
-
if (input.valueTypes !== undefined) {
|
|
369
|
-
inputDomains.push({
|
|
370
|
-
inputKind: 'metric-observations',
|
|
371
|
-
valueTypes: [...input.valueTypes].sort(),
|
|
372
|
-
...(input.missingPolicyIds !== undefined
|
|
373
|
-
? { missingPolicyIds: [...input.missingPolicyIds].sort() }
|
|
374
|
-
: {}),
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
if (input.analysisResultSchemaUris !== undefined) {
|
|
378
|
-
inputDomains.push({
|
|
379
|
-
inputKind: 'analysis-result',
|
|
380
|
-
schemaUris: [...input.analysisResultSchemaUris].sort(),
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
if (input.comparison === true)
|
|
384
|
-
inputDomains.push({ inputKind: 'comparison' });
|
|
385
|
-
inputDomains.sort((left, right) => {
|
|
386
|
-
const leftCanonical = canonicalizeJson(left);
|
|
387
|
-
const rightCanonical = canonicalizeJson(right);
|
|
388
|
-
return leftCanonical < rightCanonical ? -1 : leftCanonical > rightCanonical ? 1 : 0;
|
|
389
|
-
});
|
|
390
|
-
return {
|
|
391
|
-
capabilityKind: 'analysis-node',
|
|
392
|
-
analysisNodeKinds: [input.analysisNodeKind],
|
|
393
|
-
inputDomains,
|
|
394
|
-
outputSchema: input.outputSchema,
|
|
395
|
-
parameterSchema: input.parameterSchema,
|
|
396
|
-
inputCardinalities: {
|
|
397
|
-
metricObservations: input.valueTypes !== undefined
|
|
398
|
-
? input.metricObservationCardinality ?? { min: 1, max: 1 }
|
|
399
|
-
: { min: 0, max: 0 },
|
|
400
|
-
analysisResults: input.analysisResultSchemaUris !== undefined
|
|
401
|
-
? input.analysisResultCardinality ?? { min: 1 }
|
|
402
|
-
: { min: 0, max: 0 },
|
|
403
|
-
comparisons: input.comparison === true ? { min: 1, max: 1 } : { min: 0, max: 0 },
|
|
404
|
-
},
|
|
405
|
-
...(input.sampling !== undefined ? {
|
|
406
|
-
sampling: {
|
|
407
|
-
assignmentKinds: [...input.sampling.assignmentKinds].sort(),
|
|
408
|
-
experimentalUnits: [...input.sampling.experimentalUnits].sort(),
|
|
409
|
-
repeatedMeasures: [...input.sampling.repeatedMeasures].sort((left, right) => Number(left) - Number(right)),
|
|
410
|
-
resamplingUnits: [...input.sampling.resamplingUnits].sort(),
|
|
411
|
-
},
|
|
412
|
-
} : {}),
|
|
413
|
-
schemas: [],
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
const EXCLUDE_CAPABILITIES = {
|
|
417
|
-
capabilityKind: 'missing-policy',
|
|
418
|
-
valueTypes: ['boolean', 'categorical', 'numeric', 'ranking', 'text'],
|
|
419
|
-
schemas: [],
|
|
420
|
-
};
|
|
421
|
-
const PROGRESS_V1_DECISION_CAPABILITIES = {
|
|
422
|
-
capabilityKind: 'decision-policy',
|
|
423
|
-
analysisResultSchemaUris: [
|
|
424
|
-
BUILTIN_INTERVAL_RESULT_SCHEMA.schemaUri,
|
|
425
|
-
BUILTIN_SCALAR_RESULT_SCHEMA.schemaUri,
|
|
426
|
-
].sort(),
|
|
427
|
-
multipleComparisonPolicyIds: [],
|
|
428
|
-
parameterSchema: PROGRESS_PARAMETERS_SCHEMA,
|
|
429
|
-
schemas: [],
|
|
430
|
-
};
|
|
431
|
-
const PROGRESS_V2_DECISION_CAPABILITIES = {
|
|
432
|
-
capabilityKind: 'decision-policy',
|
|
433
|
-
analysisResultSchemaUris: [BUILTIN_INTERVAL_RESULT_SCHEMA.schemaUri],
|
|
434
|
-
multipleComparisonPolicyIds: [],
|
|
435
|
-
parameterSchema: PROGRESS_PARAMETERS_SCHEMA,
|
|
436
|
-
schemas: [],
|
|
437
|
-
};
|
|
438
|
-
const FAMILY_RELEASE_DECISION_CAPABILITIES = {
|
|
439
|
-
capabilityKind: 'decision-policy',
|
|
440
|
-
analysisResultSchemaUris: [BUILTIN_SIMULTANEOUS_INTERVAL_FAMILY_RESULT_SCHEMA.schemaUri],
|
|
441
|
-
multipleComparisonPolicyIds: ['simultaneous-intervals.bonferroni/v1'],
|
|
442
|
-
parameterSchema: FAMILY_RELEASE_PARAMETERS_SCHEMA,
|
|
443
|
-
schemas: [],
|
|
444
|
-
};
|
|
445
|
-
const PROGRESS_V1_DECISION_FINGERPRINT_FACETS = {
|
|
446
|
-
decisionOutputContract: 'decided-verdict-with-reason-codes/v1',
|
|
447
|
-
reasonRules: {
|
|
448
|
-
progress: 'effect-above-progress-threshold',
|
|
449
|
-
regression: 'effect-below-regression-threshold',
|
|
450
|
-
noise: 'effect-within-equivalence-band',
|
|
451
|
-
notDecided: 'decision-effect-unavailable',
|
|
452
|
-
},
|
|
453
|
-
};
|
|
454
|
-
const PROGRESS_V2_DECISION_FINGERPRINT_FACETS = {
|
|
455
|
-
decisionOutputContract: 'interval-bounded-verdict-with-reason-codes/v2',
|
|
456
|
-
directionRule: 'confidence-interval-must-exclude-threshold-plus-equivalence-band',
|
|
457
|
-
reasonRules: {
|
|
458
|
-
progress: 'interval-above-progress-boundary',
|
|
459
|
-
regression: 'interval-below-regression-boundary',
|
|
460
|
-
noise: 'interval-overlaps-decision-boundary',
|
|
461
|
-
notDecided: 'decision-interval-unavailable',
|
|
462
|
-
},
|
|
463
|
-
};
|
|
464
|
-
const FAMILY_RELEASE_DECISION_FINGERPRINT_FACETS = {
|
|
465
|
-
decisionOutputContract: 'all-member-bounded-release/v1',
|
|
466
|
-
effectRule: 'raw-treatment-minus-control-interval',
|
|
467
|
-
equalityRule: 'bounds-are-inclusive-for-acceptance',
|
|
468
|
-
reasonRules: {
|
|
469
|
-
release: 'all-family-criteria-acceptable',
|
|
470
|
-
block: 'family-criterion-unacceptable',
|
|
471
|
-
notDecided: 'family-criterion-uncertain',
|
|
472
|
-
unavailable: 'decision-family-contract-unavailable',
|
|
473
|
-
},
|
|
474
|
-
};
|
|
475
|
-
function parameters(context) {
|
|
476
|
-
const value = context.node.parameters;
|
|
477
|
-
return value !== null && value !== undefined && !Array.isArray(value)
|
|
478
|
-
&& typeof value === 'object'
|
|
479
|
-
? value
|
|
480
|
-
: {};
|
|
481
|
-
}
|
|
482
|
-
function metricInputs(context) {
|
|
483
|
-
return context.inputs.filter((input) => input.inputKind === 'metric-observations');
|
|
484
|
-
}
|
|
485
|
-
function observedRows(context) {
|
|
486
|
-
const inputs = metricInputs(context);
|
|
487
|
-
if (inputs.length !== 1) {
|
|
488
|
-
throw new TypeError('Built-in Analysis implementations require exactly one Metric input.');
|
|
489
|
-
}
|
|
490
|
-
return inputs.flatMap((input) => input.rows.filter((row) => row.rowStatus === 'observed'));
|
|
491
|
-
}
|
|
492
|
-
function numericValue(row) {
|
|
493
|
-
if (row.rowStatus !== 'observed')
|
|
494
|
-
throw new TypeError('Expected observed row.');
|
|
495
|
-
if (typeof row.value === 'number' && Number.isFinite(row.value))
|
|
496
|
-
return row.value;
|
|
497
|
-
if (typeof row.value === 'boolean')
|
|
498
|
-
return row.value ? 1 : 0;
|
|
499
|
-
throw new TypeError('Expected numeric or boolean observation.');
|
|
500
|
-
}
|
|
501
|
-
function mean(values) {
|
|
502
|
-
if (values.length === 0)
|
|
503
|
-
throw new TypeError('Mean requires at least one value.');
|
|
504
|
-
return values.reduce((total, value) => total + value, 0) / values.length;
|
|
505
|
-
}
|
|
506
|
-
function quantile(sortedValues, probability) {
|
|
507
|
-
if (sortedValues.length === 0)
|
|
508
|
-
throw new TypeError('Quantile requires values.');
|
|
509
|
-
if (!Number.isFinite(probability) || probability < 0 || probability > 1) {
|
|
510
|
-
throw new TypeError('Quantile probability must be in [0, 1].');
|
|
511
|
-
}
|
|
512
|
-
if (sortedValues.length === 1)
|
|
513
|
-
return sortedValues[0];
|
|
514
|
-
const position = (sortedValues.length - 1) * probability;
|
|
515
|
-
const lowerIndex = Math.floor(position);
|
|
516
|
-
const upperIndex = Math.ceil(position);
|
|
517
|
-
const weight = position - lowerIndex;
|
|
518
|
-
return sortedValues[lowerIndex] * (1 - weight) + sortedValues[upperIndex] * weight;
|
|
519
|
-
}
|
|
520
|
-
function parameterNumber(context, name, fallback) {
|
|
521
|
-
const value = parameters(context)[name];
|
|
522
|
-
return typeof value === 'number' && Number.isFinite(value) ? value : fallback;
|
|
523
|
-
}
|
|
524
|
-
function parameterInteger(context, name, fallback) {
|
|
525
|
-
const value = parameterNumber(context, name, fallback);
|
|
526
|
-
if (!Number.isSafeInteger(value))
|
|
527
|
-
throw new TypeError(`${name} must be a safe integer.`);
|
|
528
|
-
return value;
|
|
529
|
-
}
|
|
530
|
-
function incomplete(reasonCode) {
|
|
531
|
-
return {
|
|
532
|
-
analysisStatus: 'inconclusive',
|
|
533
|
-
reasonCodes: [reasonCode],
|
|
534
|
-
assumptionChecks: [{
|
|
535
|
-
assumptionId: 'sufficient-units',
|
|
536
|
-
checkStatus: 'failed',
|
|
537
|
-
reasonCode,
|
|
538
|
-
}],
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
function passedAssumption(assumptionId) {
|
|
542
|
-
return [{ assumptionId, checkStatus: 'passed' }];
|
|
543
|
-
}
|
|
544
|
-
function executeMean(context) {
|
|
545
|
-
const rows = observedRows(context);
|
|
546
|
-
if (rows.length === 0)
|
|
547
|
-
return incomplete('analysis-no-observed-values');
|
|
548
|
-
return {
|
|
549
|
-
analysisStatus: 'completed',
|
|
550
|
-
resultType: 'scalar',
|
|
551
|
-
value: mean(rows.map(numericValue)),
|
|
552
|
-
includedRowIds: rows.map((row) => row.rowId),
|
|
553
|
-
comparableRowIds: rows.map((row) => row.rowId),
|
|
554
|
-
assumptionChecks: passedAssumption('non-empty-observations'),
|
|
555
|
-
};
|
|
556
|
-
}
|
|
557
|
-
function executeRate(context) {
|
|
558
|
-
const rows = observedRows(context);
|
|
559
|
-
if (rows.length === 0)
|
|
560
|
-
return incomplete('analysis-no-observed-values');
|
|
561
|
-
if (rows.some((row) => row.rowStatus !== 'observed' || typeof row.value !== 'boolean')) {
|
|
562
|
-
throw new TypeError('Rate reducer requires boolean observations.');
|
|
563
|
-
}
|
|
564
|
-
return {
|
|
565
|
-
analysisStatus: 'completed',
|
|
566
|
-
resultType: 'scalar',
|
|
567
|
-
value: mean(rows.map(numericValue)),
|
|
568
|
-
includedRowIds: rows.map((row) => row.rowId),
|
|
569
|
-
comparableRowIds: rows.map((row) => row.rowId),
|
|
570
|
-
assumptionChecks: passedAssumption('non-empty-observations'),
|
|
571
|
-
};
|
|
572
|
-
}
|
|
573
|
-
function executeQuantile(context) {
|
|
574
|
-
const rows = observedRows(context);
|
|
575
|
-
if (rows.length === 0)
|
|
576
|
-
return incomplete('analysis-no-observed-values');
|
|
577
|
-
const probability = parameterNumber(context, 'probability', 0.5);
|
|
578
|
-
const values = rows.map(numericValue).sort((left, right) => left - right);
|
|
579
|
-
return {
|
|
580
|
-
analysisStatus: 'completed',
|
|
581
|
-
resultType: 'scalar',
|
|
582
|
-
value: quantile(values, probability),
|
|
583
|
-
includedRowIds: rows.map((row) => row.rowId),
|
|
584
|
-
comparableRowIds: rows.map((row) => row.rowId),
|
|
585
|
-
assumptionChecks: passedAssumption('non-empty-observations'),
|
|
586
|
-
};
|
|
587
|
-
}
|
|
588
|
-
function deterministicIndex(seed, replicateIndex, drawIndex, size) {
|
|
589
|
-
const digest = digestCanonicalJson({
|
|
590
|
-
derivation: 'omk.analysis-bootstrap-draw/v1',
|
|
591
|
-
seed,
|
|
592
|
-
replicateIndex,
|
|
593
|
-
drawIndex,
|
|
594
|
-
});
|
|
595
|
-
return Number.parseInt(digest.slice(7, 19), 16) % size;
|
|
596
|
-
}
|
|
597
|
-
function bootstrapSeed(context) {
|
|
598
|
-
const comparisonIds = context.inputs
|
|
599
|
-
.filter((input) => (input.inputKind === 'comparison'))
|
|
600
|
-
.map((input) => input.contrast.comparisonId)
|
|
601
|
-
.sort();
|
|
602
|
-
return digestCanonicalJson({
|
|
603
|
-
derivation: 'omk.analysis-bootstrap-seed/v1',
|
|
604
|
-
rootSeed: context.rootSeed,
|
|
605
|
-
analysisPlanDigest: context.analysisPlanDigest,
|
|
606
|
-
nodeId: context.node.nodeId,
|
|
607
|
-
implementationId: context.node.implementationId,
|
|
608
|
-
comparisonIds,
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
function metricInput(context) {
|
|
612
|
-
const inputs = metricInputs(context);
|
|
613
|
-
if (inputs.length !== 1) {
|
|
614
|
-
throw new TypeError('Built-in Analysis implementations require exactly one Metric input.');
|
|
615
|
-
}
|
|
616
|
-
return inputs[0];
|
|
617
|
-
}
|
|
618
|
-
function singleOptionalCoordinate(rows, select, label) {
|
|
619
|
-
const values = new Set(rows.map(select));
|
|
620
|
-
if (values.size > 1)
|
|
621
|
-
throw new TypeError(`One measurement unit cannot cross ${label}.`);
|
|
622
|
-
return select(rows[0]);
|
|
623
|
-
}
|
|
624
|
-
function aggregateMeasurementTrials(input, aggregation) {
|
|
625
|
-
if (input.metric.metricId !== input.referenceId
|
|
626
|
-
|| input.rows.some((row) => row.metricId !== input.referenceId)) {
|
|
627
|
-
throw new TypeError('Metric input identity differs from its measurement rows.');
|
|
628
|
-
}
|
|
629
|
-
const expected = new Map();
|
|
630
|
-
if (aggregation !== undefined) {
|
|
631
|
-
for (const member of aggregation.members) {
|
|
632
|
-
for (const replicate of member.replicates) {
|
|
633
|
-
expected.set(replicate.evaluatorId, {
|
|
634
|
-
ensembleMemberId: member.ensembleMemberId,
|
|
635
|
-
instrumentId: replicate.instrumentId,
|
|
636
|
-
replicateIndex: replicate.replicateIndex,
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
for (const row of input.rows) {
|
|
641
|
-
const coordinate = expected.get(row.evaluatorId);
|
|
642
|
-
if (coordinate === undefined
|
|
643
|
-
|| row.measurement.instrumentId !== coordinate.instrumentId
|
|
644
|
-
|| row.measurement.ensembleMemberId !== coordinate.ensembleMemberId
|
|
645
|
-
|| row.measurement.replicateGroupId !== aggregation.replicateGroupId
|
|
646
|
-
|| row.measurement.replicateIndex !== coordinate.replicateIndex) {
|
|
647
|
-
throw new TypeError('Measurement row differs from the sealed panel coordinates.');
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
const trials = groupRows(input.rows, (row) => canonicalizeJson([
|
|
652
|
-
row.targetId,
|
|
653
|
-
row.sampleId,
|
|
654
|
-
row.trialIndex,
|
|
655
|
-
]));
|
|
656
|
-
const completeTrials = [];
|
|
657
|
-
for (const rows of trials.values()) {
|
|
658
|
-
if (new Set(rows.map((row) => row.trialId)).size !== 1) {
|
|
659
|
-
throw new TypeError('One measurement trial cannot cross trial identity.');
|
|
660
|
-
}
|
|
661
|
-
const byEvaluator = new Map();
|
|
662
|
-
for (const row of rows) {
|
|
663
|
-
if (byEvaluator.has(row.evaluatorId)) {
|
|
664
|
-
throw new TypeError('Measurement trial contains a duplicate evaluator coordinate.');
|
|
665
|
-
}
|
|
666
|
-
byEvaluator.set(row.evaluatorId, row);
|
|
667
|
-
}
|
|
668
|
-
if (aggregation === undefined) {
|
|
669
|
-
if (rows.length !== 1) {
|
|
670
|
-
throw new TypeError('A non-panel Metric trial requires exactly one evaluator coordinate.');
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
else if (byEvaluator.size !== expected.size
|
|
674
|
-
|| [...expected.keys()].some((evaluatorId) => !byEvaluator.has(evaluatorId))) {
|
|
675
|
-
throw new TypeError('Measurement trial is missing a sealed evaluator coordinate.');
|
|
676
|
-
}
|
|
677
|
-
if (rows.some((row) => row.rowStatus !== 'observed'))
|
|
678
|
-
continue;
|
|
679
|
-
const value = aggregation === undefined
|
|
680
|
-
? numericValue(rows[0])
|
|
681
|
-
: (() => {
|
|
682
|
-
const memberValues = aggregation.members.map((member) => {
|
|
683
|
-
const values = member.replicates.map((replicate) => numericValue(byEvaluator.get(replicate.evaluatorId)));
|
|
684
|
-
return {
|
|
685
|
-
value: mean(values),
|
|
686
|
-
weight: 'weight' in member ? member.weight : 1,
|
|
687
|
-
};
|
|
688
|
-
});
|
|
689
|
-
return aggregation.method === 'weighted-mean'
|
|
690
|
-
? memberValues.reduce((sum, member) => sum + member.value * member.weight, 0)
|
|
691
|
-
: mean(memberValues.map((member) => member.value));
|
|
692
|
-
})();
|
|
693
|
-
completeTrials.push({
|
|
694
|
-
targetId: rows[0].targetId,
|
|
695
|
-
sampleId: rows[0].sampleId,
|
|
696
|
-
trialIndex: rows[0].trialIndex,
|
|
697
|
-
trialId: rows[0].trialId,
|
|
698
|
-
value,
|
|
699
|
-
rowIds: rows.map((row) => row.rowId),
|
|
700
|
-
...(singleOptionalCoordinate(rows, (row) => row.samplingUnitIds.clusterId, 'clusters') === undefined ? {} : {
|
|
701
|
-
clusterId: rows[0].samplingUnitIds.clusterId,
|
|
702
|
-
}),
|
|
703
|
-
...(singleOptionalCoordinate(rows, (row) => row.samplingUnitIds.stratumId, 'strata') === undefined ? {} : {
|
|
704
|
-
stratumId: rows[0].samplingUnitIds.stratumId,
|
|
705
|
-
}),
|
|
706
|
-
...(singleOptionalCoordinate(rows, (row) => row.samplingUnitIds.pairingBlockId, 'pairing blocks') === undefined ? {} : {
|
|
707
|
-
pairingBlockId: rows[0].samplingUnitIds.pairingBlockId,
|
|
708
|
-
}),
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
|
-
return completeTrials;
|
|
712
|
-
}
|
|
713
|
-
function averageMeasurementTrials(completeTrials) {
|
|
714
|
-
return [...groupRows(completeTrials, (trial) => (canonicalizeJson([trial.targetId, trial.sampleId]))).values()].map((group) => {
|
|
715
|
-
const trialsForSample = group;
|
|
716
|
-
const targetId = trialsForSample[0].targetId;
|
|
717
|
-
const sampleId = trialsForSample[0].sampleId;
|
|
718
|
-
if (trialsForSample.some((trial) => (trial.targetId !== targetId || trial.sampleId !== sampleId))) {
|
|
719
|
-
throw new TypeError('One sample measurement unit cannot cross target or sample identity.');
|
|
720
|
-
}
|
|
721
|
-
const stratumId = singleOptionalCoordinate(trialsForSample, (trial) => trial.stratumId, 'strata');
|
|
722
|
-
const clusterId = singleOptionalCoordinate(trialsForSample, (trial) => trial.clusterId, 'clusters');
|
|
723
|
-
const pairingBlockId = singleOptionalCoordinate(trialsForSample, (trial) => trial.pairingBlockId, 'pairing blocks');
|
|
724
|
-
return {
|
|
725
|
-
targetId,
|
|
726
|
-
sampleId,
|
|
727
|
-
value: mean(trialsForSample.map((trial) => trial.value)),
|
|
728
|
-
rowIds: trialsForSample.flatMap((trial) => trial.rowIds),
|
|
729
|
-
...(clusterId === undefined ? {} : { clusterId }),
|
|
730
|
-
...(stratumId === undefined ? {} : { stratumId }),
|
|
731
|
-
...(pairingBlockId === undefined ? {} : { pairingBlockId }),
|
|
732
|
-
};
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
function aggregateMeasurementUnits(context) {
|
|
736
|
-
const aggregation = MeasurementAggregationSchema.parse(parameters(context).measurementAggregation);
|
|
737
|
-
return averageMeasurementTrials(aggregateMeasurementTrials(metricInput(context), aggregation));
|
|
738
|
-
}
|
|
739
|
-
function compositeFailure(reasonCode, coverage, details) {
|
|
740
|
-
return {
|
|
741
|
-
analysisStatus: 'inconclusive',
|
|
742
|
-
reasonCodes: [reasonCode],
|
|
743
|
-
includedRowIds: [],
|
|
744
|
-
comparableRowIds: [],
|
|
745
|
-
assumptionChecks: [{
|
|
746
|
-
assumptionId: 'composite-source-domain',
|
|
747
|
-
checkStatus: 'failed',
|
|
748
|
-
reasonCode,
|
|
749
|
-
...(details === undefined ? {} : { details }),
|
|
750
|
-
}, {
|
|
751
|
-
assumptionId: 'composite-require-complete',
|
|
752
|
-
checkStatus: 'not-evaluated',
|
|
753
|
-
reasonCode,
|
|
754
|
-
details: {
|
|
755
|
-
unitKind: coverage.unitKind,
|
|
756
|
-
planned: coverage.planned,
|
|
757
|
-
complete: coverage.complete,
|
|
758
|
-
missing: coverage.missing,
|
|
759
|
-
},
|
|
760
|
-
}],
|
|
761
|
-
};
|
|
762
|
-
}
|
|
763
|
-
function compositeInputFailureReason(input) {
|
|
764
|
-
const metric = input.metric;
|
|
765
|
-
if (metric.scope !== 'sample'
|
|
766
|
-
|| metric.missingPolicyId !== 'exclude/v1'
|
|
767
|
-
|| (metric.direction !== 'higher-is-better'
|
|
768
|
-
&& metric.direction !== 'lower-is-better')) {
|
|
769
|
-
return 'analysis-composite-metric-contract-unsupported';
|
|
770
|
-
}
|
|
771
|
-
if (metric.valueType === 'numeric') {
|
|
772
|
-
const min = metric.scale?.min;
|
|
773
|
-
const max = metric.scale?.max;
|
|
774
|
-
if (typeof min !== 'number' || !Number.isFinite(min)
|
|
775
|
-
|| typeof max !== 'number' || !Number.isFinite(max) || min >= max) {
|
|
776
|
-
return 'analysis-composite-numeric-scale-invalid';
|
|
777
|
-
}
|
|
778
|
-
for (const row of input.rows) {
|
|
779
|
-
if (row.rowStatus !== 'observed')
|
|
780
|
-
continue;
|
|
781
|
-
if (typeof row.value !== 'number' || !Number.isFinite(row.value)) {
|
|
782
|
-
return 'analysis-composite-value-type-invalid';
|
|
783
|
-
}
|
|
784
|
-
if (row.value < min || row.value > max) {
|
|
785
|
-
return 'analysis-composite-value-outside-scale';
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
return undefined;
|
|
789
|
-
}
|
|
790
|
-
if (metric.valueType === 'boolean') {
|
|
791
|
-
return input.rows.some((row) => row.rowStatus === 'observed' && typeof row.value !== 'boolean')
|
|
792
|
-
? 'analysis-composite-value-type-invalid'
|
|
793
|
-
: undefined;
|
|
794
|
-
}
|
|
795
|
-
return 'analysis-composite-metric-contract-unsupported';
|
|
796
|
-
}
|
|
797
|
-
function compositeUtility(input, value) {
|
|
798
|
-
const metric = input.metric;
|
|
799
|
-
let normalized;
|
|
800
|
-
if (metric.valueType === 'boolean') {
|
|
801
|
-
if (value < 0 || value > 1) {
|
|
802
|
-
throw new TypeError('Aggregated boolean Metric value must remain in [0, 1].');
|
|
803
|
-
}
|
|
804
|
-
normalized = value;
|
|
805
|
-
}
|
|
806
|
-
else if (metric.valueType === 'numeric') {
|
|
807
|
-
const min = metric.scale?.min;
|
|
808
|
-
const max = metric.scale?.max;
|
|
809
|
-
if (typeof min !== 'number' || typeof max !== 'number' || min >= max
|
|
810
|
-
|| value < min || value > max) {
|
|
811
|
-
throw new TypeError('Aggregated numeric Metric value differs from its sealed scale.');
|
|
812
|
-
}
|
|
813
|
-
normalized = (value - min) / (max - min);
|
|
814
|
-
}
|
|
815
|
-
else {
|
|
816
|
-
throw new TypeError('Composite utility supports only boolean and numeric Metrics.');
|
|
817
|
-
}
|
|
818
|
-
return metric.direction === 'lower-is-better' ? 1 - normalized : normalized;
|
|
819
|
-
}
|
|
820
|
-
function compositeCoverageAssumption(coverage) {
|
|
821
|
-
return {
|
|
822
|
-
assumptionId: 'composite-require-complete',
|
|
823
|
-
checkStatus: 'passed',
|
|
824
|
-
details: {
|
|
825
|
-
unitKind: coverage.unitKind,
|
|
826
|
-
planned: coverage.planned,
|
|
827
|
-
complete: coverage.complete,
|
|
828
|
-
missing: coverage.missing,
|
|
829
|
-
},
|
|
830
|
-
};
|
|
831
|
-
}
|
|
832
|
-
function buildCompositeUnits(context) {
|
|
833
|
-
const sealed = CompositeBootstrapParametersSchema.parse(context.node.parameters ?? {});
|
|
834
|
-
const inputs = metricInputs(context);
|
|
835
|
-
if (inputs.length !== sealed.components.length) {
|
|
836
|
-
throw new TypeError('Composite Analysis requires exactly its sealed component Metric inputs.');
|
|
837
|
-
}
|
|
838
|
-
const inputsByMetric = new Map(inputs.map((input) => [input.referenceId, input]));
|
|
839
|
-
if (inputsByMetric.size !== inputs.length
|
|
840
|
-
|| sealed.components.some((component) => !inputsByMetric.has(component.metricId))) {
|
|
841
|
-
throw new TypeError('Composite Analysis inputs differ from its sealed components.');
|
|
842
|
-
}
|
|
843
|
-
const plannedRows = inputs.flatMap((input) => input.rows);
|
|
844
|
-
const plannedCoordinates = new Set();
|
|
845
|
-
for (const row of plannedRows) {
|
|
846
|
-
plannedCoordinates.add(canonicalizeJson([
|
|
847
|
-
row.targetId,
|
|
848
|
-
row.sampleId,
|
|
849
|
-
row.trialIndex,
|
|
850
|
-
]));
|
|
851
|
-
}
|
|
852
|
-
const completeTrialsByMetric = new Map();
|
|
853
|
-
for (const component of sealed.components) {
|
|
854
|
-
const input = inputsByMetric.get(component.metricId);
|
|
855
|
-
const reasonCode = compositeInputFailureReason(input);
|
|
856
|
-
if (reasonCode !== undefined) {
|
|
857
|
-
return {
|
|
858
|
-
result: compositeFailure(reasonCode, {
|
|
859
|
-
unitKind: 'target-sample-trial',
|
|
860
|
-
planned: plannedCoordinates.size,
|
|
861
|
-
complete: 0,
|
|
862
|
-
missing: plannedCoordinates.size,
|
|
863
|
-
}, { metricId: component.metricId }),
|
|
864
|
-
};
|
|
865
|
-
}
|
|
866
|
-
const aggregation = component.measurementAggregation === undefined
|
|
867
|
-
? undefined
|
|
868
|
-
: component.measurementAggregation;
|
|
869
|
-
const trials = aggregateMeasurementTrials(input, aggregation);
|
|
870
|
-
completeTrialsByMetric.set(component.metricId, new Map(trials.map((trial) => [
|
|
871
|
-
canonicalizeJson([trial.targetId, trial.sampleId, trial.trialIndex]),
|
|
872
|
-
trial,
|
|
873
|
-
])));
|
|
874
|
-
}
|
|
875
|
-
const completeCompositeTrials = [];
|
|
876
|
-
for (const coordinate of [...plannedCoordinates].sort()) {
|
|
877
|
-
const componentTrials = sealed.components.map((component) => (completeTrialsByMetric.get(component.metricId)?.get(coordinate)));
|
|
878
|
-
if (componentTrials.some((trial) => trial === undefined))
|
|
879
|
-
continue;
|
|
880
|
-
const complete = componentTrials;
|
|
881
|
-
const targetId = complete[0].targetId;
|
|
882
|
-
const sampleId = complete[0].sampleId;
|
|
883
|
-
const trialIndex = complete[0].trialIndex;
|
|
884
|
-
if (complete.some((trial) => trial.targetId !== targetId
|
|
885
|
-
|| trial.sampleId !== sampleId || trial.trialIndex !== trialIndex)) {
|
|
886
|
-
throw new TypeError('Composite coordinate crosses target, sample, or trial identity.');
|
|
887
|
-
}
|
|
888
|
-
if (new Set(complete.map((trial) => trial.trialId)).size !== 1) {
|
|
889
|
-
throw new TypeError('Composite coordinate crosses trial identity.');
|
|
890
|
-
}
|
|
891
|
-
const trialId = complete[0].trialId;
|
|
892
|
-
const clusterId = singleOptionalCoordinate(complete, (trial) => trial.clusterId, 'clusters');
|
|
893
|
-
const stratumId = singleOptionalCoordinate(complete, (trial) => trial.stratumId, 'strata');
|
|
894
|
-
const pairingBlockId = singleOptionalCoordinate(complete, (trial) => trial.pairingBlockId, 'pairing blocks');
|
|
895
|
-
const value = sealed.components.reduce((sum, component, index) => (sum + component.weight * compositeUtility(inputsByMetric.get(component.metricId), complete[index].value)), 0);
|
|
896
|
-
if (value < 0 || value > 1) {
|
|
897
|
-
throw new TypeError('Composite utility must remain within its sealed [0, 1] range.');
|
|
898
|
-
}
|
|
899
|
-
completeCompositeTrials.push({
|
|
900
|
-
targetId,
|
|
901
|
-
sampleId,
|
|
902
|
-
trialIndex,
|
|
903
|
-
trialId,
|
|
904
|
-
value,
|
|
905
|
-
rowIds: complete.flatMap((trial) => trial.rowIds),
|
|
906
|
-
...(clusterId === undefined ? {} : { clusterId }),
|
|
907
|
-
...(stratumId === undefined ? {} : { stratumId }),
|
|
908
|
-
...(pairingBlockId === undefined ? {} : { pairingBlockId }),
|
|
909
|
-
});
|
|
910
|
-
}
|
|
911
|
-
const coverage = {
|
|
912
|
-
unitKind: 'target-sample-trial',
|
|
913
|
-
planned: plannedCoordinates.size,
|
|
914
|
-
complete: completeCompositeTrials.length,
|
|
915
|
-
missing: plannedCoordinates.size - completeCompositeTrials.length,
|
|
916
|
-
};
|
|
917
|
-
return {
|
|
918
|
-
units: averageMeasurementTrials(completeCompositeTrials),
|
|
919
|
-
plannedRows,
|
|
920
|
-
coverage,
|
|
921
|
-
parameters: sealed,
|
|
922
|
-
};
|
|
923
|
-
}
|
|
924
|
-
function withCompositeEvidence(result, units, coverage) {
|
|
925
|
-
const coverageCheck = compositeCoverageAssumption(coverage);
|
|
926
|
-
const rowIds = units.flatMap((unit) => unit.rowIds);
|
|
927
|
-
if (result.analysisStatus !== 'completed') {
|
|
928
|
-
return {
|
|
929
|
-
...result,
|
|
930
|
-
includedRowIds: result.includedRowIds ?? rowIds,
|
|
931
|
-
comparableRowIds: result.comparableRowIds ?? result.includedRowIds ?? rowIds,
|
|
932
|
-
assumptionChecks: [...(result.assumptionChecks ?? []), coverageCheck],
|
|
933
|
-
};
|
|
934
|
-
}
|
|
935
|
-
return {
|
|
936
|
-
...result,
|
|
937
|
-
includedRowIds: result.includedRowIds ?? rowIds,
|
|
938
|
-
comparableRowIds: result.comparableRowIds ?? result.includedRowIds ?? rowIds,
|
|
939
|
-
assumptionChecks: [...(result.assumptionChecks ?? []), coverageCheck],
|
|
940
|
-
};
|
|
941
|
-
}
|
|
942
|
-
function hierarchicalScalarResult(context, statistic) {
|
|
943
|
-
const units = aggregateMeasurementUnits(context);
|
|
944
|
-
if (units.length === 0)
|
|
945
|
-
return incomplete('analysis-no-observed-values');
|
|
946
|
-
return {
|
|
947
|
-
analysisStatus: 'completed',
|
|
948
|
-
resultType: 'scalar',
|
|
949
|
-
value: statistic(units.map((unit) => unit.value)),
|
|
950
|
-
includedRowIds: units.flatMap((unit) => unit.rowIds),
|
|
951
|
-
comparableRowIds: units.flatMap((unit) => unit.rowIds),
|
|
952
|
-
assumptionChecks: passedAssumption('complete-measurement-units'),
|
|
953
|
-
};
|
|
954
|
-
}
|
|
955
|
-
function executeHierarchicalMean(context) {
|
|
956
|
-
return hierarchicalScalarResult(context, mean);
|
|
957
|
-
}
|
|
958
|
-
function executeHierarchicalRate(context) {
|
|
959
|
-
return hierarchicalScalarResult(context, mean);
|
|
960
|
-
}
|
|
961
|
-
function executeHierarchicalQuantile(context) {
|
|
962
|
-
const probability = parameterNumber(context, 'probability', 0.5);
|
|
963
|
-
return hierarchicalScalarResult(context, (values) => quantile([...values].sort((left, right) => left - right), probability));
|
|
964
|
-
}
|
|
965
|
-
function percentileInterval(context, units) {
|
|
966
|
-
const resamples = parameterInteger(context, 'resamples', 1_000);
|
|
967
|
-
const alpha = parameterNumber(context, 'alpha', 0.05);
|
|
968
|
-
if (resamples < 1 || alpha <= 0 || alpha >= 1) {
|
|
969
|
-
throw new TypeError('Bootstrap requires positive resamples and alpha in (0, 1).');
|
|
970
|
-
}
|
|
971
|
-
if (units.length < 2)
|
|
972
|
-
return incomplete('analysis-insufficient-resampling-units');
|
|
973
|
-
const seed = bootstrapSeed(context);
|
|
974
|
-
const strata = new Map();
|
|
975
|
-
for (const unit of units) {
|
|
976
|
-
const stratumId = unit.stratumId ?? 'omk:unstratified';
|
|
977
|
-
const members = strata.get(stratumId) ?? [];
|
|
978
|
-
members.push(unit);
|
|
979
|
-
strata.set(stratumId, members);
|
|
980
|
-
}
|
|
981
|
-
const estimates = [];
|
|
982
|
-
for (let replicate = 0; replicate < resamples; replicate += 1) {
|
|
983
|
-
const sample = [];
|
|
984
|
-
let drawOffset = 0;
|
|
985
|
-
for (const [stratumId, members] of [...strata.entries()].sort()) {
|
|
986
|
-
const stratumSeed = digestCanonicalJson({
|
|
987
|
-
derivation: 'omk.analysis-bootstrap-stratum-seed/v1',
|
|
988
|
-
seed,
|
|
989
|
-
stratumId,
|
|
990
|
-
});
|
|
991
|
-
for (let draw = 0; draw < members.length; draw += 1) {
|
|
992
|
-
sample.push(members[deterministicIndex(stratumSeed, replicate, drawOffset + draw, members.length)].value);
|
|
993
|
-
}
|
|
994
|
-
drawOffset += members.length;
|
|
995
|
-
}
|
|
996
|
-
estimates.push(mean(sample));
|
|
997
|
-
}
|
|
998
|
-
estimates.sort((left, right) => left - right);
|
|
999
|
-
return {
|
|
1000
|
-
analysisStatus: 'completed',
|
|
1001
|
-
resultType: 'interval',
|
|
1002
|
-
value: {
|
|
1003
|
-
estimate: mean(units.map((unit) => unit.value)),
|
|
1004
|
-
lower: quantile(estimates, alpha / 2),
|
|
1005
|
-
upper: quantile(estimates, 1 - alpha / 2),
|
|
1006
|
-
confidenceLevel: 1 - alpha,
|
|
1007
|
-
resamples,
|
|
1008
|
-
unitCount: units.length,
|
|
1009
|
-
method: 'percentile',
|
|
1010
|
-
},
|
|
1011
|
-
assumptionChecks: passedAssumption('sufficient-resampling-units'),
|
|
1012
|
-
};
|
|
1013
|
-
}
|
|
1014
|
-
function groupRows(rows, key) {
|
|
1015
|
-
const groups = new Map();
|
|
1016
|
-
for (const row of rows) {
|
|
1017
|
-
const groupId = key(row);
|
|
1018
|
-
if (groupId === undefined)
|
|
1019
|
-
continue;
|
|
1020
|
-
const group = groups.get(groupId) ?? [];
|
|
1021
|
-
group.push(row);
|
|
1022
|
-
groups.set(groupId, group);
|
|
1023
|
-
}
|
|
1024
|
-
return groups;
|
|
1025
|
-
}
|
|
1026
|
-
function groupUnit(group) {
|
|
1027
|
-
const strata = new Set(group.map((row) => row.samplingUnitIds.stratumId));
|
|
1028
|
-
if (strata.size > 1)
|
|
1029
|
-
throw new TypeError('One resampling unit cannot cross strata.');
|
|
1030
|
-
const stratumId = group[0]?.samplingUnitIds.stratumId;
|
|
1031
|
-
return {
|
|
1032
|
-
value: mean(group.map(numericValue)),
|
|
1033
|
-
...(stratumId !== undefined ? { stratumId } : {}),
|
|
1034
|
-
};
|
|
1035
|
-
}
|
|
1036
|
-
function executeMeanBootstrap(context) {
|
|
1037
|
-
const rows = observedRows(context);
|
|
1038
|
-
const unitKind = context.sampling.resamplingUnit;
|
|
1039
|
-
const groups = groupRows(rows, (row) => {
|
|
1040
|
-
if (unitKind === 'sample')
|
|
1041
|
-
return row.sampleId;
|
|
1042
|
-
if (unitKind === 'paired-block')
|
|
1043
|
-
return row.samplingUnitIds.pairingBlockId;
|
|
1044
|
-
if (unitKind === 'run')
|
|
1045
|
-
return 'run';
|
|
1046
|
-
return undefined;
|
|
1047
|
-
});
|
|
1048
|
-
const interval = percentileInterval(context, [...groups.values()].map(groupUnit));
|
|
1049
|
-
return interval.analysisStatus === 'completed' ? {
|
|
1050
|
-
...interval,
|
|
1051
|
-
includedRowIds: [...groups.values()].flat().map((row) => row.rowId),
|
|
1052
|
-
comparableRowIds: [...groups.values()].flat().map((row) => row.rowId),
|
|
1053
|
-
} : interval;
|
|
1054
|
-
}
|
|
1055
|
-
function executeClusterBootstrap(context) {
|
|
1056
|
-
const rows = observedRows(context);
|
|
1057
|
-
const groups = groupRows(rows, (row) => row.samplingUnitIds.clusterId);
|
|
1058
|
-
const interval = percentileInterval(context, [...groups.values()].map(groupUnit));
|
|
1059
|
-
return interval.analysisStatus === 'completed' ? {
|
|
1060
|
-
...interval,
|
|
1061
|
-
includedRowIds: [...groups.values()].flat().map((row) => row.rowId),
|
|
1062
|
-
comparableRowIds: [...groups.values()].flat().map((row) => row.rowId),
|
|
1063
|
-
} : interval;
|
|
1064
|
-
}
|
|
1065
|
-
function executePairedBootstrap(context) {
|
|
1066
|
-
const comparisonInputs = context.inputs.filter((input) => (input.inputKind === 'comparison'));
|
|
1067
|
-
if (comparisonInputs.length !== 1) {
|
|
1068
|
-
throw new TypeError('Paired bootstrap requires exactly one Comparison contrast.');
|
|
1069
|
-
}
|
|
1070
|
-
const comparisonInput = comparisonInputs[0];
|
|
1071
|
-
const metricInput = metricInputs(context)[0];
|
|
1072
|
-
if (metricInput === undefined || comparisonInput.contrast.metricId !== metricInput.referenceId) {
|
|
1073
|
-
return incomplete('analysis-paired-bootstrap-requires-one-matching-metric');
|
|
1074
|
-
}
|
|
1075
|
-
const controlId = comparisonInput.contrast.controlTargetId;
|
|
1076
|
-
const treatmentId = comparisonInput.contrast.treatmentTargetId;
|
|
1077
|
-
const rows = observedRows(context);
|
|
1078
|
-
const groups = groupRows(rows, (row) => row.samplingUnitIds.pairingBlockId);
|
|
1079
|
-
const differences = [];
|
|
1080
|
-
const includedRows = [];
|
|
1081
|
-
for (const group of groups.values()) {
|
|
1082
|
-
const control = group.filter((row) => row.targetId === controlId);
|
|
1083
|
-
const treatment = group.filter((row) => row.targetId === treatmentId);
|
|
1084
|
-
if (control.length === 0 || treatment.length === 0)
|
|
1085
|
-
continue;
|
|
1086
|
-
const strata = new Set(group.map((row) => row.samplingUnitIds.stratumId));
|
|
1087
|
-
if (strata.size > 1)
|
|
1088
|
-
throw new TypeError('One pairing unit cannot cross strata.');
|
|
1089
|
-
const stratumId = group[0]?.samplingUnitIds.stratumId;
|
|
1090
|
-
differences.push({
|
|
1091
|
-
value: mean(treatment.map(numericValue)) - mean(control.map(numericValue)),
|
|
1092
|
-
...(stratumId !== undefined ? { stratumId } : {}),
|
|
1093
|
-
});
|
|
1094
|
-
includedRows.push(...control, ...treatment);
|
|
1095
|
-
}
|
|
1096
|
-
const interval = percentileInterval(context, differences);
|
|
1097
|
-
return interval.analysisStatus === 'completed' ? {
|
|
1098
|
-
...interval,
|
|
1099
|
-
includedRowIds: includedRows.map((row) => row.rowId),
|
|
1100
|
-
comparableRowIds: includedRows.map((row) => row.rowId),
|
|
1101
|
-
} : interval;
|
|
1102
|
-
}
|
|
1103
|
-
function executeHierarchicalMeanBootstrap(context) {
|
|
1104
|
-
const units = aggregateMeasurementUnits(context);
|
|
1105
|
-
let bootstrapUnits = units;
|
|
1106
|
-
if (context.sampling.resamplingUnit === 'paired-block') {
|
|
1107
|
-
if (units.some((unit) => unit.pairingBlockId === undefined)) {
|
|
1108
|
-
return incomplete('analysis-pairing-membership-missing');
|
|
1109
|
-
}
|
|
1110
|
-
bootstrapUnits = [...groupRows(units, (unit) => unit.pairingBlockId).values()].map((members) => {
|
|
1111
|
-
const stratumId = singleOptionalCoordinate(members, (member) => member.stratumId, 'strata');
|
|
1112
|
-
return {
|
|
1113
|
-
value: mean(members.map((member) => member.value)),
|
|
1114
|
-
...(stratumId === undefined ? {} : { stratumId }),
|
|
1115
|
-
};
|
|
1116
|
-
});
|
|
1117
|
-
}
|
|
1118
|
-
const interval = percentileInterval(context, bootstrapUnits);
|
|
1119
|
-
return interval.analysisStatus === 'completed' ? {
|
|
1120
|
-
...interval,
|
|
1121
|
-
includedRowIds: units.flatMap((unit) => unit.rowIds),
|
|
1122
|
-
comparableRowIds: units.flatMap((unit) => unit.rowIds),
|
|
1123
|
-
} : interval;
|
|
1124
|
-
}
|
|
1125
|
-
function executeHierarchicalClusterBootstrap(context) {
|
|
1126
|
-
const units = aggregateMeasurementUnits(context);
|
|
1127
|
-
const groups = new Map();
|
|
1128
|
-
for (const unit of units) {
|
|
1129
|
-
if (unit.clusterId === undefined)
|
|
1130
|
-
return incomplete('analysis-cluster-membership-missing');
|
|
1131
|
-
groups.set(unit.clusterId, [...(groups.get(unit.clusterId) ?? []), unit]);
|
|
1132
|
-
}
|
|
1133
|
-
const clusterUnits = [...groups.values()].map((members) => {
|
|
1134
|
-
const stratumId = singleOptionalCoordinate(members, (member) => member.stratumId, 'strata');
|
|
1135
|
-
return {
|
|
1136
|
-
value: mean(members.map((member) => member.value)),
|
|
1137
|
-
...(stratumId === undefined ? {} : { stratumId }),
|
|
1138
|
-
};
|
|
1139
|
-
});
|
|
1140
|
-
const interval = percentileInterval(context, clusterUnits);
|
|
1141
|
-
return interval.analysisStatus === 'completed' ? {
|
|
1142
|
-
...interval,
|
|
1143
|
-
includedRowIds: units.flatMap((unit) => unit.rowIds),
|
|
1144
|
-
comparableRowIds: units.flatMap((unit) => unit.rowIds),
|
|
1145
|
-
} : interval;
|
|
1146
|
-
}
|
|
1147
|
-
function executeHierarchicalPairedBootstrap(context) {
|
|
1148
|
-
const comparisonInputs = context.inputs.filter((input) => (input.inputKind === 'comparison'));
|
|
1149
|
-
if (comparisonInputs.length !== 1) {
|
|
1150
|
-
throw new TypeError('Hierarchical paired bootstrap requires exactly one Comparison contrast.');
|
|
1151
|
-
}
|
|
1152
|
-
const comparisonInput = comparisonInputs[0];
|
|
1153
|
-
const input = metricInput(context);
|
|
1154
|
-
if (comparisonInput.contrast.metricId !== input.referenceId) {
|
|
1155
|
-
return incomplete('analysis-paired-bootstrap-requires-one-matching-metric');
|
|
1156
|
-
}
|
|
1157
|
-
const controlId = comparisonInput.contrast.controlTargetId;
|
|
1158
|
-
const treatmentId = comparisonInput.contrast.treatmentTargetId;
|
|
1159
|
-
const units = aggregateMeasurementUnits(context);
|
|
1160
|
-
const groups = groupRows(units, (unit) => unit.pairingBlockId);
|
|
1161
|
-
const differences = [];
|
|
1162
|
-
const includedUnits = [];
|
|
1163
|
-
for (const group of groups.values()) {
|
|
1164
|
-
const control = group.filter((unit) => unit.targetId === controlId);
|
|
1165
|
-
const treatment = group.filter((unit) => unit.targetId === treatmentId);
|
|
1166
|
-
if (control.length === 0 || treatment.length === 0)
|
|
1167
|
-
continue;
|
|
1168
|
-
const stratumId = singleOptionalCoordinate(group, (unit) => unit.stratumId, 'strata');
|
|
1169
|
-
differences.push({
|
|
1170
|
-
value: mean(treatment.map((unit) => unit.value))
|
|
1171
|
-
- mean(control.map((unit) => unit.value)),
|
|
1172
|
-
...(stratumId === undefined ? {} : { stratumId }),
|
|
1173
|
-
});
|
|
1174
|
-
includedUnits.push(...control, ...treatment);
|
|
1175
|
-
}
|
|
1176
|
-
const interval = percentileInterval(context, differences);
|
|
1177
|
-
return interval.analysisStatus === 'completed' ? {
|
|
1178
|
-
...interval,
|
|
1179
|
-
includedRowIds: includedUnits.flatMap((unit) => unit.rowIds),
|
|
1180
|
-
comparableRowIds: includedUnits.flatMap((unit) => unit.rowIds),
|
|
1181
|
-
} : interval;
|
|
1182
|
-
}
|
|
1183
|
-
function compositeBuildOrResult(context) {
|
|
1184
|
-
const built = buildCompositeUnits(context);
|
|
1185
|
-
return 'result' in built ? built.result : built;
|
|
1186
|
-
}
|
|
1187
|
-
function executeCompositeMeanBootstrap(context) {
|
|
1188
|
-
const built = compositeBuildOrResult(context);
|
|
1189
|
-
if ('analysisStatus' in built)
|
|
1190
|
-
return built;
|
|
1191
|
-
let bootstrapUnits = built.units;
|
|
1192
|
-
if (context.sampling.resamplingUnit === 'paired-block') {
|
|
1193
|
-
if (built.units.some((unit) => unit.pairingBlockId === undefined)) {
|
|
1194
|
-
return withCompositeEvidence(incomplete('analysis-pairing-membership-missing'), built.units, built.coverage);
|
|
1195
|
-
}
|
|
1196
|
-
bootstrapUnits = [...groupRows(built.units, (unit) => unit.pairingBlockId).values()].map((members) => {
|
|
1197
|
-
const stratumId = singleOptionalCoordinate(members, (member) => member.stratumId, 'strata');
|
|
1198
|
-
return {
|
|
1199
|
-
value: mean(members.map((member) => member.value)),
|
|
1200
|
-
...(stratumId === undefined ? {} : { stratumId }),
|
|
1201
|
-
};
|
|
1202
|
-
});
|
|
1203
|
-
}
|
|
1204
|
-
else if (context.sampling.resamplingUnit !== 'sample') {
|
|
1205
|
-
return withCompositeEvidence(incomplete('analysis-composite-resampling-unit-unsupported'), built.units, built.coverage);
|
|
1206
|
-
}
|
|
1207
|
-
return withCompositeEvidence(percentileInterval(context, bootstrapUnits), built.units, built.coverage);
|
|
1208
|
-
}
|
|
1209
|
-
function executeCompositeClusterBootstrap(context) {
|
|
1210
|
-
const built = compositeBuildOrResult(context);
|
|
1211
|
-
if ('analysisStatus' in built)
|
|
1212
|
-
return built;
|
|
1213
|
-
const groups = new Map();
|
|
1214
|
-
for (const unit of built.units) {
|
|
1215
|
-
if (unit.clusterId === undefined) {
|
|
1216
|
-
return withCompositeEvidence(incomplete('analysis-cluster-membership-missing'), built.units, built.coverage);
|
|
1217
|
-
}
|
|
1218
|
-
groups.set(unit.clusterId, [...(groups.get(unit.clusterId) ?? []), unit]);
|
|
1219
|
-
}
|
|
1220
|
-
const clusterUnits = [...groups.values()].map((members) => {
|
|
1221
|
-
const stratumId = singleOptionalCoordinate(members, (member) => member.stratumId, 'strata');
|
|
1222
|
-
return {
|
|
1223
|
-
value: mean(members.map((member) => member.value)),
|
|
1224
|
-
...(stratumId === undefined ? {} : { stratumId }),
|
|
1225
|
-
};
|
|
1226
|
-
});
|
|
1227
|
-
return withCompositeEvidence(percentileInterval(context, clusterUnits), built.units, built.coverage);
|
|
1228
|
-
}
|
|
1229
|
-
function executeCompositePairedBootstrap(context) {
|
|
1230
|
-
const built = compositeBuildOrResult(context);
|
|
1231
|
-
if ('analysisStatus' in built)
|
|
1232
|
-
return built;
|
|
1233
|
-
const comparisonInputs = context.inputs.filter((input) => (input.inputKind === 'comparison'));
|
|
1234
|
-
if (comparisonInputs.length !== 1) {
|
|
1235
|
-
throw new TypeError('Composite paired bootstrap requires exactly one Comparison contrast.');
|
|
1236
|
-
}
|
|
1237
|
-
const comparison = comparisonInputs[0].contrast;
|
|
1238
|
-
if (comparison.metricId !== built.parameters.compositeMetricId) {
|
|
1239
|
-
return withCompositeEvidence(incomplete('analysis-composite-comparison-metric-mismatch'), built.units, built.coverage);
|
|
1240
|
-
}
|
|
1241
|
-
if (built.units.some((unit) => unit.pairingBlockId === undefined)) {
|
|
1242
|
-
return withCompositeEvidence(incomplete('analysis-pairing-membership-missing'), built.units, built.coverage);
|
|
1243
|
-
}
|
|
1244
|
-
const differences = [];
|
|
1245
|
-
const includedUnits = [];
|
|
1246
|
-
for (const group of groupRows(built.units, (unit) => unit.pairingBlockId).values()) {
|
|
1247
|
-
const control = group.filter((unit) => unit.targetId === comparison.controlTargetId);
|
|
1248
|
-
const treatment = group.filter((unit) => unit.targetId === comparison.treatmentTargetId);
|
|
1249
|
-
if (control.length === 0 || treatment.length === 0)
|
|
1250
|
-
continue;
|
|
1251
|
-
const stratumId = singleOptionalCoordinate(group, (unit) => unit.stratumId, 'strata');
|
|
1252
|
-
differences.push({
|
|
1253
|
-
value: mean(treatment.map((unit) => unit.value))
|
|
1254
|
-
- mean(control.map((unit) => unit.value)),
|
|
1255
|
-
...(stratumId === undefined ? {} : { stratumId }),
|
|
1256
|
-
});
|
|
1257
|
-
includedUnits.push(...control, ...treatment);
|
|
1258
|
-
}
|
|
1259
|
-
const interval = percentileInterval(context, differences);
|
|
1260
|
-
return withCompositeEvidence(interval.analysisStatus === 'completed' ? {
|
|
1261
|
-
...interval,
|
|
1262
|
-
includedRowIds: includedUnits.flatMap((unit) => unit.rowIds),
|
|
1263
|
-
comparableRowIds: includedUnits.flatMap((unit) => unit.rowIds),
|
|
1264
|
-
} : interval, includedUnits, built.coverage);
|
|
1265
|
-
}
|
|
1266
|
-
function bootstrapArmStratumMean(seed, armId, stratumId, replicate, members) {
|
|
1267
|
-
const stratumSeed = digestCanonicalJson({
|
|
1268
|
-
derivation: 'omk.analysis-unpaired-bootstrap-arm-stratum-seed/v1',
|
|
1269
|
-
seed,
|
|
1270
|
-
armId,
|
|
1271
|
-
stratumId,
|
|
1272
|
-
});
|
|
1273
|
-
return mean(Array.from({ length: members.length }, (_, draw) => (members[deterministicIndex(stratumSeed, replicate, draw, members.length)].value)));
|
|
1274
|
-
}
|
|
1275
|
-
function executeUnpairedBootstrapWithUnits(context, units, plannedRows, expectedMetricId) {
|
|
1276
|
-
const comparisonInputs = context.inputs.filter((input) => (input.inputKind === 'comparison'));
|
|
1277
|
-
if (comparisonInputs.length !== 1) {
|
|
1278
|
-
throw new TypeError('Unpaired bootstrap requires exactly one Comparison contrast.');
|
|
1279
|
-
}
|
|
1280
|
-
const comparisonInput = comparisonInputs[0];
|
|
1281
|
-
const metricId = expectedMetricId ?? metricInputs(context)[0]?.referenceId;
|
|
1282
|
-
if (metricId === undefined || comparisonInput.contrast.metricId !== metricId) {
|
|
1283
|
-
return incomplete('analysis-unpaired-bootstrap-requires-one-matching-metric');
|
|
1284
|
-
}
|
|
1285
|
-
const controlId = comparisonInput.contrast.controlTargetId;
|
|
1286
|
-
const treatmentId = comparisonInput.contrast.treatmentTargetId;
|
|
1287
|
-
const controlUnits = units.filter((unit) => unit.targetId === controlId);
|
|
1288
|
-
const treatmentUnits = units.filter((unit) => unit.targetId === treatmentId);
|
|
1289
|
-
const controlSampleIds = new Set(controlUnits.map((unit) => unit.sampleId));
|
|
1290
|
-
if (treatmentUnits.some((unit) => controlSampleIds.has(unit.sampleId))) {
|
|
1291
|
-
return incomplete('analysis-unpaired-bootstrap-overlapping-units');
|
|
1292
|
-
}
|
|
1293
|
-
if (controlUnits.length < 2 || treatmentUnits.length < 2) {
|
|
1294
|
-
return incomplete('analysis-insufficient-resampling-units-per-arm');
|
|
1295
|
-
}
|
|
1296
|
-
const controlStrata = new Set(controlUnits.map((unit) => unit.stratumId ?? 'omk:unstratified'));
|
|
1297
|
-
const treatmentStrata = new Set(treatmentUnits.map((unit) => unit.stratumId ?? 'omk:unstratified'));
|
|
1298
|
-
if (controlStrata.size !== treatmentStrata.size
|
|
1299
|
-
|| [...controlStrata].some((stratumId) => !treatmentStrata.has(stratumId))) {
|
|
1300
|
-
return incomplete('analysis-unpaired-bootstrap-strata-not-shared');
|
|
1301
|
-
}
|
|
1302
|
-
const controlByStratum = new Map();
|
|
1303
|
-
const treatmentByStratum = new Map();
|
|
1304
|
-
for (const unit of controlUnits) {
|
|
1305
|
-
const stratumId = unit.stratumId ?? 'omk:unstratified';
|
|
1306
|
-
controlByStratum.set(stratumId, [...(controlByStratum.get(stratumId) ?? []), unit]);
|
|
1307
|
-
}
|
|
1308
|
-
for (const unit of treatmentUnits) {
|
|
1309
|
-
const stratumId = unit.stratumId ?? 'omk:unstratified';
|
|
1310
|
-
treatmentByStratum.set(stratumId, [...(treatmentByStratum.get(stratumId) ?? []), unit]);
|
|
1311
|
-
}
|
|
1312
|
-
const plannedStratumBySample = new Map();
|
|
1313
|
-
for (const row of plannedRows) {
|
|
1314
|
-
const stratumId = row.samplingUnitIds.stratumId ?? 'omk:unstratified';
|
|
1315
|
-
const existing = plannedStratumBySample.get(row.sampleId);
|
|
1316
|
-
if (existing !== undefined && existing !== stratumId) {
|
|
1317
|
-
throw new TypeError('One experimental unit cannot cross planned strata.');
|
|
1318
|
-
}
|
|
1319
|
-
plannedStratumBySample.set(row.sampleId, stratumId);
|
|
1320
|
-
}
|
|
1321
|
-
const plannedCountByStratum = new Map();
|
|
1322
|
-
for (const stratumId of plannedStratumBySample.values()) {
|
|
1323
|
-
plannedCountByStratum.set(stratumId, (plannedCountByStratum.get(stratumId) ?? 0) + 1);
|
|
1324
|
-
}
|
|
1325
|
-
const plannedUnitCount = plannedStratumBySample.size;
|
|
1326
|
-
const strata = [...controlStrata].sort().map((stratumId) => ({
|
|
1327
|
-
stratumId,
|
|
1328
|
-
control: controlByStratum.get(stratumId) ?? [],
|
|
1329
|
-
treatment: treatmentByStratum.get(stratumId) ?? [],
|
|
1330
|
-
plannedCount: plannedCountByStratum.get(stratumId) ?? 0,
|
|
1331
|
-
}));
|
|
1332
|
-
if (plannedUnitCount === 0
|
|
1333
|
-
|| strata.some((stratum) => stratum.plannedCount === 0)
|
|
1334
|
-
|| [...plannedCountByStratum.keys()].some((stratumId) => !controlStrata.has(stratumId))) {
|
|
1335
|
-
return incomplete('analysis-unpaired-bootstrap-planned-strata-not-observed');
|
|
1336
|
-
}
|
|
1337
|
-
const weightedDifference = (estimate) => strata.reduce((sum, stratum) => {
|
|
1338
|
-
const weight = stratum.plannedCount / plannedUnitCount;
|
|
1339
|
-
return sum + weight * (estimate(treatmentId, stratum.stratumId, stratum.treatment)
|
|
1340
|
-
- estimate(controlId, stratum.stratumId, stratum.control));
|
|
1341
|
-
}, 0);
|
|
1342
|
-
const resamples = parameterInteger(context, 'resamples', 1_000);
|
|
1343
|
-
const alpha = parameterNumber(context, 'alpha', 0.05);
|
|
1344
|
-
if (resamples < 1 || alpha <= 0 || alpha >= 1) {
|
|
1345
|
-
throw new TypeError('Bootstrap requires positive resamples and alpha in (0, 1).');
|
|
1346
|
-
}
|
|
1347
|
-
const seed = bootstrapSeed(context);
|
|
1348
|
-
const estimates = Array.from({ length: resamples }, (_, replicate) => weightedDifference((armId, stratumId, units) => bootstrapArmStratumMean(seed, armId, stratumId, replicate, units))).sort((left, right) => left - right);
|
|
1349
|
-
const includedRowIds = [...controlUnits, ...treatmentUnits].flatMap((unit) => unit.rowIds);
|
|
1350
|
-
return {
|
|
1351
|
-
analysisStatus: 'completed',
|
|
1352
|
-
resultType: 'interval',
|
|
1353
|
-
value: {
|
|
1354
|
-
estimate: weightedDifference((_armId, _stratumId, units) => (mean(units.map((unit) => unit.value)))),
|
|
1355
|
-
lower: quantile(estimates, alpha / 2),
|
|
1356
|
-
upper: quantile(estimates, 1 - alpha / 2),
|
|
1357
|
-
confidenceLevel: 1 - alpha,
|
|
1358
|
-
resamples,
|
|
1359
|
-
unitCount: controlUnits.length + treatmentUnits.length,
|
|
1360
|
-
method: 'percentile',
|
|
1361
|
-
},
|
|
1362
|
-
includedRowIds,
|
|
1363
|
-
comparableRowIds: includedRowIds,
|
|
1364
|
-
assumptionChecks: passedAssumption('independent-non-overlapping-samples'),
|
|
1365
|
-
};
|
|
1366
|
-
}
|
|
1367
|
-
function executeCompositeUnpairedBootstrap(context) {
|
|
1368
|
-
const built = compositeBuildOrResult(context);
|
|
1369
|
-
if ('analysisStatus' in built)
|
|
1370
|
-
return built;
|
|
1371
|
-
return withCompositeEvidence(executeUnpairedBootstrapWithUnits(context, built.units, built.plannedRows, built.parameters.compositeMetricId), built.units, built.coverage);
|
|
1372
|
-
}
|
|
1373
|
-
function executeUnpairedBootstrap(context) {
|
|
1374
|
-
const input = metricInput(context);
|
|
1375
|
-
const rows = observedRows(context);
|
|
1376
|
-
const units = [...groupRows(rows, (row) => canonicalizeJson([
|
|
1377
|
-
row.targetId,
|
|
1378
|
-
row.sampleId,
|
|
1379
|
-
])).values()].map((group) => {
|
|
1380
|
-
const unit = groupUnit(group);
|
|
1381
|
-
return {
|
|
1382
|
-
targetId: group[0].targetId,
|
|
1383
|
-
sampleId: group[0].sampleId,
|
|
1384
|
-
value: unit.value,
|
|
1385
|
-
rowIds: group.map((row) => row.rowId),
|
|
1386
|
-
...(unit.stratumId === undefined ? {} : { stratumId: unit.stratumId }),
|
|
1387
|
-
};
|
|
1388
|
-
});
|
|
1389
|
-
return executeUnpairedBootstrapWithUnits(context, units, input.rows);
|
|
1390
|
-
}
|
|
1391
|
-
function executeHierarchicalUnpairedBootstrap(context) {
|
|
1392
|
-
const input = metricInput(context);
|
|
1393
|
-
return executeUnpairedBootstrapWithUnits(context, aggregateMeasurementUnits(context), input.rows);
|
|
1394
|
-
}
|
|
1395
|
-
function hypotheses(context) {
|
|
1396
|
-
const result = [];
|
|
1397
|
-
for (const input of context.inputs) {
|
|
1398
|
-
if (input.inputKind !== 'analysis-result')
|
|
1399
|
-
continue;
|
|
1400
|
-
const value = input.record.value;
|
|
1401
|
-
if (value === null || Array.isArray(value) || typeof value !== 'object')
|
|
1402
|
-
continue;
|
|
1403
|
-
const entries = value.hypotheses;
|
|
1404
|
-
if (!Array.isArray(entries))
|
|
1405
|
-
continue;
|
|
1406
|
-
for (const entry of entries) {
|
|
1407
|
-
if (entry === null || Array.isArray(entry) || typeof entry !== 'object')
|
|
1408
|
-
continue;
|
|
1409
|
-
const hypothesisId = entry.hypothesisId;
|
|
1410
|
-
const pValue = entry.pValue;
|
|
1411
|
-
if (typeof hypothesisId === 'string'
|
|
1412
|
-
&& typeof pValue === 'number'
|
|
1413
|
-
&& Number.isFinite(pValue)
|
|
1414
|
-
&& pValue >= 0
|
|
1415
|
-
&& pValue <= 1) {
|
|
1416
|
-
result.push({ hypothesisId, pValue });
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
return result;
|
|
1421
|
-
}
|
|
1422
|
-
function executeBonferroni(context) {
|
|
1423
|
-
const raw = hypotheses(context);
|
|
1424
|
-
if (raw.length === 0)
|
|
1425
|
-
return incomplete('analysis-no-valid-hypotheses');
|
|
1426
|
-
if (new Set(raw.map((entry) => entry.hypothesisId)).size !== raw.length) {
|
|
1427
|
-
return incomplete('analysis-duplicate-hypothesis-id');
|
|
1428
|
-
}
|
|
1429
|
-
const alpha = parameterNumber(context, 'alpha', 0.05);
|
|
1430
|
-
if (alpha <= 0 || alpha >= 1)
|
|
1431
|
-
throw new TypeError('alpha must be in (0, 1).');
|
|
1432
|
-
const familySize = raw.length;
|
|
1433
|
-
return {
|
|
1434
|
-
analysisStatus: 'completed',
|
|
1435
|
-
resultType: 'table',
|
|
1436
|
-
value: {
|
|
1437
|
-
familySize,
|
|
1438
|
-
alpha,
|
|
1439
|
-
hypotheses: raw.sort((left, right) => (left.hypothesisId < right.hypothesisId
|
|
1440
|
-
? -1
|
|
1441
|
-
: left.hypothesisId > right.hypothesisId ? 1 : 0)).map((entry) => ({
|
|
1442
|
-
hypothesisId: entry.hypothesisId,
|
|
1443
|
-
rawPValue: entry.pValue,
|
|
1444
|
-
adjustedPValue: Math.min(1, entry.pValue * familySize),
|
|
1445
|
-
rejected: entry.pValue <= alpha / familySize,
|
|
1446
|
-
})),
|
|
1447
|
-
},
|
|
1448
|
-
assumptionChecks: passedAssumption('valid-hypothesis-family'),
|
|
1449
|
-
};
|
|
1450
|
-
}
|
|
1451
|
-
function buildSimultaneousIntervalFamilyValue(rawParameters, rawInputs) {
|
|
1452
|
-
const sealed = SimultaneousIntervalFamilyParametersSchema.parse(rawParameters);
|
|
1453
|
-
if (rawInputs.length < 2) {
|
|
1454
|
-
throw new TypeError('A simultaneous interval family requires at least two interval results.');
|
|
1455
|
-
}
|
|
1456
|
-
const ids = rawInputs.map((input) => input.referenceId);
|
|
1457
|
-
if (new Set(ids).size !== ids.length) {
|
|
1458
|
-
throw new TypeError('A simultaneous interval family cannot repeat a result identity.');
|
|
1459
|
-
}
|
|
1460
|
-
const marginalConfidenceLevel = bonferroniMarginalConfidenceLevel(sealed.familyConfidenceLevel, rawInputs.length);
|
|
1461
|
-
const members = rawInputs.map((input) => {
|
|
1462
|
-
const interval = IntervalEnvelopeSchema.parse({
|
|
1463
|
-
resultType: input.resultType,
|
|
1464
|
-
value: input.value,
|
|
1465
|
-
}).value;
|
|
1466
|
-
if (interval.confidenceLevel !== marginalConfidenceLevel
|
|
1467
|
-
|| interval.resamples !== sealed.resamples) {
|
|
1468
|
-
throw new TypeError('An interval result does not match the sealed Bonferroni family.');
|
|
1469
|
-
}
|
|
1470
|
-
return { analysisResultId: input.referenceId, interval };
|
|
1471
|
-
}).sort((left, right) => (left.analysisResultId < right.analysisResultId
|
|
1472
|
-
? -1
|
|
1473
|
-
: left.analysisResultId > right.analysisResultId ? 1 : 0));
|
|
1474
|
-
return SimultaneousIntervalFamilyEnvelopeSchema.parse({
|
|
1475
|
-
resultType: 'table',
|
|
1476
|
-
value: {
|
|
1477
|
-
adjustmentMethod: 'bonferroni',
|
|
1478
|
-
familyConfidenceLevel: sealed.familyConfidenceLevel,
|
|
1479
|
-
marginalConfidenceLevel,
|
|
1480
|
-
familySize: members.length,
|
|
1481
|
-
resamples: sealed.resamples,
|
|
1482
|
-
members,
|
|
1483
|
-
},
|
|
1484
|
-
}).value;
|
|
1485
|
-
}
|
|
1486
|
-
function executeSimultaneousIntervalFamily(context) {
|
|
1487
|
-
const inputs = context.inputs.flatMap((input) => (input.inputKind === 'analysis-result'
|
|
1488
|
-
? [{
|
|
1489
|
-
referenceId: input.referenceId,
|
|
1490
|
-
resultType: input.record.resultType,
|
|
1491
|
-
value: input.record.value,
|
|
1492
|
-
}]
|
|
1493
|
-
: []));
|
|
1494
|
-
return {
|
|
1495
|
-
analysisStatus: 'completed',
|
|
1496
|
-
resultType: 'table',
|
|
1497
|
-
value: buildSimultaneousIntervalFamilyValue(context.node.parameters ?? {}, inputs),
|
|
1498
|
-
assumptionChecks: passedAssumption('complete-simultaneous-interval-family'),
|
|
1499
|
-
};
|
|
1500
|
-
}
|
|
1501
|
-
const BUILTIN_DEFINITIONS = new Map();
|
|
1502
|
-
function register(implementationId, capabilities, outputSchema, parameterSchema, execute) {
|
|
1503
|
-
BUILTIN_DEFINITIONS.set(implementationId, {
|
|
1504
|
-
identity: runtimeIdentity(implementationId, capabilities),
|
|
1505
|
-
outputSchema,
|
|
1506
|
-
parameterSchema,
|
|
1507
|
-
execute,
|
|
1508
|
-
});
|
|
1509
|
-
}
|
|
1510
|
-
register('descriptive.mean/v1', nodeCapabilities({
|
|
1511
|
-
analysisNodeKind: 'reducer',
|
|
1512
|
-
valueTypes: ['numeric'],
|
|
1513
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1514
|
-
outputSchema: BUILTIN_SCALAR_RESULT_SCHEMA,
|
|
1515
|
-
parameterSchema: EMPTY_PARAMETERS_SCHEMA,
|
|
1516
|
-
}), BUILTIN_SCALAR_RESULT_SCHEMA, EMPTY_PARAMETERS_SCHEMA, executeMean);
|
|
1517
|
-
register('descriptive.rate/v1', nodeCapabilities({
|
|
1518
|
-
analysisNodeKind: 'reducer',
|
|
1519
|
-
valueTypes: ['boolean'],
|
|
1520
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1521
|
-
outputSchema: BUILTIN_SCALAR_RESULT_SCHEMA,
|
|
1522
|
-
parameterSchema: EMPTY_PARAMETERS_SCHEMA,
|
|
1523
|
-
}), BUILTIN_SCALAR_RESULT_SCHEMA, EMPTY_PARAMETERS_SCHEMA, executeRate);
|
|
1524
|
-
register('descriptive.quantile/v1', nodeCapabilities({
|
|
1525
|
-
analysisNodeKind: 'reducer',
|
|
1526
|
-
valueTypes: ['numeric'],
|
|
1527
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1528
|
-
outputSchema: BUILTIN_SCALAR_RESULT_SCHEMA,
|
|
1529
|
-
parameterSchema: QUANTILE_PARAMETERS_SCHEMA,
|
|
1530
|
-
}), BUILTIN_SCALAR_RESULT_SCHEMA, QUANTILE_PARAMETERS_SCHEMA, executeQuantile);
|
|
1531
|
-
register('descriptive.hierarchical-mean/v1', nodeCapabilities({
|
|
1532
|
-
analysisNodeKind: 'reducer',
|
|
1533
|
-
valueTypes: ['numeric'],
|
|
1534
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1535
|
-
outputSchema: BUILTIN_SCALAR_RESULT_SCHEMA,
|
|
1536
|
-
parameterSchema: HIERARCHICAL_REDUCER_PARAMETERS_SCHEMA,
|
|
1537
|
-
}), BUILTIN_SCALAR_RESULT_SCHEMA, HIERARCHICAL_REDUCER_PARAMETERS_SCHEMA, executeHierarchicalMean);
|
|
1538
|
-
register('descriptive.hierarchical-rate/v1', nodeCapabilities({
|
|
1539
|
-
analysisNodeKind: 'reducer',
|
|
1540
|
-
valueTypes: ['boolean'],
|
|
1541
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1542
|
-
outputSchema: BUILTIN_SCALAR_RESULT_SCHEMA,
|
|
1543
|
-
parameterSchema: HIERARCHICAL_REDUCER_PARAMETERS_SCHEMA,
|
|
1544
|
-
}), BUILTIN_SCALAR_RESULT_SCHEMA, HIERARCHICAL_REDUCER_PARAMETERS_SCHEMA, executeHierarchicalRate);
|
|
1545
|
-
register('descriptive.hierarchical-quantile/v1', nodeCapabilities({
|
|
1546
|
-
analysisNodeKind: 'reducer',
|
|
1547
|
-
valueTypes: ['numeric'],
|
|
1548
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1549
|
-
outputSchema: BUILTIN_SCALAR_RESULT_SCHEMA,
|
|
1550
|
-
parameterSchema: HIERARCHICAL_QUANTILE_PARAMETERS_SCHEMA,
|
|
1551
|
-
}), BUILTIN_SCALAR_RESULT_SCHEMA, HIERARCHICAL_QUANTILE_PARAMETERS_SCHEMA, executeHierarchicalQuantile);
|
|
1552
|
-
register('bootstrap.mean-percentile/v1', nodeCapabilities({
|
|
1553
|
-
analysisNodeKind: 'estimator',
|
|
1554
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1555
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1556
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1557
|
-
parameterSchema: BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1558
|
-
sampling: {
|
|
1559
|
-
assignmentKinds: ['complete-block', 'independent-groups'],
|
|
1560
|
-
experimentalUnits: ['sample', 'run'],
|
|
1561
|
-
repeatedMeasures: [false, true],
|
|
1562
|
-
resamplingUnits: ['sample', 'paired-block', 'run'],
|
|
1563
|
-
},
|
|
1564
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, BOOTSTRAP_PARAMETERS_SCHEMA, executeMeanBootstrap);
|
|
1565
|
-
register('bootstrap.paired-difference-percentile/v1', nodeCapabilities({
|
|
1566
|
-
analysisNodeKind: 'estimator',
|
|
1567
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1568
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1569
|
-
comparison: true,
|
|
1570
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1571
|
-
parameterSchema: BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1572
|
-
sampling: {
|
|
1573
|
-
assignmentKinds: ['complete-block'],
|
|
1574
|
-
experimentalUnits: ['sample'],
|
|
1575
|
-
repeatedMeasures: [false, true],
|
|
1576
|
-
resamplingUnits: ['paired-block'],
|
|
1577
|
-
},
|
|
1578
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, BOOTSTRAP_PARAMETERS_SCHEMA, executePairedBootstrap);
|
|
1579
|
-
register('bootstrap.unpaired-difference-percentile/v1', nodeCapabilities({
|
|
1580
|
-
analysisNodeKind: 'estimator',
|
|
1581
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1582
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1583
|
-
comparison: true,
|
|
1584
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1585
|
-
parameterSchema: BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1586
|
-
sampling: {
|
|
1587
|
-
assignmentKinds: ['independent-groups'],
|
|
1588
|
-
experimentalUnits: ['sample'],
|
|
1589
|
-
repeatedMeasures: [false, true],
|
|
1590
|
-
resamplingUnits: ['sample'],
|
|
1591
|
-
},
|
|
1592
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, BOOTSTRAP_PARAMETERS_SCHEMA, executeUnpairedBootstrap);
|
|
1593
|
-
register('bootstrap.hierarchical-mean-percentile/v1', nodeCapabilities({
|
|
1594
|
-
analysisNodeKind: 'estimator',
|
|
1595
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1596
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1597
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1598
|
-
parameterSchema: HIERARCHICAL_BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1599
|
-
sampling: {
|
|
1600
|
-
assignmentKinds: ['complete-block', 'independent-groups'],
|
|
1601
|
-
experimentalUnits: ['sample'],
|
|
1602
|
-
repeatedMeasures: [false, true],
|
|
1603
|
-
resamplingUnits: ['sample', 'paired-block'],
|
|
1604
|
-
},
|
|
1605
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, HIERARCHICAL_BOOTSTRAP_PARAMETERS_SCHEMA, executeHierarchicalMeanBootstrap);
|
|
1606
|
-
register('bootstrap.hierarchical-paired-difference-percentile/v1', nodeCapabilities({
|
|
1607
|
-
analysisNodeKind: 'estimator',
|
|
1608
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1609
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1610
|
-
comparison: true,
|
|
1611
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1612
|
-
parameterSchema: HIERARCHICAL_BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1613
|
-
sampling: {
|
|
1614
|
-
assignmentKinds: ['complete-block'],
|
|
1615
|
-
experimentalUnits: ['sample'],
|
|
1616
|
-
repeatedMeasures: [false, true],
|
|
1617
|
-
resamplingUnits: ['paired-block'],
|
|
1618
|
-
},
|
|
1619
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, HIERARCHICAL_BOOTSTRAP_PARAMETERS_SCHEMA, executeHierarchicalPairedBootstrap);
|
|
1620
|
-
register('bootstrap.hierarchical-unpaired-difference-percentile/v1', nodeCapabilities({
|
|
1621
|
-
analysisNodeKind: 'estimator',
|
|
1622
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1623
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1624
|
-
comparison: true,
|
|
1625
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1626
|
-
parameterSchema: HIERARCHICAL_BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1627
|
-
sampling: {
|
|
1628
|
-
assignmentKinds: ['independent-groups'],
|
|
1629
|
-
experimentalUnits: ['sample'],
|
|
1630
|
-
repeatedMeasures: [false, true],
|
|
1631
|
-
resamplingUnits: ['sample'],
|
|
1632
|
-
},
|
|
1633
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, HIERARCHICAL_BOOTSTRAP_PARAMETERS_SCHEMA, executeHierarchicalUnpairedBootstrap);
|
|
1634
|
-
register('bootstrap.cluster-percentile/v1', nodeCapabilities({
|
|
1635
|
-
analysisNodeKind: 'estimator',
|
|
1636
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1637
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1638
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1639
|
-
parameterSchema: BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1640
|
-
sampling: {
|
|
1641
|
-
assignmentKinds: ['complete-block'],
|
|
1642
|
-
experimentalUnits: ['cluster'],
|
|
1643
|
-
repeatedMeasures: [false, true],
|
|
1644
|
-
resamplingUnits: ['cluster'],
|
|
1645
|
-
},
|
|
1646
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, BOOTSTRAP_PARAMETERS_SCHEMA, executeClusterBootstrap);
|
|
1647
|
-
register('bootstrap.hierarchical-cluster-percentile/v1', nodeCapabilities({
|
|
1648
|
-
analysisNodeKind: 'estimator',
|
|
1649
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1650
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1651
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1652
|
-
parameterSchema: HIERARCHICAL_BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1653
|
-
sampling: {
|
|
1654
|
-
assignmentKinds: ['complete-block'],
|
|
1655
|
-
experimentalUnits: ['cluster'],
|
|
1656
|
-
repeatedMeasures: [false, true],
|
|
1657
|
-
resamplingUnits: ['cluster'],
|
|
1658
|
-
},
|
|
1659
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, HIERARCHICAL_BOOTSTRAP_PARAMETERS_SCHEMA, executeHierarchicalClusterBootstrap);
|
|
1660
|
-
register('bootstrap.composite-mean-percentile/v1', nodeCapabilities({
|
|
1661
|
-
analysisNodeKind: 'estimator',
|
|
1662
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1663
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1664
|
-
metricObservationCardinality: { min: 2 },
|
|
1665
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1666
|
-
parameterSchema: COMPOSITE_BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1667
|
-
sampling: {
|
|
1668
|
-
assignmentKinds: ['complete-block', 'independent-groups'],
|
|
1669
|
-
experimentalUnits: ['sample'],
|
|
1670
|
-
repeatedMeasures: [false, true],
|
|
1671
|
-
resamplingUnits: ['sample', 'paired-block'],
|
|
1672
|
-
},
|
|
1673
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, COMPOSITE_BOOTSTRAP_PARAMETERS_SCHEMA, executeCompositeMeanBootstrap);
|
|
1674
|
-
register('bootstrap.composite-cluster-percentile/v1', nodeCapabilities({
|
|
1675
|
-
analysisNodeKind: 'estimator',
|
|
1676
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1677
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1678
|
-
metricObservationCardinality: { min: 2 },
|
|
1679
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1680
|
-
parameterSchema: COMPOSITE_BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1681
|
-
sampling: {
|
|
1682
|
-
assignmentKinds: ['complete-block'],
|
|
1683
|
-
experimentalUnits: ['cluster'],
|
|
1684
|
-
repeatedMeasures: [false, true],
|
|
1685
|
-
resamplingUnits: ['cluster'],
|
|
1686
|
-
},
|
|
1687
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, COMPOSITE_BOOTSTRAP_PARAMETERS_SCHEMA, executeCompositeClusterBootstrap);
|
|
1688
|
-
register('bootstrap.composite-paired-difference-percentile/v1', nodeCapabilities({
|
|
1689
|
-
analysisNodeKind: 'estimator',
|
|
1690
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1691
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1692
|
-
metricObservationCardinality: { min: 2 },
|
|
1693
|
-
comparison: true,
|
|
1694
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1695
|
-
parameterSchema: COMPOSITE_BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1696
|
-
sampling: {
|
|
1697
|
-
assignmentKinds: ['complete-block'],
|
|
1698
|
-
experimentalUnits: ['sample'],
|
|
1699
|
-
repeatedMeasures: [false, true],
|
|
1700
|
-
resamplingUnits: ['paired-block'],
|
|
1701
|
-
},
|
|
1702
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, COMPOSITE_BOOTSTRAP_PARAMETERS_SCHEMA, executeCompositePairedBootstrap);
|
|
1703
|
-
register('bootstrap.composite-unpaired-difference-percentile/v1', nodeCapabilities({
|
|
1704
|
-
analysisNodeKind: 'estimator',
|
|
1705
|
-
valueTypes: ['numeric', 'boolean'],
|
|
1706
|
-
missingPolicyIds: ['exclude/v1'],
|
|
1707
|
-
metricObservationCardinality: { min: 2 },
|
|
1708
|
-
comparison: true,
|
|
1709
|
-
outputSchema: BUILTIN_INTERVAL_RESULT_SCHEMA,
|
|
1710
|
-
parameterSchema: COMPOSITE_BOOTSTRAP_PARAMETERS_SCHEMA,
|
|
1711
|
-
sampling: {
|
|
1712
|
-
assignmentKinds: ['independent-groups'],
|
|
1713
|
-
experimentalUnits: ['sample'],
|
|
1714
|
-
repeatedMeasures: [false, true],
|
|
1715
|
-
resamplingUnits: ['sample'],
|
|
1716
|
-
},
|
|
1717
|
-
}), BUILTIN_INTERVAL_RESULT_SCHEMA, COMPOSITE_BOOTSTRAP_PARAMETERS_SCHEMA, executeCompositeUnpairedBootstrap);
|
|
1718
|
-
register('simultaneous-intervals.bonferroni/v1', nodeCapabilities({
|
|
1719
|
-
analysisNodeKind: 'correction',
|
|
1720
|
-
analysisResultSchemaUris: [BUILTIN_INTERVAL_RESULT_SCHEMA.schemaUri],
|
|
1721
|
-
analysisResultCardinality: { min: 2 },
|
|
1722
|
-
outputSchema: BUILTIN_SIMULTANEOUS_INTERVAL_FAMILY_RESULT_SCHEMA,
|
|
1723
|
-
parameterSchema: SIMULTANEOUS_INTERVAL_FAMILY_PARAMETERS_SCHEMA,
|
|
1724
|
-
}), BUILTIN_SIMULTANEOUS_INTERVAL_FAMILY_RESULT_SCHEMA, SIMULTANEOUS_INTERVAL_FAMILY_PARAMETERS_SCHEMA, executeSimultaneousIntervalFamily);
|
|
1725
|
-
register('bonferroni/v1', nodeCapabilities({
|
|
1726
|
-
analysisNodeKind: 'correction',
|
|
1727
|
-
analysisResultSchemaUris: [BUILTIN_HYPOTHESIS_INPUT_SCHEMA.schemaUri],
|
|
1728
|
-
outputSchema: BUILTIN_HYPOTHESIS_TABLE_SCHEMA,
|
|
1729
|
-
parameterSchema: BONFERRONI_PARAMETERS_SCHEMA,
|
|
1730
|
-
}), BUILTIN_HYPOTHESIS_TABLE_SCHEMA, BONFERRONI_PARAMETERS_SCHEMA, executeBonferroni);
|
|
1731
|
-
class BuiltinNodeImplementation {
|
|
1732
|
-
identity;
|
|
1733
|
-
outputSchema;
|
|
1734
|
-
#definition;
|
|
1735
|
-
constructor(definition) {
|
|
1736
|
-
this.#definition = definition;
|
|
1737
|
-
this.identity = definition.identity;
|
|
1738
|
-
this.outputSchema = definition.outputSchema;
|
|
1739
|
-
}
|
|
1740
|
-
async openRun() {
|
|
1741
|
-
return {
|
|
1742
|
-
execute: async (context) => this.#definition.execute(context),
|
|
1743
|
-
dispose: () => undefined,
|
|
1744
|
-
};
|
|
1745
|
-
}
|
|
1746
|
-
}
|
|
1747
|
-
class BuiltinSchemaValidator {
|
|
1748
|
-
schema;
|
|
1749
|
-
#zod;
|
|
1750
|
-
#validateContext;
|
|
1751
|
-
#normalize;
|
|
1752
|
-
constructor(schema, zodSchema, validateContext, normalize) {
|
|
1753
|
-
this.schema = schema;
|
|
1754
|
-
this.#zod = zodSchema;
|
|
1755
|
-
this.#validateContext = validateContext;
|
|
1756
|
-
this.#normalize = normalize;
|
|
1757
|
-
}
|
|
1758
|
-
parse(value, context) {
|
|
1759
|
-
const validated = this.#zod.parse(value);
|
|
1760
|
-
const parsed = this.#normalize?.(validated) ?? validated;
|
|
1761
|
-
this.#validateContext?.(parsed, context);
|
|
1762
|
-
return parsed;
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
function requireAnalysisOutputContext(context) {
|
|
1766
|
-
if (context?.validationKind !== 'analysis-output') {
|
|
1767
|
-
throw new TypeError('Analysis output validation requires sealed node parameters.');
|
|
1768
|
-
}
|
|
1769
|
-
return context;
|
|
1770
|
-
}
|
|
1771
|
-
function validateIntervalContext(value, context) {
|
|
1772
|
-
const rawParameters = requireAnalysisOutputContext(context).parameters;
|
|
1773
|
-
const sealed = rawParameters !== null && typeof rawParameters === 'object'
|
|
1774
|
-
&& !Array.isArray(rawParameters) && 'compositeMetricId' in rawParameters
|
|
1775
|
-
? CompositeBootstrapParametersSchema.parse(rawParameters)
|
|
1776
|
-
: rawParameters !== null && typeof rawParameters === 'object'
|
|
1777
|
-
&& !Array.isArray(rawParameters) && 'measurementAggregation' in rawParameters
|
|
1778
|
-
? HierarchicalBootstrapParametersSchema.parse(rawParameters)
|
|
1779
|
-
: BootstrapParametersSchema.parse(rawParameters);
|
|
1780
|
-
const envelope = IntervalEnvelopeSchema.parse(value);
|
|
1781
|
-
if (envelope.value.resamples !== sealed.resamples
|
|
1782
|
-
|| envelope.value.confidenceLevel !== 1 - sealed.alpha
|
|
1783
|
-
|| envelope.value.unitCount !== context?.inputFacts.resamplingUnitCount) {
|
|
1784
|
-
throw new TypeError('Interval metadata does not match the sealed Analysis facts.');
|
|
1785
|
-
}
|
|
1786
|
-
}
|
|
1787
|
-
function validateBonferroniContext(value, context) {
|
|
1788
|
-
const sealed = BonferroniParametersSchema.parse(requireAnalysisOutputContext(context).parameters);
|
|
1789
|
-
const envelope = HypothesisTableEnvelopeSchema.parse(value);
|
|
1790
|
-
if (envelope.value.alpha !== sealed.alpha) {
|
|
1791
|
-
throw new TypeError('Bonferroni alpha does not match the sealed node parameters.');
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
function validateSimultaneousIntervalFamilyContext(value, context) {
|
|
1795
|
-
const sealedContext = requireAnalysisOutputContext(context);
|
|
1796
|
-
const envelope = SimultaneousIntervalFamilyEnvelopeSchema.parse(value);
|
|
1797
|
-
const expected = buildSimultaneousIntervalFamilyValue(sealedContext.parameters, sealedContext.inputFacts.analysisResultInputs ?? []);
|
|
1798
|
-
if (canonicalizeJson(envelope.value) !== canonicalizeJson(expected)) {
|
|
1799
|
-
throw new TypeError('Simultaneous interval family does not match its sealed Core inputs.');
|
|
1800
|
-
}
|
|
1801
|
-
}
|
|
1802
|
-
export const BUILTIN_EXCLUDE_MISSING_POLICY = {
|
|
1803
|
-
identity: runtimeIdentity('exclude/v1', EXCLUDE_CAPABILITIES),
|
|
1804
|
-
decide: () => 'exclude',
|
|
1805
|
-
};
|
|
1806
|
-
function selectedDecisionResult(context) {
|
|
1807
|
-
const resultId = context.contrasts.length === 1
|
|
1808
|
-
? context.contrasts[0].analysisResultId
|
|
1809
|
-
: context.contrasts.length === 0 && context.results.length === 1
|
|
1810
|
-
? context.results[0].resultId
|
|
1811
|
-
: undefined;
|
|
1812
|
-
return resultId === undefined
|
|
1813
|
-
? undefined
|
|
1814
|
-
: context.results.find((candidate) => candidate.resultId === resultId);
|
|
1815
|
-
}
|
|
1816
|
-
function scalarEffect(context) {
|
|
1817
|
-
const result = selectedDecisionResult(context);
|
|
1818
|
-
if (result === undefined)
|
|
1819
|
-
return undefined;
|
|
1820
|
-
if (typeof result.value === 'number' && Number.isFinite(result.value))
|
|
1821
|
-
return result.value;
|
|
1822
|
-
if (result.value !== null && !Array.isArray(result.value)
|
|
1823
|
-
&& typeof result.value === 'object') {
|
|
1824
|
-
const value = result.value.estimate;
|
|
1825
|
-
if (typeof value === 'number' && Number.isFinite(value))
|
|
1826
|
-
return value;
|
|
1827
|
-
}
|
|
1828
|
-
return undefined;
|
|
1829
|
-
}
|
|
1830
|
-
function intervalEffect(context) {
|
|
1831
|
-
const result = selectedDecisionResult(context);
|
|
1832
|
-
if (result === undefined)
|
|
1833
|
-
return undefined;
|
|
1834
|
-
const parsed = IntervalEnvelopeSchema.safeParse({
|
|
1835
|
-
resultType: result.resultType,
|
|
1836
|
-
value: result.value,
|
|
1837
|
-
});
|
|
1838
|
-
return parsed.success ? parsed.data.value : undefined;
|
|
1839
|
-
}
|
|
1840
|
-
function progressParameters(context) {
|
|
1841
|
-
const policyParameters = context.policy.parameters;
|
|
1842
|
-
const object = policyParameters !== null && policyParameters !== undefined
|
|
1843
|
-
&& !Array.isArray(policyParameters) && typeof policyParameters === 'object'
|
|
1844
|
-
? policyParameters
|
|
1845
|
-
: {};
|
|
1846
|
-
return {
|
|
1847
|
-
threshold: typeof object.threshold === 'number' ? object.threshold : 0,
|
|
1848
|
-
equivalence: typeof object.equivalence === 'number' ? object.equivalence : 0,
|
|
1849
|
-
};
|
|
1850
|
-
}
|
|
1851
|
-
export const BUILTIN_PROGRESS_DECISION_POLICY = {
|
|
1852
|
-
identity: runtimeIdentity('progress/v1', PROGRESS_V1_DECISION_CAPABILITIES, PROGRESS_V1_DECISION_FINGERPRINT_FACETS),
|
|
1853
|
-
decide: async (context) => {
|
|
1854
|
-
const effect = scalarEffect(context);
|
|
1855
|
-
if (effect === undefined) {
|
|
1856
|
-
return { decisionStatus: 'not-decided', reasonCodes: ['decision-effect-unavailable'] };
|
|
1857
|
-
}
|
|
1858
|
-
const { threshold, equivalence } = progressParameters(context);
|
|
1859
|
-
if (effect > threshold + equivalence) {
|
|
1860
|
-
return {
|
|
1861
|
-
decisionStatus: 'decided',
|
|
1862
|
-
verdict: 'PROGRESS',
|
|
1863
|
-
reasonCodes: ['effect-above-progress-threshold'],
|
|
1864
|
-
};
|
|
1865
|
-
}
|
|
1866
|
-
if (effect < threshold - equivalence) {
|
|
1867
|
-
return {
|
|
1868
|
-
decisionStatus: 'decided',
|
|
1869
|
-
verdict: 'REGRESSION',
|
|
1870
|
-
reasonCodes: ['effect-below-regression-threshold'],
|
|
1871
|
-
};
|
|
1872
|
-
}
|
|
1873
|
-
return {
|
|
1874
|
-
decisionStatus: 'decided',
|
|
1875
|
-
verdict: 'NOISE',
|
|
1876
|
-
reasonCodes: ['effect-within-equivalence-band'],
|
|
1877
|
-
};
|
|
1878
|
-
},
|
|
1879
|
-
};
|
|
1880
|
-
export const BUILTIN_INTERVAL_PROGRESS_DECISION_POLICY = {
|
|
1881
|
-
identity: runtimeIdentity('progress/v2', PROGRESS_V2_DECISION_CAPABILITIES, PROGRESS_V2_DECISION_FINGERPRINT_FACETS),
|
|
1882
|
-
decide: async (context) => {
|
|
1883
|
-
const interval = intervalEffect(context);
|
|
1884
|
-
if (interval === undefined) {
|
|
1885
|
-
return { decisionStatus: 'not-decided', reasonCodes: ['decision-interval-unavailable'] };
|
|
1886
|
-
}
|
|
1887
|
-
const { threshold, equivalence } = progressParameters(context);
|
|
1888
|
-
if (interval.lower > threshold + equivalence) {
|
|
1889
|
-
return {
|
|
1890
|
-
decisionStatus: 'decided',
|
|
1891
|
-
verdict: 'PROGRESS',
|
|
1892
|
-
reasonCodes: ['interval-above-progress-boundary'],
|
|
1893
|
-
};
|
|
1894
|
-
}
|
|
1895
|
-
if (interval.upper < threshold - equivalence) {
|
|
1896
|
-
return {
|
|
1897
|
-
decisionStatus: 'decided',
|
|
1898
|
-
verdict: 'REGRESSION',
|
|
1899
|
-
reasonCodes: ['interval-below-regression-boundary'],
|
|
1900
|
-
};
|
|
1901
|
-
}
|
|
1902
|
-
return {
|
|
1903
|
-
decisionStatus: 'decided',
|
|
1904
|
-
verdict: 'NOISE',
|
|
1905
|
-
reasonCodes: ['interval-overlaps-decision-boundary'],
|
|
1906
|
-
};
|
|
1907
|
-
},
|
|
1908
|
-
};
|
|
1909
|
-
export const BUILTIN_FAMILY_RELEASE_DECISION_POLICY = {
|
|
1910
|
-
identity: runtimeIdentity('release-family/v1', FAMILY_RELEASE_DECISION_CAPABILITIES, FAMILY_RELEASE_DECISION_FINGERPRINT_FACETS),
|
|
1911
|
-
decide: async (context) => {
|
|
1912
|
-
const parameters = FamilyReleaseParametersSchema.safeParse(context.policy.parameters);
|
|
1913
|
-
if (!parameters.success || context.results.length !== 1) {
|
|
1914
|
-
return {
|
|
1915
|
-
decisionStatus: 'not-decided',
|
|
1916
|
-
reasonCodes: ['decision-family-contract-unavailable'],
|
|
1917
|
-
};
|
|
1918
|
-
}
|
|
1919
|
-
const family = SimultaneousIntervalFamilyEnvelopeSchema.safeParse({
|
|
1920
|
-
resultType: context.results[0].resultType,
|
|
1921
|
-
value: context.results[0].value,
|
|
1922
|
-
});
|
|
1923
|
-
if (!family.success) {
|
|
1924
|
-
return {
|
|
1925
|
-
decisionStatus: 'not-decided',
|
|
1926
|
-
reasonCodes: ['decision-family-contract-unavailable'],
|
|
1927
|
-
};
|
|
1928
|
-
}
|
|
1929
|
-
const criterionIds = parameters.data.criteria.map((criterion) => criterion.analysisResultId).sort();
|
|
1930
|
-
const familyIds = family.data.value.members.map((member) => member.analysisResultId).sort();
|
|
1931
|
-
const contrastIds = context.contrasts.map((contrast) => contrast.analysisResultId).sort();
|
|
1932
|
-
if (canonicalizeJson(criterionIds) !== canonicalizeJson(familyIds)
|
|
1933
|
-
|| canonicalizeJson(criterionIds) !== canonicalizeJson(contrastIds)) {
|
|
1934
|
-
return {
|
|
1935
|
-
decisionStatus: 'not-decided',
|
|
1936
|
-
reasonCodes: ['decision-family-contract-unavailable'],
|
|
1937
|
-
};
|
|
1938
|
-
}
|
|
1939
|
-
const intervalsById = new Map(family.data.value.members.map((member) => [member.analysisResultId, member.interval]));
|
|
1940
|
-
let uncertain = false;
|
|
1941
|
-
for (const criterion of parameters.data.criteria) {
|
|
1942
|
-
const interval = intervalsById.get(criterion.analysisResultId);
|
|
1943
|
-
if (interval === undefined) {
|
|
1944
|
-
return {
|
|
1945
|
-
decisionStatus: 'not-decided',
|
|
1946
|
-
reasonCodes: ['decision-family-contract-unavailable'],
|
|
1947
|
-
};
|
|
1948
|
-
}
|
|
1949
|
-
const provenUnacceptable = (criterion.minimumEffect !== undefined && interval.upper < criterion.minimumEffect) || (criterion.maximumEffect !== undefined && interval.lower > criterion.maximumEffect);
|
|
1950
|
-
if (provenUnacceptable) {
|
|
1951
|
-
return {
|
|
1952
|
-
decisionStatus: 'decided',
|
|
1953
|
-
verdict: 'BLOCK',
|
|
1954
|
-
reasonCodes: ['family-criterion-unacceptable'],
|
|
1955
|
-
};
|
|
1956
|
-
}
|
|
1957
|
-
const provenAcceptable = (criterion.minimumEffect === undefined || interval.lower >= criterion.minimumEffect) && (criterion.maximumEffect === undefined || interval.upper <= criterion.maximumEffect);
|
|
1958
|
-
if (!provenAcceptable)
|
|
1959
|
-
uncertain = true;
|
|
1960
|
-
}
|
|
1961
|
-
return uncertain
|
|
1962
|
-
? {
|
|
1963
|
-
decisionStatus: 'not-decided',
|
|
1964
|
-
reasonCodes: ['family-criterion-uncertain'],
|
|
1965
|
-
}
|
|
1966
|
-
: {
|
|
1967
|
-
decisionStatus: 'decided',
|
|
1968
|
-
verdict: 'RELEASE',
|
|
1969
|
-
reasonCodes: ['all-family-criteria-acceptable'],
|
|
1970
|
-
};
|
|
1971
|
-
},
|
|
1972
|
-
};
|
|
14
|
+
export { BUILTIN_EXCLUDE_MISSING_POLICY, BUILTIN_FAMILY_RELEASE_DECISION_POLICY, BUILTIN_INTERVAL_PROGRESS_DECISION_POLICY, BUILTIN_PROGRESS_DECISION_POLICY, } from './builtin-decisions.js';
|
|
15
|
+
export { BUILTIN_HYPOTHESIS_INPUT_SCHEMA, BUILTIN_HYPOTHESIS_TABLE_SCHEMA, } from './builtin-hypothesis.js';
|
|
16
|
+
export { BUILTIN_INTERVAL_RESULT_SCHEMA, BUILTIN_SCALAR_RESULT_SCHEMA, BUILTIN_SIMULTANEOUS_INTERVAL_FAMILY_RESULT_SCHEMA, } from './builtin-schemas.js';
|
|
1973
17
|
export function createBuiltinAnalysisNodes() {
|
|
1974
18
|
return new Map([...BUILTIN_DEFINITIONS.entries()].map(([implementationId, definition]) => [
|
|
1975
19
|
implementationId,
|
|
@@ -2002,7 +46,7 @@ export function createBuiltinAnalysisSchemaValidators() {
|
|
|
2002
46
|
const parsed = value;
|
|
2003
47
|
return {
|
|
2004
48
|
...parsed,
|
|
2005
|
-
components: [...parsed.components].sort((left, right) => (left.metricId
|
|
49
|
+
components: [...parsed.components].sort((left, right) => (compareStrings(left.metricId, right.metricId))),
|
|
2006
50
|
};
|
|
2007
51
|
},
|
|
2008
52
|
],
|
|
@@ -2020,8 +64,7 @@ export function createBuiltinAnalysisSchemaValidators() {
|
|
|
2020
64
|
const parsed = value;
|
|
2021
65
|
return {
|
|
2022
66
|
...parsed,
|
|
2023
|
-
criteria: [...parsed.criteria].sort((left, right) => (left.analysisResultId
|
|
2024
|
-
: left.analysisResultId > right.analysisResultId ? 1 : 0)),
|
|
67
|
+
criteria: [...parsed.criteria].sort((left, right) => (compareStrings(left.analysisResultId, right.analysisResultId))),
|
|
2025
68
|
};
|
|
2026
69
|
},
|
|
2027
70
|
],
|