Answer prose round 1: 0 🔴, 1 🟡; state the help's step-up rule as the code holds it, and reword the docstrings and the changelog entry
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- `loop-claude --help` now describes routing in two short paragraphs for the person running the loop, and points to `bin/loop_claude/routing.py`, `bin/loop_claude/cycle/prompts.py` and `bin/routing_figures/measure.py` for the rules. The rules it used to repeat are now stated once, in the docstrings of the code that enforces them.
|
||||
- `loop-claude --help` now describes routing in two short paragraphs for the person running the loop. The rules it used to repeat are now stated once, in the code that enforces them.
|
||||
- loop-claude now archives the route on each `Worker:` line as a JSON record, such as `{"model": "claude-opus-5-5", "effort": "high", "item": 3, "likelihood": 4, "escape_and_impact": 5, "escalated_at": 12}`, and reads it back field by field. The line used to be a sentence, such as `claude-opus-5-5 at high effort, routed by item 3's L of 4 and E + I of 5`, which loop-claude parsed back word for word: rewording the sentence in the code would have made every archived line unreadable, and a rerun would have routed the open chunk afresh. A rerun and the routing figures still read the sentences archived since loop-claude routed on L. A rerun that finds a `Worker:` line it can't read now says so on stderr. The judge's reply now names the levels the worker took in `highest_likelihood_taken_in` and `highest_escape_and_impact_taken_in`, in place of `bundled` and `bundled_escape_and_impact`.
|
||||
- A chunk now takes every unblocked item of its release that fires the same review passes, whatever its purpose: one PR title no longer has to state what the items achieve together. An item with R above 5 ships alone. `chunk-preflight` says so for such an item, and never lists one as an item that may join another.
|
||||
- A branch whose name is not UTF-8 now shows no branch in the status line, in place of a name with replacement characters.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""What loop-claude says to the worker each cycle. The rung sentences are routed_by's, review_launches', escalation's and reruns'; a prompt after a step-up or an unfinished verdict says them again (rungs_held)."""
|
||||
"""What loop-claude says to the worker each cycle. routed_by, review_launches, escalation and reruns build the sentences about its rungs; rungs_held says the last three again in a prompt after a step-up or an unfinished verdict."""
|
||||
from model_routing.ladder import climbed, LADDER, position, review_rungs, reviewers_rung, ReviewKind, Rung
|
||||
from model_routing.route import ESCALATION_MARKER, HIGHEST_ESCAPE_AND_IMPACT, Route
|
||||
from loop_claude.routing import escalation_rungs
|
||||
|
||||
@@ -47,27 +47,29 @@ time. The layout, and when a copy is replaced, are in bin/transcript_archive/__i
|
||||
Every claude loop-claude starts runs the project's model, saved per <key> in
|
||||
~/.claude/loop-claude-models.json and read each cycle, unless routing, below, puts the worker,
|
||||
the session /talk opens and the judge on another rung, a model at an effort. A project without an
|
||||
entry, as on its first run, is asked for one. LOOP_CLAUDE_JUDGE_MODEL overrides it for the judge,
|
||||
LOOP_CLAUDE_WORKER_MODEL for the worker and the session /talk opens; with both set, nothing is
|
||||
asked.
|
||||
entry, as on its first run, is asked for one. LOOP_CLAUDE_JUDGE_MODEL overrides the model for the
|
||||
judge, LOOP_CLAUDE_WORKER_MODEL for the worker and the session /talk opens; with both set, nothing
|
||||
is asked.
|
||||
|
||||
Where the project's model is on the routing ladder (bin/model_routing/ladder.py), the worker and the
|
||||
session /talk opens run on the rung that the chunk's todo.md item picks, and the judge of some
|
||||
models on another. The worker's prompts name the rungs it launches its reviews on. The worker's
|
||||
rung steps up as a chunk stays unfinished or the worker asks for a higher one. The rules are in
|
||||
bin/loop_claude/routing.py, and the prompts' wording in bin/loop_claude/cycle/prompts.py. A
|
||||
models on another; a chunk no item routes runs on the project's model. The worker's prompts name the
|
||||
rungs it launches its reviews on. The worker's rung steps up as a chunk stays unfinished, or when
|
||||
the judge finds in the transcript an escalation trigger that fired and the worker asked for a higher
|
||||
rung. The rules are in bin/loop_claude/routing.py and bin/model_routing/ladder.py, and the prompts'
|
||||
wording in bin/loop_claude/cycle/prompts.py. Each verdict, interrupt, quoted answer, stop and
|
||||
step-up in the archive ends with a Worker: line, the route's JSON record (Route.record in
|
||||
bin/model_routing/route.py); a rerun resumes an open chunk on the latest route named there. A
|
||||
todo.md or an archive that cannot be read or parsed is said on stderr, and the chunk is routed
|
||||
without it. Each verdict, interrupt, quoted answer, stop and step-up in the archive ends with a
|
||||
Worker: line, the route's JSON record (Route.record in bin/model_routing/route.py); a rerun
|
||||
resumes an open chunk on the latest route named there.
|
||||
without it.
|
||||
|
||||
Every 20 cycles across all projects in the archive, the first loop to close one measures every
|
||||
finished chunk there, with no model run, and writes routing-figures.md at the archive's root
|
||||
(bin/routing_figures/measure.py). Each call the figures make for a routing change that was not
|
||||
raised before is an interrupt: claude, on the project's model, on the terminal in ~/.claude, asked
|
||||
to put the calls to the human. Once that claude ends, the calls are listed in
|
||||
routing-calls-raised.md beside the figures, and not raised again. Off a terminal, the calls are
|
||||
said on stderr, the loop goes on, and they are raised again at the next measurement.
|
||||
Once 20 cycles have closed across all projects in the archive since the last measurement, the next
|
||||
loop to close one measures every finished chunk there, with no model run, and writes
|
||||
routing-figures.md at the archive's root (bin/routing_figures/measure.py). Each call the figures
|
||||
make for a routing change, unless raised before, is an interrupt: claude, on the project's model,
|
||||
on the terminal in ~/.claude, asked to put the calls to the human. Once that claude ends, the calls
|
||||
are listed in routing-calls-raised.md beside the figures, and not raised again. Off a terminal, the
|
||||
calls are said on stderr, the loop goes on, and they are raised again at the next measurement.
|
||||
|
||||
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.
|
||||
@@ -198,7 +200,7 @@ def routed(route: Route | None, project: Rung | None, model: str, archived: typi
|
||||
|
||||
|
||||
def after_verdict(loop_run: LoopRun, project: Rung | None, concluded: Concluded) -> LoopRun:
|
||||
"""The loop run the next cycle starts from. A finished chunk drops its route; an unfinished one carries its route on, stepped_route's, and the evidence the judge gave for the verdict."""
|
||||
"""The loop run the next cycle starts from. A finished chunk drops its route. An unfinished one takes the route stepped_route makes, and the evidence the judge gave for the verdict."""
|
||||
verdict = concluded.verdict
|
||||
if isinstance(verdict, Finished):
|
||||
return dataclasses.replace(loop_run, route=None, unfinished_evidence="")
|
||||
@@ -206,7 +208,7 @@ def after_verdict(loop_run: LoopRun, project: Rung | None, concluded: Concluded)
|
||||
|
||||
|
||||
def stepped_route(project: Rung | None, ended_on: Route, verdict: Unfinished) -> Route:
|
||||
"""The route an unfinished chunk's next cycle starts on: after_unfinished's of the route its cycle ended on, which an interrupt's or a quoted answer's escalation may have raised. Off the ladder there is no rung to step, and it keeps that route."""
|
||||
"""The route an unfinished chunk's next cycle starts on: the route after_unfinished makes of the route its cycle ended on, which an interrupt's or a quoted answer's escalation may have raised. Off the ladder there is no rung to step, and it keeps that route."""
|
||||
return after_unfinished(project, ended_on, verdict) if project else ended_on
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"""Which ladder rung a chunk's worker and judge run on: docs/decisions.md → `routing:`.
|
||||
|
||||
The worker, and the session /talk opens, run on a Route (model_routing/route.py); a model off the ladder has no route to step, and its worker runs on it.
|
||||
The worker, and the session /talk opens, run on a Route (model_routing/route.py). A model off the ladder gets a route without an item, and it is never stepped.
|
||||
|
||||
- Start. routed_item is the plan item that routes a fresh chunk, none without one; first_route picks the worker's rung from its L, and the project's rung stands where there is no item.
|
||||
- Start. routed_item finds the plan item that routes a fresh chunk, if there is one with L, E and I scored; first_route picks the worker's rung from its L, or the project's rung without an item.
|
||||
- Rerun. kept decides whether a rerun resumes the route its archive last names.
|
||||
- Step-up. after_unfinished raises the route after an unfinished verdict, after_ruling after an interrupt or a quoted answer that carries an escalation; escalation_cap bounds an escalation.
|
||||
- Judge. judge_rung picks the rung of the judge of a JUDGE_REPLAYED model.
|
||||
@@ -36,7 +36,7 @@ def routed_item(todo: str, cut: LastCut) -> Item | Failure | None:
|
||||
|
||||
|
||||
def first_route(project: Rung, item: Item | None) -> Route:
|
||||
"""The route a chunk starts on: the rung its item's L picks from the project's rung."""
|
||||
"""The route a chunk starts on: the rung its item's L picks from the project's rung, or the project's rung without an item."""
|
||||
if item is None:
|
||||
return Route(project)
|
||||
return Route(worker_rung(project, item.likelihood), item.id, item.likelihood, item.escape_and_impact)
|
||||
@@ -53,7 +53,7 @@ def kept_rung(project: Rung, route: Route) -> Rung:
|
||||
|
||||
|
||||
def item_rung(project: Rung, route: Route) -> Rung:
|
||||
"""The rung the route's item's L picks from the project's rung, or the project's rung itself when no item routed it. The worker may run on a rung below it."""
|
||||
"""The rung the route's item's L picks from the project's rung, or the project's rung itself when no item routed it. The worker may run on a rung below the project's."""
|
||||
return worker_rung(project, route.likelihood) if route.item else project
|
||||
|
||||
|
||||
|
||||
@@ -1483,7 +1483,7 @@ class HelpLimits(unittest.TestCase):
|
||||
self.assertIn("fails three times running, retried a minute apart", said)
|
||||
self.assertIn(f"retried {retry.PAST_RESET // 60} minutes after the limit resets, or every {retry.UNKNOWN_RESET_POLL // 60} minutes", said)
|
||||
self.assertIn(f"still running after {PYTHON_TIMEOUT} s", said)
|
||||
self.assertIn(f"Every {measure.CYCLES_PER_CHECK} cycles across all projects", said)
|
||||
self.assertIn(f"Once {measure.CYCLES_PER_CHECK} cycles have closed across all projects", said)
|
||||
|
||||
|
||||
class ExitContract(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user