oh-my-knowledge 0.22.0 → 0.24.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 +63 -63
- package/README.zh.md +64 -62
- package/dist/src/analysis/report-diagnostics.d.ts +28 -3
- package/dist/src/analysis/report-diagnostics.d.ts.map +1 -1
- package/dist/src/analysis/report-diagnostics.js +201 -81
- package/dist/src/analysis/report-diagnostics.js.map +1 -1
- package/dist/src/analysis/sample-diagnostics.d.ts +9 -2
- package/dist/src/analysis/sample-diagnostics.d.ts.map +1 -1
- package/dist/src/analysis/sample-diagnostics.js +224 -25
- package/dist/src/analysis/sample-diagnostics.js.map +1 -1
- package/dist/src/authoring/evolver.d.ts +7 -2
- package/dist/src/authoring/evolver.d.ts.map +1 -1
- package/dist/src/authoring/evolver.js +43 -9
- package/dist/src/authoring/evolver.js.map +1 -1
- package/dist/src/authoring/generator.d.ts +24 -0
- package/dist/src/authoring/generator.d.ts.map +1 -1
- package/dist/src/authoring/generator.js +67 -5
- package/dist/src/authoring/generator.js.map +1 -1
- package/dist/src/cli/coverage-renderer.d.ts +15 -0
- package/dist/src/cli/coverage-renderer.d.ts.map +1 -0
- package/dist/src/cli/coverage-renderer.js +74 -0
- package/dist/src/cli/coverage-renderer.js.map +1 -0
- package/dist/src/cli/i18n-dict.d.ts +1 -1
- package/dist/src/cli/i18n-dict.d.ts.map +1 -1
- package/dist/src/cli/i18n-dict.js +62 -40
- package/dist/src/cli/i18n-dict.js.map +1 -1
- package/dist/src/cli/index.d.ts +3 -0
- package/dist/src/cli/index.d.ts.map +1 -0
- package/dist/src/{cli.js → cli/index.js} +123 -384
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/parse-run-config.d.ts +56 -0
- package/dist/src/cli/parse-run-config.d.ts.map +1 -0
- package/dist/src/cli/parse-run-config.js +195 -0
- package/dist/src/cli/parse-run-config.js.map +1 -0
- package/dist/src/cli/progress.d.ts +25 -0
- package/dist/src/cli/progress.d.ts.map +1 -0
- package/dist/src/cli/progress.js +62 -0
- package/dist/src/cli/progress.js.map +1 -0
- package/dist/src/cli/update-check.d.ts +3 -0
- package/dist/src/cli/update-check.d.ts.map +1 -0
- package/dist/src/cli/update-check.js +37 -0
- package/dist/src/cli/update-check.js.map +1 -0
- package/dist/src/eval-core/cache.d.ts +7 -5
- package/dist/src/eval-core/cache.d.ts.map +1 -1
- package/dist/src/eval-core/cache.js +11 -7
- package/dist/src/eval-core/cache.js.map +1 -1
- package/dist/src/eval-core/comparability.d.ts +11 -0
- package/dist/src/eval-core/comparability.d.ts.map +1 -0
- package/dist/src/eval-core/comparability.js +271 -0
- package/dist/src/eval-core/comparability.js.map +1 -0
- package/dist/src/eval-core/dependency-checker.d.ts +1 -1
- package/dist/src/eval-core/dependency-checker.js +1 -1
- package/dist/src/eval-core/evaluation-execution.d.ts +5 -2
- package/dist/src/eval-core/evaluation-execution.d.ts.map +1 -1
- package/dist/src/eval-core/evaluation-execution.js +29 -21
- package/dist/src/eval-core/evaluation-execution.js.map +1 -1
- package/dist/src/eval-core/evaluation-job.d.ts +2 -2
- package/dist/src/eval-core/evaluation-job.d.ts.map +1 -1
- package/dist/src/eval-core/evaluation-job.js +2 -2
- package/dist/src/eval-core/evaluation-job.js.map +1 -1
- package/dist/src/eval-core/evaluation-reporting.d.ts +3 -1
- package/dist/src/eval-core/evaluation-reporting.d.ts.map +1 -1
- package/dist/src/eval-core/evaluation-reporting.js +65 -5
- package/dist/src/eval-core/evaluation-reporting.js.map +1 -1
- package/dist/src/eval-core/execution-strategy.js +6 -6
- package/dist/src/eval-core/execution-strategy.js.map +1 -1
- package/dist/src/eval-core/schema.d.ts.map +1 -1
- package/dist/src/eval-core/schema.js +14 -1
- package/dist/src/eval-core/schema.js.map +1 -1
- package/dist/src/eval-core/verdict.d.ts +3 -3
- package/dist/src/eval-core/verdict.js +3 -3
- package/dist/src/eval-workflows/batch-evaluation-workflow.d.ts +111 -0
- package/dist/src/eval-workflows/batch-evaluation-workflow.d.ts.map +1 -0
- package/dist/src/eval-workflows/batch-evaluation-workflow.js +215 -0
- package/dist/src/eval-workflows/batch-evaluation-workflow.js.map +1 -0
- package/dist/src/eval-workflows/evaluation-pipeline.d.ts +7 -5
- package/dist/src/eval-workflows/evaluation-pipeline.d.ts.map +1 -1
- package/dist/src/eval-workflows/evaluation-pipeline.js +13 -8
- package/dist/src/eval-workflows/evaluation-pipeline.js.map +1 -1
- package/dist/src/eval-workflows/evaluation-preparation.d.ts +10 -8
- package/dist/src/eval-workflows/evaluation-preparation.d.ts.map +1 -1
- package/dist/src/eval-workflows/evaluation-preparation.js +8 -4
- package/dist/src/eval-workflows/evaluation-preparation.js.map +1 -1
- package/dist/src/eval-workflows/run-evaluation.d.ts +23 -20
- package/dist/src/eval-workflows/run-evaluation.d.ts.map +1 -1
- package/dist/src/eval-workflows/run-evaluation.js +34 -25
- package/dist/src/eval-workflows/run-evaluation.js.map +1 -1
- package/dist/src/executors/claude-cli.d.ts.map +1 -1
- package/dist/src/executors/claude-cli.js +12 -7
- package/dist/src/executors/claude-cli.js.map +1 -1
- package/dist/src/executors/claude-sdk.d.ts +1 -1
- package/dist/src/executors/claude-sdk.js +1 -1
- package/dist/src/executors/codex-cli-trace.d.ts +10 -0
- package/dist/src/executors/codex-cli-trace.d.ts.map +1 -0
- package/dist/src/executors/codex-cli-trace.js +123 -0
- package/dist/src/executors/codex-cli-trace.js.map +1 -0
- package/dist/src/executors/codex-cli.d.ts +18 -0
- package/dist/src/executors/codex-cli.d.ts.map +1 -0
- package/dist/src/executors/codex-cli.js +254 -0
- package/dist/src/executors/codex-cli.js.map +1 -0
- package/dist/src/executors/codex-sdk.d.ts +18 -0
- package/dist/src/executors/codex-sdk.d.ts.map +1 -0
- package/dist/src/executors/codex-sdk.js +214 -0
- package/dist/src/executors/codex-sdk.js.map +1 -0
- package/dist/src/executors/gemini.d.ts.map +1 -1
- package/dist/src/executors/gemini.js +28 -24
- package/dist/src/executors/gemini.js.map +1 -1
- package/dist/src/executors/index.d.ts.map +1 -1
- package/dist/src/executors/index.js +7 -2
- package/dist/src/executors/index.js.map +1 -1
- package/dist/src/executors/runtime-fingerprint.d.ts +7 -0
- package/dist/src/executors/runtime-fingerprint.d.ts.map +1 -0
- package/dist/src/executors/runtime-fingerprint.js +277 -0
- package/dist/src/executors/runtime-fingerprint.js.map +1 -0
- package/dist/src/executors/script.d.ts.map +1 -1
- package/dist/src/executors/script.js +48 -56
- package/dist/src/executors/script.js.map +1 -1
- package/dist/src/executors/shared.d.ts +78 -1
- package/dist/src/executors/shared.d.ts.map +1 -1
- package/dist/src/executors/shared.js +203 -1
- package/dist/src/executors/shared.js.map +1 -1
- package/dist/src/grading/assertions.d.ts.map +1 -1
- package/dist/src/grading/assertions.js +21 -6
- package/dist/src/grading/assertions.js.map +1 -1
- package/dist/src/grading/gold-dataset.d.ts +1 -1
- package/dist/src/grading/gold-dataset.js +1 -1
- package/dist/src/grading/index.d.ts.map +1 -1
- package/dist/src/grading/index.js +11 -0
- package/dist/src/grading/index.js.map +1 -1
- package/dist/src/grading/judge.d.ts.map +1 -1
- package/dist/src/grading/judge.js +75 -6
- package/dist/src/grading/judge.js.map +1 -1
- package/dist/src/inputs/eval-config.js +2 -2
- package/dist/src/inputs/eval-config.js.map +1 -1
- package/dist/src/inputs/load-samples.d.ts.map +1 -1
- package/dist/src/inputs/load-samples.js +30 -4
- package/dist/src/inputs/load-samples.js.map +1 -1
- package/dist/src/inputs/skill-loader.d.ts +2 -2
- package/dist/src/inputs/skill-loader.d.ts.map +1 -1
- package/dist/src/inputs/skill-loader.js +2 -2
- package/dist/src/inputs/skill-loader.js.map +1 -1
- package/dist/src/renderer/html-renderer.d.ts +5 -4
- package/dist/src/renderer/html-renderer.d.ts.map +1 -1
- package/dist/src/renderer/html-renderer.js +217 -93
- package/dist/src/renderer/html-renderer.js.map +1 -1
- package/dist/src/renderer/layout.d.ts +2 -1
- package/dist/src/renderer/layout.d.ts.map +1 -1
- package/dist/src/renderer/layout.js +30 -42
- package/dist/src/renderer/layout.js.map +1 -1
- package/dist/src/renderer/summary.d.ts +3 -3
- package/dist/src/renderer/summary.d.ts.map +1 -1
- package/dist/src/renderer/summary.js +232 -55
- package/dist/src/renderer/summary.js.map +1 -1
- package/dist/src/renderer/trends.d.ts.map +1 -1
- package/dist/src/renderer/trends.js +5 -3
- package/dist/src/renderer/trends.js.map +1 -1
- package/dist/src/server/report-server.js +4 -4
- package/dist/src/server/report-server.js.map +1 -1
- package/dist/src/server/report-store.d.ts +7 -5
- package/dist/src/server/report-store.d.ts.map +1 -1
- package/dist/src/server/report-store.js +39 -11
- package/dist/src/server/report-store.js.map +1 -1
- package/dist/src/types/eval.d.ts +27 -5
- package/dist/src/types/eval.d.ts.map +1 -1
- package/dist/src/types/executor.d.ts +5 -0
- package/dist/src/types/executor.d.ts.map +1 -1
- package/dist/src/types/judge.d.ts +10 -0
- package/dist/src/types/judge.d.ts.map +1 -1
- package/dist/src/types/report.d.ts +151 -29
- package/dist/src/types/report.d.ts.map +1 -1
- package/dist/src/types/storage.d.ts +7 -7
- package/dist/src/types/storage.d.ts.map +1 -1
- package/package.json +14 -5
- package/dist/src/cli.d.ts +0 -3
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js.map +0 -1
- package/dist/src/eval-workflows/each-evaluation-workflow.d.ts +0 -153
- package/dist/src/eval-workflows/each-evaluation-workflow.d.ts.map +0 -1
- package/dist/src/eval-workflows/each-evaluation-workflow.js +0 -178
- package/dist/src/eval-workflows/each-evaluation-workflow.js.map +0 -1
- package/dist/src/executors/openai-cli.d.ts +0 -3
- package/dist/src/executors/openai-cli.d.ts.map +0 -1
- package/dist/src/executors/openai-cli.js +0 -60
- package/dist/src/executors/openai-cli.js.map +0 -1
package/README.md
CHANGED
|
@@ -7,49 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
**English** | [简体中文](./README.zh.md)
|
|
9
9
|
|
|
10
|
-
**omk** —
|
|
10
|
+
**omk** — The knowledge you give your LLM — what's it actually worth?
|
|
11
|
+
omk answers with objective data, not gut feeling.
|
|
11
12
|
|
|
12
|
-
**Fix the model, vary the knowledge artifact
|
|
13
|
+
**Fix the model, vary the knowledge artifact.**
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Teams doing knowledge engineering produce lots of knowledge artifacts (skills today, but also prompts, agents, workflows…). When someone asks "why is v2 better than v1", you need objective data instead of gut feeling. `oh-my-knowledge` solves this with controlled experiments: **same model, same test samples, only the knowledge artifact changes.**
|
|
17
|
-
|
|
18
|
-
## Key features
|
|
19
|
-
|
|
20
|
-
- **Controlled-variable offline bench** — fix the model and samples, vary only the artifact; works with Claude Code skills, CLAUDE.md prompts, RAG knowledge bases, or any markdown-based instruction
|
|
21
|
-
- **Six-dimension scoring** — separate signals for Fact / Behavior / LLM-judge / Cost / Efficiency / Stability, so a regression in one axis isn't hidden by gains in another
|
|
22
|
-
- **Production session observability** — parse Claude Code session JSONL traces, measure per-skill failure rate, latency, token cost, and knowledge-gap signals on real user sessions
|
|
23
|
-
- **Knowledge-gap detection** — severity-weighted signals (explicit markers / failed searches / hedging language / repeated failures) quantify risk exposure instead of claiming completeness
|
|
24
|
-
- **Pre-merge CI gate** — `omk bench gate` enforces three-layer all-pass (fact + behavior + llm-judge) semantics, catching single-layer regressions a composite score would hide
|
|
25
|
-
- **One-line ship/no-ship verdict** — `omk bench verdict <reportId>` aggregates bootstrap CI / three-layer ci-gate / saturation / human α into a six-tier verdict (PROGRESS / CAUTIOUS / REGRESS / NOISE / UNDERPOWERED / SOLO) plus an action recommendation; the exit code reflects whether to ship
|
|
26
|
-
|
|
27
|
-
### Statistical rigor
|
|
15
|
+
<a id="statistical-rigor"></a>
|
|
16
|
+
> Built-in: Bootstrap CI · Krippendorff α (judge ↔ human) · length-debias · saturation curves · construct-validity isolation. [Why these matter →](docs/statistical-rigor.md)
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- **Bootstrap CI** (`--bootstrap`) — distribution-free confidence intervals. The t-test breaks on ordinal LLM scores; bootstrap resamples raw observations and stays valid at small N (< 30) and on skewed data. Pairwise diff CI not crossing 0 = significant.
|
|
32
|
-
- **Human Gold + Krippendorff α** (`--gold-dir`) — bring an external annotation as anchor. CI tells you "is the judge stable", α tells you "is the judge correct" — two complementary axes. omk warns when the gold annotator and the judge are the same model (would inflate α).
|
|
33
|
-
- **Length-controlled judge prompt** (default ON) — research shows LLM judges over-weight verbosity. omk's judge prompt explicitly states "length is not a quality signal"; template hash is `v3-cot-length` so older reports (with the legacy hash) are visibly different. `omk bench debias-validate length <reportId>` re-judges with the opposite setting and reports the score shift.
|
|
34
|
-
- **Saturation curve** — answers "have I run enough samples?". With `--repeat ≥ 5` we accumulate cumulative N → bootstrap CI; when CI shrink rate stays under 5% across 3 windows, more samples buy nothing. The HTML report inlines the SVG curve plus a verdict.
|
|
35
|
-
|
|
36
|
-
## Why omk over alternatives
|
|
37
|
-
|
|
38
|
-
| | omk | promptfoo | DeepEval | RAGAS | LangSmith |
|
|
39
|
-
|--|--|--|--|--|--|
|
|
40
|
-
| Bootstrap CI | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
41
|
-
| Krippendorff α (judge ↔ human) | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
42
|
-
| Length-debias judge prompt | ✓ default | ✗ | ✗ | ✗ | ✗ |
|
|
43
|
-
| Saturation curve | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
44
|
-
| Three-layer scoring isolation | ✓ | ✗ | partial | ✗ | ✗ |
|
|
45
|
-
| Per-variant skill isolation (construct validity) | ✓ default | ✗ | ✗ | ✗ | ✗ |
|
|
46
|
-
| Native Claude Code skill | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
47
|
-
| Full Chinese docs | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
48
|
-
| Hosted SaaS dashboard | ✗ | ✗ | ✓ | ✗ | ✓ |
|
|
49
|
-
|
|
50
|
-
omk's moat is **statistical rigor** — every conclusion is auditable by a researcher. If you need a hosted SaaS dashboard, choose LangSmith. If you want quick local prompt iteration without statistics, choose promptfoo. **If you ship to production and someone will ask "why should I trust this number?", choose omk**.
|
|
51
|
-
|
|
52
|
-
Full comparison with 7 tools across 25+ dimensions: [docs/comparison.md](docs/comparison.md)
|
|
18
|
+

