Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/test_decide.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.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])
self.assertEqual(d["reason"], "description_edited_after_approval")
Expand Down
7 changes: 7 additions & 0 deletions tests/test_evals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/test_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
11 changes: 11 additions & 0 deletions tools/mutants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
Expand Down
Loading