Route each chunk's worker by its item's R + C on one ladder of model and effort rungs

This commit is contained in:
2026-10-14 22:48:31 +02:00
parent 224c52e3cc
commit e2e7a0688f
17 changed files with 256 additions and 85 deletions
+10 -2
View File
@@ -1,5 +1,8 @@
from loop_claude.project.records import HUMAN_RULE_NAMES, RECORD_FILES
from todo_table import Item
from markdown_text import quoted
from loop_claude.cycle.routing import risk_and_complexity
from model_routing.ladder import Rung
def either(names: tuple[str, ...]) -> str:
"""The names as `a, b or c`."""
@@ -13,8 +16,13 @@ ANSWER_DESTINATIONS = "README.md's Goals or Audience, " + ", ".join(RECORD_FILES
ANSWERS_RECORDED = f"every answer the human typed in it that a later chunk could need is recorded in {ANSWER_DESTINATIONS} at the one place it governs"
def fresh(task: str, premises: str) -> str:
return f"{task}\n\nContinue any open draft PR or worktree for the chunk before creating a new one.\n\nThe chunk's todo.md items, or else the task above, set its scope. The goals below choose between ways to deliver that scope, and never widen it.\n\nFrom README.md:\n{premises}"
def fresh(task: str, premises: str, routed: str = "") -> str:
route = f"{routed}\n\n" if routed else ""
return f"{task}\n\nContinue any open draft PR or worktree for the chunk before creating a new one.\n\n{route}The chunk's todo.md items, or else the task above, set its scope. The goals below choose between ways to deliver that scope, and never widen it.\n\nFrom README.md:\n{premises}"
def routed(worker: Rung, item: Item) -> str:
return f"loop-claude runs you on {worker}, the rung item {item.id}'s R + C of {risk_and_complexity(item)} picks. When the chunk takes in a todo.md item whose R + C is higher, say so, naming that item and its R + C."
def resumed(unfinished_evidence: str) -> str: