From ec0b17b03f69811101ceece7f1c2915b7bac6f29 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 10:09:19 +0100 Subject: [PATCH] Sort the new modules' imports, and test a reversal count where every chunk holds one --- bin/loop_claude/cycle/spend.py | 4 ++-- bin/score_outcomes/reversals.py | 4 ++-- bin/score_outcomes/test_score_outcomes.py | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/loop_claude/cycle/spend.py b/bin/loop_claude/cycle/spend.py index 11d085fc..349c42db 100644 --- a/bin/loop_claude/cycle/spend.py +++ b/bin/loop_claude/cycle/spend.py @@ -8,11 +8,11 @@ import pathlib import typing from claude_code.entries import AssistantTurn, Entry -from claude_code.tokens import Tokens, tokens_of -from claude_code.transcript import read_transcript from failure import Failure from routing_figures.prices import PRICES +from claude_code.transcript import read_transcript from transcript_archive.outcomes import SPENT +from claude_code.tokens import Tokens, tokens_of KINDS = "input, cache write 5m, cache write 1h, cache read, output" # Who spent, such as `worker`, `judge` or `Explore "Search the hooks"`, and the model they ran on. diff --git a/bin/score_outcomes/reversals.py b/bin/score_outcomes/reversals.py index 2a613fac..8f0f5b71 100644 --- a/bin/score_outcomes/reversals.py +++ b/bin/score_outcomes/reversals.py @@ -2,10 +2,10 @@ import json import pathlib +from transcript_archive.read import chunk_outcomes, finished_chunks +from transcript_archive.outcomes import CONFIG, reversals, workers from failure import Failure from score_outcomes.results import plural -from transcript_archive.outcomes import CONFIG, reversals, workers -from transcript_archive.read import chunk_outcomes, finished_chunks def reversal_lines(project_archive: pathlib.Path) -> list[str] | Failure: diff --git a/bin/score_outcomes/test_score_outcomes.py b/bin/score_outcomes/test_score_outcomes.py index 4b576894..6e01ee2a 100644 --- a/bin/score_outcomes/test_score_outcomes.py +++ b/bin/score_outcomes/test_score_outcomes.py @@ -505,6 +505,11 @@ class Reversals(unittest.TestCase): chunk_file(archive, "kept", ("2026-11-03T10:00:00Z", outcomes.finished('{"model": "m"}', "e", "j", record=outcomes.Record("c")))) self.assertEqual(reversal_lines(archive), ["- 2026-11-02T12:00:00Z, item 7: 2 reversed", "- The other 1 finished chunk: none."]) + def test_adds_no_line_for_the_others_where_every_chunk_holds_a_reversal(self): + with tempfile.TemporaryDirectory() as root: + chunk_file(pathlib.Path(root), "a", ("2026-11-02T10:00:00Z", outcomes.finished('{"model": "m", "item": 7}', "e", "j", record=outcomes.Record("c", reversed="No.")))) + self.assertEqual(reversal_lines(pathlib.Path(root)), ["- 2026-11-02T10:00:00Z, item 7: 1 reversed"]) + def test_says_all_chunks_have_none_and_names_no_item_the_worker_line_lacks(self): with tempfile.TemporaryDirectory() as root: archive = pathlib.Path(root)