You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Erstelle CompileAndRun als neuen Scorer in cmd/sin-code/internal/evalharness/scorer.go, basierend auf ponytail's correctness.js-Gate (https://github.com/DietrichGebert/ponytail/blob/main/benchmarks/README.md:69-79):
correctness.js extracts fenced code blocks and runs per-task checks (spawns Python/Node for email, debounce, CSV; structural regex for React and FastAPI). A broken one-liner that scores great on LOC will fail on correctness.
Scorer-Logik:
Extrahiere Code-Block aus Output.Text
Compile (z. B. go build, python -m py_compile, tsc)
Führe Self-Check aus (z. B. assert, __main__-Block, kleiner Test)
Score: 1.0 wenn compile + run OK, 0.0 sonst
Boundary: Self-Check ist das Minimum, nicht das Maximum. Nicht-Lazy-Score = 0.5, ohne Self-Check = 0.0 (Compile allein reicht nicht).
Motivation
ponytail's benchmarks/README.md:69-79 definiert ein Korrektheits-Gate, das verhindert, dass triviale kaputte Lösungen als "winning" gewertet werden:
A broken one-liner that scores great on LOC will fail on correctness.
Das ist exakt die Lücke, die unser aktueller Eval-Harness hat:
ExactMatch (evalharness/scorer.go:14-24): zu starr für Code
ContainsAll (evalharness/scorer.go:27-55): funktional, aber prüft nicht Ausführung
SuccessFlag (evalharness/scorer.go:59+): prüft nicht Korrektheit
Beispiel: Ein Eval-Case "Schreibe eine FizzBuzz-Funktion":
ContainsAll("fizz", "buzz") → Score 1.0, auch wenn der Code def fizzbuzz(): return "fizz" macht
Was fehlt: Ein Scorer, der kompilierten Code ausführt und auf Korrektheit prüft.
Was ponytail genau macht
Aus https://github.com/DietrichGebert/ponytail/blob/main/benchmarks/README.md:69-79:
File
Metric
Behavior
loc.js
loc
Measurement - always passes, records line count
correctness.js
correct
Gate - fails if generated code doesn't work
correctness.js extracts fenced code blocks and runs per-task checks (spawns Python/Node for email, debounce, CSV; structural regex for React and FastAPI). A broken one-liner that scores great on LOC will fail on correctness.
Plus:
Note: The React countdown and FastAPI rate-limit checks are keyword/structural only (no runtime execution), so they verify plausible structure rather than full correctness. The email, debounce, and CSV checks execute the code.
→ Hybrid: manche Tasks haben echte Code-Execution, manche nur strukturelle Validierung.
Aus https://github.com/DietrichGebert/ponytail/blob/main/CLAUDE.md:
Trivial one-liners need no test, YAGNI applies to tests too.
→ Wichtig: Bei trivialem One-Liner (z. B. dict(zip(keys, values))) brauchen wir keinen Test, weil der Code selbsterklärend ist. Erst bei nicht-trivialer Logik verlangen wir einen Self-Check.
Summary
Erstelle
CompileAndRunals neuen Scorer incmd/sin-code/internal/evalharness/scorer.go, basierend auf ponytail'scorrectness.js-Gate (https://github.com/DietrichGebert/ponytail/blob/main/benchmarks/README.md:69-79):Scorer-Logik:
Output.Textgo build,python -m py_compile,tsc)__main__-Block, kleiner Test)Boundary: Self-Check ist das Minimum, nicht das Maximum. Nicht-Lazy-Score = 0.5, ohne Self-Check = 0.0 (Compile allein reicht nicht).
Motivation
ponytail's
benchmarks/README.md:69-79definiert ein Korrektheits-Gate, das verhindert, dass triviale kaputte Lösungen als "winning" gewertet werden:Das ist exakt die Lücke, die unser aktueller Eval-Harness hat:
ExactMatch(evalharness/scorer.go:14-24): zu starr für CodeContainsAll(evalharness/scorer.go:27-55): funktional, aber prüft nicht AusführungSuccessFlag(evalharness/scorer.go:59+): prüft nicht KorrektheitBeispiel: Ein Eval-Case "Schreibe eine FizzBuzz-Funktion":
ContainsAll("fizz", "buzz")→ Score 1.0, auch wenn der Codedef fizzbuzz(): return "fizz"machtCompileAndRun(language="python", self_check="assert fizzbuzz(15) == 'FizzBuzz'")→ Score 0.0ponytail's Benchmark-Ergebnisse (mit Korrektheits-Gate):
Ohne Korrektheits-Gate wären die Zahlen irreführend: man könnte 1-Zeilen-Code schreiben, der "fizz" enthält, aber nicht funktioniert.
Current State in SIN-Code
cmd/sin-code/internal/evalharness/scorer.goScorer-Interface,ExactMatch,ContainsAll,SuccessFlagcmd/sin-code/internal/evalharness/types.goEvalCase,EvalSet,Output,Subject,Resultcmd/sin-code/eval_cmd.gosin-code eval run --dataset <path>cmd/sin-code/internal/evalharness/evalharness_test.goWas fehlt: Ein Scorer, der kompilierten Code ausführt und auf Korrektheit prüft.
Was ponytail genau macht
Aus
https://github.com/DietrichGebert/ponytail/blob/main/benchmarks/README.md:69-79:Plus:
→ Hybrid: manche Tasks haben echte Code-Execution, manche nur strukturelle Validierung.
Aus
https://github.com/DietrichGebert/ponytail/blob/main/CLAUDE.md:→ Wichtig: Bei trivialem One-Liner (z. B.
dict(zip(keys, values))) brauchen wir keinen Test, weil der Code selbsterklärend ist. Erst bei nicht-trivialer Logik verlangen wir einen Self-Check.Detailed Implementation Plan
Phase 1 — Scorer-Implementation
Erweitere
cmd/sin-code/internal/evalharness/scorer.goum:Helper-Funktionen
cmd/sin-code/internal/evalharness/runner_extras.go:compile: spawntgo build,python -m py_compile,tsc,bash -nje nach Languagerun: spawnt den Code + Self-Check in einer Subshell mit Timeoutcmd/execmitcontext.WithTimeoutPhase 2 — Sandbox & Safety
Sandboxed Execution (
cmd/sin-code/internal/sandbox/):network,filesystemwrites outside/tmp/sin-eval-*--timeout 30s--max-memory 256MB(per cgroup oderulimit)Resource-Cleanup:
t.Cleanuplöscht/tmp/sin-eval-*nach jedem TestPhase 3 — Integration in Evalharness
CLI-Erweiterung in
cmd/sin-code/eval_cmd.go:sin-code eval run --dataset x.json --scorer compile-and-run --language gosin-code.toml(Issue feat(agent): add verbosity/compression mode (terse/ultra) with system-prompt injection #167)sin-code eval run --scorer compile-and-run --skip-test(YAGNI-Mode)JSON-Schema-Erweiterung (
cmd/sin-code/internal/dataset/dataset.go):{ "cases": [ { "id": "fizzbuzz", "prompt": "Write FizzBuzz in Python", "expected": "", "scorer": { "type": "compile_and_run", "language": "python", "self_check": "assert fizzbuzz(15) == 'FizzBuzz'", "skip_test": false } } ] }Phase 4 — Benchmarks
Three-Arm-Benchmark (Issue feat(eval): three-arm eval harness (baseline/terse/<skill>) with --compare and snapshot round-trip #171 erweitern):
__baseline__,__terse__,<skill>,__lazy__(NEU, mitskill-code-lazyaus Issue feat(skill): add skill-code-lazy bundled skill (SIN-Code variant of ponytail, respects M3 verify-first) #178)Vergleichsmatrix (Issue feat(eval): three-arm eval harness (baseline/terse/<skill>) with --compare and snapshot round-trip #171, Phase 5):
https://github.com/DietrichGebert/ponytail/blob/main/benchmarks/README.md:34-58)Phase 5 — Tests
Unit-Test
scorer_compile_run_test.go:Sandbox-Test
sandbox_test.go:socket.connect~/schreibenRace-Test:
go test -race -count=1 ./cmd/sin-code/internal/evalharness/...Phase 6 — Docs
docs/compile-and-run-scorer.md: Schema, Beispiele, Sandbox-Garantien.AGENTS.md§14.3 (Eval-Harness): fügeCompileAndRun-Scorer hinzu.BACKLOG.md: done.CHANGELOG.mdUnreleased-Section.Acceptance Criteria
cmd/sin-code/internal/evalharness/scorer.goenthältCompileAndRun-Scorergo,python,javascript,bashinternal/sandbox/)SkipTest-Mode für triviale One-Liner (YAGNI für Tests)docs/compile-and-run-scorer.mdexistiert-racegolangci-lint,govulncheck,gosec(SARIF) grünRisk and Rollback
sandbox-exec(macOS), strikter Whitelist.~/). Mitigation: Sandbox-Block für alles außer/tmp/sin-eval-*.References