Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6dd2787e7b | |||
| eff57c1dfd |
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- **build-release and build-epic run every claude in a Claude home of their own, `~/.local/share/build-release/claude-home`, and a release is cloned anywhere, no longer into `~/.claude`.** Take this release as `README.md` → Update says for a checkout in `~/.claude`: finish each open chunk first, clone the release, and change each path into `~/.claude` that a project config or a crontab names, such as `principles` and `standards`, to the new clone. The commands build the home from the clone they ship in, with links to its `CLAUDE.md`, `rules/`, `agents/` and `skills/`, a `settings.json` generated from the clone's, and each plugin that file enables; they build it again when the clone moves to another release. Sign in there once: until you have, a command stops and prints the line to run, `CLAUDE_CONFIG_DIR=~/.local/share/build-release/claude-home claude`, where you type `/login`. Your own `~/.claude` is yours again: the loop doesn't run a claude there, and only `task-bench gather` still does. The settings filter and its Install step are gone, and `self-update` no longer asks you to pick a model with `/model`.
|
||||
- **build-release and build-epic run every claude in a Claude home of their own, `~/.local/share/build-release/claude-home`, and a release is cloned anywhere, no longer into `~/.claude`.** Take this release as `README.md` → Update says for a checkout in `~/.claude`: finish each open chunk first, clone the release, write `setup:` in place of `~/.claude/` in each project config's `principles` and `standards`, and change each path into `~/.claude` that a crontab names to the new clone. The commands build the home from the clone they ship in, with links to its `CLAUDE.md`, `rules/`, `agents/`, `skills/`, `principles/` and `bin/`, a `settings.json` generated from the clone's, and each plugin that file enables; they build it again when the clone moves to another release. Sign in there once: until you have, a command stops and prints the line to run, `CLAUDE_CONFIG_DIR=~/.local/share/build-release/claude-home claude`, where you type `/login`. Your own `~/.claude` is yours again: neither the loop nor `task-bench gather` runs a claude there. The settings filter and its Install step are gone, and `self-update` no longer asks you to pick a model with `/model`.
|
||||
- **`deploy-release` is gone, with no alias: `self-update` moves a clone of a release, and `cut-release` cuts one.** Take this release by cloning it, as `README.md` → Update says for a checkout in `~/.claude`, not with `deploy-release`. From then on, update with the new clone's `bin/self-update`. It takes no argument, moves the clone it ships in and names that clone in what it prints, so never run the development clone's copy. In the development clone, run `bin/cut-release` where you ran `deploy-release --cut`, and `bin/cut-release --patch <commits>` where you ran `--cut-patch <commits>`; neither takes a `<checkout>`. A cut no longer moves `~/.claude`: its stdout is the one `Done:` line, and each machine runs `self-update` afterwards. `cut-release` cuts the clone it ships in, whatever the directory it is run from, and no longer checks an origin. Its traces go to `~/.local/state/build-release/cut-release/`, and older traces stay where they are. Install no longer links `build-release` onto `PATH`: run it as `<clone>/bin/build-release`. Remove a link made earlier: it leads into `~/.claude`, to the old release.
|
||||
- Renamed `do-epic` to `build-epic`, with no alias. Before you update, finish your open `do-epic` chunks, since a chunk left open starts a fresh session, and stop every running `do-epic`, since one that runs across the update can't reload. Then, in each Jira project, relabel every issue that carries `do-epic-claude`, `do-epic-human` or `do-epic-release-review`, done issues included, to `build-epic-claude`, `build-epic-human` or `build-epic-release-review`, since a finished release review that keeps the old label isn't counted and `build-epic` files another. Rename each `DO_EPIC_E2E_*` variable you set to `BUILD_EPIC_E2E_*`. Nothing reads the old names. The next bullet moves the folders.
|
||||
- The setup's folders moved, and nothing reads or migrates the old ones. Before you update, stop every running `build-release` and `do-epic`. Then move `~/.claude-projects/` to `~/.config/build-release/` and `~/.config/build-release/do-epic/` to `~/.config/build-release/build-epic/`, and move `~/.claude/loop-claude-models.json` to `~/.config/build-release/models.json`; move `~/.claude/loop-claude-transcripts` to `~/.local/state/build-release/transcripts` and `~/.claude/do-epic-transcripts` to `~/.local/state/build-release/build-epic-transcripts`; move `larv-review`, `project-record`, `run-heavy` and `deploy-release` from `~/.local/state/` into `~/.local/state/build-release/`, and `~/.local/state/do-epic` to `~/.local/state/build-release/build-epic`; and delete `~/.local/state/loop-claude/`, which held only locks. Respell each setting that names `~/.claude-projects/`, such as `env-file`, and the log path in your crontab line. Where `XDG_CONFIG_HOME` or `XDG_STATE_HOME` holds an absolute path, the two folders are `build-release/` under it instead, and a chunk's tmux window is handed both variables.
|
||||
|
||||
@@ -14,7 +14,7 @@ How work proceeds in any repo, unless the repo's `AGENTS.md` says otherwise. The
|
||||
- **A client project's `CLAUDE.md` and `AGENTS.md` in its repo belong to its team.** Read both at the start of each chunk there. Propose each change that aligns them with this setup in a pull request of its own, never inside a chunk's; the one edit a chunk makes there is a decision's title in `AGENTS.md`. Until the team accepts a proposal, and after it declines or doesn't answer, follow the team's rule unless it breaks one of the project's goals. Record each such conflict as a decision in the `decisions` record, as `rules/decisions.md` asks: which rule you follow, why, and the open proposal's PR. Then nobody is asked twice.
|
||||
- **Read the goals file's `## Goals` and `## Audience` before starting a chunk, unless your prompt quotes them.** The chunk's items set its scope. The goals choose between ways to deliver those items, and never add to them.
|
||||
- **Read the plan and the decisions only as far as the chunk needs.** Where your prompt quotes `chunk-preflight`'s facts, they hold the next item's L, E + I, tagline and detail, and each item that may join it with its L, E + I, S, tagline and detail; run `todo-item` only for what they leave out. Otherwise run `todo-item list`, which prints every item's row in the plan's order, without details. Then read the details of only the items the chunk takes, with `todo-item show <ID>`, which prints an item's row and detail. `AGENTS.md` lists the project principles and the title of each decision no project principle covers. Read an entry in `docs/decisions.md` only where the project principle or the title leaves open what the chunk or the review needs. Print one entry with `markdown-section <file> <fragment of its title>`, where `<file>` is what `project-record open decisions` prints.
|
||||
- **Where a line of `chunk-preflight`'s facts says to have one subagent write `Touches:` lists, launch it before the chunk's own work.** `rank_todo.py --check`'s warning of items with no list, which the facts also quote, doesn't call for it: only the next item's chunk gets the line that says to launch one, so the lists are written once. An item without a list starts no chunk beside another's. Launch the subagent on the rung "Working with the codebase" gives a subagent that files or scores plan items. It reads the code and adds a list to each named item's detail with `todo-item edit <ID> --detail`, as `~/.claude/rules/todo-items.md` says, and doesn't change anything else in the detail. Where it cannot tell which part of a file the item changes, it lists the whole file and says in the detail that the change is not predictable. It leaves alone a list an item already holds, even one a later edit of the item made stale. Where the plan is a file in the repo, it works in a worktree of its own off the default branch, and ships the plan as a pull request of its own with `chunk-pr`.
|
||||
- **Where a line of `chunk-preflight`'s facts says to have one subagent write `Touches:` lists, launch it before the chunk's own work.** `rank_todo.py --check`'s warning of items with no list, which the facts also quote, doesn't call for it: only the next item's chunk gets the line that says to launch one, so the lists are written once. An item without a list starts no chunk beside another's. Launch the subagent on the rung "Working with the codebase" gives a subagent that files or scores plan items. It reads the code and adds a list to each named item's detail with `todo-item edit <ID> --detail`, as the setup's `rules/todo-items.md` says, and doesn't change anything else in the detail. Where it cannot tell which part of a file the item changes, it lists the whole file and says in the detail that the change is not predictable. It leaves alone a list an item already holds, even one a later edit of the item made stale. Where the plan is a file in the repo, it works in a worktree of its own off the default branch, and ships the plan as a pull request of its own with `chunk-pr`.
|
||||
- **Work one chunk at a time, and put every item that can share its review into it.** Every review has a fixed cost, so a chunk takes the next plan item plus every other item for which three things hold: they name one release; they fire the same review passes (`larv-review` §3); and no item outside the chunk blocks one of them. The items need not share a purpose. An item whose risk R, in the plan, is above 5 ships alone: it joins no chunk, and none joins it. The next plan item is the first that does not wait: an item waits while it is marked `question`, until the human answers, or while an item that blocks it is still in the plan. Tiny items, a few lines of change each, need not fire the same passes: bundle up to ten that name one release, and that no item outside the chunk blocks, into one chunk. Split a milestone into items in the plan before starting it. Fix a finding in the chunk's own change within the chunk. File a finding about anything else in `todo.md`.
|
||||
- **Ask, don't guess.** Three choices are always the human's: a goal; a release, meaning the items planned into it and when it is cut; and a change to build-release's routing ladder, its rungs included. Any other rule that asks the human's approval reserves that choice too. Ask about a reserved choice. For any other choice, first check whether the goals already answer it. If they nearly do, propose a change to the goals and show how it answers this case: an answer settles one question, a goal settles every question like it. Otherwise take the option you would recommend, and record it with its reason: in the item's detail, or, where it governs later work, as the next sentence says. A recommendation you can give a reason for is not a guess. Ask only where you have no recommendation. Write every answer once, where it belongs, never only in chat: a goal in the goals file, a working rule in `AGENTS.md`, a standing choice in a comment at the one place it governs, or in `docs/decisions.md` once made in more than one place. When an answer holds a goal and a choice, write the goal in the goals file, and record as a choice only what the goal leaves open.
|
||||
- **Bench a syntax with the people who write it.** Before a new or changed spelling of something users read or write ships — markdown, HTML, a config key, a CLI flag — a panel of fresh-context readers, seated as those users from the goals file's `## Audience`, picks it.
|
||||
@@ -64,9 +64,9 @@ Reviewers hold prose to the full rules, with examples: `prose.md` in the project
|
||||
|
||||
Claude Code loads a rule file when a session writes a file its `paths:` frontmatter matches, or reads one with the Read tool or `head -n`, never `sed`. After a write, it loads only once the write is done. Read a rule file before you create a file it covers.
|
||||
|
||||
- The decision log: `~/.claude/rules/decisions.md`.
|
||||
- Goals and audience: `~/.claude/rules/goals-and-audience.md`.
|
||||
- Plan items, their scores and Exempt reasons: `~/.claude/rules/todo-items.md`. Read it before you file, score, edit or move an item: a session that runs `todo-item` never opens `todo.md` itself, so the rule doesn't load.
|
||||
- The decision log: the setup's `rules/decisions.md`.
|
||||
- Goals and audience: the setup's `rules/goals-and-audience.md`.
|
||||
- Plan items, their scores and Exempt reasons: the setup's `rules/todo-items.md`. Read it before you file, score, edit or move an item: a session that runs `todo-item` never opens `todo.md` itself, so the rule doesn't load.
|
||||
|
||||
The rules only reviewers apply, for quality, comments, READMEs and prose, are the project's review standards: the folder its config sets as `standards`, which `project-config standards` prints.
|
||||
|
||||
@@ -89,7 +89,7 @@ The rules only reviewers apply, for quality, comments, READMEs and prose, are th
|
||||
4. A review rules the work below standard: systems-architect's BLOCK, a finding against the review standards' `quality.md`, or a vote `record-ruling` counts as worse, in the report that stands after any relaunch one rung up (`larv-review` §3 → "Rung up"). It doesn't fire where the fix changes only prose (`larv-review` §3 says what is prose): fix that on your own rung.
|
||||
|
||||
When one fires, hand the hard part, edits included, to a subagent on the rung build-release's prompt names, one above yours. Open the subagent's prompt with the marker build-release's prompt gives, then the trigger's evidence. Each later subagent on that task runs on that rung or higher, and each further escalation trigger moves the task one rung higher, up to the highest rung build-release's prompt names. Ask the human before going higher. Where build-release's prompt names no escalation, as on the ladder's top rung or off it, keep the task in your own thread.
|
||||
- Give a subagent only the access its job needs, and state the limits in its prompt. One that only reads, such as a prose review, gets no shell and no edits. A reviewer under `~/.claude/agents/` writes only its report, under `~/.local/state/build-release/larv-review/` (under `$XDG_STATE_HOME` instead of `~/.local/state`, where that holds an absolute path), and rule-hook refuses it every other Write, every Edit and every MultiEdit. One that probes a build tags the image as throwaway and removes it afterwards, writes only to a folder it makes under the chunk's review folder (`larv-review review-folder` prints it), and removes no image or file it did not create.
|
||||
- Give a subagent only the access its job needs, and state the limits in its prompt. One that only reads, such as a prose review, gets no shell and no edits. A reviewer under the setup's `agents/` writes only its report, under `~/.local/state/build-release/larv-review/` (under `$XDG_STATE_HOME` instead of `~/.local/state`, where that holds an absolute path), and rule-hook refuses it every other Write, every Edit and every MultiEdit. One that probes a build tags the image as throwaway and removes it afterwards, writes only to a folder it makes under the chunk's review folder (`larv-review review-folder` prints it), and removes no image or file it did not create.
|
||||
- Check `README.md` first for build, test, install, and codegen commands, and fix one that misbehaves in the same change. Refresh `README.md` whenever you change what it describes, keeping it true, not longer.
|
||||
- Where `rule-hook` does not check it, such as an image named in test code, a Kubernetes manifest or a `docker run` line, pin a container image to its full patch version and a GitHub Action to a semver tag.
|
||||
|
||||
@@ -138,7 +138,7 @@ Claude Code reads this section by its heading when it compacts a conversation. K
|
||||
- **goals file** — the file holding a project's `## Goals` and `## Audience`: the one its config names as `goals-and-audience`. Read it in the file `project-record open goals-and-audience` prints. It is `README.md`, unless a client's project keeps it in the config's folder, or in a Jira epic's description, whose `## Goals` and `## Audience` the loop only reads.
|
||||
- **interrupt** — `build-release` asking the human, on its terminal, for a decision that is theirs. They type a one-line answer there, or `/talk` to open the worker's session there with `claude --resume`. A release ready to cut opens that session at once. A routing call opens claude on that terminal too, in `~/code/claude-config`, the checkout where this setup is developed.
|
||||
- **judge** — the headless claude that reads a worker's transcript each cycle and decides whether to interrupt and whether the chunk is finished.
|
||||
- **judge's records** — the files the judge reads beside the premises: the project's `AGENTS.md` and `docs/decisions.md`, then the human's `~/.claude/CLAUDE.md` and the `.md` files in `~/.claude/rules/`, then those in the project's review standards.
|
||||
- **judge's records** — the files the judge reads beside the premises: the project's `AGENTS.md` and `docs/decisions.md`, then the setup's `CLAUDE.md` and the `.md` files in the setup's `rules/`, then those in the project's review standards.
|
||||
- **paired ruling** — the seats vote whether the project reads better, the same or worse at the branch's head than at the base, the commit `larv-review ruling-base` prints; `larv-review --help` says how the votes make the ruling.
|
||||
- **pass** — one kind of review a chunk may take, run in rounds by its reviewers until clean; `larv-review` §3 lists them.
|
||||
- **place** — the smallest addressable unit, such as a function or a section heading, that a seat names with its `path:line` when it judges how hard the project is to read there.
|
||||
@@ -148,10 +148,11 @@ Claude Code reads this section by its heading when it compacts a conversation. K
|
||||
- **project record** — one of five documents a project keeps beside its plan, each where its config names it: `decisions`, `score-anchors`, `comprehension-history`, `reading-cost` and `changelog`.
|
||||
- **release** — a semver version the human cuts, or in a client's project someone on its team.
|
||||
- **release review** — a release's last chunk: the architecture and principles passes over the whole project, before the release is ready to cut; `larv-review` §3 → "Release review".
|
||||
- **reviewer** — a reporter of findings: an agent under `~/.claude/agents/`, `/security-review` or a forge's auto-reviewer.
|
||||
- **reviewer** — a reporter of findings: an agent under the setup's `agents/`, `/security-review` or a forge's auto-reviewer.
|
||||
- **round cap** — the rounds one pass may take per chunk; `larv-review` §3 → "Round cap".
|
||||
- **scoring run** — each seat scores the project from 1 to 10, overall and on each dimension. `larv-review` §3 → "Comprehension check" says which seats score and when one is due.
|
||||
- **seat** — one simulated reader of the comprehension panel, launched per `~/.claude/skills/comprehension-panel/SKILL.md`.
|
||||
- **seat** — one simulated reader of the comprehension panel, launched per the setup's `skills/comprehension-panel/SKILL.md`.
|
||||
- **session** — a Claude Code session: one id, what `claude --resume` continues.
|
||||
- **setup** — what this configuration ships: `CLAUDE.md`, `rules/`, `agents/`, `skills/`, `principles/` and `bin/`. Open a file of the setup in the loop's Claude home, `~/.local/share/build-release/claude-home/` (under `$XDG_DATA_HOME` instead of `~/.local/share`, where that holds an absolute path): it links to the clone whose `build-release` or `build-epic` started last.
|
||||
- **trigger** — the condition under which a review pass runs on a change it has not seen; `larv-review` §3 lists them.
|
||||
- **worker** — the headless claude that runs the task in a cycle, in the chunk's session.
|
||||
|
||||
@@ -61,9 +61,9 @@ Have the latest stable Python, today 3.14, as `python3` on `PATH`, and tmux 3.2
|
||||
|
||||
Run `build-release` by its path, `~/build-release/bin/build-release`: no step installs it. Every claude it starts, the interactive ones included, skips every permission prompt.
|
||||
|
||||
build-release and build-epic run every claude in the loop's Claude home, `~/.local/share/build-release/claude-home`, which each of the two builds when it starts. Neither reads or writes your own `~/.claude`, and nothing in it loads in the loop's home. `task-bench gather` alone still starts its claude in your own home. The loop's home holds:
|
||||
build-release and build-epic run every claude in the loop's Claude home, `~/.local/share/build-release/claude-home`, which each of the two builds when it starts. Neither reads or writes your own `~/.claude`, and nothing in it loads in the loop's home. `task-bench gather` builds the home too, and runs its claude there. The loop's home holds:
|
||||
|
||||
- links to the clone's `CLAUDE.md`, `rules/`, `agents/` and `skills/`;
|
||||
- links to the clone's `CLAUDE.md`, `rules/`, `agents/`, `skills/`, `principles/` and `bin/`, so a claude opens every file of the setup there, and the rules name each as the setup's, as in the setup's `rules/todo-items.md`;
|
||||
- a `settings.json` generated from the clone's, whose hooks run the clone's tools;
|
||||
- every plugin the clone's `settings.json` enables, which build-release or build-epic installs;
|
||||
- what Claude Code keeps in its home: your sign-in there, the sessions and the memory files.
|
||||
@@ -93,7 +93,7 @@ To get build-release's questions and stops as DMs from a bot, write the bot's to
|
||||
|
||||
Each project the loop runs in has a folder, `~/.config/build-release/<key>/`, where `<key>` is the project's name, and a config in it, `config.toml`. The folder is a git repo of its own, so the config has a history and a client's files never enter this repo. The loop commits each change it makes to a file there, such as the plan, in that repo, titled as its commits in the checkout. A project is a whole git checkout, never a subfolder of one.
|
||||
|
||||
The config names the project's main checkout and the path of every file the loop keeps for it. No path setting has a default: `project-config` fails and names each setting a config leaves out. A path is `checkout:<path>` inside the checkout, `folder:<path>` inside the config's folder, or one that starts with `/` or `~/`. Every tool reads and writes each file at the path its setting gives, and `chunk-preflight` and `todo-item` print those paths for the agents. Five of the settings name the project's records: `decisions`, `score-anchors`, `comprehension-history`, `reading-cost` and `changelog`. Keep each file's name, such as `todo.md`: the rules for a file load by its name. A project of your own keeps every file but the principles and the review standards in its checkout:
|
||||
The config names the project's main checkout and the path of every file the loop keeps for it. No path setting has a default: `project-config` fails and names each setting a config leaves out. A path is `checkout:<path>` inside the checkout, `folder:<path>` inside the config's folder, `setup:<path>` inside the clone whose tool reads the config, or one that starts with `/` or `~/`. Every tool reads and writes each file at the path its setting gives, and `chunk-preflight` and `todo-item` print those paths for the agents. Five of the settings name the project's records: `decisions`, `score-anchors`, `comprehension-history`, `reading-cost` and `changelog`. Keep each file's name, such as `todo.md`: the rules for a file load by its name. A project of your own keeps every file but the principles and the review standards in its checkout:
|
||||
|
||||
```toml
|
||||
checkout = "~/code/log"
|
||||
@@ -105,11 +105,11 @@ comprehension-history = "checkout:docs/comprehension-history.md"
|
||||
reading-cost = "checkout:docs/reading-cost.md"
|
||||
changelog = "checkout:CHANGELOG.md"
|
||||
goals-and-audience = "checkout:README.md"
|
||||
principles = "~/build-release/principles"
|
||||
standards = "~/build-release/skills/larv-review/standards"
|
||||
principles = "setup:principles"
|
||||
standards = "setup:skills/larv-review/standards"
|
||||
```
|
||||
|
||||
`principles` and `standards` name the folders the reviewers hold the project to: the technical principles and the review standards. Both ship with this setup, at the paths above. A folder of your own replaces the shipped one. A standards folder must hold `quality.md`, `prose.md`, `comments.md` and `readme.md`, since the reviewers and the rules name those files.
|
||||
`principles` and `standards` name the folders the reviewers hold the project to: the technical principles and the review standards. Both ship with this setup, at the paths above, which hold wherever its clone lies. A folder of your own replaces the shipped one. A standards folder must hold `quality.md`, `prose.md`, `comments.md` and `readme.md`, since the reviewers and the rules name those files.
|
||||
|
||||
A project may also set `env-file`, the file of `KEY=value` credentials its tools read, such as `env-file = "~/.config/build-release/log.env"`. It is a path that starts with `/` or `~/`, outside the checkout and the config's folder, so that no git remote receives it. A tool that needs a key fails and names each one the file lacks. No failure message, prompt, log line or archived loop output holds a token from the file. rule-hook refuses a Read or a Grep of the file and a Bash command that names it or searches a folder holding it with `ag`, `grep -r` or `rg`, unless the tool skips the file as hidden or ignored, so a worker doesn't read it in passing; `rule-hook --help` says which calls it checks. A project without the setting has no credentials, and never reads another project's. `project-config env-file` prints the path.
|
||||
|
||||
@@ -194,7 +194,7 @@ It prints `CHANGELOG.md`'s section for each version it moved past: do what each
|
||||
|
||||
It refuses while a file the clone tracks has an uncommitted change. Claude Code keeps its own files in the loop's home, not in the clone. The home's four links lead into the clone, though, so a rule, an agent or a skill changed at user level in that home changes the clone's file. Carry such a change into `~/code/claude-config` on a branch of its own, merge it through a PR, and cut a release.
|
||||
|
||||
A release up to 0.17.0 was a checkout in `~/.claude`, and `self-update` doesn't move one out of there. Finish each open chunk first: its session stays in `~/.claude`, where the new release doesn't look for it. Then clone the newest release as Install says, and sign in to the loop's home. In each project's config, write the new clone in place of `~/.claude` in `principles` and `standards`, and likewise in the crontab line. build-release and build-epic don't read `~/.claude` after that, so the checkout there is yours to keep or remove. Keep it on 0.17.0 if you keep it: a later `settings.json` names its hooks by a placeholder that only the loop's home fills in, so in `~/.claude` the hooks would not run.
|
||||
A release up to 0.17.0 was a checkout in `~/.claude`, and `self-update` doesn't move one out of there. Finish each open chunk first: its session stays in `~/.claude`, where the new release doesn't look for it. Then clone the newest release as Install says, and sign in to the loop's home. In each project's config, write `setup:` in place of `~/.claude/` in `principles` and `standards`, as in `setup:principles`, and write the new clone in place of `~/.claude` in the crontab line. build-release and build-epic don't read `~/.claude` after that, so the checkout there is yours to keep or remove. Keep it on 0.17.0 if you keep it: a later `settings.json` names its hooks by a placeholder that only the loop's home fills in, so in `~/.claude` the hooks would not run.
|
||||
|
||||
## Release
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ description: "Use this agent for larv-review's overrides pass."
|
||||
tools: Read, Grep, Glob, Write
|
||||
---
|
||||
|
||||
You rule on each override of a rule `rule-hook` enforces. The prompt gives you the lines `rule-hook overrides` printed, each with its rule and reason, and the branch diff. Read each rule and its stated exceptions in `~/.claude/bin/rule_hook/rules.py` → `RULES`, how an override is written and logged in the docstring of `~/.claude/bin/rule_hook/main.py`, and the project's goals and audience, `## Goals` and `## Audience` in the file your prompt's `Goals and audience:` line names, with code health (`~/.claude/CLAUDE.md` → "Shared goal") among the goals unless that file voids it.
|
||||
You rule on each override of a rule `rule-hook` enforces. The prompt gives you the lines `rule-hook overrides` printed, each with its rule and reason, and the branch diff. Read each rule and its stated exceptions in the setup's `bin/rule_hook/rules.py` → `RULES`, how an override is written and logged in the docstring of the setup's `bin/rule_hook/main.py`, and the project's goals and audience, `## Goals` and `## Audience` in the file your prompt's `Goals and audience:` line names, with code health (the setup's `CLAUDE.md` → "Shared goal") among the goals unless that file voids it.
|
||||
|
||||
For each override:
|
||||
|
||||
@@ -13,4 +13,4 @@ For each override:
|
||||
- **Reject** it as a 🔴 when the reason does not. Name how the chunk keeps the rule, such as rewording the commit or pinning the image, or say that it cannot.
|
||||
- **Ask** it as a ❓ for the human when it is outrageous: it touches a credential, a security rule or a production system, or it cannot be undone.
|
||||
|
||||
Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. Quote an override by its rule and reason only; a command's text can hold a credential.
|
||||
Verdict, severities and rounds: the setup's `skills/larv-review/review-findings.md`. Quote an override by its rule and reason only; a command's text can hold a credential.
|
||||
|
||||
@@ -5,9 +5,9 @@ tools: Read, Grep, Glob, Write
|
||||
omitClaudeMd: true
|
||||
---
|
||||
|
||||
You check every yardstick you are handed against the whole project, which you read once for all of them. A yardstick is either the project's goals, every goal under `## Goals` in the file your prompt's `Goals and audience:` line names, with code health (`~/.claude/CLAUDE.md` → "Shared goal") unless that file voids it, or one principles file, every principle in it.
|
||||
You check every yardstick you are handed against the whole project, which you read once for all of them. A yardstick is either the project's goals, every goal under `## Goals` in the file your prompt's `Goals and audience:` line names, with code health (the setup's `CLAUDE.md` → "Shared goal") unless that file voids it, or one principles file, every principle in it.
|
||||
|
||||
Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. Read the yardsticks, `README.md`, `docs/decisions.md` and the plan first, then all of the project's code, config, tests and CI. Your prompt's `Plan:` line names the plan.
|
||||
Verdict, severities and rounds: the setup's `skills/larv-review/review-findings.md`. Read the yardsticks, `README.md`, `docs/decisions.md` and the plan first, then all of the project's code, config, tests and CI. Your prompt's `Plan:` line names the plan.
|
||||
|
||||
- Per principle or goal: every place the project departs from it, with file:line, the defect in one sentence and its concrete consequence. Then one line: followed, mostly, not followed, or does not apply and why.
|
||||
- A departure a plan item plans away is named with that item, not raised.
|
||||
|
||||
@@ -53,9 +53,9 @@ Before anything else, **read the technical principles** in the folder your promp
|
||||
|
||||
## Your Output Format
|
||||
|
||||
Report only a defect a persona hits; a requirement that the change breaks, of the plan in the file your prompt's `Plan:` line names, of the goals in the file your prompt's `Goals and audience:` line names, or of code health (`~/.claude/CLAUDE.md` → "Shared goal", unless that file voids it); or a breach of a technical principle, or of a coding convention, which counts as one. Friction that is none of these is not a finding.
|
||||
Report only a defect a persona hits; a requirement that the change breaks, of the plan in the file your prompt's `Plan:` line names, of the goals in the file your prompt's `Goals and audience:` line names, or of code health (the setup's `CLAUDE.md` → "Shared goal", unless that file voids it); or a breach of a technical principle, or of a coding convention, which counts as one. Friction that is none of these is not a finding.
|
||||
|
||||
Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. After the verdict:
|
||||
Verdict, severities and rounds: the setup's `skills/larv-review/review-findings.md`. After the verdict:
|
||||
|
||||
**Surface affected**: <one line>
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ You read the prose as someone who did not write it: you see only what it says, n
|
||||
The bar, read each time, since it changes:
|
||||
|
||||
- every file in the folder your prompt's `Review standards:` line names, of `quality.md` only "A false claim is a bug";
|
||||
- `~/.claude/CLAUDE.md` → "Public API specs";
|
||||
- each file under `~/.claude/rules/` whose `paths:` frontmatter matches a file the diff changes.
|
||||
- the setup's `CLAUDE.md` → "Public API specs";
|
||||
- each file under the setup's `rules/` whose `paths:` frontmatter matches a file the diff changes.
|
||||
|
||||
Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md.
|
||||
Verdict, severities and rounds: the setup's `skills/larv-review/review-findings.md`.
|
||||
|
||||
Your prompt's `Prose language:` line names the language the project's config sets. Apply every check below to prose in that language, by that language's grammar and idiom. The bar's examples are English: find the same fault in the other language, never the same English words. Prose in another language is a finding, except what `prose.md` in the review standards says stays English. Write your report in English.
|
||||
|
||||
|
||||
@@ -144,15 +144,15 @@ Every PR gets at least this sweep.
|
||||
|
||||
## Output Format
|
||||
|
||||
Report only a defect; a requirement that the change breaks, of the plan in the file your prompt's `Plan:` line names, of the goals in the file your prompt's `Goals and audience:` line names, or of code health (`~/.claude/CLAUDE.md` → "Shared goal", unless that file voids it); a breach of a technical principle, or of a coding convention, which counts as one; and the places the prompt hands you. A finding that is none of these is noise, however true: leave it out.
|
||||
Report only a defect; a requirement that the change breaks, of the plan in the file your prompt's `Plan:` line names, of the goals in the file your prompt's `Goals and audience:` line names, or of code health (the setup's `CLAUDE.md` → "Shared goal", unless that file voids it); a breach of a technical principle, or of a coding convention, which counts as one; and the places the prompt hands you. A finding that is none of these is noise, however true: leave it out.
|
||||
|
||||
Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. After the verdict, a short **Coverage & Verification** block: what you ran (tests, static analysis, mutation — and their results), what each caller of a changed producer does with the new case (#1), what you could not verify and why, and any files that got a lighter pass — never let silence imply coverage. Then the findings, most severe first, each with:
|
||||
Verdict, severities and rounds: the setup's `skills/larv-review/review-findings.md`. After the verdict, a short **Coverage & Verification** block: what you ran (tests, static analysis, mutation — and their results), what each caller of a changed producer does with the new case (#1), what you could not verify and why, and any files that got a lighter pass — never let silence imply coverage. Then the findings, most severe first, each with:
|
||||
- **Location**: File and line/function
|
||||
- **Issue**: Clear description of the problem
|
||||
- **Risk**: What could go wrong in production
|
||||
- **Fix**: The smallest change that closes the issue — prefer delete > simplify > modify > add; code examples when helpful
|
||||
|
||||
Raise a 🔀 where the diff fires another pass's trigger in the pass table, `~/.claude/skills/larv-review/SKILL.md` §3.
|
||||
Raise a 🔀 where the diff fires another pass's trigger in the pass table, the setup's `skills/larv-review/SKILL.md` §3.
|
||||
|
||||
## Behavioral Guidelines
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ How a change ships — merge gate, pipeline, deployment, dependencies — is a d
|
||||
|
||||
You are not a per-PR reviewer. The **stability-reviewer** runs on every change for code-level safety; you run deliberately, every so often, to check the system is still aligned — right goals, right contract, right foundations, sound structure. When you do look at a specific PR, it is because the work touches architectural fundamentals or reopens foundational choices, not for routine line-level review.
|
||||
|
||||
**Verdict and severities: ~/.claude/skills/larv-review/review-findings.md.** A violation of a non-negotiable fundamental — functional-core/shell entanglement, a unit failing the fractal test of Fits in a head, a method or file carrying more than one responsibility, unreasoned duplication of a core concept, or a broken/leaky external contract — is a 🔴: lead with it, and name the concrete restructuring. The most common instance: a pure transformation (a deterministic input→output computation) entangled inside an imperative-shell or orchestration method, where it could be a named, separately-testable function. The architectural defect being real, not its line count or "how much it works today," sets the severity; rate a non-fundamental finding by its eventual cost — the recorded horizon sets that cost; fundamentals stay 🔴 at every horizon (Core Philosophy: rigor follows the horizon).
|
||||
**Verdict and severities: the setup's `skills/larv-review/review-findings.md`.** A violation of a non-negotiable fundamental — functional-core/shell entanglement, a unit failing the fractal test of Fits in a head, a method or file carrying more than one responsibility, unreasoned duplication of a core concept, or a broken/leaky external contract — is a 🔴: lead with it, and name the concrete restructuring. The most common instance: a pure transformation (a deterministic input→output computation) entangled inside an imperative-shell or orchestration method, where it could be a named, separately-testable function. The architectural defect being real, not its line count or "how much it works today," sets the severity; rate a non-fundamental finding by its eventual cost — the recorded horizon sets that cost; fundamentals stay 🔴 at every horizon (Core Philosophy: rigor follows the horizon).
|
||||
|
||||
Every finding, except a place the prompt hands you, names a concrete later change this PR makes harder, such as "a second forge needs edits in four modules"; a concern that names none is too vague to check, so leave it out.
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ FINISHED_RULES = (
|
||||
"finished=true when the chunk is complete: merged, or nothing remains that the worker could do on "
|
||||
"its own. Even then, it is finished only once {answers_recorded}.\n\n"
|
||||
"An answer counts as recorded where the premises or the records above already hold it, the human's rules "
|
||||
"(~/.claude/CLAUDE.md, ~/.claude/rules/, the project's review standards, each headed by its path) included. "
|
||||
"(the setup's CLAUDE.md, the setup's rules/, the project's review standards, each headed by its path) included. "
|
||||
"It also counts where the transcript shows the worker writing it into {answer_destinations}, "
|
||||
"but not into one of the human's rules.\n\n"
|
||||
"finished=false when work remains that a further run can "
|
||||
|
||||
@@ -274,7 +274,7 @@ class ACycleOfAChunkWithoutARepo(BuildEpicTest):
|
||||
self.description = DESCRIPTION + "\n## Scoring\nE + I, bar 4.\n\n## Decisions\n### Merges squash\nAlways.\n"
|
||||
(self.home / ".local" / "share" / "build-release" / "claude-home").mkdir(parents=True)
|
||||
(self.home / ".local" / "share" / "build-release" / "claude-home" / "CLAUDE.md").write_text("# Global\n", encoding="utf-8")
|
||||
self.assertEqual(self.cycle().records, "From the epic ABC-12's description, ## Scoring:\nE + I, bar 4.\n\nFrom the epic ABC-12's description, ## Decisions:\n### Merges squash\nAlways.\n\nFrom ~/.claude/CLAUDE.md:\n# Global")
|
||||
self.assertEqual(self.cycle().records, "From the epic ABC-12's description, ## Scoring:\nE + I, bar 4.\n\nFrom the epic ABC-12's description, ## Decisions:\n### Merges squash\nAlways.\n\nFrom the setup's CLAUDE.md:\n# Global")
|
||||
|
||||
def test_stops_where_a_section_of_the_epics_records_cannot_be_read(self) -> None:
|
||||
self.description = DESCRIPTION + "\n## Scoring\nA.\n\n## Scoring\nB.\n"
|
||||
|
||||
@@ -181,7 +181,7 @@ Exit 1, saying why, when:
|
||||
- a chunk's window cannot be started, as when the project's config cannot be read, or the tmux
|
||||
session runs another checkout's chunks
|
||||
- the tmux session cannot be put on the terminal
|
||||
- the goals file, or AGENTS.md, docs/decisions.md, ~/.claude/CLAUDE.md, ~/.claude/rules/*.md or
|
||||
- the goals file, or AGENTS.md, docs/decisions.md, the setup's CLAUDE.md, the setup's rules/*.md or
|
||||
the project's review standards where they exist, cannot be read or is not UTF-8
|
||||
- no config names the checkout, its config cannot be read, or the goals file holds no premises
|
||||
- the models file cannot be read or written
|
||||
|
||||
@@ -472,7 +472,7 @@ class Cycles(unittest.TestCase):
|
||||
self.assertIn("as the work remaining:\n\n> started\n\n", argument(workers[1], "-p"))
|
||||
self.assertEqual({call["cwd"] for call in run.calls}, {str(checkout.root)})
|
||||
self.assertIn("1. Work.", run.calls[1]["stdin"])
|
||||
self.assertIn("From docs/decisions.md:\n# Decisions\n\nFrom ~/.claude/CLAUDE.md:\n# Global instructions", run.calls[1]["stdin"])
|
||||
self.assertIn("From docs/decisions.md:\n# Decisions\n\nFrom the setup's CLAUDE.md:\n# Global instructions", run.calls[1]["stdin"])
|
||||
self.assertEqual({argument(call, "--model") for call in workers}, {"worker-model"})
|
||||
self.assertEqual({argument(call, "--model") for call in run.calls if call["role"] == "judge"}, {"judge-model"})
|
||||
self.assertIn("landed-it", run.calls[3]["stdin"])
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from collections.abc import Mapping
|
||||
import pathlib
|
||||
|
||||
from loop_state.paths import CLAUDE_HOME
|
||||
from failure import Failure
|
||||
from project_config.main import located
|
||||
from chunk_driver.project.text_file import read_utf8
|
||||
from loop_state.paths import RELEASE_ROOT
|
||||
from record_store.stores import store
|
||||
|
||||
# The records the judge reads beside the premises, by the name that heads each, with the setting in the project's config that places it; then the human's rules below.
|
||||
@@ -17,7 +17,9 @@ HUMAN_RULES_FILE = "CLAUDE.md"
|
||||
HUMAN_RULE_DIR = "rules"
|
||||
# How the judge's prompt names the records above, in the order it reads them.
|
||||
RECORDS_NAMED = "the project's working rules and decisions, then the human's rules for every project"
|
||||
HUMAN_RULE_NAMES = (f"~/{CLAUDE_HOME}/{HUMAN_RULES_FILE}", f"~/{CLAUDE_HOME}/{HUMAN_RULE_DIR}/", "the project's review standards")
|
||||
# How prose names a file of the setup wherever its clone lies: the setup's CLAUDE.md → "Vocabulary", "setup".
|
||||
SETUPS = "the setup's"
|
||||
HUMAN_RULE_NAMES = (f"{SETUPS} {HUMAN_RULES_FILE}", f"{SETUPS} {HUMAN_RULE_DIR}/", "the project's review standards")
|
||||
|
||||
|
||||
CONSEQUENCE = "the judge cannot read the records"
|
||||
@@ -55,7 +57,8 @@ def file_text(path: pathlib.Path) -> str | Failure:
|
||||
|
||||
|
||||
def named(rule: pathlib.Path, home: pathlib.Path, claude_dir: pathlib.Path) -> str:
|
||||
"""rule's path as the human writes it: under ~/.claude, or ~/ for the rest of home, or else in full."""
|
||||
if rule.is_relative_to(claude_dir):
|
||||
return f"~/{CLAUDE_HOME}/{rule.relative_to(claude_dir)}"
|
||||
"""rule's path as the human writes it: as the setup's where it lies in claude_dir, the loop's Claude home, or in the clone, or ~/ for the rest of home, or else in full."""
|
||||
for setup in (claude_dir, RELEASE_ROOT):
|
||||
if rule.is_relative_to(setup):
|
||||
return f"{SETUPS} {rule.relative_to(setup)}"
|
||||
return f"~/{rule.relative_to(home)}" if rule.is_relative_to(home) else str(rule)
|
||||
|
||||
@@ -9,53 +9,61 @@ from project_config.doubles import configured
|
||||
from failure import Failure
|
||||
from agent_cycle import judge
|
||||
from chunk_driver.project import records
|
||||
from loop_state.paths import RELEASE_ROOT
|
||||
|
||||
|
||||
class Records(unittest.TestCase):
|
||||
def test_heads_each_record_by_its_name_the_humans_rules_last(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
claude_md = pathlib.Path(root, "home", ".claude", "CLAUDE.md")
|
||||
claude_md = pathlib.Path(root, "home", "setup", "CLAUDE.md")
|
||||
config = configured(self, pathlib.Path(root), home=claude_md.parents[1]) / "config.toml"
|
||||
self.assertEqual(records.read_records(root, claude_md.parents[1], {}, claude_md.parent), "")
|
||||
claude_md.parent.mkdir(parents=True)
|
||||
claude_md.write_text("# Global\n")
|
||||
self.assertEqual(records.read_records(root, claude_md.parents[1], {}, claude_md.parent), "From ~/.claude/CLAUDE.md:\n# Global")
|
||||
self.assertEqual(records.read_records(root, claude_md.parents[1], {}, claude_md.parent), "From the setup's CLAUDE.md:\n# Global")
|
||||
pathlib.Path(root, "docs").mkdir()
|
||||
pathlib.Path(root, "docs", "decisions.md").write_text("# Decisions\n")
|
||||
pathlib.Path(root, "AGENTS.md").write_text("\n# Rules\n")
|
||||
self.assertEqual(records.read_records(root, claude_md.parents[1], {}, claude_md.parent), "From AGENTS.md:\n# Rules\n\nFrom docs/decisions.md:\n# Decisions\n\nFrom ~/.claude/CLAUDE.md:\n# Global")
|
||||
self.assertEqual(records.read_records(root, claude_md.parents[1], {}, claude_md.parent), "From AGENTS.md:\n# Rules\n\nFrom docs/decisions.md:\n# Decisions\n\nFrom the setup's CLAUDE.md:\n# Global")
|
||||
pathlib.Path(claude_md.parent, "rules").mkdir()
|
||||
pathlib.Path(claude_md.parent, "rules", "todo-items.md").write_text("# Todo\n")
|
||||
pathlib.Path(claude_md.parent, "rules", "goals-and-audience.md").write_text("# Goals\n")
|
||||
pathlib.Path(claude_md.parent, "rules", "notes.txt").write_text("not a rule\n")
|
||||
pathlib.Path(claude_md.parent, "skills", "larv-review", "standards").mkdir(parents=True)
|
||||
pathlib.Path(claude_md.parent, "skills", "larv-review", "standards", "comments.md").write_text("# Comments\n")
|
||||
self.assertTrue(records.read_records(root, claude_md.parents[1], {}, claude_md.parent).endswith("From ~/.claude/CLAUDE.md:\n# Global\n\nFrom ~/.claude/rules/goals-and-audience.md:\n# Goals\n\nFrom ~/.claude/rules/todo-items.md:\n# Todo\n\nFrom ~/.claude/skills/larv-review/standards/comments.md:\n# Comments"))
|
||||
config.write_text(config.read_text().replace('"~/.claude/skills/larv-review/standards"', '"~/review-standards"'))
|
||||
self.assertTrue(records.read_records(root, claude_md.parents[1], {}, claude_md.parent).endswith("From the setup's CLAUDE.md:\n# Global\n\nFrom the setup's rules/goals-and-audience.md:\n# Goals\n\nFrom the setup's rules/todo-items.md:\n# Todo\n\nFrom the setup's skills/larv-review/standards/comments.md:\n# Comments"))
|
||||
config.write_text(config.read_text().replace('"~/setup/skills/larv-review/standards"', '"~/review-standards"'))
|
||||
pathlib.Path(claude_md.parents[1], "review-standards").mkdir()
|
||||
pathlib.Path(claude_md.parents[1], "review-standards", "quality.md").write_text("# Ours\n")
|
||||
self.assertTrue(records.read_records(root, claude_md.parents[1], {}, claude_md.parent).endswith("From ~/.claude/rules/todo-items.md:\n# Todo\n\nFrom ~/review-standards/quality.md:\n# Ours"), "the config's standards folder replaces the default")
|
||||
self.assertTrue(records.read_records(root, claude_md.parents[1], {}, claude_md.parent).endswith("From the setup's rules/todo-items.md:\n# Todo\n\nFrom ~/review-standards/quality.md:\n# Ours"), "the config's standards folder replaces the default")
|
||||
config.write_text(config.read_text().replace('"~/review-standards"', f'"{root}/standards"'))
|
||||
pathlib.Path(root, "standards").mkdir()
|
||||
pathlib.Path(root, "standards", "quality.md").write_text("# Elsewhere\n")
|
||||
self.assertTrue(records.read_records(root, claude_md.parents[1], {}, claude_md.parent).endswith(f"From {root}/standards/quality.md:\n# Elsewhere"), "a folder outside home is named in full")
|
||||
|
||||
config.write_text(config.read_text().replace('"checkout:AGENTS.md"', '"checkout:docs/decisions.md"'))
|
||||
self.assertTrue(records.read_records(root, claude_md.parents[1], {}, claude_md.parent).startswith("From AGENTS.md and docs/decisions.md:\n# Decisions\n\nFrom ~/.claude/CLAUDE.md:\n# Global"), "a file the config names for two records appears once")
|
||||
self.assertTrue(records.read_records(root, claude_md.parents[1], {}, claude_md.parent).startswith("From AGENTS.md and docs/decisions.md:\n# Decisions\n\nFrom the setup's CLAUDE.md:\n# Global"), "a file the config names for two records appears once")
|
||||
config.write_text(config.read_text().replace('"checkout:docs/decisions.md"', '"checkout:AGENTS.md"', 1))
|
||||
|
||||
config.write_text(config.read_text().replace('"checkout:AGENTS.md"', '"folder:AGENTS.md"').replace('"checkout:docs/decisions.md"', '"folder:log/decisions.md"'))
|
||||
self.assertTrue(records.read_records(root, claude_md.parents[1], {}, claude_md.parent).startswith("From ~/.claude/CLAUDE.md:\n# Global"), "the checkout's AGENTS.md and docs/decisions.md are its owners'")
|
||||
self.assertTrue(records.read_records(root, claude_md.parents[1], {}, claude_md.parent).startswith("From the setup's CLAUDE.md:\n# Global"), "the checkout's AGENTS.md and docs/decisions.md are its owners'")
|
||||
pathlib.Path(config.parent, "log").mkdir()
|
||||
pathlib.Path(config.parent, "log", "decisions.md").write_text("# Ours\n")
|
||||
pathlib.Path(config.parent, "AGENTS.md").write_text("# Our rules\n")
|
||||
self.assertTrue(records.read_records(root, claude_md.parents[1], {}, claude_md.parent).startswith("From AGENTS.md:\n# Our rules\n\nFrom docs/decisions.md:\n# Ours\n\nFrom ~/.claude/CLAUDE.md:\n# Global"))
|
||||
self.assertTrue(records.read_records(root, claude_md.parents[1], {}, claude_md.parent).startswith("From AGENTS.md:\n# Our rules\n\nFrom docs/decisions.md:\n# Ours\n\nFrom the setup's CLAUDE.md:\n# Global"))
|
||||
config.unlink()
|
||||
self.assertEqual(records.read_records(root, claude_md.parents[1], {}, claude_md.parent), Failure(f"no config names the checkout {root}: write {claude_md.parents[1]}/.config/build-release/<key>/config.toml, as `project-config --help` shows - the judge cannot read the records."))
|
||||
|
||||
def test_names_a_file_of_the_setup_alike_in_the_loops_home_and_in_the_clone(self):
|
||||
home = pathlib.Path("/home/kim")
|
||||
for rule in (home / "share" / "claude-home" / "rules" / "todo-items.md", RELEASE_ROOT / "rules" / "todo-items.md"):
|
||||
self.assertEqual(records.named(rule, home, home / "share" / "claude-home"), "the setup's rules/todo-items.md")
|
||||
self.assertEqual(records.named(home / "standards" / "prose.md", home, home / "share" / "claude-home"), "~/standards/prose.md")
|
||||
self.assertEqual(records.named(pathlib.Path("/srv/standards/prose.md"), home, home / "share" / "claude-home"), "/srv/standards/prose.md")
|
||||
|
||||
def test_puts_the_records_handed_in_first_and_reads_only_the_humans_rules_without_a_checkout(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
claude_md = pathlib.Path(root, "home", ".claude", "CLAUDE.md")
|
||||
claude_md = pathlib.Path(root, "home", "setup", "CLAUDE.md")
|
||||
configured(self, pathlib.Path(root), home=claude_md.parents[1])
|
||||
claude_md.parent.mkdir(parents=True)
|
||||
claude_md.write_text("# Global\n")
|
||||
@@ -65,12 +73,12 @@ class Records(unittest.TestCase):
|
||||
pathlib.Path(claude_md.parent, "skills", "larv-review", "standards", "comments.md").write_text("# Comments\n")
|
||||
pathlib.Path(root, "AGENTS.md").write_text("# Rules\n")
|
||||
first = (("the epic ABC-1's description, ## Decisions", "Squash.\n"), ("the epic ABC-1's description, ## Scoring", " \n"))
|
||||
self.assertEqual(records.read_records(root, claude_md.parents[1], {}, claude_md.parent, first), "From the epic ABC-1's description, ## Decisions:\nSquash.\n\nFrom AGENTS.md:\n# Rules\n\nFrom ~/.claude/CLAUDE.md:\n# Global\n\nFrom ~/.claude/rules/todo-items.md:\n# Todo\n\nFrom ~/.claude/skills/larv-review/standards/comments.md:\n# Comments")
|
||||
self.assertEqual(records.read_records(None, claude_md.parents[1], {}, claude_md.parent, first), "From the epic ABC-1's description, ## Decisions:\nSquash.\n\nFrom ~/.claude/CLAUDE.md:\n# Global\n\nFrom ~/.claude/rules/todo-items.md:\n# Todo")
|
||||
self.assertEqual(records.read_records(root, claude_md.parents[1], {}, claude_md.parent, first), "From the epic ABC-1's description, ## Decisions:\nSquash.\n\nFrom AGENTS.md:\n# Rules\n\nFrom the setup's CLAUDE.md:\n# Global\n\nFrom the setup's rules/todo-items.md:\n# Todo\n\nFrom the setup's skills/larv-review/standards/comments.md:\n# Comments")
|
||||
self.assertEqual(records.read_records(None, claude_md.parents[1], {}, claude_md.parent, first), "From the epic ABC-1's description, ## Decisions:\nSquash.\n\nFrom the setup's CLAUDE.md:\n# Global\n\nFrom the setup's rules/todo-items.md:\n# Todo")
|
||||
|
||||
def test_stops_on_a_record_it_cannot_read(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
claude_md = pathlib.Path(root, "home", ".claude", "CLAUDE.md")
|
||||
claude_md = pathlib.Path(root, "home", "setup", "CLAUDE.md")
|
||||
configured(self, pathlib.Path(root), home=claude_md.parents[1])
|
||||
claude_md.mkdir(parents=True)
|
||||
self.assertEqual(records.read_records(root, claude_md.parents[1], {}, claude_md.parent), Failure(f"CLAUDE.md in {claude_md.parent}: Is a directory - the judge cannot read the records."))
|
||||
@@ -82,7 +90,7 @@ class Records(unittest.TestCase):
|
||||
|
||||
def test_stops_on_a_rule_it_cannot_read(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
claude_md = pathlib.Path(root, "home", ".claude", "CLAUDE.md")
|
||||
claude_md = pathlib.Path(root, "home", "setup", "CLAUDE.md")
|
||||
configured(self, pathlib.Path(root), home=claude_md.parents[1])
|
||||
rules = pathlib.Path(claude_md.parent, "rules")
|
||||
rules.mkdir(parents=True)
|
||||
|
||||
@@ -13,8 +13,8 @@ import typing
|
||||
from failure import Failure
|
||||
from text_files.file_writes import replace_file
|
||||
|
||||
# What the home links to in the clone: the instruction files Claude Code reads from its home.
|
||||
LINKED = ("CLAUDE.md", "agents", "rules", "skills")
|
||||
# What the home links to in the clone: the instruction files Claude Code reads from its home, and the two folders those files name beside them. So a claude opens every file of the setup in its own home: the setup's CLAUDE.md → "Vocabulary", "setup".
|
||||
LINKED = ("CLAUDE.md", "agents", "bin", "principles", "rules", "skills")
|
||||
# Stands for the clone's folder in the clone's settings.json. Every value that holds it is a shell command, such as a hook's.
|
||||
CLONE = "{clone}"
|
||||
# The file in the home that names the clone and the commit the home was built from.
|
||||
|
||||
@@ -25,7 +25,7 @@ class Home(unittest.TestCase):
|
||||
self.temp = pathlib.Path(tempfile.mkdtemp())
|
||||
self.addCleanup(subprocess.run, ["rm", "-rf", str(self.temp)])
|
||||
self.clone = self.temp / "the clone"
|
||||
for folder in ("agents", "rules", "skills"):
|
||||
for folder in ("agents", "bin", "principles", "rules", "skills"):
|
||||
(self.clone / folder).mkdir(parents=True)
|
||||
(self.clone / "CLAUDE.md").write_text("# The setup's rules\n", encoding="utf-8")
|
||||
(self.clone / "settings.json").write_text(json.dumps(SETTINGS), encoding="utf-8")
|
||||
@@ -49,10 +49,10 @@ class Home(unittest.TestCase):
|
||||
read: dict[str, object] = json.loads((self.home / "settings.json").read_text(encoding="utf-8"))
|
||||
return read
|
||||
|
||||
def test_a_new_home_links_the_clones_instruction_files(self) -> None:
|
||||
def test_a_new_home_links_each_folder_of_the_setup_that_an_instruction_file_names(self) -> None:
|
||||
self.assertIsNone(self.unready())
|
||||
|
||||
for name in ("CLAUDE.md", "agents", "rules", "skills"):
|
||||
for name in ("CLAUDE.md", "agents", "bin", "principles", "rules", "skills"):
|
||||
self.assertTrue((self.home / name).is_symlink(), name)
|
||||
self.assertEqual((self.home / name).resolve(), (self.clone / name).resolve())
|
||||
self.assertEqual((self.home / "CLAUDE.md").read_text(encoding="utf-8"), "# The setup's rules\n")
|
||||
|
||||
@@ -174,7 +174,7 @@ class Main(unittest.TestCase):
|
||||
self.assertIn("The reference judge, claude-opus-5-5 at xhigh effort, reproduced 2.", out)
|
||||
self.assertIn("claude-fable-5-2 at low effort, a rung a review climbs to, missed 0.\nclaude-fable-5-2 at medium effort, a rung a review climbs to, missed 1:", out)
|
||||
self.assertTrue(out.endswith("returns every verdict the reference judge reproduces: claude-opus-5-5 at medium effort\n"))
|
||||
for said in ("The task the worker was given:\nDo it.", "1. Ship.", "From ~/.claude/CLAUDE.md:\nBe kind."):
|
||||
for said in ("The task the worker was given:\nDo it.", "1. Ship.", "From the setup's CLAUDE.md:\nBe kind."):
|
||||
with self.subTest(said=said):
|
||||
self.assertIn(said, self.prompts[0])
|
||||
# The premises head the prompt and the records follow them.
|
||||
|
||||
@@ -16,19 +16,22 @@ comprehension-history = "folder:docs/comprehension-history.md"
|
||||
reading-cost = "folder:docs/reading-cost.md"
|
||||
changelog = "checkout:CHANGELOG.md"
|
||||
goals-and-audience = "folder:goals.md"
|
||||
principles = "~/.claude/principles"
|
||||
standards = "~/.claude/skills/larv-review/standards"
|
||||
principles = "setup:principles"
|
||||
standards = "setup:skills/larv-review/standards"
|
||||
"""
|
||||
|
||||
JIRA_PLAN = "jira:https://acme.atlassian.net/browse/ABC-12"
|
||||
JIRA_SCORING = 'jira-score-formula = "100 * V / (2**S + 8)"\njira-score-bar = 1\n'
|
||||
|
||||
# Where a test's config places the setup's folders: under the test's home, so no test reads the clone it runs in.
|
||||
SETUP = "~/setup"
|
||||
|
||||
|
||||
def write_config(home: pathlib.Path, checkout: pathlib.Path, goals: str = "checkout:README.md") -> pathlib.Path:
|
||||
"""A config under home that names checkout, every setting inside it but goals-and-audience; for the tests of each tool that reads the config."""
|
||||
"""A config under home that names checkout, every setting inside it but goals-and-audience, principles and standards, which lie in SETUP; for the tests of each tool that reads the config."""
|
||||
folder = config_folder({}, home) / checkout.name
|
||||
folder.mkdir(parents=True, exist_ok=True)
|
||||
(folder / "config.toml").write_text(CLIENT.replace('"~/code/acme-billing"', f'"{checkout}"').replace('"folder:', '"checkout:').replace('"checkout:goals.md"', f'"{goals}"'), encoding="utf-8")
|
||||
(folder / "config.toml").write_text(CLIENT.replace('"~/code/acme-billing"', f'"{checkout}"').replace('"folder:', '"checkout:').replace('"setup:', f'"{SETUP}/').replace('"checkout:goals.md"', f'"{goals}"'), encoding="utf-8")
|
||||
return folder
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,9 @@ Run inside a checkout, or a worktree of one. It finds the config that names the
|
||||
and project-config doesn't read anything from it, so no project may use `build-epic` as its key.
|
||||
|
||||
The config is TOML. `checkout` names the project's main checkout, and every setting in the example below is a path:
|
||||
"checkout:<path>" inside the checkout, "folder:<path>" inside the config's own folder, or one that
|
||||
starts with / or ~/. In a worktree, a "checkout:" path is the worktree's own file.
|
||||
"checkout:<path>" inside the checkout, "folder:<path>" inside the config's own folder,
|
||||
"setup:<path>" inside the clone of this setup whose tool reads the config, or one that starts with
|
||||
/ or ~/. In a worktree, a "checkout:" path is the worktree's own file.
|
||||
|
||||
checkout = "~/code/acme-billing"
|
||||
plan = "folder:todo.md"
|
||||
@@ -23,7 +24,7 @@ starts with / or ~/. In a worktree, a "checkout:" path is the worktree's own fil
|
||||
changelog = "checkout:CHANGELOG.md"
|
||||
goals-and-audience = "folder:goals.md"
|
||||
principles = "folder:principles"
|
||||
standards = "~/.claude/skills/larv-review/standards"
|
||||
standards = "setup:skills/larv-review/standards"
|
||||
|
||||
`principles` and `standards` name the folders the reviewers hold the project to: the technical
|
||||
principles and the review standards. A standards folder must hold quality.md, prose.md, comments.md
|
||||
|
||||
@@ -10,7 +10,7 @@ import re
|
||||
import tomllib
|
||||
import typing
|
||||
|
||||
from loop_state.paths import config_folder
|
||||
from loop_state.paths import config_folder, RELEASE_ROOT
|
||||
from failure import Failure
|
||||
from plan.formula import parse_formula
|
||||
from plan.todo_table import SHAPE
|
||||
@@ -25,7 +25,7 @@ SITE = r"https://[A-Za-z0-9.-]+(?::[0-9]+)?"
|
||||
# Every path a project sets, by its role. Three readers, seated as the human who writes the config, picked the spelling from four candidates. They picked role names over file names, which a client's project doesn't share.
|
||||
SETTINGS = ("plan", "working-rules", "decisions", "score-anchors", "comprehension-history", "reading-cost", "changelog", "goals-and-audience", "principles", "standards")
|
||||
# They also picked a prefix over bare relative paths: each line says its own place, and a relative path with no prefix fails instead of landing somewhere by default.
|
||||
SPELLING = '"checkout:<path>" for a path in the checkout, "folder:<path>" for one in the config\'s folder, or a path that starts with / or ~/'
|
||||
SPELLING = '"checkout:<path>" for a path in the checkout, "folder:<path>" for one in the config\'s folder, "setup:<path>" for one in the setup\'s clone, or a path that starts with / or ~/'
|
||||
# A path setting a project may leave out: the file of KEY=value credentials its tools read. It has no default either: a project without it asks for no credentials, and never reads another project's.
|
||||
ENV_FILE = "env-file"
|
||||
# An optional setting: the service that sends the loop's DMs to the human, one of NOTIFIERS. A project that names none gets no DMs, so a client's env file of Jira credentials is never read for a chat token.
|
||||
@@ -475,7 +475,8 @@ def placed(value: object, top: pathlib.Path, folder: pathlib.Path, home: pathlib
|
||||
"""The path a setting's value spells, or None where it doesn't spell one. A prefixed path stays inside its place."""
|
||||
if not isinstance(value, str):
|
||||
return None
|
||||
for prefix, place in (("checkout:", top), ("folder:", folder)):
|
||||
# "setup:" is the clone this tool runs from, so a config holds wherever that clone lies. Five readers, seated as people who write a config and as claudes that read one, each picked the prefix over a path in the loop's Claude home and over the clone's path written out.
|
||||
for prefix, place in (("checkout:", top), ("folder:", folder), ("setup:", RELEASE_ROOT)):
|
||||
if value.startswith(prefix):
|
||||
inside = pathlib.PurePosixPath(value.removeprefix(prefix))
|
||||
return None if inside.is_absolute() or ".." in inside.parts or not inside.parts else place / inside
|
||||
|
||||
@@ -12,6 +12,7 @@ from project_config.doubles import CLIENT, JIRA_PLAN, JIRA_SCORING
|
||||
from failure import Failure
|
||||
from test_env import isolated_env
|
||||
from project_config.main import located, title_templates
|
||||
from loop_state.paths import RELEASE_ROOT
|
||||
from project_config.templates import Titles
|
||||
|
||||
TOOL = pathlib.Path(__file__).resolve().parents[1] / "project-config"
|
||||
@@ -50,8 +51,8 @@ class LoadTest(ConfigCase):
|
||||
self.assertEqual(found.paths["plan"], folder / "todo.md")
|
||||
self.assertEqual(found.paths["decisions"], folder / "docs" / "decisions.md")
|
||||
self.assertEqual(found.paths["changelog"], self.checkout / "CHANGELOG.md")
|
||||
self.assertEqual(found.paths["principles"], self.home / ".claude" / "principles")
|
||||
self.assertEqual(found.paths["standards"], self.home / ".claude" / "skills" / "larv-review" / "standards")
|
||||
self.assertEqual(found.paths["principles"], RELEASE_ROOT / "principles")
|
||||
self.assertEqual(found.paths["standards"], RELEASE_ROOT / "skills" / "larv-review" / "standards")
|
||||
self.assertEqual(tuple(found.paths), SETTINGS)
|
||||
|
||||
def test_the_build_epic_folder_is_no_projects_config_so_it_needs_no_checkout(self) -> None:
|
||||
@@ -191,7 +192,7 @@ class LoadTest(ConfigCase):
|
||||
self.assertIsNone(found.tracked("plan"), "the config's folder is outside the checkout")
|
||||
|
||||
def test_an_absolute_checkout_and_path_are_taken_as_written(self) -> None:
|
||||
self.write("acme", CLIENT.replace("~/code/acme-billing", str(self.checkout)).replace("~/.claude/principles", "/srv/principles"))
|
||||
self.write("acme", CLIENT.replace("~/code/acme-billing", str(self.checkout)).replace("setup:principles", "/srv/principles"))
|
||||
found = load(self.checkout, self.checkout, self.home, {})
|
||||
assert isinstance(found, ProjectConfig), found
|
||||
self.assertEqual(found.paths["principles"], pathlib.Path("/srv/principles"))
|
||||
@@ -235,6 +236,7 @@ class LoadTest(ConfigCase):
|
||||
"a value that is not text": ("plan = 3\n", "`plan`"),
|
||||
"a path that leaves the folder": ('plan = "folder:../other/todo.md"\n', "`plan`"),
|
||||
"a path that leaves the checkout": ('plan = "checkout:../todo.md"\n', "`plan`"),
|
||||
"a path that leaves the setup": ('plan = "setup:../todo.md"\n', "`plan`"),
|
||||
"an empty path": ('plan = "folder:"\n', "`plan`"),
|
||||
}
|
||||
for case, (line, named) in cases.items():
|
||||
|
||||
@@ -15,7 +15,7 @@ STANDARDS = "skills/larv-review/standards"
|
||||
RULE_DIRS = (HUMAN_RULE_DIR, STANDARDS)
|
||||
RULE_PATH = rf"(?:{'|'.join(map(re.escape, RULE_DIRS))})/[\w-]+\.md"
|
||||
NAMES = r'("[^"]+"(?:,? (?:and )?"[^"]+")*)'
|
||||
CITATION = re.compile(rf'`?(?:~/\.claude/)?(CLAUDE\.md|{RULE_PATH})`? → {NAMES}')
|
||||
CITATION = re.compile(rf'`?(CLAUDE\.md|{RULE_PATH})`? → {NAMES}')
|
||||
# A citation of a file in whichever folder the project's config names as `standards`, checked against the folder this repo ships.
|
||||
STANDARD_CITATION = re.compile(rf"the review standards' `([\w-]+\.md)` → {NAMES}")
|
||||
HEADING = re.compile(r"^#+ (.+?)(?: \(.*\))?$", re.MULTILINE)
|
||||
@@ -24,7 +24,7 @@ DECISION_CITATION = re.compile(r"`?docs/decisions\.md`? → `([^`]+)`")
|
||||
DECISION_TITLE = re.compile(r"^## (.+)$", re.MULTILINE)
|
||||
LISTED_TITLE = re.compile(r"^- (.+)$", re.MULTILINE)
|
||||
NAME = re.compile(r'"([^"]+)"')
|
||||
RULE_FILE = re.compile(rf"(?<![\w/.-])(?:~/\.claude/)?({RULE_PATH})")
|
||||
RULE_FILE = re.compile(rf"(?<![\w/.-])({RULE_PATH})")
|
||||
STRAY = re.compile(rf'(?:CLAUDE\.md|{RULE_PATH})(?!`? → "|:\d)[^\n"]{{1,5}}"')
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import re
|
||||
import unittest
|
||||
|
||||
from git_cli.git_repo import git
|
||||
from repo_checks import ROOT
|
||||
|
||||
# A file of the setup spelled by a place in the person's own Claude home, where no release lies: a tool, or an instruction file. A session the loop starts has the release's tools on PATH, so prose names a tool bare, and names any other file as the setup's `CLAUDE.md` → "Vocabulary", "setup" says. Both hold wherever the release is cloned.
|
||||
BY_ITS_FOLDER = re.compile(r"(?:~|\$HOME)/\.claude/(?:CLAUDE\.md|(?:agents|bin|principles|rules|skills)\b[\w.<>*/-]*)")
|
||||
# The plan, the changelog and the records, then the dated benches and trials: their text names a file as it was spelled when the line was written, and nobody rewrites it.
|
||||
HISTORY = ("CHANGELOG.md", "docs/", "todo.md", "reviewer-merge-trials/", "workflow-bench/")
|
||||
|
||||
|
||||
class SetupFilesNamedWhereverTheCloneLies(unittest.TestCase):
|
||||
def test_no_tracked_file_names_a_file_of_the_setup_by_the_persons_own_claude_home(self) -> None:
|
||||
tracked = git("ls-files", cwd=str(ROOT))
|
||||
self.assertIsInstance(tracked, str, tracked)
|
||||
found = []
|
||||
for name in str(tracked).splitlines():
|
||||
path = ROOT / name
|
||||
if name.startswith(HISTORY) or name == "bin/repo_checks/test_setup_files_named.py" or not path.is_file():
|
||||
continue
|
||||
for number, line in enumerate(path.read_text(encoding="utf-8", errors="replace").splitlines(), 1):
|
||||
found += [f"{name}:{number}: {spelled}" for spelled in BY_ITS_FOLDER.findall(line)]
|
||||
|
||||
self.assertEqual(found, [], "name a tool bare, as in `todo-item`, and any other file as the setup's: the setup's `rules/todo-items.md`, never a path into `~/.claude`")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -1,37 +0,0 @@
|
||||
import re
|
||||
import unittest
|
||||
|
||||
from git_cli.git_repo import git
|
||||
from repo_checks import ROOT
|
||||
|
||||
# A tool spelled by its place in an install folder, as opposed to a source file under bin/, which a reader opens by its path. A session the loop starts has the release's tools on PATH, so prose names a tool bare, and works wherever the release is installed.
|
||||
BY_ITS_FOLDER = re.compile(r"(?:~|\$HOME)/\.claude/bin/[\w.<>-]+(?![\w.<>/-])")
|
||||
# The plan, the changelog and the records: their text names a tool as it was spelled when the line was written, and nobody rewrites it.
|
||||
HISTORY = ("CHANGELOG.md", "docs/", "todo.md")
|
||||
# The lines a person runs in their own shell or a crontab, which lack the tools: no step puts one on their `PATH`.
|
||||
BY_HAND = {
|
||||
"README.md": {"$HOME/.claude/bin/compress-archives", "~/.claude/bin/<tool>", "~/.claude/bin/build-release", "~/.claude/bin/deploy-release", "~/.claude/bin/notify", "~/.claude/bin/project-config", "~/.claude/bin/self-update"},
|
||||
"presentation/README.md": {"~/.claude/bin/run-heavy"},
|
||||
"presentation/build-pdf.py": {"~/.claude/bin/run-heavy"},
|
||||
}
|
||||
# settings.json names its hooks and its status line by their folder, and the test of the reviewer hook quotes it. Claude Code reads the file in every session, also one the human starts without the tools on PATH. A hook it cannot find doesn't refuse anything, so a bare name there would switch rule-hook off in that session.
|
||||
SETTINGS = ("settings.json", "bin/review_rules/test_reviewer_context.py")
|
||||
|
||||
|
||||
class ToolsNamedBare(unittest.TestCase):
|
||||
def test_no_tracked_file_names_a_tool_by_its_install_folder(self) -> None:
|
||||
tracked = git("ls-files", cwd=str(ROOT))
|
||||
self.assertIsInstance(tracked, str, tracked)
|
||||
found = []
|
||||
for name in str(tracked).splitlines():
|
||||
path = ROOT / name
|
||||
if name.startswith(HISTORY) or name in SETTINGS or name == "bin/repo_checks/test_tools_named_bare.py" or not path.is_file():
|
||||
continue
|
||||
for number, line in enumerate(path.read_text(encoding="utf-8", errors="replace").splitlines(), 1):
|
||||
found += [f"{name}:{number}: {spelled}" for spelled in BY_ITS_FOLDER.findall(line) if spelled not in BY_HAND.get(name, ())]
|
||||
|
||||
self.assertEqual(found, [], "name each tool bare, as in `todo-item`")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -11,7 +11,7 @@ from text_files.markdown_text import section
|
||||
SECTIONS = ("Shared goal", "Prose", "Vocabulary")
|
||||
|
||||
|
||||
# The text calls the file the setup's, the word that file uses for the release's rules, and names no install folder: a release may be installed anywhere.
|
||||
# The text calls the file the setup's, the word that file uses for the release's rules, and names the loop's Claude home as the place to open one: a reviewer without a shell cannot learn where `XDG_DATA_HOME` puts that home.
|
||||
def reviewer_context(claude_dir: pathlib.Path) -> str | Failure:
|
||||
"""SECTIONS of the CLAUDE.md in claude_dir, the loop's Claude home, as a reviewer is told them; a Failure where the file or a section is missing."""
|
||||
path = claude_dir / "CLAUDE.md"
|
||||
@@ -22,7 +22,7 @@ def reviewer_context(claude_dir: pathlib.Path) -> str | Failure:
|
||||
found = {name: section(text, re.escape(name)) for name in SECTIONS}
|
||||
if missing := [name for name, lines in found.items() if lines is None]:
|
||||
return Failure(f"{path} holds no section {', '.join(missing)}")
|
||||
return "\n\n".join(["You start without the setup's `CLAUDE.md`. These sections of it hold for you:", *("\n".join([f"## {name}", *lines]).strip() for name, lines in found.items() if lines is not None)])
|
||||
return "\n\n".join([f"You start without the setup's `CLAUDE.md`. Open a file of the setup under {claude_dir}/. These sections of that `CLAUDE.md` hold for you:", *("\n".join([f"## {name}", *lines]).strip() for name, lines in found.items() if lines is not None)])
|
||||
|
||||
|
||||
def starts_bare(agent: str, claude_dir: pathlib.Path) -> bool:
|
||||
|
||||
@@ -23,7 +23,7 @@ class ReviewerContext(unittest.TestCase):
|
||||
(self.claude_dir / "agents" / f"{agent}.md").write_text(f"---\nname: {agent}\nomitClaudeMd: true\n---\n\nReview.\n")
|
||||
|
||||
def test_holds_the_shared_goal_prose_and_vocabulary_sections_and_none_of_the_workers(self):
|
||||
self.assertEqual(reviewer_context(self.claude_dir), "You start without the setup's `CLAUDE.md`. These sections of it hold for you:\n\n## Shared goal\n\nCode health.\n\n## Prose\n\nWrite short.\n\n## Vocabulary\n\n- **chunk** — a unit.")
|
||||
self.assertEqual(reviewer_context(self.claude_dir), f"You start without the setup's `CLAUDE.md`. Open a file of the setup under {self.claude_dir}/. These sections of that `CLAUDE.md` hold for you:\n\n## Shared goal\n\nCode health.\n\n## Prose\n\nWrite short.\n\n## Vocabulary\n\n- **chunk** — a unit.")
|
||||
|
||||
def test_a_heading_inside_a_code_fence_does_not_end_a_section(self):
|
||||
(self.claude_dir / "CLAUDE.md").write_text("## Shared goal\n\n```\n## Not a heading\n```\n\nstill the goal\n\n## Prose\n\np\n\n## Vocabulary\n\nv\n")
|
||||
|
||||
@@ -13,11 +13,12 @@ from git_cli.git_repo import Git, top
|
||||
from git_cli import git_repo
|
||||
from task_bench.bench_folder import held
|
||||
from review_rules.review_folder import made_review_folder
|
||||
from loop_state.paths import paths_from, with_release_tools
|
||||
from loop_state.paths import paths_from
|
||||
from transcript_archive.project_key import project_key
|
||||
from model_routing.ladder_file import project_ladder
|
||||
from chunk_driver.project.model_choice import read_models_file
|
||||
from model_routing.ladder import Rung
|
||||
from loop_effects.effects import system_effects
|
||||
|
||||
DIGEST = "digest.md"
|
||||
PROMPT = pathlib.Path(__file__).with_name("gather-prompt.md")
|
||||
@@ -58,7 +59,17 @@ def gather(env: typing.Mapping[str, str], home: pathlib.Path, claude: Claude) ->
|
||||
|
||||
|
||||
def run_claude(args: list[str], cwd: str, prompt: str) -> subprocess.CompletedProcess[str]:
|
||||
return subprocess.run(["claude", *args], capture_output=True, cwd=cwd, env=with_release_tools(os.environ), input=prompt, text=True)
|
||||
"""Runs the gathering claude as the loop runs each of its own: in the loop's Claude home, built or refreshed first, with the release's tools first on its `PATH`."""
|
||||
effects = system_effects(pathlib.Path.home(), os.environ)
|
||||
return once_ready(effects.claude_home, effects.claude)(args, cwd, prompt)
|
||||
|
||||
|
||||
def once_ready(unready: typing.Callable[[], str | None], claude: Claude) -> Claude:
|
||||
"""claude, started only where unready gives no reason why it cannot run yet; else a failed run that says the reason."""
|
||||
def run(args: list[str], cwd: str, prompt: str) -> subprocess.CompletedProcess[str]:
|
||||
reason = unready()
|
||||
return subprocess.CompletedProcess(args, 1, "", reason) if reason else claude(args, cwd, prompt)
|
||||
return run
|
||||
|
||||
|
||||
def project_rung(home: pathlib.Path, env: typing.Mapping[str, str], git: Git) -> Rung | Failure:
|
||||
|
||||
@@ -14,7 +14,7 @@ BIN = pathlib.Path(__file__).resolve().parents[2]
|
||||
sys.path.insert(0, str(BIN))
|
||||
|
||||
from failure import Failure
|
||||
from task_bench.figures.gather import gather, PROMPT
|
||||
from task_bench.figures.gather import gather, once_ready, PROMPT
|
||||
from test_env import isolated_env
|
||||
from task_bench import main
|
||||
|
||||
@@ -69,6 +69,12 @@ class GatherTest(unittest.TestCase):
|
||||
self.assertEqual((self.calls[0][0][2], self.calls[0][1], self.calls[0][2].endswith("\n\nworktree's\n")), ("claude-opus-5-5", str(worktree), True))
|
||||
self.assertEqual((bench.exists(), self.bench.exists()), (False, True))
|
||||
|
||||
def test_the_claude_starts_only_once_the_loops_claude_home_is_ready_and_a_home_that_is_not_keeps_the_folder(self):
|
||||
found = gather(self.env, self.home, once_ready(lambda: "nobody is signed in to the loop's Claude home", self.claude))
|
||||
self.assertEqual((found.reason if isinstance(found, Failure) else found, self.calls), (f"nobody is signed in to the loop's Claude home\nThe digest stays in {self.bench} until the next bench: run `task-bench gather` again.", []))
|
||||
self.assertNotIsInstance(gather(self.env, self.home, once_ready(lambda: None, self.claude)), Failure)
|
||||
self.assertEqual(len(self.calls), 1)
|
||||
|
||||
def test_refuses_without_a_digest_and_starts_no_claude(self):
|
||||
(self.bench / "digest.md").unlink()
|
||||
found = gather(self.env, self.home, self.claude)
|
||||
@@ -143,15 +149,23 @@ class GatherTest(unittest.TestCase):
|
||||
|
||||
|
||||
class RunClaude(unittest.TestCase):
|
||||
def test_runs_claude_in_the_folder_with_the_prompt_and_the_releases_tools_first_on_its_path(self):
|
||||
def test_runs_claude_in_the_loops_claude_home_once_it_is_built_with_the_prompt_and_the_releases_tools_first_on_its_path(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
claude = pathlib.Path(folder, "claude")
|
||||
claude.write_text('#!/bin/sh\necho "$PWD $* $(cat) $PATH"\n')
|
||||
claude.write_text("""#!/bin/sh
|
||||
case "$*" in
|
||||
"auth status") echo '{"loggedIn": true}' ;;
|
||||
plugin*) ;;
|
||||
*) echo "$PWD $* $(cat) $PATH $CLAUDE_CONFIG_DIR" ;;
|
||||
esac
|
||||
""")
|
||||
claude.chmod(0o755)
|
||||
# A process of its own, so the test changes no PATH but that process's.
|
||||
# A process of its own, so the test changes no PATH and no home but that process's.
|
||||
call = f"import sys; sys.path.insert(0, {str(BIN)!r}); from task_bench.figures.gather import run_claude; print(run_claude(['-p'], {folder!r}, 'asked').stdout, end='')"
|
||||
done = subprocess.run([sys.executable, "-c", call], capture_output=True, env={"PATH": f"{folder}:/usr/bin:/bin"}, text=True)
|
||||
self.assertEqual(done.stdout, f"{os.path.realpath(folder)} -p asked {BIN}:{folder}:/usr/bin:/bin\n", done.stderr)
|
||||
done = subprocess.run([sys.executable, "-c", call], capture_output=True, env={"HOME": folder, "PATH": f"{folder}:/usr/bin:/bin"}, text=True)
|
||||
home = pathlib.Path(folder, ".local/share/build-release/claude-home")
|
||||
self.assertEqual(done.stdout, f"{os.path.realpath(folder)} -p asked {BIN}:{folder}:/usr/bin:/bin {home}\n", done.stderr)
|
||||
self.assertTrue((home / "CLAUDE.md").is_symlink())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -162,7 +162,7 @@ table's header and its three All rows. The entry's heading gives the current UTC
|
||||
features the heading reads `task-bench features of <branch>: ...` instead, for one of data sources `task-bench data-sources
|
||||
of <branch>: ...`, and for one of shipped features `task-bench shipped-features of <branch>: ...`. No tool reads the entry as a ruling or a scoring run. The bench's last line says where the entry went. A bench that fails or stops doesn't record anything.
|
||||
|
||||
`task-bench gather`, run in the same checkout, turns the digest into plan items. It starts a claude on the project's rung, the
|
||||
`task-bench gather`, run in the same checkout, turns the digest into plan items. It starts a claude in the loop's Claude home, on the project's rung, the
|
||||
cheapest rung of the model build-release runs the project on, with the digest and the prompt in bin/task_bench/figures/gather-prompt.md.
|
||||
That claude files an item with `todo-item add` for each place the runs show to be hard, and leaves the plan's file uncommitted.
|
||||
gather prints that claude's answer and removes the bench's folder. Where claude fails, the folder stays, for another try.
|
||||
@@ -185,7 +185,7 @@ With --record-figures it also exits 1, saying why: before it plants a bug, where
|
||||
cannot be read; and after the bench, where the history already holds that branch's bench of those two commits or cannot be
|
||||
written. The folder then still holds the bench's results.
|
||||
gather exits 1, saying why, outside a checkout, without a digest, where build-release has saved no model for the project or the
|
||||
model is not on its routing ladder, and where its claude fails or hits a usage limit.
|
||||
model is not on its routing ladder, and where the loop's Claude home is not ready or its claude fails or hits a usage limit.
|
||||
"""
|
||||
import dataclasses
|
||||
import functools
|
||||
|
||||
@@ -846,6 +846,17 @@ Valid while Claude Code loads `~/.claude/rules/*.md` in every project, a path-sc
|
||||
|
||||
2026-12-04, lilleman's plan for 0.18.0, replacing the clean filter of 2026-10-21. Serves goal 2. Claude Code rewrites `"model"` in its home's `settings.json` on every `/model` and plugin install. While that home was the clone, a clean filter, `bin/settings_filter.py`, kept the model and Claude Code's key order out of every commit, and each machine ran one `git config` step to set it. The loop's home is now generated outside the clone, so Claude Code never writes the tracked file, and the filter and its step are gone. A build of the home keeps the `model` its `settings.json` holds and takes every other key from the clone. lilleman chose a model per machine over one synced in `env.ANTHROPIC_MODEL`, which would override a `/model` pick from the next session on; build-release picks each project's model in `~/.config/build-release/models.json` anyway. The effort keys, `effortLevel` and `modelSettings`, stay synced: the routing decision on a chunk's worker rung relies on the effort `settings.json` gives every interactive session. The tracked file holds no theme or status line: those are the person's, in their own `~/.claude`. `bin/repo_checks/test_settings.py` holds the tracked file to no model and sorted keys. Valid while Claude Code writes the model it picks into its home's `settings.json`.
|
||||
|
||||
## setup files: prose names a file of the setup as the setup's `<path>`, a project's config names one as `setup:<path>`, and the loop's Claude home links each folder so named
|
||||
|
||||
2026-12-04, the chunk of the plan item that asked for one spelling. Serves goals 2 and 3, and applies project principle 7. Since 0.18.0 a release is cloned anywhere but `~/.claude`, so a path into `~/.claude` sends its reader to a file that doesn't exist, or to an old checkout's stale copy.
|
||||
|
||||
- **Prose:** the rules, agents, skills, principles and each tool's text write the setup's `rules/todo-items.md`. `CLAUDE.md` → "Vocabulary" defines the setup once, and says to open its files in the loop's Claude home. So `bin/claude_home` links `principles/` and `bin/` there beside the files Claude Code loads, and the hook that starts a reviewer names the home's path, since a reviewer without a shell cannot learn where `XDG_DATA_HOME` puts it. A tool is still named bare.
|
||||
- **Config:** `setup:<path>` is a path inside the clone whose tool reads the config, so `standards = "setup:skills/larv-review/standards"` holds on every machine.
|
||||
- **The bench:** five fresh-context readers, seated as a first-time installer, a worker, a reviewer without a shell, the setup's maintainer and a consultant with three clones. Each resolved every candidate with the clone in `/opt/br`, and again with `XDG_DATA_HOME` set, then ranked them. All five ranked this prose spelling first, over the home's full path at each mention, `$CLAUDE_CONFIG_DIR/<path>` and the clone written as `~/build-release/<path>`. All five ranked `setup:` first for a config, over the home's path and the clone's path. The full path misled readers who skipped the note on `XDG_DATA_HOME`, the variable cost a shell step at each mention, and the clone's path was wrong wherever the clone lies elsewhere.
|
||||
- **Left as written:** `CHANGELOG.md`, `docs/`, `todo.md` and the dated trials under `workflow-bench/` and `reviewer-merge-trials/`. `~/.claude` still names the person's own Claude home, as in goal 3 and rule-hook's `.env` rule.
|
||||
|
||||
`bin/repo_checks/test_setup_files_named.py` fails on a path into `~/.claude` that names a file of the setup. Valid while every claude the setup starts runs in the loop's Claude home.
|
||||
|
||||
## task-bench: a bench takes 5 bugs and 5 runs per side, after a 2 × 2 pilot on a new setup, and at no affordable count does a chunk-sized change rise above the noise
|
||||
|
||||
2026-11-22, lilleman, through todo item 503. Serves goal 1.4, since a bench of 50 runs costs hours and tens of millions of tokens, and goal 1.1, since a bench that can't tell a change from noise doesn't prove anything.
|
||||
|
||||
@@ -4078,3 +4078,20 @@ Read most (opens and searches):
|
||||
- `bin/cut_release/patch.py` 3
|
||||
- `CLAUDE.md` 2
|
||||
- `bin/cut_release/trace.py` 2
|
||||
|
||||
## Reading cost, chunk 81ec393bb45c, finished 2026-12-04T03:05:01Z
|
||||
|
||||
305346 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `README.md` 35
|
||||
- `docs/decisions.md` 13
|
||||
- `bin/build_release/test_black_box.py` 12
|
||||
- `bin/self_update/test_self_update.py` 9
|
||||
- `CLAUDE.md` 6
|
||||
- `bin/build_epic/main.py` 6
|
||||
- `bin/larv_review/reviewer_header.py` 6
|
||||
- `bin/review_replay/replay.py` 6
|
||||
- `todo.md` 6
|
||||
- `bin/build-release` 5
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
presentation/build-pdf.py
|
||||
```
|
||||
|
||||
It writes `presentation/build-release-explained.pdf`, which stays out of git. It needs Docker, network access to Google Fonts, and the `playwright-for-claude` image. Build the image once with `~/.claude/bin/run-heavy docker build -t playwright-for-claude ~/code/playwright-for-agents`. When a font fails to load, the build stops without printing: fallback fonts would push pages onto a second sheet.
|
||||
It writes `presentation/build-release-explained.pdf`, which stays out of git. It needs Docker, network access to Google Fonts, and the `playwright-for-claude` image. Build the image once with `~/build-release/bin/run-heavy docker build -t playwright-for-claude ~/code/playwright-for-agents`. When a font fails to load, the build stops without printing: fallback fonts would push pages onto a second sheet.
|
||||
|
||||
## Publish the page
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ HEAD = '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="v
|
||||
|
||||
def main() -> int:
|
||||
if subprocess.run(["docker", "image", "inspect", IMAGE], capture_output=True).returncode != 0:
|
||||
print(f"No {IMAGE} image. Build it once with: ~/.claude/bin/run-heavy docker build -t {IMAGE} ~/code/playwright-for-agents", file=sys.stderr)
|
||||
print(f"No {IMAGE} image. Build it once with: ~/build-release/bin/run-heavy docker build -t {IMAGE} ~/code/playwright-for-agents", file=sys.stderr)
|
||||
return 1
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
work = pathlib.Path(folder)
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
- Each added level makes a reader open one more folder, file or function to find a thing, so a split must save more than it costs. Keep eight, nine or ten things in one level when splitting them would add more names, files or jumps than it removes. Say why where the level is declared: a comment, the folder's README.
|
||||
- Group by what a reader would name: a feature, a step, what changes together. BANNED: `misc/`, `part2()` or a parameter object that exists only to bring a count down. GOOD: `invoices/`, `payments/`, `reports/`, each holding what changes together; `locales/` holding `de.json` to `zh.json`, flat.
|
||||
- Group code into files, and files into folders. A banner comment (`// --- name ---`) that groups a file's sections is the last resort, kept only where the language or the build cannot split the file, and the file says why it can't be split.
|
||||
- Crossing a limit asks for one of two answers, never a split at any cost: group the things, or record why they stay. Keep a limit only while the comprehension panel's readers (`~/.claude/skills/comprehension-panel/`) find the code it flags hard.
|
||||
- Crossing a limit asks for one of two answers, never a split at any cost: group the things, or record why they stay. Keep a limit only while the comprehension panel's readers (the setup's `skills/comprehension-panel/`) find the code it flags hard.
|
||||
* Make the entry point the first thing a newcomer finds.
|
||||
- The root holds the README and the files a tool reads only from there, such as the manifest, the lockfile and the licence, and the entry point where the ecosystem puts it there. Source, tests and tooling live in folders named by what they hold. A repo of several tools applies this to each tool's folder.
|
||||
- The entry point carries the name and the place its ecosystem expects, such as `index.js` at the root of an npm package or `src/main.rs` in a Cargo crate, with no other source file beside it.
|
||||
|
||||
+1
-1
@@ -9,6 +9,6 @@ paths:
|
||||
|
||||
**The decision log has one home: `docs/decisions.md`**. A title states the whole decision in one line: what holds at the commit it ships in, in words a reader finds in the code or the plan. `AGENTS.md` lists the project principles and the title of each decision no project principle covers, so a session works by the decisions without loading their background. The entry holds the background: its date, who made it, the reasoning, and the premise it rests on ("valid while X") so it can expire honestly when that premise dies.
|
||||
|
||||
**Every decision links to a goal or a technical principle.** An entry names the goal it serves or the technical principle it applies, from the config's principles folder; one that can do neither is a missing goal, and an entry already in the repo with neither behind it is a finding. Propose the goal, never a reason of your own — `~/.claude/CLAUDE.md` → "Working loop", "Ask, don't guess" says how. An entry working against a goal or a technical principle stands only while it names the `todo.md` item that ends it.
|
||||
**Every decision links to a goal or a technical principle.** An entry names the goal it serves or the technical principle it applies, from the config's principles folder; one that can do neither is a missing goal, and an entry already in the repo with neither behind it is a finding. Propose the goal, never a reason of your own — the setup's `CLAUDE.md` → "Working loop", "Ask, don't guess" says how. An entry working against a goal or a technical principle stands only while it names the `todo.md` item that ends it.
|
||||
|
||||
**Check each new decision against the project's principles.** A project principle, listed in the project's `AGENTS.md` under `## Project principles`, states one rule that several decisions apply. Each time a decision is recorded, ask three things. Does a project principle already cover it? Then it adds no title to `AGENTS.md`, and needs no ask. Does it break one? Then either the principle or the decision is wrong. Does it apply the same rule as decisions already listed? Then that rule is a new project principle, which covers those decisions too. A break, a new project principle or a change to one is the human's: ask, with your recommendation, and leave the project principles as they are until the human answers. Once the human approves a new one, the titles it covers leave `AGENTS.md`.
|
||||
|
||||
@@ -6,10 +6,10 @@ paths:
|
||||
|
||||
# Goals and Audience
|
||||
|
||||
A project's goals and audience live in its goals file (`~/.claude/CLAUDE.md` → "Vocabulary"): `README.md`, or a client project's `goals.md` in its config's folder or its plan epic's description in Jira.
|
||||
A project's goals and audience live in its goals file (the setup's `CLAUDE.md` → "Vocabulary"): `README.md`, or a client project's `goals.md` in its config's folder or its plan epic's description in Jira.
|
||||
|
||||
- **Goals** state the project's aim and intent, not promises: one numbered line each, like slogans, in priority order; a sub-goal is indented under its goal — "1. Blazing fast performance. 2. Correctness is more important than many features." A goal names no step of the work, such as a check to run first, and rarely an implementation. How a goal is met goes in a method section further down the goals file and names the goal it serves. BANNED as a goal: `Kill weak candidates early, with the cheap checks first.` GOOD: the goal `Keep research on a budget, so it scales in both time and cost.`, with the cheap checks moved to the method section, naming that goal.
|
||||
- **Mark each goal `**Maintain:**` or `**Achieve:**`.** A maintain goal is a state to hold: a change that breaks it is redesigned or dropped, whatever its value to other goals. An achieve goal is a direction to pursue, weighed against the other achieve goals. Under each achieve goal, three indented bullets: `Signal:` what moving towards it looks like, `Counter-signal:` what shows it is bought at a wrong price, and `Why:` one line on how the two connect. A goal with sub-goals states its own signal. A maintain goal has no bullets. BANNED: an unmarked goal; an achieve goal with no signal; `**Achieve:** Delivery speed.` with the signal `faster`. GOOD: `**Achieve:** Delivery speed.` with `Signal: hours from a chunk's start to its merge fall.`, `Counter-signal: 🔴 findings per chunk rise.` and `Why: speed bought by skipping review shows up as defects.`
|
||||
- **Leave code health out of the goals file.** `~/.claude/CLAUDE.md` → "Shared goal" states it for every project, ranked first, and says when and how a goals file voids it. File an item to drop a goal that restates it: the goals after it renumber, and every Moves cell and decision citing them must follow.
|
||||
- **Leave code health out of the goals file.** The setup's `CLAUDE.md` → "Shared goal" states it for every project, ranked first, and says when and how a goals file voids it. File an item to drop a goal that restates it: the goals after it renumber, and every Moves cell and decision citing them must follow.
|
||||
- **Audience** names who depends on the project and what they may rely on.
|
||||
- **Every project's audience includes the contributor**: the person who reads the code to change it. The goals file doesn't list them, and drops them only with the `**Void:** code health` line (`~/.claude/CLAUDE.md` → "Shared goal").
|
||||
- **Every project's audience includes the contributor**: the person who reads the code to change it. The goals file doesn't list them, and drops them only with the `**Void:** code health` line (the setup's `CLAUDE.md` → "Shared goal").
|
||||
|
||||
@@ -5,7 +5,7 @@ description: Judge how hard a project is to understand by running a panel of nin
|
||||
|
||||
# comprehension-panel — what readers find hard, versus what a metric says
|
||||
|
||||
Words: `~/.claude/CLAUDE.md` → "Vocabulary".
|
||||
Words: the setup's `CLAUDE.md` → "Vocabulary".
|
||||
|
||||
Where readers and a metric disagree, the readers win.
|
||||
|
||||
@@ -247,4 +247,4 @@ it apart; it does not by itself prove a ceiling worthless against future drift.
|
||||
|
||||
Panelists also surface real defects in passing — dead values, unstated invariants, doc gaps.
|
||||
Verify each in the code yourself before reporting it; a panelist's incidental claim is a lead, not
|
||||
a finding. Everything that survives lands per `~/.claude/CLAUDE.md` → "Working loop".
|
||||
a finding. Everything that survives lands per the setup's `CLAUDE.md` → "Working loop".
|
||||
|
||||
+21
-21
@@ -7,9 +7,9 @@ description: Ship a work chunk through review to a merged PR; decisions land in
|
||||
|
||||
You orchestrate, fix, and ship; reviewers only report. Run every reviewer in the foreground (`run_in_background: false`), each wave's reviewers in one message (§3 → "Waves"), and watch CI in the foreground: a headless run exits when the turn ends, and a background watcher dies with it. Never schedule a wakeup: a pending one keeps a headless run from exiting, so build-release neither runs its judge nor asks the human. The turn runs on until §6.
|
||||
|
||||
**Forge-neutral.** Five PR operations recur below: read a PR's diff, open a draft PR, read check status, mark ready, merge. On GitHub and Gitea, `chunk-pr` opens the draft PR, marks it ready and merges it. Read the diff and the checks with the forge's own CLI, `gh` or `tea` per `~/.claude/CLAUDE.md` → "Git, commits, and PRs". On any other forge, achieve all five through its CLI or API — discover how rather than assuming. A forge without a native draft state gets the closest equivalent (a `WIP:`/`Draft:` title prefix); note any approximation in the summary.
|
||||
**Forge-neutral.** Five PR operations recur below: read a PR's diff, open a draft PR, read check status, mark ready, merge. On GitHub and Gitea, `chunk-pr` opens the draft PR, marks it ready and merges it. Read the diff and the checks with the forge's own CLI, `gh` or `tea` per the setup's `CLAUDE.md` → "Git, commits, and PRs". On any other forge, achieve all five through its CLI or API — discover how rather than assuming. A forge without a native draft state gets the closest equivalent (a `WIP:`/`Draft:` title prefix); note any approximation in the summary.
|
||||
|
||||
The bar a chunk is reviewed to: `quality.md` in the project's review standards, the folder `project-config standards` prints. Words: `~/.claude/CLAUDE.md` → "Vocabulary". What a reviewer reports: ~/.claude/skills/larv-review/review-findings.md; how you resolve it: §3 → "Findings".
|
||||
The bar a chunk is reviewed to: `quality.md` in the project's review standards, the folder `project-config standards` prints. Words: the setup's `CLAUDE.md` → "Vocabulary". What a reviewer reports: the setup's `skills/larv-review/review-findings.md`; how you resolve it: §3 → "Findings".
|
||||
|
||||
**An ask** holds only what it asks about; the rest runs on while it waits. No user reachable (a headless run) → finish the rest, then leave the PR unmerged with the question and your recommendation in the summary, unless the ask's rule names another branch.
|
||||
|
||||
@@ -17,12 +17,12 @@ The bar a chunk is reviewed to: `quality.md` in the project's review standards,
|
||||
|
||||
- Not a git repo → say so and stop.
|
||||
- Someone else's PR, or the user asked for opinions only → one stability run, report its findings, done.
|
||||
- **Premises first**, per `~/.claude/CLAUDE.md` → "Working loop". Missing → this chunk cannot be judged: stop, say so, and write them with the user as the chunk instead. That chunk's whole review is the human's approval; a later change to a goal is reviewed like any chunk.
|
||||
- **Premises first**, per the setup's `CLAUDE.md` → "Working loop". Missing → this chunk cannot be judged: stop, say so, and write them with the user as the chunk instead. That chunk's whole review is the human's approval; a later change to a goal is reviewed like any chunk.
|
||||
- Issue trackers are project-specific — the project's own docs say whether it has one. When it does and the work has a ticket, follow that tracker's conventions for assignment and status.
|
||||
|
||||
## 2. Ship the branch (idempotent — skip whatever already exists)
|
||||
|
||||
Follow `~/.claude/CLAUDE.md` → "Git, commits, and PRs". Never commit to the default branch. Commit. Then read in the repo's CI config, such as a workflow file's `on:`, what starts a CI run:
|
||||
Follow the setup's `CLAUDE.md` → "Git, commits, and PRs". Never commit to the default branch. Commit. Then read in the repo's CI config, such as a workflow file's `on:`, what starts a CI run:
|
||||
|
||||
- **A push to the chunk's branch starts one** → open no pull request yet. Push with `git push --set-upstream origin <branch>` now and after each commit, so CI cycles while the review runs. §4 opens the pull request once our own review is done: human reviewers see a draft, and a forge's auto-reviewer may review one, so an early draft draws findings our passes would have caught.
|
||||
- **Only a pull request starts one, or the repo has no CI** → run `chunk-pr open '<title>' '<summary>'` now: it pushes with upstream set and opens a **draft** PR, so CI cycles while the review runs.
|
||||
@@ -31,13 +31,13 @@ No remote → review locally and say so in the summary.
|
||||
|
||||
**Work in the worktree.** Enter the chunk's worktree with the `EnterWorktree` tool, `path` set to it, unless the session already works there. A reviewer, a seat and the security pass's skill read the diff of the session's working directory, and a subagent starts there; from the checkout root they find the branch's diff empty.
|
||||
|
||||
**Reading cost.** Run `reading-cost` in the chunk's worktree, unless build-release's prompt shows that `chunk-preflight` already ran it there, and commit what it appends to `docs/reading-cost.md`; the commit re-enters no pass. Resolve a merge conflict in that file by putting the default branch's figures first and dropping a figure for a chunk the default branch already holds. On `Rising:`, file a plan item titled `**Lower the reading cost of the files a chunk reads most before its first commit.**`, scored per `~/.claude/rules/todo-items.md` with the tool's medians and files as its detail; where the plan already holds it, leave it as it is: `docs/reading-cost.md` holds the figures. The item names the next release, or the one after when this chunk ships the next release's last item. On exit 1, repair what its message names and run it again; when the message names no repair, file it as a `question` item, or refresh the question item an earlier run filed, and go on. Leave the plan as it is on any other output. The chunk that ships that item runs the tool with `--reset` instead, so the next rise is measured on chunks that finished after it.
|
||||
**Reading cost.** Run `reading-cost` in the chunk's worktree, unless build-release's prompt shows that `chunk-preflight` already ran it there, and commit what it appends to `docs/reading-cost.md`; the commit re-enters no pass. Resolve a merge conflict in that file by putting the default branch's figures first and dropping a figure for a chunk the default branch already holds. On `Rising:`, file a plan item titled `**Lower the reading cost of the files a chunk reads most before its first commit.**`, scored per the setup's `rules/todo-items.md` with the tool's medians and files as its detail; where the plan already holds it, leave it as it is: `docs/reading-cost.md` holds the figures. The item names the next release, or the one after when this chunk ships the next release's last item. On exit 1, repair what its message names and run it again; when the message names no repair, file it as a `question` item, or refresh the question item an earlier run filed, and go on. Leave the plan as it is on any other output. The chunk that ships that item runs the tool with `--reset` instead, so the next rise is measured on chunks that finished after it.
|
||||
|
||||
**Tests and static analysis.** Where the branch changes code, config or tests, before each stability round: search the project's Markdown, the help and error text in code, and the comments beside the code for each flag, name, path and number the change renames, removes or changes, and fix each line it made false. Where the change adds a member to a set, such as a locale, command or format, search the same places too for each sentence that claims something of every or each member of that set, and fix each one the new member makes false. For each builtin, flag or option the change adds, take each range or set of inputs its docs state. Run the command once with a value just outside it, such as a date past the years it supports, as the Run and Limits bullets of §3 → "Claimed output" say. Where it printed nothing, an error or a clamped value, fix each doc line that states the range so that it names that result, and keep the run for §3's hand-over. Commit, then run the project's test suite and static analysis in the chunk's worktree as its README documents them, and fix a failure before going on. Hand stability-reviewer the commit they last passed on; a fix from the mutation tests below moves the head, so run them again after it, and the reviewer doesn't run them again on that commit.
|
||||
|
||||
**Mutation tests.** Where the branch changes code, run the project's mutation command in the chunk's worktree, with every change committed, before each stability round: the one the project's README documents, else `run-heavy mutate-changes --prefix '<how the project runs its tools>'`. `mutate-changes --help` says how to set `--prefix` and `--jobs`. Where a mutant of a changed line survives and changes behaviour, kill it: add or strengthen a test that fails on it, commit, and run the command again. Hand stability-reviewer what the last run printed, with the commit it ran on. On exit 1, repair what its message names and run it again; when you cannot, hand the reviewer the message.
|
||||
|
||||
Where `mutate-changes` prints `Not mutated, as no tool covers their language:` and that line names a file of code, not only Markdown or config files, file a plan item titled `**Add a mutation tool for <language>.**`, scored per `~/.claude/rules/todo-items.md`. Its detail names the language's mutation tool, pinned to a version that supports the project's language version, and the code files the line named. Where an earlier chunk filed the item, add this chunk's files to its detail instead.
|
||||
Where `mutate-changes` prints `Not mutated, as no tool covers their language:` and that line names a file of code, not only Markdown or config files, file a plan item titled `**Add a mutation tool for <language>.**`, scored per the setup's `rules/todo-items.md`. Its detail names the language's mutation tool, pinned to a version that supports the project's language version, and the code files the line named. Where an earlier chunk filed the item, add this chunk's files to its detail instead.
|
||||
|
||||
## 3. Passes
|
||||
|
||||
@@ -72,7 +72,7 @@ Give a reviewer without Bash `git ls-files`'s output in its prompt, since some h
|
||||
|
||||
`larv-review` holds this section's mechanical rules: the chunk's review folder, the round count and each round commit's counts, the paired ruling's base and vote count, the scoring run's trigger; the history's format, its latest places and its count of how often seats agree; and the header of each reviewer's prompt. Run it in the chunk's worktree; `larv-review --help` states each rule. On exit 1, repair what its message names and run it again; when you cannot, ask the user.
|
||||
|
||||
**Reports.** Run `larv-review reviewer-header <pass>` in the chunk's worktree, and open each prompt to an agent under `~/.claude/agents/` with what it prints; then say in a few lines what the change does and which files it touches. The command makes the chunk's review folder and writes the branch diff and the plan's listing into it. The header names that diff, the reviewer's full report, `<pass>-round-<n>.md`, in the folder, the folders of technical principles and review standards the project's config sets, the files of coding conventions where it lists any, the listing, and for architecture and stability the places too. For a reviewer whose definition starts it without `CLAUDE.md`, the header's last line names the file that holds the project principles and decision titles, which the reviewer reads first. For a relaunch one rung up, add `--rerun`: the report becomes `<pass>-round-<n>-rerun.md`, and the header names the report that asked. Before you answer a 🔴 or 🟡, read its entry: Grep the report for the finding's place, with the lines after it, rather than Read the whole report. rule-hook refuses a reviewer's Edit and MultiEdit, and any Write outside `~/.local/state/build-release/larv-review/`, which is under `$XDG_STATE_HOME` instead of `~/.local/state` where that holds an absolute path. Keep the folder after the merge: `review-replay` replays a round from the reports its prompt names, and `compress-archives` gzips each file 30 days after it last changed.
|
||||
**Reports.** Run `larv-review reviewer-header <pass>` in the chunk's worktree, and open each prompt to an agent under the setup's `agents/` with what it prints; then say in a few lines what the change does and which files it touches. The command makes the chunk's review folder and writes the branch diff and the plan's listing into it. The header names that diff, the reviewer's full report, `<pass>-round-<n>.md`, in the folder, the folders of technical principles and review standards the project's config sets, the files of coding conventions where it lists any, the listing, and for architecture and stability the places too. For a reviewer whose definition starts it without `CLAUDE.md`, the header's last line names the file that holds the project principles and decision titles, which the reviewer reads first. For a relaunch one rung up, add `--rerun`: the report becomes `<pass>-round-<n>-rerun.md`, and the header names the report that asked. Before you answer a 🔴 or 🟡, read its entry: Grep the report for the finding's place, with the lines after it, rather than Read the whole report. rule-hook refuses a reviewer's Edit and MultiEdit, and any Write outside `~/.local/state/build-release/larv-review/`, which is under `$XDG_STATE_HOME` instead of `~/.local/state` where that holds an absolute path. Keep the folder after the merge: `review-replay` replays a round from the reports its prompt names, and `compress-archives` gzips each file 30 days after it last changed.
|
||||
|
||||
**Claimed output.** Before the Product-owner or Prose pass launches in a round, find the lines the diff adds or changes that say what a command, flag or error prints, such as "the error names the fix", or what a command writes, such as "the diff of the regenerated file holds only X". In round 2, take only the lines the round's fixes changed. Those reviewers have no shell, and reading code can't show that an output holds the words a line claims.
|
||||
|
||||
@@ -83,7 +83,7 @@ Give a reviewer without Bash `git ls-files`'s output in its prompt, since some h
|
||||
|
||||
**Cited sources.** Before the Prose pass launches in a round, find each sentence the diff adds or changes that names a web page as the source of its claim, such as a licence line that cites the publisher's licence page. In round 2, take only the sentences round 1's fixes changed. Prose-reviewer has no web access, so without the page it marks such a claim ❓.
|
||||
|
||||
- **Fetch.** Run `curl --fail --location --max-redirs 5 --max-time 30 --output <page> --proto '=https' --proto-redir '=https' --show-error --silent --write-out '%{url_effective}' <URL>`, `<page>` a temporary file. It prints where the redirects ended. Where a page builds its text with scripts, so that curl would save only its scripts, fetch it as `~/.claude/CLAUDE.md` → "Web research" says, in place of curl. Where the fetch fails, the page is empty, or the cited URL or the printed one is behind a login or on an internal host, the sentence is `not fetched: <why>`. Send only the URL. Don't read the page's text yourself: the reviewer does.
|
||||
- **Fetch.** Run `curl --fail --location --max-redirs 5 --max-time 30 --output <page> --proto '=https' --proto-redir '=https' --show-error --silent --write-out '%{url_effective}' <URL>`, `<page>` a temporary file. It prints where the redirects ended. Where a page builds its text with scripts, so that curl would save only its scripts, fetch it as the setup's `CLAUDE.md` → "Web research" says, in place of curl. Where the fetch fails, the page is empty, or the cited URL or the printed one is behind a login or on an internal host, the sentence is `not fetched: <why>`. Send only the URL. Don't read the page's text yourself: the reviewer does.
|
||||
- **Hand over.** Write each sentence into `source-pages-round-<n>.md` in the chunk's review folder, `<n>` the round's number: its file and line, the URL, and the page's text, appended from its temporary file, or `not fetched: <why>`. Delete each temporary page. Add `Source pages: <that path>` to the Prose reviewer's prompt. With no such sentence, write no file and add no line.
|
||||
|
||||
**Precedent, then ask** — for the full scan:
|
||||
@@ -94,7 +94,7 @@ Give a reviewer without Bash `git ls-files`'s output in its prompt, since some h
|
||||
|
||||
**Opt-out** — for the architect, the product-owner pass and the comprehension check:
|
||||
|
||||
- **Entry.** A project opts out only through a `docs/decisions.md` entry, held before the chunk began, whose title opens `review opt-out:` and names one or more of the three. The entry names the project goal that skipping them serves. A project that opts out of the comprehension check voids code health in its goals file, as `~/.claude/CLAUDE.md` → "Shared goal" says; `rank_todo.py` refuses its plan until it does.
|
||||
- **Entry.** A project opts out only through a `docs/decisions.md` entry, held before the chunk began, whose title opens `review opt-out:` and names one or more of the three. The entry names the project goal that skipping them serves. A project that opts out of the comprehension check voids code health in its goals file, as the setup's `CLAUDE.md` → "Shared goal" says; `rank_todo.py` refuses its plan until it does.
|
||||
- **Skip.** Every chunk skips each reviewer the entry names, even where its trigger, a 🔀 or a due scoring run calls for it, and the chunk's summary cites the entry. Unlike a suspension, an opt-out needs no plan item to end it.
|
||||
- **Malformed.** A title naming another reviewer, or an entry naming no goal, is a finding of the pass the chunk runs, and the chunk runs every pass its trigger fires.
|
||||
|
||||
@@ -102,9 +102,9 @@ Give a reviewer without Bash `git ls-files`'s output in its prompt, since some h
|
||||
|
||||
- **Round.** A round is one review by a pass's reviewer: the first and each re-entry. The rerun after the architect returns Stage 0 questions ("Architecture" below) and a relaunch one rung up ("Rung up" below) stay in their round.
|
||||
- **Auto-reviewer.** The external auto-reviewer (§4) is a pass of its own, each review it posts, up to the cap, a round. Its count is the number of its reviews on the PR, less its reviews of a `Record the comprehension check:` commit, and `round-count` doesn't list it. A commit that answers one of its rounds takes an ordinary title, not an `Answer <pass> round` one, and a round that didn't change anything gets no commit.
|
||||
- **Count.** Close each round of a pass other than the auto-reviewer with one commit that holds the round's fixes. Title it `Answer <pass> round <n>: <k> 🔴, <m> 🟡 (<j> misread); …`: `<pass>` is the pass's name in lower case, such as `full scan`, `<k>` and `<m>` are the 🔴 and 🟡 findings all the round's reviewers reported, and `<j>` is how many of those they marked `[misread]` (review-findings.md → "Misread"); a reviewer that marks none, such as `/security-review`, adds 0. Example: `Answer stability round 1: 1 🔴, 2 🟡 (1 misread); flag a deleted test`. For a pass an agent under `~/.claude/agents/` reviews, run `larv-review round-title <pass>` and write only the summary after what it prints: the title up to and including its `;`, counted from the round's report. Where it exits 1 for want of a report it can count, count the findings by hand, and the hook lets the title through. rule-hook's `round-title-counts` refuses a title whose counts differ from that report's. A round that didn't change anything gets an empty commit (`git commit --allow-empty`). Push the commits when §4 runs next, where there is a remote. `larv-review round-count` prints each pass's count and marks a pass at the cap.
|
||||
- **Count.** Close each round of a pass other than the auto-reviewer with one commit that holds the round's fixes. Title it `Answer <pass> round <n>: <k> 🔴, <m> 🟡 (<j> misread); …`: `<pass>` is the pass's name in lower case, such as `full scan`, `<k>` and `<m>` are the 🔴 and 🟡 findings all the round's reviewers reported, and `<j>` is how many of those they marked `[misread]` (review-findings.md → "Misread"); a reviewer that marks none, such as `/security-review`, adds 0. Example: `Answer stability round 1: 1 🔴, 2 🟡 (1 misread); flag a deleted test`. For a pass an agent under the setup's `agents/` reviews, run `larv-review round-title <pass>` and write only the summary after what it prints: the title up to and including its `;`, counted from the round's report. Where it exits 1 for want of a report it can count, count the findings by hand, and the hook lets the title through. rule-hook's `round-title-counts` refuses a title whose counts differ from that report's. A round that didn't change anything gets an empty commit (`git commit --allow-empty`). Push the commits when §4 runs next, where there is a remote. `larv-review round-count` prints each pass's count and marks a pass at the cap.
|
||||
- **Done.** A pass is done when its latest round leaves no 🔴 or 🟡 standing: none was reported, or each was shown factually wrong, declined, filed, or named under the bar per "Findings", or settled in the PR summary per "Comprehension check" → "Places", or, for the prose pass and a pass at its cap, fixed. A stability pass whose round's fixes skip the next round per "Re-entry" → "Mechanical answers" is done once that rule's run is clean. Resolve that round's 🟢s and ❓s per "Findings" too.
|
||||
- **Cap.** A pass takes at most two rounds per chunk, and the release review's architecture and principles passes five; don't ask the user for more. Answer its last round's findings per "Findings": those fixes merge once the gate passes, unreviewed by that pass. rule-hook's `round-cap` refuses a round commit that would take a pass past its cap, and no override waives it. A review the auto-reviewer posts after its second isn't a round: fix none of it and rerun no pass for it, but file a security finding it raises per `~/.claude/CLAUDE.md` → "Working loop", and any other 🔴 in `todo.md`.
|
||||
- **Cap.** A pass takes at most two rounds per chunk, and the release review's architecture and principles passes five; don't ask the user for more. Answer its last round's findings per "Findings": those fixes merge once the gate passes, unreviewed by that pass. rule-hook's `round-cap` refuses a round commit that would take a pass past its cap, and no override waives it. A review the auto-reviewer posts after its second isn't a round: fix none of it and rerun no pass for it, but file a security finding it raises per the setup's `CLAUDE.md` → "Working loop", and any other 🔴 in `todo.md`.
|
||||
|
||||
**Re-entry.** A fix is a change no pass has seen. It reruns the pass of every row below that it fits in both columns:
|
||||
|
||||
@@ -138,22 +138,22 @@ A round's fixes re-enter together: run every pass the table names for any of the
|
||||
|
||||
**Mechanical answers.** A stability round's fixes may skip the next stability round. That holds where the round reported a 🔴, and each of its 🔴 and 🟡 findings asked only that a named mutant be killed or a named failing test pass. Run §2's tests and mutation command on the fixes, and fix again per §2 until they leave no failing test and no surviving mutant that changes behaviour. Each named failing test must pass as the round found it, not edited or deleted. Then the stability pass doesn't run again, and the round's answer commit title ends `; tests and mutants clean at <commit>`. The fixes still rerun each other pass whose row they meet. Where the run can't be made clean, or a fix edits a named failing test, the stability pass runs again as the table says.
|
||||
|
||||
**What a round reviews.** An agent under `~/.claude/agents/` reviews the branch in round 1. From round 2 it reviews only the answers to its last round's findings, and each fix from another pass that re-entered its pass. Prompt it with the path of its last round's report and each finding's answer: the fix's diff, or the reason it was dismissed. Give it each other pass's fix as `git diff <the commit before that fix> <the fix's commit>`, since the fixes may be unpushed, with the finding it answered. It reports only an answer that is plainly wrong or worse than the change it answered, so its pass converges in its second round. Other reviewers review the branch as their tool does.
|
||||
**What a round reviews.** An agent under the setup's `agents/` reviews the branch in round 1. From round 2 it reviews only the answers to its last round's findings, and each fix from another pass that re-entered its pass. Prompt it with the path of its last round's report and each finding's answer: the fix's diff, or the reason it was dismissed. Give it each other pass's fix as `git diff <the commit before that fix> <the fix's commit>`, since the fixes may be unpushed, with the finding it answered. It reports only an answer that is plainly wrong or worse than the change it answered, so its pass converges in its second round. Other reviewers review the branch as their tool does.
|
||||
|
||||
**Rung up.** A reviewer rules the work below standard when its report holds systems-architect's BLOCK or a finding against the review standards' `quality.md`. A comprehension seat does when `record-ruling` counts one of its votes as worse.
|
||||
|
||||
- **Ask.** Such a reviewer or seat may end its report asking for a rerun one rung up. Relaunch it only on the rung build-release's prompt names for it; where the prompt names none, the report stands.
|
||||
- **Relaunch.** Relaunch a reviewer on that rung with the same prompt, except for its header, made with `--rerun` per "Reports"; its report stands in place of the report that asked, in the same round. Relaunch a seat with the same prompt alone; its line replaces the one that asked in the votes file, before `record-ruling` runs. A relaunch cannot ask again.
|
||||
- **Escalate.** A below-standard ruling in the report that stands is escalation trigger 4 in `~/.claude/CLAUDE.md` → "Working with the codebase", unless the fix changes only prose: the worker then fixes it on its own rung.
|
||||
- **Escalate.** A below-standard ruling in the report that stands is escalation trigger 4 in the setup's `CLAUDE.md` → "Working with the codebase", unless the fix changes only prose: the worker then fixes it on its own rung.
|
||||
|
||||
**Findings.** A reviewer rates each finding 🔴 must fix, 🟡 should fix, 🟢 nit, ❓ question, or 🔀 escalation naming the reviewer whose concern it is.
|
||||
|
||||
- **Outside the chunk.** A finding outside the chunk's change, whatever its pass or severity, is scored and filed in `todo.md` per `~/.claude/rules/todo-items.md`. A 🔴 is marked `defect`. A 🟡 against a file in the config's principles folder is marked `principle`, its detail naming the principle, where no other reason fits. One under the bar and not exempt is named in the summary with its score. A verified security HIGH is handled per "Security". In the release review the whole project is the chunk's change, so nothing lies outside it; "Release review" → "Findings" says which of its findings are filed.
|
||||
- **Outside the chunk.** A finding outside the chunk's change, whatever its pass or severity, is scored and filed in `todo.md` per the setup's `rules/todo-items.md`. A 🔴 is marked `defect`. A 🟡 against a file in the config's principles folder is marked `principle`, its detail naming the principle, where no other reason fits. One under the bar and not exempt is named in the summary with its score. A verified security HIGH is handled per "Security". In the release review the whole project is the chunk's change, so nothing lies outside it; "Release review" → "Findings" says which of its findings are filed.
|
||||
- **Under build-epic.** A chunk build-epic runs files a finding about one of the epic's goals in the epic, as its prompt says, in place of `todo.md`. Where unsure whether a finding is about the epic's goals or a repo's, ask the human.
|
||||
- **Goal or decision.** A fix that would change a goal, or a `docs/decisions.md` entry the repo held before the chunk began, is asked; no user reachable → filed, marked `question`, the goal or decision left as is.
|
||||
- **New decision.** Each decision a fix or an answer records in `docs/decisions.md` is checked against the project principles per `~/.claude/rules/decisions.md` → "Decisions: one home, each linked to a goal or a technical principle", "Check each new decision against the project's principles", before the commit that records it.
|
||||
- **New decision.** Each decision a fix or an answer records in `docs/decisions.md` is checked against the project principles per the setup's `rules/decisions.md` → "Decisions: one home, each linked to a goal or a technical principle", "Check each new decision against the project's principles", before the commit that records it.
|
||||
- **🔴.** A 🔴 is fixed, or shown factually wrong, and what disproved it recorded per the review standards' `comments.md` → "Where a choice goes": in a comment at the code the finding concerns, or in `docs/decisions.md` when it concerns more than one place. Never declined.
|
||||
- **🟡.** A 🟡 is fixed, shown factually wrong like a 🔴, or declined. Decline one only where the reason is sound, consistent with the goals and the technical principles, and confidence is very high; the decline and its reason are recorded the same way. A reason neither speaks to is a gap in the goals: fix the finding, or ask per `~/.claude/CLAUDE.md` → "Working loop", "Ask, don't guess"; no user reachable → fix. Never drop one silently, and never decline one for convenience or the size of the fix.
|
||||
- **🟡.** A 🟡 is fixed, shown factually wrong like a 🔴, or declined. Decline one only where the reason is sound, consistent with the goals and the technical principles, and confidence is very high; the decline and its reason are recorded the same way. A reason neither speaks to is a gap in the goals: fix the finding, or ask per the setup's `CLAUDE.md` → "Working loop", "Ask, don't guess"; no user reachable → fix. Never drop one silently, and never decline one for convenience or the size of the fix.
|
||||
- **🟢 and ❓.** A 🟢 or ❓ is fixed, answered, declined in the summary with its reason, or filed. Answer one where the code, a test, a goal or a decision the repo held before the chunk began settles it, and quote what in the summary. A ❓ only the user can answer is asked; no user reachable → filed, marked `question`.
|
||||
- **🔀.** A 🔀 runs the named reviewer's pass once the current pass is done.
|
||||
- **Other scales.** Other reviewers map onto this scale: `/security-review`'s HIGH is 🔴, MEDIUM 🟡, LOW 🟢; what a forge's auto-reviewer marks blocking is 🔴. A finding of theirs repeating one declined or filed does not stand.
|
||||
@@ -172,7 +172,7 @@ The release review is a release's last chunk, run once the release holds no item
|
||||
3. Add bench features until the reference patch of at least one changes the code at each code place `larv-review places` prints.
|
||||
|
||||
The review's summary lists each bench feature it rewrote, deleted and added. File nothing in `todo.md` for one.
|
||||
- **Findings.** The passes fix their findings in the release they review, within their five rounds, so the release holds no drift the review found. They file only three kinds in `todo.md`, each under that release, or under the earliest release `~/.claude/rules/todo-items.md` allows where that release's bump forbids it: a finding whose fix needs a human answer, marked `question`; one whose fix adds a feature; and one whose fix the five rounds cannot finish. The release isn't ready to cut while one is open.
|
||||
- **Findings.** The passes fix their findings in the release they review, within their five rounds, so the release holds no drift the review found. They file only three kinds in `todo.md`, each under that release, or under the earliest release the setup's `rules/todo-items.md` allows where that release's bump forbids it: a finding whose fix needs a human answer, marked `question`; one whose fix adds a feature; and one whose fix the five rounds cannot finish. The release isn't ready to cut while one is open.
|
||||
- **Comprehension check.** It runs its paired ruling here, per "Comprehension check".
|
||||
|
||||
### Architecture
|
||||
@@ -184,11 +184,11 @@ Launch systems-architect: review the whole project as the release leaves it; the
|
||||
|
||||
### Principles
|
||||
|
||||
Launch one principles-auditor on the trigger in §3, so the project is read once per round. Hand it the goals file's goals, from the header's `Goals and audience:` line, and code health (`~/.claude/CLAUDE.md` → "Shared goal") unless that file voids it, and each file in the config's principles folder (`project-config principles` prints it) whose `Applies to` line the project meets, judged from the README, `git ls-files` and the branch diff. A file without the line applies to every project. Unsure → hand it the file. Hand it each file the header's `Coding conventions:` line names too.
|
||||
Launch one principles-auditor on the trigger in §3, so the project is read once per round. Hand it the goals file's goals, from the header's `Goals and audience:` line, and code health (the setup's `CLAUDE.md` → "Shared goal") unless that file voids it, and each file in the config's principles folder (`project-config principles` prints it) whose `Applies to` line the project meets, judged from the README, `git ls-files` and the branch diff. A file without the line applies to every project. Unsure → hand it the file. Hand it each file the header's `Coding conventions:` line names too.
|
||||
|
||||
### Comprehension check
|
||||
|
||||
The comprehension check records how hard the project is for its contributor to read (`~/.claude/rules/goals-and-audience.md`), and no score blocks a merge; only a run the plan calls and the branch lacks does, per "Scoring run". Simulated readers, the seats, launched per `~/.claude/skills/comprehension-panel/SKILL.md` as the `comprehension-seat` agent, each read the whole project, not the diff. It reports no findings and is no pass: it runs in §5, after every pass is done, the auto-reviewer included, so it reads the branch as review left it. It runs a paired ruling in the release review, even where an opt-out skips its architect, and a scoring run where one is due. It skips only as "Opt-out" or "Suspended" below says.
|
||||
The comprehension check records how hard the project is for its contributor to read (the setup's `rules/goals-and-audience.md`), and no score blocks a merge; only a run the plan calls and the branch lacks does, per "Scoring run". Simulated readers, the seats, launched per the setup's `skills/comprehension-panel/SKILL.md` as the `comprehension-seat` agent, each read the whole project, not the diff. It reports no findings and is no pass: it runs in §5, after every pass is done, the auto-reviewer included, so it reads the branch as review left it. It runs a paired ruling in the release review, even where an opt-out skips its architect, and a scoring run where one is due. It skips only as "Opt-out" or "Suspended" below says.
|
||||
|
||||
**Paired ruling.** Each seat votes whether the project reads better, the same or worse at this branch's head than at the base.
|
||||
|
||||
@@ -199,7 +199,7 @@ The comprehension check records how hard the project is for its contributor to r
|
||||
**Scoring run**, when `larv-review needs-scoring-run <the IDs of the items the chunk ships, if any>` prints `Scoring run due:`. `chunk-pr merge` refuses until the branch's committed history records every run the plan calls, which `larv-review scoring-run-owed` counts at merge time from the merge base; an earlier due line is only a snapshot.
|
||||
|
||||
- **Seats.** Junior A, Mid A, the maintainability senior and the inherited architect each score the project at the head from 1 to 10 overall and on four dimensions: Navigation, Locality, Shape and Self-sufficiency. Run `larv-review prepare-scoring`. It makes the worktree the seats read and prints each seat's prompt file; launch each seat with its file's text as its prompt. Write their lines into a scores file and run `larv-review record-scoring <scores file> <the same item IDs>`, which appends the run to the history and prints the four seats' means.
|
||||
- **Floor item.** Where `record-scoring` prints `Floor:`, a `Next:` line follows: file one floor item, or refresh the open one. A floor item is a plan item meant to bring every mean to the project's readability floor, which `record-scoring`'s `Floor:` line names. File it as one ambitious refactor, not touch-ups. It restructures the area behind the places `larv-review places` prints for this run, chosen where they bear on the lowest dimension, sized to bring every mean to that floor, and quotes those places. Its tagline opens with `Reach the comprehension floor:`, so its own chunk runs a scoring run; while a mean stays under the floor, that run's `Next:` line asks for the next floor item. Mark it `owner`, since the human asked that such a project always hold one, so no score deletes it. Put it in the earliest release the plan names after the one the chunk ships into, or else in the next version after that one that `~/.claude/rules/todo-items.md` allows, so the floor doesn't hold up any release. While one is open, refresh its places and aim from the newest run instead of filing another; the item the chunk ships doesn't count as open. Commit it with the run, as "Record" says.
|
||||
- **Floor item.** Where `record-scoring` prints `Floor:`, a `Next:` line follows: file one floor item, or refresh the open one. A floor item is a plan item meant to bring every mean to the project's readability floor, which `record-scoring`'s `Floor:` line names. File it as one ambitious refactor, not touch-ups. It restructures the area behind the places `larv-review places` prints for this run, chosen where they bear on the lowest dimension, sized to bring every mean to that floor, and quotes those places. Its tagline opens with `Reach the comprehension floor:`, so its own chunk runs a scoring run; while a mean stays under the floor, that run's `Next:` line asks for the next floor item. Mark it `owner`, since the human asked that such a project always hold one, so no score deletes it. Put it in the earliest release the plan names after the one the chunk ships into, or else in the next version after that one that the setup's `rules/todo-items.md` allows, so the floor doesn't hold up any release. While one is open, refresh its places and aim from the newest run instead of filing another; the item the chunk ships doesn't count as open. Commit it with the run, as "Record" says.
|
||||
- **Second run.** Where `needs-scoring-run` printed that the chunk `leaves release … with no plan item`, run `prepare-scoring` again and launch the same four seats afresh on the same head. Their scores file's first line is `<PR or branch> rerun at <commit>`. Record it with the same `record-scoring` command.
|
||||
- **Bench.** Where the project's README documents a `task-bench` command, start that command with `--record-figures` when the seats launch, on the same head, in the background under `run-heavy`. A bench that finishes appends its figures to the history. Wait for the bench before the commit "Record" below asks for, though it takes hours, and put the `All` `change` row it prints in the summary. A second run takes no second bench. The bench is a report beside the panel's scores: none of its figures blocks a merge or files an item, so don't run `task-bench gather` on it. Where it fails, say why in the summary and merge without it.
|
||||
- **Agreement.** After the second run, run `larv-review agreement` and put its counts in the summary. On `Assumption fails:`, ask the user whether to keep the paired ruling or change the decision `review: the comprehension check records …`. Record the answer as a decision in the repo whose history was counted, with the counts that led to the ask. A later run asks again only when the rulings' rate falls, or the runs' rate rises, against the recorded counts.
|
||||
@@ -241,7 +241,7 @@ Launch prose-reviewer with what the diff touched and every section this review c
|
||||
3. The forge's checks: `chunk-pr merge` waits for them to pass (§5 step 4). A red check is a finding.
|
||||
4. No CI configured → the gate is local tests only; note it in the summary.
|
||||
5. The local tests green → where §2 left the pull request unopened, open it with `chunk-pr open '<final title>' '<summary>'` and mark it ready at once with `chunk-pr ready`. Otherwise mark the PR ready with `chunk-pr ready '<final title>'`, which sets the title as it marks the PR ready.
|
||||
6. **External auto-reviewer**, when the repo has one — its config file (`.coderabbit.yaml` and the like), or its comments on earlier PRs; none → skip it, say so. Marking the PR ready summons it, unless it reviewed the draft already. On a pull request into an epic's working branch (`chunk-pr --help`), a reviewer that reviews only pull requests into the default branch is summoned by the project's `review-request-comment`, which `chunk-pr ready` posts: push each later commit there with `chunk-pr push`, which posts that comment again. Wait up to **10 minutes** for its first review, checking about once a minute; nothing by then → note it in the summary and carry on, never waiting twice. Its rounds, §3 → "Round cap". Once it has reviewed, each later return here before its cap, after a fix re-entered per §3, waits up to **5 minutes** for its re-review of the new commit. Each of its findings, fixed or declined, ends with the setup change that `~/.claude/CLAUDE.md` → "Working loop", "Change the setup for each finding an outside reviewer raises on a PR, deterministic tools first" asks for.
|
||||
6. **External auto-reviewer**, when the repo has one — its config file (`.coderabbit.yaml` and the like), or its comments on earlier PRs; none → skip it, say so. Marking the PR ready summons it, unless it reviewed the draft already. On a pull request into an epic's working branch (`chunk-pr --help`), a reviewer that reviews only pull requests into the default branch is summoned by the project's `review-request-comment`, which `chunk-pr ready` posts: push each later commit there with `chunk-pr push`, which posts that comment again. Wait up to **10 minutes** for its first review, checking about once a minute; nothing by then → note it in the summary and carry on, never waiting twice. Its rounds, §3 → "Round cap". Once it has reviewed, each later return here before its cap, after a fix re-entered per §3, waits up to **5 minutes** for its re-review of the new commit. Each of its findings, fixed or declined, ends with the setup change that the setup's `CLAUDE.md` → "Working loop", "Change the setup for each finding an outside reviewer raises on a PR, deterministic tools first" asks for.
|
||||
|
||||
## 5. Goal alignment, then merge
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Review findings
|
||||
|
||||
Words: `~/.claude/CLAUDE.md` → "Vocabulary".
|
||||
Words: the setup's `CLAUDE.md` → "Vocabulary".
|
||||
|
||||
A reviewer reads and reports; it doesn't edit anything. It writes no file but its report, except the scratch files that a reviewer holding Bash makes with Bash. Read `docs/decisions.md` first and the plan, which your prompt's `Plan:` line names: a finding declined or disproved in `docs/decisions.md` or in a comment at the code it concerns, or filed in the plan, is not raised again, unless the decline works against a goal or a technical principle and names no plan item ending it.
|
||||
|
||||
@@ -18,7 +18,7 @@ Where your prompt has a `Coding conventions:` line, read each file it names besi
|
||||
|
||||
## Misread
|
||||
|
||||
Mark a 🔴 or 🟡 `[misread]`, right after its severity mark, where it arose because the implementer misread code that shipped before this change: a wrong belief about what that code does, what a name means or what a contract promises. Don't mark a finding about a defect in the change's own new code. `score-outcomes` counts the marked findings per chunk, as code health's counter-signal (`~/.claude/CLAUDE.md` → "Shared goal").
|
||||
Mark a 🔴 or 🟡 `[misread]`, right after its severity mark, where it arose because the implementer misread code that shipped before this change: a wrong belief about what that code does, what a name means or what a contract promises. Don't mark a finding about a defect in the change's own new code. `score-outcomes` counts the marked findings per chunk, as code health's counter-signal (the setup's `CLAUDE.md` → "Shared goal").
|
||||
|
||||
## Verdict
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Prose
|
||||
|
||||
The full rules; `~/.claude/CLAUDE.md` → "Prose" keeps a core of them for the worker.
|
||||
The full rules; the setup's `CLAUDE.md` → "Prose" keeps a core of them for the worker.
|
||||
|
||||
Everything written — chat, commit messages, comments, docs, code — is in **English**. Where a project's config names another `language`, which `project-config language` prints, the prose that project's readers see is in that language instead: its docs, comments, commit messages, pull requests and tracker text. These stay English: chat, names in code, a reviewer's report, and what a tool reads, which is the fixed words of a title, such as `Answer <pass> round <n>:`, `todo.md`'s table, and a record's headings, such as `## Unreleased`. Prose meets four priorities, in this order. When two pull against each other, the higher one wins.
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| 581 | 0.18.0 | | | **Name each file of the setup, in everything a model or a person reads, by a path that holds wherever the clone lies, never by `~/.claude`.** | 3 | 2 | 3 | 6 | 6 | 2 by 8 | 0.8 |
|
||||
| 486 | 0.18.0 | | owner | **Open an interactive claude with the setup loaded through one wrapper command, which sets the generated home and `PATH` and passes every argument on to claude.** | 2 | 1 | 1 | 2 | 3 | 2 by 2 | 0.5 |
|
||||
| 581 | 0.18.0 | | | **Name each file of the setup, in everything a model or a person reads, by a path that holds wherever the clone lies, never by `~/.claude`.** | 4 | 2 | 3 | 7 | 7 | 2 by 8 | 0.5 |
|
||||
| 577 | 0.18.0 | 486, 581 | owner | **Test in the gate that a container holding only a stock Claude Code runs a chunk from a clone, against a mock Messages API, and that the run leaves the container's own `~/.claude` as it was.** | 3 | 1 | 2 | 4 | 6 | 3 by 9, 2 by 5 | 5.2 |
|
||||
| 583 | 0.18.0 | | | **Ignore only what the repo generates, in place of the allowlist that kept a Claude home's files out of the clone.** | 1 | 1 | 2 | 2 | 1 | code health by 2 | 2.9 |
|
||||
| 576 | 0.18.0 | | owner | **Name the project `dev-factory` in the README, the prose and the tools, and say in the changelog that the repo moved.** | 2 | 2 | 2 | 4 | 4 | 2 by 1, 6 by 1 | 0.4 |
|
||||
@@ -106,6 +106,21 @@
|
||||
|
||||
## Details
|
||||
|
||||
### 486. Open an interactive claude with the setup loaded through one wrapper command, which sets the generated home and `PATH` and passes every argument on to claude.
|
||||
|
||||
Part of the standalone-install plan lilleman approved on 2026-11-20, as reshaped on 2026-12-03 when 0.18.0 was planned. Once the loop has its own home, the person's own claude no longer loads this setup or its rule-hook; this command is how they opt in, for a manual `/larv-review` or a planning talk. `--resume`, `-p` and `--model` work as with plain claude, and permissions come from the setup's `settings.json`. A panel seated as the audience picks its spelling; `build-release claude` was the proposal. Say in the README that only the loop's sessions and this command get rule-hook's guards.
|
||||
|
||||
Where the wrapper lives is not predictable: a panel picks its spelling, and `build-release claude` would be a subcommand of the loop's command, whose package item 485 renames first. So the list names the loop's files as they are today and leaves out a new launcher.
|
||||
|
||||
Touches:
|
||||
|
||||
- `bin/build_release/loop/main.py`: `run_loop` (small)
|
||||
- `bin/build_release/loop/usage.py`: `HELP` (small)
|
||||
- `bin/build_release/loop/test_main.py`
|
||||
- `bin/loop_effects/effects.py`: `claude_on_terminal` (small)
|
||||
- `.gitignore`
|
||||
- `README.md`: `## Install` (small), `## Tools` (small)
|
||||
|
||||
### 581. Name each file of the setup, in everything a model or a person reads, by a path that holds wherever the clone lies, never by `~/.claude`.
|
||||
|
||||
Found while shipping the loop's generated Claude home. The loop's claudes now run in `~/.local/share/build-release/claude-home`, and the clone lies anywhere but `~/.claude`. What they read still sends them to the person's own home: `CLAUDE.md`, the files under `rules/`, `agents/`, `skills/` and `principles/` name `~/.claude/rules/…`, `~/.claude/skills/…`, `~/.claude/agents/` and `~/.claude/bin/<tool>`, about 14 files. So a worker in a clone elsewhere is told to read files that don't exist, and one whose `~/.claude` still holds an old checkout reads a stale release, which breaks goal 3. The same holds for:
|
||||
@@ -144,21 +159,6 @@ Touches:
|
||||
|
||||
Which other tools' help names `~/.claude/bin/` is not predictable, so the list leaves those files out.
|
||||
|
||||
### 486. Open an interactive claude with the setup loaded through one wrapper command, which sets the generated home and `PATH` and passes every argument on to claude.
|
||||
|
||||
Part of the standalone-install plan lilleman approved on 2026-11-20, as reshaped on 2026-12-03 when 0.18.0 was planned. Once the loop has its own home, the person's own claude no longer loads this setup or its rule-hook; this command is how they opt in, for a manual `/larv-review` or a planning talk. `--resume`, `-p` and `--model` work as with plain claude, and permissions come from the setup's `settings.json`. A panel seated as the audience picks its spelling; `build-release claude` was the proposal. Say in the README that only the loop's sessions and this command get rule-hook's guards.
|
||||
|
||||
Where the wrapper lives is not predictable: a panel picks its spelling, and `build-release claude` would be a subcommand of the loop's command, whose package item 485 renames first. So the list names the loop's files as they are today and leaves out a new launcher.
|
||||
|
||||
Touches:
|
||||
|
||||
- `bin/build_release/loop/main.py`: `run_loop` (small)
|
||||
- `bin/build_release/loop/usage.py`: `HELP` (small)
|
||||
- `bin/build_release/loop/test_main.py`
|
||||
- `bin/loop_effects/effects.py`: `claude_on_terminal` (small)
|
||||
- `.gitignore`
|
||||
- `README.md`: `## Install` (small), `## Tools` (small)
|
||||
|
||||
### 577. Test in the gate that a container holding only a stock Claude Code runs a chunk from a clone, against a mock Messages API, and that the run leaves the container's own `~/.claude` as it was.
|
||||
|
||||
Part of the standalone-install plan lilleman approved on 2026-11-20, as reshaped on 2026-12-03 when 0.18.0 was planned. Split from item 494, which keeps the newcomer's README. The probes behind the decision "Claude Code in a home of its own" already ran a mock Messages API at `ANTHROPIC_BASE_URL`. The test fails where goal 3 breaks: it compares `~/.claude` before and after the run. Give the container a memory and a swap limit, and run it under `run-heavy`.
|
||||
|
||||
Reference in New Issue
Block a user