Skip to content

Commit 29589bf

Browse files
committed
Add pack review smoke clean option
1 parent d6425f6 commit 29589bf

10 files changed

Lines changed: 64 additions & 11 deletions

File tree

.codex-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "skillbench",
3-
"version": "0.5.25",
3+
"version": "0.5.26",
44
"description": "Evaluate, compare, trace, and evolve Codex skills with eval cases, judge feedback, harness matrices, GEPA-style optimization, and optional Comet tracking.",
55
"author": {
66
"name": "helloJamest",

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,11 @@ python -m skillbench pack-review-smoke `
335335
examples\eval_packs\generic-skill-release.json `
336336
--review-dir .skillbench\pack-review-smoke `
337337
--bundle-output .skillbench\pack-review-bundle `
338+
--clean `
338339
--json
339340
```
340341

341-
This writes validation JSON, comparison JSON/Markdown, `pack_review_ci_result.json`, JUnit, SARIF, and a bundled dashboard for local inspection.
342+
This writes validation JSON, comparison JSON/Markdown, `pack_review_ci_result.json`, JUnit, SARIF, and a bundled dashboard for local inspection. Add `--clean` when repeated local runs should remove stale review and bundle artifacts before rebuilding.
342343

343344
Build one uploadable report bundle for CI artifacts or release evidence:
344345

ROADMAP.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,5 @@ SkillBench is moving from a working MVP toward a trustworthy, reproducible Agent
5959
- v0.5.23 shipped eval pack review report bundles and uploaded bundle artifacts from the pack checklist workflow.
6060
- v0.5.24 shipped release-quality docs for consuming eval pack review bundles from CI.
6161
- v0.5.25 shipped `skillbench pack-review-smoke` as a compact local command for producing eval pack review evidence bundles.
62-
- Next: add optional pack review bundle cleanup/retention controls for repeated local runs.
62+
- v0.5.26 shipped `pack-review-smoke --clean` for repeated local runs without stale artifacts.
63+
- Next: add richer pack review smoke summaries with top gate failures and artifact hints.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.25
1+
0.5.26

docs/eval-pack-review-bundles.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ To reproduce the CI evidence locally:
6868
```bash
6969
skillbench pack-review-smoke examples/eval_packs/generic-skill-smoke.json examples/eval_packs/generic-skill-release.json \
7070
--review-dir .skillbench/pack-review-smoke \
71-
--bundle-output .skillbench/pack-review-bundle
71+
--bundle-output .skillbench/pack-review-bundle \
72+
--clean
7273
```
7374

74-
The command above is equivalent to the expanded workflow below:
75+
Use `--clean` for repeated local runs so stale validation, comparison, JUnit, SARIF, or dashboard files do not survive from earlier smoke checks. The command above is equivalent to the expanded workflow below:
7576

7677
```bash
7778
mkdir -p .skillbench/pack-checklists

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "skillbench"
7-
version = "0.5.25"
7+
version = "0.5.26"
88
description = "Evaluate, compare, trace, and evolve Codex skills with eval cases, judge feedback, harness matrices, GEPA-style loops, and optional Comet tracking."
99
requires-python = ">=3.10"
1010
authors = [{ name = "SkillBench Contributors" }]

runtime/skillbench/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""SkillBench runtime package."""
22

3-
__version__ = "0.5.25"
3+
__version__ = "0.5.26"

runtime/skillbench/cli.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import argparse
44
import json
5+
import shutil
56
import sys
67
from pathlib import Path
78

@@ -206,6 +207,7 @@ def build_parser() -> argparse.ArgumentParser:
206207
pack_smoke_parser.add_argument("right", help="Candidate or release eval pack JSON.")
207208
pack_smoke_parser.add_argument("--review-dir", default=".skillbench/pack-review-smoke", help="Directory for intermediate validation, comparison, JUnit, SARIF, and CI artifacts.")
208209
pack_smoke_parser.add_argument("--bundle-output", default=".skillbench/pack-review-bundle", help="Directory for the generated report bundle.")
210+
pack_smoke_parser.add_argument("--clean", action="store_true", help="Remove the review and bundle output directories before writing new smoke artifacts.")
209211
pack_smoke_parser.add_argument("--json", action="store_true", help="Print machine-readable smoke result JSON.")
210212

211213
bundle_parser = sub.add_parser("bundle", help="Build a publishable report bundle with dashboard, PR comment, CI artifacts, and raw artifact manifests.")
@@ -686,6 +688,11 @@ def _case_selection_kwargs(args: argparse.Namespace) -> dict:
686688

687689
def _run_pack_review_smoke(args: argparse.Namespace) -> dict:
688690
review_dir = Path(args.review_dir)
691+
bundle_output = Path(args.bundle_output)
692+
if args.clean:
693+
_clean_output_dir(review_dir)
694+
if bundle_output.resolve() != review_dir.resolve():
695+
_clean_output_dir(bundle_output)
689696
review_dir.mkdir(parents=True, exist_ok=True)
690697

691698
left = Path(args.left)
@@ -736,11 +743,12 @@ def _run_pack_review_smoke(args: argparse.Namespace) -> dict:
736743
pack_review["artifacts"]["sarif_json"] = str(sarif_path)
737744
write_json(pack_review_path, pack_review)
738745

739-
bundle_manifest = build_report_bundle(review_dir, args.bundle_output)
746+
bundle_manifest = build_report_bundle(review_dir, bundle_output)
740747
return {
741748
"passed": bool(pack_review.get("passed")),
749+
"cleaned": bool(args.clean),
742750
"review_dir": str(review_dir),
743-
"bundle_output": str(Path(args.bundle_output)),
751+
"bundle_output": str(bundle_output),
744752
"left_validation": str(left_validation_path),
745753
"right_validation": str(right_validation_path),
746754
"comparison_json": str(comparison_json_path),
@@ -753,6 +761,17 @@ def _run_pack_review_smoke(args: argparse.Namespace) -> dict:
753761
}
754762

755763

764+
def _clean_output_dir(path: Path) -> None:
765+
target = path.resolve()
766+
if not target.exists():
767+
return
768+
if not target.is_dir():
769+
raise ValueError(f"Cannot clean non-directory path: {path}")
770+
if target.parent == target:
771+
raise ValueError(f"Refusing to clean filesystem root: {path}")
772+
shutil.rmtree(target)
773+
774+
756775
def _apply_agent_args(config: SkillBenchConfig, args: argparse.Namespace) -> None:
757776
if getattr(args, "agent_runner", None):
758777
config.agent_runner = args.agent_runner

skills/skillbench/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Use the SkillBench runtime to evaluate and evolve Codex skills.
1818
- `pack-checklist`: render a Markdown authoring checklist for reviewing an eval pack before CI.
1919
- `pack-compare`: compare eval pack versions for case and coverage changes, with optional removed-coverage CI gates.
2020
- `pack-review-artifacts`: build pack review CI result JSON, JUnit, and SARIF from eval pack review artifacts.
21-
- `pack-review-smoke`: run local pack review smoke from two eval packs and build the same evidence bundle used in CI.
21+
- `pack-review-smoke`: run local pack review smoke from two eval packs and build the same evidence bundle used in CI; add `--clean` for repeated local runs.
2222
- `list-cases`: inspect case IDs, tags, modes, and dimensions before filtering.
2323
- `eval`: score one candidate against an eval set.
2424
- `lift`: compare with-skill and without-skill runs to measure skill utility.

tests/test_skillbench_core.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,6 +2247,37 @@ def test_pack_review_smoke_cli_builds_review_bundle(tmp_path, capsys):
22472247
assert (bundle_dir / "skillbench-comment.md").exists()
22482248

22492249

2250+
def test_pack_review_smoke_cli_clean_removes_stale_outputs(tmp_path, capsys):
2251+
review_dir = tmp_path / "pack-review-smoke"
2252+
bundle_dir = tmp_path / "pack-review-bundle"
2253+
review_dir.mkdir()
2254+
bundle_dir.mkdir()
2255+
(review_dir / "stale.validation.json").write_text("{}", encoding="utf-8")
2256+
(bundle_dir / "stale.txt").write_text("old", encoding="utf-8")
2257+
2258+
exit_code = skillbench_main(
2259+
[
2260+
"pack-review-smoke",
2261+
str(GENERIC_SKILL_SMOKE_PACK),
2262+
str(EVAL_PACKS_DIR / "generic-skill-release.json"),
2263+
"--review-dir",
2264+
str(review_dir),
2265+
"--bundle-output",
2266+
str(bundle_dir),
2267+
"--clean",
2268+
"--json",
2269+
]
2270+
)
2271+
2272+
data = json.loads(capsys.readouterr().out)
2273+
assert exit_code == 0
2274+
assert data["cleaned"] is True
2275+
assert not (review_dir / "stale.validation.json").exists()
2276+
assert not (bundle_dir / "stale.txt").exists()
2277+
assert (review_dir / "pack_review_ci_result.json").exists()
2278+
assert (bundle_dir / "bundle_manifest.json").exists()
2279+
2280+
22502281
def test_report_bundle_reads_utf8_bom_external_ci_result_json(tmp_path, capsys):
22512282
exit_code = skillbench_main(
22522283
[

0 commit comments

Comments
 (0)