@dzhechkov/skills-bto 1.3.3 → 1.3.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzhechkov/skills-bto",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Build-Benchmark-Test-Optimize skill pack for Claude Code — deterministic benchmarking, quality gates, witness chain, judge attestation, and optimization",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -179,3 +179,10 @@ Each worker writes a log regardless of success:
179
179
  ## Reusability Note
180
180
  This template is artifact-type agnostic. Replace BASE_ARTIFACT_PATH and RUBRIC_PATH
181
181
  to optimize any text artifact: prompts, skills, presentations, research sections, code docstrings.
182
+
183
+ ## Hold-out validation (delegate to `dz bto-optimize`)
184
+ When `dz` is available, do NOT accept a variant on its tuning-set score alone. Split scenarios
185
+ (`dz bto-optimize --split`), score candidates on the tune set, validate the top candidate on the held-out set,
186
+ and call `dz bto-optimize --select` — it accepts a winner only if the weakest dimension improves on the HOLDOUT
187
+ with no regression elsewhere. This is the anti-Goodhart guard the heuristic loop lacks. See
188
+ `skills/bto/modules/optimize.md` → "Rigorous validation".
@@ -206,3 +206,11 @@ This command is also invoked internally by `/bto` as the final step (OPTIMIZE ph
206
206
  - Always save a `.pre-optimize.bak` backup before overwriting original
207
207
  - Round 3 evaluation must use Layer 2 (sonnet judges), not Layer 1 (haiku)
208
208
  - Preserve original artifact intent — optimization changes HOW, not WHAT
209
+
210
+ ## Rigorous validation (recommended when `dz` ≥ 0.3.119)
211
+
212
+ For a reproducible, budget-capped run that resists judge-gaming, follow the **"Rigorous validation (hold-out +
213
+ no-regress)"** protocol in `skills/bto/modules/optimize.md`: it splits scenarios into a tuning set and a held-out
214
+ set, tunes candidates on the tune set, and accepts a winner ONLY if it lifts the weakest dimension on the UNSEEN
215
+ holdout without regressing the others (`dz bto-optimize --split/--plan/--select`). Prose-only, diff-confirmed,
216
+ never auto-written. Absent `dz`, the heuristic evolutionary loop runs unchanged.
@@ -199,3 +199,46 @@ Stop optimization immediately if:
199
199
  2. Critical structural checks (Layer 0) fail on any variant
200
200
  3. Artifact semantics change fundamentally
201
201
  4. User requests stop
202
+
203
+ ---
204
+
205
+ ## Rigorous validation (hold-out + no-regress) — `dz bto-optimize` (when `dz` ≥ 0.3.119)
206
+
207
+ The evolutionary loop above SELECTS the highest score on the **same** eval it tuned on — which lets a variant
208
+ that flatters the judge panel (verbosity, buzzwords) win even if it doesn't help real users (**Goodhart**). When
209
+ the `dz` CLI is available, delegate the deterministic validation steps to it so acceptance is gated on **unseen**
210
+ scenarios with a **no-regress** guard and a **hard budget cap**. This strengthens the loop; it does not replace it.
211
+
212
+ **Scope (Phase-1):** only the **directive prose** of `SKILL.md` is mutated — the "when to activate" block + the
213
+ core instruction. Frontmatter, section headings, and examples are OFF-LIMITS (`--scope-check` rejects a candidate
214
+ that touches them). Never auto-write; the human confirms the diff.
215
+
216
+ Protocol (folds into the steps above):
217
+
218
+ 1. **Split** the BTO scenario ids into a tuning set and a held-out set (deterministic):
219
+ ```bash
220
+ dz bto-optimize --split --scenarios @scenarios.json --holdout 0.34 # → { tune:[...], holdout:[...] }
221
+ ```
222
+ 2. **Plan the budget** and respect the hard cap (the engine trims candidates/rounds to fit and reports it):
223
+ ```bash
224
+ dz bto-optimize --plan --candidates 5 --rounds 1 --tune <#tune> --holdout <#holdout> --max 24
225
+ ```
226
+ Never run more judge passes than the printed plan.
227
+ 3. **Tune** — generate the K prose candidates (existing strategies) and score each via the judge panel on the
228
+ **tune** scenarios ONLY. Record per-candidate per-dimension scores.
229
+ 4. **Validate** — score the top tune candidate(s) on the **holdout** scenarios (unseen).
230
+ 5. **Select** — the engine accepts a candidate ONLY if, on the holdout, the weakest dimension improves AND no
231
+ other dimension / the aggregate regresses (beyond `--tolerance`, default 0):
232
+ ```bash
233
+ dz bto-optimize --select --baseline @baseline.json --candidates @candidates.json # → { winner|null, reason }
234
+ ```
235
+ `baseline.json` = `{ "holdout": {<DimScores>} }`; each candidate = `{ id, prose, tune:{DimScores}, holdout:{DimScores} }`.
236
+ A tune-winner that regresses on the holdout is **rejected** — this is the anti-gaming guarantee.
237
+ 6. **Confirm gate** — show the prose diff + the tune/holdout deltas and let the human accept before any write:
238
+ ```bash
239
+ dz bto-optimize --scope-check --original SKILL.md --candidate candidate.md # prose-only guard
240
+ dz bto-optimize --diff --original SKILL.md --candidate candidate.md # the diff to confirm
241
+ ```
242
+
243
+ Grounded in dspy.ts MIPROv2 (propose → minibatch-tune → **validate on held-out** → best). Absent `dz` ⇒ fall
244
+ back to the heuristic loop above (unchanged).