Rename loop-claude to build-release, with no alias

This commit is contained in:
2026-12-03 15:22:11 +01:00
parent 38102d5aa5
commit 969190064e
139 changed files with 717 additions and 671 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
"""Refuse an Agent or Skill call that launches a review below the rung it needs, worked out on the project's ladder from the rungs and the E + I loop-claude hands its worker: docs/decisions.md → `routing:`."""
"""Refuse an Agent or Skill call that launches a review below the rung it needs, worked out on the project's ladder from the rungs and the E + I build-release hands its worker: docs/decisions.md → `routing:`."""
import pathlib
import typing
@@ -26,7 +26,7 @@ SECURITY_SKILLS = {"claude-security", "security-review"}
def reviewer_breaches(call: Call, environ: typing.Mapping[str, str], home: str) -> list[Breach]:
"""The breach of an Agent call that launches a review below its rung; none where loop-claude handed no rungs."""
"""The breach of an Agent call that launches a review below its rung; none where build-release handed no rungs."""
kind = review_kind(call.given)
if kind is None or not hands_rungs(environ):
return []
@@ -45,12 +45,12 @@ def reviewer_breaches(call: Call, environ: typing.Mapping[str, str], home: str)
def unread(ladder: Failure, cwd: str) -> Breach:
"""The breach of a review launched where loop-claude handed rungs and the project's ladder cannot be read, so nothing tells which rung the review needs."""
"""The breach of a review launched where build-release handed rungs and the project's ladder cannot be read, so nothing tells which rung the review needs."""
return Breach("reviewer-rung", f"the rung this review needs cannot be worked out: {ladder.reason}", cwd)
def skill_breaches(call: Call, environ: typing.Mapping[str, str], home: str) -> list[Breach]:
"""The breach of a Skill call that runs the security pass below the project's rung; none where loop-claude handed no rungs.
"""The breach of a Skill call that runs the security pass below the project's rung; none where build-release handed no rungs.
The skill runs on its caller's rung. A subagent launched as the security pass was held to the project's rung by reviewer_breaches. The worker's own rung is known, so its call is refused only below the project's rung. Any other subagent's rung is unknown, so its call is refused."""
skill = text(call.given, "skill").lstrip("/").rsplit(":", 1)[-1]
+3 -3
View File
@@ -47,7 +47,7 @@ RULES: dict[RuleName, Rule] = {
),
# A marker would let the credentials into the transcript all the same, so no marker waives it.
"env-file-read": Rule(
"an agent never reads ~/.claude/.env or a project's env-file, the file of credentials the project's config names, since a value the agent reads lands in its transcript, which loop-claude archives and the backups copy; it leaves a tool that needs a credential to read the file itself, gets the file's path from `project-config env-file`, and spells the path another way, such as \"the .env in ~/.claude\", in a command that must mention it without reading it, such as a commit's title, and searches only a folder without it",
"an agent never reads ~/.claude/.env or a project's env-file, the file of credentials the project's config names, since a value the agent reads lands in its transcript, which build-release archives and the backups copy; it leaves a tool that needs a credential to read the file itself, gets the file's path from `project-config env-file`, and spells the path another way, such as \"the .env in ~/.claude\", in a command that must mention it without reading it, such as a commit's title, and searches only a folder without it",
"against ~/.claude/.env and the env-file of every config under ~/.claude-projects: a Read of one; a Grep of one, or of a folder holding one, unless a checkout ignores the file and the Grep's glob cannot match it; and a Bash command that spells one's path, or names it in a word or a redirect's target from the directory `cd` left the command in, whether or not the command reads it; and a Bash command that runs `ag`, `grep -r` or `rg` over a folder holding one, or over the directory `cd` left the command in where it names no folder, unless the tool skips the file: `ag` and `rg` skip a hidden file, one below a hidden folder of the search and one a checkout ignores, and `rg` one that none of its globs matches",
overridable=False,
),
@@ -77,8 +77,8 @@ 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. 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",
"a reviewer, a comprehension seat or the security pass runs on the rung build-release 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 build-release 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,
),
# The cap holds with no ask, so no marker waives it.
+19 -19
View File
@@ -158,7 +158,7 @@ class CommandBreaches(unittest.TestCase):
self.assertEqual(checked(command), [])
def test_a_pgrep_or_pkill_f_whose_pattern_the_command_contains_breaks_endless_wait(self):
for command in ["pgrep -f chunk-pr", "pkill -f 'loop-claude'", "pgrep -fa chunk-pr", "pgrep -u me -f chunk-pr", "pgrep --full chunk-pr", "pkill -9 -f loop-claude", "pkill -KILL -f loop-claude", "pgrep -f chunk-pr -u", "pkill --full chunk-pr --signal", "pgrep -f -", "if pgrep -f loop-claude; then echo up; fi", "until ! pgrep -f \"chunk-pr merg\" || [ $SECONDS -gt 600 ]; do sleep 15; done", "pgrep -U me -f chunk-pr", "pgrep -fUME chunk-pr", "pgrep -f9 chunk-pr", "pgrep --signal TERM --full chunk-pr", "pgrep -f 'chunk[pr'", "pgrep -f 'chunk-pr .*merg'", "nice pgrep -f chunk-pr", "bash -c 'pgrep -f chunk-pr'"]:
for command in ["pgrep -f chunk-pr", "pkill -f 'build-release'", "pgrep -fa chunk-pr", "pgrep -u me -f chunk-pr", "pgrep --full chunk-pr", "pkill -9 -f build-release", "pkill -KILL -f build-release", "pgrep -f chunk-pr -u", "pkill --full chunk-pr --signal", "pgrep -f -", "if pgrep -f build-release; then echo up; fi", "until ! pgrep -f \"chunk-pr merg\" || [ $SECONDS -gt 600 ]; do sleep 15; done", "pgrep -U me -f chunk-pr", "pgrep -fUME chunk-pr", "pgrep -f9 chunk-pr", "pgrep --signal TERM --full chunk-pr", "pgrep -f 'chunk[pr'", "pgrep -f 'chunk-pr .*merg'", "nice pgrep -f chunk-pr", "bash -c 'pgrep -f chunk-pr'"]:
with self.subTest(command):
self.assertEqual(checked(command), ["endless-wait"])
ending = ", or a pattern the command doesn't contain, such as `[c]hunk` for `chunk`"
@@ -180,7 +180,7 @@ class CommandBreaches(unittest.TestCase):
self.assertEqual(checked(command.replace("-f ", "-x ")), ["endless-wait"])
def test_a_pgrep_f_on_a_pattern_the_command_lacks_or_a_pgrep_without_f_passes_endless_wait(self):
for command in ["pgrep -f '[c]hunk-pr merg'", "pgrep -f \"$name\"", "pgrep -f '^python3 .*loop-claude$'", "pgrep -x chunk-pr", "pgrep chunk-pr", "pgrep -u me -x chunk-pr", "pkill -f -u me '[l]oop-claude'", "pkill --signal TERM --full '[c]hunk'", "pkill -KILL -f '[l]oop-claude'", "pkill -9 -f '[l]oop-claude'", "pkill --signal=TERM --full '[c]hunk'", "pgrep -f -U me '[c]hunk' -u", "echo pgrep -f chunk-pr", "git commit -m 'Refuse pgrep -f chunk-pr'", "pgrep -f"]:
for command in ["pgrep -f '[c]hunk-pr merg'", "pgrep -f \"$name\"", "pgrep -f '^python3 .*build-release$'", "pgrep -x chunk-pr", "pgrep chunk-pr", "pgrep -u me -x chunk-pr", "pkill -f -u me '[l]oop-claude'", "pkill --signal TERM --full '[c]hunk'", "pkill -KILL -f '[l]oop-claude'", "pkill -9 -f '[l]oop-claude'", "pkill --signal=TERM --full '[c]hunk'", "pgrep -f -U me '[c]hunk' -u", "echo pgrep -f chunk-pr", "git commit -m 'Refuse pgrep -f chunk-pr'", "pgrep -f"]:
with self.subTest(command):
self.assertEqual(checked(command), [])
@@ -282,9 +282,9 @@ HOME = "/h"
class ReviewerRung(unittest.TestCase):
# A worker routed to Sonnet 5.5 at high, on a project whose rung is Opus 5.5 at medium, with its reviewers on the project's rung.
ENVIRON = {"LOOP_CLAUDE_PROJECT_RUNG": "claude-opus-5-5 at medium effort", "LOOP_CLAUDE_WORKER_RUNG": "claude-sonnet-5-5 at high effort", "LOOP_CLAUDE_ESCAPE_AND_IMPACT": "4"}
ENVIRON = {"BUILD_RELEASE_PROJECT_RUNG": "claude-opus-5-5 at medium effort", "BUILD_RELEASE_WORKER_RUNG": "claude-sonnet-5-5 at high effort", "BUILD_RELEASE_ESCAPE_AND_IMPACT": "4"}
# The same project, with a worker, and so its reviewers, routed above it to Fable 5.2 at max.
ABOVE = {"LOOP_CLAUDE_PROJECT_RUNG": "claude-opus-5-5 at medium effort", "LOOP_CLAUDE_WORKER_RUNG": "claude-fable-5-2 at max effort", "LOOP_CLAUDE_ESCAPE_AND_IMPACT": "4"}
ABOVE = {"BUILD_RELEASE_PROJECT_RUNG": "claude-opus-5-5 at medium effort", "BUILD_RELEASE_WORKER_RUNG": "claude-fable-5-2 at max effort", "BUILD_RELEASE_ESCAPE_AND_IMPACT": "4"}
def refused(self, given: dict, environ: dict[str, str] = ENVIRON) -> list[str]:
return rules(reviewer_breaches(Call("Agent", given, "/r"), environ, HOME))
@@ -300,7 +300,7 @@ class ReviewerRung(unittest.TestCase):
pathlib.Path(repo, "docs", "decisions.md").write_text("Decided.\n")
git(repo, "add", ".")
git(repo, "commit", "-q", "-m", "prose")
high = self.ENVIRON | {"LOOP_CLAUDE_ESCAPE_AND_IMPACT": "7"}
high = self.ENVIRON | {"BUILD_RELEASE_ESCAPE_AND_IMPACT": "7"}
on_project = {"subagent_type": "stability-reviewer", "model": "opus", "effort": "medium"}
self.assertEqual(rules(reviewer_breaches(Call("Agent", on_project, repo), high, HOME)), [])
self.assertEqual(rules(reviewer_breaches(Call("Agent", {**on_project, "model": "sonnet", "effort": "high"}, repo), high, HOME)), ["reviewer-rung"])
@@ -347,14 +347,14 @@ class ReviewerRung(unittest.TestCase):
def test_a_reviewer_is_held_to_the_rung_its_e_plus_i_picks_where_that_is_higher(self):
self.assertEqual(self.refused({"subagent_type": "stability-reviewer", "model": "opus", "effort": "medium"}, self.ABOVE), ["reviewer-rung"])
self.assertEqual(self.refused({"subagent_type": "stability-reviewer", "model": "fable", "effort": "max"}, self.ABOVE), [])
lifted = self.ENVIRON | {"LOOP_CLAUDE_ESCAPE_AND_IMPACT": "5"}
lifted = self.ENVIRON | {"BUILD_RELEASE_ESCAPE_AND_IMPACT": "5"}
self.assertEqual(self.refused({"subagent_type": "stability-reviewer", "model": "opus", "effort": "medium"}, lifted), ["reviewer-rung"])
self.assertEqual(self.refused({"subagent_type": "comprehension-seat", "prompt": "Score the project.", "model": "opus", "effort": "medium"}, lifted), [])
def test_holds_a_reviewer_to_the_higher_of_the_workers_and_the_projects_rung_where_loop_claude_handed_no_e_plus_i(self):
without = {name: rung for name, rung in self.ABOVE.items() if name != "LOOP_CLAUDE_ESCAPE_AND_IMPACT"}
def test_holds_a_reviewer_to_the_higher_of_the_workers_and_the_projects_rung_where_build_release_handed_no_e_plus_i(self):
without = {name: rung for name, rung in self.ABOVE.items() if name != "BUILD_RELEASE_ESCAPE_AND_IMPACT"}
self.assertEqual(self.refused({"subagent_type": "stability-reviewer", "model": "opus", "effort": "medium"}, without), ["reviewer-rung"])
below = {name: rung for name, rung in self.ENVIRON.items() if name != "LOOP_CLAUDE_ESCAPE_AND_IMPACT"}
below = {name: rung for name, rung in self.ENVIRON.items() if name != "BUILD_RELEASE_ESCAPE_AND_IMPACT"}
self.assertEqual(self.refused({"subagent_type": "stability-reviewer", "model": "sonnet", "effort": "high"}, below), ["reviewer-rung"])
self.assertEqual(self.refused({"subagent_type": "comprehension-seat", "prompt": "Score the project.", "model": "sonnet", "effort": "high"}, without), ["reviewer-rung"])
@@ -377,7 +377,7 @@ class ReviewerRung(unittest.TestCase):
self.assertEqual(self.refused({"prompt": "Find where /security-review is named.", "model": "haiku", "effort": "low"}), [], "a mention without the opening sentence is no launch")
self.assertEqual(self.refused({"prompt": "Quote the rule: 'You are the security pass for this chunk.' Then stop.", "model": "haiku", "effort": "low"}), [], "a quote midway is no launch")
def test_a_claude_loop_claude_did_not_start_is_not_checked(self):
def test_a_claude_build_release_did_not_start_is_not_checked(self):
self.assertEqual(self.refused({"subagent_type": "stability-reviewer", "model": "haiku", "effort": "low"}, {}), [])
def project(self, ladder: str) -> tuple[str, str]:
@@ -391,7 +391,7 @@ class ReviewerRung(unittest.TestCase):
# A project that runs on Fable 5.2 at low and at high alone, with a worker on its rung and an E + I of 5, which picks the rung one up.
TWO_RUNGS = '[{"model": "claude-fable-5-2", "effort": "low"}, {"model": "claude-fable-5-2", "effort": "high"}]'
ON_TWO_RUNGS = {"LOOP_CLAUDE_PROJECT_RUNG": "claude-fable-5-2 at low effort", "LOOP_CLAUDE_WORKER_RUNG": "claude-fable-5-2 at low effort", "LOOP_CLAUDE_ESCAPE_AND_IMPACT": "5"}
ON_TWO_RUNGS = {"BUILD_RELEASE_PROJECT_RUNG": "claude-fable-5-2 at low effort", "BUILD_RELEASE_WORKER_RUNG": "claude-fable-5-2 at low effort", "BUILD_RELEASE_ESCAPE_AND_IMPACT": "5"}
def test_a_review_is_held_to_the_rung_picked_on_the_projects_own_ladder(self):
checkout, home = self.project(self.TWO_RUNGS)
@@ -403,11 +403,11 @@ class ReviewerRung(unittest.TestCase):
self.assertEqual(rules(reviewer_breaches(Call("Agent", {**reviewer, "effort": "medium"}, "/r"), self.ON_TWO_RUNGS, HOME)), [])
self.assertEqual(rules(breaches_of(Call("Agent", {**reviewer, "effort": "medium"}, checkout), home, self.ON_TWO_RUNGS)[2]), ["reviewer-rung"], "the hook reads the ladder under the home it is given")
def test_a_rung_loop_claude_handed_that_the_projects_ladder_does_not_hold_is_not_checked(self):
# As when the ladder's file changed after loop-claude started the worker: the next cycle routes on the new ladder.
def test_a_rung_build_release_handed_that_the_projects_ladder_does_not_hold_is_not_checked(self):
# As when the ladder's file changed after build-release started the worker: the next cycle routes on the new ladder.
checkout, home = self.project(self.TWO_RUNGS)
reviewer = Call("Agent", {"subagent_type": "stability-reviewer", "model": "haiku", "effort": "low"}, checkout)
for name in ("LOOP_CLAUDE_PROJECT_RUNG", "LOOP_CLAUDE_WORKER_RUNG"):
for name in ("BUILD_RELEASE_PROJECT_RUNG", "BUILD_RELEASE_WORKER_RUNG"):
with self.subTest(name=name):
environ = self.ON_TWO_RUNGS | {name: "claude-opus-5-5 at medium effort"}
self.assertEqual(reviewer_breaches(reviewer, environ, home), [])
@@ -416,15 +416,15 @@ class ReviewerRung(unittest.TestCase):
def test_a_security_skill_is_held_to_the_projects_rung_on_the_projects_own_ladder(self):
checkout, home = self.project('[{"model": "claude-fable-5-2", "effort": "high"}, {"model": "claude-fable-5-2", "effort": "low"}]')
# On this ladder the worker's low effort ranks above the project's high one; on the shipped ladder it ranks below.
environ = {"LOOP_CLAUDE_PROJECT_RUNG": "claude-fable-5-2 at high effort", "LOOP_CLAUDE_WORKER_RUNG": "claude-fable-5-2 at low effort"}
environ = {"BUILD_RELEASE_PROJECT_RUNG": "claude-fable-5-2 at high effort", "BUILD_RELEASE_WORKER_RUNG": "claude-fable-5-2 at low effort"}
self.assertEqual(skill_breaches(Call("Skill", {"skill": "security-review"}, checkout), environ, home), [])
self.assertEqual(rules(skill_breaches(Call("Skill", {"skill": "security-review"}, "/r"), environ, HOME)), ["reviewer-rung"])
self.assertEqual(rules(breaches_of(Call("Skill", {"skill": "security-review"}, "/r"), home, environ)[2]), ["reviewer-rung"])
self.assertEqual(breaches_of(Call("Skill", {"skill": "security-review"}, checkout), home, environ)[2], [])
on_the_projects = environ | {"LOOP_CLAUDE_WORKER_RUNG": "claude-fable-5-2 at high effort"}
on_the_projects = environ | {"BUILD_RELEASE_WORKER_RUNG": "claude-fable-5-2 at high effort"}
self.assertEqual(skill_breaches(Call("Skill", {"skill": "security-review"}, checkout), on_the_projects, home), [], "a worker on the project's rung runs the skill itself")
def test_a_review_is_refused_where_the_projects_ladder_cannot_be_read_and_loop_claude_handed_rungs(self):
def test_a_review_is_refused_where_the_projects_ladder_cannot_be_read_and_build_release_handed_rungs(self):
checkout, home = self.project("[]")
own = pathlib.Path(home, ".claude-projects", "acme", "routing-ladder.json")
reviewer = Call("Agent", {"subagent_type": "stability-reviewer", "model": "fable", "effort": "max"}, checkout)
@@ -432,7 +432,7 @@ class ReviewerRung(unittest.TestCase):
self.assertEqual(rules(breaches), ["reviewer-rung"])
self.assertTrue(breaches[0].detail.startswith(f"the rung this review needs cannot be worked out: {own}: it holds no list of rungs. "), breaches[0].detail)
self.assertEqual(breaches[0].directory, checkout)
self.assertEqual(reviewer_breaches(reviewer, {}, home), [], "a claude loop-claude did not start is not checked")
self.assertEqual(reviewer_breaches(reviewer, {}, home), [], "a claude build-release did not start is not checked")
self.assertEqual(reviewer_breaches(Call("Agent", {"subagent_type": "Explore"}, checkout), self.ON_TWO_RUNGS, home), [], "nor is a subagent that reviews nothing")
self.assertEqual(skill_breaches(Call("Skill", {"skill": "simplify"}, checkout), self.ON_TWO_RUNGS, home), [])
@@ -465,7 +465,7 @@ class ReviewerRung(unittest.TestCase):
unreadable = skill_breaches(Call("Skill", {"skill": "security-review"}, "/r", "general-purpose", "/nonexistent/agent-a1.jsonl", True), self.ENVIRON, HOME)
self.assertEqual(rules(unreadable), ["reviewer-rung"])
def test_any_other_skill_or_a_claude_loop_claude_did_not_start_is_not_checked(self):
def test_any_other_skill_or_a_claude_build_release_did_not_start_is_not_checked(self):
self.assertEqual(rules(self.skill_refused({"skill": "simplify"})), [])
self.assertEqual(rules(self.skill_refused({"skill": "security-review"}, {})), [])