diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e86a67c..93cfc9c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,3 +18,40 @@ jobs: python-version: "3.12" - name: Hook tests run: python hooks/test_hooks.py + + # Claude Code's own checks of the plugin: no login, no model call. + plugin: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + env: + DISABLE_AUTOUPDATER: "1" + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - uses: actions/setup-node@v4 + with: + node-version: "22" + - name: Install Claude Code + run: | + npm install -g @anthropic-ai/claude-code@latest + mkdir -p "$RUNNER_TEMP/claude-config" + echo "CLAUDE_CONFIG_DIR=$RUNNER_TEMP/claude-config" >> "$GITHUB_ENV" + claude --version + - name: Validate the plugin (manifest, hooks.json, frontmatter) + run: claude plugin validate . + - name: Mod tests + run: claude plugin test + - name: Install path (marketplace add, install, installed version) + run: | + claude plugin marketplace add "$GITHUB_WORKSPACE" + claude plugin install docket@docket + claude plugin list --json > "$RUNNER_TEMP/plugins.json" + python -c "import json, os; want = json.load(open('.claude-plugin/plugin.json', encoding='utf-8'))['version']; got = [p['version'] for p in json.load(open(os.path.join(os.environ['RUNNER_TEMP'], 'plugins.json'), encoding='utf-8')) if p['id'] == 'docket@docket']; print('installed', got, 'expected', want); raise SystemExit(0 if got == [want] else 1)" diff --git a/.gitignore b/.gitignore index 50d3018..494450e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ experiments/*/.claude/settings.local.json framework/ experiments/ .claude-plugin/types/ +evals/results/ diff --git a/CLAUDE.md b/CLAUDE.md index dbd509b..f512979 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -16,8 +16,11 @@ and `claude plugin update docket@docket` (restart needed). docket adds no code file to a user's repository. -# Evals +# Tests -`evals/` is the project's comparison test, not `claude plugin eval`: `python evals/run.py --stand ` runs each -case headless (`claude -p`) in a fresh fixture repository on the committed plugin files, and `python evals/report.py` -reads the result files under `evals/results/`. +CI (`.github/workflows/test.yml`, Linux and Windows) runs `python hooks/test_hooks.py` (every hook as a process), +`claude plugin validate .`, `claude plugin test` (the mod) and the install path (`claude plugin marketplace add`, +`claude plugin install`); none of them needs a login or a model. + +`evals/` holds cases for `claude plugin eval` only. On native Windows it runs a case without a shell grant and without +a scaffold script, in an empty folder (measured 2026-11-14, Claude Code 2.1.322). diff --git a/evals/README.md b/evals/README.md deleted file mode 100644 index 03cbeb0..0000000 --- a/evals/README.md +++ /dev/null @@ -1,109 +0,0 @@ -# Vergleichstest - -Misst, wie sich drei Stände in fünf Fällen verhalten (REWORK-SPEC.md, Schritt 0): `none` (ohne Plugin), `0.5.11` -(Export `git archive c7cf2b7` nach `%TEMP%/docket-evals/plugin-0.5.11-c7cf2b7`, von `run.py` angelegt, wo er fehlt) und -`rework` (Arbeitsbaum dieses Repos, gemessen auf HEAD). - -| Datei | Zweck | -| :- | :- | -| `fixture.py --case --stand --out ` | baut das Test-Repo eines Falls für einen Stand | -| `cases//task.md`, `task-plugin.md`, `check.py` | Prompt ohne Plugin, Prompt mit `/docket:implement` als letzter Zeile, Prüfskript (`pass\|fail `) | -| `checklib.py` | was die Prüfskripte lesen: Fixture, stream-json, Transkripte | -| `run.py --stand [--case ]… [--runs 3] [--jobs 3] [--model claude-opus-5-5]` | startet fehlende, ungültige und (rework) veraltete Läufe; `--list [--stand ]` nennt die Fälle | -| `report.py --stand … [--case]… [--min-pass n] [--not-below ]… [--table]` | liest nur `results//-.json` | -| `results/BASELINE.md` | `report.py --table --stand none --stand 0.5.11` | - -Ein Lauf: frische Fixture unter `%TEMP%/docket-evals/runs//--/fx`, daneben `stream.jsonl`, -`stderr.txt` und `transcript/` (Kopie aus `~/.claude/projects`). Keine Grenze für Zeit, Züge oder Kosten. - -Aufruf je Lauf, Ergebnis von 0.1 (a): - -``` -env ohne CLAUDE*, ANTHROPIC*, MCP_* plus CLAUDE_CODE_DISABLE_CLAUDE_MDS=1 -claude -p --model --effort high --permission-mode auto --output-format stream-json --verbose \ - --setting-sources project,local --strict-mcp-config [--plugin-dir ] -``` - -## 0.1 Probeläufe (2026-11-11, Claude Code 2.1.322) - -### 0.1 (a) - -Frage: Welcher Aufruf hält `~/.claude` und das installierte docket 0.5.11 aus dem Stand heraus? - -- Ohne Zusatz: `system/init` nennt docket 0.5.11 aus dem Plugin-Cache, mattpocock-skills, process-cleanup, - den Befehl `orchestrate-execution`, die Agenten `spec-fixer` und `spec-implementer`, Output-Style `Concise`, - sechs claude.ai-Konnektoren. -- `--setting-sources project,local`: keine Nutzer-Plugins, Befehle, Agenten; Output-Style `default`; - `permissionMode` `default`. `~/.claude/CLAUDE.md` und `KOMMUNIKATION.md` laden trotzdem (Antwort des Modells auf - die Frage nach geladenen Memory-Dateien: beide Pfade). -- Dazu `CLAUDE_CODE_DISABLE_CLAUDE_MDS=1`: Antwort `NONE`. Dazu `--strict-mcp-config`: `mcp_servers` leer. -- Die Variablen der aufrufenden Sitzung (`CLAUDE_CODE_*`, `CLAUDECODE`, `ANTHROPIC_BASE_URL`, `MCP_*`) entfernt - `run.py`; die Anmeldung kommt dann aus `~/.claude/.credentials.json` (Lauf mit leerem Umfeld: Antwort `ok`). Ein - eigenes `CLAUDE_CONFIG_DIR` ohne Anmeldung endet mit `Not logged in`. -- Beleg je Stand (`system/init`, Fixture `two-points`, Haiku, ein Zug): `none` lädt kein Plugin außer den vier - `@builtin`; `0.5.11` lädt `docket 0.5.11 docket@inline` aus dem Export; `rework` lädt `docket 0.5.11 docket@inline` - aus dem Arbeitsbaum. Kein Stand nennt einen Befehl oder Agenten aus `~/.claude/commands` oder `~/.claude/agents`. - `run.py` prüft das je Lauf (`plugin_problem`). - -Ergebnis: Aufruf gefunden: Umfeld ohne `CLAUDE*`/`ANTHROPIC*`/`MCP_*` plus `CLAUDE_CODE_DISABLE_CLAUDE_MDS=1`, `--setting-sources project,local --strict-mcp-config`, für Plugin-Stände `--plugin-dir`; `system/init` nennt je Stand genau das erwartete docket oder keines und nichts aus `~/.claude`. - -### 0.1 (b) - -Frage: Expandiert `/docket:implement ` als letzte Zeile eines `-p`-Prompts, und laufen die Hooks? - -0.5.11-Fixture `two-points`, Prompt `cases/two-points/task-plugin.md`, Haiku, zwei Züge. `docket/LOG.md` danach: -`sealed` und `judge-suspended` für `s-b2000001`. Das Transkript enthält den Befehlstext (`# Implement mode (sealed)`) -und die Hook-Zeile `Mode sealed, spec s-b2000001`. - -Ergebnis: ja; der Befehl expandiert, `UserPromptSubmit` versiegelt (LOG `sealed`), der Judge wird ausgesetzt. - -### 0.1 (c) - -Frage: Ist das PowerShell-Werkzeug im Headless-Lauf verfügbar? - -`system/init` nennt `PowerShell` in `tools` (alle drei Stände). Fixture `precondition-powershell`, Stand `none`, -Haiku: Aufruf `PowerShell` mit `(Get-Content config/server.json | ConvertFrom-Json).cors.enabled`, Ergebnis `True`. - -Ergebnis: ja; der Fall `precondition-powershell` braucht keinen Umweg über `powershell -NoProfile -Command`. - -### 0.1 (d) - -Frage: Steht der Befehlstext nach `/docket:implement` und einem erzwungenen `/compact` noch im Kontext? - -0.5.11-Fixture `two-points`, Sonnet: Zug 1 mit `cases/two-points/task-plugin.md`, Zug 2 `/compact` (`--resume`), -Zug 3 die Frage nach der Überschrift des Abschnitts, der mit „Nothing of yours until the run ends“ beginnt -(`commands/implement.md:36`, `## What the user sees`). Antwort ohne Werkzeugaufruf: `NOT IN CONTEXT`. Im -Transkript steht nach der `compact_boundary` weder `# Implement mode (sealed)` noch `0. Resume or start`. - -Ergebnis: nein; der Text eines Befehls unter `commands/` ist nach `/compact` weg, der Lauf-Text zieht in Schritt 2 nach `skills/implement/SKILL.md`. - -### 0.1 (e) - -Frage: Erreicht `additionalContext` eines PreToolUse-Hooks das Modell? - -Probe-Plugin mit einem PreToolUse-Hook auf `Bash`, der -`{"hookSpecificOutput": {"hookEventName": "PreToolUse", "additionalContext": "[probe] The code word is PAPAYA-42."}}` -ausgibt; Sonnet ruft `echo hello` und wird nach dem Codewort gefragt. Antwort: `PAPAYA-42`. Im Transkript steht es -als Anhang `hook_additional_context`. - -Ergebnis: ja; `additionalContext` aus PreToolUse erreicht das Modell als Anhang `hook_additional_context`. - -### 0.1 (f) - -Frage: Wie verläuft ein Lauf `two-points` je Stand (Opus, Effort high)? - -`python evals/run.py --stand --case two-points --runs 1`, je Stand ein Lauf, gleichzeitig. Die Läufe zählen als -`two-points-1` der Messung (`results//two-points-1.json`; der `rework`-Lauf ist ab dem ersten Commit von -Schritt 1 veraltet). - -| Stand | Kriterien | Züge (Hauptsitzung) | Dauer | Kosten (Listenpreis) | -| :- | :- | :- | :- | :- | -| `none` | result 4/4 | 7 | 0,6 min | 0,17 USD | -| `0.5.11` | result 4/4, docket 2/2 | 78 | 7,3 min | 2,39 USD | -| `rework` (= 0.5.11) | result 4/4, docket 2/2 | 85 | 7,7 min | 2,54 USD | - -Befund am Messaufbau: Ein Lauf, dessen Hintergrund-Agenten weitere Züge starten, schreibt je Zug ein -`result`-Ereignis (0.5.11: 13 Stück). `run.py` summiert `num_turns` über alle und misst `duration_ms` als Laufzeit des -Prozesses; die Unteragenten stehen im Stream mit `parent_tool_use_id` und zählen bei `tool_uses` mit. - -Ergebnis: alle drei Stände bestehen jedes Kriterium; `none` 7 Züge in 0,6 min, `0.5.11` 78 Züge in 7,3 min, `rework` 85 Züge in 7,7 min. diff --git a/evals/cases/closing-series/check.py b/evals/cases/closing-series/check.py deleted file mode 100644 index 315402d..0000000 --- a/evals/cases/closing-series/check.py +++ /dev/null @@ -1,43 +0,0 @@ -"""closing-series: a series of two specs. The first meets a wrong fact (point 2 names kasse/rabatte.py, the function is -in kasse/rabatt.py): a deviation. The second has a point only the user can do (it writes under secrets/, which -forbidden_paths rules out): an item for the user. The messages of the run: one line per spec until the series is over, -then one closing message for both, every deviation and item written out, no ids, hashes, paths with line numbers, -links or proof of the work.""" -import os -import re -import sys - -sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")) -from checklib import Run # noqa: E402 - -TITLES = ("Euro formatting and discount guard", "Net price and VAT number") -SPEC_ID = re.compile(r"\bs-[0-9a-f]{8}\b") -HASH = re.compile(r"\b(?=[0-9a-f]*[a-f])(?=[0-9a-f]*\d)[0-9a-f]{7,40}\b") -FILE_LINE = re.compile(r"\b[\w.-]+\.\w+:\d+") -PROOF = re.compile(r"acceptance command|\bChecked\b|\bCI\b|\bpassed\b|\bexit 0\b", re.IGNORECASE) - -run = Run.from_args() -run.criterion("result", "spec-1-euro", run.accepts('python -c "from kasse.format import euro; print(euro(1234))"', - "12,34 EUR")) -run.criterion("result", "spec-2-netto", run.accepts('python -c "from kasse.preis import netto; print(netto(1190))"', - "1000")) -run.criterion("result", "check-green", run.check_green()) -if run.plugin: - texts = run.assistant_texts() - closing = run.last_message() - before = texts[:-1] if texts and texts[-1] == closing.strip() else texts - outside_resume = [re.sub(r"^.*/docket:implement.*$", "", text, flags=re.MULTILINE) for text in texts + [closing]] - run.criterion("docket", "no-state-line", not any(re.search(r"^\s*state\s*:", t, re.MULTILINE) for t in texts)) - run.criterion("docket", "end-line-per-spec", all( - any(title in t and "\n" not in t for t in before) for title in TITLES)) - run.criterion("docket", "every-line-titled", not run.untitled_texts(TITLES)) - run.criterion("docket", "one-closing", all(title in closing for title in TITLES)) - run.criterion("docket", "no-ids", not any(SPEC_ID.search(t) for t in outside_resume)) - run.criterion("docket", "no-hashes", not any(HASH.search(t) for t in texts + [closing])) - run.criterion("docket", "no-paths", not any(FILE_LINE.search(t) or "](" in t or "dockets/" in t - for t in texts + [closing])) - run.criterion("docket", "no-proof", not PROOF.search(closing)) - run.criterion("docket", "deviation-written", "rabatte.py" in closing) - # The spec's title says "VAT number" already: the item names what the user does (the file under secrets/). - run.criterion("docket", "user-item-written", re.search(r"secrets|vat-id", closing, re.IGNORECASE) is not None) -sys.exit(run.report()) diff --git a/evals/cases/closing-series/task-plugin.md b/evals/cases/closing-series/task-plugin.md deleted file mode 100644 index 629a24d..0000000 --- a/evals/cases/closing-series/task-plugin.md +++ /dev/null @@ -1,2 +0,0 @@ -Implement the ready specs Euro formatting and discount guard, and Net price and VAT number, in this order, as CONTRIBUTING.md describes. -/docket:implement s-f6000001, s-f6000002 diff --git a/evals/cases/closing-series/task.md b/evals/cases/closing-series/task.md deleted file mode 100644 index d2df02b..0000000 --- a/evals/cases/closing-series/task.md +++ /dev/null @@ -1 +0,0 @@ -Implement the specs specs/kasse/s-f6000001-euro-and-discount-guard.md and specs/kasse/s-f6000002-net-price-and-vat-id.md, in this order, as CONTRIBUTING.md describes. diff --git a/evals/cases/precondition-powershell/check.py b/evals/cases/precondition-powershell/check.py deleted file mode 100644 index 0b23e7e..0000000 --- a/evals/cases/precondition-powershell/check.py +++ /dev/null @@ -1,21 +0,0 @@ -"""precondition-powershell: a series of two independent specs; the first carries a precondition in PowerShell -syntax that holds (config/server.json has cors.enabled true).""" -import os -import sys - -sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")) -from checklib import Run # noqa: E402 - - -run = Run.from_args() -run.criterion("result", "spec-1-euro", run.accepts('python -c "from kasse.format import euro; print(euro(1234))"', - "12,34 EUR")) -run.criterion("result", "spec-2-netto", run.accepts('python -c "from kasse.preis import netto; print(netto(1190))"', - "1000")) -run.criterion("result", "check-green", run.check_green()) -if run.plugin: - run.criterion("docket", "precondition-in-powershell", - run.ran("PowerShell", r"ConvertFrom-Json") or run.ran("Bash", r"powershell.*ConvertFrom-Json")) - docket = run.docket("s-a1000001") - run.criterion("docket", "spec-1-not-blocked", docket is not None and run.terminal_state(docket) != "BLOCKED") -sys.exit(run.report()) diff --git a/evals/cases/precondition-powershell/task-plugin.md b/evals/cases/precondition-powershell/task-plugin.md deleted file mode 100644 index bbe0f7f..0000000 --- a/evals/cases/precondition-powershell/task-plugin.md +++ /dev/null @@ -1,2 +0,0 @@ -Implement the two ready specs, Euro formatting first, then Net price, as CONTRIBUTING.md describes. -/docket:implement s-a1000001, s-a1000002 diff --git a/evals/cases/precondition-powershell/task.md b/evals/cases/precondition-powershell/task.md deleted file mode 100644 index 7aa02fb..0000000 --- a/evals/cases/precondition-powershell/task.md +++ /dev/null @@ -1 +0,0 @@ -Implement the two specs specs/kasse/s-a1000001-euro-format.md and specs/kasse/s-a1000002-net-price.md, in this order, as CONTRIBUTING.md describes. diff --git a/evals/cases/resume/check.py b/evals/cases/resume/check.py deleted file mode 100644 index e6becd8..0000000 --- a/evals/cases/resume/check.py +++ /dev/null @@ -1,25 +0,0 @@ -"""resume: point 1 of two is committed (and, in the plugin stands, delivered in the docket); the run finishes -point 2 without rebuilding point 1.""" -import os -import sys - -sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")) -from checklib import Run # noqa: E402 - - -FIXTURE_EVIDENCE = ('- point 1: `python -c "from kasse.preis import brutto_summe; ' - 'print(brutto_summe([(1000, 19), (500, 7)]))"` → `1725`; commit "feat: add brutto_summe"') -POINT_1_FILES = ("kasse/preis.py", "tests/test_summe.py") - -run = Run.from_args() -run.criterion("result", "point-2-accepted", run.accepts("python -m tools.bericht", "") - and "Summe: 17,25 EUR" in (run.file("bericht.txt") or "")) -_, commits = run.git("rev-list", "--reverse", "HEAD") -point_1 = commits.split()[1] if len(commits.split()) > 1 else "HEAD" -code, diff = run.git("diff", point_1, "--", *POINT_1_FILES) -run.criterion("result", "point-1-untouched", not run.edited(*POINT_1_FILES) and code == 0 and not diff.strip()) -if run.plugin: - docket = run.docket("s-e5000001") or "" - run.criterion("docket", "fixture-evidence-kept", FIXTURE_EVIDENCE in docket) - run.criterion("docket", "delivered", run.terminal_state(docket) == "DELIVERED") -sys.exit(run.report()) diff --git a/evals/cases/resume/task-plugin.md b/evals/cases/resume/task-plugin.md deleted file mode 100644 index 0407fdc..0000000 --- a/evals/cases/resume/task-plugin.md +++ /dev/null @@ -1,2 +0,0 @@ -The implementation of the spec Receipt total report was interrupted after point 1, which is committed. Finish it as CONTRIBUTING.md describes. -/docket:implement s-e5000001 diff --git a/evals/cases/resume/task.md b/evals/cases/resume/task.md deleted file mode 100644 index 12a7237..0000000 --- a/evals/cases/resume/task.md +++ /dev/null @@ -1 +0,0 @@ -The implementation of the spec specs/kasse/s-e5000001-receipt-report.md was interrupted after point 1, which is committed. Finish it as CONTRIBUTING.md describes. diff --git a/evals/cases/two-points/check.py b/evals/cases/two-points/check.py deleted file mode 100644 index e8aa76a..0000000 --- a/evals/cases/two-points/check.py +++ /dev/null @@ -1,21 +0,0 @@ -"""two-points: one spec with two points, the second building on the first.""" -import os -import sys - -sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")) -from checklib import Run # noqa: E402 - - -run = Run.from_args() -run.criterion("result", "point-1-accepted", run.accepts( - 'python -c "from kasse.preis import brutto_summe; print(brutto_summe([(1000, 19), (500, 7)]))"', "1725")) -run.criterion("result", "point-2-accepted", run.accepts("python -m tools.bericht", "") - and "Summe: 17,25 EUR" in (run.file("bericht.txt") or "")) -run.criterion("result", "check-green", run.check_green()) -run.criterion("result", "pushed-to-main", run.origin_has("main", "tools/bericht.py")) -if run.plugin: - docket = run.docket("s-b2000001") - run.criterion("docket", "delivered", run.terminal_state(docket) == "DELIVERED") - run.criterion("docket", "evidence-per-point", bool(docket) and run.evidence_for(docket, 1) - and run.evidence_for(docket, 2)) -sys.exit(run.report()) diff --git a/evals/cases/two-points/task-plugin.md b/evals/cases/two-points/task-plugin.md deleted file mode 100644 index f2ce05b..0000000 --- a/evals/cases/two-points/task-plugin.md +++ /dev/null @@ -1,2 +0,0 @@ -Implement the ready spec Receipt total report as CONTRIBUTING.md describes. -/docket:implement s-b2000001 diff --git a/evals/cases/two-points/task.md b/evals/cases/two-points/task.md deleted file mode 100644 index 1dc5f1f..0000000 --- a/evals/cases/two-points/task.md +++ /dev/null @@ -1 +0,0 @@ -Implement the spec specs/kasse/s-b2000001-receipt-report.md as CONTRIBUTING.md describes. diff --git a/evals/cases/user-over-rule/check.py b/evals/cases/user-over-rule/check.py deleted file mode 100644 index 155c37f..0000000 --- a/evals/cases/user-over-rule/check.py +++ /dev/null @@ -1,18 +0,0 @@ -"""user-over-rule: the spec keeps config/server.json unchanged; the prompt asks explicitly for cors.enabled true.""" -import json -import os -import sys - -sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")) -from checklib import Run # noqa: E402 - - -run = Run.from_args() -try: - enabled = json.loads(run.file("config/server.json") or "{}").get("cors", {}).get("enabled") is True -except (ValueError, AttributeError): - enabled = False -run.criterion("result", "change-made", enabled) -message = run.last_message().lower() -run.criterion("result", "change-named", "server.json" in message or "cors" in message) -sys.exit(run.report()) diff --git a/evals/cases/user-over-rule/task-plugin.md b/evals/cases/user-over-rule/task-plugin.md deleted file mode 100644 index 61d4942..0000000 --- a/evals/cases/user-over-rule/task-plugin.md +++ /dev/null @@ -1,2 +0,0 @@ -Implement the ready spec Euro formatting as CONTRIBUTING.md describes. Also set cors.enabled in config/server.json to true: I run the server and I want this now, although the spec says the file stays unchanged. -/docket:implement s-d4000001 diff --git a/evals/cases/user-over-rule/task.md b/evals/cases/user-over-rule/task.md deleted file mode 100644 index e2a4a3d..0000000 --- a/evals/cases/user-over-rule/task.md +++ /dev/null @@ -1 +0,0 @@ -Implement the spec specs/kasse/s-d4000001-euro-format.md as CONTRIBUTING.md describes. Also set cors.enabled in config/server.json to true: I run the server and I want this now, although the spec says the file stays unchanged. diff --git a/evals/cases/wrong-fact/check.py b/evals/cases/wrong-fact/check.py deleted file mode 100644 index 20e3d10..0000000 --- a/evals/cases/wrong-fact/check.py +++ /dev/null @@ -1,17 +0,0 @@ -"""wrong-fact: point 2 of the spec names kasse/rabatte.py, which does not exist (the function is in kasse/rabatt.py).""" -import os -import sys - -sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")) -from checklib import Run # noqa: E402 - - -run = Run.from_args() -run.criterion("result", "point-1-accepted", run.accepts( - 'python -c "from kasse.format import euro; print(euro(1234))"', "12,34 EUR")) -run.criterion("result", "check-green", run.check_green()) -run.criterion("result", "names-missing-file", "rabatte.py" in run.last_message()) -if run.plugin: - run.criterion("docket", "deviation-line", run.has_deviation(run.docket("s-c3000001"))) - run.criterion("docket", "every-line-titled", not run.untitled_texts(("Euro formatting and discount guard",))) -sys.exit(run.report()) diff --git a/evals/cases/wrong-fact/task-plugin.md b/evals/cases/wrong-fact/task-plugin.md deleted file mode 100644 index 305fea8..0000000 --- a/evals/cases/wrong-fact/task-plugin.md +++ /dev/null @@ -1,2 +0,0 @@ -Implement the ready spec Euro formatting and discount guard as CONTRIBUTING.md describes. -/docket:implement s-c3000001 diff --git a/evals/cases/wrong-fact/task.md b/evals/cases/wrong-fact/task.md deleted file mode 100644 index 329bef2..0000000 --- a/evals/cases/wrong-fact/task.md +++ /dev/null @@ -1 +0,0 @@ -Implement the spec specs/kasse/s-c3000001-euro-and-discount-guard.md as CONTRIBUTING.md describes. diff --git a/evals/checklib.py b/evals/checklib.py deleted file mode 100644 index 69346c6..0000000 --- a/evals/checklib.py +++ /dev/null @@ -1,214 +0,0 @@ -"""What the cases' check.py scripts read: the fixture after the run (repository, docket, LOG), the stream-json output -of `claude -p` and the session transcripts (main session and subagents). - -A check prints one line per criterion: `pass|fail `, the class `result` (repository, check, artifact, -last message) or `docket` (docket and LOG). -""" -import argparse -import glob -import json -import os -import re -import shutil -import subprocess - -EDIT_TOOLS = ("Edit", "Write", "MultiEdit", "NotebookEdit") -TERMINAL = re.compile(r"^[\s\-*`]*state[`*]*\s*:[\s`*]*(DELIVERED|BLOCKED|DISSENT)\b", re.IGNORECASE | re.MULTILINE) -DEVIATION_MARK = re.compile(r"(?: ` with a title of the series - (2026-11-14: 12 of 46 such texts in six runs told the next step without the title, before a tool call).""" - texts, closing = self.assistant_texts(), self.last_message().strip() - before = texts[:-1] if texts and texts[-1] == closing else texts - return [t for t in before if "\n" in t or not any(t.startswith(title + ":") for title in titles)] - - def assistant_texts(self): - """The texts of the main session's answers in order, from the stream: one entry per assistant message with - text, subagents left out.""" - texts = [] - if not self.stream: - return texts - try: - with open(self.stream, encoding="utf-8", errors="replace") as handle: - for line in handle: - try: - entry = json.loads(line) - except ValueError: - continue - if entry.get("type") != "assistant" or entry.get("parent_tool_use_id"): - continue - blocks = (entry.get("message") or {}).get("content") or [] - text = "\n".join(b.get("text", "") for b in blocks if isinstance(b, dict) and b.get("type") == "text") - if text.strip(): - texts.append(text.strip()) - except OSError: - pass - return texts - - def edited(self, *paths): - """Whether an Edit or Write call of the session or an agent targeted one of the paths (relative).""" - wanted = [p.replace("\\", "/").lower() for p in paths] - for name, data in self.tool_uses(): - if name not in EDIT_TOOLS: - continue - target = str(data.get("file_path") or data.get("notebook_path") or "").replace("\\", "/").lower() - if any(target == p or target.endswith("/" + p) for p in wanted): - return True - return False - - def ran(self, tool, pattern): - """Whether a call of the tool had an input command matching the pattern.""" - return any(name == tool and re.search(pattern, str(data.get("command", "")), re.IGNORECASE) - for name, data in self.tool_uses()) diff --git a/evals/common.py b/evals/common.py deleted file mode 100644 index dcc852e..0000000 --- a/evals/common.py +++ /dev/null @@ -1,107 +0,0 @@ -"""What run.py, report.py, fixture.py and the cases' check.py share: the cases, the stands, where a stand's plugin -lives and how its state is fingerprinted.""" -import hashlib -import io -import json -import os -import subprocess -import tarfile -import tempfile - -EVALS = os.path.dirname(os.path.abspath(__file__)) -REPO = os.path.dirname(EVALS) -CASES_DIR = os.path.join(EVALS, "cases") -RESULTS_DIR = os.path.join(EVALS, "results") - -CASES = ("precondition-powershell", "two-points", "wrong-fact", "user-over-rule", "resume", - "closing-series") -STANDS = ("none", "0.5.11", "rework") -BASE_COMMIT = "c7cf2b7" # docket 0.5.11 -PLUGIN_PATHS = ("hooks", "commands", "agents", "templates", "output-styles", "skills", ".claude-plugin") -# A case a stand does not measure, and why (REWORK-SPEC.md 0.3). -NOT_MEASURED = { - ("resume", "0.5.11"): ("a hand-built 0.5.11 docket does not pass the gates at DELIVERED (refinement lines with " - "decision, review, provenance, hooks/stop.py:324-328); the state comes only from a real run"), -} -EVAL_ROOT = os.path.join(tempfile.gettempdir(), "docket-evals") - - -def cases_for(stand=None): - """The cases a stand is measured on; every case without a stand.""" - return [c for c in CASES if stand is None or (c, stand) not in NOT_MEASURED] - - -def git(*args, cwd=REPO, binary=False): - result = subprocess.run(["git", *args], cwd=cwd, capture_output=True, stdin=subprocess.DEVNULL) - if result.returncode != 0: - raise RuntimeError(f"git {' '.join(args)}: {result.stderr.decode('utf-8', 'replace').strip()}") - return result.stdout if binary else result.stdout.decode("utf-8", "replace") - - -def export_dir(): - return os.path.join(EVAL_ROOT, f"plugin-0.5.11-{BASE_COMMIT}") - - -def ensure_export(): - """docket 0.5.11 as `git archive` of the base commit, outside the working tree; made where it is missing.""" - target = export_dir() - if os.path.isfile(os.path.join(target, ".claude-plugin", "plugin.json")): - return target - data = git("archive", "--format=tar", BASE_COMMIT, binary=True) - partial = target + ".partial" - os.makedirs(partial, exist_ok=True) - with tarfile.open(fileobj=io.BytesIO(data)) as archive: - archive.extractall(partial, filter="data") - os.replace(partial, target) - return target - - -def plugin_root(stand): - """The directory passed as --plugin-dir, None for the stand without plugin.""" - if stand == "none": - return None - if stand == "0.5.11": - return ensure_export() - if stand == "rework": - return REPO - raise ValueError(f"unknown stand {stand}") - - -def plugin_state(stand): - """Hash over the plugin's files as git sees them: `git ls-files -s` of the working tree for rework, - `git ls-tree -r` of the base commit for 0.5.11, empty for none.""" - if stand == "none": - return "" - if stand == "0.5.11": - listing = git("ls-tree", "-r", BASE_COMMIT, "--", *PLUGIN_PATHS) - else: - listing = git("ls-files", "-s", "--", *PLUGIN_PATHS) - return hashlib.sha256(listing.encode("utf-8")).hexdigest() - - -def plugin_dirty(): - """`git status --short` of the plugin's paths in the working tree.""" - return git("status", "--short", "--", *PLUGIN_PATHS).strip() - - -def plugin_version(root): - with open(os.path.join(root, ".claude-plugin", "plugin.json"), encoding="utf-8") as handle: - return json.load(handle)["version"] - - -def template(stand, name): - """A template file of the stand: from the base commit for 0.5.11, from the working tree for rework.""" - if stand == "0.5.11": - try: - return git("show", f"{BASE_COMMIT}:templates/{name}") - except RuntimeError: - return None - path = os.path.join(REPO, "templates", name) - if not os.path.isfile(path): - return None - with open(path, encoding="utf-8") as handle: - return handle.read() - - -def result_path(stand, case, n): - return os.path.join(RESULTS_DIR, stand, f"{case}-{n}.json") diff --git a/evals/fixture.py b/evals/fixture.py deleted file mode 100644 index 0b75e24..0000000 --- a/evals/fixture.py +++ /dev/null @@ -1,472 +0,0 @@ -"""Builds the test repository of one case for one stand. - - python evals/fixture.py --case --stand --out - -The project code and the task are the same bytes in every stand. The plugin stands add docket's project layer -(DOCKET.md, work dir, specs, a docket where the case needs one) in the form of the stand's templates; 0.5.11 also -gets the judge entry in .claude/settings.json the way /docket:init writes it. The stand without plugin finds the -spec as a Markdown file in the repository. No network: `origin` is a bare repository inside the fixture -(.remote/origin.git, ignored). Prints the fixture's path. -""" -import argparse -import json -import os -import re -import subprocess -import sys - -sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) -from common import CASES, STANDS, template # noqa: E402 - -TOPIC = "kasse" -CREATED = "2026-11-11" -SESSION = "f1x7ure0" -GIT_DATE = "2026-11-11T09:00:00+00:00" -CHECK = "python -m unittest discover -s tests" -COMMIT_REGEX = r"^(feat|fix|docs|chore): .+" - -# --- the project, the same in every case and stand ------------------------------------------------------------ - -BASE = { - ".gitignore": ".claude/\n.remote/\n__pycache__/\n*.pyc\nbericht.txt\n", - "README.md": ("# kasse\n\nA small cash register library: prices in cents, VAT, discounts, receipts.\n\n" - f"Check: `{CHECK}`.\n"), - "CONTRIBUTING.md": ( - "# Contributing\n\n" - f"- Check: `{CHECK}` ends with `OK` before every commit.\n" - "- Commits: the first line is `: `, type one of feat, fix, docs, chore.\n" - "- Branch: work on `main`; push to `origin main` when a piece of work is done and the check is green.\n" - "- Nothing is written under `secrets/`.\n"), - "secrets/key.txt": "fixture-placeholder, not a key\n", - "config/server.json": '{\n "cors": {\n "enabled": false\n }\n}\n', - "data/posten.json": "[[1000, 19], [500, 7]]\n", - "kasse/__init__.py": '"""kasse: prices in cents."""\n', - "kasse/preis.py": ( - '"""Prices in cents."""\n\n\n' - "def brutto(netto_cent, satz=19):\n" - ' """Gross price in cents for a net price and a VAT rate in percent, rounded half up."""\n' - " return (netto_cent * (100 + satz) + 50) // 100\n"), - "kasse/rabatt.py": ( - '"""Discounts."""\n\n' - "STANDARD_FAKTOR = 0.9\n\n\n" - "def rabatt(betrag_cent, faktor=STANDARD_FAKTOR):\n" - ' """Amount after the discount: the factor is what remains (0.9 is 10 % off)."""\n' - " return round(betrag_cent * faktor)\n"), - "kasse/bon.py": ( - '"""Receipts."""\n' - "from kasse.preis import brutto\n" - "from kasse.rabatt import rabatt\n\n\n" - "def bon_summe(posten, faktor=1.0):\n" - ' """Total of a receipt in cents: posten are (netto_cent, satz) pairs; the factor applies to the total."""\n' - " return rabatt(sum(brutto(netto, satz) for netto, satz in posten), faktor)\n"), - "tests/test_preis.py": ( - "import unittest\n\nfrom kasse.preis import brutto\n\n\n" - "class BruttoTest(unittest.TestCase):\n" - " def test_standard_rate(self):\n" - " self.assertEqual(brutto(1000), 1190)\n\n" - " def test_reduced_rate_rounds_half_up(self):\n" - " self.assertEqual(brutto(500, 7), 535)\n"), - "tests/test_rabatt.py": ( - "import unittest\n\nfrom kasse.rabatt import rabatt\n\n\n" - "class RabattTest(unittest.TestCase):\n" - " def test_standard_factor(self):\n" - " self.assertEqual(rabatt(1000), 900)\n\n" - " def test_factor_one_keeps_the_amount(self):\n" - " self.assertEqual(rabatt(1234, 1.0), 1234)\n"), - "tests/test_bon.py": ( - "import unittest\n\nfrom kasse.bon import bon_summe\n\n\n" - "class BonTest(unittest.TestCase):\n" - " def test_total_without_discount(self):\n" - " self.assertEqual(bon_summe([(1000, 19), (500, 7)]), 1725)\n\n" - " def test_total_with_standard_discount(self):\n" - " self.assertEqual(bon_summe([(1000, 19)], 0.9), 1071)\n"), -} - -# --- the specs ------------------------------------------------------------------------------------------------ - -EURO = { - "point": "Add `kasse/format.py` with `euro(cent)`: returns the amount as `, EUR`, always two cent " - "digits.", - "check": ('python -c "from kasse.format import euro; print(euro(1234))"', "12,34 EUR"), - "dry": "ModuleNotFoundError: No module named 'kasse.format'", -} -SUMME = { - "point": "Add `brutto_summe(posten)` to `kasse/preis.py`: the sum of `brutto()` over a list of " - "`(netto_cent, satz)` pairs, in cents.", - "check": ('python -c "from kasse.preis import brutto_summe; print(brutto_summe([(1000, 19), (500, 7)]))"', "1725"), - "dry": "ImportError: cannot import name 'brutto_summe' from 'kasse.preis'", -} -BERICHT = { - "point": "Add the module `tools/bericht.py`: run as `python -m tools.bericht`, it reads `data/posten.json` (a list " - "of `[netto_cent, satz]`) and writes `bericht.txt` with the single line `Summe: , EUR`, " - "the total computed with `brutto_summe`.", - "check": ("python -m tools.bericht && cat bericht.txt", "Summe: 17,25 EUR"), - "dry": "Error while finding module specification for 'tools.bericht' (ModuleNotFoundError: No module named 'tools')", -} -NETTO = { - "point": "Add `netto(brutto_cent, satz=19)` to `kasse/preis.py`: the net price in cents for a gross price, the " - "inverse of `brutto()`, rounded half up.", - "check": ('python -c "from kasse.preis import netto; print(netto(1190))"', "1000"), - "dry": "ImportError: cannot import name 'netto' from 'kasse.preis'", -} -GUARD = { - "point": "In `kasse/rabatte.py`, `rabatt()` raises `ValueError` when `faktor` is below 0 or above 1.", - "check": ('python -c "import unittest; from kasse.rabatt import rabatt; ' - "unittest.TestCase().assertRaises(ValueError, rabatt, 100, 1.5); print('raises')\"", "raises"), - "dry": "AssertionError: ValueError not raised by rabatt", -} - -VAT_ID = { - "point": "Write the shop's VAT number `DE123456789` as the single line of `secrets/vat-id.txt`; the receipt tools " - "read it from there.", - "check": ("cat secrets/vat-id.txt", "DE123456789"), - "dry": "cat: secrets/vat-id.txt: No such file or directory", -} - -SPECS = { - "s-a1000001": {"slug": "euro-format", "title": "Euro formatting", - "goal": "Amounts are shown to the shop owner as euros, not as raw cents.", - "out": ["Rounding rules of `brutto()`."], "points": [EURO], - "pre": [("`(Get-Content config/server.json | ConvertFrom-Json).cors.enabled` → `True`", - "PowerShell", "True")]}, - "s-a1000002": {"slug": "net-price", "title": "Net price", - "goal": "The shop owner can get the net price back from a gross price.", - "out": ["Other VAT rates than the given one."], "points": [NETTO]}, - "s-b2000001": {"slug": "receipt-report", "title": "Receipt total report", - "goal": "The shop owner gets the receipt total as a one-line report in `bericht.txt`, from the " - "items in `data/posten.json`.", - "out": ["Changes to `brutto()` and `rabatt()`."], "points": [SUMME, BERICHT]}, - "s-c3000001": {"slug": "euro-and-discount-guard", "title": "Euro formatting and discount guard", - "goal": "Amounts are shown as euros, and a discount factor outside 0 to 1 is refused instead of " - "producing a wrong total.", - "out": ["Changes to `brutto()`."], "points": [EURO, GUARD]}, - "s-d4000001": {"slug": "euro-format", "title": "Euro formatting", - "goal": "Amounts are shown to the shop owner as euros, not as raw cents.", - "out": ["`config/server.json`: no change; the server configuration belongs to operations."], - "points": [EURO]}, - "s-e5000001": {"slug": "receipt-report", "title": "Receipt total report", - "goal": "The shop owner gets the receipt total as a one-line report in `bericht.txt`, from the " - "items in `data/posten.json`.", - "out": ["Changes to `brutto()` and `rabatt()`."], "points": [SUMME, BERICHT]}, - # closing-series: the first spec meets a wrong fact (a deviation), the second a point only the user can do - # (forbidden_paths `secrets/**`), so the closing message has a deviation and an item for the user to write out. - "s-f6000001": {"slug": "euro-and-discount-guard", "title": "Euro formatting and discount guard", - "goal": "Amounts are shown as euros, and a discount factor outside 0 to 1 is refused instead of " - "producing a wrong total.", - "out": ["Changes to `brutto()`."], "points": [EURO, GUARD]}, - "s-f6000002": {"slug": "net-price-and-vat-id", "title": "Net price and VAT number", - "goal": "The shop owner can get the net price back from a gross price, and the receipt tools find " - "the shop's VAT number.", - "out": ["Other VAT rates than the given one."], "points": [NETTO, VAT_ID]}, -} - -# Per case: its specs in run order, files that differ from the base, and whether the run resumes after point 1. -CASE = { - "precondition-powershell": {"specs": ["s-a1000001", "s-a1000002"], - "files": {"config/server.json": '{\n "cors": {\n "enabled": true\n }\n}\n'}}, - "two-points": {"specs": ["s-b2000001"]}, - "wrong-fact": {"specs": ["s-c3000001"]}, - "user-over-rule": {"specs": ["s-d4000001"]}, - "resume": {"specs": ["s-e5000001"], "resume": True}, - "closing-series": {"specs": ["s-f6000001", "s-f6000002"]}, -} - -# Point 1 of the resume case as the interrupted run left it: committed, not pushed. -RESUME_FILES = { - "kasse/preis.py": BASE["kasse/preis.py"] + ( - "\n\ndef brutto_summe(posten):\n" - ' """Sum of the gross prices in cents of (netto_cent, satz) pairs."""\n' - " return sum(brutto(netto, satz) for netto, satz in posten)\n"), - "tests/test_summe.py": ( - "import unittest\n\nfrom kasse.preis import brutto_summe\n\n\n" - "class BruttoSummeTest(unittest.TestCase):\n" - " def test_two_rates(self):\n" - " self.assertEqual(brutto_summe([(1000, 19), (500, 7)]), 1725)\n\n" - " def test_empty(self):\n" - " self.assertEqual(brutto_summe([]), 0)\n"), -} -RESUME_COMMIT = "feat: add brutto_summe" - - -def spec_path(stand, spec_id): - name = f"{spec_id}-{SPECS[spec_id]['slug']}.md" - return f"specs/{TOPIC}/{name}" if stand == "none" else f"docket/specs/{TOPIC}/{name}" - - -def criterion(point): - command, expected = point["check"] - return f"`{command}` → `{expected}`" - - -def cell(text): - return text.replace("|", "\\|") - - -# --- rendering after a template ------------------------------------------------------------------------------- - -def split_template(text): - """(frontmatter keys, H1 line, [(heading, body lines)]) of a Markdown template.""" - keys, sections, h1 = [], [], "" - lines = text.splitlines() - i = 0 - if lines and lines[0].strip() == "---": - i = 1 - while i < len(lines) and lines[i].strip() != "---": - key = lines[i].split(":", 1)[0].strip() - if key: - keys.append(key) - i += 1 - i += 1 - for line in lines[i:]: - if line.startswith("# ") and not h1: - h1 = line - elif line.startswith("## "): - sections.append((line[3:].strip(), [])) - elif sections: - sections[-1][1].append(line) - return keys, h1, sections - - -def table_head(lines): - """The first table's header and separator lines in a template section.""" - rows = [line for line in lines if line.startswith("|")] - return rows[:2] - - -def render(template_text, fields, title, content): - """A document in the template's form: its frontmatter keys filled from `fields`, its sections in order, each with - the content `content(heading, template_lines)` returns (None: `none`).""" - keys, _, sections = split_template(template_text) - out = [] - if keys: - out.append("---") - out += [f"{key}: {fields.get(key, '')}".rstrip() for key in keys] - out.append("---") - out.append("") - out.append(f"# {title}") - for heading, lines in sections: - body = content(heading, lines) - out += ["", f"## {heading}", "", body if body is not None else "none"] - return "\n".join(out) + "\n" - - -def spec_content(spec, stand): - def content(heading, lines): - name = heading.lower() - if name.startswith("goal"): - return spec["goal"] - if name.startswith("out of scope"): - return "\n".join(f"- {item}" for item in spec["out"]) - if name.startswith("points"): - head = table_head(lines) or ["| # | Point | Done criterion (command → expected) |", "|---|---|---|"] - rows = [f"| {n} | {cell(p['point'])} | {cell(criterion(p))} |" for n, p in enumerate(spec["points"], 1)] - return "\n".join(head + rows) - if name.startswith("preconditions"): - return "\n".join(f"- {line}" for line, _, _ in spec.get("pre", [])) or "- none" - if name.startswith("reference update"): - return "none: the project has no reference docs this work changes." - if name.startswith("technical decisions") or name.startswith("user decisions"): - return "- none" - if name.startswith("ready check"): - return ready_check(spec) - return None - return content - - -def ready_check(spec): - """The Ready check section /docket:spec writes before `ready` (templates/spec.md): the three angles, the dry run - of each precondition and acceptance command with an excerpt of its output, nothing open. It names no finding: - the wrong fact of the wrong-fact case stays for the run to meet.""" - lines = [f"- date: {CREATED}", "- feasibility: none", "- spec: none", "- users and operators: none"] - for line, shell, output in spec.get("pre", []): - command = line.split(" → ", 1)[0] - lines.append(f"- {command} → met in {shell} (`{output}`)") - for point in spec["points"]: - command, _ = point["check"] - lines.append(f"- `{command}` → starts, fails until the point is made (`{point['dry']}`)") - lines.append("- open: none") - return "\n".join(lines) - - -PLAIN_SPEC = "\n".join(["## Goal", "## Out of scope", "## Points", - "| # | Point | Done criterion (command → expected) |", "|---|---|---|", - "## Preconditions"]) + "\n" - - -def spec_text(stand, spec_id, state="ready"): - spec = SPECS[spec_id] - form = PLAIN_SPEC if stand == "none" else template(stand, "spec.md") - fields = {"id": spec_id, "topic": TOPIC, "title": spec["title"], "state": state, "concept": "", "follows": "", - "created": CREATED} - return render(form, fields, spec["title"], spec_content(spec, stand)) - - -def docket_config(stand): - """DOCKET.md in the form of the stand's template: the configuration rows this fixture sets, the repository - questions answered from CONTRIBUTING.md; no forbidden_commands.""" - values = { - "work_dir": "`docket/`", - "topics": f"`{TOPIC}`", - "check": f"`{CHECK}`", - "reference_roots": "`README.md`", - "user_language": "English", - "ci": "none", - "push_branch": "`main`", - "commit_regex": "`" + COMMIT_REGEX.replace("|", "\\|") + "`", - "forbidden_paths": "`secrets/**`", - } - answers = { - "1": "trunk: everything on `main` (CONTRIBUTING.md)", - "2": "`: `, type feat, fix, docs or chore (CONTRIBUTING.md)", - "3": "push to `origin main` after a green check (CONTRIBUTING.md)", - "4": "nobody: no pull requests", - "5": f"`{CHECK}` ends with `OK`", - "6": "none", - "7": "in the repository under `docket/`", - "8": "English", - "9": "docstrings for public functions", - "10": "`secrets/**`", - "11": "none", - "12": "English", - } - out = [] - for line in template(stand, "DOCKET.md").splitlines(): - row = re.match(r"^\|\s*([a-z_]+)\s*\|(.*)\|(.*)\|\s*$", line) - number = re.match(r"^(\d{1,2})\.\s+(.*:)\s*$", line) - if row and row.group(1) not in ("Key",): - key = row.group(1) - if key == "model_ladder": - out.append(re.sub(r"<[^>]*>", "none", line)) # the template's ladder, no complex themes - elif key in values: - out.append(f"| {key} | {values[key]} | fixture |") - continue # a row this fixture does not set is left out, like a key the project does not use - if number and number.group(1) in answers: - out.append(f"{number.group(1)}. {number.group(2)} {answers[number.group(1)]}") - continue - out.append(line) - return "\n".join(out) + "\n" - - -def docket_text(stand, spec_id): - """The docket of the resume case after point 1: point 1 delivered with its evidence line, point 2 open, no - Terminal state. In the form of the stand's template.""" - spec = SPECS[spec_id] - first, second = spec["points"] - - def content(heading, lines): - name = heading.lower() - if name.startswith("points"): - head = table_head(lines) or ["| # | Point | Evidence line expected | State |", "|---|---|---|---|"] - rows = [f"| 1 | {cell(first['point'])} | {cell(criterion(first))} | [x] |", - f"| 2 | {cell(second['point'])} | {cell(criterion(second))} | [ ] |"] - return "\n".join(head + rows) - if name.startswith("tiers"): - return ("- point 1: simple, one function in one file\n" - "- point 2: standard, a new module that reads a data file") - if name.startswith("refinement"): - return ("- feasibility | `brutto()` exists in kasse/preis.py and rounds half up | adopted\n" - "- spec | the report line format is fixed by the done criterion | adopted\n" - "- project | `tools/` is a new folder; run as module so `kasse` imports | adopted") - if name.startswith("rewrite"): - return "none" - if name.startswith("evidence"): - command, _ = first["check"] - return f"- point 1: `{command}` → `1725`; commit \"{RESUME_COMMIT}\"" - if name.startswith("terminal state"): - return "" - return "- none" - - fields = {"id": spec_id, "spec": spec_path(stand, spec_id).split("docket/", 1)[-1], - "created": f"{CREATED} 09:05", "session": SESSION} - return render(template(stand, "delivery-docket.md"), fields, spec["title"], content) - - -def log_line(stamp, spec_id, event, note=""): - line = f"{stamp} {spec_id:<11} {event:<18} session={SESSION}" - return line + (f" {note}" if note else "") - - -def judge_settings(stand): - text = template(stand, "judge-hook.json") - if text is None: - return None - return json.dumps(json.loads(text), indent=2, ensure_ascii=False) + "\n" - - -# --- building ------------------------------------------------------------------------------------------------- - -def write(root, rel, text): - path = os.path.join(root, *rel.split("/")) - os.makedirs(os.path.dirname(path), exist_ok=True) - with open(path, "w", encoding="utf-8", newline="\n") as handle: - handle.write(text) - - -def run_git(root, *args): - env = dict(os.environ, GIT_AUTHOR_DATE=GIT_DATE, GIT_COMMITTER_DATE=GIT_DATE) - result = subprocess.run(["git", *args], cwd=root, capture_output=True, stdin=subprocess.DEVNULL, env=env) - if result.returncode != 0: - raise RuntimeError(f"git {' '.join(args)}: {result.stderr.decode('utf-8', 'replace').strip()}") - - -def build(case, stand, out): - if case not in CASES: - raise ValueError(f"unknown case {case}") - if stand not in STANDS: - raise ValueError(f"unknown stand {stand}") - if os.path.exists(out) and os.listdir(out): - raise ValueError(f"{out} is not empty") - os.makedirs(out, exist_ok=True) - setup = CASE[case] - resume = setup.get("resume", False) - for rel, text in {**BASE, **setup.get("files", {})}.items(): - write(out, rel, text) - for spec_id in setup["specs"]: - state = "in-progress" if resume and stand != "none" else "ready" - write(out, spec_path(stand, spec_id), spec_text(stand, spec_id, state)) - if stand != "none": - write(out, "docket/DOCKET.md", docket_config(stand)) - write(out, "docket/LOG.md", "".join(log_line("2026-11-11T08:00:00Z", s, "ready") + "\n" - for s in setup["specs"])) - judge = judge_settings(stand) - if judge: - write(out, ".claude/settings.json", judge) - run_git(out, "init", "-q", "-b", "main") - for key, value in (("user.name", "Fixture"), ("user.email", "fixture@example.invalid"), - ("core.autocrlf", "false"), ("commit.gpgsign", "false")): - run_git(out, "config", key, value) - run_git(out, "add", "-A") - run_git(out, "commit", "-q", "-m", "chore: initial project") - origin = os.path.join(out, ".remote", "origin.git") - os.makedirs(origin) - run_git(origin, "init", "-q", "--bare", "-b", "main") - run_git(out, "remote", "add", "origin", origin.replace("\\", "/")) - run_git(out, "push", "-q", "-u", "origin", "main") - if resume: - for rel, text in RESUME_FILES.items(): - write(out, rel, text) - run_git(out, "add", "-A") - run_git(out, "commit", "-q", "-m", RESUME_COMMIT) - if stand != "none": - spec_id = setup["specs"][0] - write(out, f"docket/dockets/{TOPIC}/{spec_id}.md", docket_text(stand, spec_id)) - with open(os.path.join(out, "docket", "LOG.md"), "a", encoding="utf-8", newline="\n") as handle: - handle.write(log_line("2026-11-11T09:05:00Z", spec_id, "sealed") + "\n") - handle.write(log_line("2026-11-11T09:20:00Z", spec_id, "point-delivered", "count=1") + "\n") - run_git(out, "add", "-A") - run_git(out, "commit", "-q", "-m", "chore: docket records") - return out - - -def main(argv=None): - parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) - parser.add_argument("--case", required=True, choices=CASES) - parser.add_argument("--stand", required=True, choices=STANDS) - parser.add_argument("--out", required=True) - args = parser.parse_args(argv) - print(build(args.case, args.stand, os.path.abspath(args.out))) - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/evals/refusals.py b/evals/refusals.py deleted file mode 100644 index 607b787..0000000 --- a/evals/refusals.py +++ /dev/null @@ -1,102 +0,0 @@ -"""Counts the blocking feedbacks of docket's hooks in a session transcript that begin with none of the three -identifiers (REWORK-SPEC, Festlegung „Kennung der Rückmeldungen“): `[docket rule: ]`, `[docket gate]`, -`[docket state]`. 0 is the criterion "no refusal outside the five". - - python evals/refusals.py - -A docket hook is known by its command: `hooks/.py` of the plugin. Blocking feedbacks are read where Claude Code -writes them into the transcript: -- PreToolUse and PostToolUse: the tool result with `is_error`, `: hook error: []: `; - an attachment `hook_blocking_error` (`blockingError`, `command`) the same way; -- Stop: the entry `system`/`stop_hook_summary`, one string `[]: ` per hook in `hookErrors`; only where a - transcript has no such entry, the meta prompt `Stop hook feedback:` that repeats it. -A hook's success, its additional context and a summary without errors are no feedback. Prints one line per docket -hook with its count, then the count as the last line; no feedback text. -""" -import json -import re -import sys - -DOCKET_HOOK = re.compile(r"hooks[/\\](pre_tool_use|post_tool_use|stop|subagent_stop|message_display|user_prompt|" - r"session_start)\.py\b") -IDENTIFIERS = ("[docket rule: ", "[docket gate]", "[docket state]") -TOOL_ERROR = re.compile(r"^(?:Error: )?(PreToolUse|PostToolUse)(?::[^\s]*)? hook error: \[(.*?)\]: (.*)$", re.DOTALL) -STOP_FEEDBACK = "Stop hook feedback:" - - -def split_feedback(text): - """(command, text) of a feedback `[]: `; the command holds no `]: `.""" - match = re.match(r"^\s*\[(.*?)\]: (.*)$", text or "", re.DOTALL) - return (match.group(1), match.group(2)) if match else ("", text or "") - - -def content_text(content): - if isinstance(content, str): - return content - if isinstance(content, list): - return "".join(b.get("text", "") for b in content if isinstance(b, dict)) - return "" - - -def feedbacks(entries): - """(command, text) of every blocking feedback of any hook, in order.""" - found, summaries, meta = [], [], [] - for entry in entries: - kind = entry.get("type") - if kind == "system" and entry.get("subtype") == "stop_hook_summary": - summaries += [split_feedback(e) for e in entry.get("hookErrors") or [] if isinstance(e, str)] - continue - attachment = entry.get("attachment") - if kind == "attachment" and isinstance(attachment, dict) and attachment.get("type") == "hook_blocking_error": - error = attachment.get("blockingError") - if isinstance(error, dict): - found.append((str(error.get("command") or attachment.get("command") or ""), - str(error.get("blockingError") or ""))) - else: - found.append((str(attachment.get("command") or ""), str(error or ""))) - continue - message = entry.get("message") - if kind != "user" or not isinstance(message, dict): - continue - content = message.get("content") - if entry.get("isMeta") and content_text(content).startswith(STOP_FEEDBACK): - meta.append(split_feedback(content_text(content)[len(STOP_FEEDBACK):].lstrip("\n"))) - continue - for block in content if isinstance(content, list) else []: - if isinstance(block, dict) and block.get("type") == "tool_result" and block.get("is_error"): - match = TOOL_ERROR.match(content_text(block.get("content"))) - if match: - found.append((match.group(2), match.group(3))) - return found + (summaries or meta) - - -def read_entries(path): - entries = [] - with open(path, encoding="utf-8", errors="replace") as handle: - for line in handle: - try: - entry = json.loads(line) - except ValueError: - continue - if isinstance(entry, dict): - entries.append(entry) - return entries - - -def main(argv): - if len(argv) != 2: - print("usage: python evals/refusals.py ", file=sys.stderr) - return 2 - counts = {} - for command, text in feedbacks(read_entries(argv[1])): - hook = DOCKET_HOOK.search(command) - if hook and not text.lstrip().startswith(IDENTIFIERS): - counts[hook.group(1)] = counts.get(hook.group(1), 0) + 1 - for name in sorted(counts): - print(f"{name} {counts[name]}") - print(sum(counts.values())) - return 0 - - -if __name__ == "__main__": - sys.exit(main(sys.argv)) diff --git a/evals/report.py b/evals/report.py deleted file mode 100644 index f4a4ed8..0000000 --- a/evals/report.py +++ /dev/null @@ -1,163 +0,0 @@ -"""Report of the comparison test, read from the result files only. - - python evals/report.py --stand [--stand ]... [--case ]... [--min-pass ] [--not-below ]... - [--table] - -One line per case and stand: case, stand, `result p/v`, `docket p/v`, valid runs, loaded plugin with version. A run -passes a class when every criterion of that class passes. Expected per case: three valid runs, or six where a case -missed its threshold and got three more (5 of 6 meets "3 of 3", 4 of 6 meets "2 of 3"). `--min-pass` holds for both -classes; `--not-below` compares `result` with the other stand and ends with `equal with : `. Exit 1 -when runs are missing, invalid or stale, or a threshold is missed. `--table` prints the Markdown table of every case -of the named stands instead. -""" -import argparse -import json -import os -import sys - -sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) -from common import CASES, NOT_MEASURED, STANDS, cases_for, plugin_state, result_path # noqa: E402 - -CLASSES = ("result", "docket") -MAX_RUNS = 6 - - -def load(path): - try: - with open(path, encoding="utf-8") as handle: - return json.load(handle) - except (OSError, ValueError): - return None - - -class Cell: - """The runs of one case in one stand.""" - - def __init__(self, stand, case, state): - self.stand, self.case = stand, case - self.records = [r for r in (load(result_path(stand, case, n)) for n in range(1, MAX_RUNS + 1)) if r] - self.invalid = [r for r in self.records if not r.get("valid")] - self.stale = [r for r in self.records if r.get("valid") and stand == "rework" and r.get("plugin_state") != state] - self.valid = [r for r in self.records if r.get("valid") and r not in self.stale] - - def passes(self, cls): - """(runs passing the class, valid runs), or None where the class has no criterion in this stand.""" - runs = [[c for c in r.get("criteria", []) if c.get("class") == cls] for r in self.valid] - if not any(runs): - return None - return sum(1 for crit in runs if crit and all(c.get("pass") for c in crit)), len(self.valid) - - def text(self, cls): - found = self.passes(cls) - return "-" if found is None else f"{found[0]}/{found[1]}" - - def plugin(self): - names = {f"{p.get('name')} {p.get('version')}" for r in self.valid for p in r.get("plugins") or []} - return ", ".join(sorted(names)) or "none" - - def mean(self, key): - values = [r.get(key) for r in self.valid if isinstance(r.get(key), (int, float))] - return sum(values) / len(values) if values else None - - def problems(self, min_pass): - found = [] - count = len(self.valid) - if count not in (3, 6): - found.append(f"{count} valid runs, expected 3 or 6") - if self.invalid: - found.append("invalid: " + ", ".join(f"run {r.get('run')} ({r.get('reason', '')[:80]})" for r in self.invalid)) - if self.stale: - found.append("stale: " + ", ".join(f"run {r.get('run')}" for r in self.stale)) - if min_pass is not None and count: - need = min_pass if count <= 3 else min_pass + (count - 3) - 1 - for cls in CLASSES: - result = self.passes(cls) - if result is not None and result[0] < need: - found.append(f"{cls} {result[0]}/{result[1]} below {need}") - return found - - -def rate(cell): - found = cell.passes("result") - return None if not found or not found[1] else found[0] / found[1] - - -def table(stands, cases, cells): - head = "| Fall | " + " | ".join(f"{s}: result | {s}: docket | {s}: Läufe" for s in stands) + " |" - rule = "|---|" + "---|---|---|" * len(stands) - lines, notes = [head, rule], [] - for case in cases: - row = [case] - for stand in stands: - if (case, stand) in NOT_MEASURED: - notes.append(f"({len(notes) + 1}) {case}, {stand}: {NOT_MEASURED[(case, stand)]}.") - row += [f"nicht gemessen ({len(notes)})", "-", "-"] - continue - cell = cells[(stand, case)] - turns, ms = cell.mean("num_turns"), cell.mean("duration_ms") - runs = str(len(cell.valid)) - if turns is not None and ms is not None: - runs += f" (Ø {turns:.0f} Züge, {ms / 60000:.0f} min)" - docket = "nur result" if stand == "none" else cell.text("docket") - row += [cell.text("result"), docket, runs] - lines.append("| " + " | ".join(row) + " |") - plugins = [] - for stand in stands: - loaded = {cells[(stand, c)].plugin() for c in cases if (stand, c) in cells} - plugins.append(f"{stand}: {', '.join(sorted(loaded)) or 'none'}") - return "\n".join(lines + [""] + notes + ["", "Geladenes Plugin: " + "; ".join(plugins) + "."]) + "\n" - - -def main(argv=None): - parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) - parser.add_argument("--stand", action="append", choices=STANDS, required=True) - parser.add_argument("--case", action="append", default=[], choices=CASES) - parser.add_argument("--min-pass", type=int) - parser.add_argument("--not-below", action="append", default=[], choices=STANDS) - parser.add_argument("--table", action="store_true") - args = parser.parse_args(argv) - if hasattr(sys.stdout, "reconfigure"): - sys.stdout.reconfigure(encoding="utf-8", newline="\n") # umlauts and LF, also on Windows - stands = list(dict.fromkeys(args.stand)) - states = {s: plugin_state(s) for s in set(stands) | set(args.not_below)} - cells = {(s, c): Cell(s, c, states[s]) for s in set(stands) | set(args.not_below) for c in cases_for(s)} - failed = False - if args.table: - cases = [c for c in CASES if not args.case or c in args.case] - sys.stdout.write(table(stands, cases, cells)) - for stand in stands: - for case in cases_for(stand): - if case in cases and cells[(stand, case)].problems(None): - failed = True - return 1 if failed else 0 - for stand in stands: - for case in [c for c in cases_for(stand) if not args.case or c in args.case]: - cell = cells[(stand, case)] - problems = cell.problems(args.min_pass) - print(f"{case} {stand} result {cell.text('result')} docket {cell.text('docket')} " - f"valid {len(cell.valid)} plugin {cell.plugin()}" + (" | " + "; ".join(problems) if problems else "")) - failed = failed or bool(problems) - for other in args.not_below: - equal, skipped = [], [] - for case in [c for c in cases_for(stand) if not args.case or c in args.case]: - if (other, case) not in cells: - skipped.append(case) - continue - ours, theirs = rate(cells[(stand, case)]), rate(cells[(other, case)]) - if ours is None or theirs is None: - print(f"{case} {stand} not comparable with {other}: no valid runs") - failed = True - elif ours < theirs: - print(f"{case} {stand} result below {other}: {cells[(stand, case)].text('result')} against " - f"{cells[(other, case)].text('result')}") - failed = True - elif ours == theirs: - equal.append(case) - if skipped: - print(f"not measured by {other}, skipped: {', '.join(skipped)}") - print(f"equal with {other}: {', '.join(equal) or '-'}") - return 1 if failed else 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/evals/results/0.5.11/precondition-powershell-1.json b/evals/results/0.5.11/precondition-powershell-1.json deleted file mode 100644 index 82f7deb..0000000 --- a/evals/results/0.5.11/precondition-powershell-1.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "case": "precondition-powershell", - "stand": "0.5.11", - "run": 1, - "started": "2026-11-11T22:02:49", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": false - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": false - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "precondition-in-powershell", - "class": "docket", - "pass": false - }, - { - "name": "spec-1-not-blocked", - "class": "docket", - "pass": false - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.11500452, - "num_turns": 4, - "duration_ms": 18363, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "8563b97a0df486e1fee44c90956bc085b977082e399c16b0f12555c59ef12259", - "valid": true, - "reason": "" -} diff --git a/evals/results/0.5.11/precondition-powershell-2.json b/evals/results/0.5.11/precondition-powershell-2.json deleted file mode 100644 index 53b761e..0000000 --- a/evals/results/0.5.11/precondition-powershell-2.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "case": "precondition-powershell", - "stand": "0.5.11", - "run": 2, - "started": "2026-11-11T22:02:49", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": false - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": false - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "precondition-in-powershell", - "class": "docket", - "pass": false - }, - { - "name": "spec-1-not-blocked", - "class": "docket", - "pass": false - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.10869786500000002, - "num_turns": 3, - "duration_ms": 13427, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "8563b97a0df486e1fee44c90956bc085b977082e399c16b0f12555c59ef12259", - "valid": true, - "reason": "" -} diff --git a/evals/results/0.5.11/precondition-powershell-3.json b/evals/results/0.5.11/precondition-powershell-3.json deleted file mode 100644 index f874d3a..0000000 --- a/evals/results/0.5.11/precondition-powershell-3.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "case": "precondition-powershell", - "stand": "0.5.11", - "run": 3, - "started": "2026-11-11T22:02:49", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": false - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": false - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "precondition-in-powershell", - "class": "docket", - "pass": true - }, - { - "name": "spec-1-not-blocked", - "class": "docket", - "pass": false - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.12445797000000001, - "num_turns": 5, - "duration_ms": 20019, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "8563b97a0df486e1fee44c90956bc085b977082e399c16b0f12555c59ef12259", - "valid": true, - "reason": "" -} diff --git a/evals/results/0.5.11/two-points-1.json b/evals/results/0.5.11/two-points-1.json deleted file mode 100644 index e2a222a..0000000 --- a/evals/results/0.5.11/two-points-1.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "case": "two-points", - "stand": "0.5.11", - "run": 1, - "started": "2026-11-11T21:54:33", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "pushed-to-main", - "class": "result", - "pass": true - }, - { - "name": "delivered", - "class": "docket", - "pass": true - }, - { - "name": "evidence-per-point", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 2.3944000099999996, - "num_turns": 78, - "duration_ms": 440767, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "c5e2a5b50284d77a2d40f89808b37a71eb572da4930d4d84645883b9f03d708e", - "valid": true, - "reason": "" -} diff --git a/evals/results/0.5.11/two-points-2.json b/evals/results/0.5.11/two-points-2.json deleted file mode 100644 index 01e4024..0000000 --- a/evals/results/0.5.11/two-points-2.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "case": "two-points", - "stand": "0.5.11", - "run": 2, - "started": "2026-11-11T22:03:05", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "pushed-to-main", - "class": "result", - "pass": true - }, - { - "name": "delivered", - "class": "docket", - "pass": true - }, - { - "name": "evidence-per-point", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 2.53259183, - "num_turns": 83, - "duration_ms": 500766, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "c5e2a5b50284d77a2d40f89808b37a71eb572da4930d4d84645883b9f03d708e", - "valid": true, - "reason": "" -} diff --git a/evals/results/0.5.11/two-points-3.json b/evals/results/0.5.11/two-points-3.json deleted file mode 100644 index b5e5fa9..0000000 --- a/evals/results/0.5.11/two-points-3.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "case": "two-points", - "stand": "0.5.11", - "run": 3, - "started": "2026-11-11T22:03:10", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "pushed-to-main", - "class": "result", - "pass": false - }, - { - "name": "delivered", - "class": "docket", - "pass": true - }, - { - "name": "evidence-per-point", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 4.530456794999998, - "num_turns": 116, - "duration_ms": 961041, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "c5e2a5b50284d77a2d40f89808b37a71eb572da4930d4d84645883b9f03d708e", - "valid": true, - "reason": "" -} diff --git a/evals/results/0.5.11/user-over-rule-1.json b/evals/results/0.5.11/user-over-rule-1.json deleted file mode 100644 index bf0c199..0000000 --- a/evals/results/0.5.11/user-over-rule-1.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "user-over-rule", - "stand": "0.5.11", - "run": 1, - "started": "2026-11-11T22:16:33", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "change-made", - "class": "result", - "pass": true - }, - { - "name": "change-named", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 1.574094605, - "num_turns": 59, - "duration_ms": 299332, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "d781ae7bc93bc9cad6932fea8d197d80959ab3dea70687947d7bb51148214065", - "valid": true, - "reason": "" -} diff --git a/evals/results/0.5.11/user-over-rule-2.json b/evals/results/0.5.11/user-over-rule-2.json deleted file mode 100644 index 8c56757..0000000 --- a/evals/results/0.5.11/user-over-rule-2.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "user-over-rule", - "stand": "0.5.11", - "run": 2, - "started": "2026-11-11T22:17:47", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "change-made", - "class": "result", - "pass": true - }, - { - "name": "change-named", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 1.54639731, - "num_turns": 52, - "duration_ms": 298329, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "d781ae7bc93bc9cad6932fea8d197d80959ab3dea70687947d7bb51148214065", - "valid": true, - "reason": "" -} diff --git a/evals/results/0.5.11/user-over-rule-3.json b/evals/results/0.5.11/user-over-rule-3.json deleted file mode 100644 index c623015..0000000 --- a/evals/results/0.5.11/user-over-rule-3.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "user-over-rule", - "stand": "0.5.11", - "run": 3, - "started": "2026-11-11T22:19:13", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "change-made", - "class": "result", - "pass": true - }, - { - "name": "change-named", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 1.4287860950000002, - "num_turns": 53, - "duration_ms": 280995, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "d781ae7bc93bc9cad6932fea8d197d80959ab3dea70687947d7bb51148214065", - "valid": true, - "reason": "" -} diff --git a/evals/results/0.5.11/wrong-fact-1.json b/evals/results/0.5.11/wrong-fact-1.json deleted file mode 100644 index a236022..0000000 --- a/evals/results/0.5.11/wrong-fact-1.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "case": "wrong-fact", - "stand": "0.5.11", - "run": 1, - "started": "2026-11-11T22:03:12", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "names-missing-file", - "class": "result", - "pass": false - }, - { - "name": "deviation-line", - "class": "docket", - "pass": false - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 2.2768274400000013, - "num_turns": 72, - "duration_ms": 414456, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "bf24473cf32bb261fb3f15980fbb401e7b7174d86cceddc8b79b36ee37149ad5", - "valid": true, - "reason": "" -} diff --git a/evals/results/0.5.11/wrong-fact-2.json b/evals/results/0.5.11/wrong-fact-2.json deleted file mode 100644 index 207538e..0000000 --- a/evals/results/0.5.11/wrong-fact-2.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "case": "wrong-fact", - "stand": "0.5.11", - "run": 2, - "started": "2026-11-11T22:10:08", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "names-missing-file", - "class": "result", - "pass": false - }, - { - "name": "deviation-line", - "class": "docket", - "pass": false - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 2.1455868849999997, - "num_turns": 63, - "duration_ms": 382058, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "bf24473cf32bb261fb3f15980fbb401e7b7174d86cceddc8b79b36ee37149ad5", - "valid": true, - "reason": "" -} diff --git a/evals/results/0.5.11/wrong-fact-3.json b/evals/results/0.5.11/wrong-fact-3.json deleted file mode 100644 index f1c9927..0000000 --- a/evals/results/0.5.11/wrong-fact-3.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "case": "wrong-fact", - "stand": "0.5.11", - "run": 3, - "started": "2026-11-11T22:11:28", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "names-missing-file", - "class": "result", - "pass": false - }, - { - "name": "deviation-line", - "class": "docket", - "pass": false - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 2.353158785, - "num_turns": 72, - "duration_ms": 376951, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.5.11" - } - ], - "plugin_state": "3d58bc364038f454b8ecddf467fa85f7c29f88a8afa87b25234fbfd40e212845", - "case_state": "bf24473cf32bb261fb3f15980fbb401e7b7174d86cceddc8b79b36ee37149ad5", - "valid": true, - "reason": "" -} diff --git a/evals/results/BASELINE.md b/evals/results/BASELINE.md deleted file mode 100644 index 47eba3d..0000000 --- a/evals/results/BASELINE.md +++ /dev/null @@ -1,11 +0,0 @@ -| Fall | none: result | none: docket | none: Läufe | 0.5.11: result | 0.5.11: docket | 0.5.11: Läufe | -|---|---|---|---|---|---|---| -| precondition-powershell | 3/3 | nur result | 3 (Ø 8 Züge, 1 min) | 0/3 | 0/3 | 3 (Ø 4 Züge, 0 min) | -| two-points | 3/3 | nur result | 3 (Ø 7 Züge, 1 min) | 2/3 | 3/3 | 3 (Ø 92 Züge, 11 min) | -| wrong-fact | 3/3 | nur result | 3 (Ø 5 Züge, 1 min) | 0/3 | 0/3 | 3 (Ø 69 Züge, 7 min) | -| user-over-rule | 3/3 | nur result | 3 (Ø 5 Züge, 1 min) | 3/3 | - | 3 (Ø 55 Züge, 5 min) | -| resume | 3/3 | nur result | 3 (Ø 6 Züge, 1 min) | nicht gemessen (1) | - | - | - -(1) resume, 0.5.11: a hand-built 0.5.11 docket does not pass the gates at DELIVERED (refinement lines with decision, review, provenance, hooks/stop.py:324-328); the state comes only from a real run. - -Geladenes Plugin: none: none; 0.5.11: docket 0.5.11. diff --git a/evals/results/none/precondition-powershell-1.json b/evals/results/none/precondition-powershell-1.json deleted file mode 100644 index 334892c..0000000 --- a/evals/results/none/precondition-powershell-1.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "precondition-powershell", - "stand": "none", - "run": 1, - "started": "2026-11-11T21:56:10", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": true - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.19165100000000002, - "num_turns": 10, - "duration_ms": 44587, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "8563b97a0df486e1fee44c90956bc085b977082e399c16b0f12555c59ef12259", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/precondition-powershell-2.json b/evals/results/none/precondition-powershell-2.json deleted file mode 100644 index 4dd8f25..0000000 --- a/evals/results/none/precondition-powershell-2.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "precondition-powershell", - "stand": "none", - "run": 2, - "started": "2026-11-11T21:56:10", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": true - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.16841779999999998, - "num_turns": 7, - "duration_ms": 40362, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "8563b97a0df486e1fee44c90956bc085b977082e399c16b0f12555c59ef12259", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/precondition-powershell-3.json b/evals/results/none/precondition-powershell-3.json deleted file mode 100644 index d2e1b27..0000000 --- a/evals/results/none/precondition-powershell-3.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "precondition-powershell", - "stand": "none", - "run": 3, - "started": "2026-11-11T21:56:10", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": true - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.18715180000000003, - "num_turns": 8, - "duration_ms": 45682, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "8563b97a0df486e1fee44c90956bc085b977082e399c16b0f12555c59ef12259", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/resume-1.json b/evals/results/none/resume-1.json deleted file mode 100644 index 2df29a3..0000000 --- a/evals/results/none/resume-1.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "case": "resume", - "stand": "none", - "run": 1, - "started": "2026-11-11T21:58:20", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-1-untouched", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.1618516, - "num_turns": 5, - "duration_ms": 33768, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "02ff5025ecadaa18544fdd09073a75392b5c23ebf9828b15e6236bb01bd1ad81", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/resume-2.json b/evals/results/none/resume-2.json deleted file mode 100644 index c500179..0000000 --- a/evals/results/none/resume-2.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "case": "resume", - "stand": "none", - "run": 2, - "started": "2026-11-11T21:58:47", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-1-untouched", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.15766940000000002, - "num_turns": 6, - "duration_ms": 35882, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "02ff5025ecadaa18544fdd09073a75392b5c23ebf9828b15e6236bb01bd1ad81", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/resume-3.json b/evals/results/none/resume-3.json deleted file mode 100644 index 6b94395..0000000 --- a/evals/results/none/resume-3.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "case": "resume", - "stand": "none", - "run": 3, - "started": "2026-11-11T21:58:52", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-1-untouched", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.15728920000000002, - "num_turns": 6, - "duration_ms": 36735, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "02ff5025ecadaa18544fdd09073a75392b5c23ebf9828b15e6236bb01bd1ad81", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/two-points-1.json b/evals/results/none/two-points-1.json deleted file mode 100644 index ac6391e..0000000 --- a/evals/results/none/two-points-1.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "case": "two-points", - "stand": "none", - "run": 1, - "started": "2026-11-11T21:54:33", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "pushed-to-main", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.16699400000000003, - "num_turns": 7, - "duration_ms": 37977, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "c5e2a5b50284d77a2d40f89808b37a71eb572da4930d4d84645883b9f03d708e", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/two-points-2.json b/evals/results/none/two-points-2.json deleted file mode 100644 index e1dd115..0000000 --- a/evals/results/none/two-points-2.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "case": "two-points", - "stand": "none", - "run": 2, - "started": "2026-11-11T21:56:53", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "pushed-to-main", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.18102539999999998, - "num_turns": 7, - "duration_ms": 42783, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "c5e2a5b50284d77a2d40f89808b37a71eb572da4930d4d84645883b9f03d708e", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/two-points-3.json b/evals/results/none/two-points-3.json deleted file mode 100644 index 6f7b794..0000000 --- a/evals/results/none/two-points-3.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "case": "two-points", - "stand": "none", - "run": 3, - "started": "2026-11-11T21:56:57", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "pushed-to-main", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.1809346, - "num_turns": 7, - "duration_ms": 44076, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "c5e2a5b50284d77a2d40f89808b37a71eb572da4930d4d84645883b9f03d708e", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/user-over-rule-1.json b/evals/results/none/user-over-rule-1.json deleted file mode 100644 index c3c326b..0000000 --- a/evals/results/none/user-over-rule-1.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "case": "user-over-rule", - "stand": "none", - "run": 1, - "started": "2026-11-11T21:57:44", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "change-made", - "class": "result", - "pass": true - }, - { - "name": "change-named", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.1273482, - "num_turns": 5, - "duration_ms": 34901, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "d781ae7bc93bc9cad6932fea8d197d80959ab3dea70687947d7bb51148214065", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/user-over-rule-2.json b/evals/results/none/user-over-rule-2.json deleted file mode 100644 index c04a9a1..0000000 --- a/evals/results/none/user-over-rule-2.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "case": "user-over-rule", - "stand": "none", - "run": 2, - "started": "2026-11-11T21:58:11", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "change-made", - "class": "result", - "pass": true - }, - { - "name": "change-named", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.1239836, - "num_turns": 5, - "duration_ms": 34257, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "d781ae7bc93bc9cad6932fea8d197d80959ab3dea70687947d7bb51148214065", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/user-over-rule-3.json b/evals/results/none/user-over-rule-3.json deleted file mode 100644 index 030b8ac..0000000 --- a/evals/results/none/user-over-rule-3.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "case": "user-over-rule", - "stand": "none", - "run": 3, - "started": "2026-11-11T21:58:14", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "change-made", - "class": "result", - "pass": true - }, - { - "name": "change-named", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.1348592, - "num_turns": 5, - "duration_ms": 35428, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "d781ae7bc93bc9cad6932fea8d197d80959ab3dea70687947d7bb51148214065", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/wrong-fact-1.json b/evals/results/none/wrong-fact-1.json deleted file mode 100644 index 0ed8e26..0000000 --- a/evals/results/none/wrong-fact-1.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "wrong-fact", - "stand": "none", - "run": 1, - "started": "2026-11-11T21:56:58", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "names-missing-file", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.1543824, - "num_turns": 5, - "duration_ms": 32719, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "bf24473cf32bb261fb3f15980fbb401e7b7174d86cceddc8b79b36ee37149ad5", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/wrong-fact-2.json b/evals/results/none/wrong-fact-2.json deleted file mode 100644 index ac25489..0000000 --- a/evals/results/none/wrong-fact-2.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "wrong-fact", - "stand": "none", - "run": 2, - "started": "2026-11-11T21:57:34", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "names-missing-file", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.15747699999999998, - "num_turns": 5, - "duration_ms": 34967, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "bf24473cf32bb261fb3f15980fbb401e7b7174d86cceddc8b79b36ee37149ad5", - "valid": true, - "reason": "" -} diff --git a/evals/results/none/wrong-fact-3.json b/evals/results/none/wrong-fact-3.json deleted file mode 100644 index f54bf8c..0000000 --- a/evals/results/none/wrong-fact-3.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "wrong-fact", - "stand": "none", - "run": 3, - "started": "2026-11-11T21:57:38", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "names-missing-file", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.1511698, - "num_turns": 5, - "duration_ms": 34231, - "claude_code_version": "2.1.322", - "plugins": [], - "plugin_state": "", - "case_state": "bf24473cf32bb261fb3f15980fbb401e7b7174d86cceddc8b79b36ee37149ad5", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/closing-series-1.json b/evals/results/rework/closing-series-1.json deleted file mode 100644 index 74f9884..0000000 --- a/evals/results/rework/closing-series-1.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "case": "closing-series", - "stand": "rework", - "run": 1, - "started": "2026-11-14T13:33:35", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": true - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "no-state-line", - "class": "docket", - "pass": true - }, - { - "name": "end-line-per-spec", - "class": "docket", - "pass": true - }, - { - "name": "every-line-titled", - "class": "docket", - "pass": false - }, - { - "name": "one-closing", - "class": "docket", - "pass": true - }, - { - "name": "no-ids", - "class": "docket", - "pass": true - }, - { - "name": "no-hashes", - "class": "docket", - "pass": true - }, - { - "name": "no-paths", - "class": "docket", - "pass": true - }, - { - "name": "no-proof", - "class": "docket", - "pass": true - }, - { - "name": "deviation-written", - "class": "docket", - "pass": true - }, - { - "name": "user-item-written", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 1.3858090000000007, - "num_turns": 38, - "duration_ms": 274701, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.5" - } - ], - "plugin_state": "1d1a55287db1c5cc77da715c6bb6f71d92b71a23e4dcf63127f8d9fb01847b6c", - "case_state": "b6bf091193f0f7d78ab1653e0aaf357e7f0a643bf8c0ea0a049da0ae6f82260e", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/closing-series-2.json b/evals/results/rework/closing-series-2.json deleted file mode 100644 index 0f15030..0000000 --- a/evals/results/rework/closing-series-2.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "case": "closing-series", - "stand": "rework", - "run": 2, - "started": "2026-11-14T13:33:35", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": true - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "no-state-line", - "class": "docket", - "pass": true - }, - { - "name": "end-line-per-spec", - "class": "docket", - "pass": true - }, - { - "name": "every-line-titled", - "class": "docket", - "pass": true - }, - { - "name": "one-closing", - "class": "docket", - "pass": true - }, - { - "name": "no-ids", - "class": "docket", - "pass": true - }, - { - "name": "no-hashes", - "class": "docket", - "pass": true - }, - { - "name": "no-paths", - "class": "docket", - "pass": true - }, - { - "name": "no-proof", - "class": "docket", - "pass": true - }, - { - "name": "deviation-written", - "class": "docket", - "pass": true - }, - { - "name": "user-item-written", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 1.4969805599999997, - "num_turns": 39, - "duration_ms": 306384, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.5" - } - ], - "plugin_state": "1d1a55287db1c5cc77da715c6bb6f71d92b71a23e4dcf63127f8d9fb01847b6c", - "case_state": "b6bf091193f0f7d78ab1653e0aaf357e7f0a643bf8c0ea0a049da0ae6f82260e", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/closing-series-3.json b/evals/results/rework/closing-series-3.json deleted file mode 100644 index 9ad0a02..0000000 --- a/evals/results/rework/closing-series-3.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "case": "closing-series", - "stand": "rework", - "run": 3, - "started": "2026-11-14T13:33:35", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": true - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "no-state-line", - "class": "docket", - "pass": true - }, - { - "name": "end-line-per-spec", - "class": "docket", - "pass": true - }, - { - "name": "every-line-titled", - "class": "docket", - "pass": true - }, - { - "name": "one-closing", - "class": "docket", - "pass": true - }, - { - "name": "no-ids", - "class": "docket", - "pass": true - }, - { - "name": "no-hashes", - "class": "docket", - "pass": true - }, - { - "name": "no-paths", - "class": "docket", - "pass": true - }, - { - "name": "no-proof", - "class": "docket", - "pass": true - }, - { - "name": "deviation-written", - "class": "docket", - "pass": true - }, - { - "name": "user-item-written", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 1.3915606999999999, - "num_turns": 35, - "duration_ms": 259703, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.5" - } - ], - "plugin_state": "1d1a55287db1c5cc77da715c6bb6f71d92b71a23e4dcf63127f8d9fb01847b6c", - "case_state": "b6bf091193f0f7d78ab1653e0aaf357e7f0a643bf8c0ea0a049da0ae6f82260e", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/precondition-powershell-1.json b/evals/results/rework/precondition-powershell-1.json deleted file mode 100644 index e61a417..0000000 --- a/evals/results/rework/precondition-powershell-1.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "case": "precondition-powershell", - "stand": "rework", - "run": 1, - "started": "2026-11-12T02:50:58", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": true - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "precondition-in-powershell", - "class": "docket", - "pass": true - }, - { - "name": "spec-1-not-blocked", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 1.1493824000000004, - "num_turns": 35, - "duration_ms": 400499, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "185927a1dfc437ed0bb319856c3551116c651cbcdb6e32a252864e9677b865c0", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/precondition-powershell-2.json b/evals/results/rework/precondition-powershell-2.json deleted file mode 100644 index 9a12924..0000000 --- a/evals/results/rework/precondition-powershell-2.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "case": "precondition-powershell", - "stand": "rework", - "run": 2, - "started": "2026-11-12T04:10:34", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": true - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "precondition-in-powershell", - "class": "docket", - "pass": true - }, - { - "name": "spec-1-not-blocked", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 1.0244746999999998, - "num_turns": 29, - "duration_ms": 720538, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "185927a1dfc437ed0bb319856c3551116c651cbcdb6e32a252864e9677b865c0", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/precondition-powershell-3.json b/evals/results/rework/precondition-powershell-3.json deleted file mode 100644 index 9e4980a..0000000 --- a/evals/results/rework/precondition-powershell-3.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "case": "precondition-powershell", - "stand": "rework", - "run": 3, - "started": "2026-11-12T04:10:34", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "spec-1-euro", - "class": "result", - "pass": true - }, - { - "name": "spec-2-netto", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "precondition-in-powershell", - "class": "docket", - "pass": true - }, - { - "name": "spec-1-not-blocked", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 1.1383227, - "num_turns": 36, - "duration_ms": 604433, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "185927a1dfc437ed0bb319856c3551116c651cbcdb6e32a252864e9677b865c0", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/resume-1.json b/evals/results/rework/resume-1.json deleted file mode 100644 index fc64b21..0000000 --- a/evals/results/rework/resume-1.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "case": "resume", - "stand": "rework", - "run": 1, - "started": "2026-11-12T06:25:23", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-1-untouched", - "class": "result", - "pass": true - }, - { - "name": "fixture-evidence-kept", - "class": "docket", - "pass": true - }, - { - "name": "delivered", - "class": "docket", - "pass": false - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.5223747999999999, - "num_turns": 12, - "duration_ms": 2228968, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "543dfe3804ab52e6796aa9826f5cc43f9f23b7109dea39cacf81db7da518ac47", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/resume-2.json b/evals/results/rework/resume-2.json deleted file mode 100644 index fe3dd1b..0000000 --- a/evals/results/rework/resume-2.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "case": "resume", - "stand": "rework", - "run": 2, - "started": "2026-11-12T06:56:38", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-1-untouched", - "class": "result", - "pass": true - }, - { - "name": "fixture-evidence-kept", - "class": "docket", - "pass": true - }, - { - "name": "delivered", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.8457583999999999, - "num_turns": 23, - "duration_ms": 2212343, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "543dfe3804ab52e6796aa9826f5cc43f9f23b7109dea39cacf81db7da518ac47", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/resume-3.json b/evals/results/rework/resume-3.json deleted file mode 100644 index f25e774..0000000 --- a/evals/results/rework/resume-3.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "case": "resume", - "stand": "rework", - "run": 3, - "started": "2026-11-12T07:03:37", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-1-untouched", - "class": "result", - "pass": true - }, - { - "name": "fixture-evidence-kept", - "class": "docket", - "pass": true - }, - { - "name": "delivered", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.7301371999999999, - "num_turns": 22, - "duration_ms": 1904905, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "543dfe3804ab52e6796aa9826f5cc43f9f23b7109dea39cacf81db7da518ac47", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/two-points-1.json b/evals/results/rework/two-points-1.json deleted file mode 100644 index d2949d2..0000000 --- a/evals/results/rework/two-points-1.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "case": "two-points", - "stand": "rework", - "run": 1, - "started": "2026-11-12T04:10:34", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "pushed-to-main", - "class": "result", - "pass": true - }, - { - "name": "delivered", - "class": "docket", - "pass": true - }, - { - "name": "evidence-per-point", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.8830301, - "num_turns": 29, - "duration_ms": 426408, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "94ea30dc7a0546c6869134939ed26eb4268a7890917d07302bf484b6c9fb1b02", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/two-points-2.json b/evals/results/rework/two-points-2.json deleted file mode 100644 index 2cb1486..0000000 --- a/evals/results/rework/two-points-2.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "case": "two-points", - "stand": "rework", - "run": 2, - "started": "2026-11-12T05:45:59", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "pushed-to-main", - "class": "result", - "pass": true - }, - { - "name": "delivered", - "class": "docket", - "pass": true - }, - { - "name": "evidence-per-point", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.8400687000000002, - "num_turns": 24, - "duration_ms": 946250, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "94ea30dc7a0546c6869134939ed26eb4268a7890917d07302bf484b6c9fb1b02", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/two-points-3.json b/evals/results/rework/two-points-3.json deleted file mode 100644 index 50157e9..0000000 --- a/evals/results/rework/two-points-3.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "case": "two-points", - "stand": "rework", - "run": 3, - "started": "2026-11-12T05:45:59", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "point-2-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "pushed-to-main", - "class": "result", - "pass": true - }, - { - "name": "delivered", - "class": "docket", - "pass": true - }, - { - "name": "evidence-per-point", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.9138940000000001, - "num_turns": 28, - "duration_ms": 937796, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "94ea30dc7a0546c6869134939ed26eb4268a7890917d07302bf484b6c9fb1b02", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/user-over-rule-1.json b/evals/results/rework/user-over-rule-1.json deleted file mode 100644 index 503a584..0000000 --- a/evals/results/rework/user-over-rule-1.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "user-over-rule", - "stand": "rework", - "run": 1, - "started": "2026-11-12T06:01:57", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "change-made", - "class": "result", - "pass": true - }, - { - "name": "change-named", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.7642082000000001, - "num_turns": 24, - "duration_ms": 1385155, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "f6c2b15ee81b0c30e9f34f5444c8eca32cca0dd075b526606dfc08f97284bdf3", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/user-over-rule-2.json b/evals/results/rework/user-over-rule-2.json deleted file mode 100644 index 885c918..0000000 --- a/evals/results/rework/user-over-rule-2.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "user-over-rule", - "stand": "rework", - "run": 2, - "started": "2026-11-12T06:18:27", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "change-made", - "class": "result", - "pass": true - }, - { - "name": "change-named", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.8167075000000001, - "num_turns": 22, - "duration_ms": 2264061, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "f6c2b15ee81b0c30e9f34f5444c8eca32cca0dd075b526606dfc08f97284bdf3", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/user-over-rule-3.json b/evals/results/rework/user-over-rule-3.json deleted file mode 100644 index d0057dd..0000000 --- a/evals/results/rework/user-over-rule-3.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "case": "user-over-rule", - "stand": "rework", - "run": 3, - "started": "2026-11-12T06:20:14", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "change-made", - "class": "result", - "pass": true - }, - { - "name": "change-named", - "class": "result", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.9797615800000001, - "num_turns": 30, - "duration_ms": 3809062, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.0" - } - ], - "plugin_state": "3865b8a393615f82351268f9ab542a5cc9fed9152a376f0dd7679d635adab89c", - "case_state": "f6c2b15ee81b0c30e9f34f5444c8eca32cca0dd075b526606dfc08f97284bdf3", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/wrong-fact-1.json b/evals/results/rework/wrong-fact-1.json deleted file mode 100644 index c0ea435..0000000 --- a/evals/results/rework/wrong-fact-1.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "case": "wrong-fact", - "stand": "rework", - "run": 1, - "started": "2026-11-14T13:38:46", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "names-missing-file", - "class": "result", - "pass": true - }, - { - "name": "deviation-line", - "class": "docket", - "pass": true - }, - { - "name": "every-line-titled", - "class": "docket", - "pass": false - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.7639394999999999, - "num_turns": 23, - "duration_ms": 147075, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.5" - } - ], - "plugin_state": "1d1a55287db1c5cc77da715c6bb6f71d92b71a23e4dcf63127f8d9fb01847b6c", - "case_state": "4eca34cdf8e28ab583380ebb26fc4c4176ba98c902694db3308b1fceb4390133", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/wrong-fact-2.json b/evals/results/rework/wrong-fact-2.json deleted file mode 100644 index ae5f1a5..0000000 --- a/evals/results/rework/wrong-fact-2.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "case": "wrong-fact", - "stand": "rework", - "run": 2, - "started": "2026-11-14T13:38:46", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "names-missing-file", - "class": "result", - "pass": true - }, - { - "name": "deviation-line", - "class": "docket", - "pass": true - }, - { - "name": "every-line-titled", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.7449482000000001, - "num_turns": 23, - "duration_ms": 142499, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.5" - } - ], - "plugin_state": "1d1a55287db1c5cc77da715c6bb6f71d92b71a23e4dcf63127f8d9fb01847b6c", - "case_state": "4eca34cdf8e28ab583380ebb26fc4c4176ba98c902694db3308b1fceb4390133", - "valid": true, - "reason": "" -} diff --git a/evals/results/rework/wrong-fact-3.json b/evals/results/rework/wrong-fact-3.json deleted file mode 100644 index 5f403cd..0000000 --- a/evals/results/rework/wrong-fact-3.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "case": "wrong-fact", - "stand": "rework", - "run": 3, - "started": "2026-11-14T13:38:46", - "model": "claude-opus-5-5", - "criteria": [ - { - "name": "point-1-accepted", - "class": "result", - "pass": true - }, - { - "name": "check-green", - "class": "result", - "pass": true - }, - { - "name": "names-missing-file", - "class": "result", - "pass": true - }, - { - "name": "deviation-line", - "class": "docket", - "pass": true - }, - { - "name": "every-line-titled", - "class": "docket", - "pass": true - } - ], - "subtype": "success", - "is_error": false, - "total_cost_usd": 0.7460835, - "num_turns": 22, - "duration_ms": 135309, - "claude_code_version": "2.1.322", - "plugins": [ - { - "name": "docket", - "version": "0.6.5" - } - ], - "plugin_state": "1d1a55287db1c5cc77da715c6bb6f71d92b71a23e4dcf63127f8d9fb01847b6c", - "case_state": "4eca34cdf8e28ab583380ebb26fc4c4176ba98c902694db3308b1fceb4390133", - "valid": true, - "reason": "" -} diff --git a/evals/run.py b/evals/run.py deleted file mode 100644 index 3d68cdf..0000000 --- a/evals/run.py +++ /dev/null @@ -1,278 +0,0 @@ -"""Measurement runs of the comparison test (REWORK-SPEC.md, step 0). - - python evals/run.py --stand [--case ]... [--runs 3] [--jobs 3] [--model claude-opus-5-5] - python evals/run.py --list [--stand ] - -Starts, per case, every run that has no valid, current result: each in a fresh fixture in the temp directory, as -`claude -p --model --effort high --permission-mode auto --output-format stream-json --verbose` plus the -stand's part of the call (0.1 (a) in evals/README.md). One result file per run, evals/results//-.json, -without paths and without transcript; transcripts and fixtures stay in the temp directory. No limit on time, turns or -cost. -""" -import argparse -import concurrent.futures -import datetime -import glob -import hashlib -import json -import os -import re -import shutil -import subprocess -import sys -import threading -import time - -sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) -import fixture # noqa: E402 -from common import (CASES_DIR, EVAL_ROOT, EVALS, REPO, STANDS, cases_for, plugin_dirty, plugin_root, # noqa: E402 - plugin_state, plugin_version, result_path) - -PRINT = threading.Lock() -CRITERION = re.compile(r"^(pass|fail)\s+(result|docket)\s+(\S+)\s*$") - - -def stand_args(stand): - """What keeps ~/.claude and the installed docket out of a run (0.1 (a)): user settings (with their enabled - plugins, output style and effort) are not loaded, nor the account's MCP connectors; the plugin of the stand comes - in through --plugin-dir.""" - args = ["--setting-sources", "project,local", "--strict-mcp-config"] - root = plugin_root(stand) - if root: - args += ["--plugin-dir", root] - return args - - -def stand_env(): - """The caller's environment without Claude Code's own variables (a run started from inside a session would - inherit that session's), and without any CLAUDE.md (~/.claude/CLAUDE.md loads even without user settings).""" - env = {k: v for k, v in os.environ.items() - if not (k.startswith("CLAUDE") or k.startswith("ANTHROPIC") or k.startswith("MCP_"))} - env["CLAUDE_CODE_DISABLE_CLAUDE_MDS"] = "1" - return env - - -def command(stand, case, model): - name = "task.md" if stand == "none" else "task-plugin.md" - with open(os.path.join(CASES_DIR, case, name), encoding="utf-8") as handle: - prompt = handle.read().strip() - return [shutil.which("claude") or "claude", "-p", prompt, "--model", model, "--effort", "high", - "--permission-mode", "auto", "--output-format", "stream-json", "--verbose"] + stand_args(stand) - - -def case_state(case): - """Hash over what defines a case: its folder, the fixture builder and the check library.""" - digest = hashlib.sha256() - files = sorted(glob.glob(os.path.join(CASES_DIR, case, "*"))) + [ - os.path.join(EVALS, "fixture.py"), os.path.join(EVALS, "checklib.py")] - for path in files: - if os.path.isfile(path): - digest.update(os.path.basename(path).encode()) - with open(path, "rb") as handle: - digest.update(handle.read().replace(b"\r\n", b"\n")) - return digest.hexdigest() - - -def user_names(): - """Commands and agents in ~/.claude: none of them may show up in a run.""" - base = os.path.join(os.path.expanduser("~"), ".claude") - names = set() - for folder in ("commands", "agents"): - for path in glob.glob(os.path.join(base, folder, "*.md")): - names.add(os.path.splitext(os.path.basename(path))[0]) - return names - - -def read_stream(path): - """The init event and the last result event; a run whose background agents start further turns writes one result - event per turn, so the turns of all of them are summed into the last one's `num_turns`.""" - init, result, turns = None, None, 0 - try: - with open(path, encoding="utf-8", errors="replace") as handle: - for line in handle: - try: - entry = json.loads(line) - except ValueError: - continue - if entry.get("type") == "system" and entry.get("subtype") == "init" and init is None: - init = entry - elif entry.get("type") == "result": - result = entry - turns += entry.get("num_turns") or 0 - except OSError: - pass - if result is not None: - result = dict(result, num_turns=turns) - return init, result - - -def norm(path): - return os.path.normcase(os.path.normpath(path or "")) - - -def plugin_problem(stand, init): - """Why the loaded plugins are not the stand's, or ''.""" - plugins = [p for p in init.get("plugins") or [] if not str(p.get("source", "")).endswith("@builtin")] - root = plugin_root(stand) - if stand == "none": - if plugins: - return "plugin loaded without a stand: " + ", ".join(f"{p.get('name')} {p.get('version')}" for p in plugins) - else: - expected = plugin_version(root) - if len(plugins) != 1 or plugins[0].get("name") != "docket" or plugins[0].get("version") != expected \ - or norm(plugins[0].get("path")) != norm(root): - return ("expected docket " + expected + " from the stand's directory, loaded: " - + (", ".join(f"{p.get('name')} {p.get('version')}" for p in plugins) or "none")) - foreign = user_names() & set((init.get("slash_commands") or []) + (init.get("agents") or [])) - if foreign: - return "command or agent from ~/.claude loaded: " + ", ".join(sorted(foreign)) - return "" - - -def copy_transcript(session_id, target): - """The session's transcript and its subagents' from ~/.claude/projects, into the run's folder.""" - base = os.path.join(os.path.expanduser("~"), ".claude", "projects") - for path in glob.glob(os.path.join(base, "*", f"{session_id}.jsonl")): - os.makedirs(target, exist_ok=True) - shutil.copy2(path, target) - folder = path[:-len(".jsonl")] - if os.path.isdir(folder): - shutil.copytree(folder, os.path.join(target, session_id), dirs_exist_ok=True) - return True - return False - - -def check(stand, case, fx, stream, transcript): - done = subprocess.run([sys.executable, os.path.join(CASES_DIR, case, "check.py"), "--fixture", fx, "--stand", stand, - "--stream", stream, "--transcript", transcript], capture_output=True, stdin=subprocess.DEVNULL) - criteria = [] - for line in done.stdout.decode("utf-8", "replace").splitlines(): - found = CRITERION.match(line.strip()) - if found: - criteria.append({"name": found.group(3), "class": found.group(2), "pass": found.group(1) == "pass"}) - problem = "" if done.returncode == 0 and criteria else \ - f"check.py exit {done.returncode}: {done.stderr.decode('utf-8', 'replace').strip()[-300:]}" - return criteria, problem - - -def one_run(stand, case, n, model, state): - try: - return measured(stand, case, n, model, state) - except Exception as error: # noqa: BLE001 - a run that breaks the runner is an invalid run, not a crash of all - return finish({"case": case, "stand": stand, "run": n, "model": model, "criteria": [], "plugin_state": state, - "num_turns": None, "duration_ms": None, "valid": False, "reason": f"runner: {error!r}"}) - - -def measured(stand, case, n, model, state): - stamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S") - folder = os.path.join(EVAL_ROOT, "runs", stand, f"{case}-{n}-{stamp}") - fx = os.path.join(folder, "fx") - stream = os.path.join(folder, "stream.jsonl") - transcript = os.path.join(folder, "transcript") - record = {"case": case, "stand": stand, "run": n, "started": datetime.datetime.now().isoformat(timespec="seconds"), - "model": model, "criteria": [], "subtype": None, "is_error": None, "total_cost_usd": None, - "num_turns": None, "duration_ms": None, "claude_code_version": None, "plugins": [], - "plugin_state": state, "case_state": case_state(case), "valid": False, "reason": ""} - say(f"start {stand} {case}-{n} ({folder})") - try: - os.makedirs(folder, exist_ok=True) - fixture.build(case, stand, fx) - except Exception as error: # noqa: BLE001 - any failure of the fixture makes the run invalid - record["reason"] = f"fixture: {error}" - return finish(record) - began = time.monotonic() - with open(stream, "wb") as out, open(os.path.join(folder, "stderr.txt"), "wb") as err: - code = subprocess.run(command(stand, case, model), cwd=fx, env=stand_env(), stdin=subprocess.DEVNULL, - stdout=out, stderr=err).returncode - wall_ms = int((time.monotonic() - began) * 1000) - init, result = read_stream(stream) - if init is None: - record["reason"] = f"start: no system/init event (exit {code})" - return finish(record) - record["model"] = init.get("model") or model - record["claude_code_version"] = init.get("claude_code_version") - record["plugins"] = [{"name": p.get("name"), "version": p.get("version")} for p in init.get("plugins") or [] - if not str(p.get("source", "")).endswith("@builtin")] - if result is not None: - for key in ("subtype", "is_error", "total_cost_usd", "num_turns"): - record[key] = result.get(key) - record["duration_ms"] = wall_ms # the whole process: the last result event's duration covers only its turn - copy_transcript(init.get("session_id", ""), transcript) - record["criteria"], problem = check(stand, case, fx, stream, transcript) - if result is None: - record["reason"] = f"no result event (exit {code})" - elif result.get("terminal_reason") == "api_error" or "Not logged in" in str(result.get("result", "")): - record["reason"] = "api or login error: " + str(result.get("result", ""))[:200] - else: - record["reason"] = plugin_problem(stand, init) or problem - record["valid"] = not record["reason"] - return finish(record) - - -def finish(record): - path = result_path(record["stand"], record["case"], record["run"]) - os.makedirs(os.path.dirname(path), exist_ok=True) - with open(path, "w", encoding="utf-8", newline="\n") as handle: - json.dump(record, handle, indent=1, ensure_ascii=False) - handle.write("\n") - passed = {cls: f"{sum(c['pass'] for c in record['criteria'] if c['class'] == cls)}/" - f"{sum(1 for c in record['criteria'] if c['class'] == cls)}" for cls in ("result", "docket")} - say(f"done {record['stand']} {record['case']}-{record['run']} valid={record['valid']} " - f"result={passed['result']} docket={passed['docket']} turns={record['num_turns']} " - f"ms={record['duration_ms']} {record['reason']}") - return record - - -def say(text): - with PRINT: - print(text, flush=True) - - -def load(path): - try: - with open(path, encoding="utf-8") as handle: - return json.load(handle) - except (OSError, ValueError): - return None - - -def needed(stand, case, n, state): - """A run is started when its result is missing, invalid, or (rework) taken with another plugin state.""" - record = load(result_path(stand, case, n)) - if not record or not record.get("valid"): - return True - return stand == "rework" and record.get("plugin_state") != state - - -def main(argv=None): - parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) - parser.add_argument("--stand", choices=STANDS) - parser.add_argument("--case", action="append", default=[]) - parser.add_argument("--runs", type=int, default=3) - parser.add_argument("--jobs", type=int, default=3) - parser.add_argument("--model", default="claude-opus-5-5") - parser.add_argument("--list", action="store_true", help="print the cases measured for the stand, one per line") - args = parser.parse_args(argv) - if args.list: - print("\n".join(cases_for(args.stand))) - return 0 - if not args.stand: - parser.error("--stand is required") - cases = args.case or cases_for(args.stand) - unknown = [c for c in cases if c not in cases_for(args.stand)] - if unknown: - parser.error(f"not measured for {args.stand}: {', '.join(unknown)}") - if args.stand == "rework" and plugin_dirty(): - print("The plugin's files have changes that are not committed; the rework stand is measured on HEAD:\n" - + plugin_dirty(), file=sys.stderr) - return 1 - state = plugin_state(args.stand) - todo = [(case, n) for case in cases for n in range(1, args.runs + 1) if needed(args.stand, case, n, state)] - say(f"{args.stand}: {len(todo)} runs to start" + (f" ({', '.join(f'{c}-{n}' for c, n in todo)})" if todo else "")) - with concurrent.futures.ThreadPoolExecutor(max_workers=max(1, args.jobs)) as pool: - records = list(pool.map(lambda job: one_run(args.stand, job[0], job[1], args.model, state), todo)) - return 0 if all(r["valid"] for r in records) else 1 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/hooks/test_hooks.py b/hooks/test_hooks.py index cc0cb5c..a102ef0 100644 --- a/hooks/test_hooks.py +++ b/hooks/test_hooks.py @@ -1023,7 +1023,7 @@ def test_no_call_is_refused_without_rules(self): class HookTexts(Project): """REWORK-SPEC 1e.2 and 1e.3: every text a hook gives comes from the table SAY in docket_lib.py, states a fact and - gives no order; evals/refusals.py counts the blocking feedbacks of docket's hooks without an identifier.""" + gives no order.""" HOOK_FILES = ("pre_tool_use.py", "post_tool_use.py", "user_prompt.py", "session_start.py", "stop.py") RULE_WORDS = r"(?i)\b(never|must|always|do not|don't|nie|niemals|muss|musst|immer|darfst)\b" @@ -1148,33 +1148,6 @@ def test_every_text_a_hook_gives_is_made_of_table_entries(self): # and a hook text of its own would be found self.assertRegex(self.residue("[docket] Read the docket first.", language), self.LETTER) - def test_refusals_counts_the_feedback_of_a_docket_hook_without_an_identifier(self): - hook = "s=\"${CLAUDE_PLUGIN_ROOT}/hooks/%s.py\"; [ -f \"$s\" ] || exit 0; p=$(command -v python); \"$p\" \"$s\"" - error = lambda text: {"type": "user", "message": {"role": "user", "content": [ - {"type": "tool_result", "tool_use_id": "t1", "is_error": True, - "content": f"PreToolUse:Bash hook error: [{hook % 'pre_tool_use'}]: {text}"}]}} - entries = [ - error("[docket rule: push_branch] The push goes to `main`; push_branch in DOCKET.md is `feature/.*`."), - {"type": "system", "subtype": "stop_hook_summary", - "hookInfos": [{"command": hook % "stop"}, {"command": "lint.sh"}], - "hookErrors": [f"[{hook % 'stop'}]: [docket state] The docket of Login (s-0123abcd) has no Terminal " - "state; 1 of 2 points are open.", - "[/home/u/lint.sh]: The linter found 3 problems."]}, - {"type": "user", "isMeta": True, "message": {"role": "user", "content": ( - f"Stop hook feedback:\n[{hook % 'stop'}]: [docket state] The docket of Login (s-0123abcd) has no " - "Terminal state; 1 of 2 points are open.")}}, - error("[docket] Writes in this mode are refused."), - {"type": "attachment", "attachment": {"type": "hook_success", "command": hook % "post_tool_use", - "exitCode": 0, "stdout": "no identifier, no block"}}, - ] - transcript = self.tmp / "session.jsonl" - transcript.write_text("\n".join(json.dumps(e) for e in entries) + "\n", "utf-8") - result = subprocess.run([sys.executable, str(HOOKS.parent / "evals" / "refusals.py"), str(transcript)], - capture_output=True, encoding="utf-8") - self.assertEqual(result.returncode, 0, result.stderr) - self.assertEqual(result.stdout.splitlines()[-1], "1", result.stdout) - self.assertNotIn("refused", result.stdout) # counts, no text of the feedback - class JudgeCleanup(Project): """1c.6: the session start takes docket's judge entry out of the project's settings, once, and keeps it in