Measure routing figures every 20th cycle and raise each call for a routing change once
This commit is contained in:
@@ -60,6 +60,18 @@ and counts its unfinished verdicts afresh. A rung no longer on the ladder, or be
|
||||
item's R + C picks, is dropped, and the chunk is routed afresh from todo.md. A todo.md or an
|
||||
archive that cannot be read or parsed is said on stderr, and the chunk is routed without it.
|
||||
|
||||
Every 20th cycle across all projects in the archive, counting the cycles a verdict closed, it
|
||||
measures every finished chunk there, with no model run: tokens by project, subagent type, rung and
|
||||
the tool whose results they took in, and for each chunk an item routed, by the rung it started on,
|
||||
its review rounds past each pass's first, its unfinished verdicts and its subagents' rungs. It
|
||||
writes them to routing-figures.md at the archive's root. They call for a routing change when chunks
|
||||
routed onto a rung took more review rounds or unfinished verdicts than chunks routed onto the next
|
||||
rung up, each rung with 5 chunks or more, or when the reports of 5 or more subagents of one type
|
||||
were longer than the tool results they read. Each call not raised before is an interrupt: claude
|
||||
on the terminal in ~/.claude, asked the calls. Once that claude ends, the calls are listed in
|
||||
routing-calls-raised.md beside the figures, and never raised again. A figure that cannot be
|
||||
measured or written is said on stderr, and the loop goes on.
|
||||
|
||||
A change to bin/loop-claude or any bin/**/*.py takes effect at the next cycle boundary, once
|
||||
loop-claude --help succeeds: the loop reloads into the edited script.
|
||||
|
||||
@@ -101,6 +113,8 @@ import sys
|
||||
import typing
|
||||
|
||||
from transcript_archive.write import archive
|
||||
from transcript_archive.location import archive_root, project_archive
|
||||
from loop_claude.loop.routing_check import check_routing
|
||||
from loop_claude.project.checkout import checkout_root
|
||||
from loop_claude.cycle.run import Cycle, run_cycle
|
||||
from loop_claude.loop.reload import decode_handed, exec_if_edited, fingerprint, LoopRun, RELOAD_FLAG
|
||||
@@ -113,7 +127,6 @@ from todo_table import Item
|
||||
from transcript_archive.read import latest_worker
|
||||
from transcript_archive import outcomes
|
||||
from loop_claude.paths import Paths
|
||||
from transcript_archive.location import project_archive
|
||||
from project_key import project_key
|
||||
from model_routing.ladder import project_rung, Rung
|
||||
from loop_claude.project.premises import read_premises
|
||||
@@ -165,6 +178,8 @@ def run_loop(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launc
|
||||
before, loop_run = loop_run.route, after_verdict(loop_run, anchor, verdict)
|
||||
if stop := archive_step(archive_folder, session, loop_run, before, effects):
|
||||
return stop
|
||||
if stop := check_routing(archive_root(paths.home, env), paths, effects):
|
||||
return stop
|
||||
|
||||
|
||||
def routed(loop_run: LoopRun, anchor: Rung | None, archived: typing.Callable[[], Route | None], item: typing.Callable[[], Item | None]) -> LoopRun:
|
||||
|
||||
Reference in New Issue
Block a user