Give todo_table.items one way to say a plan has no items table

This commit is contained in:
2026-10-22 00:32:30 +02:00
parent f429e256de
commit f0ece378c0
7 changed files with 38 additions and 18 deletions
+4 -2
View File
@@ -4,7 +4,7 @@ import dataclasses
from chunk_pick import chunk_item, LastCut, Next
from model_routing.ladder import climbed, highest, LADDER, position, project_rung, review_floor, Rung, stepped_up, worker_rung
from failure import Failure
from todo_table import Item, items
from todo_table import Item, items, NoItemsTable
from model_routing.route import Route
UNFINISHED_PER_STEP = 2
@@ -17,9 +17,11 @@ JUDGE_REPLAYED = ("claude-opus-5-5",)
def routed_item(todo: str, cut: LastCut) -> Item | Failure | None:
"""The item chunk_pick.chunk_item picks from todo.md, weighed against the last cut; None when there is none, or it lacks L, E or I."""
found = items(todo)
if isinstance(found, NoItemsTable):
return None
if isinstance(found, Failure):
return found
pick = chunk_item(found or [], cut)
pick = chunk_item(found, cut)
takes = pick.item if isinstance(pick, Next) else None
return takes if takes and takes.likelihood and takes.escape_and_impact else None