oh-my-knowledge 0.23.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.
Files changed (153) hide show
  1. package/README.md +63 -64
  2. package/README.zh.md +64 -63
  3. package/dist/src/analysis/report-diagnostics.d.ts +3 -2
  4. package/dist/src/analysis/report-diagnostics.d.ts.map +1 -1
  5. package/dist/src/analysis/report-diagnostics.js +107 -80
  6. package/dist/src/analysis/report-diagnostics.js.map +1 -1
  7. package/dist/src/analysis/sample-diagnostics.d.ts +4 -1
  8. package/dist/src/analysis/sample-diagnostics.d.ts.map +1 -1
  9. package/dist/src/analysis/sample-diagnostics.js +123 -29
  10. package/dist/src/analysis/sample-diagnostics.js.map +1 -1
  11. package/dist/src/authoring/evolver.d.ts +5 -0
  12. package/dist/src/authoring/evolver.d.ts.map +1 -1
  13. package/dist/src/authoring/evolver.js +20 -3
  14. package/dist/src/authoring/evolver.js.map +1 -1
  15. package/dist/src/cli/i18n-dict.d.ts +1 -1
  16. package/dist/src/cli/i18n-dict.d.ts.map +1 -1
  17. package/dist/src/cli/i18n-dict.js +28 -24
  18. package/dist/src/cli/i18n-dict.js.map +1 -1
  19. package/dist/src/cli/index.js +80 -66
  20. package/dist/src/cli/index.js.map +1 -1
  21. package/dist/src/cli/parse-run-config.d.ts.map +1 -1
  22. package/dist/src/cli/parse-run-config.js +4 -4
  23. package/dist/src/cli/parse-run-config.js.map +1 -1
  24. package/dist/src/cli/progress.d.ts +1 -0
  25. package/dist/src/cli/progress.d.ts.map +1 -1
  26. package/dist/src/cli/progress.js +8 -1
  27. package/dist/src/cli/progress.js.map +1 -1
  28. package/dist/src/eval-core/cache.d.ts +7 -5
  29. package/dist/src/eval-core/cache.d.ts.map +1 -1
  30. package/dist/src/eval-core/cache.js +11 -7
  31. package/dist/src/eval-core/cache.js.map +1 -1
  32. package/dist/src/eval-core/comparability.d.ts +11 -0
  33. package/dist/src/eval-core/comparability.d.ts.map +1 -0
  34. package/dist/src/eval-core/comparability.js +271 -0
  35. package/dist/src/eval-core/comparability.js.map +1 -0
  36. package/dist/src/eval-core/evaluation-execution.d.ts +4 -1
  37. package/dist/src/eval-core/evaluation-execution.d.ts.map +1 -1
  38. package/dist/src/eval-core/evaluation-execution.js +25 -17
  39. package/dist/src/eval-core/evaluation-execution.js.map +1 -1
  40. package/dist/src/eval-core/evaluation-job.d.ts +2 -2
  41. package/dist/src/eval-core/evaluation-job.d.ts.map +1 -1
  42. package/dist/src/eval-core/evaluation-job.js +2 -2
  43. package/dist/src/eval-core/evaluation-job.js.map +1 -1
  44. package/dist/src/eval-core/evaluation-reporting.d.ts +3 -1
  45. package/dist/src/eval-core/evaluation-reporting.d.ts.map +1 -1
  46. package/dist/src/eval-core/evaluation-reporting.js +64 -4
  47. package/dist/src/eval-core/evaluation-reporting.js.map +1 -1
  48. package/dist/src/eval-core/execution-strategy.js +2 -2
  49. package/dist/src/eval-core/execution-strategy.js.map +1 -1
  50. package/dist/src/eval-core/schema.d.ts.map +1 -1
  51. package/dist/src/eval-core/schema.js +13 -0
  52. package/dist/src/eval-core/schema.js.map +1 -1
  53. package/dist/src/eval-workflows/batch-evaluation-workflow.d.ts +111 -0
  54. package/dist/src/eval-workflows/batch-evaluation-workflow.d.ts.map +1 -0
  55. package/dist/src/eval-workflows/batch-evaluation-workflow.js +215 -0
  56. package/dist/src/eval-workflows/batch-evaluation-workflow.js.map +1 -0
  57. package/dist/src/eval-workflows/evaluation-pipeline.d.ts +5 -3
  58. package/dist/src/eval-workflows/evaluation-pipeline.d.ts.map +1 -1
  59. package/dist/src/eval-workflows/evaluation-pipeline.js +6 -5
  60. package/dist/src/eval-workflows/evaluation-pipeline.js.map +1 -1
  61. package/dist/src/eval-workflows/evaluation-preparation.d.ts +8 -6
  62. package/dist/src/eval-workflows/evaluation-preparation.d.ts.map +1 -1
  63. package/dist/src/eval-workflows/evaluation-preparation.js +8 -4
  64. package/dist/src/eval-workflows/evaluation-preparation.js.map +1 -1
  65. package/dist/src/eval-workflows/run-evaluation.d.ts +20 -17
  66. package/dist/src/eval-workflows/run-evaluation.d.ts.map +1 -1
  67. package/dist/src/eval-workflows/run-evaluation.js +25 -15
  68. package/dist/src/eval-workflows/run-evaluation.js.map +1 -1
  69. package/dist/src/executors/claude-cli.d.ts.map +1 -1
  70. package/dist/src/executors/claude-cli.js +11 -6
  71. package/dist/src/executors/claude-cli.js.map +1 -1
  72. package/dist/src/executors/codex-cli-trace.d.ts +10 -0
  73. package/dist/src/executors/codex-cli-trace.d.ts.map +1 -0
  74. package/dist/src/executors/codex-cli-trace.js +123 -0
  75. package/dist/src/executors/codex-cli-trace.js.map +1 -0
  76. package/dist/src/executors/codex-cli.d.ts +18 -0
  77. package/dist/src/executors/codex-cli.d.ts.map +1 -0
  78. package/dist/src/executors/codex-cli.js +254 -0
  79. package/dist/src/executors/codex-cli.js.map +1 -0
  80. package/dist/src/executors/codex-sdk.d.ts +18 -0
  81. package/dist/src/executors/codex-sdk.d.ts.map +1 -0
  82. package/dist/src/executors/codex-sdk.js +214 -0
  83. package/dist/src/executors/codex-sdk.js.map +1 -0
  84. package/dist/src/executors/gemini.d.ts.map +1 -1
  85. package/dist/src/executors/gemini.js +28 -24
  86. package/dist/src/executors/gemini.js.map +1 -1
  87. package/dist/src/executors/index.d.ts.map +1 -1
  88. package/dist/src/executors/index.js +7 -2
  89. package/dist/src/executors/index.js.map +1 -1
  90. package/dist/src/executors/runtime-fingerprint.d.ts +7 -0
  91. package/dist/src/executors/runtime-fingerprint.d.ts.map +1 -0
  92. package/dist/src/executors/runtime-fingerprint.js +277 -0
  93. package/dist/src/executors/runtime-fingerprint.js.map +1 -0
  94. package/dist/src/executors/script.d.ts.map +1 -1
  95. package/dist/src/executors/script.js +47 -55
  96. package/dist/src/executors/script.js.map +1 -1
  97. package/dist/src/executors/shared.d.ts +78 -1
  98. package/dist/src/executors/shared.d.ts.map +1 -1
  99. package/dist/src/executors/shared.js +203 -1
  100. package/dist/src/executors/shared.js.map +1 -1
  101. package/dist/src/grading/assertions.d.ts.map +1 -1
  102. package/dist/src/grading/assertions.js +18 -3
  103. package/dist/src/grading/assertions.js.map +1 -1
  104. package/dist/src/grading/index.d.ts.map +1 -1
  105. package/dist/src/grading/index.js +11 -0
  106. package/dist/src/grading/index.js.map +1 -1
  107. package/dist/src/grading/judge.d.ts.map +1 -1
  108. package/dist/src/grading/judge.js +75 -6
  109. package/dist/src/grading/judge.js.map +1 -1
  110. package/dist/src/inputs/skill-loader.d.ts +1 -1
  111. package/dist/src/inputs/skill-loader.d.ts.map +1 -1
  112. package/dist/src/inputs/skill-loader.js +1 -1
  113. package/dist/src/inputs/skill-loader.js.map +1 -1
  114. package/dist/src/renderer/html-renderer.d.ts +5 -4
  115. package/dist/src/renderer/html-renderer.d.ts.map +1 -1
  116. package/dist/src/renderer/html-renderer.js +217 -93
  117. package/dist/src/renderer/html-renderer.js.map +1 -1
  118. package/dist/src/renderer/layout.d.ts +2 -1
  119. package/dist/src/renderer/layout.d.ts.map +1 -1
  120. package/dist/src/renderer/layout.js +30 -42
  121. package/dist/src/renderer/layout.js.map +1 -1
  122. package/dist/src/renderer/summary.d.ts +3 -3
  123. package/dist/src/renderer/summary.d.ts.map +1 -1
  124. package/dist/src/renderer/summary.js +232 -42
  125. package/dist/src/renderer/summary.js.map +1 -1
  126. package/dist/src/renderer/trends.d.ts.map +1 -1
  127. package/dist/src/renderer/trends.js +5 -3
  128. package/dist/src/renderer/trends.js.map +1 -1
  129. package/dist/src/server/report-server.js +4 -4
  130. package/dist/src/server/report-server.js.map +1 -1
  131. package/dist/src/server/report-store.d.ts +7 -5
  132. package/dist/src/server/report-store.d.ts.map +1 -1
  133. package/dist/src/server/report-store.js +39 -11
  134. package/dist/src/server/report-store.js.map +1 -1
  135. package/dist/src/types/eval.d.ts +4 -2
  136. package/dist/src/types/eval.d.ts.map +1 -1
  137. package/dist/src/types/executor.d.ts +5 -0
  138. package/dist/src/types/executor.d.ts.map +1 -1
  139. package/dist/src/types/judge.d.ts +10 -0
  140. package/dist/src/types/judge.d.ts.map +1 -1
  141. package/dist/src/types/report.d.ts +120 -24
  142. package/dist/src/types/report.d.ts.map +1 -1
  143. package/dist/src/types/storage.d.ts +7 -7
  144. package/dist/src/types/storage.d.ts.map +1 -1
  145. package/package.json +2 -1
  146. package/dist/src/eval-workflows/each-evaluation-workflow.d.ts +0 -153
  147. package/dist/src/eval-workflows/each-evaluation-workflow.d.ts.map +0 -1
  148. package/dist/src/eval-workflows/each-evaluation-workflow.js +0 -178
  149. package/dist/src/eval-workflows/each-evaluation-workflow.js.map +0 -1
  150. package/dist/src/executors/openai-cli.d.ts +0 -3
  151. package/dist/src/executors/openai-cli.d.ts.map +0 -1
  152. package/dist/src/executors/openai-cli.js +0 -60
  153. 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** — LLM evaluation framework with built-in statistical rigor. Bootstrap CI / Krippendorff α / length-debias / saturation curves out of the box. Native support for Claude Code skills, prompts, agents, and RAG.
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, let the data speak.**
13
+ **Fix the model, vary the knowledge artifact.**
13
14
 
