Answer principles round 1: 0 🔴, 9 🟡; drop a route handed under R + C, validate Route, rank old tables without C, settle item 166, file items 170 and 171

This commit is contained in:
2026-10-16 12:49:32 +02:00
parent 5e736d6eaa
commit 886c864521
23 changed files with 147 additions and 95 deletions
+5 -5
View File
@@ -5,7 +5,7 @@ import re
import statistics
import typing
from model_routing.route import archived_rung, ESCALATION_MARKER
from model_routing.route import archived_worker, ESCALATION_MARKER
from claude_code.entries import assistant_parts, parts, tool_call, usage_count
from git_command import commits
from model_routing.ladder import position, Rung
@@ -91,10 +91,10 @@ def measured(chunk: Chunk, home: str) -> ChunkFigures:
reports[kind] = reports.get(kind, Reports(0, 0, 0)) + Reports(1, len(reported.get(subagent.launched_by, "")), sum(map(len, results(subagent.entries).values())))
for _, tools, spent in spend(subagent.entries):
add(tokens, chunk.project, kind, rung, tools, spent)
start = archived_rung(cycles[0][1]) if cycles else None
start = archived_worker(cycles[0][1]) if cycles else None
return ChunkFigures(
tokens=tokens,
start=start[0] if start and start[1] else None,
start=start.rung if start and start.routed else None,
rounds_past_first=rounds_past_first(chunk.worker, home),
unfinished=sum(len(UNFINISHED_AT.findall(kept)) for kept in chunk.outcomes),
delegated=delegated,
@@ -133,8 +133,8 @@ def rung_at(cycles: list[tuple[str, str]], timestamp: str) -> Rung | str:
"""The rung of the cycle running at timestamp: the worker named by the first outcome stamped at or after it, or else by the last outcome. A worker off the ladder is returned as its text."""
second = timestamp[:19] + "Z"
found = next((rung for stamp, rung in cycles if stamp >= second), cycles[-1][1] if cycles else "unrouted")
route = archived_rung(found)
return route[0] if route else found
archived = archived_worker(found)
return archived.rung if archived else found
def subagent_rung(entries: list[dict], arguments: dict, worker: Rung | str) -> Rung: