oh-my-knowledge 0.32.0 → 0.34.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 +29 -14
- package/README.zh.md +32 -17
- package/dist/analysis/coverage-analyzer.d.ts +0 -1
- package/dist/analysis/coverage-analyzer.js +0 -1
- package/dist/analysis/failure-clusterer.d.ts +0 -1
- package/dist/analysis/failure-clusterer.js +0 -1
- package/dist/analysis/gap-analyzer.d.ts +0 -1
- package/dist/analysis/gap-analyzer.js +0 -1
- package/dist/analysis/hedging-classifier.d.ts +0 -1
- package/dist/analysis/hedging-classifier.js +1 -2
- package/dist/analysis/report-diagnostics.d.ts +0 -1
- package/dist/analysis/report-diagnostics.js +0 -1
- package/dist/analysis/sample-diagnostics.d.ts +1 -2
- package/dist/analysis/sample-diagnostics.js +18 -19
- package/dist/analysis/saturation.d.ts +8 -1
- package/dist/analysis/saturation.js +12 -5
- package/dist/assets/agent-skills/omk/SKILL.md +197 -0
- package/dist/assets/agent-skills/omk/references/commands.md +547 -0
- package/dist/authoring/evolver.d.ts +169 -4
- package/dist/authoring/evolver.js +287 -15
- package/dist/authoring/generator.d.ts +29 -2
- package/dist/authoring/generator.js +113 -1
- package/dist/authoring/sample-fixer.d.ts +0 -1
- package/dist/authoring/sample-fixer.js +0 -1
- package/dist/cli/commands/doctor.d.ts +2 -1
- package/dist/cli/commands/doctor.js +24 -6
- package/dist/cli/commands/eval/gold/compare.d.ts +0 -1
- package/dist/cli/commands/eval/gold/compare.js +0 -1
- package/dist/cli/commands/eval/gold/index.d.ts +0 -1
- package/dist/cli/commands/eval/gold/index.js +0 -1
- package/dist/cli/commands/eval/gold/init.d.ts +0 -1
- package/dist/cli/commands/eval/gold/init.js +0 -1
- package/dist/cli/commands/eval/gold/validate.d.ts +0 -1
- package/dist/cli/commands/eval/gold/validate.js +0 -1
- package/dist/cli/commands/eval/index.d.ts +2 -1
- package/dist/cli/commands/eval/index.js +23 -11
- package/dist/cli/commands/evolve.d.ts +7 -1
- package/dist/cli/commands/evolve.js +93 -6
- package/dist/cli/commands/init.d.ts +0 -1
- package/dist/cli/commands/init.js +0 -1
- package/dist/cli/commands/install.d.ts +22 -0
- package/dist/cli/commands/install.js +411 -0
- package/dist/cli/commands/observe/inbox.d.ts +0 -1
- package/dist/cli/commands/observe/inbox.js +0 -1
- package/dist/cli/commands/observe/index.d.ts +0 -1
- package/dist/cli/commands/observe/index.js +6 -3
- package/dist/cli/commands/observe/ingest.d.ts +0 -1
- package/dist/cli/commands/observe/ingest.js +0 -1
- package/dist/cli/commands/observe/show.d.ts +0 -1
- package/dist/cli/commands/observe/show.js +0 -1
- package/dist/cli/commands/sample.d.ts +2 -1
- package/dist/cli/commands/sample.js +100 -9
- package/dist/cli/commands/studio.d.ts +0 -1
- package/dist/cli/commands/studio.js +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +1 -2
- package/dist/cli/lib/cli-exit.d.ts +0 -1
- package/dist/cli/lib/cli-exit.js +0 -1
- package/dist/cli/lib/cmd-flags.d.ts +11 -1
- package/dist/cli/lib/cmd-flags.js +0 -1
- package/dist/cli/lib/i18n-dict/common.d.ts +1 -2
- package/dist/cli/lib/i18n-dict/common.js +18 -3
- package/dist/cli/lib/i18n-dict/evolve.d.ts +1 -2
- package/dist/cli/lib/i18n-dict/evolve.js +24 -1
- package/dist/cli/lib/i18n-dict/gen.d.ts +0 -1
- package/dist/cli/lib/i18n-dict/gen.js +0 -1
- package/dist/cli/lib/i18n-dict/help.d.ts +0 -1
- package/dist/cli/lib/i18n-dict/help.js +0 -1
- package/dist/cli/lib/i18n-dict/init.d.ts +0 -1
- package/dist/cli/lib/i18n-dict/init.js +0 -1
- package/dist/cli/lib/i18n-dict/install.d.ts +3 -0
- package/dist/cli/lib/i18n-dict/install.js +90 -0
- package/dist/cli/lib/i18n-dict/run.d.ts +0 -1
- package/dist/cli/lib/i18n-dict/run.js +0 -1
- package/dist/cli/lib/i18n-dict/types.d.ts +0 -1
- package/dist/cli/lib/i18n-dict/types.js +0 -1
- package/dist/cli/lib/i18n-dict.d.ts +2 -2
- package/dist/cli/lib/i18n-dict.js +2 -1
- package/dist/cli/lib/i18n.d.ts +0 -1
- package/dist/cli/lib/i18n.js +0 -1
- package/dist/cli/lib/parse-run-config/judge-models.d.ts +0 -1
- package/dist/cli/lib/parse-run-config/judge-models.js +0 -1
- package/dist/cli/lib/parse-run-config/samples-discovery.d.ts +0 -1
- package/dist/cli/lib/parse-run-config/samples-discovery.js +1 -4
- package/dist/cli/lib/parse-run-config/variant-resolution.d.ts +8 -4
- package/dist/cli/lib/parse-run-config/variant-resolution.js +46 -14
- package/dist/cli/lib/parse-run-config.d.ts +0 -1
- package/dist/cli/lib/parse-run-config.js +1 -2
- package/dist/cli/lib/progress.d.ts +0 -1
- package/dist/cli/lib/progress.js +0 -1
- package/dist/cli/lib/resolve-skill-input.d.ts +0 -1
- package/dist/cli/lib/resolve-skill-input.js +7 -6
- package/dist/cli/lib/run-tally.d.ts +0 -1
- package/dist/cli/lib/run-tally.js +1 -2
- package/dist/cli/lib/shared.d.ts +0 -1
- package/dist/cli/lib/shared.js +1 -2
- package/dist/cli/lib/update-check.d.ts +65 -1
- package/dist/cli/lib/update-check.js +220 -32
- package/dist/cli/lib/update-fetch-worker.d.ts +1 -0
- package/dist/cli/lib/update-fetch-worker.js +34 -0
- package/dist/cli/oclif/base-command.d.ts +0 -1
- package/dist/cli/oclif/base-command.js +0 -1
- package/dist/cli/oclif/help.d.ts +0 -1
- package/dist/cli/oclif/help.js +0 -1
- package/dist/cli/oclif/i18n.d.ts +0 -1
- package/dist/cli/oclif/i18n.js +0 -1
- package/dist/cli/oclif/parsers.d.ts +0 -1
- package/dist/cli/oclif/parsers.js +0 -1
- package/dist/cli/oclif/projection.d.ts +0 -1
- package/dist/cli/oclif/projection.js +0 -1
- package/dist/cli/oclif/run.d.ts +0 -1
- package/dist/cli/oclif/run.js +0 -1
- package/dist/diagnosis/observe-mapper.d.ts +2 -3
- package/dist/diagnosis/observe-mapper.js +6 -7
- package/dist/diagnosis/observe-producer.d.ts +0 -1
- package/dist/diagnosis/observe-producer.js +3 -4
- package/dist/diagnosis/studio-projection.d.ts +0 -1
- package/dist/diagnosis/studio-projection.js +0 -1
- package/dist/diagnosis/types.d.ts +0 -1
- package/dist/diagnosis/types.js +0 -1
- package/dist/doctor/fixer.d.ts +0 -1
- package/dist/doctor/fixer.js +0 -1
- package/dist/doctor/health/builtin-dimensions.d.ts +0 -1
- package/dist/doctor/health/builtin-dimensions.js +0 -1
- package/dist/doctor/health/composer.d.ts +0 -1
- package/dist/doctor/health/composer.js +1 -2
- package/dist/doctor/health/dimension-registry.d.ts +0 -1
- package/dist/doctor/health/dimension-registry.js +0 -1
- package/dist/doctor/health/dimension-spec.d.ts +0 -1
- package/dist/doctor/health/dimension-spec.js +0 -1
- package/dist/doctor/health/load-custom-dimensions.d.ts +1 -0
- package/dist/doctor/health/load-custom-dimensions.js +30 -0
- package/dist/doctor/health/parser.d.ts +0 -1
- package/dist/doctor/health/parser.js +0 -1
- package/dist/doctor/health/prompt-builder.d.ts +0 -1
- package/dist/doctor/health/prompt-builder.js +0 -1
- package/dist/doctor/health/register.d.ts +0 -1
- package/dist/doctor/health/register.js +0 -1
- package/dist/doctor/index.d.ts +0 -1
- package/dist/doctor/index.js +1 -2
- package/dist/doctor/messages.d.ts +0 -1
- package/dist/doctor/messages.js +1 -2
- package/dist/doctor/preflight.d.ts +0 -1
- package/dist/doctor/preflight.js +0 -1
- package/dist/doctor/renderer.d.ts +0 -1
- package/dist/doctor/renderer.js +0 -1
- package/dist/doctor/rules.d.ts +0 -1
- package/dist/doctor/rules.js +0 -1
- package/dist/eval-core/bootstrap.d.ts +8 -1
- package/dist/eval-core/bootstrap.js +11 -4
- package/dist/eval-core/cache.d.ts +0 -1
- package/dist/eval-core/cache.js +0 -1
- package/dist/eval-core/comparability.d.ts +0 -1
- package/dist/eval-core/comparability.js +3 -4
- package/dist/eval-core/dependency-checker.d.ts +0 -1
- package/dist/eval-core/dependency-checker.js +2 -2
- package/dist/eval-core/evaluation-execution.d.ts +0 -1
- package/dist/eval-core/evaluation-execution.js +0 -1
- package/dist/eval-core/evaluation-job.d.ts +0 -1
- package/dist/eval-core/evaluation-job.js +0 -1
- package/dist/eval-core/evaluation-reporting.d.ts +0 -1
- package/dist/eval-core/evaluation-reporting.js +9 -8
- package/dist/eval-core/execution-strategy.d.ts +0 -1
- package/dist/eval-core/execution-strategy.js +6 -3
- package/dist/eval-core/fact-checker.d.ts +0 -1
- package/dist/eval-core/fact-checker.js +0 -1
- package/dist/eval-core/layer-gates.d.ts +0 -1
- package/dist/eval-core/layer-gates.js +0 -1
- package/dist/eval-core/mocks-runtime.d.ts +0 -1
- package/dist/eval-core/mocks-runtime.js +0 -1
- package/dist/eval-core/schema.d.ts +0 -1
- package/dist/eval-core/schema.js +0 -1
- package/dist/eval-core/statistics.d.ts +0 -1
- package/dist/eval-core/statistics.js +0 -1
- package/dist/eval-core/task-planner.d.ts +0 -1
- package/dist/eval-core/task-planner.js +0 -1
- package/dist/eval-core/verdict.d.ts +21 -4
- package/dist/eval-core/verdict.js +54 -5
- package/dist/eval-workflows/batch-evaluation-workflow.d.ts +18 -3
- package/dist/eval-workflows/batch-evaluation-workflow.js +31 -15
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.d.ts +0 -1
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.js +0 -1
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.d.ts +0 -1
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.js +0 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.d.ts +0 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.js +0 -1
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.d.ts +0 -1
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.js +0 -1
- package/dist/eval-workflows/evaluation-pipeline.d.ts +0 -1
- package/dist/eval-workflows/evaluation-pipeline.js +0 -1
- package/dist/eval-workflows/evaluation-preparation.d.ts +1 -5
- package/dist/eval-workflows/evaluation-preparation.js +20 -16
- package/dist/eval-workflows/messages.d.ts +0 -1
- package/dist/eval-workflows/messages.js +0 -1
- package/dist/eval-workflows/run-evaluation.d.ts +4 -9
- package/dist/eval-workflows/run-evaluation.js +16 -26
- package/dist/executors/anthropic-api.d.ts +0 -1
- package/dist/executors/anthropic-api.js +1 -2
- package/dist/executors/claude-cli.d.ts +0 -1
- package/dist/executors/claude-cli.js +0 -1
- package/dist/executors/claude-sdk-trace.d.ts +0 -1
- package/dist/executors/claude-sdk-trace.js +0 -1
- package/dist/executors/claude-sdk.d.ts +0 -1
- package/dist/executors/claude-sdk.js +0 -1
- package/dist/executors/codex-cli-trace.d.ts +0 -1
- package/dist/executors/codex-cli-trace.js +0 -1
- package/dist/executors/codex-cli.d.ts +0 -1
- package/dist/executors/codex-cli.js +0 -1
- package/dist/executors/codex-sdk.d.ts +0 -1
- package/dist/executors/codex-sdk.js +0 -1
- package/dist/executors/gemini.d.ts +0 -1
- package/dist/executors/gemini.js +0 -1
- package/dist/executors/index.d.ts +0 -1
- package/dist/executors/index.js +0 -1
- package/dist/executors/openai-api.d.ts +0 -1
- package/dist/executors/openai-api.js +0 -1
- package/dist/executors/runtime-fingerprint.d.ts +0 -1
- package/dist/executors/runtime-fingerprint.js +2 -3
- package/dist/executors/script.d.ts +0 -1
- package/dist/executors/script.js +0 -1
- package/dist/executors/shared.d.ts +0 -2
- package/dist/executors/shared.js +0 -1
- package/dist/grading/assertions.d.ts +0 -1
- package/dist/grading/assertions.js +0 -1
- package/dist/grading/debias-validate.d.ts +0 -1
- package/dist/grading/debias-validate.js +0 -1
- package/dist/grading/diagnostic.d.ts +0 -1
- package/dist/grading/diagnostic.js +0 -1
- package/dist/grading/gold-cli.d.ts +0 -1
- package/dist/grading/gold-cli.js +0 -1
- package/dist/grading/gold-dataset.d.ts +0 -1
- package/dist/grading/gold-dataset.js +0 -1
- package/dist/grading/human-gold.d.ts +0 -1
- package/dist/grading/human-gold.js +0 -1
- package/dist/grading/index.d.ts +0 -1
- package/dist/grading/index.js +0 -1
- package/dist/grading/judge.d.ts +0 -1
- package/dist/grading/judge.js +0 -1
- package/dist/grading/layered-scores.d.ts +0 -1
- package/dist/grading/layered-scores.js +0 -1
- package/dist/inputs/eval-config.d.ts +0 -1
- package/dist/inputs/eval-config.js +3 -2
- package/dist/inputs/load-samples.d.ts +0 -1
- package/dist/inputs/load-samples.js +0 -1
- package/dist/inputs/mcp-resolver.d.ts +0 -1
- package/dist/inputs/mcp-resolver.js +0 -1
- package/dist/inputs/skill-loader.d.ts +99 -7
- package/dist/inputs/skill-loader.js +325 -45
- package/dist/inputs/source-resolver.d.ts +28 -0
- package/dist/inputs/source-resolver.js +125 -0
- package/dist/inputs/url-fetcher.d.ts +0 -1
- package/dist/inputs/url-fetcher.js +0 -1
- package/dist/managed/index.d.ts +5 -0
- package/dist/managed/index.js +5 -0
- package/dist/managed/store.d.ts +76 -0
- package/dist/managed/store.js +260 -0
- package/dist/observability/experience-frontmatter.d.ts +0 -1
- package/dist/observability/experience-frontmatter.js +0 -1
- package/dist/observability/experience.d.ts +1 -2
- package/dist/observability/experience.js +1 -2
- package/dist/observability/feedback-matchers.d.ts +0 -1
- package/dist/observability/feedback-matchers.js +0 -1
- package/dist/observability/feedback-projection.d.ts +0 -1
- package/dist/observability/feedback-projection.js +0 -1
- package/dist/observability/inbox-view-model.d.ts +0 -1
- package/dist/observability/inbox-view-model.js +0 -1
- package/dist/observability/inbox.d.ts +0 -1
- package/dist/observability/inbox.js +2 -3
- package/dist/observability/problem-patterns.d.ts +0 -1
- package/dist/observability/problem-patterns.js +0 -1
- package/dist/observability/resolved-review.d.ts +0 -1
- package/dist/observability/resolved-review.js +4 -5
- package/dist/observability/review-state.d.ts +0 -1
- package/dist/observability/review-state.js +3 -4
- package/dist/observability/skill-chain-advisories.d.ts +0 -1
- package/dist/observability/skill-chain-advisories.js +0 -1
- package/dist/observability/skill-chain.d.ts +0 -1
- package/dist/observability/skill-chain.js +5 -6
- package/dist/observability/skill-health-analyzer.d.ts +13 -1
- package/dist/observability/skill-health-analyzer.js +17 -3
- package/dist/observability/soft-standards/constants.d.ts +0 -1
- package/dist/observability/soft-standards/constants.js +0 -1
- package/dist/observability/soft-standards/index.d.ts +0 -1
- package/dist/observability/soft-standards/index.js +0 -1
- package/dist/observability/soft-standards/llm-extractor.d.ts +0 -1
- package/dist/observability/soft-standards/llm-extractor.js +7 -8
- package/dist/observability/soft-standards/runtime-evaluator.d.ts +0 -1
- package/dist/observability/soft-standards/runtime-evaluator.js +2 -3
- package/dist/observability/soft-standards/skill-standards-store.d.ts +0 -1
- package/dist/observability/soft-standards/skill-standards-store.js +5 -6
- package/dist/observability/soft-standards/types.d.ts +10 -11
- package/dist/observability/soft-standards/types.js +0 -1
- package/dist/observability/text-signals.d.ts +0 -1
- package/dist/observability/text-signals.js +0 -1
- package/dist/observability/trace-adapter.d.ts +0 -1
- package/dist/observability/trace-adapter.js +0 -1
- package/dist/observability/trace-attribution.d.ts +0 -1
- package/dist/observability/trace-attribution.js +0 -1
- package/dist/observability/trace-segmenter.d.ts +0 -1
- package/dist/observability/trace-segmenter.js +0 -1
- package/dist/observability/trace-source.d.ts +0 -1
- package/dist/observability/trace-source.js +0 -1
- package/dist/renderer/html-renderer.d.ts +0 -1
- package/dist/renderer/html-renderer.js +4 -5
- package/dist/renderer/layout.d.ts +0 -1
- package/dist/renderer/layout.js +2 -1
- package/dist/renderer/observation-inbox/helpers.d.ts +0 -1
- package/dist/renderer/observation-inbox/helpers.js +0 -1
- package/dist/renderer/observation-inbox/styles.d.ts +0 -1
- package/dist/renderer/observation-inbox/styles.js +0 -1
- package/dist/renderer/observation-inbox-renderer.d.ts +0 -1
- package/dist/renderer/observation-inbox-renderer.js +13 -14
- package/dist/renderer/skill-detail-renderer.d.ts +0 -1
- package/dist/renderer/skill-detail-renderer.js +101 -23
- package/dist/renderer/skill-health-renderer.d.ts +0 -1
- package/dist/renderer/skill-health-renderer.js +33 -5
- package/dist/renderer/skill-list-renderer.d.ts +0 -1
- package/dist/renderer/skill-list-renderer.js +18 -7
- package/dist/renderer/summary.d.ts +0 -1
- package/dist/renderer/summary.js +21 -10
- package/dist/renderer/table.d.ts +0 -1
- package/dist/renderer/table.js +0 -1
- package/dist/renderer/test-view.d.ts +0 -1
- package/dist/renderer/test-view.js +0 -1
- package/dist/renderer/trends.d.ts +0 -1
- package/dist/renderer/trends.js +0 -1
- package/dist/server/job-store.d.ts +0 -1
- package/dist/server/job-store.js +0 -1
- package/dist/server/report-server.d.ts +0 -1
- package/dist/server/report-server.js +10 -4
- package/dist/server/report-store.d.ts +1 -2
- package/dist/server/report-store.js +6 -7
- package/dist/server/skill-index.d.ts +0 -1
- package/dist/server/skill-index.js +7 -5
- package/dist/server/skill-insights.d.ts +0 -1
- package/dist/server/skill-insights.js +41 -14
- package/dist/shared/hard-rules.d.ts +0 -1
- package/dist/shared/hard-rules.js +0 -1
- package/dist/shared/llm-prompts/index.d.ts +0 -1
- package/dist/shared/llm-prompts/index.js +0 -1
- package/dist/shared/llm-prompts/skill-health.d.ts +0 -1
- package/dist/shared/llm-prompts/skill-health.js +0 -1
- package/dist/shared/time.d.ts +0 -1
- package/dist/shared/time.js +0 -1
- package/dist/shared/tool-search.d.ts +0 -1
- package/dist/shared/tool-search.js +0 -1
- package/dist/types/dependencies.d.ts +0 -1
- package/dist/types/dependencies.js +0 -1
- package/dist/types/diagnosis.d.ts +0 -1
- package/dist/types/diagnosis.js +0 -1
- package/dist/types/doctor.d.ts +4 -5
- package/dist/types/doctor.js +2 -3
- package/dist/types/eval.d.ts +2 -1
- package/dist/types/eval.js +0 -1
- package/dist/types/executor.d.ts +1 -2
- package/dist/types/executor.js +0 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/judge.d.ts +0 -1
- package/dist/types/judge.js +0 -1
- package/dist/types/managed.d.ts +85 -0
- package/dist/types/managed.js +1 -0
- package/dist/types/observability.d.ts +5 -6
- package/dist/types/observability.js +0 -1
- package/dist/types/report.d.ts +2 -3
- package/dist/types/report.js +0 -1
- package/dist/types/shared.d.ts +0 -1
- package/dist/types/shared.js +0 -1
- package/dist/types/skill-index.d.ts +3 -1
- package/dist/types/skill-index.js +0 -1
- package/dist/types/storage.d.ts +0 -1
- package/dist/types/storage.js +0 -1
- package/dist/util/safe-slice.d.ts +0 -1
- package/dist/util/safe-slice.js +0 -1
- package/package.json +10 -5
- package/dist/analysis/coverage-analyzer.d.ts.map +0 -1
- package/dist/analysis/coverage-analyzer.js.map +0 -1
- package/dist/analysis/failure-clusterer.d.ts.map +0 -1
- package/dist/analysis/failure-clusterer.js.map +0 -1
- package/dist/analysis/gap-analyzer.d.ts.map +0 -1
- package/dist/analysis/gap-analyzer.js.map +0 -1
- package/dist/analysis/hedging-classifier.d.ts.map +0 -1
- package/dist/analysis/hedging-classifier.js.map +0 -1
- package/dist/analysis/report-diagnostics.d.ts.map +0 -1
- package/dist/analysis/report-diagnostics.js.map +0 -1
- package/dist/analysis/sample-diagnostics.d.ts.map +0 -1
- package/dist/analysis/sample-diagnostics.js.map +0 -1
- package/dist/analysis/saturation.d.ts.map +0 -1
- package/dist/analysis/saturation.js.map +0 -1
- package/dist/authoring/evolver.d.ts.map +0 -1
- package/dist/authoring/evolver.js.map +0 -1
- package/dist/authoring/generator.d.ts.map +0 -1
- package/dist/authoring/generator.js.map +0 -1
- package/dist/authoring/sample-fixer.d.ts.map +0 -1
- package/dist/authoring/sample-fixer.js.map +0 -1
- package/dist/cli/commands/doctor.d.ts.map +0 -1
- package/dist/cli/commands/doctor.js.map +0 -1
- package/dist/cli/commands/eval/gold/compare.d.ts.map +0 -1
- package/dist/cli/commands/eval/gold/compare.js.map +0 -1
- package/dist/cli/commands/eval/gold/index.d.ts.map +0 -1
- package/dist/cli/commands/eval/gold/index.js.map +0 -1
- package/dist/cli/commands/eval/gold/init.d.ts.map +0 -1
- package/dist/cli/commands/eval/gold/init.js.map +0 -1
- package/dist/cli/commands/eval/gold/validate.d.ts.map +0 -1
- package/dist/cli/commands/eval/gold/validate.js.map +0 -1
- package/dist/cli/commands/eval/index.d.ts.map +0 -1
- package/dist/cli/commands/eval/index.js.map +0 -1
- package/dist/cli/commands/evolve.d.ts.map +0 -1
- package/dist/cli/commands/evolve.js.map +0 -1
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/init.js.map +0 -1
- package/dist/cli/commands/observe/inbox.d.ts.map +0 -1
- package/dist/cli/commands/observe/inbox.js.map +0 -1
- package/dist/cli/commands/observe/index.d.ts.map +0 -1
- package/dist/cli/commands/observe/index.js.map +0 -1
- package/dist/cli/commands/observe/ingest.d.ts.map +0 -1
- package/dist/cli/commands/observe/ingest.js.map +0 -1
- package/dist/cli/commands/observe/show.d.ts.map +0 -1
- package/dist/cli/commands/observe/show.js.map +0 -1
- package/dist/cli/commands/sample.d.ts.map +0 -1
- package/dist/cli/commands/sample.js.map +0 -1
- package/dist/cli/commands/studio.d.ts.map +0 -1
- package/dist/cli/commands/studio.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/lib/cli-exit.d.ts.map +0 -1
- package/dist/cli/lib/cli-exit.js.map +0 -1
- package/dist/cli/lib/cmd-flags.d.ts.map +0 -1
- package/dist/cli/lib/cmd-flags.js.map +0 -1
- package/dist/cli/lib/i18n-dict/common.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/common.js.map +0 -1
- package/dist/cli/lib/i18n-dict/evolve.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/evolve.js.map +0 -1
- package/dist/cli/lib/i18n-dict/gen.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/gen.js.map +0 -1
- package/dist/cli/lib/i18n-dict/help.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/help.js.map +0 -1
- package/dist/cli/lib/i18n-dict/init.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/init.js.map +0 -1
- package/dist/cli/lib/i18n-dict/run.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/run.js.map +0 -1
- package/dist/cli/lib/i18n-dict/types.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/types.js.map +0 -1
- package/dist/cli/lib/i18n-dict.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict.js.map +0 -1
- package/dist/cli/lib/i18n.d.ts.map +0 -1
- package/dist/cli/lib/i18n.js.map +0 -1
- package/dist/cli/lib/parse-run-config/judge-models.d.ts.map +0 -1
- package/dist/cli/lib/parse-run-config/judge-models.js.map +0 -1
- package/dist/cli/lib/parse-run-config/samples-discovery.d.ts.map +0 -1
- package/dist/cli/lib/parse-run-config/samples-discovery.js.map +0 -1
- package/dist/cli/lib/parse-run-config/variant-resolution.d.ts.map +0 -1
- package/dist/cli/lib/parse-run-config/variant-resolution.js.map +0 -1
- package/dist/cli/lib/parse-run-config.d.ts.map +0 -1
- package/dist/cli/lib/parse-run-config.js.map +0 -1
- package/dist/cli/lib/progress.d.ts.map +0 -1
- package/dist/cli/lib/progress.js.map +0 -1
- package/dist/cli/lib/resolve-skill-input.d.ts.map +0 -1
- package/dist/cli/lib/resolve-skill-input.js.map +0 -1
- package/dist/cli/lib/run-tally.d.ts.map +0 -1
- package/dist/cli/lib/run-tally.js.map +0 -1
- package/dist/cli/lib/shared.d.ts.map +0 -1
- package/dist/cli/lib/shared.js.map +0 -1
- package/dist/cli/lib/update-check.d.ts.map +0 -1
- package/dist/cli/lib/update-check.js.map +0 -1
- package/dist/cli/oclif/base-command.d.ts.map +0 -1
- package/dist/cli/oclif/base-command.js.map +0 -1
- package/dist/cli/oclif/help.d.ts.map +0 -1
- package/dist/cli/oclif/help.js.map +0 -1
- package/dist/cli/oclif/i18n.d.ts.map +0 -1
- package/dist/cli/oclif/i18n.js.map +0 -1
- package/dist/cli/oclif/parsers.d.ts.map +0 -1
- package/dist/cli/oclif/parsers.js.map +0 -1
- package/dist/cli/oclif/projection.d.ts.map +0 -1
- package/dist/cli/oclif/projection.js.map +0 -1
- package/dist/cli/oclif/run.d.ts.map +0 -1
- package/dist/cli/oclif/run.js.map +0 -1
- package/dist/diagnosis/observe-mapper.d.ts.map +0 -1
- package/dist/diagnosis/observe-mapper.js.map +0 -1
- package/dist/diagnosis/observe-producer.d.ts.map +0 -1
- package/dist/diagnosis/observe-producer.js.map +0 -1
- package/dist/diagnosis/studio-projection.d.ts.map +0 -1
- package/dist/diagnosis/studio-projection.js.map +0 -1
- package/dist/diagnosis/types.d.ts.map +0 -1
- package/dist/diagnosis/types.js.map +0 -1
- package/dist/doctor/fixer.d.ts.map +0 -1
- package/dist/doctor/fixer.js.map +0 -1
- package/dist/doctor/health/builtin-dimensions.d.ts.map +0 -1
- package/dist/doctor/health/builtin-dimensions.js.map +0 -1
- package/dist/doctor/health/composer.d.ts.map +0 -1
- package/dist/doctor/health/composer.js.map +0 -1
- package/dist/doctor/health/dimension-registry.d.ts.map +0 -1
- package/dist/doctor/health/dimension-registry.js.map +0 -1
- package/dist/doctor/health/dimension-spec.d.ts.map +0 -1
- package/dist/doctor/health/dimension-spec.js.map +0 -1
- package/dist/doctor/health/parser.d.ts.map +0 -1
- package/dist/doctor/health/parser.js.map +0 -1
- package/dist/doctor/health/prompt-builder.d.ts.map +0 -1
- package/dist/doctor/health/prompt-builder.js.map +0 -1
- package/dist/doctor/health/register.d.ts.map +0 -1
- package/dist/doctor/health/register.js.map +0 -1
- package/dist/doctor/index.d.ts.map +0 -1
- package/dist/doctor/index.js.map +0 -1
- package/dist/doctor/messages.d.ts.map +0 -1
- package/dist/doctor/messages.js.map +0 -1
- package/dist/doctor/preflight.d.ts.map +0 -1
- package/dist/doctor/preflight.js.map +0 -1
- package/dist/doctor/renderer.d.ts.map +0 -1
- package/dist/doctor/renderer.js.map +0 -1
- package/dist/doctor/rules.d.ts.map +0 -1
- package/dist/doctor/rules.js.map +0 -1
- package/dist/eval-core/bootstrap.d.ts.map +0 -1
- package/dist/eval-core/bootstrap.js.map +0 -1
- package/dist/eval-core/cache.d.ts.map +0 -1
- package/dist/eval-core/cache.js.map +0 -1
- package/dist/eval-core/comparability.d.ts.map +0 -1
- package/dist/eval-core/comparability.js.map +0 -1
- package/dist/eval-core/dependency-checker.d.ts.map +0 -1
- package/dist/eval-core/dependency-checker.js.map +0 -1
- package/dist/eval-core/evaluation-execution.d.ts.map +0 -1
- package/dist/eval-core/evaluation-execution.js.map +0 -1
- package/dist/eval-core/evaluation-job.d.ts.map +0 -1
- package/dist/eval-core/evaluation-job.js.map +0 -1
- package/dist/eval-core/evaluation-reporting.d.ts.map +0 -1
- package/dist/eval-core/evaluation-reporting.js.map +0 -1
- package/dist/eval-core/execution-strategy.d.ts.map +0 -1
- package/dist/eval-core/execution-strategy.js.map +0 -1
- package/dist/eval-core/fact-checker.d.ts.map +0 -1
- package/dist/eval-core/fact-checker.js.map +0 -1
- package/dist/eval-core/layer-gates.d.ts.map +0 -1
- package/dist/eval-core/layer-gates.js.map +0 -1
- package/dist/eval-core/mocks-runtime.d.ts.map +0 -1
- package/dist/eval-core/mocks-runtime.js.map +0 -1
- package/dist/eval-core/schema.d.ts.map +0 -1
- package/dist/eval-core/schema.js.map +0 -1
- package/dist/eval-core/statistics.d.ts.map +0 -1
- package/dist/eval-core/statistics.js.map +0 -1
- package/dist/eval-core/task-planner.d.ts.map +0 -1
- package/dist/eval-core/task-planner.js.map +0 -1
- package/dist/eval-core/verdict.d.ts.map +0 -1
- package/dist/eval-core/verdict.js.map +0 -1
- package/dist/eval-workflows/batch-evaluation-workflow.d.ts.map +0 -1
- package/dist/eval-workflows/batch-evaluation-workflow.js.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.js.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.js.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.js.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.js.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline.js.map +0 -1
- package/dist/eval-workflows/evaluation-preparation.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-preparation.js.map +0 -1
- package/dist/eval-workflows/messages.d.ts.map +0 -1
- package/dist/eval-workflows/messages.js.map +0 -1
- package/dist/eval-workflows/run-evaluation.d.ts.map +0 -1
- package/dist/eval-workflows/run-evaluation.js.map +0 -1
- package/dist/executors/anthropic-api.d.ts.map +0 -1
- package/dist/executors/anthropic-api.js.map +0 -1
- package/dist/executors/claude-cli.d.ts.map +0 -1
- package/dist/executors/claude-cli.js.map +0 -1
- package/dist/executors/claude-sdk-trace.d.ts.map +0 -1
- package/dist/executors/claude-sdk-trace.js.map +0 -1
- package/dist/executors/claude-sdk.d.ts.map +0 -1
- package/dist/executors/claude-sdk.js.map +0 -1
- package/dist/executors/codex-cli-trace.d.ts.map +0 -1
- package/dist/executors/codex-cli-trace.js.map +0 -1
- package/dist/executors/codex-cli.d.ts.map +0 -1
- package/dist/executors/codex-cli.js.map +0 -1
- package/dist/executors/codex-sdk.d.ts.map +0 -1
- package/dist/executors/codex-sdk.js.map +0 -1
- package/dist/executors/gemini.d.ts.map +0 -1
- package/dist/executors/gemini.js.map +0 -1
- package/dist/executors/index.d.ts.map +0 -1
- package/dist/executors/index.js.map +0 -1
- package/dist/executors/openai-api.d.ts.map +0 -1
- package/dist/executors/openai-api.js.map +0 -1
- package/dist/executors/runtime-fingerprint.d.ts.map +0 -1
- package/dist/executors/runtime-fingerprint.js.map +0 -1
- package/dist/executors/script.d.ts.map +0 -1
- package/dist/executors/script.js.map +0 -1
- package/dist/executors/shared.d.ts.map +0 -1
- package/dist/executors/shared.js.map +0 -1
- package/dist/grading/assertions.d.ts.map +0 -1
- package/dist/grading/assertions.js.map +0 -1
- package/dist/grading/debias-validate.d.ts.map +0 -1
- package/dist/grading/debias-validate.js.map +0 -1
- package/dist/grading/diagnostic.d.ts.map +0 -1
- package/dist/grading/diagnostic.js.map +0 -1
- package/dist/grading/gold-cli.d.ts.map +0 -1
- package/dist/grading/gold-cli.js.map +0 -1
- package/dist/grading/gold-dataset.d.ts.map +0 -1
- package/dist/grading/gold-dataset.js.map +0 -1
- package/dist/grading/human-gold.d.ts.map +0 -1
- package/dist/grading/human-gold.js.map +0 -1
- package/dist/grading/index.d.ts.map +0 -1
- package/dist/grading/index.js.map +0 -1
- package/dist/grading/judge.d.ts.map +0 -1
- package/dist/grading/judge.js.map +0 -1
- package/dist/grading/layered-scores.d.ts.map +0 -1
- package/dist/grading/layered-scores.js.map +0 -1
- package/dist/inputs/eval-config.d.ts.map +0 -1
- package/dist/inputs/eval-config.js.map +0 -1
- package/dist/inputs/load-samples.d.ts.map +0 -1
- package/dist/inputs/load-samples.js.map +0 -1
- package/dist/inputs/mcp-resolver.d.ts.map +0 -1
- package/dist/inputs/mcp-resolver.js.map +0 -1
- package/dist/inputs/skill-loader.d.ts.map +0 -1
- package/dist/inputs/skill-loader.js.map +0 -1
- package/dist/inputs/url-fetcher.d.ts.map +0 -1
- package/dist/inputs/url-fetcher.js.map +0 -1
- package/dist/observability/experience-frontmatter.d.ts.map +0 -1
- package/dist/observability/experience-frontmatter.js.map +0 -1
- package/dist/observability/experience.d.ts.map +0 -1
- package/dist/observability/experience.js.map +0 -1
- package/dist/observability/feedback-matchers.d.ts.map +0 -1
- package/dist/observability/feedback-matchers.js.map +0 -1
- package/dist/observability/feedback-projection.d.ts.map +0 -1
- package/dist/observability/feedback-projection.js.map +0 -1
- package/dist/observability/inbox-view-model.d.ts.map +0 -1
- package/dist/observability/inbox-view-model.js.map +0 -1
- package/dist/observability/inbox.d.ts.map +0 -1
- package/dist/observability/inbox.js.map +0 -1
- package/dist/observability/problem-patterns.d.ts.map +0 -1
- package/dist/observability/problem-patterns.js.map +0 -1
- package/dist/observability/resolved-review.d.ts.map +0 -1
- package/dist/observability/resolved-review.js.map +0 -1
- package/dist/observability/review-state.d.ts.map +0 -1
- package/dist/observability/review-state.js.map +0 -1
- package/dist/observability/skill-chain-advisories.d.ts.map +0 -1
- package/dist/observability/skill-chain-advisories.js.map +0 -1
- package/dist/observability/skill-chain.d.ts.map +0 -1
- package/dist/observability/skill-chain.js.map +0 -1
- package/dist/observability/skill-health-analyzer.d.ts.map +0 -1
- package/dist/observability/skill-health-analyzer.js.map +0 -1
- package/dist/observability/soft-standards/constants.d.ts.map +0 -1
- package/dist/observability/soft-standards/constants.js.map +0 -1
- package/dist/observability/soft-standards/index.d.ts.map +0 -1
- package/dist/observability/soft-standards/index.js.map +0 -1
- package/dist/observability/soft-standards/llm-extractor.d.ts.map +0 -1
- package/dist/observability/soft-standards/llm-extractor.js.map +0 -1
- package/dist/observability/soft-standards/runtime-evaluator.d.ts.map +0 -1
- package/dist/observability/soft-standards/runtime-evaluator.js.map +0 -1
- package/dist/observability/soft-standards/skill-standards-store.d.ts.map +0 -1
- package/dist/observability/soft-standards/skill-standards-store.js.map +0 -1
- package/dist/observability/soft-standards/types.d.ts.map +0 -1
- package/dist/observability/soft-standards/types.js.map +0 -1
- package/dist/observability/text-signals.d.ts.map +0 -1
- package/dist/observability/text-signals.js.map +0 -1
- package/dist/observability/trace-adapter.d.ts.map +0 -1
- package/dist/observability/trace-adapter.js.map +0 -1
- package/dist/observability/trace-attribution.d.ts.map +0 -1
- package/dist/observability/trace-attribution.js.map +0 -1
- package/dist/observability/trace-segmenter.d.ts.map +0 -1
- package/dist/observability/trace-segmenter.js.map +0 -1
- package/dist/observability/trace-source.d.ts.map +0 -1
- package/dist/observability/trace-source.js.map +0 -1
- package/dist/renderer/html-renderer.d.ts.map +0 -1
- package/dist/renderer/html-renderer.js.map +0 -1
- package/dist/renderer/layout.d.ts.map +0 -1
- package/dist/renderer/layout.js.map +0 -1
- package/dist/renderer/observation-inbox/helpers.d.ts.map +0 -1
- package/dist/renderer/observation-inbox/helpers.js.map +0 -1
- package/dist/renderer/observation-inbox/styles.d.ts.map +0 -1
- package/dist/renderer/observation-inbox/styles.js.map +0 -1
- package/dist/renderer/observation-inbox-renderer.d.ts.map +0 -1
- package/dist/renderer/observation-inbox-renderer.js.map +0 -1
- package/dist/renderer/skill-detail-renderer.d.ts.map +0 -1
- package/dist/renderer/skill-detail-renderer.js.map +0 -1
- package/dist/renderer/skill-health-renderer.d.ts.map +0 -1
- package/dist/renderer/skill-health-renderer.js.map +0 -1
- package/dist/renderer/skill-list-renderer.d.ts.map +0 -1
- package/dist/renderer/skill-list-renderer.js.map +0 -1
- package/dist/renderer/summary.d.ts.map +0 -1
- package/dist/renderer/summary.js.map +0 -1
- package/dist/renderer/table.d.ts.map +0 -1
- package/dist/renderer/table.js.map +0 -1
- package/dist/renderer/test-view.d.ts.map +0 -1
- package/dist/renderer/test-view.js.map +0 -1
- package/dist/renderer/trends.d.ts.map +0 -1
- package/dist/renderer/trends.js.map +0 -1
- package/dist/server/job-store.d.ts.map +0 -1
- package/dist/server/job-store.js.map +0 -1
- package/dist/server/report-server.d.ts.map +0 -1
- package/dist/server/report-server.js.map +0 -1
- package/dist/server/report-store.d.ts.map +0 -1
- package/dist/server/report-store.js.map +0 -1
- package/dist/server/skill-index.d.ts.map +0 -1
- package/dist/server/skill-index.js.map +0 -1
- package/dist/server/skill-insights.d.ts.map +0 -1
- package/dist/server/skill-insights.js.map +0 -1
- package/dist/shared/hard-rules.d.ts.map +0 -1
- package/dist/shared/hard-rules.js.map +0 -1
- package/dist/shared/llm-prompts/index.d.ts.map +0 -1
- package/dist/shared/llm-prompts/index.js.map +0 -1
- package/dist/shared/llm-prompts/skill-health.d.ts.map +0 -1
- package/dist/shared/llm-prompts/skill-health.js.map +0 -1
- package/dist/shared/time.d.ts.map +0 -1
- package/dist/shared/time.js.map +0 -1
- package/dist/shared/tool-search.d.ts.map +0 -1
- package/dist/shared/tool-search.js.map +0 -1
- package/dist/types/dependencies.d.ts.map +0 -1
- package/dist/types/dependencies.js.map +0 -1
- package/dist/types/diagnosis.d.ts.map +0 -1
- package/dist/types/diagnosis.js.map +0 -1
- package/dist/types/doctor.d.ts.map +0 -1
- package/dist/types/doctor.js.map +0 -1
- package/dist/types/eval.d.ts.map +0 -1
- package/dist/types/eval.js.map +0 -1
- package/dist/types/executor.d.ts.map +0 -1
- package/dist/types/executor.js.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/judge.d.ts.map +0 -1
- package/dist/types/judge.js.map +0 -1
- package/dist/types/observability.d.ts.map +0 -1
- package/dist/types/observability.js.map +0 -1
- package/dist/types/report.d.ts.map +0 -1
- package/dist/types/report.js.map +0 -1
- package/dist/types/shared.d.ts.map +0 -1
- package/dist/types/shared.js.map +0 -1
- package/dist/types/skill-index.d.ts.map +0 -1
- package/dist/types/skill-index.js.map +0 -1
- package/dist/types/storage.d.ts.map +0 -1
- package/dist/types/storage.js.map +0 -1
- package/dist/util/safe-slice.d.ts.map +0 -1
- package/dist/util/safe-slice.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Sample } from '../types/index.js';
|
|
1
|
+
import type { Sample, ExecutorFn } from '../types/index.js';
|
|
2
|
+
import type { ObservationInboxItem } from '../types/observability.js';
|
|
2
3
|
interface GenerateSamplesOptions {
|
|
3
4
|
skillContent: string;
|
|
4
5
|
count?: number;
|
|
@@ -29,10 +30,36 @@ export declare function generateSamples({ skillContent, count, model, executorNa
|
|
|
29
30
|
samples: Sample[];
|
|
30
31
|
costUSD: number;
|
|
31
32
|
}>;
|
|
33
|
+
type TraceSignalItem = Pick<ObservationInboxItem, 'skillName' | 'signalType' | 'signalSubtype' | 'severity' | 'evidence' | 'messageWindow' | 'occurrences'>;
|
|
34
|
+
/**
|
|
35
|
+
* Build the generation prompt for `omk sample --from-traces`. Renders each
|
|
36
|
+
* observation-inbox signal (evidence + message window) into a section and asks
|
|
37
|
+
* the generator to synthesize regression samples that reproduce the observed
|
|
38
|
+
* production failures. The trace text feeds the *generator* only — never the
|
|
39
|
+
* judge prompt — so judge-prompt isolation is unaffected.
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildSamplesFromTracesPrompt(items: TraceSignalItem[], count?: number): string;
|
|
42
|
+
export interface GenerateSamplesFromTracesOptions {
|
|
43
|
+
items: TraceSignalItem[];
|
|
44
|
+
count?: number;
|
|
45
|
+
model?: string;
|
|
46
|
+
executorName?: string;
|
|
47
|
+
/** Injectable executor (tests). Defaults to createExecutor(executorName). */
|
|
48
|
+
executor?: ExecutorFn;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Generate draft eval samples from production-trace observation signals. Mirrors
|
|
52
|
+
* generateSamples' executor / retry / finalize path but feeds the trace prompt and
|
|
53
|
+
* stamps `provenance: 'production-trace'`. Output is meant to land in a review draft,
|
|
54
|
+
* not the live dataset (the CLI enforces that).
|
|
55
|
+
*/
|
|
56
|
+
export declare function generateSamplesFromTraces({ items, count, model, executorName, executor: injectedExecutor, }: GenerateSamplesFromTracesOptions): Promise<{
|
|
57
|
+
samples: Sample[];
|
|
58
|
+
costUSD: number;
|
|
59
|
+
}>;
|
|
32
60
|
export declare function sanitizeGeneratedSamples(samples: Sample[], opts?: {
|
|
33
61
|
skillContent?: string;
|
|
34
62
|
}): {
|
|
35
63
|
stripped: string[];
|
|
36
64
|
};
|
|
37
65
|
export {};
|
|
38
|
-
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -461,6 +461,119 @@ async function finalizeSamples(samples, costUSD, skillContent) {
|
|
|
461
461
|
}
|
|
462
462
|
return { samples, costUSD };
|
|
463
463
|
}
|
|
464
|
+
const TRACE_GEN_INSTRUCTIONS = `下面给出的不是 skill,而是从生产会话 trace 中观测到的失败 / 异常信号。请为这些信号生成评测用例(eval samples),使评测能复现并守住这些失败模式——把线上真实发生过的问题沉淀成回归用例。
|
|
465
|
+
|
|
466
|
+
要求:
|
|
467
|
+
- 每个信号生成 1-2 条聚焦回归用例;信号若是噪声 / 证据不足 / 无法复现,跳过它,不要硬凑。
|
|
468
|
+
- prompt 要还原触发该信号的场景(自然语言任务),不要直接复述证据文本。
|
|
469
|
+
- 断言优先用 mock_hit / tools_called / tools_not_called / tool_input_contains 精确锚定失败步骤,再用 contains 兜底;按「原子型」配比处理(无需工作流编号步骤),除非证据明显是多步流程。
|
|
470
|
+
- 不要在输出里说明判断过程,直接输出 JSON 数组。`;
|
|
471
|
+
/**
|
|
472
|
+
* Build the generation prompt for `omk sample --from-traces`. Renders each
|
|
473
|
+
* observation-inbox signal (evidence + message window) into a section and asks
|
|
474
|
+
* the generator to synthesize regression samples that reproduce the observed
|
|
475
|
+
* production failures. The trace text feeds the *generator* only — never the
|
|
476
|
+
* judge prompt — so judge-prompt isolation is unaffected.
|
|
477
|
+
*/
|
|
478
|
+
export function buildSamplesFromTracesPrompt(items, count) {
|
|
479
|
+
const sections = items.map((it, i) => {
|
|
480
|
+
const ev = it.evidence ?? {};
|
|
481
|
+
const evLines = [
|
|
482
|
+
ev.tool && `工具: ${ev.tool}`,
|
|
483
|
+
ev.query && `查询/输入: ${ev.query}`,
|
|
484
|
+
ev.path && `路径: ${ev.path}`,
|
|
485
|
+
ev.outputSnippet && `输出片段: ${ev.outputSnippet}`,
|
|
486
|
+
ev.assistantSnippet && `助手片段: ${ev.assistantSnippet}`,
|
|
487
|
+
ev.markerToken && `标记: ${ev.markerToken}`,
|
|
488
|
+
].filter(Boolean).join('\n') || '(无结构化证据)';
|
|
489
|
+
const win = it.messageWindow
|
|
490
|
+
? '\n上下文消息:\n' + [...it.messageWindow.before, ...it.messageWindow.event, ...it.messageWindow.after]
|
|
491
|
+
.map((m) => ` [${m.role}] ${m.snippet}`).join('\n')
|
|
492
|
+
: '';
|
|
493
|
+
return `### 信号 ${i + 1}:${it.signalType} / ${it.signalSubtype}(严重度 ${it.severity},出现 ${it.occurrences} 次,skill: ${it.skillName})\n${evLines}${win}`;
|
|
494
|
+
}).join('\n\n---\n\n');
|
|
495
|
+
const countLine = typeof count === 'number'
|
|
496
|
+
? `共生成约 ${count} 条评测用例。`
|
|
497
|
+
: '按上面的「每个信号 1-2 条」生成。';
|
|
498
|
+
return `${TRACE_GEN_INSTRUCTIONS}
|
|
499
|
+
|
|
500
|
+
## 观测到的失败信号(共 ${items.length} 个)
|
|
501
|
+
|
|
502
|
+
${sections}
|
|
503
|
+
|
|
504
|
+
${countLine}直接输出 JSON 数组。`;
|
|
505
|
+
}
|
|
506
|
+
/** Build a sanitize context string from trace evidence so finalizeSamples keeps
|
|
507
|
+
* tool-name assertions that reference tools actually seen in the traces (an empty
|
|
508
|
+
* context would strip every tool-name fact assertion). */
|
|
509
|
+
function traceSanitizeContext(items) {
|
|
510
|
+
return items.map((it) => {
|
|
511
|
+
const ev = it.evidence ?? {};
|
|
512
|
+
return [ev.tool, ev.query, ev.path, ev.outputSnippet, ev.assistantSnippet, ev.markerToken]
|
|
513
|
+
.filter(Boolean).join(' ');
|
|
514
|
+
}).join('\n');
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Generate draft eval samples from production-trace observation signals. Mirrors
|
|
518
|
+
* generateSamples' executor / retry / finalize path but feeds the trace prompt and
|
|
519
|
+
* stamps `provenance: 'production-trace'`. Output is meant to land in a review draft,
|
|
520
|
+
* not the live dataset (the CLI enforces that).
|
|
521
|
+
*/
|
|
522
|
+
export async function generateSamplesFromTraces({ items, count, model = GENERATOR_DEFAULT_MODEL, executorName = 'claude', executor: injectedExecutor, }) {
|
|
523
|
+
if (items.length === 0)
|
|
524
|
+
return { samples: [], costUSD: 0 };
|
|
525
|
+
const executor = injectedExecutor ?? createExecutor(executorName);
|
|
526
|
+
const prompt = buildSamplesFromTracesPrompt(items, count);
|
|
527
|
+
const sanitizeContext = traceSanitizeContext(items);
|
|
528
|
+
const PROVENANCE = 'production-trace';
|
|
529
|
+
const MAX_ATTEMPTS = 3;
|
|
530
|
+
let lastErr = '';
|
|
531
|
+
let totalCost = 0;
|
|
532
|
+
for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
|
|
533
|
+
const attemptPrompt = attempt === 1
|
|
534
|
+
? prompt
|
|
535
|
+
: `${prompt}\n\n上一次输出解析失败:${lastErr}\n请严格按 JSON 规范输出(字符串内部用「」全角引号),只输出数组,不要包含其他文字。`;
|
|
536
|
+
const result = await executor({ model, system: SYSTEM_PROMPT, prompt: attemptPrompt, timeoutMs: 300_000, lean: true });
|
|
537
|
+
totalCost += result.costUSD || 0;
|
|
538
|
+
if (!result.ok) {
|
|
539
|
+
lastErr = result.error || 'unknown error';
|
|
540
|
+
if (attempt === MAX_ATTEMPTS)
|
|
541
|
+
throw new Error(`trace generation failed after ${MAX_ATTEMPTS} attempts: ${lastErr}`);
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
let jsonStr = result.output.trim();
|
|
545
|
+
const jsonMatch = jsonStr.match(/```(?:json)?\s*([\s\S]*?)```/);
|
|
546
|
+
if (jsonMatch)
|
|
547
|
+
jsonStr = jsonMatch[1].trim();
|
|
548
|
+
let samples;
|
|
549
|
+
try {
|
|
550
|
+
samples = JSON.parse(jsonStr);
|
|
551
|
+
}
|
|
552
|
+
catch (e) {
|
|
553
|
+
lastErr = `JSON 解析失败: ${e.message}`;
|
|
554
|
+
if (attempt === MAX_ATTEMPTS)
|
|
555
|
+
throw new Error(`trace generation failed after ${MAX_ATTEMPTS} attempts (JSON invalid): ${lastErr}`);
|
|
556
|
+
process.stderr.write(`[omk sample --from-traces] 第 ${attempt} 次输出 JSON 无效,重试中...\n`);
|
|
557
|
+
continue;
|
|
558
|
+
}
|
|
559
|
+
if (!Array.isArray(samples)) {
|
|
560
|
+
lastErr = '输出不是 JSON 数组';
|
|
561
|
+
if (attempt === MAX_ATTEMPTS)
|
|
562
|
+
throw new Error(`trace generation failed after ${MAX_ATTEMPTS} attempts: ${lastErr}`);
|
|
563
|
+
continue;
|
|
564
|
+
}
|
|
565
|
+
// Empty array = the model conservatively skipped every signal (the trace prompt
|
|
566
|
+
// explicitly permits this when signals are noise / unreproducible). That's a valid
|
|
567
|
+
// 0-result, not a failure — return it so the CLI can no-op instead of erroring.
|
|
568
|
+
if (samples.length === 0)
|
|
569
|
+
return { samples: [], costUSD: totalCost };
|
|
570
|
+
// Stamp provenance before sanitize so it survives (it's a valid enum value).
|
|
571
|
+
for (const s of samples)
|
|
572
|
+
s.provenance = PROVENANCE;
|
|
573
|
+
return await finalizeSamples(samples, totalCost, sanitizeContext);
|
|
574
|
+
}
|
|
575
|
+
throw new Error('unreachable');
|
|
576
|
+
}
|
|
464
577
|
/**
|
|
465
578
|
* Validate + sanitize LLM-generated samples at generator boundary.
|
|
466
579
|
*
|
|
@@ -717,4 +830,3 @@ export function sanitizeGeneratedSamples(samples, opts = {}) {
|
|
|
717
830
|
}
|
|
718
831
|
return { stripped };
|
|
719
832
|
}
|
|
720
|
-
//# sourceMappingURL=generator.js.map
|
|
@@ -16,6 +16,8 @@ export default class Doctor extends BaseCommand {
|
|
|
16
16
|
model: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
17
|
samples: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
18
|
timeout: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
dimensions: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
21
|
'static-only': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
22
|
fix: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
23
|
effort: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -23,4 +25,3 @@ export default class Doctor extends BaseCommand {
|
|
|
23
25
|
run(): Promise<void>;
|
|
24
26
|
}
|
|
25
27
|
export declare function pruneDoctorHistory(dir: string, skillName: string, maxKeep: number): void;
|
|
26
|
-
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -117,7 +117,7 @@ export default class Doctor extends BaseCommand {
|
|
|
117
117
|
}),
|
|
118
118
|
samples: Flags.string({
|
|
119
119
|
description: bilingual({
|
|
120
|
-
zh: '
|
|
120
|
+
zh: '用例文件路径(.json/.yaml)。不传则按 target / cwd 顺序自动发现。',
|
|
121
121
|
en: 'Samples file path (.json/.yaml). Auto-detects from target / cwd if omitted.',
|
|
122
122
|
}),
|
|
123
123
|
}),
|
|
@@ -128,6 +128,18 @@ export default class Doctor extends BaseCommand {
|
|
|
128
128
|
}),
|
|
129
129
|
parse: numberStringParser('--timeout', { min: 1 }),
|
|
130
130
|
}),
|
|
131
|
+
'output-dir': Flags.string({
|
|
132
|
+
description: bilingual({
|
|
133
|
+
zh: '报告输出目录,默认 ~/.oh-my-knowledge/doctors。',
|
|
134
|
+
en: 'Report output dir, default ~/.oh-my-knowledge/doctors.',
|
|
135
|
+
}),
|
|
136
|
+
}),
|
|
137
|
+
dimensions: Flags.string({
|
|
138
|
+
description: bilingual({
|
|
139
|
+
zh: '自定义维度配置文件(YAML),追加到内置 7 维度之后。',
|
|
140
|
+
en: 'Custom dimensions config file (YAML), appended after builtin 7 dimensions.',
|
|
141
|
+
}),
|
|
142
|
+
}),
|
|
131
143
|
'static-only': Flags.boolean({
|
|
132
144
|
description: bilingual({
|
|
133
145
|
zh: '离线静态模式,只跑 4 条静态 rule(skill_readable / skill_metadata / dependencies_present / samples_contract_aligned),不调 LLM。',
|
|
@@ -182,6 +194,13 @@ export default class Doctor extends BaseCommand {
|
|
|
182
194
|
}
|
|
183
195
|
// 副作用 import: 注册 7 内置维度 spec + skill_health composer rule。
|
|
184
196
|
await import('../../doctor/health/register.js');
|
|
197
|
+
if (flags.dimensions) {
|
|
198
|
+
const { loadAndRegisterCustomDimensions } = await import('../../doctor/health/load-custom-dimensions.js');
|
|
199
|
+
const count = loadAndRegisterCustomDimensions(resolve(flags.dimensions));
|
|
200
|
+
if (count > 0) {
|
|
201
|
+
process.stderr.write(lang === 'zh' ? `已加载 ${count} 个自定义维度\n` : `Loaded ${count} custom dimension(s)\n`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
185
204
|
const { runDoctor } = await import('../../doctor/index.js');
|
|
186
205
|
const { renderDoctorReportText, renderDoctorReportJson } = await import('../../doctor/renderer.js');
|
|
187
206
|
const { getRegisteredRules } = await import('../../doctor/rules.js');
|
|
@@ -233,7 +252,7 @@ export default class Doctor extends BaseCommand {
|
|
|
233
252
|
}
|
|
234
253
|
renderDoctorReportText(report, lang);
|
|
235
254
|
}
|
|
236
|
-
persistDoctorReport(report);
|
|
255
|
+
persistDoctorReport(report, flags['output-dir'] ? resolve(flags['output-dir']) : undefined);
|
|
237
256
|
if (flags.fix) {
|
|
238
257
|
const existing = report;
|
|
239
258
|
if (existing.outcome !== 'failed') {
|
|
@@ -251,8 +270,8 @@ export default class Doctor extends BaseCommand {
|
|
|
251
270
|
// 每个 skill 最多保留多少份历史 doctor 报告(避免无界增长拖慢 studio 启动 +
|
|
252
271
|
// scanDoctorReports 扫盘成本)。50 = ~每天 1 跑撑 1.5 个月 sparkline,够用。
|
|
253
272
|
const DOCTOR_HISTORY_MAX_PER_SKILL = 50;
|
|
254
|
-
function persistDoctorReport(report) {
|
|
255
|
-
const dir = join(homedir(), '.oh-my-knowledge', 'doctors');
|
|
273
|
+
function persistDoctorReport(report, outputDir) {
|
|
274
|
+
const dir = outputDir ?? join(homedir(), '.oh-my-knowledge', 'doctors');
|
|
256
275
|
mkdirSync(dir, { recursive: true });
|
|
257
276
|
const safeId = report.id.replace(/[/\\:*?"<>|]/g, '_');
|
|
258
277
|
for (const skill of report.skills) {
|
|
@@ -281,7 +300,7 @@ export function pruneDoctorHistory(dir, skillName, maxKeep) {
|
|
|
281
300
|
continue;
|
|
282
301
|
try {
|
|
283
302
|
const data = JSON.parse(readFileSync(join(dir, file), 'utf-8'));
|
|
284
|
-
if (data?.
|
|
303
|
+
if (data?.reportKind !== 'doctor' || !Array.isArray(data.skills) || data.skills.length !== 1)
|
|
285
304
|
continue;
|
|
286
305
|
if (data.skills[0].skillName !== skillName)
|
|
287
306
|
continue;
|
|
@@ -299,4 +318,3 @@ export function pruneDoctorHistory(dir, skillName, maxKeep) {
|
|
|
299
318
|
catch { /* ignore */ }
|
|
300
319
|
}
|
|
301
320
|
}
|
|
302
|
-
//# sourceMappingURL=doctor.js.map
|
|
@@ -9,6 +9,8 @@ export default class Eval extends BaseCommand {
|
|
|
9
9
|
lang: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
control: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
treatment: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'control-cwd': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'treatment-cwd': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
14
|
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
15
|
samples: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
16
|
'skill-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -51,4 +53,3 @@ export default class Eval extends BaseCommand {
|
|
|
51
53
|
};
|
|
52
54
|
run(): Promise<void>;
|
|
53
55
|
}
|
|
54
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -7,6 +7,7 @@ import { tCli } from '../../lib/i18n.js';
|
|
|
7
7
|
import { parseRunConfig } from '../../lib/parse-run-config.js';
|
|
8
8
|
import { makeOnProgress } from '../../lib/progress.js';
|
|
9
9
|
import { computeRunTally } from '../../lib/run-tally.js';
|
|
10
|
+
import { DEFAULT_BOOTSTRAP_SAMPLES } from '../../../eval-core/bootstrap.js';
|
|
10
11
|
function isDryRunReport(report) {
|
|
11
12
|
return Boolean(report && typeof report === 'object' && report.dryRun === true);
|
|
12
13
|
}
|
|
@@ -44,7 +45,7 @@ async function emitEvaluationVerdict(report, values) {
|
|
|
44
45
|
}
|
|
45
46
|
function batchItemFallbackReport(batch, item) {
|
|
46
47
|
return {
|
|
47
|
-
|
|
48
|
+
reportKind: 'evaluation',
|
|
48
49
|
id: item.reportId,
|
|
49
50
|
meta: {
|
|
50
51
|
...batch.meta,
|
|
@@ -64,7 +65,7 @@ async function loadBatchChildReports(batch, reportsDir, lang) {
|
|
|
64
65
|
const reports = [];
|
|
65
66
|
for (const item of batch.items) {
|
|
66
67
|
const loaded = await store.get(item.reportId);
|
|
67
|
-
if (loaded?.
|
|
68
|
+
if (loaded?.reportKind === 'evaluation') {
|
|
68
69
|
reports.push(loaded);
|
|
69
70
|
}
|
|
70
71
|
else {
|
|
@@ -99,7 +100,7 @@ async function emitBatchVerdict(report, reportsDir, values, lang) {
|
|
|
99
100
|
}
|
|
100
101
|
async function announceSavedReport({ report, filePath, reportsDir, values, lang, }) {
|
|
101
102
|
const tally = computeRunTally(report);
|
|
102
|
-
process.stderr.write(tCli(report.
|
|
103
|
+
process.stderr.write(tCli(report.reportKind === 'batch-evaluation' ? 'cli.run.batch_complete' : 'cli.run.eval_complete', lang));
|
|
103
104
|
process.stderr.write(tCli('cli.run.tally', lang, tally));
|
|
104
105
|
process.stderr.write(tCli('cli.run.report_saved', lang, { path: filePath }));
|
|
105
106
|
if (!values['no-serve'] && process.stdout.isTTY) {
|
|
@@ -162,11 +163,11 @@ async function runEval(_args, flags, lang) {
|
|
|
162
163
|
if (bootstrapEnabled) {
|
|
163
164
|
config.bootstrap = true;
|
|
164
165
|
const bsRaw = values['bootstrap-samples'];
|
|
165
|
-
const parsedBs = bsRaw !== undefined ? Number(bsRaw) : (evalConfig?.bootstrapSamples ??
|
|
166
|
+
const parsedBs = bsRaw !== undefined ? Number(bsRaw) : (evalConfig?.bootstrapSamples ?? DEFAULT_BOOTSTRAP_SAMPLES);
|
|
166
167
|
if (bsRaw !== undefined && (!Number.isFinite(parsedBs) || parsedBs < 100)) {
|
|
167
168
|
process.stderr.write(tCli('cli.run.invalid_bootstrap_samples', lang, { value: bsRaw }));
|
|
168
169
|
}
|
|
169
|
-
const bsCount = Math.max(100, Math.floor(parsedBs) ||
|
|
170
|
+
const bsCount = Math.max(100, Math.floor(parsedBs) || DEFAULT_BOOTSTRAP_SAMPLES);
|
|
170
171
|
if (bsCount > 10000) {
|
|
171
172
|
process.stderr.write(tCli('cli.run.bootstrap_samples_too_large', lang, { n: bsCount }));
|
|
172
173
|
}
|
|
@@ -289,12 +290,24 @@ export default class Eval extends BaseCommand {
|
|
|
289
290
|
lang: LANG_FLAG,
|
|
290
291
|
// ── 实验角色 ──
|
|
291
292
|
control: Flags.string({
|
|
292
|
-
description: bilingual({ zh: 'control variant
|
|
293
|
+
description: bilingual({ zh: 'control variant 表达式(仅 artifact 身份)', en: 'Control variant expr (artifact identity only)' }),
|
|
293
294
|
}),
|
|
294
295
|
treatment: Flags.string({
|
|
295
296
|
description: bilingual({
|
|
296
|
-
zh: 'treatment variant
|
|
297
|
-
en: 'Treatment variants, comma-separated',
|
|
297
|
+
zh: 'treatment variant 列表,逗号分隔(仅 artifact 身份)',
|
|
298
|
+
en: 'Treatment variants, comma-separated (artifact identity only)',
|
|
299
|
+
}),
|
|
300
|
+
}),
|
|
301
|
+
'control-cwd': Flags.string({
|
|
302
|
+
description: bilingual({
|
|
303
|
+
zh: 'control 的 runtime context 目录',
|
|
304
|
+
en: 'Runtime context dir for control',
|
|
305
|
+
}),
|
|
306
|
+
}),
|
|
307
|
+
'treatment-cwd': Flags.string({
|
|
308
|
+
description: bilingual({
|
|
309
|
+
zh: 'treatment 的 runtime context 目录列表,逗号分隔、与 --treatment 按序对齐(空位 = 无 cwd)',
|
|
310
|
+
en: 'Runtime context dirs for treatments, comma-separated, index-aligned with --treatment (blank = none)',
|
|
298
311
|
}),
|
|
299
312
|
}),
|
|
300
313
|
config: Flags.string({
|
|
@@ -302,7 +315,7 @@ export default class Eval extends BaseCommand {
|
|
|
302
315
|
}),
|
|
303
316
|
samples: Flags.string({
|
|
304
317
|
description: bilingual({
|
|
305
|
-
zh: '
|
|
318
|
+
zh: '用例文件路径。默认 eval-samples.json,也接受 .yaml/.yml;自动发现 --skill-dir 下的 <skill>/.omk/samples.json。',
|
|
306
319
|
en: 'Samples file path. Defaults to eval-samples.json (also .yaml/.yml); auto-discovers <skill>/.omk/samples.json under --skill-dir.',
|
|
307
320
|
}),
|
|
308
321
|
}),
|
|
@@ -343,7 +356,7 @@ export default class Eval extends BaseCommand {
|
|
|
343
356
|
parse: integerStringParser('--concurrency', { min: 1 }),
|
|
344
357
|
}),
|
|
345
358
|
timeout: Flags.string({
|
|
346
|
-
description: bilingual({ zh: '
|
|
359
|
+
description: bilingual({ zh: '单用例超时秒,默认 600', en: 'Per-sample timeout sec, default 600' }),
|
|
347
360
|
parse: numberStringParser('--timeout', { min: 1 }),
|
|
348
361
|
}),
|
|
349
362
|
batch: Flags.boolean({
|
|
@@ -462,4 +475,3 @@ export default class Eval extends BaseCommand {
|
|
|
462
475
|
});
|
|
463
476
|
}
|
|
464
477
|
}
|
|
465
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -31,7 +31,13 @@ export default class Evolve extends BaseCommand {
|
|
|
31
31
|
'sample-fix-max-attempts': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
32
32
|
'reuse-latest-eval': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
33
33
|
'improve-mode': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
34
|
+
'holdout-ratio': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
35
|
+
'no-significance-gate': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
36
|
+
'significance-alpha': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
37
|
+
'test-ratio': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
38
|
+
'edit-budget': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
39
|
+
'no-edit-budget': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
40
|
+
'no-reject-memory': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
34
41
|
};
|
|
35
42
|
run(): Promise<void>;
|
|
36
43
|
}
|
|
37
|
-
//# sourceMappingURL=evolve.d.ts.map
|
|
@@ -26,6 +26,13 @@ export async function runEvolve(args, flags, lang) {
|
|
|
26
26
|
console.error(tCli('cli.evolve.specify_skill_path', lang));
|
|
27
27
|
throw new CliExit(1);
|
|
28
28
|
}
|
|
29
|
+
// A locked test set needs a separate val set to decide on; --test-ratio alone is a no-op.
|
|
30
|
+
if ((Number(flags['test-ratio']) || 0) > 0 && (Number(flags['holdout-ratio']) || 0) === 0) {
|
|
31
|
+
console.error(lang === 'zh'
|
|
32
|
+
? '--test-ratio 需要配合 --holdout-ratio 使用(test 集只在留出 val 集时才有意义)。'
|
|
33
|
+
: '--test-ratio requires --holdout-ratio (a locked test set only makes sense alongside a held-out val set).');
|
|
34
|
+
throw new CliExit(2);
|
|
35
|
+
}
|
|
29
36
|
const { resolveSkillInput } = await import('../lib/resolve-skill-input.js');
|
|
30
37
|
let resolvedInput;
|
|
31
38
|
try {
|
|
@@ -68,9 +75,17 @@ export async function runEvolve(args, flags, lang) {
|
|
|
68
75
|
autoFixSamples: flags['auto-fix-samples'],
|
|
69
76
|
sampleFixMaxAttempts: Math.max(1, Number(flags['sample-fix-max-attempts']) || 2),
|
|
70
77
|
reuseLatestEval: flags['reuse-latest-eval'],
|
|
78
|
+
holdoutRatio: Number(flags['holdout-ratio']) || 0,
|
|
79
|
+
significanceGate: !flags['no-significance-gate'],
|
|
80
|
+
// parser 已保证是合法数字串;用 Number() 直取,不用 `|| default`——否则
|
|
81
|
+
// `--edit-budget 0`(关预算)/ `--significance-alpha 0` 会被 falsy 吞成默认值。
|
|
82
|
+
significanceAlpha: Number(flags['significance-alpha']),
|
|
83
|
+
testRatio: Number(flags['test-ratio']),
|
|
84
|
+
editBudget: flags['no-edit-budget'] ? 0 : Number(flags['edit-budget']),
|
|
85
|
+
rejectMemory: !flags['no-reject-memory'],
|
|
71
86
|
improveMode: flags['improve-mode'] === 'rewrite' ? 'rewrite' : 'agent',
|
|
72
87
|
onProgress: makeOnProgress(lang),
|
|
73
|
-
onRoundProgress({ round, totalRounds: _totalRounds, phase, score, delta, accepted, costUSD, costReported, error }) {
|
|
88
|
+
onRoundProgress({ round, totalRounds: _totalRounds, phase, score, delta, accepted, costUSD, costReported, error, significant }) {
|
|
74
89
|
// costReported=false 时显示「—」而不是 $0.0000(executor 不报 cost,如 codex)。
|
|
75
90
|
const fmtRoundCost = (c, r) => r ? `$${c.toFixed(4)}` : '—';
|
|
76
91
|
if (phase === 'baseline') {
|
|
@@ -85,7 +100,9 @@ export async function runEvolve(args, flags, lang) {
|
|
|
85
100
|
}
|
|
86
101
|
else if (phase === 'done') {
|
|
87
102
|
const delta_ = delta >= 0 ? `+${delta.toFixed(2)}` : delta.toFixed(2);
|
|
88
|
-
|
|
103
|
+
// 门拒掉「均分上升但不显著」的候选时,补一句原因,否则 (+0.0x) ✗ REJECT 看着矛盾。
|
|
104
|
+
const rejectNote = !accepted && significant === false ? tCli('cli.evolve.reject_not_significant', lang) : '';
|
|
105
|
+
const status = accepted ? '✓ ACCEPT' : `✗ REJECT${rejectNote}`;
|
|
89
106
|
process.stderr.write(tCli('cli.evolve.round_done', lang, {
|
|
90
107
|
round, score: score.toFixed(2), delta: delta_, status, cost: fmtRoundCost(costUSD, costReported !== false),
|
|
91
108
|
}));
|
|
@@ -102,6 +119,24 @@ export async function runEvolve(args, flags, lang) {
|
|
|
102
119
|
start: result.startScore.toFixed(2), final: result.finalScore.toFixed(2),
|
|
103
120
|
percent: improvement, rounds: result.totalRounds, cost: totalCostStr,
|
|
104
121
|
}));
|
|
122
|
+
if (result.holdout) {
|
|
123
|
+
process.stderr.write(result.holdout.disabled
|
|
124
|
+
? tCli('cli.evolve.holdout_disabled', lang, { ratio: result.holdout.ratio })
|
|
125
|
+
: tCli('cli.evolve.holdout_active', lang, {
|
|
126
|
+
train: result.holdout.trainCount, holdout: result.holdout.holdoutCount,
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
if (result.gate?.underpowered) {
|
|
130
|
+
process.stderr.write(tCli('cli.evolve.gate_underpowered', lang));
|
|
131
|
+
}
|
|
132
|
+
if (result.test?.disabled) {
|
|
133
|
+
process.stderr.write(tCli('cli.evolve.test_disabled', lang, { ratio: result.test.ratio }));
|
|
134
|
+
}
|
|
135
|
+
else if (result.test && typeof result.generalizationScore === 'number') {
|
|
136
|
+
process.stderr.write(tCli('cli.evolve.generalization', lang, {
|
|
137
|
+
count: result.test.count, score: result.generalizationScore.toFixed(2),
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
105
140
|
process.stderr.write(tCli('cli.evolve.best_path', lang, {
|
|
106
141
|
best: result.bestSkillPath, target: resolve(skillPath),
|
|
107
142
|
}));
|
|
@@ -166,7 +201,7 @@ export default class Evolve extends BaseCommand {
|
|
|
166
201
|
}),
|
|
167
202
|
samples: Flags.string({
|
|
168
203
|
description: bilingual({
|
|
169
|
-
zh: '
|
|
204
|
+
zh: '用例文件路径,默认 eval-samples.json',
|
|
170
205
|
en: 'Samples file, default eval-samples.json',
|
|
171
206
|
}),
|
|
172
207
|
default: 'eval-samples.json',
|
|
@@ -198,7 +233,7 @@ export default class Evolve extends BaseCommand {
|
|
|
198
233
|
parse: integerStringParser('--concurrency', { min: 1 }),
|
|
199
234
|
}),
|
|
200
235
|
timeout: Flags.string({
|
|
201
|
-
description: bilingual({ zh: '
|
|
236
|
+
description: bilingual({ zh: '单用例超时秒,默认 600', en: 'Per-sample timeout sec, default 600' }),
|
|
202
237
|
default: '600',
|
|
203
238
|
parse: numberStringParser('--timeout', { min: 1 }),
|
|
204
239
|
}),
|
|
@@ -236,7 +271,7 @@ export default class Evolve extends BaseCommand {
|
|
|
236
271
|
}),
|
|
237
272
|
'stop-on-assertions-pass': Flags.boolean({
|
|
238
273
|
description: bilingual({
|
|
239
|
-
zh: '
|
|
274
|
+
zh: '普通用例断言全过时提前停止',
|
|
240
275
|
en: 'Stop early when normal samples pass assertions',
|
|
241
276
|
}),
|
|
242
277
|
default: false,
|
|
@@ -271,6 +306,59 @@ export default class Evolve extends BaseCommand {
|
|
|
271
306
|
default: 'agent',
|
|
272
307
|
options: ['agent', 'rewrite'],
|
|
273
308
|
}),
|
|
309
|
+
'holdout-ratio': Flags.string({
|
|
310
|
+
description: bilingual({
|
|
311
|
+
zh: '留出验收集比例(0..1,默认 0=关)。> 0 时按 holdout 分接受候选、weak-sample 只取训练集,防 train-on-test',
|
|
312
|
+
en: 'Holdout fraction for the accept decision (0..1, default 0=off). When > 0, candidates are accepted on holdout score and weak samples come only from train — guards against train-on-test',
|
|
313
|
+
}),
|
|
314
|
+
default: '0',
|
|
315
|
+
parse: numberStringParser('--holdout-ratio', { min: 0, max: 1 }),
|
|
316
|
+
}),
|
|
317
|
+
'no-significance-gate': Flags.boolean({
|
|
318
|
+
description: bilingual({
|
|
319
|
+
zh: '关掉显著性接受门,退回「候选分高一点点就收」的点估计判定(默认门开:只收统计显著的提升)',
|
|
320
|
+
en: 'Disable the significance accept gate, reverting to point-estimate accept (default: gate on — accept only statistically significant gains)',
|
|
321
|
+
}),
|
|
322
|
+
default: false,
|
|
323
|
+
}),
|
|
324
|
+
'significance-alpha': Flags.string({
|
|
325
|
+
description: bilingual({
|
|
326
|
+
zh: '显著性门的 diff CI 显著性水平(默认 0.05 = 95% CI)',
|
|
327
|
+
en: 'Significance level for the accept gate diff CI (default 0.05 = 95% CI)',
|
|
328
|
+
}),
|
|
329
|
+
default: '0.05',
|
|
330
|
+
parse: numberStringParser('--significance-alpha', { min: 0, max: 1 }),
|
|
331
|
+
}),
|
|
332
|
+
'test-ratio': Flags.string({
|
|
333
|
+
description: bilingual({
|
|
334
|
+
zh: '锁定 test 集比例(0..1,默认 0=关),需配 --holdout-ratio。全程不参与选择,收尾读一次给无偏泛化分',
|
|
335
|
+
en: 'Locked test fraction (0..1, default 0=off); requires --holdout-ratio. Never used for selection; read once at the end for an unbiased generalization score',
|
|
336
|
+
}),
|
|
337
|
+
default: '0',
|
|
338
|
+
parse: numberStringParser('--test-ratio', { min: 0, max: 1 }),
|
|
339
|
+
}),
|
|
340
|
+
'edit-budget': Flags.string({
|
|
341
|
+
description: bilingual({
|
|
342
|
+
zh: '单轮最多改动的 skill 行占比(默认 0.2)。超预算的候选评测前直接判拒,省 eval 成本',
|
|
343
|
+
en: 'Max fraction of skill lines a round may change (default 0.2). Over-budget candidates are rejected before evaluation, saving eval cost',
|
|
344
|
+
}),
|
|
345
|
+
default: '0.2',
|
|
346
|
+
parse: numberStringParser('--edit-budget', { min: 0, max: 1 }),
|
|
347
|
+
}),
|
|
348
|
+
'no-edit-budget': Flags.boolean({
|
|
349
|
+
description: bilingual({
|
|
350
|
+
zh: '关掉 edit budget 约束(允许任意大小的单轮改动)',
|
|
351
|
+
en: 'Disable the edit budget (allow arbitrarily large single-round edits)',
|
|
352
|
+
}),
|
|
353
|
+
default: false,
|
|
354
|
+
}),
|
|
355
|
+
'no-reject-memory': Flags.boolean({
|
|
356
|
+
description: bilingual({
|
|
357
|
+
zh: '关掉 rejected-edit 记忆(不把被拒改法回灌下一轮 prompt)',
|
|
358
|
+
en: 'Disable rejected-edit memory (do not feed rejected edits back into the next prompt)',
|
|
359
|
+
}),
|
|
360
|
+
default: false,
|
|
361
|
+
}),
|
|
274
362
|
};
|
|
275
363
|
async run() {
|
|
276
364
|
const { args, flags } = await this.parse(Evolve);
|
|
@@ -280,4 +368,3 @@ export default class Evolve extends BaseCommand {
|
|
|
280
368
|
});
|
|
281
369
|
}
|
|
282
370
|
}
|
|
283
|
-
//# sourceMappingURL=evolve.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseCommand } from '../oclif/base-command.js';
|
|
2
|
+
export default class Install extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: {
|
|
5
|
+
description: string;
|
|
6
|
+
command: string;
|
|
7
|
+
}[];
|
|
8
|
+
static args: {
|
|
9
|
+
input: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
10
|
+
};
|
|
11
|
+
static flags: {
|
|
12
|
+
lang: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
kind: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
to: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
dest: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<void>;
|
|
20
|
+
private installBuiltinAgentSkill;
|
|
21
|
+
private installManagedSkill;
|
|
22
|
+
}
|