Run a chunk's worker on the rung its item picks, below the project's too, with its reviewers kept on the project's rung

This commit is contained in:
2026-10-14 23:50:39 +02:00
parent 8f7b0c5ac7
commit b4e7dd9875
9 changed files with 52 additions and 31 deletions
+9 -4
View File
@@ -1,3 +1,4 @@
from model_routing.ladder import highest, Rung
from loop_claude.project.records import HUMAN_RULE_NAMES, RECORD_FILES
from markdown_text import quoted
from loop_claude.routing import Route
@@ -14,13 +15,17 @@ 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, route: Route) -> str:
routed = f"{routed_by(route)}\n\n" if route.item else ""
def fresh(task: str, premises: str, route: Route, anchor: Rung | None) -> str:
routed = f"{routed_by(route, anchor)}\n\n" if route.item else ""
return f"{task}\n\nContinue any open draft PR or worktree for the chunk before creating a new one.\n\n{routed}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_by(route: Route) -> str:
return f"loop-claude runs you on {route.rung}, routed by item {route.item}'s R + C of {route.risk_and_complexity}. Name each todo.md item this chunk takes, with its R + C, whether or not it is item {route.item}."
def routed_by(route: Route, anchor: Rung | None) -> str:
said = f"loop-claude runs you on {route.rung}, routed by item {route.item}'s R + C of {route.risk_and_complexity}. Name each todo.md item this chunk takes, with its R + C, whether or not it is item {route.item}."
if anchor is None or highest(route.rung, anchor) == route.rung:
return said
# The Agent tool takes a model's family name, such as opus, and runs that family's latest model, which each ladder rung names.
return f"{said} Your rung is below the project's, {anchor}: launch each reviewer, each comprehension seat and the security pass's subagent with the Agent tool's model `{anchor.model.split('-')[1]}` and effort `{anchor.effort}`."
def resumed(unfinished_evidence: str) -> str: