diff --git a/CHANGELOG.md b/CHANGELOG.md index ea5aaec8..33db6f7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- README β†’ Install now says that every machine taking this checkout must be a sandbox with no direct access to a production environment, since `settings.json` runs Claude Code in auto mode with the dangerous-mode prompt skipped. Before, it asked for a sandbox only for `loop-claude`. + ## 0.3.0 - A task scored L 1 now routes its worker, or a delegated subagent such as a search, one rung below the project's rung, as L 2 does; it used to go two rungs below. On an Opus 5.5 project that is Sonnet 5.5 at high, not Haiku 5.5 at max: chunks started on Haiku 5.5 took more review rounds and unfinished verdicts. diff --git a/README.md b/README.md index 2d9692d7..7ee48994 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ Me, on my own machines, which take tagged releases. Nobody else depends on it. ## Install +Take this checkout only onto a machine that is a sandbox with no direct access to a production environment, such as a dedicated VM: `settings.json` runs Claude Code in auto mode with the dangerous-mode prompt skipped. + Claude Code may already have created `~/.claude`, where `git clone` refuses to run, so make the repository in place: ```sh @@ -64,7 +66,7 @@ Then pick a model with `/model`. After a pick, `git status` may list `settings.json`, and a `git pull` that changes the file refuses to run. `git add settings.json` stages no change and clears both. Once it is staged, such a pull goes through and drops the model: pick it again. -Link `loop-claude` onto `PATH`: `ln -s ~/.claude/bin/loop-claude ~/.local/bin/loop-claude`. Run `loop-claude` only in a sandbox with no direct access to a production environment, such as a dedicated VM: every claude it starts, the interactive ones included, skips every permission prompt. +Link `loop-claude` onto `PATH`: `ln -s ~/.claude/bin/loop-claude ~/.local/bin/loop-claude`. Every claude it starts, the interactive ones included, skips every permission prompt. ## Update @@ -100,7 +102,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a - `metric-bench [history]` benches cheap static metrics of a project's Python against the places its comprehension history names as hardest; `metric-bench --help` states the metrics and the scores. - `rank_todo.py [--check] [todo.md]` scores and ranks a project's `todo.md`; `rank_todo.py --help` states the format. - `reading-cost [--reset] [record]` appends a figure for each chunk `loop-claude` finished to a project's `docs/reading-cost.md`, and says whether the figures rise; `reading-cost --help` states the measure. -- `review-replay ` replays a review pass's archived rounds from the projects run on the model, on the code each reviewed, and prints the lowest rung below the project's that, like each rung above it, finds every πŸ”΄ and 🟑 the project's rung finds again; `review-replay --help` states the replay. Run it only in a sandbox, like loop-claude: each replayed reviewer skips every permission prompt, stability-reviewer has Bash, and an archived prompt may name paths on the host. +- `review-replay ` replays a review pass's archived rounds from the projects run on the model, on the code each reviewed, and prints the lowest rung below the project's that, like each rung above it, finds every πŸ”΄ and 🟑 the project's rung finds again; `review-replay --help` states the replay. Each replayed reviewer skips every permission prompt, stability-reviewer has Bash, and an archived prompt may name paths on the host. - `rule-hook [overrides]` blocks a tool call that breaks a rule a program can check, unless the call overrides the rule; `settings.json` β†’ `hooks` runs it before each Bash, Edit, MultiEdit, Write and Agent call, and `rule-hook --help` states the rules and the override. - `score-outcomes [L E I S]` lists the finished items whose guessed scores sit nearest the given ones, and the shipped items the project's `docs/score-anchors.md` names for each level of L, E and I, each with what its chunk measured; then the median outcome at each guessed R and S, and how well L, E and I each order the chunks by review rounds and πŸ”΄ findings; `score-outcomes --help` states the measures. - `settings_filter.py` is git's clean filter for `settings.json`: it drops `"model"` and sorts the keys. `.gitattributes` sets the filter `settings` on `settings.json`, and Install's `git config` line makes this script that filter. diff --git a/bin/loop_claude/loop/main.py b/bin/loop_claude/loop/main.py index 73d3c34f..c0ae2495 100644 --- a/bin/loop_claude/loop/main.py +++ b/bin/loop_claude/loop/main.py @@ -39,17 +39,10 @@ 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 interrupt, and as every cycle ends, Ctrl-C and a failure included, the session's transcript is -copied to $LOOP_CLAUDE_TRANSCRIPTS///.jsonl (default -~/.claude/loop-claude-transcripts), named by its hash. is the hash of the transcript's first -line with a timestamp, the same for every cycle of a chunk. Beside the copy, .outcomes.md -holds the verdict, with the transcript passage the judge rested it on, any passage it quoted to -show an escalation trigger fired, and the judge's rung; each answer the judge quoted, with the -question it answers and any passage it quoted to show an escalation trigger fired; each judge -reply the loop rejected, with the reason and the reply as json; and why the loop stopped. Each of these opens with its UTC time. Claude Code keeps a folder per -session beside its transcript, holding the subagents' transcripts among other files; that folder, -and every other file named after the session except the transcript, are copied into -/session/. A file there is replaced only by a version that grew from it. A file Claude Code -rewrote lands beside its copy as .. +copied into a folder per chunk under $LOOP_CLAUDE_TRANSCRIPTS/ (default root +~/.claude/loop-claude-transcripts), named by its hash, with an outcomes file beside it: the task, +then each verdict, quoted answer, rejected judge reply, step-up and stop, each opened by its UTC +time. The layout, and when a copy is replaced, are in bin/transcript_archive/__init__.py. Every claude loop-claude starts runs the project's model, saved per in ~/.claude/loop-claude-models.json and read each cycle, unless routing, below, puts the worker, @@ -57,75 +50,96 @@ the session /talk opens and the judge on another rung; a project without an entr 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. -Where that model is on the routing ladder (bin/model_routing/ladder.py), the worker and the -session /talk opens run on one of the ladder's rungs: a model at an effort. As a chunk starts, it is routed -on the item chunk-preflight names, read from todo.md on the default branch as the preflight just -fetched it (chunk_pick.chunk_item). That item is the earliest release's top item that does not wait, -but only where that release is the next one: the earliest after the newest vX.Y.Z tag that todo.md -has named at that tag or since, skipping a release its ## Renamed section marks renamed, or, where -no tag names a version, the earliest release. Otherwise no item routes the chunk. An item waits -while it is marked question, or while an item that blocks it is still in the table. The item's L -picks the worker's rung, stepping from the model's cheapest rung by WORKER_STEPS in +Routing: the worker's rung + +Where the project's model is on the routing ladder (bin/model_routing/ladder.py), the worker and the +session /talk opens run on one of the ladder's rungs: a model at an effort. As a chunk starts, it is +routed on the item chunk-preflight names, read from todo.md on the default branch as the preflight +just fetched it (chunk_pick.chunk_item). That item is the earliest release's top item that does not +wait, but only where that release is the next one: the earliest after the newest vX.Y.Z tag that +todo.md has named at that tag or since, skipping a release its ## Renamed section marks renamed, or, +where no tag names a version, the earliest release. Otherwise no item routes the chunk. An item +waits while it is marked question, or while an item that blocks it is still in the table. The item's +L picks the worker's rung, stepping from the model's cheapest rung by WORKER_STEPS in bin/model_routing/ladder.py, below it for a low L; without such an item, or with its L, E or I -unscored, the chunk runs on the model's cheapest rung. The -item's E + I picks the reviewers' rung, stepping up from the cheapest rung by REVIEW_STEPS there, -never below the worker's rung. Where it steps none and the worker runs no higher than the cheapest -rung, a pass REPLAYED there names runs on the rung it names, the lowest a review-replay run found -finding what the cheapest rung finds, even below the worker's. The worker's first prompt names the rung and the item, and asks the -worker to name each item the chunk takes, with its L and E + I, and to count the item's size again -once it has read the code (prompts.recount). The prompt names the rung of each review that runs on -a rung other than the worker's: the reviewers' rung or the replay's for each pass's reviewer, and -the cheapest rung for each comprehension seat and the security pass. It also names the reviewers' rung -each higher E + I picks, so the worker reviews an item it takes in on that rung in the same run. -When the worker runs below the cheapest rung, the prompt has it launch each subagent that files or -scores todo.md items on the rung subagent-rung --plan prints. The prompt after -each unfinished verdict says this again, since a step-up may have moved the worker. A reviewer or -seat that rules the work below standard may ask to rerun one rung up; each prompt names that rung. -loop-claude hands the worker's claude its own rung, the project's and the reviews' E + I, in -LOOP_CLAUDE_WORKER_RUNG, LOOP_CLAUDE_PROJECT_RUNG and LOOP_CLAUDE_ESCAPE_AND_IMPACT, and rule-hook -refuses a review launched below the rung those pick for it. The judge reports the highest L and the -highest E + I the worker states for an item it takes in. The next cycle steps the worker up to the -rung that L picks, never down, and the reviewers to the rung picked by the higher of two: that -E + I, or the routed item's (Route.reviewed_on in bin/model_routing/route.py). A level off its -scale counts as none. Every second unfinished verdict on a chunk steps it up one rung -(routing.stepped). So does an unfinished verdict on a worker that ended its run asking for a -higher rung, once the judge quotes the transcript showing that the escalation trigger it named -fired (~/.claude/CLAUDE.md β†’ "Working with the codebase" lists them). An interrupt or a quoted answer -with such a quote steps the rung as it comes in, before the human is asked or the worker resumes -(routing.stepped_by_ruling). Each such step marks how many transcript entries the session held, -and from then on the judge must quote the worker's own lines after that mark, where it reads a -[step] line. Each step on an escalation stops two rungs above the rung the chunk's item picks, and the worker's prompts -offer it only while the worker is below that limit. Each finished or unfinished verdict, interrupt, -quoted answer, stop and step-up in the archive names the worker's rung, with the item, L and E + I -that routed the chunk, any taken-in E + I that picks a higher review rung (archived as a step-up -too), and the mark. A rerun resumes an open chunk on the latest -route named there, and counts its unfinished verdicts afresh. A rung no longer on the ladder, or -below the one its item's L picks, is dropped, and the chunk is routed afresh from todo.md. So is a -chunk whose archived line names an R + C, as loop-claude wrote before it routed on L. A todo.md or +unscored, the chunk runs on the model's cheapest rung. + +Routing: the reviewers' rung + +The routed item's E + I picks the reviewers' rung, stepping up from the cheapest rung by +REVIEW_STEPS in bin/model_routing/ladder.py, never below the worker's rung. Where it steps none and +the worker runs no higher than the cheapest rung, a pass REPLAYED in that file names runs on the +rung it names, the lowest a review-replay run found finding what the cheapest rung finds, even below +the worker's. + +Routing: what the worker's prompts say + +The worker's first prompt names the rung and the item, and asks the worker to name each item the +chunk takes, with its L and E + I, and to count the item's size again once it has read the code +(prompts.recount). The prompt names the rung of each review that runs on a rung other than the +worker's: the reviewers' rung or the replay's for each pass's reviewer, and the cheapest rung for +each comprehension seat and the security pass. It also names the reviewers' rung each higher E + I +picks, so the worker reviews an item it takes in on that rung in the same run. When the worker runs +below the cheapest rung, the prompt has it launch each subagent that files or scores todo.md items +on the rung subagent-rung --plan prints. The prompt after each unfinished verdict says this again, +since a step-up may have moved the worker. A reviewer or seat that rules the work below standard may +ask to rerun one rung up; each prompt names that rung. loop-claude hands the worker's claude its own +rung, the project's and the reviews' E + I, in LOOP_CLAUDE_WORKER_RUNG, LOOP_CLAUDE_PROJECT_RUNG and +LOOP_CLAUDE_ESCAPE_AND_IMPACT, and rule-hook refuses a review launched below the rung those pick for +it. + +Routing: step-ups + +The judge reports the highest L and the highest E + I the worker states for an item it takes in. The +next cycle steps the worker up to the rung that L picks, never down, and the reviewers to the rung +picked by the higher of two: that E + I, or the routed item's (Route.reviewed_on in +bin/model_routing/route.py). A level off its scale counts as none. Every second unfinished verdict +on a chunk steps it up one rung (routing.stepped). So does an unfinished verdict on a worker that +ended its run asking for a higher rung, once the judge quotes the transcript showing that the +escalation trigger it named fired (~/.claude/CLAUDE.md β†’ "Working with the codebase" lists them). An +interrupt or a quoted answer with such a quote steps the rung as it comes in, before the human is +asked or the worker resumes (routing.stepped_by_ruling). Each such step marks how many transcript +entries the session held, and from then on the judge must quote the worker's own lines after that +mark, where it reads a [step] line. Each step on an escalation stops two rungs above the rung the +chunk's item picks, and the worker's prompts offer it only while the worker is below that limit. + +Routing: the archive and reruns + +Each finished or unfinished verdict, interrupt, quoted answer, stop and step-up in the archive names +the worker's rung, with the item, L and E + I that routed the chunk, any taken-in E + I that picks a +higher review rung (archived as a step-up too), and the mark. A rerun resumes an open chunk on the +latest route named there, and counts its unfinished verdicts afresh. A rung no longer on the ladder, +or below the one its item's L picks, is dropped, and the chunk is routed afresh from todo.md. So is +a chunk whose archived line names an R + C, as loop-claude wrote before it routed on L. A todo.md or an archive that cannot be read or parsed is said on stderr, and the chunk is routed without it. -The judge of a model listed in JUDGE_REPLAYED (bin/loop_claude/routing.py) runs on the rung that -the reviewers' E + I (Route.reviewed_on) picks for a review from that model. It never runs below the +Routing: the judge's rung + +The judge of a model listed in JUDGE_REPLAYED (bin/loop_claude/routing.py) runs on the rung that the +reviewers' E + I (Route.reviewed_on) picks for a review from that model. It never runs below the model's cheapest rung, and runs on it when no item routed the chunk or was taken in. Its rung stays put when the worker steps up. A model is listed once judge-replay found its cheapest rung returning every verdict the reference judge reproduced. Any other model's judge runs at the effort its settings give. -Counting the cycles a verdict closed across all projects in the archive, the first loop to close -one 20 or more cycles after the last measurement measures every finished chunk there, with no model -run: tokens by project, subagent type, rung and the tool whose results they took in, and, for each -chunk a todo.md item routed, grouped by the rung it started on: its review rounds past each pass's -first, its unfinished verdicts and its subagents' rungs. It writes them to routing-figures.md at the archive's root. They call for a -routing change when chunks routed onto a rung took more review rounds or unfinished verdicts than -chunks routed onto the next rung up, each rung with 5 chunks or more, or when the reports of 5 or -more subagents of one type were longer than the tool results they read. Each call 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. A line `- Reset` in -routing-calls-raised.md restarts both: the figures count only chunks that finished after it, and a -call raised before it may be raised again. A chunk that cannot be read is skipped and named in the -figures; figures that cannot be measured or written are said on stderr, and the loop goes on. +Routing: the figures + +Counting the cycles a verdict closed across all projects in the archive, the first loop to close one +20 or more cycles after the last measurement measures every finished chunk there, with no model run: +tokens by project, subagent type, rung and the tool whose results they took in, and, for each chunk +a todo.md item routed, grouped by the rung it started on: its review rounds past each pass's first, +its unfinished verdicts and its subagents' rungs. It writes them to routing-figures.md at the +archive's root. They call for a routing change when chunks routed onto a rung took more review +rounds or unfinished verdicts than chunks routed onto the next rung up, each rung with 5 chunks or +more, or when the reports of 5 or more subagents of one type were longer than the tool results they +read. Each call 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. A line +`- Reset` in routing-calls-raised.md restarts both: the figures count only chunks that +finished after it, and a call raised before it may be raised again. A chunk that cannot be read is skipped and +named in the figures; figures that cannot be measured or written are said on stderr, and the loop +goes on. 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. diff --git a/bin/rule_hook/override_log.py b/bin/rule_hook/override_log.py index 2bc94655..44456a62 100644 --- a/bin/rule_hook/override_log.py +++ b/bin/rule_hook/override_log.py @@ -34,10 +34,14 @@ def parsed_entry(line: str) -> LogLine | None: def this_chunks(entry: LogLine, reflog: set[str], branch: str, on_default: typing.Callable[[str], bool]) -> bool: - """Whether the override is the current branch's: its commit is in the branch's reflog, which keeps a commit an amend or a rebase replaced, follows `git branch -m`, and holds no other branch's commit.""" + """Whether the override is the current branch's: its commit is in the branch's reflog, which holds every commit the branch has had. So: + - an override logged at c1 still counts after an amend or a rebase replaced c1 with c2; + - one logged under the branch's old name counts after `git branch -m`, which carries the reflog over; + - one logged on another branch, at a commit this reflog lacks, doesn't count; + - one logged at a default-branch commit, such as the one the branch started from, sits in the reflogs of other branches too, so it counts only under this branch's own name; + - one logged before any commit existed, with an empty commit, counts on every branch.""" if entry.commit == "": return True - # The default branch's commits are in every branch's reflog, so such a line counts only under the branch's own name: one logged before the branch's first commit. return entry.commit in reflog and (entry.branch == branch or not on_default(entry.commit)) diff --git a/bin/shell_command.py b/bin/shell_command.py index b39eae78..6fe84ce8 100644 --- a/bin/shell_command.py +++ b/bin/shell_command.py @@ -29,6 +29,16 @@ def simple_commands(command: str, cwd: str, home: str) -> list[Simple]: def segments(command: str) -> list[list[str]]: + """The command's simple commands as lists of words, split at ; & | ( ) < > and line breaks, without redirect targets. Shell forms it does not parse: + - a quoted string is one word, so `bash -c "git commit"` and `echo "$(git commit)"` hide the inner command; + - a backtick substitution stays inside its words, while `$(git commit)` outside quotes splits into the `$` and a command of its own; + - a keyword or a brace opens its command's words, so `then git commit` reads as the command `then`; + - a redirect splits a command in two, so `git > out commit` reads as `git` and `commit`; + - `<(...)` and `<<<` read as redirects, so the word after them is dropped as the target; + - a file descriptor before a redirect, as in `2>&1`, stays a word; + - a heredoc's body is dropped; + - variables, aliases and functions are not expanded; + - a line with an unbalanced quote yields nothing.""" text = uncommented(HEREDOC.sub(lambda heredoc: heredoc.group(0).split("\n", 1)[0], command)) tokens = lexed(text) if tokens is None: diff --git a/bin/transcript_archive/__init__.py b/bin/transcript_archive/__init__.py index e69de29b..8bbb36e1 100644 --- a/bin/transcript_archive/__init__.py +++ b/bin/transcript_archive/__init__.py @@ -0,0 +1,22 @@ +"""The archive of loop-claude's transcripts: where each file lives, what it holds, and when a copy is replaced. + +///.jsonl +///.outcomes.md +///session/... + +- The archive root is $LOOP_CLAUDE_TRANSCRIPTS, or ~/.claude/loop-claude-transcripts (location.archive_root). +- The project key is the checkout's path relative to ~/code, or to / outside it (project_key.project_key). +- is the hash of the transcript's first line with a timestamp (location.chunk_folder). It is the + same for every cycle of a chunk, and differs between chunks, since a finished chunk's session is deleted + and the next chunk's transcript starts afresh. +- .jsonl is a copy of the session's transcript, named by the hash of its bytes, so each distinct + transcript is kept once. +- .outcomes.md sits beside the copy and holds the task, then each outcome opened by its UTC time (outcomes.py). +- session/ holds every other file of the session, such as the subagents' transcripts, which Claude + Code keeps in a folder named after the session, beside the transcript. A file there is replaced only by a version that + grew from it. A file Claude Code rewrote whole lands beside its copy as . + (write.copy_for). + +write.archive writes the layout, at every interrupt and as every cycle ends. read.py and the tools that +measure finished chunks read it. +""" diff --git a/bin/transcript_archive/write.py b/bin/transcript_archive/write.py index cf8e49b2..f147dbe5 100644 --- a/bin/transcript_archive/write.py +++ b/bin/transcript_archive/write.py @@ -12,6 +12,7 @@ from utc_stamp import utc def archive(project_archive: pathlib.Path, path: str, task: str, outcome: str, at: float) -> Failure | None: + """Keeps the transcript at path, its outcomes file and its session's files in project_archive, in the layout this package's docstring gives; the failure that stopped it, or None. The outcome is stamped and appended to the outcomes file, which opens with the task only when the copy is new.""" try: with open(path, "rb") as handle: raw = handle.read() diff --git a/docs/decisions.md b/docs/decisions.md index 4061bb7b..3a2bf1b3 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -136,7 +136,19 @@ Valid while the ladder orders its rungs by competence. ## todo.md: one table of items, scored by the formula it states, held to its bar and ranked by `bin/rank_todo.py`, which ranks each blocker above the items it blocks; each achieve goal weighs by its position, code health first and four times as heavy while the comprehension panel's overall is under 7.0 or unmeasured, then README.md's goals; the table's order is the plan's only order -2026-10-02, lilleman. Serves goal 1: findings were filed faster than chunks closed them, so the plan grew without telling what mattered. Each item is scored as `~/.claude/rules/todo-items.md` says; this repo's formula counts value highest and size least. An item under the bar is not kept; this repo's bar started at 10 and was set to 9 the same day, purging the 17 items under it. An Exempt cell keeps a row past the bar where a rule needs it kept. lilleman retired the two decisions whose plans the purge removed: the stats line in the transcript archive, and three benches before a workflow change merges. A finding under the bar is recorded nowhere, so a later review may raise it again, and the run rescores it. That costs one scoring; a ledger of dropped findings would regrow the list the bar caps. larv-review's "Round cap" β†’ "Done" counts a finding named under the bar as settled, so one raised again holds no pass open. `rank_todo.py --check` is part of larv-review's gate, since only a check keeps the stored Score from going stale. The format is mandatory in every project, as the premises are (goal 1.3); the formula and bar are each project's own. A script ranks the table so a re-rank after each addition or edit is deterministic and cheap. A 🟑 against a technical principle is exempt as `principle`, because its audience value scores low and the bar would drop every one. A 🟒 against a principle is scored like any other finding. 2026-10-08, lilleman: the goal weights in `todo.md` depart from an even spread by position, which would weigh goal 4, leaking nothing, at 0.11. Valid while one human sets the bar and reads the ranking, and while the items marked `principle` stay few enough to rank. +2026-10-02, lilleman. Serves goal 1: findings were filed faster than chunks closed them, so the plan grew without telling what mattered. Each item is scored as `~/.claude/rules/todo-items.md` says; this repo's formula counts value highest and size least. The format is mandatory in every project, as the premises are (goal 1.3); the formula and bar are each project's own. A script ranks the table so a re-rank after each addition or edit is deterministic and cheap. Valid while one human sets the bar and reads the ranking, and while the items marked `principle` stay few enough to rank. + +2026-10-02, lilleman, on the bar. An item under the bar is not kept; this repo's bar started at 10 and was set to 9 the same day. An Exempt cell keeps a row past the bar where a rule needs it kept. + +2026-10-02, lilleman, on the purge. Setting the bar to 9 purged the 17 items under it. lilleman retired the two decisions whose plans the purge removed: the stats line in the transcript archive, and three benches before a workflow change merges. + +2026-10-02, lilleman, on re-raising findings. A finding under the bar is recorded nowhere, so a later review may raise it again, and the run rescores it. That costs one scoring; a ledger of dropped findings would regrow the list the bar caps. larv-review's "Round cap" β†’ "Done" counts a finding named under the bar as settled, so one raised again holds no pass open. + +2026-10-02, lilleman, on the gate check. `rank_todo.py --check` is part of larv-review's gate, since only a check keeps the stored Score from going stale. + +2026-10-02, lilleman, on the `principle` exemption. A 🟑 against a technical principle is exempt as `principle`, because its audience value scores low and the bar would drop every one. A 🟒 against a principle is scored like any other finding. + +2026-10-08, lilleman, on the goal weights: the weights in `todo.md` depart from an even spread by position, which would weigh goal 4, leaking nothing, at 0.11. 2026-10-15, lilleman: the scores get a researched method, which `todo.md` items 149 and 151 build, after PR #283 shipped the ranking, PR #296 the risk scores and PR #298 the anchors each project names for each level in `docs/score-anchors.md`; the evidence is in `docs/scoring-and-goals-research.md`. R becomes L + E + I βˆ’ 2: the chance the change holds a defect, set first by its size; the chance the defect escapes tests, review and monitoring; and the worst impact dimension, each about Γ—10 per level. I5, irreversible, holds R at 7 or more, and I4 at 5 or more, since a severe enough consequence outranks how unlikely it is. C goes from every table and tool: what it scored beyond size, spread and novelty, which L already holds, is complexity, which adds almost nothing once size is accounted for. Items rank by value per cost, V / 2^S, and V sums each cited achieve goal's weight times how far the item moves it. A goes, and the Audience says whose value the goals serve. R stays out of the ranking and sets how carefully an item is done; an item that lowers risk scores it as value. Each release fills by priority up to a capacity it states, in place of the bar. Each README goal is `maintain`, which vetoes an item that breaks it, or `achieve`, with a signal, a counter-signal and a one-line reason, as this README's Goals now mark them; each project keeps settled decisions to test its goals against. Each part of this method holds once the item that builds it ships. 2026-10-16, lilleman: a task's L and E + I pick its rungs in place of R, as `routing: one ladder` records. diff --git a/docs/reading-cost.md b/docs/reading-cost.md index e60317fc..5f7d7977 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -738,3 +738,11 @@ Read most (opens and searches): ## Reading cost, chunk 4527b73a80f1, finished 2026-10-21T22:42:41Z 63554 new input tokens before the first commit. + +## Reading cost, chunk 4ac79cd68d51, finished 2026-10-21T22:53:11Z + +53393 new input tokens before the first commit. + +Read most (opens and searches): + +- `skills/larv-review/SKILL.md` 1 diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index 0a307156..1bd6fede 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -142,7 +142,7 @@ A verified HIGH inside this chunk's blast radius is fixed here, outside it on it Only the user may answer `claude-security`'s cost prompt. `/security-review` or `claude-security` unavailable, the plugin's cost prompt unanswered, or no file scanned β†’ say so in the summary; never substitute a hand-rolled pass. -**Do not over-read a clean result.** `/security-review` is single-repo and static: it does not trace authorization across services, does not run the application, and deliberately excludes dependency CVEs in third-party libraries β€” Renovate/Dependabot owns those, per `~/.claude/CLAUDE.md` β†’ "Working with the codebase". Never point an automated reviewer or scan at an untrusted fork's PR content; a PR body is untrusted input to it (CVE-2025-59536, CVE-2026-21852). +**Do not over-read a clean result.** `/security-review` is single-repo and static: it does not trace authorization across services, does not run the application, and deliberately excludes dependency CVEs in third-party libraries. Never point an automated reviewer or scan at an untrusted fork's PR content; a PR body is untrusted input to it (CVE-2025-59536, CVE-2026-21852). ### Overrides diff --git a/todo.md b/todo.md index 0908ff73..f2ae7655 100644 --- a/todo.md +++ b/todo.md @@ -12,17 +12,10 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| -| 131 | 0.4.0 | | | **Describe the transcript archive's layout in `bin/transcript_archive/`, which owns it, and have loop-claude's help point there.** | 1 | 2 | 1 | 2 | 2 | code health by 4, 1.4 by 4 | 29.2 | -| 133 | 0.4.0 | | | **Show, beside `bin/rule_hook/override_log.py`'s `this_chunks`, one example per case it decides: an amended or rebased commit, a renamed branch, and a commit on the default branch.** | 1 | 2 | 1 | 2 | 2 | code health by 4, 1.4 by 4 | 29.2 | -| 134 | 0.4.0 | | | **Name in `bin/shell_command.py`'s `segments` the shell forms it does not parse, so a caller knows what it misses.** | 1 | 2 | 1 | 2 | 2 | code health by 4, 1.4 by 4 | 29.2 | -| 157 | 0.4.0 | | | **Split `docs/decisions.md` β†’ `todo.md: one table of items …`'s 2026-10-02 paragraph into one paragraph per choice.** | 1 | 2 | 1 | 2 | 2 | code health by 4, 1.4 by 4 | 29.2 | -| 80 | 0.4.0 | | defect | **State in README β†’ Install that every machine taking this checkout must be a sandbox, as `settings.json`'s auto mode assumes.** | 1 | 2 | 1 | 2 | 1 | 2 by 4 | 28.7 | | 122 | 0.4.0 | | | **Assemble the judge's prompt in `bin/loop_claude/cycle/judge.py`, importing only wording the worker also sees, and call the worker "the worker" in it.** | 2 | 2 | 3 | 5 | 3 | code health by 5, 1.4 by 5 | 27.4 | | 207 | 0.4.0 | | | **Have `chunk-preflight` and larv-review's scoring-run trigger decide "work has landed towards the next release" in one place.** | 2 | 2 | 3 | 5 | 3 | code health by 5 | 22.5 | | 130 | 0.4.0 | | | **Move the vote counting out of `bin/larv_review/ruling.py`'s `votes`, so reading a votes file decides nothing.** | 2 | 1 | 2 | 3 | 3 | code health by 4, 1.4 by 4 | 21.9 | -| 176 | 0.4.0 | | | **Give `loop-claude --help`'s routing paragraph sub-headings, such as Routing, Judge rung and Routing figures, so a reader finds a rule without reading 39 lines.** | 1 | 2 | 1 | 2 | 2 | code health by 3, 1.4 by 2 | 20.6 | | 170 | 0.4.0 | | decision | **Re-tune `WORKER_STEPS` and `REVIEW_STEPS` once 10 chunks have shipped under them, from how well L, E and I order their review rounds and πŸ”΄ findings.** | 2 | 2 | 3 | 5 | 2 | 1.1 by 3, 1.4 by 5 | 10.9 | -| 106 | 0.4.0 | | | **Make larv-review's "Do not over-read a clean result" cite a rule that says Renovate or Dependabot owns dependency CVEs, or drop the citation.** | 1 | 2 | 1 | 2 | 1 | 1.1 by 5 | 8.4 | | 154 | 0.4.0 | | defect | **Have `bin/shell_command.py`'s `segments` keep a command's words together across a redirect, so `git > out commit` reads as one git commit.** | 1 | 1 | 3 | 3 | 2 | 1.1 by 6 | 8.4 | | 186 | 0.4.0 | | | **Point every file a session parks outside its checkout, such as the comprehension panel's detached worktree and a build probe's output, at a folder a headless session has, since loop-claude's sessions have no scratchpad.** | 1 | 2 | 2 | 3 | 2 | 1.1 by 3, 1.5 by 2 | 6.8 | | 198 | 0.4.0 | | decision | **Count, per finished chunk, the findings that arose from misreading code that had already shipped, so code health's counter-signal shows.** | 3 | 2 | 2 | 5 | 5 | code health by 3, 1.1 by 2 | 6.2 | @@ -87,26 +80,6 @@ ## Details -### 131. Describe the transcript archive's layout in `bin/transcript_archive/`, which owns it, and have loop-claude's help point there. - -Two seats of PR #257's scoring run named `bin/transcript_archive/write.py:13` `archive`. Two invariants are explained only in loop-claude's help, `bin/loop_claude/loop/main.py`: folders are named by a hash of the transcript's first timestamped line, and a copy is replaced only by one grown from it. Make `archive` easier to read. - -### 133. Show, beside `bin/rule_hook/override_log.py`'s `this_chunks`, one example per case it decides: an amended or rebased commit, a renamed branch, and a commit on the default branch. - -Junior A, Mid A and the maintainability senior of PR #257's scoring run named `bin/rule_hook/override_log.py:36` `this_chunks`: which overrides belong to the chunk rests on reflog behaviour a reader must trust or work out. Make `this_chunks` easier to read. - -### 134. Name in `bin/shell_command.py`'s `segments` the shell forms it does not parse, so a caller knows what it misses. - -Junior A and Mid A of PR #257's scoring run named `bin/shell_command.py:31` `segments`: a hand-rolled tokenizer with dense regexes and a second lexing path for unbalanced quotes, which the rule hook and `reading-cost` both depend on. Its comments state each quirk but not its limits. Make `segments` easier to read. - -### 157. Split `docs/decisions.md` β†’ `todo.md: one table of items …`'s 2026-10-02 paragraph into one paragraph per choice. - -Raised by PR #283's prose pass. The paragraph runs about 330 words and holds six choices: the bar, the purge, re-raising findings, the gate check, the `principle` exemption and the 2026-10-08 weights note. A reader after one of them reads all six. - -### 80. State in README β†’ Install that every machine taking this checkout must be a sandbox, as `settings.json`'s auto mode assumes. - -A defect: goal 2, keeping the setup shareable between computers, does not hold while a new machine is never told it must be a sandbox. Raised by the principles audit of PR #224. The `settings.json` decision is valid while every machine taking this checkout is a sandbox, but Install asks for a sandbox only for `loop-claude`. - ### 122. Assemble the judge's prompt in `bin/loop_claude/cycle/judge.py`, importing only wording the worker also sees, and call the worker "the worker" in it. All four seats of PR #257's scoring run named `bin/loop_claude/cycle/judge.py:16` `JUDGE_RULES`. The prompt is spliced from constants in `cycle/prompts.py` (`ANSWER_DESTINATIONS`, `ANSWERS_RECORDED`, `either`) and `project/records.py` (`HUMAN_RULE_NAMES`), so a reader rebuilds it from three files. It says "the agent" where the code and `CLAUDE.md` β†’ "Vocabulary" say "worker". Wording the worker also sees, such as `ANSWER_DESTINATIONS` in `prompts.resumed`, may stay in `cycle/prompts.py`. Make `JUDGE_RULES` easier to read. @@ -119,18 +92,10 @@ All four seats of PR #257's scoring run named `bin/loop_claude/cycle/judge.py:16 Mid A of PR #257's scoring run named `bin/larv_review/ruling.py:8` `votes`. It calls `counted` while validating, to reject the maintainability senior's and Junior A's lines when Mid A and the inherited architect already agree overall: a ruling hidden in a parser. The counting rule is spread over `seats.py`, `ruling.py`, `comprehension_history.place_dimensions` and the help. Make `votes` easier to read. -### 176. Give `loop-claude --help`'s routing paragraph sub-headings, such as Routing, Judge rung and Routing figures, so a reader finds a rule without reading 39 lines. - -Raised by the prose pass of PR #302: the help, the docstring of `bin/loop_claude/loop/main.py`, is 145 lines, and its routing paragraph one block of 39, from the ladder through the judge's rung to the routing figures. A reader looking for one rule, such as when the worker steps up, reads it all. The comprehension seats already found the help hard (`larv-review places`: "loop-claude --help": a 120-line contract with no pointers to the modules it maps onto). - ### 170. Re-tune `WORKER_STEPS` and `REVIEW_STEPS` once 10 chunks have shipped under them, from how well L, E and I order their review rounds and πŸ”΄ findings. `docs/decisions.md` β†’ `routing: one ladder…` calls the steps lilleman approved on 2026-10-16 a first guess. Once 10 chunks that each shipped one item scored with L, E and I have merged, read `score-outcomes`' rank correlations for L, E and I and the routed-chunks table of `routing-figures.md`, and propose new steps to lilleman, whose call they are. -### 106. Make larv-review's "Do not over-read a clean result" cite a rule that says Renovate or Dependabot owns dependency CVEs, or drop the citation. - -Found by the goals audit of PR #245. `skills/larv-review/SKILL.md` Β§3 β†’ "Security" says Renovate or Dependabot owns dependency CVEs per `CLAUDE.md` β†’ "Working with the codebase", which says nothing about either. - ### 154. Have `bin/shell_command.py`'s `segments` keep a command's words together across a redirect, so `git > out commit` reads as one git commit. `segments('echo hi > f arg')` returns `arg` as a command of its own, and `segments('git > /tmp/x commit -m hi')` returns `git` and `commit -m hi` apart, though the shell runs one `git commit`. rule-hook's commit rules read the commands `segments` finds, so such a commit escapes `commit-one-line`, `no-ai-attribution`, `round-title-counts` and `todo-rank-check`. The comprehension seats' scoring run in PR #280 found it.