14
- ## Why this tool
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
- The biggest LLM-eval failure mode is "confident bias" — narrow CIs around the wrong answer. omk's statistical layer ships four pieces so conclusions can be externally audited:
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
+ ![omk report](./assets/screenshots/report-overview.png)
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,27 +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
- | **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 |
102
92
  | **One-line verdict** | `omk bench verdict <id>` six-tier verdict + ship recommendation + exit-code routing; HTML pill shares the same rules |
103
- | **RAG metrics** | `faithfulness` / `answer_relevancy` / `context_recall` — anti-hallucination + answer relevance + context coverage; auto-inherits length-debias |
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) |
104
97
  | **Sample diagnostics** | `omk bench diagnose <id>` — 7 issue kinds (low discrimination / duplicates / ambiguous rubric / cost outliers / etc.) + 0-100 healthScore |
105
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 |
106
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 |
107
- | **Multi-executor** | Claude CLI / Claude SDK / OpenAI / Gemini / any custom command |
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 |
108
103
  | **Multi-judge ensemble** | `--judge-models claude:opus,openai:gpt-4o` cross-vendor scoring + agreement metrics |
109
104
  | **MCP URL fetching** | pull content from private-doc URLs via an MCP server (SSO-protected knowledge bases, etc.) |
110
105
  | **Blind A/B** | `--blind` hides variant names; HTML report has a reveal button |
111
- | **Parallel execution** | `--concurrency N` runs N tasks at once |
112
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 |
113
109
  | **Auto analysis** | detects low-discrimination assertions, flat scores, all-pass / all-fail, expensive samples |
114
110
  | **Traceability** | reports carry CLI version, Node version, artifact version fingerprint, judge prompt hash |
115
111
  | **EN / ZH switch** | one-click language toggle in the HTML report |
@@ -135,8 +131,8 @@ flowchart TD
135
131
  end
136
132
 
137
133
  subgraph Exec["④ Executor (fixed model)"]
138
- E["claude / claude-sdk / openai / gemini<br/>anthropic-api / openai-api / custom"]
139
- T["claude-sdk extracts<br/>turns / toolCalls trace"]
134
+ E["claude / claude-sdk / codex / openai / gemini<br/>anthropic-api / openai-api / custom"]
135
+ T["claude-sdk / codex extract<br/>turns / toolCalls trace"]
140
136
  E -.-> T
141
137
  end
142
138
 
@@ -373,13 +369,13 @@ options:
373
369
  --control <expr> control-group variant expression (experiment role = control)
374
370
  --treatment <v1,v2> treatment-group variant expressions, comma-separated
375
371
  at least one of --control / --treatment is required
376
- (unless you use --config or --each)
372
+ (unless you use --config or --batch)
377
373
  special values: baseline (empty artifact), git:name (git HEAD),
378
374
  git:ref:name (specific commit), path with "/" (read file directly)
379
375
  --config <path> YAML/JSON config file (evaluation-as-code); declares
380
376
  samples + variants + model + executor in one file; CLI
381
377
  flags override config fields when both are provided
382
- --model <name> model under test (default: sonnet)
378
+ --model <name> task execution model (default: sonnet)
383
379
  --judge-model <name> judge model (default: haiku)
384
380
  --output-dir <path> output dir (default: ~/.oh-my-knowledge/reports/)
385
381
  --no-judge skip the LLM judge
@@ -395,7 +391,7 @@ options:
395
391
  (default: .mcp.json in cwd)
396
392
  --no-serve don't auto-start the report server after the run
397
393
  --verbose print per-sample details (duration, tokens, output preview)
398
- --each batch mode: evaluate each artifact independently vs baseline
394
+ --batch batch mode: evaluate each artifact independently vs baseline
399
395
  requires {name}.eval-samples.json paired with each artifact
400
396
  --judge-repeat <n> run the LLM judge N times per (sample × dimension) and report stddev
401
397
  --judge-models <list> multi-judge ensemble: "executor1:model1,executor2:model2"
@@ -420,9 +416,9 @@ options:
420
416
 
421
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?".
422
418
 
423
- ### `omk bench run --each` (batch mode)
419
+ ### `omk bench run --batch` (batch mode)
424
420
 
425
- When `skills/` contains several **independent** artifacts, use `--each` to evaluate each one against baseline and produce a merged report.
421
+ When `skills/` contains several **independent** artifacts, use `--batch` to evaluate each one against baseline and produce a BatchEvaluationReport with child EvaluationReports.
426
422
 
427
423
  ```
428
424
  skills/
@@ -442,8 +438,8 @@ Pairing rules:
442
438
  - artifacts without paired samples are skipped with a warning
443
439
 
444
440
  ```bash
445
- omk bench run --each
446
- omk bench run --each --dry-run
441
+ omk bench run --batch
442
+ omk bench run --batch --dry-run
447
443
  ```
448
444
 
449
445
  ### `omk bench gen-samples` (generate test cases)
@@ -455,7 +451,7 @@ Reads an artifact's content and uses an LLM to auto-generate eval-samples. Revie
455
451
  omk bench gen-samples skills/my-skill.md
456
452
 
457
453
  # batch-generate for every artifact under skills/ that lacks samples
458
- omk bench gen-samples --each
454
+ omk bench gen-samples --batch
459
455
 
460
456
  # specify sample count
461
457
  omk bench gen-samples skills/my-skill.md --count 10
@@ -464,10 +460,10 @@ omk bench gen-samples skills/my-skill.md --count 10
464
460
  Options:
465
461
 
466
462
  ```
467
- --each batch-generate for every artifact missing samples
463
+ --batch batch-generate for every artifact missing samples
468
464
  --count <n> samples per artifact (default: 5)
469
465
  --model <name> model used for generation (default: sonnet)
470
- --skill-dir <path> artifact dir (default: skills), used with --each
466
+ --skill-dir <path> artifact dir (default: skills), used with --batch
471
467
  ```
472
468
 
473
469
  ### `omk bench evolve` (self-iterating improvement)
@@ -671,13 +667,16 @@ The command writes `~/.oh-my-knowledge/analyses/<timestamp>-skill-health.json`.
671
667
  |---|---|---|
672
668
  | `claude` | default | invokes `claude -p` via Claude CLI |
673
669
  | `claude-sdk` | structured output | uses Claude Agent SDK — no stdout parsing, avoids buffer truncation |
674
- | `openai` | cross-vendor comparison | invokes `openai api` CLI |
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** |
675
672
  | `gemini` | cross-vendor comparison | invokes `gemini` CLI |
676
673
  | `anthropic-api` | no CLI needed | calls Anthropic HTTP API directly (needs `ANTHROPIC_API_KEY`) |
677
674
  | `openai-api` | no CLI needed | calls OpenAI HTTP API directly (needs `OPENAI_API_KEY`) |
678
675
 
679
676
  API-direct executors support custom base URLs via env: `ANTHROPIC_BASE_URL`, `OPENAI_BASE_URL`.
680
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
+
681
680
  ### Custom executor
682
681
 
683
682
  Any shell command can serve as an executor, communicating via stdin/stdout JSON:
@@ -721,7 +720,7 @@ skills/
721
720
  | `./path/to/file.md` | path with `/`: read the file directly as an artifact |
722
721
  | `variant@/path/to/project` | attach a run dir to any variant; supports `name@cwd`, `git:name@cwd`, `/file.md@cwd` |
723
722
 
724
- When both `--control` and `--treatment` are omitted, use `--config eval.yaml` or `--each`. With `--each`, `baseline` is auto-added as control and every discovered artifact becomes a treatment.
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.
725
724
 
726
725
  ```bash
727
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** — 内置统计严谨性的 LLM 评测框架。Bootstrap CI / Krippendorff α / 长度偏差校正 / 饱和曲线开箱即用。原生支持 Claude Code skill、prompt、agent、RAG。
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
- - **Bootstrap CI** (`--bootstrap`) — 不假设分布的置信区间。t 检验在 LLM 序数评分上失效,bootstrap 直接重采样原始数据,对小 N(< 30)和偏态分布都稳。pairwise diff CI 不含 0 = 显著差异。
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
+ ![omk 报告](./assets/screenshots/report-overview-zh.png)
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,28 +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
- | **21+ 种断言** | 包含子串、正则、JSON Schema、ROUGE/BLEU/Levenshtein 相似度、Agent 工具调用、语义相似度、自定义函数等 |
95
- | **断言取反 + 组合** | 通用 `not: true` 字段 + `assert-set` (any/all) 任意嵌套 |
92
+ | **Verdict 一行结论** | `omk bench verdict <id>` 六档判定 + ship 建议 + exit code 路由,与 HTML 报告 verdict pill 共享规则 |
96
93
  | **六维评估** | 事实 / 行为 / LLM 评价 / 成本 / 效率 / 稳定性独立展示 |
97
- | **统计严谨性** | Bootstrap CI / Krippendorff α / Length-debias / Saturation curve |
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
- | **用例设计科学性 (sample design science)** | Sample schema 加 `capability` / `difficulty` / `construct` / `provenance` 元数据字段(HF Dataset Cards 风)。`bench diagnose` 输出 coverage 分桶 + 检测 `rubric_clarity_low` / `capability_thin` 两类新 issue。`bench gen-samples` 自动给生成的 sample 打 provenance。详见 [docs/sample-design-spec.md](docs/sample-design-spec.md),含 8 条行业 gap(HELM / MMLU-Pro / Construct Validity / IRT / Dataset Cards / Adversarial)的 omk v1 映射 |
100
- | **Verdict 一行结论** | `omk bench verdict <id>` 六档判定 + ship 建议 + exit code 路由,与 HTML 报告 verdict pill 共享规则 |
101
- | **RAG metrics** | `faithfulness` / `answer_relevancy` / `context_recall` 三 metric — 反幻觉 + 切题度 + context 覆盖,自动继承 length-debias |
102
- | **样本质量诊断** | `omk bench diagnose <id>` 7 类 issue(区分度低 / 重复 / 歧义 / 成本异常 / 全 fail 等)+ healthScore 0-100 |
103
- | **失败聚类 + 根因** | `omk bench failures <id>` 单 LLM 调用聚类失败样本 + 每 cluster 给修复建议 |
104
- | **预算硬阈值** | `--budget-usd / --budget-per-sample-usd / --budget-per-sample-ms` 总成本 + 单样本成本/耗时上限,超出中止保留 partial report |
105
- | **多执行器** | 支持 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 映射 |
106
103
  | **多评委 ensemble** | `--judge-models claude:opus,openai:gpt-4o` 跨厂商评分 + agreement 度量 |
107
104
  | **MCP URL 获取** | 通过 MCP Server 获取私有文档 URL 内容(SSO 保护的知识库等) |
108
105
  | **盲测 A/B** | `--blind` 隐藏变体名称,HTML 报告有揭晓按钮 |
109
- | **并行执行** | `--concurrency N` 并行 N 个任务 |
110
106
  | **多轮方差分析** | `--repeat N` 重复 N 次,计算均值/标准差/置信区间/t 检验 |
111
- | **自动分析** | 检测低区分度断言、均匀分数、全通过/全失败、高成本样本 |
107
+ | **并行执行** | `--concurrency N` 并行 N 个任务 |
108
+ | **断言取反 + 组合** | 通用 `not: true` 字段 + `assert-set` (any/all) 任意嵌套 |
109
+ | **自动分析** | 检测低区分度断言、均匀分数、全通过/全失败、高成本用例 |
112
110
  | **可追溯性** | 报告含 CLI 版本、Node 版本、artifact 版本指纹、judge prompt hash |
113
111
  | **中英切换** | HTML 报告右上角一键切换语言 |
114
112
 
@@ -133,7 +131,7 @@ flowchart TD
133
131
  end
134
132
 
135
133
  subgraph Exec["④ 执行器(固定模型)"]
136
- E["claude / claude-sdk / openai / gemini<br/>anthropic-api / openai-api / 自定义命令"]
134
+ E["claude / claude-sdk / codex / openai / gemini<br/>anthropic-api / openai-api / 自定义命令"]
137
135
  T["claude-sdk 抽取<br/>turns / toolCalls trace"]
