From 2036fdc05322e9554fe229c819715cc58aee9424 Mon Sep 17 00:00:00 2001 From: Don Petry <36422719+don-petry@users.noreply.github.com> Date: Sun, 8 Nov 2026 21:20:57 -0600 Subject: [PATCH 1/2] The owed Muse reads of #632 and #639: three boundary cases and their mutants #632 (issue 626): the plan places the heads by heads_place, so a heads folder linked into the workspace stops it before it makes anything there. #639 (issue 608): description_anchor takes the records always, with no default; and the world dates an approval by a Run of the item in its own second. Co-Authored-By: Claude Opus 5.5 --- tests/test_decide.py | 3 +++ tests/test_evals.py | 7 +++++++ tests/test_simulator.py | 2 ++ tools/mutants.py | 11 +++++++++++ 4 files changed, 23 insertions(+) diff --git a/tests/test_decide.py b/tests/test_decide.py index 6b3a77a6..18908a6b 100644 --- a/tests/test_decide.py +++ b/tests/test_decide.py @@ -1860,6 +1860,9 @@ def test_an_approval_is_anchored_at_the_act_that_read_the_description(self): # self.assertEqual(d["reason"], "description_edited_after_approval") # A re-run whose dispatch was not read may be the act that read, made before it: nothing shows when, so it holds. unread = dict(act, started_at="2026-10-11T12:30:00Z", rerun_by_dispatcher=False) + # The records are always given: with none, the anchor would be the approval's own time, which issue 608 ended. + with self.assertRaises(TypeError): + derive.description_anchor(facts(reviews=[approval]), "2026-10-11T12:10:00Z") self.assertEqual(derive.description_anchor(facts(reviews=[approval]), "2026-10-11T12:10:00Z", runs=REVIEWED + [unread]), "") d = go(facts(reviews=[approval], description_edited_at="2026-10-11T12:10:00Z"), REVIEWED + [unread]) self.assertEqual(d["reason"], "description_edited_after_approval") diff --git a/tests/test_evals.py b/tests/test_evals.py index 0a0c69a4..61f76580 100644 --- a/tests/test_evals.py +++ b/tests/test_evals.py @@ -2586,6 +2586,13 @@ def __call__(self, args, env, timeout, **given): self.clean() (self.temp / "heldout").mkdir() self.assertEqual(self.step(plan), "scratch_unreadable") + # The plan places the heads by heads_place: a heads folder linked to a place in the workspace that is not there + # yet stops it before it makes anything there (the Muse read of issue 626's change). + self.clean() + os.symlink(str(self.work / "evil"), str(self.temp / "heads")) + self.assertEqual(self.step(plan), "scratch_in_workspace") + self.assertFalse(os.path.lexists(str(self.work / "evil")), "nothing is made in the workspace") + os.unlink(str(self.temp / "heads")) def test_each_cases_head_is_read_with_no_credential_and_one_not_read_closes_the_gate(self): # decision 0138 # The fetch reads each case's head, the commit its diff was taken at, as its tarball through a transport of its diff --git a/tests/test_simulator.py b/tests/test_simulator.py index c627f31d..a2961483 100644 --- a/tests/test_simulator.py +++ b/tests/test_simulator.py @@ -562,6 +562,8 @@ def run(at, intent=terms.ISSUE_APPROVAL, content="sha256:00c1"): ([run(10), run(13, intent="review-change")], 12, True), ([run(10), run(13, content="sha256:00c2")], 12, True), ([run(5, intent="review-change")], 10, False), + # A Run of the item in the approval's own second is as old as it (the Muse read of issue 608's change). + ([run(15, intent="review-change")], 10, False), ([], 10, True), ([run(16)], 10, True)): self.assertEqual(self.read([review(machine, 15)], edited, runs), (held, held), (runs, edited)) diff --git a/tools/mutants.py b/tools/mutants.py index 2964fd16..b35c8efe 100644 --- a/tools/mutants.py +++ b/tools/mutants.py @@ -15633,6 +15633,17 @@ def moved_before(rel: str, block: str, anchor: str) -> tuple: ("the world dates each approval by its own time still", 'sim/world.py', ' anchor = min(self.read_at(rv) for rv in since) if since else (look if machine else None)\n', ' anchor = min(rv["submitted_at"] for rv in since) if since else (look if machine else None)\n', ('tests.test_simulator.Simulation.test_the_worlds_reading_of_an_edit_after_the_approval_is_the_kernels',)), + # The owed Muse reads of issues 608 and 626's changes: a Run in the approval's own second, the records always given, + # and the plan's heads placed by heads_place. + ("the world takes a Run in the approval's own second as after it", 'sim/world.py', + ' return at if any(r["started_at"] <= at for r in self.runs) else ""\n', ' return at if any(r["started_at"] < at for r in self.runs) else ""\n', + ('tests.test_simulator.Simulation.test_the_worlds_reading_of_an_edit_after_the_approval_is_the_kernels',)), + ("the description's anchor takes no records by default", 'kernel/derive.py', + 'def description_anchor(facts: dict, edited: str, *, runs: list):', 'def description_anchor(facts: dict, edited: str, *, runs: list = ()):', + ('tests.test_decide.Convergence.test_an_approval_is_anchored_at_the_act_that_read_the_description',)), + ('the plan places the heads by their path alone', 'harness/eval/__init__.py', + ' place, heads = scratch(env, workspace), heads_place(env, workspace)\n', ' place, heads = scratch(env, workspace), pathlib.Path(os.path.realpath(os.path.join(env["RUNNER_TEMP"], "heads")))\n', + APART), ('the calls go unread', 'tools/check_purity.py', ' problems += _calls(name, tree, trees, takers, tops)\n', '', ('tests.test_tools.Purity.test_the_kernel_calls_nothing_it_is_given', 'tests.test_tools.Purity.test_what_fills_a_decision_maker_is_a_kernel_function')), From 431c89918fae91c3f760c346eacfb77553346c84 Mon Sep 17 00:00:00 2001 From: Don Petry <36422719+don-petry@users.noreply.github.com> Date: Sun, 8 Nov 2026 23:17:28 -0600 Subject: [PATCH 2/2] #668: the anchor's missing records are the TypeError's cause, by name Co-Authored-By: Claude Opus 5.5 --- tests/test_decide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_decide.py b/tests/test_decide.py index 18908a6b..6a67e45f 100644 --- a/tests/test_decide.py +++ b/tests/test_decide.py @@ -1861,7 +1861,7 @@ def test_an_approval_is_anchored_at_the_act_that_read_the_description(self): # # A re-run whose dispatch was not read may be the act that read, made before it: nothing shows when, so it holds. unread = dict(act, started_at="2026-10-11T12:30:00Z", rerun_by_dispatcher=False) # The records are always given: with none, the anchor would be the approval's own time, which issue 608 ended. - with self.assertRaises(TypeError): + with self.assertRaisesRegex(TypeError, "runs"): derive.description_anchor(facts(reviews=[approval]), "2026-10-11T12:10:00Z") self.assertEqual(derive.description_anchor(facts(reviews=[approval]), "2026-10-11T12:10:00Z", runs=REVIEWED + [unread]), "") d = go(facts(reviews=[approval], description_edited_at="2026-10-11T12:10:00Z"), REVIEWED + [unread])