From 650b9041b0201c6c4bd84a9cba1711e79f29947c Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 1 Dec 2026 16:55:51 +0100 Subject: [PATCH 1/4] Fix the clock of the usage-limit wait test --- bin/loop_claude/test_black_box.py | 9 +++++++-- docs/reading-cost.md | 10 ++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/bin/loop_claude/test_black_box.py b/bin/loop_claude/test_black_box.py index 7b0d0ab8..92388521 100644 --- a/bin/loop_claude/test_black_box.py +++ b/bin/loop_claude/test_black_box.py @@ -141,6 +141,9 @@ if os.path.basename(sys.argv[0]) == "loop-claude": record({"argv": sys.argv[1:]}) pause = time.sleep time.sleep = lambda seconds: record({"sleep": seconds}) if seconds >= 1 else pause(seconds) + # A test that sets LOOP_TEST_NOW fixes the loop's wall clock at that many seconds since the epoch. + if "LOOP_TEST_NOW" in os.environ: + time.time = lambda: float(os.environ["LOOP_TEST_NOW"]) # The host's own memory doesn't matter: every read finds all of it available. sys.path.insert(0, os.path.dirname(os.path.realpath(sys.argv[0]))) import pathlib @@ -704,13 +707,15 @@ class Cycles(unittest.TestCase): def test_waits_out_a_usage_limit_which_ends_a_run_of_failures(self): checkout = Checkout(self) checkout.env["TZ"] = "UTC" - resets_at = int(time.time()) + 3600 + now = 1_800_000_000 + checkout.env["LOOP_TEST_NOW"] = str(now) + resets_at = now + 3600 rejected = json.dumps({"type": "rate_limit_event", "rate_limit_info": {"status": "rejected", "resetsAt": resets_at}}) limited = json.dumps({"type": "result", "api_error_status": 429, "is_error": True, "result": "You've hit your session limit"}) run = checkout.run([worker(exit=1), worker(exit=1), worker(stream=f"{rejected}\n{limited}\n", result=False, exit=1), worker(exit=1), worker(), judge(stdout=limited, exit=1), judge()]) self.assertEqual(run.code, 130) self.assertEqual(run.roles(), ["worker"] * 5 + ["judge"] * 2 + ["worker"]) - self.assertEqual([round(seconds, -1) for seconds in run.sleeps], [60, 60, 3720, 60, 600]) + self.assertEqual(run.sleeps, [60, 60, 3720, 60, 600]) self.assertIn(f"the worker hit a usage limit (You've hit your session limit); retrying at {datetime.datetime.fromtimestamp(resets_at + 120, datetime.timezone.utc):%Y-%m-%d %H:%M:%S}\n", run.stderr) self.assertIn("the judge hit a usage limit (You've hit your session limit); retrying at ", run.stderr) diff --git a/docs/reading-cost.md b/docs/reading-cost.md index 3778a071..b3ba5b08 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -3864,3 +3864,13 @@ Read most (opens and searches): Read most (opens and searches): - `agents/stability-reviewer.md` 1 + +## Reading cost, chunk 180918d0d6c2, finished 2026-12-01T15:54:50Z + +122282 new input tokens before the first commit. + +Read most (opens and searches): + +- `docs/decisions.md` 18 +- `todo.md` 12 +- `README.md` 4 -- 2.52.0 From 4af3edbfa53ea60056b87cfb40a0a793ecfbe865 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 1 Dec 2026 16:58:15 +0100 Subject: [PATCH 2/4] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20approved,?= =?UTF-8?q?=20nothing=20to=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 73c0d592459320733e0c1d7b346988a002cd19a5 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 1 Dec 2026 16:58:15 +0100 Subject: [PATCH 3/4] =?UTF-8?q?Answer=20prose=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20reword=20th?= =?UTF-8?q?e=20clock=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/loop_claude/test_black_box.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/loop_claude/test_black_box.py b/bin/loop_claude/test_black_box.py index 92388521..5da494f3 100644 --- a/bin/loop_claude/test_black_box.py +++ b/bin/loop_claude/test_black_box.py @@ -141,7 +141,7 @@ if os.path.basename(sys.argv[0]) == "loop-claude": record({"argv": sys.argv[1:]}) pause = time.sleep time.sleep = lambda seconds: record({"sleep": seconds}) if seconds >= 1 else pause(seconds) - # A test that sets LOOP_TEST_NOW fixes the loop's wall clock at that many seconds since the epoch. + # LOOP_TEST_NOW pins the loop's wall clock to that many seconds since the epoch. if "LOOP_TEST_NOW" in os.environ: time.time = lambda: float(os.environ["LOOP_TEST_NOW"]) # The host's own memory doesn't matter: every read finds all of it available. -- 2.52.0 From fdbd81e4f24379dc7928ce7e280baa8124b0f478 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 1 Dec 2026 16:59:00 +0100 Subject: [PATCH 4/4] Finish item 570 in the plan --- todo.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/todo.md b/todo.md index efc1a076..1199f16f 100644 --- a/todo.md +++ b/todo.md @@ -12,7 +12,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| -| 570 | 0.17.0 | | defect | **Make `test_waits_out_a_usage_limit_which_ends_a_run_of_failures` pass whatever the time of day; today it fails on some runs by ten seconds.** | 1 | 1 | 1 | 1 | 1 | code health by 2 | 2.9 | | 567 | 0.17.0 | | | **Make product-owner-reviewer report each sentence of the change that states a behaviour no code makes true yet, including one a later plan item will make true.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 0.7 | | 569 | 0.17.0 | | | **Rerun the stability pass on a fix for a 🟡 that adds a new unit of behaviour, such as a guard or shared state; today no pass reads it.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 0.7 | | 568 | 0.17.0 | | | **Make the prose and product-owner reviewers flag a number, threshold or "noise" claim in a README that no measurement in the change supports, and a measurement note that omits what it leaves out.** | 1 | 2 | 1 | 2 | 2 | 1.1 by 2 | 0.7 | @@ -112,10 +111,6 @@ ## Details -### 570. Make `test_waits_out_a_usage_limit_which_ends_a_run_of_failures` pass whatever the time of day; today it fails on some runs by ten seconds. - -`bin/loop_claude/test_black_box.py:713` expected the waits `[60, 60, 3720, 60, 600]` and got `[60, 60, 3710.0, 60, 600]` in CI run 7565, on a pull request that changed only `todo.md`. The wait until the usage limit resets seems to depend on the wall clock at the moment the test runs. Give the test a fixed clock, so the wait is the same on every run. - ### 567. Make product-owner-reviewer report each sentence of the change that states a behaviour no code makes true yet, including one a later plan item will make true. An outside reviewer caught what our review missed. A chunk added a doc paragraph that promised an effect, which held for one output and not for another. The product-owner reviewer had seen the gap and left it out of its report because a plan item already covers the missing half. The plan item makes the promise true later; until it ships, the paragraph the chunk adds is false for a reader who relies on it. -- 2.52.0