Answer architecture round 1: 1 🔴, 2 🟡; share one rung search between both replays, searching down from the project's rung, name the sixth git runner in item 114, decline recording the reviewed commit

This commit is contained in:
2026-10-15 20:52:50 +02:00
parent ae7161d2f4
commit 4f722d94f4
21 changed files with 398 additions and 321 deletions
+6 -31
View File
@@ -10,10 +10,10 @@ import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from stability_replay.rounds import authored_by, recorded_findings, Replay, replayed, report, reviewed_path, Round, round_from, sample, Tried
from stability_replay.rounds import authored_by, recorded_findings, report, reviewed_path, Round, round_from, sample
from loop_claude.effects import Effects, system_effects
from loop_claude.cycle.retry import Limited
from stability_replay import main
from rung_replay.search import Miss, Replay, Tried
from model_routing.ladder import Rung
TOOL = pathlib.Path(__file__).resolve().parents[1] / "stability-replay"
@@ -82,35 +82,10 @@ class Sample(unittest.TestCase):
self.assertEqual(sample(rounds, 2), [rounds[0], rounds[2]])
class Replayed(unittest.TestCase):
def test_holds_each_rung_highest_first_to_what_the_reference_found_and_stops_at_the_first_that_misses(self):
rounds = [a_round(1, ("🔴 a", "🟡 b")), a_round(2, ("🔴 c",))]
found = {REFERENCE: [{0, 1}, set()], MIDDLE: [{0, 1}], CHEAP: [{1}]}
asked = []
def review_all(on, rung):
asked.append((len(on), rung))
return found[rung]
replay = replayed(rounds, REFERENCE, [MIDDLE, CHEAP, Rung("claude-haiku-5-5", "xhigh")], review_all)
self.assertEqual(replay, Replay(1, [Tried(MIDDLE, []), Tried(CHEAP, [(rounds[0], "🔴 a")])], MIDDLE))
self.assertEqual(asked, [(2, REFERENCE), (1, MIDDLE), (1, CHEAP)])
def test_names_no_rung_when_the_first_misses_or_the_reference_found_nothing(self):
rounds = [a_round(1)]
self.assertEqual(replayed(rounds, REFERENCE, [MIDDLE], lambda on, rung: [{0}] if rung == REFERENCE else [set()]), Replay(0, [Tried(MIDDLE, [(rounds[0], "🔴 a")])], None))
self.assertEqual(replayed(rounds, REFERENCE, [MIDDLE], lambda on, rung: [set()]), Replay(1, [], None))
def test_stops_at_a_usage_limit(self):
limit = Limited(None, "limit")
self.assertEqual(replayed([a_round(1)], REFERENCE, [MIDDLE], lambda on, rung: limit), limit)
self.assertEqual(replayed([a_round(1)], REFERENCE, [MIDDLE], lambda on, rung: [{0}] if rung == REFERENCE else limit), limit)
class Report(unittest.TestCase):
def test_counts_the_findings_and_names_each_miss_and_the_lowest_rung_that_missed_none(self):
rounds = [a_round(1, ("🔴 a", "🟡 b")), a_round(2)]
lines = report("claude-opus-5-5", REFERENCE, rounds, Replay(1, [Tried(MIDDLE, []), Tried(CHEAP, [(rounds[0], "🔴 a\nmore")])], MIDDLE)).splitlines()
rounds = [a_round(1, ("🔴 a\nmore", "🟡 b")), a_round(2)]
lines = report("claude-opus-5-5", REFERENCE, rounds, Replay([{0, 1}, set()], [Tried(MIDDLE, []), Tried(CHEAP, [Miss(rounds[0], 0, {1})])], MIDDLE)).splitlines()
self.assertEqual(lines, [
"Replayed 2 stability rounds of claude-opus-5-5 projects, holding 3 🔴 and 🟡 findings.",
"The reference reviewer, claude-opus-5-5 at medium effort, found 2 of them.",
@@ -119,8 +94,8 @@ class Report(unittest.TestCase):
" /code/p 2026-10-14T10:00:01Z: 🔴 a",
"Lowest rung that finds every finding the reference reviewer finds: claude-sonnet-5-5 at high effort",
])
self.assertEqual(report("claude-opus-5-5", REFERENCE, rounds, Replay(0, [Tried(MIDDLE, [(rounds[1], "🔴 a")])], None)).splitlines()[-1], "Lowest rung that finds every finding the reference reviewer finds: none below the project's rung")
self.assertEqual(report("claude-opus-5-5", REFERENCE, rounds, Replay(3, [], None)).splitlines()[-1], "No rung tried: the reference reviewer found no finding to hold one to.")
self.assertEqual(report("claude-opus-5-5", REFERENCE, rounds, Replay([{0, 1}, {0}], [Tried(MIDDLE, [Miss(rounds[1], 0, set())])], None)).splitlines()[-1], "Lowest rung that finds every finding the reference reviewer finds: none below the project's rung")
self.assertEqual(report("claude-opus-5-5", REFERENCE, rounds, Replay([set(), set()], [], None)).splitlines()[-1], "No rung tried: the reference reviewer found no finding to hold one to.")
def unused(*_):