138
136
  E -.-> T
139
137
  end
@@ -370,7 +368,7 @@ omk bench run [选项]
370
368
  --skill-dir <路径> artifact 目录(默认:skills)
371
369
  --control <expr> 对照组变体表达式(experiment role = control)
372
370
  --treatment <v1,v2> 实验组变体表达式,逗号分隔
373
- 除非用 --config 或 --each,--control / --treatment 两者至少传一个
371
+ 除非用 --config 或 --batch,--control / --treatment 两者至少传一个
374
372
  特殊值:baseline(空 artifact)、git:name(git 历史版本)、
375
373
  git:ref:name(指定 commit)、含 / 的路径(直接读取文件)
376
374
  --config <路径> YAML/JSON 配置文件(evaluation-as-code);在一个文件里声明
@@ -391,7 +389,7 @@ omk bench run [选项]
391
389
  (默认:当前目录的 .mcp.json)
392
390
  --no-serve 评测完成后不自动启动报告服务
393
391
  --verbose 打印每个样本的详细执行结果(耗时、tokens、输出预览)
394
- --each 批量评测:每个 artifact 独立和 baseline 对比
392
+ --batch 批量评测:每个 artifact 独立和 baseline 对比
395
393
  需要每个 artifact 配对 {name}.eval-samples.json
396
394
  --judge-repeat <n> 每条 sample × dimension 跑 LLM 评委 N 次,输出 stddev (评委自一致性)
397
395
  --judge-models <list> 多评委 ensemble: "executor1:model1,executor2:model2"
@@ -413,9 +411,9 @@ omk bench run [选项]
413
411
 
414
412
  **和 `cost_max` / `latency_max` 断言的区别**: 断言是**单样本评分维度**(超出直接打 0 分,run 继续);budget 是**工作流级硬阈值**(`totalUSD` 超出整个 run abort 保留 partial report,per-sample 超出该样本失败但 run 继续)。一个回答"质量是否达标",一个回答"花钱/时间是否在预算内"。
415
413
 
416
- ### `omk bench run --each`(批量评测)
414
+ ### `omk bench run --batch`(批量评测)
417
415
 
418
- 当 skills/ 下放了多个**独立的** artifact 时,使用 `--each` 逐个评测,每个 artifact 独立和 baseline 对比,生成一份合并报告。
416
+ 当 skills/ 下放了多个**独立的** artifact 时,使用 `--batch` 逐个评测,每个 artifact 独立和 baseline 对比,生成一份 BatchEvaluationReport,内部索引多个 child EvaluationReport。
419
417
 
420
418
  ```
421
419
  skills/
@@ -435,8 +433,8 @@ skills/
435
433
  - 没有配对 eval-samples 的 artifact 会被跳过并打印警告
436
434
 
437
435
  ```bash
438
- omk bench run --each
439
- omk bench run --each --dry-run
436
+ omk bench run --batch
437
+ omk bench run --batch --dry-run
440
438
  ```
441
439
 
442
440
  ### `omk bench gen-samples`(生成测评用例)
@@ -448,7 +446,7 @@ omk bench run --each --dry-run
448
446
  omk bench gen-samples skills/my-skill.md
449
447
 
450
448
  # 为 skills/ 下所有缺少测试集的 artifact 批量生成
451
- omk bench gen-samples --each
449
+ omk bench gen-samples --batch
452
450
 
453
451
  # 指定生成数量
454
452
  omk bench gen-samples skills/my-skill.md --count 10
@@ -457,10 +455,10 @@ omk bench gen-samples skills/my-skill.md --count 10
457
455
  选项:
458
456
 
459
457
  ```
460
- --each 为所有缺少 eval-samples 的 artifact 批量生成
458
+ --batch 为所有缺少 eval-samples 的 artifact 批量生成
461
459
  --count <n> 每个 artifact 生成的样本数(默认:5)
