From 533b54c4bbaa1effe9959e7e0ab9e8be7bd3aa5e Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sat, 31 Oct 2026 01:34:45 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1=20(0=20misread);=20keep=20only?= =?UTF-8?q?=20what=20loop-claude=20owns=20in=20its=20preflight=20paragraph?= =?UTF-8?q?,=20say=20a=20bare=20run=20still=20fetches;=20this=20commit=20a?= =?UTF-8?q?lso=20holds=20prose=20round=201's=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- bin/chunk_preflight/main.py | 38 +++++++++++---------- bin/chunk_preflight/test_chunk_preflight.py | 2 +- bin/loop_claude/loop/main.py | 11 +++--- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6798be52..b9c5aa3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- A bare run of `chunk-preflight` now only prints the facts: it makes no worktree or branch for the item and runs no tool in one. `chunk-preflight --worktree` makes them and runs the tools, as `loop-claude` now asks for each chunk. Before, every run that found an item added the worktree `-item-` and the branch `item-`, which a run for the facts alone left to remove. +- A bare run of `chunk-preflight` now only prints the facts. It no longer adds the worktree `-item-` and the branch `item-`, or runs `reading-cost`, `larv-review places` and its other checks in that worktree. `chunk-preflight --worktree` does all that, and `loop-claude` now passes it. Before, every run that found an item added the worktree and branch, and you had to remove them after a run made only to read the facts. - A release review now fixes the findings of its architecture and principles passes in the release it reviews. Before, it filed each one in `todo.md`, so the release held the drift the review had found. It files only three kinds of finding, each under the release being reviewed: one whose fix needs a human answer, marked `question`; one whose fix adds a feature; and one whose fix the five rounds cannot finish. Until each is done, the release isn't ready to cut. - In a repo with no tag yet, `chunk-preflight` now calls a release finished once `todo.md` files no item under it: its release review is due, and no later release's item is taken. Before, it lost sight of such a release. - In a run `loop-claude` started, `rule-hook` now refuses a `/security-review` or `/claude-security` Skill call that the worker makes in its own context on a rung below the project's. It also refuses one from any subagent whose prompt doesn't open with `You are the security pass for this chunk.`, since that subagent's rung is unchecked. The refusal says to invoke the skill from a subagent on the project's rung, its prompt opening with that sentence. Before, only an Agent call that launched the security pass was held to that rung. diff --git a/bin/chunk_preflight/main.py b/bin/chunk_preflight/main.py index 8eb6c425..bec6a1f4 100644 --- a/bin/chunk_preflight/main.py +++ b/bin/chunk_preflight/main.py @@ -1,13 +1,13 @@ -"""Find the mechanical facts a chunk starts from, and, with --worktree, make its worktree, so its worker starts from them. +"""Find the mechanical facts a chunk starts from, so its worker starts from them; with --worktree, also make its worktree. usage: chunk-preflight [--worktree] -Run it inside a project checkout. A bare run only reads, so a run for the facts alone leaves -nothing to remove. loop-claude runs it with --worktree at the checkout root before each chunk's -first worker, before it routes the chunk, and quotes what it prints in the worker's prompt. It -fetches origin, when the checkout has that remote, and takes origin's default branch, or else the -local main or master. It leaves the checkout as it is, and reads todo.md as the default branch -holds it, the plan loop-claude routes on. It prints: +Run it inside a project checkout. It fetches origin, when the checkout has that remote, and takes +origin's default branch, or else the local main or master. Without --worktree, it still fetches, +but it doesn't make a worktree or a branch, and doesn't run any tool in one. loop-claude runs it +with --worktree at the checkout root before each chunk's first worker, before it routes the chunk, +and quotes what it prints in the worker's prompt. It leaves the checkout as it is, and reads +todo.md as the default branch holds it, the plan loop-claude routes on. It prints: - the newest v* tag on the default branch, and how many entries the default branch's CHANGELOG.md holds under ## Unreleased, or else how many commits followed the tag; @@ -23,9 +23,9 @@ holds it, the plan loop-claude routes on. It prints: Where todo.md's earliest release is x.y.z or earlier, it says todo.md files items under a release already cut; - with --worktree, the item's worktree: a sibling of the checkout named -item-, on - the branch item-; without it, that none was made. It continues a worktree already on that - branch; else it adds one on the local branch, else on a new branch tracking origin's, else on a - new branch off the default branch; + the branch item-. It continues a worktree already on that branch; else it adds one on the + local branch, else on a new branch tracking origin's, else on a new branch off the default + branch. Without --worktree, it prints that none was made; - the open pull requests whose head is the item's branch, each by its number and URL, as gh lists them on a github.com origin, and else as tea does. No title reaches the output; - the items of that release that a chunk taking the item may take too: those that are not @@ -33,17 +33,19 @@ holds it, the plan loop-claude routes on. It prints: item's own R is above 5; - each file or folder git tracks that the item's tagline or detail names in backticks, with a file's lines or a folder's files, and the item's tagline and detail; -- with the worktree, what `rank_todo.py --check todo.md`, `larv-review needs-scoring-run `, - `reading-cost` and `larv-review places` print in it, each with its exit code. reading-cost - appends to the worktree's docs/reading-cost.md, for the chunk to commit. +- where it made or continued the worktree, what `rank_todo.py --check todo.md`, + `larv-review needs-scoring-run `, `reading-cost` and `larv-review places` print in it, each + with its exit code. reading-cost appends to the worktree's docs/reading-cost.md, for the chunk to + commit. A fact it cannot find it says it cannot, and why, and goes on. A fetch, forge CLI or tool still running after {timeout} seconds, or after the seconds CHUNK_PREFLIGHT_TIMEOUT sets, is stopped; a stopped fetch reads origin as last fetched. With no item, it makes no worktree and runs none of those four tools, --worktree or not. -Exit 1, saying why, on any argument other than --worktree, on a CHUNK_PREFLIGHT_TIMEOUT that is no -number of seconds above 0, or when git cannot start or finds no checkout or no default branch. +Exit 1, saying why, on any argument other than --worktree, -h or --help, on a +CHUNK_PREFLIGHT_TIMEOUT that is no number of seconds above 0, or when git cannot start or finds no +checkout or no default branch. """ import pathlib import re @@ -64,7 +66,7 @@ TOOLS = (("rank_todo.py", "--check", "todo.md"), ("larv-review", "needs-scoring- # Seconds before a fetch, forge CLI or tool is stopped, so a hung one cannot keep the rest from printing; TIMEOUT_SETTING overrides it. TIMEOUT = 60 TIMEOUT_SETTING = "CHUNK_PREFLIGHT_TIMEOUT" -# The flag that makes the item's worktree and runs TOOLS in it. Three readers seated as lilleman picked it 2-1 over --start; --make-worktree misreads where the worktree is continued. +# The flag that makes the item's worktree and runs TOOLS in it. Three readers seated as the README's audience picked it 2-1 over --start. WORKTREE = "--worktree" @@ -84,7 +86,7 @@ def main(argv: list[str], env: typing.Mapping[str, str]) -> int: def run(setting: str | None, make: bool) -> list[str] | Failure: - """The preflight's lines, given what TIMEOUT_SETTING holds and whether to make the item's worktree; a Failure where that is no number of seconds, or git finds no checkout or no default branch.""" + """The preflight's lines, given the setting TIMEOUT_SETTING holds and whether to make the item's worktree; a Failure where the setting is no number of seconds above 0, or git finds no checkout or no default branch.""" timeout = seconds(setting) if isinstance(timeout, Failure): return timeout @@ -114,7 +116,7 @@ def preflight(root: pathlib.Path, timeout: float, make: bool) -> list[str] | Fai def item_facts(root: pathlib.Path, default: str, plan: Plan, timeout: float, make: bool) -> ItemFacts: - worktree = item_worktree(root, plan.branch, default) if make else Failure(f"none made, as it ran without {WORKTREE}.") + worktree = item_worktree(root, plan.branch, default) if make else Failure(f"none made, since it ran without {WORKTREE}.") path = worktree.path if isinstance(worktree, Worktree) else None return ItemFacts(plan, worktree, pull_listing(root, plan.branch, timeout), named_files(plan.text, path or root), tools_run(plan.first.id, path, timeout) if path else []) diff --git a/bin/chunk_preflight/test_chunk_preflight.py b/bin/chunk_preflight/test_chunk_preflight.py index f195e8e7..d40cf24b 100644 --- a/bin/chunk_preflight/test_chunk_preflight.py +++ b/bin/chunk_preflight/test_chunk_preflight.py @@ -270,7 +270,7 @@ class ChunkPreflightTool(unittest.TestCase): done = repo.preflight() self.assertEqual(done.returncode, 0, done.stderr) self.assertIn("item 3, L 2, E + I 5", done.stdout) - self.assertIn("Worktree: none made, as it ran without --worktree.", done.stdout) + self.assertIn("Worktree: none made, since it ran without --worktree.", done.stdout) self.assertIn("Open pull requests from item-3: none.", done.stdout) self.assertIn("`src/app.py`: 3 lines", done.stdout) self.assertNotIn("`reading-cost`", done.stdout) diff --git a/bin/loop_claude/loop/main.py b/bin/loop_claude/loop/main.py index a4f2a3cd..4ed47ac5 100644 --- a/bin/loop_claude/loop/main.py +++ b/bin/loop_claude/loop/main.py @@ -35,11 +35,10 @@ loop-inbox lists it too. While claude is open, Ctrl-C reaches it alone, and the While it runs, loop-claude also lists itself in loop-inbox, with the todo.md items its chunk takes, as bin/loop_claude/running_loops.py describes. -As a chunk starts, before it is routed, loop-claude runs bin/chunk-preflight --worktree -(bin/chunk_preflight/), which finds the chunk's facts and makes its worktree; chunk-preflight ---help lists them, and prompts.preflight_facts in bin/loop_claude/cycle/prompts.py quotes them in -the first prompt. A preflight that fails, or is still running after 600 s and is stopped, leaves -the worker to find the facts itself. +As a chunk starts, before it is routed, loop-claude runs bin/chunk-preflight --worktree and quotes +what it prints in the first prompt (prompts.preflight_facts in bin/loop_claude/cycle/prompts.py); +chunk-preflight --help says what it finds and makes. A preflight that fails, or is still running +after 600 s and is stopped, leaves the worker to find the facts itself. Each project has one session, named "A loop-claude", where is the checkout's path relative to ~/code, or to / outside it. The session is deleted when its chunk finishes. At every @@ -295,7 +294,7 @@ def chunk_start(session: Session, preflight: pathlib.Path, root: str, effects: E def chunk_facts(preflight: pathlib.Path, root: str, effects: Effects) -> str: - """What chunk-preflight printed at the checkout root, its worktree made, for a fresh worker's prompt, or why it could not run.""" + """What `chunk-preflight --worktree` printed at the checkout root, for a fresh worker's prompt, or why it could not run.""" done = effects.python([str(preflight), "--worktree"], root) if done.returncode: return prompts.preflight_failed(done.stderr.strip() or f"it exited {done.returncode}")