From 1a5cf15a6089258699f65a45606a5805352cda04 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 8 Nov 2026 19:08:44 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20prose=20round=201:=200=20=F0=9F=94=B4,?= =?UTF-8?q?=201=20=F0=9F=9F=A1=20(0=20misread);=20complete=20route=5Ffrom'?= =?UTF-8?q?s=20docstring,=20trim=20the=20rung=20comment=20and=20the=20test?= =?UTF-8?q?=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/loop_claude/test_loop_claude.py | 2 +- bin/model_routing/ladder.py | 2 +- bin/model_routing/route.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/loop_claude/test_loop_claude.py b/bin/loop_claude/test_loop_claude.py index 99f32f72..492cdb25 100644 --- a/bin/loop_claude/test_loop_claude.py +++ b/bin/loop_claude/test_loop_claude.py @@ -1156,7 +1156,7 @@ class Routing(unittest.TestCase): def test_leaves_the_count_of_unfinished_verdicts_out_of_the_worker_line_so_a_rerun_restarts_it(self): self.assertEqual(route_from(Route(self.HIGH, 3, 4, 5, unfinished=1).worker_line()), Route(self.HIGH, 3, 4, 5)) - def test_reads_no_route_from_a_worker_line_that_is_no_json_or_has_unknown_or_mistyped_fields_or_levels_off_their_scales(self): + def test_reads_no_route_from_a_worker_line_that_route_worker_line_could_not_have_written(self): for line in ('{"effort": "high"}', '{"model": "claude-opus-5-5", "effort": "high", "unfinished": 1}', '{"model": "claude-opus-5-5", "item": "3"}', '{"model": "claude-opus-5-5", "effort": 3}', '{"model": 5}', '{"model": "claude-opus-5-5", "effort": "high", "escalated_at": -3}', '{"model": "claude-opus-5-5", "item": true, "likelihood": 4, "escape_and_impact": 5}', '{"model": "claude-opus-5-5", "effort": "high", "item": 3, "likelihood": 5, "escape_and_impact": 5}', '{"model": "claude-opus-5-5", "effort": "high", "escape_and_impact_taken_in": 9}', '["claude-opus-5-5"]', '{"model": ', "worker-model", "claude-opus-5-5 at high effort, routed by item 3's L of 4 and E + I of 5"): with self.subTest(line=line): self.assertIsNone(route_from(line)) diff --git a/bin/model_routing/ladder.py b/bin/model_routing/ladder.py index 12a7e55d..b0cd1b77 100644 --- a/bin/model_routing/ladder.py +++ b/bin/model_routing/ladder.py @@ -36,7 +36,7 @@ class Rung: return Rung(model, effort) return Rung(family.model, effort) if effort else family - # The one spelling of a rung. loop-claude hands it to rule-hook in environment variables, so parse must keep reading it. + # loop-claude hands a rung to rule-hook in environment variables in this spelling, so parse must keep reading it. def __str__(self) -> str: return f"{self.model} at {self.effort} effort" if self.effort else self.model diff --git a/bin/model_routing/route.py b/bin/model_routing/route.py index d9abda54..a435db6b 100644 --- a/bin/model_routing/route.py +++ b/bin/model_routing/route.py @@ -1,4 +1,4 @@ -"""A chunk's route: its worker's rung and the plan item that picked it. The archive keeps the route as JSON on the Worker: line that ends each outcome.""" +"""A chunk's route: its worker's rung and the plan item that picked it. The archive keeps the route as JSON on the Worker: line that ends each verdict, interrupt, quoted answer, stop and step-up.""" import dataclasses import json import typing @@ -79,7 +79,7 @@ WORKER_LINE_FIELDS = tuple(field.name for field in dataclasses.fields(Route) if def route_from(worker: str) -> Route | None: - """The route an archived worker line names. None where the line isn't JSON, names no model, holds fields Route.worker_line never writes, or holds levels off their scales.""" + """The route an archived worker line names; None for a line Route.worker_line could not have written, such as text that isn't JSON.""" fields = json_fields(worker) if fields is None or not Route.fits(fields): return None