diff --git a/bin/loop_claude/test_black_box.py b/bin/loop_claude/test_black_box.py index 7b0d0ab8..5da494f3 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) + # 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. 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 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.