Eval-Gerüst gegen aufgezeichnete Antworten #10

Merged
torben merged 9 commits from 4-eval-harness into main 2026-12-02 18:40:45 +00:00
Owner

Closes #4

Zusammenfassung

uv run chemenu-eval evals/<satz> bewertet einen Eval-Satz gegen aufgezeichnete Modellantworten, ohne Netz und ohne API-Schlüssel. Ergebnis je Fall, Summenzeile; Exit 0 bestanden, 1 nicht bestanden, 2 Satz nicht ladbar oder Aufruf falsch. Die CI führt den Beispiel-Satz als eigenen Schritt aus.

Je Commit:

  • Add ADR 0002 on the eval harness: Lage als eigenes Paket chemenu.evals neben den Schichten, Ausgabeschema als pydantic-Modell (strict), Sätze als YAML; Eintrag in docs/architecture.md, Glossar „Ausgabemodell“, „Prüfung“.
  • Add pydantic dependency
  • Add eval types and hard graders: Typen, equals/contains an JSON-Pointern (typtreu, bool ≠ int), score_case mit strikter Validierung über Aliase; Schemafehler einzeilig ohne Doku-Links.
  • Add PyYAML and its type stubs for the eval loader
  • Add eval set and recorded response loader: YAML-Loader mit nur YAML-1.2-Booleans (no bleibt String), BOM toleriert; jede Ladeursache wird EvalSetError mit Datei; Fall-Dateien ohne id-Feld, nur *.yaml in cases/; unlesbare Aufzeichnung wird ResponseError.
  • Add eval runner, report and chemenu-eval command: Lauf, Bericht, Exit-Codes; unlesbare Aufzeichnung ergibt eine FAIL-Zeile statt Traceback.
  • Add example eval set and its test: drei Fälle eines Entitäten-Beispielschritts.
  • Run the example eval set in CI: Schritt Evals nach Pytest, sonst unverändert.
  • Document the eval command in CLAUDE.md and eval-runner: Kommando in CLAUDE.md (Kommandos und, über den Slice hinaus, eine Zeile in „Aufbau“), eval-runner nennt das Kommando.

Abweichungen vom Entwurf aus der Gegenprüfung (Reviewer, /code-review): id-Feld in Fall-Dateien abgelehnt; typtreuer Vergleich; YAML-1.2-Booleans; Pointer gegen Alias-Namen; ResponseError im ResponseSource-Vertrag; Nicht-.yaml-Dateien in cases/ sind ein Ladefehler.

Prüfnachweis

$ uv run chemenu-eval evals/example
PASS  de-no-entities  1.00
PASS  de-person-place  1.00
PASS  en-organisation  1.00
example: 3/3 passed, mean 1.00, threshold 1.0
exit=0

Lokal: pre-commit alle Hooks grün, pyright 0 errors, pytest 49 passed; jeder Commit einzeln grün (git rebase origin/main --exec …). CI: siehe Checks am PR.

🤖 Generated with Claude Code

Closes #4 ## Zusammenfassung `uv run chemenu-eval evals/<satz>` bewertet einen Eval-Satz gegen aufgezeichnete Modellantworten, ohne Netz und ohne API-Schlüssel. Ergebnis je Fall, Summenzeile; Exit 0 bestanden, 1 nicht bestanden, 2 Satz nicht ladbar oder Aufruf falsch. Die CI führt den Beispiel-Satz als eigenen Schritt aus. Je Commit: - **Add ADR 0002 on the eval harness**: Lage als eigenes Paket `chemenu.evals` neben den Schichten, Ausgabeschema als pydantic-Modell (strict), Sätze als YAML; Eintrag in `docs/architecture.md`, Glossar „Ausgabemodell“, „Prüfung“. - **Add pydantic dependency** - **Add eval types and hard graders**: Typen, `equals`/`contains` an JSON-Pointern (typtreu, bool ≠ int), `score_case` mit strikter Validierung über Aliase; Schemafehler einzeilig ohne Doku-Links. - **Add PyYAML and its type stubs for the eval loader** - **Add eval set and recorded response loader**: YAML-Loader mit nur YAML-1.2-Booleans (`no` bleibt String), BOM toleriert; jede Ladeursache wird `EvalSetError` mit Datei; Fall-Dateien ohne `id`-Feld, nur `*.yaml` in `cases/`; unlesbare Aufzeichnung wird `ResponseError`. - **Add eval runner, report and chemenu-eval command**: Lauf, Bericht, Exit-Codes; unlesbare Aufzeichnung ergibt eine FAIL-Zeile statt Traceback. - **Add example eval set and its test**: drei Fälle eines Entitäten-Beispielschritts. - **Run the example eval set in CI**: Schritt `Evals` nach `Pytest`, sonst unverändert. - **Document the eval command in CLAUDE.md and eval-runner**: Kommando in `CLAUDE.md` (Kommandos und, über den Slice hinaus, eine Zeile in „Aufbau“), `eval-runner` nennt das Kommando. Abweichungen vom Entwurf aus der Gegenprüfung (Reviewer, `/code-review`): `id`-Feld in Fall-Dateien abgelehnt; typtreuer Vergleich; YAML-1.2-Booleans; Pointer gegen Alias-Namen; `ResponseError` im `ResponseSource`-Vertrag; Nicht-`.yaml`-Dateien in `cases/` sind ein Ladefehler. ## Prüfnachweis ``` $ uv run chemenu-eval evals/example PASS de-no-entities 1.00 PASS de-person-place 1.00 PASS en-organisation 1.00 example: 3/3 passed, mean 1.00, threshold 1.0 exit=0 ``` Lokal: pre-commit alle Hooks grün, pyright 0 errors, pytest 49 passed; jeder Commit einzeln grün (`git rebase origin/main --exec …`). CI: siehe Checks am PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
torben added this to the M0 Fundament milestone 2026-12-02 17:10:41 +00:00
torben added the
kind
feature
label 2026-12-02 17:10:41 +00:00
torben added 9 commits 2026-12-02 17:10:41 +00:00
Record layout, output schema and set format decisions from #4, plus
architecture entry and glossary terms.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Needed for the typed eval specs and output models.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pure grading of recorded responses: equals and contains checks over
JSON Pointers, strict output-model validation, score per case.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Eval sets are YAML files; types-PyYAML keeps pyright strict.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
load_eval_set turns a set directory into an EvalSet; every load
failure becomes an EvalSetError naming the file. RecordedResponses
returns raw response text or None.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Scores each case against its recorded response, prints one line per case plus a summary, and exits 0, 1 or 2 (load error).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Three recorded cases for an entity-extraction step; threshold 1.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Separate Evals step after Pytest; other checks unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Document the eval command in CLAUDE.md and eval-runner
CI / checks (pull_request) Successful in 35s
ecba5f32a3
Replace the placeholder text now that chemenu-eval exists.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
torben merged commit 2c55a0b749 into main 2026-12-02 18:40:45 +00:00
torben deleted branch 4-eval-harness 2026-12-02 18:40:46 +00:00
Sign in to join this conversation.