|
|
53
19
|
|
|
54
20
|
## Quick start
|
|
55
21
|
|
|
@@ -70,7 +36,7 @@ cd my-eval
|
|
|
70
36
|
omk bench run --dry-run
|
|
71
37
|
|
|
72
38
|
# run the evaluation (auto-discovers everything under skills/)
|
|
73
|
-
omk bench run
|
|
39
|
+
omk bench run # → HTML report with verdict in 5 minutes
|
|
74
40
|
|
|
75
41
|
# CLI output language: zh (default) / en — flag wins over env
|
|
76
42
|
omk bench run --lang en
|
|
@@ -89,26 +55,57 @@ After installing omk, talk to it in natural language from Claude Code:
|
|
|
89
55
|
|
|
90
56
|
You can also just say "compare v1 vs v2 for me" or "improve this artifact" — omk picks the right command.
|
|
91
57
|
|
|
58
|
+
## Why this tool
|
|
59
|
+
|
|
60
|
+
Teams doing knowledge engineering produce lots of knowledge artifacts (skills today, but also prompts, agents, workflows…). When someone asks "why is v2 better than v1", you need objective data instead of gut feeling. `oh-my-knowledge` solves this with controlled experiments: **same model, same test samples, only the knowledge artifact changes.**
|
|
61
|
+
|
|
62
|
+
## Key features
|
|
63
|
+
|
|
64
|
+
- **Controlled-variable offline bench** — fix the model and samples, vary only the artifact; works with Claude Code skills, CLAUDE.md prompts, RAG knowledge bases, or any markdown-based instruction
|
|
65
|
+
- **Six-dimension scoring** — separate signals for Fact / Behavior / LLM-judge / Cost / Efficiency / Stability, so a regression in one axis isn't hidden by gains in another
|
|
66
|
+
- **Production session observability** — parse Claude Code session JSONL traces, measure per-skill failure rate, latency, token cost, and knowledge-gap signals on real user sessions
|
|
67
|
+
- **Knowledge-gap detection** — severity-weighted signals (explicit markers / failed searches / hedging language / repeated failures) quantify risk exposure instead of claiming completeness
|
|
68
|
+
- **Pre-merge CI gate** — `omk bench gate` enforces three-layer all-pass (fact + behavior + llm-judge) semantics, catching single-layer regressions a composite score would hide
|
|
69
|
+
- **One-line ship/no-ship verdict** — `omk bench verdict <reportId>` aggregates bootstrap CI / three-layer ci-gate / saturation / human α into a six-tier verdict (PROGRESS / CAUTIOUS / REGRESS / NOISE / UNDERPOWERED / SOLO) plus an action recommendation; the exit code reflects whether to ship
|
|
70
|
+
|
|
71
|
+
## Why omk over alternatives
|
|
72
|
+
|
|
73
|
+
| | omk | promptfoo | DeepEval | LangSmith |
|
|
74
|
+
|--|--|--|--|--|
|
|
75
|
+
| Bootstrap CI | ✓ default | ✗ | ✗ | ✗ |
|
|
76
|
+
| Krippendorff α (judge ↔ human) | ✓ default | ✗ | ✗ | ✗ |
|
|
77
|
+
| Length-debias judge prompt | ✓ default | ✗ | ✗ | ✗ |
|
|
78
|
+
| Saturation curve | ✓ | ✗ | ✗ | ✗ |
|
|
79
|
+
| Three-layer scoring isolation | ✓ | ✗ | partial | ✗ |
|
|
80
|
+
| Per-variant skill isolation (construct validity) | ✓ default | ✗ | ✗ | ✗ |
|
|
81
|
+
| Native Claude Code skill | ✓ | ✗ | ✗ | ✗ |
|
|
82
|
+
| Hosted SaaS dashboard | ✗ | ✗ | ✓ | ✓ |
|
|
83
|
+
|
|
84
|
+
omk's moat is **default-on safety net** — Bootstrap CI, judge ↔ human α, and length-debias aren't advanced flags; they're the default. Other tools let you opt into confidence intervals; omk makes them unavoidable. Need a hosted SaaS dashboard? Choose LangSmith. Want quick local prompt iteration without statistics? Choose promptfoo. **Shipping to production and someone will ask "why should I trust this number?" Choose omk.**
|
|
85
|
+
|
|
86
|
+
RAG-specific evals: see RAGAS (separate niche, complementary to omk). Full comparison with 7 tools across 25+ dimensions: [docs/comparison.md](docs/comparison.md).
|
|
87
|
+
|
|
92
88
|
## Features
|
|
93
89
|
|
|
94
90
|
| Feature | What it does |
|
|
95
91
|
|---|---|
|
|
96
|
-
| **21+ assertion types** | substring, regex, JSON Schema, ROUGE/BLEU/Levenshtein similarity, agent tool-call assertions, semantic similarity, custom JS, and more |
|
|
97
|
-
| **Assertion negation + composition** | universal `not: true` field + `assert-set` (any/all) with arbitrary nesting |
|
|
98
|
-
| **Six-dim evaluation** | Fact / Behavior / LLM-judge / Cost / Efficiency / Stability shown independently |
|
|
99
|
-
| **Statistical rigor** | Bootstrap CI / Krippendorff α / length-debias / saturation curve |
|
|
100
|
-
| **Construct-validity isolation** | `--strict-baseline` (default ON) cuts three contamination channels so baseline doesn't silently see the skill it's being compared against: (1) SDK skill auto-discovery, (2) subagent Skill tool, (3) cwd file-system access via the `skills/<name>/` symlink that's normally there for the treatment variant. eval.yaml `allowedSkills` for per-variant whitelists |
|
|
101
92
|
| **One-line verdict** | `omk bench verdict <id>` six-tier verdict + ship recommendation + exit-code routing; HTML pill shares the same rules |
|
|
102
|
-
| **
|
|
93
|
+
| **Six-dim evaluation** | Fact / Behavior / LLM-judge / Cost / Efficiency / Stability shown independently |
|
|
94
|
+
| **Multi-executor** | Claude CLI / Claude SDK / Codex CLI / Codex SDK / OpenAI / Gemini / any custom command |
|
|
95
|
+
| **21+ assertion types** | substring, regex, JSON Schema, ROUGE/BLEU/Levenshtein similarity, agent tool-call assertions, semantic similarity, custom JS, and more |
|
|
96
|
+
| **Statistical rigor** | Bootstrap CI / Krippendorff α / length-debias / saturation curve — all on by default. [Details →](docs/statistical-rigor.md) |
|
|
103
97
|
| **Sample diagnostics** | `omk bench diagnose <id>` — 7 issue kinds (low discrimination / duplicates / ambiguous rubric / cost outliers / etc.) + 0-100 healthScore |
|
|
104
98
|
| **Failure clustering** | `omk bench failures <id>` — single LLM call clusters failed samples and emits per-cluster fixes |
|
|
99
|
+
| **RAG metrics** | `faithfulness` / `answer_relevancy` / `context_recall` — anti-hallucination + answer relevance + context coverage; auto-inherits length-debias |
|
|
105
100
|
| **Hard budget caps** | `--budget-usd / --budget-per-sample-usd / --budget-per-sample-ms` — abort on total-cost overrun, flag per-sample overruns; partial report persisted |
|
|
106
|
-
| **
|
|
101
|
+
| **Construct-validity isolation** | `--strict-baseline` (default ON) cuts three contamination channels so baseline doesn't silently see the skill it's being compared against: (1) SDK skill auto-discovery, (2) subagent Skill tool, (3) cwd file-system access via the `skills/<name>/` symlink that's normally there for the treatment variant. eval.yaml `allowedSkills` for per-variant whitelists |
|
|
102
|
+
| **Sample design science** | Sample schema with `capability` / `difficulty` / `construct` / `provenance` metadata fields (HF Dataset Cards style). `bench diagnose` shows coverage breakdown + flags `rubric_clarity_low` (short rubric without grading keywords) / `capability_thin` (capability supported by ≤ N×0.2 samples). `bench gen-samples` auto-stamps provenance. See [docs/sample-design-spec.md](docs/sample-design-spec.md) for the 8 industry-gap mapping |
|
|
107
103
|
| **Multi-judge ensemble** | `--judge-models claude:opus,openai:gpt-4o` cross-vendor scoring + agreement metrics |
|
|
108
104
|
| **MCP URL fetching** | pull content from private-doc URLs via an MCP server (SSO-protected knowledge bases, etc.) |
|
|
109
105
|
| **Blind A/B** | `--blind` hides variant names; HTML report has a reveal button |
|
|
110
|
-
| **Parallel execution** | `--concurrency N` runs N tasks at once |
|
|
111
106
|
| **Multi-run variance** | `--repeat N` repeats the eval and computes mean / SD / CI / t-test |
|
|
107
|
+
| **Parallel execution** | `--concurrency N` runs N tasks at once |
|
|
108
|
+
| **Assertion negation + composition** | universal `not: true` field + `assert-set` (any/all) with arbitrary nesting |
|
|
112
109
|
| **Auto analysis** | detects low-discrimination assertions, flat scores, all-pass / all-fail, expensive samples |
|
|
113
110
|
| **Traceability** | reports carry CLI version, Node version, artifact version fingerprint, judge prompt hash |
|
|
114
111
|
| **EN / ZH switch** | one-click language toggle in the HTML report |
|
|
@@ -134,8 +131,8 @@ flowchart TD
|
|
|
134
131
|
end
|
|
135
132
|
|
|
136
133
|
subgraph Exec["④ Executor (fixed model)"]
|
|
137
|
-
E["claude / claude-sdk / openai / gemini<br/>anthropic-api / openai-api / custom"]
|
|
138
|
-
T["claude-sdk
|
|
134
|
+
E["claude / claude-sdk / codex / openai / gemini<br/>anthropic-api / openai-api / custom"]
|
|
135
|
+
T["claude-sdk / codex extract<br/>turns / toolCalls trace"]
|
|
139
136
|
E -.-> T
|
|
140
137
|
end
|
|
141
138
|
|
|
@@ -372,13 +369,13 @@ options:
|
|
|
372
369
|
--control <expr> control-group variant expression (experiment role = control)
|
|
373
370
|
--treatment <v1,v2> treatment-group variant expressions, comma-separated
|
|
374
371
|
at least one of --control / --treatment is required
|
|
375
|
-
(unless you use --config or --
|
|
372
|
+
(unless you use --config or --batch)
|
|
376
373
|
special values: baseline (empty artifact), git:name (git HEAD),
|
|
377
374
|
git:ref:name (specific commit), path with "/" (read file directly)
|
|
378
375
|
--config <path> YAML/JSON config file (evaluation-as-code); declares
|
|
379
376
|
samples + variants + model + executor in one file; CLI
|
|
380
377
|
flags override config fields when both are provided
|
|
381
|
-
--model <name>
|
|
378
|
+
--model <name> task execution model (default: sonnet)
|
|
382
379
|
--judge-model <name> judge model (default: haiku)
|
|
383
380
|
--output-dir <path> output dir (default: ~/.oh-my-knowledge/reports/)
|
|
384
381
|
--no-judge skip the LLM judge
|
|
@@ -394,7 +391,7 @@ options:
|
|
|
394
391
|
(default: .mcp.json in cwd)
|
|
395
392
|
--no-serve don't auto-start the report server after the run
|
|
396
393
|
--verbose print per-sample details (duration, tokens, output preview)
|
|
397
|
-
--
|
|
394
|
+
--batch batch mode: evaluate each artifact independently vs baseline
|
|
398
395
|
requires {name}.eval-samples.json paired with each artifact
|
|
399
396
|
--judge-repeat <n> run the LLM judge N times per (sample × dimension) and report stddev
|
|
400
397
|
--judge-models <list> multi-judge ensemble: "executor1:model1,executor2:model2"
|
|
@@ -419,9 +416,9 @@ options:
|
|
|
419
416
|
|
|
420
417
|
**Difference from `cost_max` / `latency_max` assertions**: assertions are **per-sample scoring rules** (exceeding the cap fails that one assertion, the run continues); budget caps are **workflow-level hard limits** (`totalUSD` overrun aborts the run and persists a partial report; per-sample overruns fail the offending sample but the run continues). Assertions answer "is quality acceptable?"; budgets answer "are cost/time within the envelope?".
|
|
421
418
|
|
|
422
|
-
### `omk bench run --
|
|
419
|
+
### `omk bench run --batch` (batch mode)
|
|
423
420
|
|
|
424
|
-
When `skills/` contains several **independent** artifacts, use `--
|
|
421
|
+
When `skills/` contains several **independent** artifacts, use `--batch` to evaluate each one against baseline and produce a BatchEvaluationReport with child EvaluationReports.
|
|
425
422
|
|
|
426
423
|
```
|
|
427
424
|
skills/
|
|
@@ -441,8 +438,8 @@ Pairing rules:
|
|
|
441
438
|
- artifacts without paired samples are skipped with a warning
|
|
442
439
|
|
|
443
440
|
```bash
|
|
444
|
-
omk bench run --
|
|
445
|
-
omk bench run --
|
|
441
|
+
omk bench run --batch
|
|
442
|
+
omk bench run --batch --dry-run
|
|
446
443
|
```
|
|
447
444
|
|
|
448
445
|
### `omk bench gen-samples` (generate test cases)
|
|
@@ -454,7 +451,7 @@ Reads an artifact's content and uses an LLM to auto-generate eval-samples. Revie
|
|
|
454
451
|
omk bench gen-samples skills/my-skill.md
|
|
455
452
|
|
|
456
453
|
# batch-generate for every artifact under skills/ that lacks samples
|
|
457
|
-
omk bench gen-samples --
|
|
454
|
+
omk bench gen-samples --batch
|
|
458
455
|
|
|
459
456
|
# specify sample count
|
|
460
457
|
omk bench gen-samples skills/my-skill.md --count 10
|
|
@@ -463,10 +460,10 @@ omk bench gen-samples skills/my-skill.md --count 10
|
|
|
463
460
|
Options:
|
|
464
461
|
|
|
465
462
|
```
|
|
466
|
-
--
|
|
463
|
+
--batch batch-generate for every artifact missing samples
|
|
467
464
|
--count <n> samples per artifact (default: 5)
|
|
468
465
|
--model <name> model used for generation (default: sonnet)
|
|
469
|
-
--skill-dir <path> artifact dir (default: skills), used with --
|
|
466
|
+
--skill-dir <path> artifact dir (default: skills), used with --batch
|
|
470
467
|
```
|
|
471
468
|
|
|
472
469
|
### `omk bench evolve` (self-iterating improvement)
|
|
@@ -670,13 +667,16 @@ The command writes `~/.oh-my-knowledge/analyses/<timestamp>-skill-health.json`.
|
|
|
670
667
|
|---|---|---|
|
|
671
668
|
| `claude` | default | invokes `claude -p` via Claude CLI |
|
|
672
669
|
| `claude-sdk` | structured output | uses Claude Agent SDK — no stdout parsing, avoids buffer truncation |
|
|
673
|
-
| `
|
|
670
|
+
| `codex` | OpenAI agent CLI | invokes `codex exec --json` (`@openai/codex` npm); best-effort tool trace; **costUSD not reported** (codex CLI does not emit USD; check usage externally) |
|
|
671
|
+
| `codex-sdk` | OpenAI agent SDK | uses `@openai/codex-sdk` with its bundled `@openai/codex` binary and streamed SDK events; **costUSD not reported** |
|
|
674
672
|
| `gemini` | cross-vendor comparison | invokes `gemini` CLI |
|
|
675
673
|
| `anthropic-api` | no CLI needed | calls Anthropic HTTP API directly (needs `ANTHROPIC_API_KEY`) |
|
|
676
674
|
| `openai-api` | no CLI needed | calls OpenAI HTTP API directly (needs `OPENAI_API_KEY`) |
|
|
677
675
|
|
|
678
676
|
API-direct executors support custom base URLs via env: `ANTHROPIC_BASE_URL`, `OPENAI_BASE_URL`.
|
|
679
677
|
|
|
678
|
+
Codex construct-validity notes: (1) `codex` uses the `codex` binary on `PATH`; `codex-sdk` uses the bundled `@openai/codex` binary resolved by `@openai/codex-sdk`. Reports persist per-variant `meta.executorRuntimes` plus `meta.executorRuntime` / `meta.judgeRuntime` fingerprints (binary or SDK version + capability snapshot), and `bench diff` / `bench verdict` warn when strict comparability cannot be audited. If runtime fingerprints differ, treat results as an executor-runtime comparison, not only prompt/template behavior. (2) Both executors isolate user-level config: `codex` passes `--ephemeral` + `--ignore-user-config`; `codex-sdk` redirects `$CODEX_HOME` to a per-process tmp dir (auth.json symlinked through). User-level `~/.codex/config.toml` does not leak into eval runs in either case.
|
|
679
|
+
|
|
680
680
|
### Custom executor
|
|
681
681
|
|
|
682
682
|
Any shell command can serve as an executor, communicating via stdin/stdout JSON:
|
|
@@ -720,7 +720,7 @@ skills/
|
|
|
720
720
|
| `./path/to/file.md` | path with `/`: read the file directly as an artifact |
|
|
721
721
|
| `variant@/path/to/project` | attach a run dir to any variant; supports `name@cwd`, `git:name@cwd`, `/file.md@cwd` |
|
|
722
722
|
|
|
723
|
-
When both `--control` and `--treatment` are omitted, use `--config eval.yaml` or `--
|
|
723
|
+
When both `--control` and `--treatment` are omitted, use `--config eval.yaml` or `--batch`. With `--batch`, `baseline` is auto-added as control and every discovered artifact becomes a treatment.
|
|
724
724
|
|
|
725
725
|
```bash
|
|
726
726
|
# explicit: one control, one or more treatments
|
package/README.zh.md
CHANGED
|
@@ -7,47 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
[English](./README.md) | **简体中文**
|
|
9
9
|
|
|
10
|
-
**omk** —
|
|
10
|
+
**omk** — 你给 LLM 的知识,价值在哪里?
|
|
11
|
+
omk 帮你用客观数据回答,而不是凭感觉。
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
**固定模型,只变知识载体。**
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
做知识工程的团队会产出大量知识载体(当前常见是 skill,也包括 prompt、agent、workflow 等)。当被问到"v2 比 v1 好在哪"时,需要客观数据而非主观判断。`oh-my-knowledge` 通过控制变量实验解决这个问题:相同模型、相同测试样本,只改变知识载体。
|
|
17
|
-
|
|
18
|
-
## 核心能力
|
|
19
|
-
|
|
20
|
-
- **控制变量离线评测** — 固定模型和样本,只变知识载体;兼容 Claude Code skill、CLAUDE.md prompt、RAG 知识库等任何 markdown 形式的指令
|
|
21
|
-
- **六维独立打分** — Fact / Behavior / LLM-judge / Cost / Efficiency / Stability 分别出信号,单一维度的回退不会被其他维度的收益掩盖
|
|
22
|
-
- **线上 session 观测** — 解析 Claude Code session JSONL,在真实用户会话上测量各 skill 的失败率、耗时、token 成本和知识缺口信号
|
|
23
|
-
- **知识缺口识别** — 严重度加权的信号(显式标记 / 搜索失败 / hedging 用语 / 反复失败)量化风险敞口,不宣称完备性
|
|
24
|
-
- **合并前 CI 门** — `omk bench gate` 强制三层 all-pass(fact + behavior + llm-judge),抓复合分掩盖的单层回退
|
|
25
|
-
- **一行 ship/no-ship 结论** — `omk bench verdict <reportId>` 聚合 bootstrap CI / 三层 ci-gate / saturation / human α,给六档 verdict(PROGRESS / CAUTIOUS / REGRESS / NOISE / UNDERPOWERED / SOLO)+ 行动建议;exit code 反映是否可 ship
|
|
26
|
-
|
|
27
|
-
### 统计严谨性
|
|
28
|
-
LLM 评测最容易踩的坑是"自信的偏差"——CI 很窄但结论错。omk 的统计层做四件事让结论可被外部审计:
|
|
15
|
+
<a id="statistical-rigor"></a>
|
|
16
|
+
> 默认带:Bootstrap 置信区间 · Krippendorff α(评委 ↔ 人工)· 长度去偏 · 饱和曲线 · 用例隔离(construct validity)。[这些为什么重要 →](docs/zh/statistical-rigor.md)
|
|
29
17
|
|
|
30
|
-
|
|
31
|
-
- **Human Gold + Krippendorff α** (`--gold-dir`) — 引入外部标注作为锚点。CI 解决"评委稳不稳",α 解决"评委对不对"——两个维度互补。omk 自动检测污染(gold annotator 与 judge 同模型时警告)。
|
|
32
|
-
- **Length-controlled judge prompt** (默认开启) — 研究证实 LLM 评委隐性偏向更长的回答。omk 的 judge prompt 加显式段落"长度不是质量信号",template hash 为 v3-cot-length,跟旧版本的报告 hash 肉眼可辨。`omk bench debias-validate length <reportId>` 重判检测偏差幅度。
|
|
33
|
-
- **Saturation curve** — 回答"我跑够样本了吗"。`--repeat ≥ 5` 时累积 N → 均值 + bootstrap CI 序列,CI 宽度衰减率 < 5% 持续 3 个窗口判定饱和——再多样本对结论无实质收益。HTML 报告内联 SVG 曲线 + verdict。
|
|
34
|
-
|
|
35
|
-
## 为什么选 omk
|
|
36
|
-
|
|
37
|
-
| | omk | promptfoo | DeepEval | RAGAS | LangSmith |
|
|
38
|
-
|--|--|--|--|--|--|
|
|
39
|
-
| Bootstrap CI | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
40
|
-
| Krippendorff α(评委 ↔ 人工锚点) | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
41
|
-
| Length-debias 评委 prompt | ✓ 默认 | ✗ | ✗ | ✗ | ✗ |
|
|
42
|
-
| 饱和曲线 | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
43
|
-
| 三层独立评分 | ✓ | ✗ | 部分 | ✗ | ✗ |
|
|
44
|
-
| 原生 Claude Code skill | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
45
|
-
| 完整中文文档 | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
46
|
-
| 托管 SaaS 看板 | ✗ | ✗ | ✓ | ✗ | ✓ |
|
|
47
|
-
|
|
48
|
-
omk 的护城河是**统计严谨性** — 每条结论都能被研究者审计。需要托管 SaaS 看板?选 LangSmith。要本地快速 prompt 迭代不要统计层?选 promptfoo。**要 ship 到生产且会被问"为什么应该相信这个数字"?选 omk**。
|
|
49
|
-
|
|
50
|
-
完整对比(7 个工具 × 25+ 维度): [docs/zh/comparison.md](docs/zh/comparison.md)
|
|
18
|
+

|
|
51
19
|
|
|
52
20
|
## 快速开始
|
|
53
21
|
|
|
@@ -68,7 +36,7 @@ cd my-eval
|
|
|
68
36
|
omk bench run --dry-run
|
|
69
37
|
|
|
70
38
|
# 运行评测(自动发现 skills/ 目录下的所有 artifact)
|
|
71
|
-
omk bench run
|
|
39
|
+
omk bench run # → 5 分钟出 HTML 报告 + verdict
|
|
72
40
|
|
|
73
41
|
# CLI 输出语言: zh (默认) / en — flag 优先级高于环境变量
|
|
74
42
|
omk bench run --lang en
|
|
@@ -87,27 +55,58 @@ OMK_LANG=en omk bench report
|
|
|
87
55
|
|
|
88
56
|
或直接说"帮我评测 v1 和 v2 的差异"、"改进一下这个 artifact",omk 会自动理解意图并调用对应命令。
|
|
89
57
|
|
|
58
|
+
## 为什么需要这个工具
|
|
59
|
+
|
|
60
|
+
做知识工程的团队会产出大量知识载体(当前常见是 skill,也包括 prompt、agent、workflow 等)。当被问到"v2 比 v1 好在哪"时,需要客观数据而非主观判断。`oh-my-knowledge` 通过控制变量实验解决这个问题:相同模型、相同测试用例,只改变知识载体。
|
|
61
|
+
|
|
62
|
+
## 核心能力
|
|
63
|
+
|
|
64
|
+
- **控制变量离线评测** — 固定模型和用例,只变知识载体;兼容 Claude Code skill、CLAUDE.md prompt、RAG 知识库等任何 markdown 形式的指令
|
|
65
|
+
- **六维独立打分** — Fact / Behavior / LLM-judge / Cost / Efficiency / Stability 分别出信号,单一维度的回退不会被其他维度的收益掩盖
|
|
66
|
+
- **线上 session 观测** — 解析 Claude Code session JSONL,在真实用户会话上测量各 skill 的失败率、耗时、token 成本和知识缺口信号
|
|
67
|
+
- **知识缺口识别** — 严重度加权的信号(显式标记 / 搜索失败 / hedging 用语 / 反复失败)量化风险敞口,不宣称完备性
|
|
68
|
+
- **合并前 CI 门** — `omk bench gate` 强制三层 all-pass(fact + behavior + llm-judge),抓复合分掩盖的单层回退
|
|
69
|
+
- **一行 ship/no-ship 结论** — `omk bench verdict <reportId>` 聚合 bootstrap CI / 三层 ci-gate / saturation / human α,给六档 verdict(PROGRESS / CAUTIOUS / REGRESS / NOISE / UNDERPOWERED / SOLO)+ 行动建议;exit code 反映是否可 ship
|
|
70
|
+
|
|
71
|
+
## 为什么选 omk
|
|
72
|
+
|
|
73
|
+
| | omk | promptfoo | DeepEval | LangSmith |
|
|
74
|
+
|--|--|--|--|--|
|
|
75
|
+
| Bootstrap 置信区间 | ✓ 默认 | ✗ | ✗ | ✗ |
|
|
76
|
+
| Krippendorff α(评委 ↔ 人工) | ✓ 默认 | ✗ | ✗ | ✗ |
|
|
77
|
+
| 长度去偏的评委 prompt | ✓ 默认 | ✗ | ✗ | ✗ |
|
|
78
|
+
| 饱和曲线 | ✓ | ✗ | ✗ | ✗ |
|
|
79
|
+
| 三层独立评分 | ✓ | ✗ | 部分 | ✗ |
|
|
80
|
+
| 用例隔离(construct validity) | ✓ 默认 | ✗ | ✗ | ✗ |
|
|
81
|
+
| 原生 Claude Code skill | ✓ | ✗ | ✗ | ✗ |
|
|
82
|
+
| 托管 SaaS 看板 | ✗ | ✗ | ✓ | ✓ |
|
|
83
|
+
|
|
84
|
+
omk 的护城河是 **default-on 安全网** —— Bootstrap CI / 评委 ↔ 人工 α / 长度去偏不是 advanced flag,是默认行为。其他工具让你**手动**接置信区间;omk 让你**默认无法忽略**它。需要 SaaS 看板?选 LangSmith。要快速 prompt 迭代不要统计层?选 promptfoo。**要发到生产且会被问"为什么应该相信这个数字"?选 omk。**
|
|
85
|
+
|
|
86
|
+
RAG 专项评测请看 RAGAS(独立 niche,跟 omk 互补)。完整对比(7 个工具 × 25+ 维度): [docs/zh/comparison.md](docs/zh/comparison.md)
|
|
87
|
+
|
|
90
88
|
## 特性
|
|
91
89
|
|
|
92
90
|
| 特性 | 说明 |
|
|
93
91
|
|------|------|
|
|
94
|
-
| **
|
|
95
|
-
| **断言取反 + 组合** | 通用 `not: true` 字段 + `assert-set` (any/all) 任意嵌套 |
|
|
92
|
+
| **Verdict 一行结论** | `omk bench verdict <id>` 六档判定 + ship 建议 + exit code 路由,与 HTML 报告 verdict pill 共享规则 |
|
|
96
93
|
| **六维评估** | 事实 / 行为 / LLM 评价 / 成本 / 效率 / 稳定性独立展示 |
|
|
97
|
-
|
|
|
94
|
+
| **多执行器** | 支持 Claude CLI / Claude SDK / Codex CLI / Codex SDK / OpenAI / Gemini 及自定义命令 |
|
|
95
|
+
| **21+ 种断言** | 包含子串、正则、JSON Schema、ROUGE/BLEU/Levenshtein 相似度、Agent 工具调用、语义相似度、自定义函数等 |
|
|
96
|
+
| **统计严谨性** | Bootstrap CI / Krippendorff α / 长度去偏 / 饱和曲线 —— 全部默认开。[详情 →](docs/zh/statistical-rigor.md) |
|
|
97
|
+
| **用例质量诊断** | `omk bench diagnose <id>` 7 类 issue(区分度低 / 重复 / 歧义 / 成本异常 / 全 fail 等)+ healthScore 0-100 |
|
|
98
|
+
| **失败聚类 + 根因** | `omk bench failures <id>` 单 LLM 调用聚类失败用例 + 每 cluster 给修复建议 |
|
|
99
|
+
| **RAG metrics** | `faithfulness` / `answer_relevancy` / `context_recall` 三 metric — 反幻觉 + 切题度 + context 覆盖,自动继承长度去偏 |
|
|
100
|
+
| **预算硬阈值** | `--budget-usd / --budget-per-sample-usd / --budget-per-sample-ms` 总成本 + 单用例成本/耗时上限,超出中止保留 partial report |
|
|
98
101
|
| **用例隔离 (construct validity)** | `--strict-baseline` (默认开) 三堵 baseline 拿到被测 skill 的污染路径:(1) SDK skill auto-discovery (2) subagent Skill 工具调用 (3) cwd 文件系统(避免 baseline 顺 `skills/<name>/` symlink 直接 Read 到 SKILL.md)。eval.yaml `allowedSkills` 支持 per-variant 白名单 |
|
|
99
|
-
| **
|
|
100
|
-
| **RAG metrics** | `faithfulness` / `answer_relevancy` / `context_recall` 三 metric — 反幻觉 + 切题度 + context 覆盖,自动继承 length-debias |
|
|
101
|
-
| **样本质量诊断** | `omk bench diagnose <id>` 7 类 issue(区分度低 / 重复 / 歧义 / 成本异常 / 全 fail 等)+ healthScore 0-100 |
|
|
102
|
-
| **失败聚类 + 根因** | `omk bench failures <id>` 单 LLM 调用聚类失败样本 + 每 cluster 给修复建议 |
|
|
103
|
-
| **预算硬阈值** | `--budget-usd / --budget-per-sample-usd / --budget-per-sample-ms` 总成本 + 单样本成本/耗时上限,超出中止保留 partial report |
|
|
104
|
-
| **多执行器** | 支持 Claude CLI / Claude SDK / OpenAI / Gemini 及自定义命令 |
|
|
102
|
+
| **用例设计科学性 (sample design science)** | Sample schema 加 `capability` / `difficulty` / `construct` / `provenance` 元数据字段(HF Dataset Cards 风)。`bench diagnose` 输出 coverage 分桶 + 检测 `rubric_clarity_low` / `capability_thin` 两类新 issue。`bench gen-samples` 自动给生成的用例打 provenance。详见 [docs/sample-design-spec.md](docs/sample-design-spec.md),含 8 条行业 gap(HELM / MMLU-Pro / Construct Validity / IRT / Dataset Cards / Adversarial)的 omk v1 映射 |
|
|
105
103
|
| **多评委 ensemble** | `--judge-models claude:opus,openai:gpt-4o` 跨厂商评分 + agreement 度量 |
|
|
106
104
|
| **MCP URL 获取** | 通过 MCP Server 获取私有文档 URL 内容(SSO 保护的知识库等) |
|
|
107
105
|
| **盲测 A/B** | `--blind` 隐藏变体名称,HTML 报告有揭晓按钮 |
|
|
108
|
-
| **并行执行** | `--concurrency N` 并行 N 个任务 |
|
|
109
106
|
| **多轮方差分析** | `--repeat N` 重复 N 次,计算均值/标准差/置信区间/t 检验 |
|
|
110
|
-
|
|
|
107
|
+
| **并行执行** | `--concurrency N` 并行 N 个任务 |
|
|
108
|
+
| **断言取反 + 组合** | 通用 `not: true` 字段 + `assert-set` (any/all) 任意嵌套 |
|
|
109
|
+
| **自动分析** | 检测低区分度断言、均匀分数、全通过/全失败、高成本用例 |
|
|
111
110
|
| **可追溯性** | 报告含 CLI 版本、Node 版本、artifact 版本指纹、judge prompt hash |
|
|
112
111
|
| **中英切换** | HTML 报告右上角一键切换语言 |
|
|
113
112
|
|
|
@@ -132,7 +131,7 @@ flowchart TD
|
|
|
132
131
|
end
|
|
133
132
|
|
|
134
133
|
subgraph Exec["④ 执行器(固定模型)"]
|
|
135
|
-
E["claude / claude-sdk / openai / gemini<br/>anthropic-api / openai-api / 自定义命令"]
|
|
134
|
+
E["claude / claude-sdk / codex / openai / gemini<br/>anthropic-api / openai-api / 自定义命令"]
|
|
136
135
|
T["claude-sdk 抽取<br/>turns / toolCalls trace"]
|
|
137
136
|
E -.-> T
|
|
138
137
|
end
|
|
@@ -369,7 +368,7 @@ omk bench run [选项]
|
|
|
369
368
|
--skill-dir <路径> artifact 目录(默认:skills)
|
|
370
369
|
--control <expr> 对照组变体表达式(experiment role = control)
|
|
371
370
|
--treatment <v1,v2> 实验组变体表达式,逗号分隔
|
|
372
|
-
除非用 --config 或 --
|
|
371
|
+
除非用 --config 或 --batch,--control / --treatment 两者至少传一个
|
|
373
372
|
特殊值:baseline(空 artifact)、git:name(git 历史版本)、
|
|
374
373
|
git:ref:name(指定 commit)、含 / 的路径(直接读取文件)
|
|
375
374
|
--config <路径> YAML/JSON 配置文件(evaluation-as-code);在一个文件里声明
|
|
@@ -390,7 +389,7 @@ omk bench run [选项]
|
|
|
390
389
|
(默认:当前目录的 .mcp.json)
|
|
391
390
|
--no-serve 评测完成后不自动启动报告服务
|
|
392
391
|
--verbose 打印每个样本的详细执行结果(耗时、tokens、输出预览)
|
|
393
|
-
--
|
|
392
|
+
--batch 批量评测:每个 artifact 独立和 baseline 对比
|
|
394
393
|
需要每个 artifact 配对 {name}.eval-samples.json
|
|
395
394
|
--judge-repeat <n> 每条 sample × dimension 跑 LLM 评委 N 次,输出 stddev (评委自一致性)
|
|
396
395
|
--judge-models <list> 多评委 ensemble: "executor1:model1,executor2:model2"
|
|
@@ -412,9 +411,9 @@ omk bench run [选项]
|
|
|
412
411
|
|
|
413
412
|
**和 `cost_max` / `latency_max` 断言的区别**: 断言是**单样本评分维度**(超出直接打 0 分,run 继续);budget 是**工作流级硬阈值**(`totalUSD` 超出整个 run abort 保留 partial report,per-sample 超出该样本失败但 run 继续)。一个回答"质量是否达标",一个回答"花钱/时间是否在预算内"。
|
|
414
413
|
|
|
415
|
-
### `omk bench run --
|
|
414
|
+
### `omk bench run --batch`(批量评测)
|
|
416
415
|
|
|
417
|
-
当 skills/ 下放了多个**独立的** artifact 时,使用 `--
|
|
416
|
+
当 skills/ 下放了多个**独立的** artifact 时,使用 `--batch` 逐个评测,每个 artifact 独立和 baseline 对比,生成一份 BatchEvaluationReport,内部索引多个 child EvaluationReport。
|
|
418
417
|
|
|
419
418
|
```
|
|
420
419
|
skills/
|
|
@@ -434,8 +433,8 @@ skills/
|
|
|
434
433
|
- 没有配对 eval-samples 的 artifact 会被跳过并打印警告
|
|
435
434
|
|
|
436
435
|
```bash
|
|
437
|
-
omk bench run --
|
|
438
|
-
omk bench run --
|
|
436
|
+
omk bench run --batch
|
|
437
|
+
omk bench run --batch --dry-run
|
|
439
438
|
```
|
|
440
439
|
|
|
441
440
|
### `omk bench gen-samples`(生成测评用例)
|
|
@@ -447,7 +446,7 @@ omk bench run --each --dry-run
|
|
|
447
446
|
omk bench gen-samples skills/my-skill.md
|
|
448
447
|
|
|
449
448
|
# 为 skills/ 下所有缺少测试集的 artifact 批量生成
|
|
450
|
-
omk bench gen-samples --
|
|
449
|
+
omk bench gen-samples --batch
|
|
451
450
|
|
|
452
451
|
# 指定生成数量
|
|
453
452
|
omk bench gen-samples skills/my-skill.md --count 10
|
|
@@ -456,10 +455,10 @@ omk bench gen-samples skills/my-skill.md --count 10
|
|
|
456
455
|
选项:
|
|
457
456
|
|
|
458
457
|
```
|
|
459
|
-
--
|
|
458
|
+
--batch 为所有缺少 eval-samples 的 artifact 批量生成
|
|
460
459
|
--count <n> 每个 artifact 生成的样本数(默认:5)
|
|
461
460
|
--model <名称> 生成用的模型(默认:sonnet)
|
|
462
|
-
--skill-dir <路径> artifact 目录(默认:skills),配合 --
|
|
461
|
+
--skill-dir <路径> artifact 目录(默认:skills),配合 --batch 使用
|
|
463
462
|
```
|
|
464
463
|
|
|
465
464
|
### `omk bench evolve`(自我循环改进)
|
|
@@ -663,13 +662,16 @@ omk analyze ~/.claude/projects/my-project --kb /path/to/project
|
|
|
663
662
|
|--------|----------|------|
|
|
664
663
|
| `claude` | 默认 | 通过 `claude -p` 调用 Claude CLI |
|
|
665
664
|
| `claude-sdk` | 结构化输出 | 通过 Claude Agent SDK 调用,无 stdout 解析,避免 buffer 截断 |
|
|
666
|
-
| `
|
|
665
|
+
| `codex` | OpenAI agent CLI | 通过 `codex exec --json` 调用,需本地装好登录的 codex(`@openai/codex`);best-effort tool trace,**costUSD 不报**(codex 自身不输出 USD,需外部账单核算) |
|
|
666
|
+
| `codex-sdk` | OpenAI agent SDK | 通过 `@openai/codex-sdk` 调用其自带的 `@openai/codex` binary 和 SDK 事件流;**costUSD 不报** |
|
|
667
667
|
| `gemini` | 跨厂商对比 | 通过 `gemini` CLI 调用 |
|
|
668
668
|
| `anthropic-api` | 无需 CLI | 直接调用 Anthropic HTTP API(需 `ANTHROPIC_API_KEY`) |
|
|
669
669
|
| `openai-api` | 无需 CLI | 直接调用 OpenAI HTTP API(需 `OPENAI_API_KEY`) |
|
|
670
670
|
|
|
671
671
|
API 直调执行器支持通过环境变量自定义 Base URL:`ANTHROPIC_BASE_URL`、`OPENAI_BASE_URL`。
|
|
672
672
|
|
|
673
|
+
Codex construct-validity 说明:(1) `codex` 使用 `PATH` 上找到的 `codex` binary;`codex-sdk` 使用 `@openai/codex-sdk` 解析到的自带 `@openai/codex` binary。报告会持久化 per-variant `meta.executorRuntimes` 以及 `meta.executorRuntime` / `meta.judgeRuntime` 指纹(binary 或 SDK 版本 + 能力快照),`bench diff` / `bench verdict` 会在 strict comparability 无法审计时提示。runtime 指纹不一致时,结果应解释为 executor runtime 对比,而不只是 prompt/template 行为对比。(2) 两个 executor 都隔离用户级 config:`codex` 传 `--ephemeral` + `--ignore-user-config`,`codex-sdk` 把 `$CODEX_HOME` 重定向到 per-process tmp 目录(auth.json 通过 symlink 透传)。用户的 `~/.codex/config.toml` 不会渗入任意一个 executor 的 eval。
|
|
674
|
+
|
|
673
675
|
### 自定义执行器
|
|
674
676
|
|
|
675
677
|
任何 shell 命令都可以作为执行器,通过 stdin/stdout JSON 协议通信:
|
|
@@ -713,7 +715,7 @@ skills/
|
|
|
713
715
|
| `./path/to/file.md` | 含 `/` 的路径,直接读取文件作为 artifact |
|
|
714
716
|
| `variant@/path/to/project` | 给任意变体附加运行目录,支持 `name@cwd`、`git:name@cwd`、`/file.md@cwd` |
|
|
715
717
|
|
|
716
|
-
`--control` 和 `--treatment` 都不传时,用 `--config eval.yaml` 或 `--
|
|
718
|
+
`--control` 和 `--treatment` 都不传时,用 `--config eval.yaml` 或 `--batch`。`--batch` 模式下会自动用 `baseline` 作对照组,每个被发现的 artifact 作实验组。
|
|
717
719
|
|
|
718
720
|
```bash
|
|
719
721
|
# 显式:一个 control,一个或多个 treatment
|
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-analysis: detect patterns and generate insights from evaluation results.
|
|
3
3
|
*/
|
|
4
|
-
import type { Report, AnalysisResult } from '../types/index.js';
|
|
4
|
+
import type { Report, AnalysisResult, Sample, SampleQualityAggregate, Lang } from '../types/index.js';
|
|
5
|
+
/** opts for `analyzeResults`. Optional because most older callers don't have
|
|
6
|
+
* samples in scope; new callers (evaluation-pipeline / evolver) pass them in to
|
|
7
|
+
* populate `analysis.sampleQuality`. */
|
|
8
|
+
export interface AnalyzeResultsOptions {
|
|
9
|
+
/** Original Sample[] from eval-samples. Enables `analysis.sampleQuality` aggregation. */
|
|
10
|
+
samples?: Sample[];
|
|
11
|
+
}
|
|
5
12
|
/**
|
|
6
|
-
* Analyze an evaluation report and produce insights
|
|
13
|
+
* Analyze an evaluation report and produce structured insights.
|
|
7
14
|
*/
|
|
8
|
-
export declare function analyzeResults(report: Report): AnalysisResult;
|
|
15
|
+
export declare function analyzeResults(report: Report, opts?: AnalyzeResultsOptions): AnalysisResult;
|
|
16
|
+
/**
|
|
17
|
+
* Build sample design science aggregate from sample metadata.
|
|
18
|
+
*
|
|
19
|
+
* Pure function — no result/score data needed. Reads:
|
|
20
|
+
* - `Sample.capability` (string[], normalized case-insensitive + dash/camel/underscore stripped)
|
|
21
|
+
* - `Sample.difficulty` ('easy' | 'medium' | 'hard')
|
|
22
|
+
* - `Sample.construct` (free-form string)
|
|
23
|
+
* - `Sample.provenance` ('human' | 'llm-generated' | 'production-trace')
|
|
24
|
+
* - `Sample.rubric` (for avgRubricLength)
|
|
25
|
+
*
|
|
26
|
+
* Missing fields are bucketed under the `unspecified` key in the relevant
|
|
27
|
+
* distribution map, so users see "I have N samples without difficulty declared".
|
|
28
|
+
*
|
|
29
|
+
* Used by `bench diagnose` CLI to surface coverage gaps. Does NOT participate
|
|
30
|
+
* in grading / judge / verdict. See docs/sample-design-spec.md.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildSampleQualityAggregate(samples: Sample[]): SampleQualityAggregate;
|
|
33
|
+
export declare function generateAnalysisSummary(report: Report, lang?: Lang): string | undefined;
|
|
9
34
|
//# sourceMappingURL=report-diagnostics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-diagnostics.d.ts","sourceRoot":"","sources":["../../../src/analysis/report-diagnostics.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAwB,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"report-diagnostics.d.ts","sourceRoot":"","sources":["../../../src/analysis/report-diagnostics.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAwB,cAAc,EAAE,MAAM,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAG5H;;yCAEyC;AACzC,MAAM,WAAW,qBAAqB;IACpC,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,qBAA0B,GAAG,cAAc,CAkD/F;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,sBAAsB,CAuErF;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,IAAW,GAAG,MAAM,GAAG,SAAS,CA+O7F"}
|