Answer architecture round 3: 0 🔴, 1 🟡; pick the next chunk's item in one function, todo_table.chunk_item, which routing and the preflight both call, so routing names no item where the release after the last cut has none

This commit is contained in:
2026-10-17 02:19:11 +02:00
parent 45004e1b0b
commit 4cf3c2bd8c
9 changed files with 130 additions and 95 deletions
+4 -4
View File
@@ -1,9 +1,9 @@
"""Which ladder rung a chunk's worker and judge run on: docs/decisions.md → `routing:`."""
import dataclasses
from todo_table import chunk_item, Item, items
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, next_item
from model_routing.route import Route
UNFINISHED_PER_STEP = 2
@@ -13,12 +13,12 @@ ESCALATION_CAP = 2
JUDGE_REPLAYED = ("claude-opus-5-5",)
def routed_item(todo: str) -> Item | Failure | None:
"""The item todo_table.next_item names; None when there is none, or it lacks L, E or I."""
def routed_item(todo: str, tag: str | None | Failure, commits: int | Failure) -> Item | Failure | None:
"""The item todo_table.chunk_item picks from todo.md, given the newest v* tag and the commits since it; None when there is none, or it lacks L, E or I."""
found = items(todo)
if isinstance(found, Failure):
return found
takes = next_item(found or [])
_, takes = chunk_item(found or [], tag, commits)
return takes if takes and takes.likelihood and takes.escape_and_impact else None