anthropics / anthropics/claude-plugins-official

skill-creator: aggregate_benchmark.py silently zeroes total_tokens and hardcodes runs_per_configuration

Aberta Para iniciantes
#5,723 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
36.3k
Forks
4.1k
Merge médio
2d 14h
PRs com merge (30d)
539

Descrição

`skills/skill-creator/scripts/aggregate_benchmark.py` has two metric-corrupting bugs, both reproducible by reading the code:

**1. `total_tokens` is only read when timing is missing from grading.json** (~line 140). The token count lives inside the fallback branch:

```python
result["time_seconds"] = timing.get("total_duration_seconds", 0.0)
timing_file = run_dir / "timing.json"
if result["time_seconds"] == 0.0 and timing_file.exists():
...
result["time_seconds"] = timing_data.get("total_duration_seconds", 0.0)
result["tokens"] = timing_data.get("total_tokens", 0)
```

When `grading.json` carries timing (the normal case), the branch never runs and `tokens` stays 0 — the benchmark reports zero token cost with no warning. Fix: read `total_tokens` unconditionally from `timing.json` (or from grading.json's timing block if it carries one).

**2. `runs_per_configuration` is hardcoded to `3`** (~line 270, in `benchmark["metadata"]`), regardless of how many runs actually aggregated. Any benchmark run with a different N reports wrong metadata, and downstream variance analysis that trusts it divides by the wrong count. Fix: derive it from the runs actually collected.

Observed on plugin cache version `ed404106fcd8`, running benchmarks locally on real skills; both persisted across a plugin update.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Start with skills/skill-creator/scripts/aggregate_benchmark.py, reading the timing/grading parsing around line 140 and benchmark metadata construction around line 270. Run a local benchmark with grading.json timing present and with a run count other than three; done means the aggregated token total is populated and runs_per_configuration matches the runs collected.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
testing
Tipo de issue
Bug
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Ativa
Clareza
Claramente especificada
Facilidade para iniciantes
82/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.