462
460
  --model <名称> 生成用的模型(默认:sonnet)
463
- --skill-dir <路径> artifact 目录(默认:skills),配合 --each 使用
461
+ --skill-dir <路径> artifact 目录(默认:skills),配合 --batch 使用
464
462
  ```
465
463
 
466
464
  ### `omk bench evolve`(自我循环改进)
@@ -664,13 +662,16 @@ omk analyze ~/.claude/projects/my-project --kb /path/to/project
664
662
  |--------|----------|------|
665
663
  | `claude` | 默认 | 通过 `claude -p` 调用 Claude CLI |
666
664
  | `claude-sdk` | 结构化输出 | 通过 Claude Agent SDK 调用,无 stdout 解析,避免 buffer 截断 |
667
- | `openai` | 跨厂商对比 | 通过 `openai api` CLI 调用 |
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 不报** |
668
667
  | `gemini` | 跨厂商对比 | 通过 `gemini` CLI 调用 |
669
668
  | `anthropic-api` | 无需 CLI | 直接调用 Anthropic HTTP API(需 `ANTHROPIC_API_KEY`) |
670
669
  | `openai-api` | 无需 CLI | 直接调用 OpenAI HTTP API(需 `OPENAI_API_KEY`) |
671
670
 
672
671
  API 直调执行器支持通过环境变量自定义 Base URL:`ANTHROPIC_BASE_URL`、`OPENAI_BASE_URL`。
673
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
+
674
675
  ### 自定义执行器
675
676
 
676
677
  任何 shell 命令都可以作为执行器,通过 stdin/stdout JSON 协议通信:
@@ -714,7 +715,7 @@ skills/
714
715
  | `./path/to/file.md` | 含 `/` 的路径,直接读取文件作为 artifact |
715
716
  | `variant@/path/to/project` | 给任意变体附加运行目录,支持 `name@cwd`、`git:name@cwd`、`/file.md@cwd` |
716
717
 
717
- `--control` 和 `--treatment` 都不传时,用 `--config eval.yaml` 或 `--each`。`--each` 模式下会自动用 `baseline` 作对照组,每个被发现的 artifact 作实验组。
718
+ `--control` 和 `--treatment` 都不传时,用 `--config eval.yaml` 或 `--batch`。`--batch` 模式下会自动用 `baseline` 作对照组,每个被发现的 artifact 作实验组。
718
719
 
719
720
  ```bash
720
721
  # 显式:一个 control,一个或多个 treatment
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Auto-analysis: detect patterns and generate insights from evaluation results.
3
3
  */
4
- import type { Report, AnalysisResult, Sample, SampleQualityAggregate } from '../types/index.js';
4
+ import type { Report, AnalysisResult, Sample, SampleQualityAggregate, Lang } from '../types/index.js';
5
5
  /** opts for `analyzeResults`. Optional because most older callers don't have
6
6
  * samples in scope; new callers (evaluation-pipeline / evolver) pass them in to
7
7
  * populate `analysis.sampleQuality`. */
@@ -10,7 +10,7 @@ export interface AnalyzeResultsOptions {
10
10
  samples?: Sample[];
11
11
  }
12
12
  /**
13
- * Analyze an evaluation report and produce insights + suggestions.
13
+ * Analyze an evaluation report and produce structured insights.
14
14
  */
15
15
  export declare function analyzeResults(report: Report, opts?: AnalyzeResultsOptions): AnalysisResult;
16
16
  /**
@@ -30,4 +30,5 @@ export declare function analyzeResults(report: Report, opts?: AnalyzeResultsOpti
30
30
  * in grading / judge / verdict. See docs/sample-design-spec.md.
31
31
  */
32
32
  export declare function buildSampleQualityAggregate(samples: Sample[]): SampleQualityAggregate;
33
+ export declare function generateAnalysisSummary(report: Report, lang?: Lang): string | undefined;
33
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,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAGtH;;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"}
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"}