From 21d507f0c50a403f185e00d4e30197f00c8ea040 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 23 Oct 2026 11:09:51 +0200 Subject: [PATCH] =?UTF-8?q?Answer=20principles=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1;=20give=20the=20true=20reason?= =?UTF-8?q?=20score-outcomes=20keeps=20its=20name,=20name=20archived=5Fkin?= =?UTF-8?q?d=20and=20three=20locals=20by=20what=20they=20hold?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/claude_code/test_claude_code.py | 10 +++++----- bin/judge_replay/replay.py | 12 ++++++------ bin/judge_replay/test_judge_replay.py | 6 +++--- bin/routing_figures/measure.py | 4 ++-- bin/rule_hook/test_rule_hook.py | 4 ++-- docs/decisions.md | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/bin/claude_code/test_claude_code.py b/bin/claude_code/test_claude_code.py index 53f26966..9ba7db64 100644 --- a/bin/claude_code/test_claude_code.py +++ b/bin/claude_code/test_claude_code.py @@ -93,12 +93,12 @@ class Parse(unittest.TestCase): class ClaudeReply(unittest.TestCase): @staticmethod - def claude(*outcomes): + def claude(*results): def run(args, cwd, prompt): - outcome = outcomes[0] - if isinstance(outcome, OSError): - raise outcome - return subprocess.CompletedProcess(args, *outcome) + result = results[0] + if isinstance(result, OSError): + raise result + return subprocess.CompletedProcess(args, *result) return run def test_runs_claude_headless_with_the_args_in_cwd_on_the_prompt(self): diff --git a/bin/judge_replay/replay.py b/bin/judge_replay/replay.py index 0422ec83..b1462ff8 100644 --- a/bin/judge_replay/replay.py +++ b/bin/judge_replay/replay.py @@ -21,7 +21,7 @@ class Case: task: str transcript: pathlib.Path at: str - archived: Kind + archived_kind: Kind def case_from(root: str, outcomes: str, transcript: pathlib.Path) -> Case | None: @@ -40,8 +40,8 @@ def sample(cases: list[Case], per_kind: int) -> list[Case]: seen: collections.Counter[Kind] = collections.Counter() kept = [] for found in sorted(cases, key=lambda found: (found.at, found.root, str(found.transcript)), reverse=True): - seen[found.archived] += 1 - if seen[found.archived] <= per_kind: + seen[found.archived_kind] += 1 + if seen[found.archived_kind] <= per_kind: kept.append(found) return kept[::-1] @@ -64,11 +64,11 @@ def verdict_kind(verdict: Verdict | Failure) -> Kind: def reproduced(case: Case, kind: Kind) -> list[Kind]: """The archived kind, where the reply returns it: a rung is held only to a verdict the reference judge reproduces.""" - return [kind] if kind == case.archived else [] + return [kind] if kind == case.archived_kind else [] def report(model: str, reference: Rung, cases: list[Case], replay: Replay[Case, Kind, Kind]) -> str: - kinds = collections.Counter(found.archived for found in cases) + kinds = collections.Counter(found.archived_kind for found in cases) unreproduced = [(found, kind) for found, kind in zip(cases, replay.on_reference) if not reproduced(found, kind)] lines = [ f"Replayed {len(cases)} verdicts of {model} projects: {', '.join(f'{count} {kind}' for kind, count in sorted(kinds.items()))}.", @@ -86,4 +86,4 @@ def report(model: str, reference: Rung, cases: list[Case], replay: Replay[Case, def missed_lines(missed: list[tuple[Case, Kind]]) -> list[str]: - return [f" {found.root} {found.at}: archived {found.archived}, replayed {kind}" for found, kind in missed] + return [f" {found.root} {found.at}: archived {found.archived_kind}, replayed {kind}" for found, kind in missed] diff --git a/bin/judge_replay/test_judge_replay.py b/bin/judge_replay/test_judge_replay.py index 8ef54a42..4be4b08c 100644 --- a/bin/judge_replay/test_judge_replay.py +++ b/bin/judge_replay/test_judge_replay.py @@ -25,8 +25,8 @@ MIDDLE = Rung("claude-sonnet-5-5", "high") REFERENCE = Rung("claude-opus-5-5", "xhigh") -def case(at, archived): - return Case("/code/p", "Do the next chunk.", TRANSCRIPT, at, archived) +def case(at, archived_kind): + return Case("/code/p", "Do the next chunk.", TRANSCRIPT, at, archived_kind) class CaseFrom(unittest.TestCase): @@ -37,7 +37,7 @@ class CaseFrom(unittest.TestCase): def test_reads_each_kind_of_verdict(self): for verdict in (FINISHED, UNFINISHED, INTERRUPTED, ANSWERED): found = case_from("/code/p", f"Task: t\n\n2026-10-14T10:00:00Z {verdict}\n\nmore\n", TRANSCRIPT) - self.assertEqual(found.archived, verdict) + self.assertEqual(found.archived_kind, verdict) def test_skips_a_copy_with_no_verdict(self): self.assertIsNone(case_from("/code/p", "Task: t\n\n2026-10-14T10:00:00Z Stepped up\n\nWorker: y\n", TRANSCRIPT)) diff --git a/bin/routing_figures/measure.py b/bin/routing_figures/measure.py index 8ad1e507..8bcc9411 100644 --- a/bin/routing_figures/measure.py +++ b/bin/routing_figures/measure.py @@ -125,8 +125,8 @@ def add(tokens: dict[str, collections.Counter[str]], project: str, kind: str, ru tokens["subagent type"][kind] += spent tokens["rung"][rung] += spent # Split whole, the first tools taking the remainder, so the tool table adds up to the others. - for place, tool in enumerate(tools): - tokens["tool"][tool] += spent // len(tools) + (place < spent % len(tools)) + for position, tool in enumerate(tools): + tokens["tool"][tool] += spent // len(tools) + (position < spent % len(tools)) def rung_at(cycles: list[tuple[str, str]], timestamp: str) -> Rung | str: diff --git a/bin/rule_hook/test_rule_hook.py b/bin/rule_hook/test_rule_hook.py index 2636f00a..a3232462 100644 --- a/bin/rule_hook/test_rule_hook.py +++ b/bin/rule_hook/test_rule_hook.py @@ -172,8 +172,8 @@ class Overrides(unittest.TestCase): def test_a_blocked_call_overrides_nothing_yet(self): breaches = [Breach("image-pin", "x", "/r"), Breach("action-pin", "y", "/r")] - checked = check(breaches, "# rule-override image-pin: a", False, False) - self.assertTrue(checked.blocked) + blocked_call = check(breaches, "# rule-override image-pin: a", False, False) + self.assertTrue(blocked_call.blocked) passed = check(breaches[:1], "# rule-override image-pin: a", False, False) self.assertEqual((passed.blocked, passed.overridden), (False, [(breaches[0], "a")])) diff --git a/docs/decisions.md b/docs/decisions.md index 01b275ff..1467c2db 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -2,11 +2,11 @@ ## bin/: an outcome is an entry of a `.outcomes.md` file in loop-claude's archive, a record is a document tools or people keep entries in, and a place is what a comprehension seat names -2026-10-23, larv-review, through PR #367. Serves code health: a reader can trust that one word names one thing in every tool. Before, three tools used each of these words for different things. Each word kept the meaning it already had where renaming costs most: +2026-10-23, larv-review, through PR #367. Serves code health: a reader can trust that one word names one thing in every tool. Before, "record" and "outcome" each named different things in three modules, and "place" in two. Each word kept the meaning it already had where renaming costs most: -- An outcome: the archive's file names end in `.outcomes.md`, and the tools that read them find them by that suffix. score-outcomes' `Outcome` became `Result`, and rule-hook's became `Checked`. score-outcomes' CLI name and printed report keep "outcome", since they are public text. +- An outcome: the archive's file names end in `.outcomes.md`, and the tools that read them find them by that suffix. score-outcomes' `Outcome` became `Result`, and rule-hook's became `Checked`. The command `score-outcomes` keeps its name, since renaming it would be a change of its own: files every project loads, such as `rules/todo-items.md`, name it, and so do decision titles. Its help and report keep the word its name uses. - A record: "judge's records" is a term in `~/.claude/CLAUDE.md` → "Vocabulary", and reading-cost's help calls its file a record. A single item in such a document is an entry; the route the archive keeps is a worker line (`Route.worker_line`). The verb "to record" keeps its plain meaning. -- A place: the comprehension panel's term, also in the Vocabulary. A count of files is called `files`. +- A place: the comprehension panel's term, also in the Vocabulary. reading-cost's `Reading.places`, how often each file was read, became `Reading.files`. Valid while the archive's file names, the Vocabulary and the panel keep these words. @@ -32,7 +32,7 @@ The cap is 5, `bin/todo_table.py`'s `BUNDLE_MAX_R`, from the same chunks: by the 2026-09-20, lilleman. Serves goal 1. Across six projects scored with the four seats, Locality or Self-sufficiency was the lowest dimension at every seat and Navigation at none, so a layout fix would not lift a project under the floor. Valid while the scoring run keeps those four seats. -2026-10-15, lilleman, set by PR #283 on 2026-10-16: an item that lifts the lowest dimension moves each goal it cites by 9, since the lowest dimension caps the overall and lifting it is worth the most to the floor. Within a chunk its work comes first; in the plan, lilleman answering that PR's review, such items compete with the others like any item and don't rank first. PR #257's scoring run found Shape lowest, at 6.25, and `todo.md` item 124, with a since-shipped item giving "record", "outcome" and "places" one meaning each in `bin/`, was to lift it. Release 0.3.0's scoring runs found Locality lowest, at 5.75 and 5.88, so the 9 moved from those items to the ones lifting Locality. +2026-10-15, lilleman, set by PR #283 on 2026-10-16: an item that lifts the lowest dimension moves each goal it cites by 9, since the lowest dimension caps the overall and lifting it is worth the most to the floor. Within a chunk its work comes first; in the plan, lilleman answering that PR's review, such items compete with the others like any item and don't rank first. PR #257's scoring run found Shape lowest, at 6.25, and two items were to lift it: `todo.md` item 124, and the one PR #367 shipped, which gave "record", "outcome" and "place" one meaning each in `bin/`. Release 0.3.0's scoring runs found Locality lowest, at 5.75 and 5.88, so the 9 moved from those items to the ones lifting Locality. ## loop-claude: a `claude` that cannot start is a failed worker run, retried