Keep the shipped routing ladder beside the module that reads it, so a copy of bin/ carries it
This commit is contained in:
@@ -76,14 +76,15 @@ medium, high, xhigh or max:
|
||||
{"model": "claude-fable-5-2", "effort": "low"}
|
||||
]
|
||||
|
||||
This setup ships one, routing-ladder.json at its root. A project that keeps a routing-ladder.json in
|
||||
its config's folder, ~/.claude-projects/<key>/, runs on that ladder instead, whole: write there
|
||||
every rung the project may run on. loop-claude reads the project's ladder as each cycle starts, and
|
||||
never commits the file. subagent-rung and rule-hook read the same ladder; the routing figures,
|
||||
judge-replay and review-replay, which span every project, read the shipped one.
|
||||
This setup ships one, bin/model_routing/routing-ladder.json. A project that keeps a
|
||||
routing-ladder.json in its config's folder, ~/.claude-projects/<key>/, runs on that ladder
|
||||
instead, whole: write there every rung the project may run on. loop-claude reads the project's
|
||||
ladder as each cycle starts, and never commits the file. subagent-rung and rule-hook read the same
|
||||
ladder; the routing figures, judge-replay and review-replay, which span every project, read the
|
||||
shipped one.
|
||||
|
||||
Where the project's model is on its routing ladder, the worker and the
|
||||
session /talk opens run on the rung that the chunk's todo.md item picks, and the judge of some
|
||||
Where the project's model is on its routing ladder, 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; 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, when the
|
||||
worker names on its `Chunk items:` line an item that picks a higher rung, or when the judge finds
|
||||
|
||||
@@ -952,8 +952,6 @@ class Reload(unittest.TestCase):
|
||||
checkout = Checkout(self)
|
||||
copy = checkout.temp / "bin"
|
||||
shutil.copytree(BIN, copy, ignore=shutil.ignore_patterns("__pycache__", "test_*"))
|
||||
# The copied tools read the ladder their setup ships from the folder above their bin/.
|
||||
shutil.copy(BIN.parent / "routing-ladder.json", copy.parent)
|
||||
checkout.script = copy / "loop-claude"
|
||||
checkout.env["FAKE_CLAUDE_EDIT"] = str(copy)
|
||||
run = checkout.run([
|
||||
|
||||
@@ -10,8 +10,8 @@ from project_config.settings import Unnamed
|
||||
|
||||
# The file's name in both places. Three readers, seated as the human who writes an override in a hurry, picked a bare list of objects over a list of strings, a list of pairs and a list under a key. Two of them picked one name for both files: an override is then a copy of the shipped file with rungs cut.
|
||||
NAME = "routing-ladder.json"
|
||||
# The ladder this setup ships, at the root of the checkout the running tool is in.
|
||||
SHIPPED = pathlib.Path(__file__).resolve().parents[2] / NAME
|
||||
# The ladder this setup ships, beside this module, so a copy of bin/ carries it: the tests of a reload and mutate-changes each run the tools from such a copy.
|
||||
SHIPPED = pathlib.Path(__file__).resolve().with_name(NAME)
|
||||
# A model as Rung.family reads it: the Agent tool's family name follows the first hyphen.
|
||||
MODEL = re.compile(r"[^\s-]+(-[^\s-]+)+")
|
||||
SHAPE = f'a JSON list of rungs, least competent first, each as {{"model": "claude-opus-5-5", "effort": "medium"}}, with an effort of {", ".join(EFFORTS[:-1])} or {EFFORTS[-1]}'
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{"model": "claude-sonnet-5-5", "effort": "high"},
|
||||
{"model": "claude-opus-5-5", "effort": "medium"},
|
||||
{"model": "claude-fable-5-2", "effort": "low"},
|
||||
{"model": "claude-fable-5-2", "effort": "medium"},
|
||||
{"model": "claude-opus-5-5", "effort": "xhigh"},
|
||||
{"model": "claude-fable-5-2", "effort": "high"},
|
||||
{"model": "claude-fable-5-2", "effort": "max"}
|
||||
]
|
||||
@@ -61,7 +61,7 @@ RULES: dict[RuleName, Rule] = {
|
||||
),
|
||||
# A rung is not a judgment call, and the refusal names the arguments to pass, so no marker waives it.
|
||||
"reviewer-rung": Rule(
|
||||
"a reviewer, a comprehension seat or the security pass runs on the rung loop-claude names for it: for a seat or the security pass the project's rung, and for a reviewer the highest of the project's rung, the worker's and the one the chunk's item's E + I picks, or the project's rung where the branch changes only Markdown no agent follows, so a worker below the project's rung cannot hand a review to its own cheaper model",
|
||||
"a reviewer, a comprehension seat or the security pass runs on the rung loop-claude names for it: for a seat or the security pass the project's rung, and for a reviewer the highest of the project's rung, the worker's and the one the chunk's item's E + I picks, or the project's rung where the branch changes only Markdown no agent follows, so a worker below the project's rung cannot hand a review to its own cheaper model. The rungs rank as on the project's routing ladder, and the review is refused while that ladder cannot be read",
|
||||
"an Agent call, in a claude loop-claude started, whose subagent type is an agent under agents/, or whose prompt opens with seat-prompts.md's opening sentence or the one larv-review's Security section sets; and a `security-review` or `claude-security` Skill call in such a claude, which runs on its caller's rung, unless the caller is a subagent whose prompt opens with that sentence",
|
||||
overridable=False,
|
||||
),
|
||||
|
||||
@@ -5,13 +5,15 @@ usage: subagent-rung [--plan] <model> <L>
|
||||
<model> is the project's model, such as claude-opus-5-5, and <L> the task's L, the chance it holds
|
||||
a defect, a level from 1 to 4 scored as for a todo.md item. It prints the rung that L picks from
|
||||
the model's cheapest rung, the project's rung, in the Agent tool's words, such as `model sonnet,
|
||||
effort high`. It reads the routing ladder of the project whose checkout it runs in:
|
||||
routing-ladder.json in the folder of the project's config, ~/.claude-projects/<key>/, or else
|
||||
the one this setup ships. loop-claude --help says how to write one. --plan, for a task that files or scores todo.md items, prints the project's rung where
|
||||
effort high`. --plan, for a task that files or scores todo.md items, prints the project's rung where
|
||||
that L picks a lower one, as ~/.claude/rules/todo-items.md lets only the project's rung or above
|
||||
plan. For a model off the routing ladder, the tool doesn't print anything on stdout, says so on stderr and
|
||||
exits 0; launch the subagent with no model or effort.
|
||||
|
||||
It reads the routing ladder of the project whose checkout it runs in: routing-ladder.json in the
|
||||
folder of the project's config, ~/.claude-projects/<key>/, or else the one this setup ships, as in
|
||||
a checkout no config names. loop-claude --help shows the file's shape.
|
||||
|
||||
Exit 1, saying why, on bad arguments, or where the project's config or its routing ladder is faulty
|
||||
or cannot be read.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user