From 682181bc3bb6a520d7d2268804fdbf7d2d19e299 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 22 Oct 2026 21:07:27 +0200 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=201:=201=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1;=20restore=20the=20import=20or?= =?UTF-8?q?der,=20and=20decide=20ships-alone=20from=20L,=20E=20and=20I=20s?= =?UTF-8?q?o=20an=20unranked=20row=20counts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/chunk_preflight/facts.py | 2 +- bin/test_rank_todo.py | 3 +++ bin/todo_table.py | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/chunk_preflight/facts.py b/bin/chunk_preflight/facts.py index 4d8f172f..0d9fe3ed 100644 --- a/bin/chunk_preflight/facts.py +++ b/bin/chunk_preflight/facts.py @@ -1,5 +1,5 @@ """The lines the preflight prints, stated from what it gathered.""" -from todo_table import BUNDLE_MAX_R, bundle_candidates, Item, ships_alone, version +from todo_table import bundle_candidates, BUNDLE_MAX_R, Item, ships_alone, version from failure import Failure from chunk_preflight.gathered import Forge, Gathered, ItemFacts, NamedPath, NoItem, Plan, Ran from chunk_pick import LastCut, unreleased_entries diff --git a/bin/test_rank_todo.py b/bin/test_rank_todo.py index 9264228e..e910b2bb 100644 --- a/bin/test_rank_todo.py +++ b/bin/test_rank_todo.py @@ -483,6 +483,9 @@ class Blockers(unittest.TestCase): # At R 6, item 3 ships alone too. riskier = todo_table.items(TODO.replace("| 2 | 1 | 2 | 3 | 7 |", "| 3 | 2 | 3 | 6 | 7 |")) self.assertNotIn(3, [item.id for item in todo_table.bundle_candidates(riskier, todo_table.next_item(riskier))]) + # Before rank_todo.py fills its R cell, item 3's L 3, E 2 and I 3 still make R 6. + unranked = todo_table.items(TODO.replace("| 2 | 1 | 2 | 3 | 7 |", "| 3 | 2 | 3 | | 7 |")) + self.assertNotIn(3, [item.id for item in todo_table.bundle_candidates(unranked, todo_table.next_item(unranked))]) def test_drops_a_blocker_the_table_no_longer_holds_as_finished(self): finished = TODO.replace("| 4 | 0.1.0 | | security | **Rotate the leaked key.** | 3 | 3 | 5 | 9 | 2 | 2.1 by 1 | 0 |\n", "").replace("| 2 | 0.1.0 | |", "| 2 | 0.1.0 | 4 |") diff --git a/bin/todo_table.py b/bin/todo_table.py index c96ea3cc..638d71df 100644 --- a/bin/todo_table.py +++ b/bin/todo_table.py @@ -203,8 +203,9 @@ def renames(todo: str) -> set[tuple[int, int, int]] | Failure: def ships_alone(item: Item) -> bool: - """An item above BUNDLE_MAX_R joins no chunk, and none joins it.""" - return item.scores.get("R", 0) > BUNDLE_MAX_R + """An item above BUNDLE_MAX_R joins no chunk, and none joins it. R comes from L, E and I, so an R cell rank_todo.py has yet to fill counts too; a table without them, in the old shape, ships nothing alone.""" + scores = item.scores + return all(level in scores for level in ("L", "E", "I")) and risk(scores["L"], scores["E"], scores["I"]) > BUNDLE_MAX_R def bundle_candidates(found: list[Item], first: Item) -> list[Item]: