Fix the rename's gate failures

This commit is contained in:
2026-12-03 15:29:06 +01:00
parent 969190064e
commit 4e7ec0b210
11 changed files with 48 additions and 47 deletions
+6 -6
View File
@@ -55,11 +55,6 @@ class ExitContract(unittest.TestCase):
("agent_cycle/run.py", "close", "1", "annotation.reason", read),
("agent_cycle/run.py", "close", "1", "failure.reason", read),
("agent_cycle/run.py", "close", "1", "failure.reason", "a finished chunk's session cannot be deleted"),
("chunk_driver/chunk_run.py", "closed_cycle", "1", "failure.reason", read),
("chunk_driver/cycle_start.py", "project_routing", "1", "ladder_file.reason", premises_),
("chunk_driver/cycle_start.py", "routing_on", "1", "ladder.reason", "the project's routing ladder cannot be read or holds a fault"),
("chunk_driver/project/model_choice.py", "get_or_ask_model", "1", "models.reason", models_),
("chunk_driver/project/model_choice.py", "get_or_ask_model", "1", "failure.reason", models_),
("build_release/loop/checkout.py", "checkout_root", "1", "found.reason", git),
("build_release/loop/main.py", "run_loop", "1", "reason", "tmux is missing or older than 3.2"),
("build_release/loop/main.py", "run_loop", "1", "f'{CHUNK_FLAG} is how build-release starts itself", "--chunk is given outside a tmux window"),
@@ -72,10 +67,15 @@ class ExitContract(unittest.TestCase):
("build_release/loop/main.py", "loop_run_from", "1", 'f"the edited build-release cannot read the state', "a reload cannot read the state the running script handed it"),
("build_release/loop/reload.py", "exec_if_edited", "1", "f'could not reload build-release:", "python cannot start for a reload"),
("build_release/loop/routing_check.py", "raise_calls", "1", "f\"could not start claude for the routing calls in {loop.paths.config_clone}", "claude cannot start for an interrupt"),
("chunk_driver/chunk_run.py", "closed_cycle", "1", "failure.reason", read),
("chunk_driver/cycle_start.py", "project_routing", "1", "ladder_file.reason", premises_),
("chunk_driver/cycle_start.py", "routing_on", "1", "ladder.reason", "the project's routing ladder cannot be read or holds a fault"),
("chunk_driver/project/model_choice.py", "get_or_ask_model", "1", "models.reason", models_),
("chunk_driver/project/model_choice.py", "get_or_ask_model", "1", "failure.reason", models_),
]
root = pathlib.Path(main.__file__).parents[2]
found = []
for path in sorted(path for package in ("agent_cycle", "chunk_driver", "build_release") for path in (root / package).rglob("*.py") if not path.name.startswith("test_")):
for path in sorted(path for package in ("agent_cycle", "build_release", "chunk_driver") for path in (root / package).rglob("*.py") if not path.name.startswith("test_")):
functions = [node for node in ast.walk(ast.parse(path.read_text())) if isinstance(node, ast.FunctionDef)]
stops = [(call.lineno, function.name, ast.unparse(call.args[0]), ast.unparse(call.args[1])) for function in functions for call in ast.walk(function) if isinstance(call, ast.Call) and getattr(call.func, "id", None) == "Stop" and not (isinstance(call.args[0], ast.Constant) and call.args[0].value in (0, 2, 130))]
found += [(str(path.relative_to(root)), function, code, reason) for _, function, code, reason in sorted(stops)]
+30 -30
View File
@@ -8,27 +8,26 @@ as goals-and-audience: a file, or a Jira epic's description. `project-config goa
prints where it is. The task runs at the checkout root. Each cycle a worker runs the task. A chunk's
first worker prompt also quotes the premises. They, with code health (the setup's CLAUDE.md →
"Shared goal") ranked first unless the goals file voids it, choose between ways to deliver the
chunk's plan items, or else the task, and never widen them. A judge then reads the transcript's
end, the premises, and the records: the project's AGENTS.md and docs/decisions.md, and the setup's
CLAUDE.md and rules/*.md, then the .md files in the folder of review standards
the project's config sets, where they exist. It rules whether the chunk, the work of one PR, is
finished. A chunk stays unfinished until each answer the human typed in it that a later chunk could
need is recorded: the premises or the records hold it, or the transcript shows the worker writing it
into the premises, AGENTS.md, docs/decisions.md, the plan or a comment. A choice the worker made
that the premises or the records settle is not asked about. When the worker asks a question they
answer, the judge quotes the answer, build-release prints it, and the worker resumes with it. A quote
they do not hold word for word is dropped, and the question goes to the human. So does a question
asked again after its answer. A question the human answered earlier in the chunk goes back to the
worker with that answer, unless the question quotes the words of the answer that leave it open. The
fourth question they answer in one cycle goes to the human too, with the quote. An unfinished chunk
resumes its session next cycle, and the worker is shown the passage the judge quoted as the work
remaining. The next chunk starts a fresh session. Cycles continue until an exit below or Ctrl-C,
either of which stops that one chunk.
Words: the setup's CLAUDE.md → "Vocabulary".
chunk's plan items, or else the task, and never widen them. A judge then reads the transcript's end,
the premises, and the records: the project's AGENTS.md and docs/decisions.md, and the setup's
CLAUDE.md and rules/*.md, then the .md files in the folder of review standards the project's config
sets, where they exist. It rules whether the chunk, the work of one PR, is finished. A chunk stays
unfinished until each answer the human typed in it that a later chunk could need is recorded: the
premises or the records hold it, or the transcript shows the worker writing it into the premises,
AGENTS.md, docs/decisions.md, the plan or a comment. A choice the worker made that the premises or
the records settle is not asked about. When the worker asks a question they answer, the judge quotes
the answer, build-release prints it, and the worker resumes with it. A quote they do not hold word
for word is dropped, and the question goes to the human. So does a question asked again after its
answer. A question the human answered earlier in the chunk goes back to the worker with that answer,
unless the question quotes the words of the answer that leave it open. The fourth question they
answer in one cycle goes to the human too, with the quote. An unfinished chunk resumes its session
next cycle, and the worker is shown the passage the judge quoted as the work remaining. The next
chunk starts a fresh session. Cycles continue until an exit below or Ctrl-C, either of which stops
that one chunk. Words: the setup's CLAUDE.md → "Vocabulary".
build-release needs tmux 3.2 or later, and checks it before it starts anything. Each chunk runs in its
own window of one tmux session per project, named loop-<key>, such as loop-claude-config. <key> is
the checkout's path relative to ~/code, or to / outside it, with a dash for each character other
build-release needs tmux 3.2 or later, and checks it before it starts anything. Each chunk runs in
its own window of one tmux session per project, named loop-<key>, such as loop-claude-config. <key>
is the checkout's path relative to ~/code, or to / outside it, with a dash for each character other
than a letter, a digit, _ or -. The tmux session's @loop-root option names its checkout, and a
checkout whose key maps to a tmux session another checkout runs is refused. build-release <task>
starts the chunks that may start now, then attaches to the tmux session, or switches to it inside
@@ -43,11 +42,12 @@ release review, runs alone in the window no-item.
Each window runs a build-release for that one chunk, started with --chunk <window>, which nobody
types. As a chunk finishes, its loop starts each chunk that may start then, with the task it ran
itself, and exits, which closes its window. A loop that stops, by Ctrl-C, an exit below or a
failure, keeps its window, with its last lines, and its chunk keeps its items; the next build-release
<task> starts it again before any other. To stop every chunk, press Ctrl-C in each window. A chunk's
claude session is named "A <key> build-release <window>", so a rerun resumes a chunk left open, and is
deleted when the chunk finishes. A fresh worker is told the items the project's other chunks hold,
running or stopped: each one's own and those on its latest `Chunk items:` line, and leaves them out.
failure, keeps its window, with its last lines, and its chunk keeps its items; the next
build-release <task> starts it again before any other. To stop every chunk, press Ctrl-C in each
window. A chunk's claude session is named "A <key> build-release <window>", so a rerun resumes a
chunk left open, and is deleted when the chunk finishes. A fresh worker is told the items the
project's other chunks hold, running or stopped: each one's own and those on its latest `Chunk
items:` line, and leaves them out.
A question only the human can answer is an interrupt (bin/agent_cycle/interrupt.py).
build-release prints the question in the chunk's window and rings its bell. Until it is answered the
@@ -66,8 +66,8 @@ stops are left out: Ctrl-C, printing this help, the build-release that started t
attaches or prints how to, and a loop whose chunk finished once it started the next chunks. A DM
that fails is said on stderr, and the loop goes on. Where no answer has come 10 minutes before the
worker's hour-long prompt cache expires, and the worker's context holds at least 60k tokens,
build-release compacts the worker's session with `claude -p /compact` and keeps waiting, so the resume
doesn't write the whole context again.
build-release compacts the worker's session with `claude -p /compact` and keeps waiting, so the
resume doesn't write the whole context again.
As a chunk starts, before it is routed, build-release runs bin/chunk-preflight --worktree, adding
--item <ID> in a window named for an item, and quotes what it prints in the first prompt
@@ -160,9 +160,9 @@ measurement.
A change to bin/build-release or any bin/**/*.py takes effect at the next cycle boundary, once
build-release --help succeeds: the loop reloads into the edited script.
Under merge = "human", where no chunk runs and every item left awaits a person's merge, build-release
doesn't start a chunk: it names those pull requests, in a DM too, and exits 0. Its window closes,
so the next build-release <task> reads the plan again.
Under merge = "human", where no chunk runs and every item left awaits a person's merge,
build-release doesn't start a chunk: it names those pull requests, in a DM too, and exits 0. Its
window closes, so the next build-release <task> reads the plan again.
Exit 1, saying why, when:
- no task is given