Run a preflight before each fresh worker and put its facts in the worker's prompt

This commit is contained in:
2026-10-17 00:29:24 +02:00
parent 46b79e7803
commit f9615cb3b0
22 changed files with 532 additions and 76 deletions
+5 -7
View File
@@ -3,7 +3,7 @@ import dataclasses
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, waiting
from todo_table import Item, items, next_item
from model_routing.route import Route
UNFINISHED_PER_STEP = 2
@@ -14,13 +14,11 @@ JUDGE_REPLAYED = ("claude-opus-5-5",)
def routed_item(todo: str) -> Item | Failure | None:
"""The next release's first row that does not wait, as todo_table.waiting says, in the table's order; None when there is none, or it lacks L, E or I."""
"""The item todo_table.next_item names; None when there is none, or it lacks L, E or I."""
found = items(todo)
if isinstance(found, Failure) or not found:
return found if isinstance(found, Failure) else None
next_release = min(item.release for item in found)
waits = waiting(found)
takes = next((item for item in found if item.release == next_release and item.id not in waits), None)
if isinstance(found, Failure):
return found
takes = next_item(found or [])
return takes if takes and takes.likelihood and takes.escape_and_impact else None