Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eb354ab3ea | |||
| b36132c0ce | |||
| c3d3cc91f7 | |||
| 81f26860e7 | |||
| 5070d8960c | |||
| 9077066caf | |||
| c82471d9b6 | |||
| bebeff95ab | |||
| 8739256d8f | |||
| 022fafa13b | |||
| a2738657be | |||
| 7a549ed928 | |||
| adb99dbb2d | |||
| 3b7fa9b6dd | |||
| c567042d95 | |||
| 018d45aa6e | |||
| 1940722b16 | |||
| 8131638be1 | |||
| 0035c9d1dc | |||
| 2a454d7187 | |||
| ecbbe98823 | |||
| 66705ca616 | |||
| 29ce6bb11a | |||
| 59b633b67d | |||
| 3a287c90a9 | |||
| 308e2fc518 | |||
| c8c6dc1eb9 | |||
| 33fcca6a2e | |||
| bd93c29295 | |||
| d372b4aae1 | |||
| 99a1011de5 | |||
| 67daa379e7 | |||
| f86ae5fd46 | |||
| 165d97cdfc | |||
| c921802ec1 | |||
| 605f0046df | |||
| 177a0b23b8 | |||
| 7cc2b23447 | |||
| 0cd46f95aa | |||
| f70dd74835 | |||
| 97c73236af | |||
| 0b3f6d3b2d | |||
| ba4cc2c90f | |||
| eb2dd96cd8 | |||
| 9617b45407 | |||
| 0eb726939c | |||
| d8031dea99 | |||
| 1e5f7f931f | |||
| 6433920a49 | |||
| 5aa66798e3 | |||
| e3051c2f8d | |||
| da74f30453 | |||
| ef415dc258 | |||
| 18fae1956e | |||
| bfa2ccaca4 | |||
| 7d38116d9e | |||
| 54cbcd5391 | |||
| 59b0685346 | |||
| d483a1d8c2 | |||
| 980418abf8 | |||
| d478e5d476 | |||
| 2b5a6a63d8 | |||
| 1552b15fc6 | |||
| 0f60e30c37 | |||
| 99ef63cb07 | |||
| 6dd2787e7b | |||
| 82b933af00 | |||
| 97e862869f | |||
| 3ca72509f0 | |||
| 6828218dec | |||
| 76869883be | |||
| 028fd3e3ce | |||
| a375cb8515 | |||
| 3b990d8884 | |||
| 3fe6c64480 | |||
| eff57c1dfd | |||
| 9d2f5b9253 | |||
| cafa9dd61c | |||
| 0b8d5ac396 |
@@ -3,4 +3,4 @@
|
||||
`~/.claude` is a checkout of this repo, so an `AGENTS.md` here would load into every other project's sessions. Where a rule names a project's `AGENTS.md`, read it here as:
|
||||
|
||||
- the project principles, the title of each decision no project principle covers, and the working rules: the head of `docs/decisions.md`, before `# Decisions`;
|
||||
- the scoring-run values: `skills/comprehension-panel/seat-prompts.md` → "claude-config's values".
|
||||
- the scoring-run values: `skills/comprehension-panel/seat-prompts.md` → "dev-factory's values".
|
||||
|
||||
+10
-227
@@ -1,227 +1,10 @@
|
||||
# Allowlist: Claude Code writes credentials (.credentials.json), full session
|
||||
# transcripts (projects/, history.jsonl), memory files and shell env dumps
|
||||
# into this directory, and each release adds more. Ignore everything, then
|
||||
# un-ignore authored config only.
|
||||
*
|
||||
|
||||
!.gitignore
|
||||
!CHANGELOG.md
|
||||
!CLAUDE.md
|
||||
!LICENSE.md
|
||||
!README.md
|
||||
!ci.sh
|
||||
!settings.json
|
||||
!todo.md
|
||||
|
||||
!.claude/
|
||||
!.claude/rules/
|
||||
!.claude/rules/*.md
|
||||
!.claude/settings.json
|
||||
!.gitea/
|
||||
!.gitea/workflows/
|
||||
!.gitea/workflows/*.yml
|
||||
!agents/
|
||||
!agents/*.md
|
||||
!bin/
|
||||
!bin/adf_codec/
|
||||
!bin/adf_codec/*.py
|
||||
!bin/adf_codec/node_shim/
|
||||
!bin/adf_codec/node_shim/Dockerfile
|
||||
!bin/adf_codec/node_shim/package-lock.json
|
||||
!bin/adf_codec/node_shim/package.json
|
||||
!bin/adf_codec/node_shim/shim.mjs
|
||||
!bin/agent_cycle/
|
||||
!bin/agent_cycle/*.py
|
||||
!bin/atlassian/
|
||||
!bin/atlassian/*.py
|
||||
!bin/branch_chunks/
|
||||
!bin/branch_chunks/*.py
|
||||
!bin/build-epic
|
||||
!bin/build-epic-e2e
|
||||
!bin/build-release
|
||||
!bin/build_epic/
|
||||
!bin/build_epic/*.py
|
||||
!bin/build_epic/backend/
|
||||
!bin/build_epic/backend/*.py
|
||||
!bin/build_epic/e2e/
|
||||
!bin/build_epic/e2e/*.py
|
||||
!bin/build_release/
|
||||
!bin/build_release/**/
|
||||
!bin/build_release/**/*.py
|
||||
!bin/chunk-pr
|
||||
!bin/chunk-preflight
|
||||
!bin/chunk_driver/
|
||||
!bin/chunk_driver/*.py
|
||||
!bin/chunk_driver/project/
|
||||
!bin/chunk_driver/project/*.py
|
||||
!bin/chunk_pr/
|
||||
!bin/chunk_pr/*.py
|
||||
!bin/chunk_preflight/
|
||||
!bin/chunk_preflight/*.py
|
||||
!bin/claude_code/
|
||||
!bin/claude_code/*.py
|
||||
!bin/claude_home/
|
||||
!bin/claude_home/*.py
|
||||
!bin/command-patterns
|
||||
!bin/command_lines/
|
||||
!bin/command_lines/*.py
|
||||
!bin/command_patterns/
|
||||
!bin/command_patterns/*.py
|
||||
!bin/compress-archives
|
||||
!bin/compress_archives/
|
||||
!bin/compress_archives/*.py
|
||||
!bin/cut-release
|
||||
!bin/cut_release/
|
||||
!bin/cut_release/*.py
|
||||
!bin/failure.py
|
||||
!bin/forge/
|
||||
!bin/forge/*.py
|
||||
!bin/git_cli/
|
||||
!bin/git_cli/*.py
|
||||
!bin/judge-replay
|
||||
!bin/judge_replay/
|
||||
!bin/judge_replay/*.py
|
||||
!bin/larv-review
|
||||
!bin/larv_review/
|
||||
!bin/larv_review/*.py
|
||||
!bin/loop_effects/
|
||||
!bin/loop_effects/*.py
|
||||
!bin/loop_state/
|
||||
!bin/loop_state/*.py
|
||||
!bin/machine_load/
|
||||
!bin/machine_load/*.py
|
||||
!bin/markdown-section
|
||||
!bin/markdown_section/
|
||||
!bin/markdown_section/*.py
|
||||
!bin/metric-bench
|
||||
!bin/metric_bench/
|
||||
!bin/metric_bench/*.py
|
||||
!bin/model_routing/
|
||||
!bin/model_routing/*.py
|
||||
!bin/model_routing/routing-ladder.json
|
||||
!bin/mutate-changes
|
||||
!bin/mutate_changes/
|
||||
!bin/mutate_changes/*.py
|
||||
!bin/notifier/
|
||||
!bin/notifier/*.py
|
||||
!bin/notify
|
||||
!bin/plan/
|
||||
!bin/plan/*.py
|
||||
!bin/plan_store/
|
||||
!bin/plan_store/*.py
|
||||
!bin/project-config
|
||||
!bin/project-record
|
||||
!bin/project_config/
|
||||
!bin/project_config/*.py
|
||||
!bin/project_record/
|
||||
!bin/project_record/*.py
|
||||
!bin/rank_todo.py
|
||||
!bin/reading-cost
|
||||
!bin/reading_cost/
|
||||
!bin/reading_cost/*.py
|
||||
!bin/record_store/
|
||||
!bin/record_store/*.py
|
||||
!bin/release_plan/
|
||||
!bin/release_plan/*.py
|
||||
!bin/repo_checks/
|
||||
!bin/repo_checks/*.py
|
||||
!bin/rest_client/
|
||||
!bin/rest_client/*.py
|
||||
!bin/review-replay
|
||||
!bin/review_replay/
|
||||
!bin/review_replay/*.py
|
||||
!bin/review_rules/
|
||||
!bin/review_rules/*.py
|
||||
!bin/routing_figures/
|
||||
!bin/routing_figures/*.py
|
||||
!bin/rule-hook
|
||||
!bin/rule_hook/
|
||||
!bin/rule_hook/*.py
|
||||
!bin/run-heavy
|
||||
!bin/run-tests
|
||||
!bin/run_heavy/
|
||||
!bin/run_heavy/*.py
|
||||
!bin/run_heavy/path_entry/
|
||||
!bin/run_heavy/path_entry/docker
|
||||
!bin/run_tests/
|
||||
!bin/run_tests/*.py
|
||||
!bin/rung_replay/
|
||||
!bin/rung_replay/*.py
|
||||
!bin/score-outcomes
|
||||
!bin/score_outcomes/
|
||||
!bin/score_outcomes/*.py
|
||||
!bin/self-update
|
||||
!bin/self_update/
|
||||
!bin/self_update/*.py
|
||||
!bin/setup.cfg
|
||||
!bin/statusline.py
|
||||
!bin/subagent-rung
|
||||
!bin/subagent_rung/
|
||||
!bin/subagent_rung/*.py
|
||||
!bin/task-bench
|
||||
!bin/task_bench/
|
||||
!bin/task_bench/**/
|
||||
!bin/task_bench/**/*.py
|
||||
!bin/task_bench/figures/gather-prompt.md
|
||||
!bin/test_*.py
|
||||
!bin/text_files/
|
||||
!bin/text_files/*.py
|
||||
!bin/todo-item
|
||||
!bin/todo_item/
|
||||
!bin/todo_item/*.py
|
||||
!bin/touch-predictions
|
||||
!bin/touch_predictions/
|
||||
!bin/touch_predictions/*.py
|
||||
!bin/transcript_archive/
|
||||
!bin/transcript_archive/*.py
|
||||
!bin/wait-for
|
||||
!bin/wait_for/
|
||||
!bin/wait_for/*.py
|
||||
!docs/
|
||||
!docs/*.md
|
||||
!judge-field-trials/
|
||||
!judge-field-trials/*.py
|
||||
!judge-field-trials/README.md
|
||||
!presentation/
|
||||
!presentation/README.md
|
||||
!presentation/build-pdf.py
|
||||
!presentation/index.html
|
||||
!presentation/render-pdf.js
|
||||
!principles/
|
||||
!principles/*.md
|
||||
!reviewer-merge-trials/
|
||||
!reviewer-merge-trials/*-reviewer.md
|
||||
!reviewer-merge-trials/*.py
|
||||
!reviewer-merge-trials/README.md
|
||||
!reviewer-merge-trials/cases-*.json
|
||||
!rules/
|
||||
!rules/*.md
|
||||
!skills/
|
||||
!skills/comprehension-panel/
|
||||
!skills/comprehension-panel/*.md
|
||||
!skills/larv-review/
|
||||
!skills/larv-review/*.md
|
||||
!skills/larv-review/standards/
|
||||
!skills/larv-review/standards/*.md
|
||||
!stability-skip-count/
|
||||
!stability-skip-count/README.md
|
||||
!stability-skip-count/count.py
|
||||
!task-bench-image/
|
||||
!task-bench-image/Dockerfile
|
||||
!workflow-bench/
|
||||
!workflow-bench/advisor-judge-prompt.md
|
||||
!workflow-bench/advisor-run-prompt.md
|
||||
!workflow-bench/advisor_bench.py
|
||||
!workflow-bench/bench.py
|
||||
!workflow-bench/compare-prompt.md
|
||||
!workflow-bench/compare.py
|
||||
!workflow-bench/handoff-brief-prompt.md
|
||||
!workflow-bench/handoff-resume-prompt.md
|
||||
!workflow-bench/handoff_bench.py
|
||||
!workflow-bench/review_git.py
|
||||
!workflow-bench/run-prompt.md
|
||||
!workflow-bench/setup.cfg
|
||||
!workflow-bench/test_advisor_bench.py
|
||||
!workflow-bench/test_bench.py
|
||||
!workflow-bench/test_handoff_bench.py
|
||||
!workflow-bench/test_review_git.py
|
||||
# What the repo's own tools generate: the runs of workflow-bench and
|
||||
# reviewer-merge-trials, and the presentation's PDF.
|
||||
__pycache__/
|
||||
presentation/build-release-explained.pdf
|
||||
reviewer-merge-trials/agents-*.json
|
||||
reviewer-merge-trials/clones/
|
||||
reviewer-merge-trials/results/
|
||||
reviewer-merge-trials/runs.pkl
|
||||
workflow-bench/*-[0-9]*.md
|
||||
workflow-bench/*/
|
||||
|
||||
+7
-1
@@ -2,7 +2,13 @@
|
||||
|
||||
## 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`.
|
||||
- Split the README's opening paragraph into one sentence on what dev-factory is and a list of what each folder and file holds.
|
||||
- **The loop's Claude home keeps out your own `~/.claude/CLAUDE.md` and `~/.claude/rules/`, which Claude Code loaded in every project under your home folder.** The home's generated `settings.json` now names your `~/.claude` in `claudeMdExcludes`. build-release and build-epic refuse to run from a release cloned inside `~/.claude`, since that setting would drop the release's own rules: clone it elsewhere, as `README.md` → Install says. The gate now runs a first chunk as a newcomer would, in a container with a stock Claude Code and a mock Messages API (`first-chunk-e2e/run`), and fails where anything from that `~/.claude` reaches a request or the folder changes.
|
||||
- Added `claude-release`, which opens claude in the loop's Claude home with the setup loaded, in the folder you run it in, and passes every argument on to claude; `README.md` → Install says how it differs from the claude you start from your own `~/.claude`.
|
||||
- **The project and its repo are named `dev-factory`, in the README, the docs, the prose and the tools; the repo moved from `claude-config` on the forge.** Before you update, point each clone at the new URL, as `README.md` → Install clones it: `git remote set-url origin <URL>`. First finish the project's open chunks and stop its running `build-release`: neither the tmux session `loop-claude-config` nor a claude session named `A claude-config build-release <window>` is found under the new key. Then rename the setup's development clone from `~/code/claude-config` to `~/code/dev-factory`, where the tools expect it. A project's key is its clone's path relative to `~/code`, so the rename gives the project a new key. After it, set `checkout = "~/code/dev-factory"` in the project's `config.toml`, move its folder `~/.config/build-release/claude-config/` to `~/.config/build-release/dev-factory/`, move its folder under the transcripts root the same way (`~/.local/state/build-release/transcripts/`, unless `BUILD_RELEASE_TRANSCRIPTS` names another), and rename its entry in `~/.config/build-release/models.json`. The Docker image the README builds for `task-bench` is tagged `dev-factory-task-bench`, not `claude-config-task-bench`: build it again.
|
||||
- **The rules, agents, skills and each tool's text name a file of the setup as the setup's, as in the setup's `rules/todo-items.md`, and a project's config names one as `setup:<path>`, as in `standards = "setup:skills/larv-review/standards"`.** Both hold wherever the release is cloned; `CLAUDE.md` → "Vocabulary" defines the setup. The loop's Claude home links `bin/` and `principles/` too, and `task-bench gather` runs its claude in that home, where it exits 1 until someone is signed in.
|
||||
- `.gitignore` ignores only what the repo generates, in place of an allowlist that kept a Claude home's files out of the clone. A checkout in `~/.claude` that moves past 0.17.0 would list its credentials, transcripts and memory files as untracked: run `echo '*' >> .git/info/exclude` in it, or leave it on 0.17.0.
|
||||
- **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 `agents/`, `bin/`, `CLAUDE.md`, `principles/`, `rules/` 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: 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,17 +14,17 @@ 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.
|
||||
- **Implement the simplest change that solves the item, and ship it with `/larv-review`.** Whenever a test can check the change, write that test first and see it fail. Take its expected values from the item, never from the code. larv-review's reviewers hold the change to the technical principles, and a finding against one names it. Read a file in the principles folder the project's config sets (`project-config principles` prints it) only when the item changes it, a finding or a record you write names it, or you decline a finding.
|
||||
- **Change the setup for each finding an outside reviewer raises on a PR, deterministic tools first.** An outside reviewer is a forge's auto-reviewer or a human, not one of larv-review's reviewer agents. For each finding of theirs, whether you fix it or decline it, ask why our review didn't raise it first, and change the setup so it would; a fix that only answers the comment leaves the same gap open for the next chunk. Put the change in the first place that fits:
|
||||
1. A deterministic tool that would have caught it, such as a rule-hook rule, a gate check, a linter setting or `mutate-changes`: a tool catches the fault every time, and a reviewer only when it notices.
|
||||
2. A technical principle or a review standard, where a rule was missing or too vague: in claude-config's files, or in the project's own principles folder.
|
||||
2. A technical principle or a review standard, where a rule was missing or too vague: in dev-factory's files, or in the project's own principles folder.
|
||||
3. Anything else: the reviewers' agents, `larv-review`'s text, or the project's own settings or `AGENTS.md`. A client repo's `AGENTS.md` changes by a proposal of its own, per "A client project's `CLAUDE.md` and `AGENTS.md`" above.
|
||||
|
||||
Change claude-config's files where every project gains, and the project's own only where the gap is that project's alone. In claude-config, the change is a fix of the chunk. In another project, a change to the project's own files is a fix of the chunk too, and a change to claude-config's is an item in claude-config's plan: start a worktree of claude-config off `origin/main`, run `todo-item add` in it, commit the plan file, and ship it as a pull request of its own with `chunk-pr`, since claude-config's default branch may not take a direct push. Describe the gap without the client's name, code or comment text. File a change too big for the chunk as its own item. Where no setup gap caused the finding, as when the finding is wrong, say so in the chunk's summary rather than inventing a change.
|
||||
Change dev-factory's files where every project gains, and the project's own only where the gap is that project's alone. In dev-factory, the change is a fix of the chunk. In another project, a change to the project's own files is a fix of the chunk too, and a change to dev-factory's is an item in dev-factory's plan: start a worktree of dev-factory off `origin/main`, run `todo-item add` in it, commit the plan file, and ship it as a pull request of its own with `chunk-pr`, since dev-factory's default branch may not take a direct push. Describe the gap without the client's name, code or comment text. File a change too big for the chunk as its own item. Where no setup gap caused the finding, as when the finding is wrong, say so in the chunk's summary rather than inventing a change.
|
||||
- **Remove a finished item from the plan, and revise any decision that cites it.** If the repo publishes something others consume — a package, an image, an API — reword the item for them and move it to `CHANGELOG.md` under `## Unreleased`. A changelog is for the public, never for the next agent. Otherwise delete it; git history is the record. `todo-item finish <ID>` removes the item with its detail, and adds the bullet you pass with `--changelog <bullet>`; it refuses while a decision cites the item. A plan kept in Jira takes no bullet, since the issues' history is its changelog: `finish` there refuses `--changelog`. A chunk finishes its items as it merges, through `chunk-pr merge --finish <ID>`, which takes the same flags (`larv-review` §5).
|
||||
- **Releases are the human's.** The version bump and the publishing credentials are theirs, whatever another rule says. Prepare everything else, so cutting a release is one decision.
|
||||
- **Open each plan item or ticket with a bold one-sentence tagline**, so the taglines alone say what a release holds. The tagline states the target state, checkable when done: an imperative verb plus what holds afterwards. A present-tense fact reads as the current state and doesn't say anything about what to do. Add "today X" only where the direction is otherwise ambiguous. GOOD: `**Accept undefined in MetadataValue and drop such keys on output.**` BANNED: `MetadataValue accepts undefined; such keys are dropped on output`.
|
||||
@@ -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.
|
||||
|
||||
@@ -136,9 +136,9 @@ Claude Code reads this section by its heading when it compacts a conversation. K
|
||||
- **cycle** — in `build-release`, worker runs and the judge's verdict on each, until the chunk closes or is left for the next cycle. In between, the human answers any interrupt, or the worker resumes with an answer the judge quoted from the premises or the judge's records.
|
||||
- **gate** — the merge gate: the checks a PR passes before it merges.
|
||||
- **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.
|
||||
- **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/dev-factory`, 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** — the release of this repo that the machine runs, with every file in its clone. 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 `agents/`, `bin/`, `CLAUDE.md`, `principles/`, `rules/` and `skills/` of the clone that built it 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.
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
# Claude Code configuration
|
||||
# dev-factory
|
||||
|
||||
My setup for Claude Code, version controlled: `CLAUDE.md` and `rules/` for instructions, the words under `CLAUDE.md` → "Vocabulary"; `.claude/rules/` for the rules that load in this repo alone; `agents/` and `skills/`; `principles/` and `skills/larv-review/standards/` for what the reviewer agents hold projects to, which a project's config names as `principles` and `standards`; `docs/` for decisions and the comprehension history; `settings.json` for the harness and `.claude/settings.json` for the harness inside this repo; `CHANGELOG.md` and `todo.md`; the tools in `bin/`, with the routing ladder they ship, `bin/model_routing/routing-ladder.json`; `workflow-bench/`, the scripts and prompts of the 2026-09-30 bench of larv-review and of the 2026-11-12 bench of the advisor tool; `reviewer-merge-trials/`, the 2026-11-09 trials of merging reviewers, with their method, results and scripts; `judge-field-trials/`, the 2026-11-11 trials of which facts code could read in place of build-release's judge, with their results and scripts; `stability-skip-count/`, the 2026-11-12 count of archived stability rounds, with its script, from which larv-review took when to skip a stability round 2; and `presentation/`, a page that explains this setup to newcomers, with the script that prints it to PDF.
|
||||
dev-factory builds a project's plan into merged pull requests, with Claude Code as its harness today. This repo holds dev-factory's setup, version controlled:
|
||||
|
||||
- `CLAUDE.md` and `rules/` for instructions, with the words they use defined under `CLAUDE.md` → "Vocabulary"
|
||||
- `.claude/rules/` for the rules that load in this repo alone
|
||||
- `agents/` and `skills/`
|
||||
- `principles/` and `skills/larv-review/standards/` for what the reviewer agents hold projects to, which a project's config names as `principles` and `standards`
|
||||
- `docs/` for decisions and the comprehension history
|
||||
- `settings.json` for the harness and `.claude/settings.json` for the harness inside this repo
|
||||
- `CHANGELOG.md` and `todo.md`
|
||||
- `bin/` for the tools, with the routing ladder they ship, `bin/model_routing/routing-ladder.json`
|
||||
- `workflow-bench/`, the scripts and prompts of the 2026-09-30 bench of larv-review and of the 2026-11-12 bench of the advisor tool
|
||||
- `reviewer-merge-trials/`, the 2026-11-09 trials of merging reviewers, with their method, results and scripts
|
||||
- `judge-field-trials/`, the 2026-11-11 trials of which facts code could read itself instead of leaving them to build-release's judge, with their results and scripts
|
||||
- `stability-skip-count/`, the 2026-11-12 count of archived stability rounds, with its script, which larv-review used to decide when to skip a stability round 2
|
||||
- `presentation/`, the page of a talk that explained this setup to newcomers, as the setup stood at the talk, with the script that prints it to PDF
|
||||
|
||||
## Goals
|
||||
|
||||
@@ -52,25 +66,27 @@ Take this checkout only onto a machine that is a sandbox with no direct access t
|
||||
Each machine holds two clones. `~/build-release` holds only a release, and its tools are the ones you run: its own `bin/self-update` moves it from tag to tag. Clone it anywhere but `~/.claude`; this README writes `~/build-release`. Develop in a clone under `~/code`, where build-release runs this repo's chunks like any project's.
|
||||
|
||||
```sh
|
||||
git clone ssh://git@gitea.larvit.se:21022/lilleman/claude-config.git ~/build-release
|
||||
git clone ssh://git@gitea.larvit.se:21022/lilleman/dev-factory.git ~/build-release
|
||||
git -C ~/build-release checkout --detach "$(git -C ~/build-release tag -l 'v*' --sort=-v:refname | head -n 1)"
|
||||
git clone ssh://git@gitea.larvit.se:21022/lilleman/claude-config.git ~/code/claude-config
|
||||
git clone ssh://git@gitea.larvit.se:21022/lilleman/dev-factory.git ~/code/dev-factory
|
||||
```
|
||||
|
||||
Have the latest stable Python, today 3.14, as `python3` on `PATH`, and tmux 3.2 or later: build-release runs each chunk in its own window of a tmux session per project. build-release and build-epic stop and say so where either is older. For Rust projects, have `rust-analyzer` on `PATH`, which the `rust-analyzer-lsp` plugin needs.
|
||||
|
||||
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 `agents/`, `bin/`, `CLAUDE.md`, `principles/`, `rules/` and `skills/`, so a claude opens there each file of the setup that the rules name, 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.
|
||||
|
||||
Sign in to the loop's home once. Until you have, build-release and build-epic stop and print the line to run, `CLAUDE_CONFIG_DIR=~/.local/share/build-release/claude-home claude`: type `/login` in the claude it opens. A model you pick there with `/model` stays in the generated `settings.json`. The loop's home has no theme or status line of yours: those stay in your own `~/.claude`, for the claude you start yourself. build-release or build-epic builds the home again once the clone holds another commit, as after `self-update`, and keeps the sign-in, the model and the sessions. The home follows the clone whose build-release or build-epic ran last, so run only the release clone's, never the development clone's: that one would point every running loop at unreleased rules.
|
||||
Sign in to the loop's home once. Until you have, build-release and build-epic stop and print the line to run, `CLAUDE_CONFIG_DIR=~/.local/share/build-release/claude-home claude`: type `/login` in the claude it opens. A model you pick there with `/model` stays in the generated `settings.json`. The loop's home has no theme or status line of yours: those stay in your own `~/.claude`, for the claude you start yourself. build-release or build-epic builds the home again once the clone holds another commit, as after `self-update`, and keeps the sign-in, the model and the sessions. It builds the home again when you change `XDG_STATE_HOME`, too. The home follows the clone whose build-release, build-epic, `task-bench gather` or `claude-release` ran last, so run only the release clone's, never the development clone's: that one would point every running loop at unreleased rules.
|
||||
|
||||
The setup keeps each project's config, and what you choose for a project, in the config folder, `~/.config/build-release/`. Its tools keep their own state, such as transcripts, review reports and locks, in the state folder, `~/.local/state/build-release/`. The loop's Claude home is in the data folder, `~/.local/share/build-release/`, which holds what build-release builds again and what Claude Code writes. Where `XDG_CONFIG_HOME` holds an absolute path, the config folder is `build-release/` under that path instead, and likewise the state folder under `XDG_STATE_HOME` and the data folder under `XDG_DATA_HOME`; this README spells the defaults. Set such a variable in the environment Claude Code starts in, since rule-hook reads it there. `settings.json` names only the default review folder, `~/.local/state/build-release/larv-review`, in `additionalDirectories`: where `XDG_STATE_HOME` moves that folder, add it to the loop's home's `settings.json` yourself, and again each time build-release or build-epic builds the home, or an interactive session asks before a reviewer writes its report. Back up these four folders:
|
||||
To work in the loop's home yourself, for a manual `/larv-review` or a planning talk, run `~/build-release/bin/claude-release` in the project's checkout. It builds or refreshes the home first, as above, then runs claude there and passes every argument on, so `--resume`, `-p` and `--model` work as with plain claude. Where nobody has signed in to the home yet, type `/login` in the claude it opens. The home's `settings.json` bypasses permissions, and Claude Code may still ask you to trust the folder. The setup's hooks, such as `rule-hook`, which refuses a tool call that breaks a rule a program can check, run in every claude in the loop's home: the loop's sessions and `claude-release`. The claude you start from your own `~/.claude` loads neither the setup nor its hooks.
|
||||
|
||||
The setup keeps each project's config, and what you choose for a project, in the config folder, `~/.config/build-release/`. Its tools keep their own state, such as transcripts, review reports and locks, in the state folder, `~/.local/state/build-release/`. The loop's Claude home is in the data folder, `~/.local/share/build-release/`, which holds what build-release builds again and what Claude Code writes. Where `XDG_CONFIG_HOME` holds an absolute path, the config folder is `build-release/` under that path instead, and likewise the state folder under `XDG_STATE_HOME` and the data folder under `XDG_DATA_HOME`; this README spells the defaults. Set such a variable in the environment Claude Code starts in, since rule-hook reads it there. Back up these four folders:
|
||||
|
||||
- `~/.config/build-release/`: each project's config, a client project's plan and records, and `models.json`, the model of each project, which build-release and build-epic write. A project's `env-file`, if you keep it here as below, puts credentials in the backup, so keep the backup private.
|
||||
- `~/.local/state/build-release/transcripts`: every transcript build-release keeps. Where you set `BUILD_RELEASE_TRANSCRIPTS`, back up the folder it names instead.
|
||||
@@ -93,7 +109,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 +121,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.
|
||||
|
||||
@@ -192,13 +208,13 @@ Move `~/build-release` to the newest release:
|
||||
|
||||
It prints `CHANGELOG.md`'s section for each version it moved past: do what each asks, such as a new step under Install. `self-update` moves the clone it ships in, whatever the directory it is run from, and names that clone in each line that says what it did or why it refused. So run `~/build-release`'s copy, never the development clone's. The next build-release or build-epic builds the loop's Claude home again from the new release. `self-update --help` says what else it checks.
|
||||
|
||||
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.
|
||||
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 six links lead into the clone, though, so a rule, an agent, a skill, a principle or a tool changed in that home changes the clone's file. Carry such a change into `~/code/dev-factory` 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. A later release's `.gitignore` doesn't ignore Claude Code's credentials, transcripts and memory files, so in `~/.claude` a `git add .` would stage them. Where that checkout has moved past 0.17.0, run `echo '*' >> .git/info/exclude` in it.
|
||||
|
||||
## Release
|
||||
|
||||
Once the next release holds no item in `todo.md` and its release review has landed, cut it from `~/code/claude-config`:
|
||||
Once the next release holds no item in `todo.md` and its release review has landed, cut it from `~/code/dev-factory`:
|
||||
|
||||
```sh
|
||||
bin/cut-release
|
||||
@@ -216,13 +232,14 @@ It applies only those commits on the newest tag, tests them with `ci.sh`, tags a
|
||||
|
||||
## Tools
|
||||
|
||||
build-release, build-epic and `task-bench gather` put the release's tools first on the `PATH` of every claude they start, so this README and the rules name each tool bare, as in `metric-bench`. Install puts no tool on your shell's `PATH`: there, and in a claude you start from it yourself, call each by its path, `~/build-release/bin/<tool>`, from the project's checkout. Run `cut-release` from the development clone instead, as Release says. The tools under `~/build-release` are the release's; test a change to one from `~/code/claude-config/bin`. The tools are listed in alphabetical order, and the packages under `bin/` follow under their own heading.
|
||||
build-release, build-epic, `task-bench gather` and `claude-release` put the release's tools first on the `PATH` of every claude they start, so this README and the rules name each tool bare, as in `metric-bench`. Install puts no tool on your shell's `PATH`: there, and in a claude you start by any other means, call each by its path, `~/build-release/bin/<tool>`, from the project's checkout. Run `cut-release` from the development clone instead, as Release says. The tools under `~/build-release` are the release's; test a change to one from `~/code/dev-factory/bin`. The tools are listed in alphabetical order, and the packages under `bin/` follow under their own heading.
|
||||
|
||||
- `build-epic <EPIC-KEY>` runs the chunks of one Jira epic whose items span repos, or have none, each in its own window of the tmux session `epic-<EPIC-KEY>`, on the same cycle, judge and interrupt as build-release. The epic's description is its record: goals, audience, scoring and decisions. Before it starts chunks, build-epic plans each open issue that no label places yet, as "Set up a project" says. It files a sub-task per repo where the issue changes several repos. Otherwise it labels the issue with where it is worked, and asks you where that is unclear. It plans no issue your team filed a sub-task under: those sub-tasks run instead, each under a label of its own, and your team closes the issue. Then, where two or more issues may start, it scores each of them that holds no scores, and moves the issues that build-epic itself filed into order of score on the board. An open issue runs once a label names its repo or marks it as Claude's, in order of score, as many at once as a line such as `**Max parallel chunks:** 2` in the epic's description allows, 1 without it, and as each repo's `parallel-chunks` allows. A chunk whose pull request waits on a gate parks. An open task of yours that blocks another issue gets a window that DMs you once and reads the epic every minute; once you close the task, the issues it blocked may start. `build-epic <EPIC-KEY> --dry-run` prints what `build-epic <EPIC-KEY>` would write to Jira and which chunks it would start, and does neither; run it before the first real run on a team's epic. `--help` lists what it prints and leaves out. build-epic closes the epic only once you confirm every goal. Install → "Set up a project" says how to set it up; `build-epic --help` states the flags and the contract.
|
||||
- `build-epic-e2e` runs `build-epic` against a sandbox epic on a real Jira site, as Test says.
|
||||
- `build-release <task>` runs a project's next chunks, each in its own tmux window, cycle after cycle; `build-release --help` states its contract.
|
||||
- `chunk-pr open|sync|ready|push|merge|clean|open-epic` opens a chunk's pull request as a draft, brings its branch level with origin's default branch, marks it ready and merges it once its checks pass, with `gh` on a GitHub origin and `tea` elsewhere. Where the project's config sets `epic-branch`, the pull request goes into the epic's working branch instead, `push` pushes later commits and asks the auto-reviewer for a review, and `open-epic` opens the pull request from that branch into the default branch. The chunks of one project merge one at a time: in its turn, `merge` brings the branch level again, finishes the plan items its `--finish` flags name, and waits for the checks. Under `merge = "human"` it then marks the pull request ready and leaves the merge to a person. Once the pull request is merged, `clean` removes the chunk's worktree and branch and fast-forwards the main checkout. `chunk-pr --help` states the steps.
|
||||
- `chunk-preflight` finds the mechanical facts a chunk starts from, and with `--worktree` makes its worktree; `build-release` runs it with `--worktree` before it routes each chunk, and `chunk-preflight --help` lists the facts.
|
||||
- `claude-release [<claude argument>…]` runs claude in the loop's Claude home with the setup loaded, in the folder you run it in, and passes every argument on to claude; Install says why you'd want that.
|
||||
- `command-patterns [<version>] [--calls <file>]` prints a table of the shell command patterns a release's archived chunks ran, such as `tea pr create`, for an audit of the release, and with `--calls <file>` saves each call as a JSON line; `command-patterns --help` states the columns and the line's keys.
|
||||
- `compress-archives` gzips each transcript in build-release's archive and each file in the review folders 30 days after it last changed, keeping all of them; Install's crontab line runs it daily.
|
||||
- `cut-release [--patch <commits>]` cuts the next release of the development clone it ships in, and with `--patch` a patch release of only the commits named, as Release says.
|
||||
@@ -325,15 +342,8 @@ Test on the host with `bin/run-tests`, which runs pytest through `uvx`, pinned i
|
||||
|
||||
The commands in this section name their tools bare, as Tools says. CI runs `ci.sh` on every pull request, and `main` doesn't merge anything until it passes. The script runs the same tests on the committed HEAD in a pinned Python container. Run it under `run-heavy` to reproduce a CI failure, with Docker on `PATH` and its socket at `/var/run/docker.sock`, which the container shares.
|
||||
|
||||
`ci.sh` then runs `first-chunk-e2e/run`, which checks goals 2 and 3 as a newcomer meets them. It runs a first chunk in a container, from a clone of the committed HEAD, against a mock Messages API, so it needs no sign-in. It fails unless the chunk finishes on the setup's instructions, no request holds anything from the container's `~/.claude`, and that folder and `~/.claude.json` hold what they held before. Run it under `run-heavy` too. It needs the network: the image fetches Claude Code, and `build-release` installs the plugins.
|
||||
|
||||
To mutation-test the lines a branch changes, run `run-heavy mutate-changes --prefix 'uvx --python "$(command -v python3)" --with pytest==9.2.0 --from "mutmut>=3,<4"'` in its checkout.
|
||||
|
||||
To bench how hard the code is to fix a bug in, build the image first, with `run-heavy docker build --quiet --memory 2g --memory-swap 2g -t claude-config-task-bench task-bench-image`. Then run `task-bench --image claude-config-task-bench --prefix 'uvx --python "$(command -v python3)" --with pytest==9.2.0 --from "mutmut>=3,<4"' --test 'python -m pytest -q -p no:cacheprovider -n 4 bin --ignore=bin/adf_codec --ignore=bin/run_tests --ignore=bin/repo_checks/test_types.py --deselect bin/plan/test_touches.py::PredictedTest --deselect bin/loop_effects/test_effects.py::ChildShells'` in this checkout, under `run-heavy`. A scoring run starts it with `--record-figures` added. The bench runs the tests with no network, so the image holds everything they need. The `--test` leaves out the tests that need docker or `uvx`, and `ChildShells`, which needs `docker run --init` to reap its processes: `bin/run-tests` on the host runs those.
|
||||
|
||||
## Tracking a new file
|
||||
|
||||
`.gitignore` is an allowlist. Track a file by negating it and its parent directories, then confirm with `git check-ignore -v <path>`:
|
||||
|
||||
```
|
||||
!docs/
|
||||
!docs/*.md
|
||||
```
|
||||
To bench how hard the code is to fix a bug in, build the image first, with `run-heavy docker build --quiet --memory 2g --memory-swap 2g -t dev-factory-task-bench task-bench-image`. Then run `task-bench --image dev-factory-task-bench --prefix 'uvx --python "$(command -v python3)" --with pytest==9.2.0 --from "mutmut>=3,<4"' --test 'python -m pytest -q -p no:cacheprovider -n 4 bin --ignore=bin/adf_codec --ignore=bin/run_tests --ignore=bin/repo_checks/test_types.py --deselect bin/plan/test_touches.py::PredictedTest --deselect bin/loop_effects/test_effects.py::ChildShells'` in this checkout, under `run-heavy`. A scoring run starts it with `--record-figures` added. The bench runs the tests with no network, so the image holds everything they need. The `--test` leaves out the tests that need docker or `uvx`, and `ChildShells`, which needs `docker run --init` to reap its processes: `bin/run-tests` on the host runs those.
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ def image_tag(shim: pathlib.Path) -> str:
|
||||
digest = hashlib.sha256()
|
||||
for name in SHIM_FILES:
|
||||
digest.update((shim / name).read_bytes())
|
||||
return f"claude-config-adf-codec:{digest.hexdigest()[:12]}"
|
||||
return f"dev-factory-adf-codec:{digest.hexdigest()[:12]}"
|
||||
|
||||
|
||||
def docker_args(image: str, mode: str) -> list[str]:
|
||||
|
||||
@@ -2,6 +2,7 @@ import contextlib
|
||||
import fcntl
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
import pytest
|
||||
@@ -143,6 +144,12 @@ def test_the_image_tag_changes_with_the_shim_files(tmp_path):
|
||||
assert convert.image_tag(tmp_path) != before
|
||||
|
||||
|
||||
def test_the_image_tag_is_the_project_name_and_twelve_hex_digits_of_the_shim_files(tmp_path):
|
||||
for name in convert.SHIM_FILES:
|
||||
(tmp_path / name).write_text("a")
|
||||
assert re.fullmatch(r"dev-factory-adf-codec:[0-9a-f]{12}", convert.image_tag(tmp_path))
|
||||
|
||||
|
||||
def test_the_container_command_line_is_exactly_this():
|
||||
assert convert.docker_args("image:1", "to-adf") == [
|
||||
"docker", "run", "--rm", "-i", "--memory", "256m", "--memory-swap", "256m", "--network", "none", "--read-only", "image:1", "to-adf",
|
||||
|
||||
@@ -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 name) 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 "
|
||||
|
||||
@@ -35,7 +35,7 @@ class Cycle:
|
||||
|
||||
Each step reads the few fields it needs by name, so the fields stay at one level. docs/decisions.md → `principles: about seven things per level, …` allows more than seven where a reader finds them by name.
|
||||
"""
|
||||
# The claude-config release and commit the cycle runs under, such as `v0.8.0 (<sha>)`, or why they are unknown: chunk_driver/cycle_start.py's setup_version.
|
||||
# The dev-factory release and commit the cycle runs under, such as `v0.8.0 (<sha>)`, or why they are unknown: chunk_driver/cycle_start.py's setup_version.
|
||||
config: str
|
||||
effects: Effects
|
||||
# What chunk-preflight found, or why it could not run, for a fresh worker's prompt; empty when the session was open as the cycle began.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""What a stretch of the chunk's work spent, in raw tokens by model and kind, which the archive records beside each verdict, interrupt and quoted answer: docs/decisions.md → `build-release: each verdict records the claude-config release and commit that ran it…`.
|
||||
"""What a stretch of the chunk's work spent, in raw tokens by model and kind, which the archive records beside each verdict, interrupt and quoted answer: docs/decisions.md → `build-release: each verdict records the dev-factory release and commit that ran it…`.
|
||||
|
||||
A stretch runs from the previous outcome that recorded a spend, or from the chunk's start, to the ruling. It counts the worker's main thread, each subagent and the judge run that ruled, each message once. Dollars are left to be derived from the model and the tokens, at the prices recorded beside them.
|
||||
"""
|
||||
|
||||
@@ -43,7 +43,7 @@ ONE_UP = Rung("claude-fable-5-2", "low")
|
||||
THREE_UP = Rung("claude-opus-5-5", "xhigh")
|
||||
# How the archive records a worker that runs off the ladder.
|
||||
OFF_LADDER = '{"model": "worker-model"}'
|
||||
# The claude-config release and commit each cycle the tests run is under.
|
||||
# The dev-factory release and commit each cycle the tests run is under.
|
||||
CONFIG = "v0.8.0 (abc123)"
|
||||
# How it records routes by item 179's L of 2 and E + I of 5.
|
||||
SONNET_179 = '{"model": "claude-sonnet-5-5", "effort": "high", "item": 179, "likelihood": 2, "escape_and_impact": 5}'
|
||||
|
||||
@@ -23,7 +23,7 @@ class TmuxCommands(unittest.TestCase):
|
||||
self.assertEqual(fake.tmux_calls, [["-V"]])
|
||||
|
||||
def test_names_the_session_for_the_project(self):
|
||||
self.assertEqual(tmux.session_name(tmux.LOOP, "claude-config"), "loop-claude-config")
|
||||
self.assertEqual(tmux.session_name(tmux.LOOP, "dev-factory"), "loop-dev-factory")
|
||||
# tmux reads `.` and `:` in a target as separators.
|
||||
self.assertEqual(tmux.session_name(tmux.LOOP, "my.site:2 x"), "loop-my-site-2-x")
|
||||
self.assertEqual(tmux.session_name(tmux.LOOP, "Acme/Billing"), "loop-Acme-Billing")
|
||||
|
||||
@@ -78,7 +78,7 @@ def unusable(run: Tmux, driver: str) -> str | None:
|
||||
|
||||
|
||||
def session_name(kind: str, key: str) -> str:
|
||||
"""The tmux session an entry point runs its chunks in: kind LOOP with a project's key, such as `loop-claude-config`, or kind EPIC with an epic's key, such as `epic-ABC-12`. tmux reads `.` and `:` in a target as separators, so every character of the key but a letter, a digit, `_` and `-` becomes a dash."""
|
||||
"""The tmux session an entry point runs its chunks in: kind LOOP with a project's key, such as `loop-dev-factory`, or kind EPIC with an epic's key, such as `epic-ABC-12`. tmux reads `.` and `:` in a target as separators, so every character of the key but a letter, a digit, `_` and `-` becomes a dash."""
|
||||
return f"{kind}-" + re.sub(r"[^A-Za-z0-9_-]", "-", key)
|
||||
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ class TheLauncher(unittest.TestCase):
|
||||
ran = subprocess.run([str(launcher), "--help"], capture_output=True, text=True, timeout=60)
|
||||
self.assertEqual((ran.returncode, ran.stdout.split(" ", 2)[2]), (0, main.HELP + "\n"))
|
||||
tracked = subprocess.run(["git", "ls-files", "--error-unmatch", launcher.name], capture_output=True, cwd=launcher.parent)
|
||||
self.assertEqual(tracked.returncode, 0, "bin/build-epic is not in the repo; .gitignore lists what it keeps")
|
||||
self.assertEqual(tracked.returncode, 0, "bin/build-epic is not in the repo")
|
||||
|
||||
|
||||
class TheCommand(BuildEpicTest):
|
||||
@@ -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"
|
||||
|
||||
@@ -88,7 +88,7 @@ class RoutingCheck(unittest.TestCase):
|
||||
self.assertEqual(args[:6], ["--model", "m", "--effort", "high", "--permission-mode", "bypassPermissions"])
|
||||
self.assertIn(f"don't change anything until they answer:\n- {call}", args[6])
|
||||
self.assertEqual(fake.terminal_environments, [{"CLAUDE_CODE_SANDBOXED": "1"}])
|
||||
self.assertEqual(fake.terminal_folders, [str(self.home / "code" / "claude-config")], "the development clone, since ~/.claude holds only a release")
|
||||
self.assertEqual(fake.terminal_folders, [str(self.home / "code" / "dev-factory")], "the development clone, since a release clone holds only a release")
|
||||
self.assertIn("Record what they decide in this checkout, the development clone", args[6])
|
||||
self.assertIsNone(state.mark_measured(self.root, 0))
|
||||
self.assertEqual(self.check(FakeEffects(git=[UNREAD] * 3))[0], None)
|
||||
@@ -124,7 +124,7 @@ class RoutingCheck(unittest.TestCase):
|
||||
def test_stops_when_claude_cannot_start_for_the_calls(self):
|
||||
self.chunks(5, 4)
|
||||
stop, _ = self.check(FakeEffects(on_terminal_claude=[OSError(2, "No such file or directory")], git=[UNREAD] * 3))
|
||||
self.assertEqual(stop, Stop(1, f"could not start claude for the routing calls in {self.home / 'code' / 'claude-config'}, the setup's development clone: No such file or directory"))
|
||||
self.assertEqual(stop, Stop(1, f"could not start claude for the routing calls in {self.home / 'code' / 'dev-factory'}, the setup's development clone: No such file or directory"))
|
||||
|
||||
def test_says_a_figure_it_cannot_write_and_goes_on(self):
|
||||
assert_not_root(self)
|
||||
|
||||
@@ -31,10 +31,11 @@ build-release runs every claude in the loop's Claude home, ~/.local/share/build-
|
||||
which it builds from the clone it ships in before it starts anything. Until someone has signed in
|
||||
there, it stops and prints the command to sign in with. README.md → Install says what the
|
||||
home holds.
|
||||
`claude-release [<claude argument>…]` runs claude in that home, for you to talk to.
|
||||
|
||||
build-release needs tmux 3.2 or later, and checks that too before it starts anything. Each chunk
|
||||
runs in its own window of one tmux session per project, named loop-<key>, such as
|
||||
loop-claude-config. <key> is the checkout's path relative to ~/code, or to / outside it, with a dash
|
||||
loop-dev-factory. <key> is the checkout's path relative to ~/code, or to / outside it, with a dash
|
||||
for each character other than a letter, a digit, _ or -. The tmux session's @loop-root option names
|
||||
its checkout, and a checkout whose key maps to a tmux session another checkout runs is refused.
|
||||
build-release <task> starts the chunks that may start now, then attaches to the tmux session, or
|
||||
@@ -158,7 +159,7 @@ Once 20 cycles have closed across all projects in the archive since the last mea
|
||||
loop to close one measures every finished chunk there, with no model run, and writes
|
||||
routing-figures.md at the archive's root (bin/routing_figures/). Each call the figures make for a
|
||||
routing change, unless raised before, is an interrupt: claude, on the project's model, on the
|
||||
terminal in the setup's development clone, ~/code/claude-config, asked to put the calls to the
|
||||
terminal in the setup's development clone, ~/code/dev-factory, asked to put the calls to the
|
||||
human. Once that claude ends, the calls are listed in
|
||||
routing-calls-raised.md beside the figures, kept in routing-state.json, and not raised again. Off a
|
||||
terminal, the calls are said on stderr, the loop goes on, and they are raised again at the next
|
||||
@@ -181,7 +182,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".
|
||||
OF_THE_SETUP = "the setup's"
|
||||
HUMAN_RULE_NAMES = (f"{OF_THE_SETUP} {HUMAN_RULES_FILE}", f"{OF_THE_SETUP} {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. A file in claude_dir, the loop's Claude home, or in the clone is the setup's. Any other is written from ~/ where it lies in home, else in full."""
|
||||
for setup in (claude_dir, RELEASE_ROOT):
|
||||
if rule.is_relative_to(setup):
|
||||
return f"{OF_THE_SETUP} {rule.relative_to(setup)}"
|
||||
return f"~/{rule.relative_to(home)}" if rule.is_relative_to(home) else str(rule)
|
||||
|
||||
@@ -9,53 +9,68 @@ 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
|
||||
|
||||
KIM = pathlib.Path("/home/kim")
|
||||
CLAUDE_HOME = KIM / "share" / "claude-home"
|
||||
|
||||
|
||||
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):
|
||||
for rule in (CLAUDE_HOME / "rules" / "todo-items.md", RELEASE_ROOT / "rules" / "todo-items.md"):
|
||||
with self.subTest(rule):
|
||||
self.assertEqual(records.named(rule, KIM, CLAUDE_HOME), "the setup's rules/todo-items.md")
|
||||
|
||||
def test_names_any_other_file_under_the_home_from_the_tilde(self):
|
||||
self.assertEqual(records.named(KIM / "standards" / "prose.md", KIM, CLAUDE_HOME), "~/standards/prose.md")
|
||||
|
||||
def test_names_a_file_outside_the_home_in_full(self):
|
||||
self.assertEqual(records.named(pathlib.Path("/srv/standards/prose.md"), KIM, 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 +80,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 +97,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)
|
||||
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
# Said before the first import of the setup's code, which an older Python cannot read.
|
||||
if sys.version_info < (3, 14):
|
||||
sys.exit(f"claude-release needs Python 3.14 or later as python3 on PATH; it found Python {sys.version.split()[0]}")
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
|
||||
|
||||
from claude_release import main
|
||||
from loop_effects import effects
|
||||
|
||||
sys.exit(main.main(sys.argv[1:], pathlib.Path.cwd(), effects.system_effects(pathlib.Path.home(), os.environ)))
|
||||
+33
-17
@@ -13,11 +13,15 @@ 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 each file of the setup that they name 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.
|
||||
# Stands for the reports folder, which holds every chunk's review folder, in the clone's settings.json. Every value that holds it is a path, so unlike CLONE it isn't shell-quoted.
|
||||
REPORTS = "{reports}"
|
||||
# What `unready` says first where nobody has signed in to the home yet.
|
||||
SIGNED_OUT = "nobody is signed in to the loop's Claude home"
|
||||
# The file in the home that names the clone, its commit and the reports folder the home was built from.
|
||||
BUILT_FROM = "built-from"
|
||||
|
||||
# Runs `claude` with these arguments in the home.
|
||||
@@ -28,10 +32,10 @@ class Git(typing.Protocol):
|
||||
def __call__(self, *args: str, cwd: str | None = None) -> str | Failure: ...
|
||||
|
||||
|
||||
def unready(home: pathlib.Path, clone: pathlib.Path, claude: Claude, git: Git) -> str | None:
|
||||
"""Builds the home from clone, or refreshes it where the clone's commit changed since. Then why a claude cannot run in the home yet, said for the person to act on; None where one can."""
|
||||
def unready(home: pathlib.Path, clone: pathlib.Path, reports: pathlib.Path, own: pathlib.Path, claude: Claude, git: Git) -> str | None:
|
||||
"""Builds the home from clone, or refreshes it where the clone's commit or the reports folder changed since; own is the person's own Claude home, whose instructions the home keeps out. Then says why a claude cannot run in the home yet, said for the person to act on; None where one can."""
|
||||
try:
|
||||
built = refreshed(home, clone, claude, git)
|
||||
built = refreshed(home, clone, reports, own, claude, git)
|
||||
if isinstance(built, Failure):
|
||||
return f"could not build the loop's Claude home, {home}: {built.reason}"
|
||||
status = claude(["auth", "status"])
|
||||
@@ -43,7 +47,12 @@ def unready(home: pathlib.Path, clone: pathlib.Path, claude: Claude, git: Git) -
|
||||
if signed:
|
||||
return None
|
||||
# /login is typed in a claude that runs in the home: docs/decisions.md → `Claude Code in a home of its own`.
|
||||
return f"nobody is signed in to the loop's Claude home; run `CLAUDE_CONFIG_DIR={shlex.quote(str(home))} claude` and type /login there, once"
|
||||
return f"{SIGNED_OUT}; run `CLAUDE_CONFIG_DIR={shlex.quote(str(home))} claude` and type /login there, once"
|
||||
|
||||
|
||||
def only_signed_out(reason: str) -> bool:
|
||||
"""Whether a reason `unready` gave is that nobody has signed in yet."""
|
||||
return reason.startswith(SIGNED_OUT)
|
||||
|
||||
|
||||
def signed_in(status: str) -> bool | None:
|
||||
@@ -61,11 +70,14 @@ def printed(done: subprocess.CompletedProcess[str]) -> str:
|
||||
return " ".join((done.stderr or done.stdout).split()) or f"it printed nothing and exited {done.returncode}"
|
||||
|
||||
|
||||
def refreshed(home: pathlib.Path, clone: pathlib.Path, claude: Claude, git: Git) -> Failure | None:
|
||||
def refreshed(home: pathlib.Path, clone: pathlib.Path, reports: pathlib.Path, own: pathlib.Path, claude: Claude, git: Git) -> Failure | None:
|
||||
# The home links to the clone's rules/, and the exclusion of own's files also drops a rule file reached through a link: a clone in own would run without its rules.
|
||||
if clone.resolve().is_relative_to(own.resolve()):
|
||||
return Failure(f"the release is cloned in your own Claude home, {own}, whose instructions the loop keeps out; clone it elsewhere, as README.md → Install says")
|
||||
commit = git("rev-parse", "HEAD", cwd=str(clone))
|
||||
if isinstance(commit, Failure):
|
||||
return commit
|
||||
built_from = f"{clone} at {commit.strip()}\n"
|
||||
built_from = f"{clone} at {commit.strip()}, reports in {reports}\n"
|
||||
home.mkdir(parents=True, exist_ok=True)
|
||||
# Several loops start at once after an update: one refreshes the home, and the others wait and find it done.
|
||||
with open(home / ".refresh-lock", "w", encoding="utf-8") as lock:
|
||||
@@ -74,7 +86,7 @@ def refreshed(home: pathlib.Path, clone: pathlib.Path, claude: Claude, git: Git)
|
||||
if stamp.is_file() and stamp.read_text(encoding="utf-8") == built_from:
|
||||
return None
|
||||
# The stamp is written last, so a refresh that failed halfway runs again.
|
||||
return linked(home, clone) or settings_written(home, clone) or plugins_installed(clone, claude) or replace_file(stamp, built_from.encode())
|
||||
return linked(home, clone) or settings_written(home, clone, reports, own) or plugins_installed(clone, claude) or replace_file(stamp, built_from.encode())
|
||||
|
||||
|
||||
def linked(home: pathlib.Path, clone: pathlib.Path) -> Failure | None:
|
||||
@@ -87,9 +99,11 @@ def linked(home: pathlib.Path, clone: pathlib.Path) -> Failure | None:
|
||||
return None
|
||||
|
||||
|
||||
def settings_written(home: pathlib.Path, clone: pathlib.Path) -> Failure | None:
|
||||
"""Writes the home's settings.json: the clone's, with the clone's folder in place of CLONE, and the model the home's file holds."""
|
||||
settings = placed(json.loads((clone / "settings.json").read_text(encoding="utf-8")), shlex.quote(str(clone)))
|
||||
def settings_written(home: pathlib.Path, clone: pathlib.Path, reports: pathlib.Path, own: pathlib.Path) -> Failure | None:
|
||||
"""Writes the home's settings.json: the clone's, with the clone's folder in place of CLONE and the reports folder in place of REPORTS, the model the home's file holds, and own's instructions kept out."""
|
||||
settings = placed(json.loads((clone / "settings.json").read_text(encoding="utf-8")), {CLONE: shlex.quote(str(clone)), REPORTS: str(reports)})
|
||||
# Claude Code reads `.claude/CLAUDE.md` and `.claude/rules/` in every folder above the one it runs in, so the person's own would load in each project under their home folder: docs/decisions.md → `Claude Code in a home of its own`.
|
||||
settings["claudeMdExcludes"] = [f"{own}/**"]
|
||||
generated = home / "settings.json"
|
||||
try:
|
||||
old = json.loads(generated.read_text(encoding="utf-8")) if generated.is_file() else {}
|
||||
@@ -103,13 +117,15 @@ def settings_written(home: pathlib.Path, clone: pathlib.Path) -> Failure | None:
|
||||
return replace_file(generated, (json.dumps(settings, indent=2, sort_keys=True) + "\n").encode())
|
||||
|
||||
|
||||
def placed(value: typing.Any, clone: str) -> typing.Any:
|
||||
def placed(value: typing.Any, stand_for: dict[str, str]) -> typing.Any:
|
||||
if isinstance(value, str):
|
||||
return value.replace(CLONE, clone)
|
||||
for name, replacement in stand_for.items():
|
||||
value = value.replace(name, replacement)
|
||||
return value
|
||||
if isinstance(value, list):
|
||||
return [placed(each, clone) for each in value]
|
||||
return [placed(each, stand_for) for each in value]
|
||||
if isinstance(value, dict):
|
||||
return {key: placed(each, clone) for key, each in value.items()}
|
||||
return {key: placed(each, stand_for) for key, each in value.items()}
|
||||
return value
|
||||
|
||||
|
||||
|
||||
@@ -8,12 +8,13 @@ import unittest
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from failure import Failure
|
||||
from claude_home.home import unready
|
||||
from claude_home.home import only_signed_out, unready
|
||||
|
||||
SETTINGS = {
|
||||
"enabledPlugins": {"code-review@official": True, "frontend-design@official": False, "lsp@other": True},
|
||||
"extraKnownMarketplaces": {"official": {"source": {"repo": "anthropics/official", "source": "github"}}, "other": {"source": {"repo": "someone/other", "source": "github"}}, "unused": {"source": {"repo": "someone/unused", "source": "github"}}},
|
||||
"hooks": {"PreToolUse": [{"hooks": [{"command": "{clone}/bin/rule-hook", "type": "command"}]}]},
|
||||
"permissions": {"additionalDirectories": ["{reports}", "~/code"], "defaultMode": "bypassPermissions"},
|
||||
"tui": "fullscreen",
|
||||
}
|
||||
SIGNED_IN = json.dumps({"loggedIn": True, "authMethod": "claude.ai"})
|
||||
@@ -25,12 +26,14 @@ 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")
|
||||
self.home = self.temp / "share" / "claude-home"
|
||||
self.commit: str | Failure = "1a2b3c\n"
|
||||
self.reports = self.temp / "state" / "build-release" / "larv-review"
|
||||
self.own = self.temp / "home" / ".claude"
|
||||
self.status = SIGNED_IN
|
||||
# The exit code of each `claude plugin` command, by its last argument; 0 for one not named.
|
||||
self.exits: dict[str, int] = {}
|
||||
@@ -43,16 +46,16 @@ class Home(unittest.TestCase):
|
||||
return subprocess.CompletedProcess(args, self.exits.get(args[-1], 0), "", f"no {args[-1]}\nin the marketplace\n")
|
||||
|
||||
def unready(self) -> str | None:
|
||||
return unready(self.home, self.clone, self.claude, lambda *args, cwd=None: self.commit if (args, cwd) == (("rev-parse", "HEAD"), str(self.clone)) else Failure(f"unexpected git {args} in {cwd}"))
|
||||
return unready(self.home, self.clone, self.reports, self.own, self.claude, lambda *args, cwd=None: self.commit if (args, cwd) == (("rev-parse", "HEAD"), str(self.clone)) else Failure(f"unexpected git {args} in {cwd}"))
|
||||
|
||||
def settings(self) -> dict[str, object]:
|
||||
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")
|
||||
@@ -64,6 +67,32 @@ class Home(unittest.TestCase):
|
||||
self.assertEqual(self.settings()["tui"], "fullscreen")
|
||||
self.assertEqual(json.loads((self.clone / "settings.json").read_text(encoding="utf-8")), SETTINGS)
|
||||
|
||||
def test_the_generated_settings_let_a_session_write_the_reports_folder_wherever_the_state_folder_is(self) -> None:
|
||||
self.unready()
|
||||
|
||||
self.assertEqual(self.settings()["permissions"], {"additionalDirectories": [str(self.reports), "~/code"], "defaultMode": "bypassPermissions"})
|
||||
|
||||
def test_the_generated_settings_keep_out_the_instructions_of_the_persons_own_home(self) -> None:
|
||||
self.unready()
|
||||
|
||||
self.assertEqual(self.settings()["claudeMdExcludes"], [f"{self.own}/**"])
|
||||
|
||||
def test_a_clone_in_the_persons_own_home_stops_since_the_exclusion_would_drop_the_setups_rules(self) -> None:
|
||||
for own in (self.clone, self.clone.parent):
|
||||
with self.subTest(own=own):
|
||||
self.own = own
|
||||
|
||||
self.assertEqual(self.unready(), f"could not build the loop's Claude home, {self.home}: the release is cloned in your own Claude home, {own}, whose instructions the loop keeps out; clone it elsewhere, as README.md → Install says")
|
||||
self.assertFalse((self.home / "settings.json").exists())
|
||||
|
||||
def test_a_moved_reports_folder_refreshes_the_home(self) -> None:
|
||||
self.unready()
|
||||
self.reports = self.temp / "elsewhere" / "build-release" / "larv-review"
|
||||
|
||||
self.assertIsNone(self.unready())
|
||||
|
||||
self.assertEqual(self.settings()["permissions"]["additionalDirectories"][0], str(self.reports)) # type: ignore[index]
|
||||
|
||||
def test_it_adds_each_enabled_plugins_marketplace_then_installs_each_enabled_plugin(self) -> None:
|
||||
self.unready()
|
||||
|
||||
@@ -87,7 +116,7 @@ class Home(unittest.TestCase):
|
||||
|
||||
self.unready()
|
||||
|
||||
self.assertEqual((self.home / "settings.json").read_text(encoding="utf-8"), '{\n "env": {\n "A": "1"\n },\n "tui": "fullscreen"\n}\n')
|
||||
self.assertEqual((self.home / "settings.json").read_text(encoding="utf-8"), f'{{\n "claudeMdExcludes": [\n "{self.own}/**"\n ],\n "env": {{\n "A": "1"\n }},\n "tui": "fullscreen"\n}}\n')
|
||||
|
||||
def test_a_home_built_from_the_clones_commit_is_left_as_it_is(self) -> None:
|
||||
self.unready()
|
||||
@@ -126,6 +155,7 @@ class Home(unittest.TestCase):
|
||||
self.status = SIGNED_OUT
|
||||
|
||||
self.assertEqual(self.unready(), f"nobody is signed in to the loop's Claude home; run `CLAUDE_CONFIG_DIR={self.home} claude` and type /login there, once")
|
||||
self.assertTrue(only_signed_out(self.unready() or ""))
|
||||
|
||||
def test_a_status_that_says_nobody_is_signed_in_or_out_quotes_what_claude_said(self) -> None:
|
||||
for stdout, stderr, said in (("", "Error: the settings\nare broken\n", "Error: the settings are broken"), ("Not logged in\n", "", "Not logged in"), ('{"authMethod": "none"}', "", '{"authMethod": "none"}'), ("3", "", "3"), ('{"loggedIn": "yes"}', "", '{"loggedIn": "yes"}'), ("", "", "it printed nothing and exited 1")):
|
||||
@@ -133,7 +163,7 @@ class Home(unittest.TestCase):
|
||||
def claude(args: list[str]) -> subprocess.CompletedProcess[str]:
|
||||
return subprocess.CompletedProcess(args, 1, stdout, stderr) if args == ["auth", "status"] else subprocess.CompletedProcess(args, 0, "", "")
|
||||
|
||||
reason = unready(self.home, self.clone, claude, lambda *args, cwd=None: "1a2b3c\n")
|
||||
reason = unready(self.home, self.clone, self.reports, self.own, claude, lambda *args, cwd=None: "1a2b3c\n")
|
||||
|
||||
self.assertEqual(reason, f"could not ask claude who is signed in to the loop's Claude home, {self.home}: {said}")
|
||||
|
||||
@@ -174,15 +204,16 @@ class Home(unittest.TestCase):
|
||||
def missing(args: list[str]) -> subprocess.CompletedProcess[str]:
|
||||
raise FileNotFoundError(2, "No such file or directory", "claude")
|
||||
|
||||
reason = unready(self.home, self.clone, missing, lambda *args, cwd=None: "1a2b3c\n")
|
||||
reason = unready(self.home, self.clone, self.reports, self.own, missing, lambda *args, cwd=None: "1a2b3c\n")
|
||||
|
||||
self.assertEqual(reason, f"could not build the loop's Claude home, {self.home}: [Errno 2] No such file or directory: 'claude'")
|
||||
self.assertFalse(only_signed_out(reason))
|
||||
|
||||
def test_a_claude_that_is_stopped_after_its_time_stops(self) -> None:
|
||||
def stalled(args: list[str]) -> subprocess.CompletedProcess[str]:
|
||||
raise subprocess.TimeoutExpired(["claude", *args], 600)
|
||||
|
||||
reason = unready(self.home, self.clone, stalled, lambda *args, cwd=None: "1a2b3c\n")
|
||||
reason = unready(self.home, self.clone, self.reports, self.own, stalled, lambda *args, cwd=None: "1a2b3c\n")
|
||||
|
||||
self.assertEqual(reason, f"could not build the loop's Claude home, {self.home}: Command '['claude', 'plugin', 'marketplace', 'add', 'anthropics/official']' timed out after 600 seconds")
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
from loop_effects.effects import Effects
|
||||
from claude_home.home import only_signed_out
|
||||
|
||||
|
||||
# A command of its own, since `build-release claude` would take a task that starts with "claude" for this command.
|
||||
def main(argv: list[str], cwd: pathlib.Path, effects: Effects) -> int:
|
||||
"""Runs claude on the terminal in cwd with argv as its arguments, in the loop's Claude home. Returns claude's exit code as a shell reports it, or 1 where the home isn't ready for a reason other than a missing sign-in."""
|
||||
not_ready = effects.claude_home()
|
||||
# A missing sign-in doesn't stop it: the login is typed in this claude.
|
||||
if not_ready and not only_signed_out(not_ready):
|
||||
print(not_ready, file=sys.stderr)
|
||||
return 1
|
||||
code = effects.claude_on_terminal(argv, str(cwd), {})
|
||||
# subprocess reports a claude that a signal ended as minus the signal's number, which sys.exit would turn into 256 minus it.
|
||||
return 128 - code if code < 0 else code
|
||||
@@ -0,0 +1,46 @@
|
||||
import contextlib
|
||||
import io
|
||||
import pathlib
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from loop_effects.doubles import FakeEffects
|
||||
from claude_release import main
|
||||
from claude_home.home import SIGNED_OUT
|
||||
|
||||
|
||||
class ClaudeRelease(unittest.TestCase):
|
||||
def run_main(self, args: list[str], fake: FakeEffects) -> tuple[int, str]:
|
||||
err = io.StringIO()
|
||||
with contextlib.redirect_stderr(err):
|
||||
return main.main(args, pathlib.Path("/project"), fake.effects()), err.getvalue()
|
||||
|
||||
def test_passes_every_argument_on_to_claude_in_the_folder_it_runs_in(self):
|
||||
fake = FakeEffects(on_terminal_claude=[0])
|
||||
code, err = self.run_main(["--resume", "abc", "--model", "opus", "-p", "hi"], fake)
|
||||
self.assertEqual((code, err, fake.made("claude_on_terminal"), fake.terminal_folders), (0, "", [["--resume", "abc", "--model", "opus", "-p", "hi"]], ["/project"]))
|
||||
# The effect adds the home and the tools' PATH to the environment; the command doesn't add anything.
|
||||
self.assertEqual(fake.terminal_environments, [{}])
|
||||
|
||||
def test_exits_with_the_code_of_claude(self):
|
||||
self.assertEqual(self.run_main([], FakeEffects(on_terminal_claude=[3]))[0], 3)
|
||||
|
||||
def test_opens_claude_where_nobody_is_signed_in_yet_for_the_login_typed_there(self):
|
||||
fake = FakeEffects(on_terminal_claude=[0])
|
||||
fake.home_unready = f"{SIGNED_OUT}; run `CLAUDE_CONFIG_DIR=/h claude` and type /login there, once"
|
||||
self.assertEqual((self.run_main([], fake)[0], len(fake.made("claude_on_terminal"))), (0, 1))
|
||||
|
||||
def test_exits_as_a_shell_reports_a_claude_that_a_signal_ended(self):
|
||||
self.assertEqual(self.run_main([], FakeEffects(on_terminal_claude=[-15]))[0], 143)
|
||||
|
||||
def test_stops_where_the_home_cannot_be_built(self):
|
||||
fake = FakeEffects()
|
||||
fake.home_unready = "could not build the loop's Claude home, /h: disk full"
|
||||
code, err = self.run_main(["--resume"], fake)
|
||||
self.assertEqual((code, err, fake.made("claude_on_terminal")), (1, "could not build the loop's Claude home, /h: disk full\n", []))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -132,7 +132,7 @@ class Cut(unittest.TestCase):
|
||||
self.env = {**isolated_env(), "GIT_CONFIG_GLOBAL": str(self.temp / "gitconfig"), "GIT_CONFIG_NOSYSTEM": "1", "PATH": f"{fake}:{os.environ['PATH']}", "XDG_STATE_HOME": str(self.temp / "state")}
|
||||
self.forge_state({"origin": str(self.origin), "pulls": [], "checks": "none", "calls": []})
|
||||
self.git(self.temp, "init", "-q", "--bare", "-b", "main", str(self.origin))
|
||||
self.clone = self.temp / "claude-config"
|
||||
self.clone = self.temp / "dev-factory"
|
||||
self.git(self.temp, "clone", "-q", str(self.origin), str(self.clone))
|
||||
self.commit({"CHANGELOG.md": "# Changelog\n\n## 0.1.0\n\n- First.\n", "todo.md": TODO + ROW.format(id=1, release="0.2.0") + ROW.format(id=2, release="0.3.0"), "tool.txt": "broken\n", "ci.sh": "exit 0\n"}, "Start")
|
||||
self.git(self.clone, "tag", "-a", "v0.1.0", "-m", "Cut release 0.1.0")
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -92,8 +92,8 @@ checkout's HEAD, which the seats read, and one prompt file per seat beside it, a
|
||||
skills/comprehension-panel/seat-prompts.md builds them. It prints the worktree's path and each
|
||||
prompt's. It takes {{language}}, {{kind}}, {{domain}}, {{domain docs}} and {{3am question}} from the
|
||||
project's working-rules file → "Scoring run", which is the checkout's AGENTS.md unless the config
|
||||
names another. Where that file holds no such section, as in claude-config, it takes them from the
|
||||
checkout's seat-prompts.md → "claude-config's values". It fills the other placeholders from the worktree and
|
||||
names another. Where that file holds no such section, as in dev-factory, it takes them from the
|
||||
checkout's seat-prompts.md → "dev-factory's values". It fills the other placeholders from the worktree and
|
||||
the panel's SKILL.md. Where any one of the five values is missing, it exits 1 and doesn't write
|
||||
anything. Where a setup that record-scoring never removed is still there, it removes it first and
|
||||
says so.
|
||||
|
||||
@@ -16,12 +16,13 @@ import typing
|
||||
|
||||
from notifier.notify import Backend, BACKENDS, notify
|
||||
from loop_effects import child_shells
|
||||
from loop_state.paths import claude_home, in_claude_home, RELEASE_ROOT, with_release_tools
|
||||
from loop_state.paths import CLAUDE_HOME, claude_home, in_claude_home, RELEASE_ROOT, with_release_tools
|
||||
from failure import Failure
|
||||
from git_cli import git_repo
|
||||
from machine_load.memory import Memory, read_memory
|
||||
from project_config.settings import Notifier
|
||||
from text_files.file_writes import replace_file
|
||||
from review_rules.review_folder import reports_folder
|
||||
from forge.commands import Run, runner
|
||||
from machine_load.slots import slot_folder
|
||||
from claude_home.home import unready
|
||||
@@ -127,7 +128,7 @@ def system_effects(home: pathlib.Path, env: typing.Mapping[str, str], backends:
|
||||
"""
|
||||
return Effects(
|
||||
claude=lambda args, cwd, stdin: subprocess.run(["claude", *args], capture_output=True, cwd=cwd, env=claude_environment(env, home), input=stdin, text=True),
|
||||
claude_home=lambda: unready(claude_home(env, home), RELEASE_ROOT, lambda args: subprocess.run(["claude", *args], capture_output=True, env=claude_environment(env, home), stdin=subprocess.DEVNULL, text=True, timeout=home_timeout), git_repo.git),
|
||||
claude_home=lambda: unready(claude_home(env, home), RELEASE_ROOT, reports_folder(home, env), home / CLAUDE_HOME, lambda args: subprocess.run(["claude", *args], capture_output=True, env=claude_environment(env, home), stdin=subprocess.DEVNULL, text=True, timeout=home_timeout), git_repo.git),
|
||||
claude_on_terminal=claude_on_terminal,
|
||||
discard_typed=lambda: termios.tcflush(sys.stdin, termios.TCIFLUSH),
|
||||
dm=lambda text, directory: notify(text, directory, home, env, backends),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import contextlib
|
||||
import dataclasses
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import signal
|
||||
@@ -153,6 +154,33 @@ class ClaudeHomeEffect(unittest.TestCase):
|
||||
self.assertEqual(ran[-1], f"{built} auth status")
|
||||
self.assertIn(f"{built} plugin install code-review@claude-plugins-official", ran)
|
||||
|
||||
def test_lets_a_session_write_the_reports_folder_under_the_state_folder_it_is_given(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
claude = pathlib.Path(folder, "claude")
|
||||
claude.write_text('#!/bin/sh\necho \'{"loggedIn": true}\'\n')
|
||||
claude.chmod(0o755)
|
||||
home = pathlib.Path(folder, "home")
|
||||
state = pathlib.Path(folder, "moved state")
|
||||
|
||||
reason = system_effects(home, without_xdg_folders(os.environ) | {"PATH": f"{folder}:{os.environ['PATH']}", "XDG_STATE_HOME": str(state)}).claude_home()
|
||||
|
||||
self.assertIsNone(reason)
|
||||
written = json.loads((home / ".local" / "share" / "build-release" / "claude-home" / "settings.json").read_text())
|
||||
self.assertIn(str(state / "build-release" / "larv-review"), written["permissions"]["additionalDirectories"])
|
||||
|
||||
def test_keeps_the_instructions_of_the_persons_own_claude_home_out_of_the_loops(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
claude = pathlib.Path(folder, "claude")
|
||||
claude.write_text('#!/bin/sh\necho \'{"loggedIn": true}\'\n')
|
||||
claude.chmod(0o755)
|
||||
home = pathlib.Path(folder, "home")
|
||||
|
||||
reason = system_effects(home, without_xdg_folders(os.environ) | {"PATH": f"{folder}:{os.environ['PATH']}"}).claude_home()
|
||||
|
||||
self.assertIsNone(reason)
|
||||
written = json.loads((home / ".local" / "share" / "build-release" / "claude-home" / "settings.json").read_text())
|
||||
self.assertEqual(written["claudeMdExcludes"], [f"{home}/.claude/**"])
|
||||
|
||||
def test_a_plugin_that_does_not_install_stops_naming_the_command_and_what_claude_said(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
claude = pathlib.Path(folder, "claude")
|
||||
|
||||
@@ -10,7 +10,7 @@ RELEASE_ROOT = pathlib.Path(__file__).resolve().parents[2]
|
||||
|
||||
# Each folder below is named relative to the person's home folder.
|
||||
|
||||
# The person's own Claude home. No claude the loop starts runs there, and neither entry point reads or writes it: its name is for prose and for rule-hook's rules that guard it.
|
||||
# The person's own Claude home. No claude the loop starts runs there, and neither entry point reads or writes it: its name is for prose, for rule-hook's rules that guard it, and for the instructions the loop's home keeps out.
|
||||
CLAUDE_HOME = ".claude"
|
||||
# The name of the setup's own folder, in the config home and in the state home.
|
||||
SETUP = "build-release"
|
||||
@@ -89,7 +89,7 @@ def paths_from(home: pathlib.Path, env: Mapping[str, str]) -> Paths:
|
||||
return Paths(
|
||||
claude_code_transcripts=claude / "projects",
|
||||
claude_dir=claude,
|
||||
config_clone=home / "code" / "claude-config",
|
||||
config_clone=home / "code" / "dev-factory",
|
||||
config_folder=config,
|
||||
home=home,
|
||||
model_catalog=claude / "cache" / "model-catalog",
|
||||
|
||||
@@ -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 principles and standards, which lie in SETUP, and goals-and-audience, which is goals; 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. docs/decisions.md → `setup files: …` holds the bench that picked the prefix.
|
||||
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}}"')
|
||||
|
||||
|
||||
|
||||
@@ -7,27 +7,14 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from repo_checks import ROOT
|
||||
|
||||
PRIVATE = [
|
||||
".claude/settings.local.json",
|
||||
".credentials.json",
|
||||
"auto-mode-transcripts/a.jsonl",
|
||||
"backups/.claude.json.backup.1",
|
||||
"daemon-auth-status.json",
|
||||
"daemon.log",
|
||||
"daemon/control.key",
|
||||
"debug/a.txt",
|
||||
"file-history/a/b.md",
|
||||
"history.jsonl",
|
||||
"jobs/a/b.json",
|
||||
"memory/MEMORY.md",
|
||||
"paste-cache/a.txt",
|
||||
"projects/-home-a/a.jsonl",
|
||||
"projects/-home-a/memory/MEMORY.md",
|
||||
"projects/-home-a/memory/a.md",
|
||||
"session-env/a/b.sh",
|
||||
"sessions/a.json",
|
||||
"shell-snapshots/a.sh",
|
||||
"tasks/a/b.json",
|
||||
GENERATED = [
|
||||
"bin/__pycache__/a.cpython-313.pyc",
|
||||
"bin/agent_cycle/__pycache__/a.cpython-313.pyc",
|
||||
"presentation/build-release-explained.pdf",
|
||||
"reviewer-merge-trials/agents-wave3.json",
|
||||
"reviewer-merge-trials/clones/rm-a/b.py",
|
||||
"reviewer-merge-trials/results/a/b.json",
|
||||
"reviewer-merge-trials/runs.pkl",
|
||||
"workflow-bench/a-1-1.md",
|
||||
"workflow-bench/a-1-1/README.md",
|
||||
"workflow-bench/compare/a/A1/fixes.diff",
|
||||
@@ -44,6 +31,7 @@ class Gitignore(unittest.TestCase):
|
||||
ignored = subprocess.run(["git", "ls-files", "-oi", "--exclude-standard", "--", "bin/*.py", "bin/**/*.py"], capture_output=True, check=True, cwd=ROOT, text=True).stdout
|
||||
self.assertEqual(ignored, "")
|
||||
|
||||
def test_ignores_every_private_file(self):
|
||||
ignored = subprocess.run(["git", "check-ignore", "--no-index", "--stdin"], capture_output=True, cwd=ROOT, input="\n".join(PRIVATE), text=True).stdout
|
||||
self.assertEqual(ignored.splitlines(), PRIVATE)
|
||||
def test_ignores_every_generated_file(self):
|
||||
ignored = subprocess.run(["git", "check-ignore", "--no-index", "--stdin"], capture_output=True, cwd=ROOT, input="\n".join(GENERATED), text=True).stdout
|
||||
self.assertEqual(ignored.splitlines(), GENERATED)
|
||||
|
||||
|
||||
@@ -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. It names any other file as the setup's: `CLAUDE.md` → "Vocabulary", "setup". 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`; in a line a person types, name the clone as the README does, `~/build-release/bin/<tool>`")
|
||||
|
||||
|
||||
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, as that file's "Vocabulary" does, and names the loop's Claude home as the place to open a file of the setup: 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")
|
||||
|
||||
@@ -4,7 +4,7 @@ usage: self-update
|
||||
|
||||
Run it by its path in a clone of a release, as in <clone>/bin/self-update. It fetches origin's
|
||||
tags and checks out the newest v* tag, detached, so the clone holds only what a release holds.
|
||||
Development happens in another clone, such as ~/code/claude-config. It prints the clone and the version it moved
|
||||
Development happens in another clone, such as ~/code/dev-factory. It prints the clone and the version it moved
|
||||
from and to, then CHANGELOG.md's section for each version since, so you can do what each asks, such
|
||||
as a new step under Install.
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -142,16 +148,36 @@ class GatherTest(unittest.TestCase):
|
||||
self.assertEqual(errors.getvalue(), f"{self.bench} holds no digest: run task-bench in this checkout first.\n")
|
||||
|
||||
|
||||
class OnceReady(unittest.TestCase):
|
||||
def test_a_home_that_is_not_ready_gives_a_failed_run_that_says_why_on_stderr(self):
|
||||
done = once_ready(lambda: "not signed in", lambda *_: self.fail("claude started"))(["-p"], "/checkout", "asked")
|
||||
self.assertEqual((done.args, done.returncode, done.stdout, done.stderr), (["-p"], 1, "", "not signed in"))
|
||||
|
||||
def test_a_ready_home_runs_claude_with_what_it_was_given(self):
|
||||
ran = subprocess.CompletedProcess(["-p"], 0, "answered", "")
|
||||
calls: list[tuple[list[str], str, str]] = []
|
||||
self.assertIs(once_ready(lambda: None, lambda *given: calls.append(given) or ran)(["-p"], "/checkout", "asked"), ran)
|
||||
self.assertEqual(calls, [(["-p"], "/checkout", "asked")])
|
||||
|
||||
|
||||
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, and where gather's claude fails or hits a usage limit.
|
||||
"""
|
||||
import dataclasses
|
||||
import functools
|
||||
|
||||
@@ -35,7 +35,7 @@ JUDGE_RUN = "Judge run: "
|
||||
JUDGE_RUN_AT = re.compile(rf"^{re.escape(JUDGE_RUN)}({FOLDER}/[0-9a-f]{{64}}\.json)$", re.MULTILINE)
|
||||
|
||||
|
||||
# The claude-config release and commit that ran the cycle, on the line before JUDGE, such as `Config: v0.8.0 (<sha>)`.
|
||||
# The dev-factory release and commit that ran the cycle, on the line before JUDGE, such as `Config: v0.8.0 (<sha>)`.
|
||||
CONFIG = "Config: "
|
||||
# Opens the block of what the work since the previous outcome that recorded a spend spent; an outcome that didn't spend anything has none.
|
||||
SPENT = "Spent since "
|
||||
@@ -48,7 +48,7 @@ REVERSED_AT = re.compile(rf"^{re.escape(REVERSED)}\n((?:> .*\n)*> .*)", re.MULTI
|
||||
|
||||
|
||||
class Annotation(typing.NamedTuple):
|
||||
"""What a verdict, an interrupt or a quoted answer records beside its judge lines, so a change to the setup can be judged before and after: docs/decisions.md → `build-release: each verdict records the claude-config release and commit that ran it…`. Each part is left out where empty; the cycle always gives config."""
|
||||
"""What a verdict, an interrupt or a quoted answer records beside its judge lines, so a change to the setup can be judged before and after: docs/decisions.md → `build-release: each verdict records the dev-factory release and commit that ran it…`. Each part is left out where empty; the cycle always gives config."""
|
||||
config: str = ""
|
||||
# The block spent_block renders.
|
||||
spent: str = ""
|
||||
|
||||
@@ -18,3 +18,5 @@ git bundle create - HEAD | docker run --rm -i ${CI_CONTAINER:+--name "$CI_CONTAI
|
||||
# On a failure, the CI log shows the whole pytest output, which run-tests saved to its log file.
|
||||
PATH="$HOME/.local/bin:$PATH" bin/run-tests || { cat /tmp/run-tests-*.log; exit 1; }
|
||||
'
|
||||
# Then a newcomer's first chunk, in a container of its own: first-chunk-e2e/first_chunk.py says what it checks.
|
||||
sh first-chunk-e2e/run
|
||||
|
||||
@@ -4793,3 +4793,86 @@ Inherited architect, would restructure first:
|
||||
- Locality: `bin/rule_hook/round_cap.py:10` `round_cap_breaches`: the round cap has four homes and fails open at `earlier_titles`
|
||||
- Locality: `bin/agent_cycle/routing.py:115` `unfinished_route`: routing is spread over four homes
|
||||
- Locality: `bin/transcript_archive/outcomes.py:11` `outcomes`: a line format parsed by regex in four readers
|
||||
|
||||
## 2026-12-04T07:58:11Z, PR #813 at 5070d896
|
||||
|
||||
| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |
|
||||
|---|---|---|---|---|---|
|
||||
| Junior A | 7 | 6 | 6 | 6 | 6.5 |
|
||||
| Mid A | 7 | 5.5 | 6.5 | 6 | 6 |
|
||||
| Maintainability senior | 7 | 5.5 | 6 | 6 | 6 |
|
||||
| Inherited architect | 7 | 7 | 6 | 6 | 6.5 |
|
||||
| Mean | 7.00 | 6.00 | 6.13 | 6.00 | 6.25 |
|
||||
|
||||
Junior A, hardest first:
|
||||
|
||||
- Self-sufficiency, Locality: `bin/agent_cycle/routing.py:115` `unfinished_route`: five rungs held at once, the escalation mark in another module
|
||||
- Locality, Shape: `bin/chunk_pr/main.py:462` `merged`: a queue loop carrying flock, approval, human-merge, park and epic-base variants, and a side trip to `remeasure`
|
||||
- Shape, Self-sufficiency: `bin/task_bench/main.py:242` `Planner`: three layers of curried callables, and the Rust test-module rules in one chain of nested clauses
|
||||
- Self-sufficiency, Locality: `skills/larv-review/SKILL.md:109` "Re-entry": a nine-row table whose exceptions and the round cap sit in other sections
|
||||
- Locality, Shape: `bin/build_epic/main.py:241` `chunk_run`: one loop over `str | Stop | Merged` with about 30 imports
|
||||
|
||||
Mid A, hardest first:
|
||||
|
||||
- Locality, Shape: `bin/chunk_pr/main.py:530` `merge_turn`: about seven decisions in a row, with the order of side effects load-bearing and unstated
|
||||
- Locality: `bin/build_epic/scheduler.py:178` `start_chunks`: state carried in tmux window-name suffixes written in another package
|
||||
- Locality: `bin/build_epic/parking.py:26` `parked_through`: park state spread over a file, a window name and the forge, with a mutable `Told`
|
||||
- Self-sufficiency: `bin/agent_cycle/routing.py:115` `unfinished_route`: five rungs, the reason in the decision log
|
||||
- Shape: `bin/task_bench/main.py:243` `Planner`: closures three deep
|
||||
|
||||
Maintainability senior, hardest first:
|
||||
|
||||
- Locality: `bin/build_epic/scheduler.py:178` `start_chunks`: correctness depends on window names that `parking.py` writes
|
||||
- Locality, Shape: `bin/build_epic/parking.py:26` `parked_through`: one chunk's parked state in three places, order stated and not justified
|
||||
- Locality: `bin/chunk_pr/main.py:462` `merged`: failure mid-merge decided in sibling tools
|
||||
- Shape: `bin/build_epic/main.py:241` `chunk_run`: `news` typed `str | Stop | Merged`, the empty string never named
|
||||
- Locality: `bin/agent_cycle/judge.py:79` `TASK_HEADING`: a heading wording that replay parses, held by a comment alone
|
||||
|
||||
Inherited architect, would restructure first:
|
||||
|
||||
- Navigation, Shape: `README.md:276` "Packages under bin/": the only map of a flat `bin/` of about 83 entries
|
||||
- Locality: `bin/rule_hook/round_cap.py:10` `round_cap_breaches`: the round count lives in four places with two failure policies
|
||||
- Shape: `bin/chunk_pr/main.py:462` `merged`: a 778-line module with seven subcommands
|
||||
- Self-sufficiency: `bin/build_epic/__init__.py:1` the empty package docstring, with 22 modules citing one decision entry
|
||||
- Self-sufficiency: `.claude/rules/this-repo-keeps-no-agents-md.md:3` a rationale that says `~/.claude` is a checkout of this repo
|
||||
|
||||
## 2026-12-04T08:00:09Z, PR #813 rerun at 5070d896
|
||||
|
||||
| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |
|
||||
|---|---|---|---|---|---|
|
||||
| Junior A | 7 | 5.5 | 6 | 6 | 6 |
|
||||
| Mid A | 7 | 5.5 | 6 | 5.5 | 6 |
|
||||
| Maintainability senior | 7 | 5.5 | 6 | 6 | 6 |
|
||||
| Inherited architect | 7 | 6.5 | 6 | 6.5 | 6.5 |
|
||||
| Mean | 7.00 | 5.75 | 6.00 | 6.00 | 6.13 |
|
||||
|
||||
Junior A, hardest first:
|
||||
|
||||
- Self-sufficiency, Locality: `bin/agent_cycle/routing.py:115` `unfinished_route`: five rungs and a counter held at once, the escalation mark in another module
|
||||
- Locality, Shape: `bin/build_epic/main.py:241` `chunk_run`: `news` typed `str | Stop | Merged`, its exit test readable only after `parked_through`
|
||||
- Locality: `bin/build_epic/parking.py:118` `resumed_news`: a polling loop whose mutable `Told` renames tmux windows
|
||||
- Locality, Shape: `bin/chunk_pr/main.py:462` `merged`: a flock queue, an approval wait and by-human, to-epic and park flags
|
||||
- Shape: `bin/task_bench/main.py:242` `Planner`: a callable that returns a callable that returns a callable
|
||||
|
||||
Mid A, hardest first:
|
||||
|
||||
- Locality: `bin/build_epic/parking.py:26` `parked_through`: state in files, tmux window names and the slot scheduler
|
||||
- Locality, Shape: `bin/chunk_pr/main.py:462` `merged`: a name that returns a str, with a hidden `scoring-run-owed` call
|
||||
- Locality, Shape: `bin/build_epic/scheduler.py:178` `start_chunks`: five derived sets and an elif ladder under a lock
|
||||
- Self-sufficiency: `bin/agent_cycle/routing.py:115` `unfinished_route`: rungs, floor, cap and mark interacting
|
||||
- Shape: `bin/release_plan/release_standing.py:206` `next_release`: a boolean expression that reads as a puzzle
|
||||
|
||||
Maintainability senior, hardest first:
|
||||
|
||||
- Locality: `bin/build_epic/scheduler.py:178` `start_chunks`: the scheduler's state is a tmux window name that `tmux.py` writes
|
||||
- Locality, Shape: `bin/build_epic/main.py:241` `chunk_run`: whether the loop ends depends on `news == ""` together with `Finished`
|
||||
- Locality: `bin/chunk_pr/main.py:462` `merged`: sentinels and two flags that switch each other off, a scoring-run check inside the turn
|
||||
- Locality: `bin/build_release/loop/chunk_windows.py:46` `held_items`: which chunks start depends on a worker's `Chunk items:` line
|
||||
- Locality: `bin/build_release/loop/reload.py:97` `exec_if_edited`: any edit under `bin/` reloads a live loop
|
||||
|
||||
Inherited architect, would restructure first:
|
||||
|
||||
- Navigation, Shape: `README.md:276` "Packages under bin/": the only map of a flat `bin/` of about 85 entries
|
||||
- Shape: `bin/chunk_pr/main.py:1` `chunk_pr`: 778 lines, 35 functions, seven subcommands
|
||||
- Locality: `bin/rule_hook/round_cap.py:10` `round_cap_breaches`: the round cap lives in prose, a constant and a hook
|
||||
- Self-sufficiency: `.claude/rules/this-repo-keeps-no-agents-md.md:3` a rationale that says `~/.claude` is a checkout of this repo
|
||||
|
||||
+19
-7
@@ -18,14 +18,14 @@ Each project principle states one rule that the decisions below apply; their ent
|
||||
- bin/: the tools send no OTLP traces, logs or metrics, and build-release's archive holds the trace of each cycle
|
||||
- bin/: the tools support only the latest stable Python, and the tests, written in plain unittest, run on it in four pytest-xdist workers
|
||||
- build-epic: drives one Jira epic whose items span repos, or have none, ranked by the epic's goals, then code health, then each repo's goals, and closes the epic only once the human confirms every goal
|
||||
- build-release: each verdict records the claude-config release and commit that ran it, the raw tokens each thread spent by model and kind since the previous outcome that recorded a spend, and the human's typed answer the judge quotes as reversing a choice the worker took on its own recommendation
|
||||
- build-release: each verdict records the dev-factory release and commit that ran it, the raw tokens each thread spent by model and kind since the previous outcome that recorded a spend, and the human's typed answer the judge quotes as reversing a choice the worker took on its own recommendation
|
||||
- build-release: each chunk runs in its own tmux window, of one tmux session per project, up to `parallel-chunks` at once, and needs tmux 3.2; its claude session is named after its window, its id derived from that name; a chunk's commit in the config's folder takes only the file it changed
|
||||
- chunk-pr: the chunks of a project merge one at a time on a machine, each finishing its plan items in its turn, and a pull request that waits for an approval leaves the queue while it waits
|
||||
- Claude Code in a home of its own: a `CLAUDE_CONFIG_DIR` home loads `CLAUDE.md`, rules, agents, skills, hooks and plugins, and `CLAUDE_CODE_OAUTH_TOKEN` signs in there, but never under `--bare`
|
||||
- deploy: this repo keeps no `AGENTS.md`, since `~/.claude` is its checkout; its principles and decision titles head `docs/decisions.md`, its working rules follow them there, and its `.claude/settings.json` excludes every `.claude/CLAUDE.md`, so a session in the clone loads only the clone's `CLAUDE.md`
|
||||
- epic-branch: an epic's chunks branch off and merge into a working branch its project's config names, without a person, and a person merges that branch into the default branch in one pull request
|
||||
- machine load: a heavy command waits for one of the machine's heavy slots, one for every 4 CPUs, which every session shares, and build-release starts a worker only while at least a quarter of the machine's memory is available
|
||||
- names: the plan calls the project and its repo `dev-factory`, its commands are `build-release` and `build-epic` with no old name kept as an alias, and the code keeps its other names until their planned items ship
|
||||
- names: the project and its repo are `dev-factory`, its commands are `build-release` and `build-epic` with no old name kept as an alias, and the code keeps its other names until their planned items ship
|
||||
- principles: about seven things per level, four or five where they act on each other, more where a reader finds them by name; crossing a limit asks for a grouping or a recorded reason
|
||||
- project config: a record may name a Confluence Cloud page as `confluence:` and its address, the loop reads and writes it as markdown, and a write never overwrites a save made since the loop's read
|
||||
- project config: a tool that reads a file's commits says where it does not support that file, and the work goes on
|
||||
@@ -132,6 +132,7 @@ The cap is 5, `bin/plan/todo_table.py`'s `BUNDLE_MAX_R`, from the same chunks: b
|
||||
2026-11-20, lilleman's standalone-install plan. Serves goal 3, which keeps the setup out of the human's `~/.claude`, and goal 5: a home of its own keeps the loop's transcripts and token apart from the human's. The plan therefore runs every claude the loop starts in a home of its own, and doesn't load the setup with `--plugin-dir`, `--settings` and `--append-system-prompt-file` over the human's home. The probes ran on Claude Code 2.1.330, on throwaway homes, never the human's. A mock Messages API at `ANTHROPIC_BASE_URL` recorded each request and answered the first with a tool call that reads a file, so the system prompt and the tool results show what loaded, with no real token. A bullet that names 2.1.336 was probed on that version instead. Each result holds for the version it was probed on; repeat the probes when the version changes.
|
||||
|
||||
- **Loads from `$CLAUDE_CONFIG_DIR`:** `CLAUDE.md` (in the system prompt), `rules/*.md` (one with `paths:` entered the context after the model read a matching file, not before), `agents/`, `skills/`, the hooks of `settings.json` (a `SessionStart` hook ran) and plugins. `claude plugin marketplace add` and `claude plugin install` write to `<home>/plugins`, and the installed plugin's skill is listed. `.claude.json` lands in the home too, so the human's `~/.claude.json` stays theirs.
|
||||
- **The human's own `~/.claude/CLAUDE.md` and `~/.claude/rules/` load too, unless the home's settings exclude them.** 2026-12-04, found by `first-chunk-e2e/run` on Claude Code 2.1.336: claude reads `.claude/CLAUDE.md` and `.claude/rules/` in every folder above its working folder as project instructions, and the human's home folder is above each project they keep under it. Both reached the worker's request in the loop's home. A `SessionStart` hook in the human's `~/.claude/settings.json` didn't run. So `bin/claude_home` writes `claudeMdExcludes` into the home's `settings.json`, naming everything under the human's `~/.claude`, after which neither loads. The exclusion also drops a rule file the home reaches through a link, though not a linked `CLAUDE.md`, so `bin/claude_home` refuses a release cloned in the human's `~/.claude`: none of its `rules/` would load. Not tested: a `CLAUDE.md` in the human's home folder itself, which is outside their Claude home.
|
||||
- **The loop's home signs in by `/login`.** 2026-12-03, lilleman, planning 0.18.0: the human signs in once, in a claude started with `CLAUDE_CONFIG_DIR` naming the loop's home, and makes and keeps no long-lived token file. `bin/claude_home` asks `claude auth status` before a command starts a chunk. Probed on Claude Code 2.1.336 in a throwaway home: signed out, it prints JSON with `loggedIn: false` and exits 1. Not tested: where the home keeps the sign-in. The token below stays the way a container signs in, as task-bench does.
|
||||
- **Signs in by `CLAUDE_CODE_OAUTH_TOKEN`:** the request carried `Authorization: Bearer <token>` with the `oauth-2025-04-20` beta, and `claude auth status` said `loggedIn: true, authMethod: oauth_token`. The home didn't hold a credentials file. Without the variable the home is `loggedIn: false`. Not tested: that Anthropic accepts a real token, since `claude setup-token` needs the human's browser sign-in. The authentication docs say the token lasts one year and can only make model requests; neither is tested, and the first real run shows whether it signs in.
|
||||
- **`--bare` can't use that token.** With `CLAUDE_CODE_OAUTH_TOKEN`, it says `Not logged in · Please run /login` and doesn't send a request. With `ANTHROPIC_API_KEY` it signs in, but doesn't load anything from the home (`CLAUDE.md`, rules, agents or skills) and offers only Bash, Edit and Read. So a container that signs in by a long-lived token runs without `--bare`; its fresh home is empty, so nothing of the human's loads there either. The project's `CLAUDE.md` loads from the working folder, and its `AGENTS.md` only where the project has no `CLAUDE.md`.
|
||||
@@ -140,13 +141,13 @@ The cap is 5, `bin/plan/todo_table.py`'s `BUNDLE_MAX_R`, from the same chunks: b
|
||||
|
||||
## loop's Claude home: `bin/claude_home` generates it in the data folder from the clone it ships in, with links to the clone's instruction files and a `settings.json` whose `{clone}` it fills in
|
||||
|
||||
2026-12-04, lilleman's plan for 0.18.0. Serves goal 3. `bin/claude_home` builds the home in the data folder, `~/.local/share/build-release/claude-home`, so the clone stays a clean checkout: the files Claude Code keeps in its home never reach a commit. Only a change made through one of the four links below reaches the clone. `bin/claude_home` links `CLAUDE.md`, `rules/`, `agents/` and `skills/` to the clone's, and writes `settings.json` from the clone's with the clone's path in place of `{clone}`, since the clone may lie anywhere and the tracked file can't hold its path. It builds the home again when the clone's commit or path changes, which covers a release's tag and a development clone alike. Probed on 2.1.336, once, while the home was built: `claude plugin install` finds a plugin only after `claude plugin marketplace add` of its marketplace; each exits 0 where its work is already done; and an install rewrites the home's `settings.json` in Claude Code's key order. Not tested: that a session loads the four through links, which needs a model request.
|
||||
2026-12-04, lilleman's plan for 0.18.0. Serves goal 3. `bin/claude_home` builds the home in the data folder, `~/.local/share/build-release/claude-home`, so the clone stays a clean checkout: the files Claude Code keeps in its home never reach a commit. Only a change made through one of the six links below reaches the clone. `bin/claude_home` links `agents/`, `bin/`, `CLAUDE.md`, `principles/`, `rules/` and `skills/` to the clone's, `bin/` and `principles/` since `setup files: …` below, and writes `settings.json` from the clone's with the clone's path in place of `{clone}`, since the clone may lie anywhere and the tracked file can't hold its path. It builds the home again when the clone's commit or path changes, which covers a release's tag and a development clone alike. Probed on 2.1.336, once, while the home was built: `claude plugin install` finds a plugin only after `claude plugin marketplace add` of its marketplace; each exits 0 where its work is already done; and an install rewrites the home's `settings.json` in Claude Code's key order. Not tested: that a session loads `agents/`, `CLAUDE.md`, `rules/` and `skills/` through links, which needs a model request.
|
||||
|
||||
## comprehension floor: every dimension and the overall at the project's readability floor or above is the target, and no score blocks a merge or release
|
||||
|
||||
2026-09-27, lilleman, restating the 2026-09-24 target and extending it to the overall. Serves goal 1. 2026-10-13, lilleman: the floor doesn't block anything, and `review: the comprehension check records …` says why. Valid while the scoring run keeps its four seats. 2026-11-12, lilleman, through todo item 358: a project's config sets this floor as `readability-floor`, its readability floor, since legacy code scores low. It is 7.0 where left out, and the signal stays that the score rises. Readers seated as the person who writes the config picked the key, 2 of 3.
|
||||
|
||||
## deploy: a clone of a release holds only that release, which its own `bin/self-update` moves it to; this repo is developed in `~/code/claude-config`, where build-release runs its chunks like any project's
|
||||
## deploy: a clone of a release holds only that release, which its own `bin/self-update` moves it to; this repo is developed in `~/code/dev-factory`, where build-release runs its chunks like any project's
|
||||
|
||||
2026-10-29, lilleman. Serves goal 1.3 and goal 2. `~/.claude` was this repo's development checkout, so every merge reached every session on the machine at once, its unfinished work included, while other machines took only tags. Now each machine takes only releases: what a release holds is what every session runs, and cutting one is the human's step that ships it. `self-update` automates README → Update. It refuses an uncommitted change to a tracked file that the new tag doesn't hold, such as a rule edited through a link of the loop's Claude home, and a move that would drop commits no release holds. 2026-12-03, lilleman, in the standalone-install plan: a release is run from a clone by the path of its `bin/`, so `self-update` moves the clone it ships in and takes no argument, in place of `deploy-release`, which ran from the development clone. Three fresh readers, seated as a person who installed a release, a consultant new to it and the maintainer, each picked `bin/self-update` over `build-release self-update`, which read as a task handed to build-release, and over `update-release`, `update` and `take-release`. 2026-12-04, lilleman's plan for 0.18.0, with the loop's Claude home: the clone lies anywhere but `~/.claude`, and Claude Code's own writes go to the generated home. Valid while every claude the loop starts reads its configuration from one home per machine.
|
||||
|
||||
@@ -271,7 +272,7 @@ Valid while claude takes `--session-id` and resumes by it, and the human runs bu
|
||||
|
||||
`claude_reply` reads stream-json for every caller, so the judge's runs are streams too; the archive's `JudgeRun` stays as it was, since a judge has no tools and one turn. Valid while transcripts stay small enough to copy whole.
|
||||
|
||||
## build-release: each verdict records the claude-config release and commit that ran it, the raw tokens each thread spent by model and kind since the previous outcome that recorded a spend, and the human's typed answer the judge quotes as reversing a choice the worker took on its own recommendation
|
||||
## build-release: each verdict records the dev-factory release and commit that ran it, the raw tokens each thread spent by model and kind since the previous outcome that recorded a spend, and the human's typed answer the judge quotes as reversing a choice the worker took on its own recommendation
|
||||
|
||||
2026-11-12, lilleman, todo item 305. Serves goals 1, 1.2 and 1.4. A change to the setup can be judged only by comparing chunks run before it with chunks run after, so each verdict, interrupt and quoted answer in build-release's archive records three things beside its judge lines.
|
||||
|
||||
@@ -340,9 +341,9 @@ The heavy command in that hang started its container from the project's own scri
|
||||
|
||||
A daemon-wide cap would see every container: dockerd's `cgroup-parent`, given a memory limit. lilleman turned it down, since it is host config and would cap a project's heavy work too. Valid while sessions start their work in containers on a machine they share.
|
||||
|
||||
## names: the plan calls the project and its repo `dev-factory`, its commands are `build-release` and `build-epic` with no old name kept as an alias, and the code keeps its other names until their planned items ship
|
||||
## names: the project and its repo are `dev-factory`, its commands are `build-release` and `build-epic` with no old name kept as an alias, and the code keeps its other names until their planned items ship
|
||||
|
||||
2026-11-28, lilleman, part of the standalone-install plan approved on 2026-11-20. Serves goal 2: a person who clones a release meets commands named for what they make. The names set the install folders, such as `~/.config/build-release/`. lilleman chose `build-release` over the proposed `do-release` because "do" reads as if the command cuts the release, which stays the human's. "Build" says it makes what the release holds, and `build-epic` follows it for an epic. Neither name has "claude" in it, which fits goal 6, a setup that doesn't depend on Claude Code. `loop-claude` has been renamed `build-release`, and `do-epic` has been renamed `build-epic`; the code keeps its other names until item 576 ships, in 0.18.0. On 2026-12-03 lilleman chose a hard break for the renames to `build-release`, `build-epic` and `dev-factory`: no old name stays as an alias. The `build-epic` rename applied it to the tool's own names too, so no name of the old tool lingers: its issue labels, which sit in a client's Jira, its config, state and transcripts folders and its `BUILD_EPIC_E2E_*` variables take the new name. Renaming the repo on the forge is the human's. Valid while the install folders are named for `build-release`.
|
||||
2026-11-28, lilleman, part of the standalone-install plan approved on 2026-11-20. Serves goal 2: a person who clones a release meets commands named for what they make. The names set the install folders, such as `~/.config/build-release/`. lilleman chose `build-release` over the proposed `do-release` because "do" reads as if the command cuts the release, which stays the human's. "Build" says it makes what the release holds, and `build-epic` follows it for an epic. Neither name has "claude" in it, which fits goal 6, a setup that doesn't depend on Claude Code. `loop-claude` has been renamed `build-release`, and `do-epic` has been renamed `build-epic`; 0.18.0 names the project `dev-factory` in the README, the prose and the tools, and the code keeps its other names, such as `CLAUDE.md`, until item 496 ships. A record of a past measurement or talk keeps the name it was made under: the transcript paths and project keys in `reviewer-merge-trials/`, and everything under `presentation/`. On 2026-12-03 lilleman chose a hard break for the renames to `build-release`, `build-epic` and `dev-factory`: no old name stays as an alias. The `build-epic` rename applied it to the tool's own names too, so no name of the old tool lingers: its issue labels, which sit in a client's Jira, its config, state and transcripts folders and its `BUILD_EPIC_E2E_*` variables take the new name. Renaming the repo on the forge is the human's. Valid while the install folders are named for `build-release`.
|
||||
|
||||
## principles: about seven things per level, four or five where they act on each other, more where a reader finds them by name; crossing a limit asks for a grouping or a recorded reason
|
||||
|
||||
@@ -846,6 +847,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 worker of the chunk whose plan item asked for one spelling, on the bench below. 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 name such a file as the setup's, as in 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 where a claude runs it. A line a person types in their own shell names it in the clone, as the README does: `~/build-release/bin/run-heavy`.
|
||||
- **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`, `$CLAUDE_CONFIG_DIR` 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,114 @@ 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
|
||||
|
||||
## Reading cost, chunk 338e966493fc, finished 2026-12-04T03:26:52Z
|
||||
|
||||
62696 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `README.md` 7
|
||||
- `.gitignore` 3
|
||||
- `bin/build_epic/test_main.py` 3
|
||||
- `bin/rule_hook/rules.py` 2
|
||||
- `ci.sh` 2
|
||||
- `CHANGELOG.md` 1
|
||||
- `bin/mutate_changes/tool_process.py` 1
|
||||
- `bin/repo_checks/test_gitignore.py` 1
|
||||
- `bin/rule_hook/main.py` 1
|
||||
- `bin/run-tests` 1
|
||||
|
||||
## Reading cost, chunk dedf3d6e1aca, finished 2026-12-04T03:51:53Z
|
||||
|
||||
71912 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `README.md` 4
|
||||
- `bin/loop_effects/effects.py` 4
|
||||
- `bin/loop_state/paths.py` 4
|
||||
- `CHANGELOG.md` 3
|
||||
- `bin/claude_home/test_home.py` 2
|
||||
- `bin/claude_home/home.py` 1
|
||||
- `bin/review_rules/review_folder.py` 1
|
||||
- `settings.json` 1
|
||||
|
||||
## Reading cost, chunk a7593c957df7, finished 2026-12-04T04:31:15Z
|
||||
|
||||
87399 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `README.md` 3
|
||||
- `rules/todo-items.md` 3
|
||||
- `CLAUDE.md` 1
|
||||
- `bin/claude_home/home.py` 1
|
||||
- `skills/larv-review/review-findings.md` 1
|
||||
- `todo.md` 1
|
||||
|
||||
## Reading cost, chunk 85d4c360f075, finished 2026-12-04T05:26:32Z
|
||||
|
||||
77732 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `README.md` 9
|
||||
- `docs/decisions.md` 8
|
||||
- `CHANGELOG.md` 7
|
||||
- `bin/build_release/loop/usage.py` 5
|
||||
- `presentation/README.md` 2
|
||||
- `bin/loop_state/paths.py` 1
|
||||
- `presentation/index.html` 1
|
||||
- `todo.md` 1
|
||||
|
||||
## Reading cost, chunk 887a12bda0b0, finished 2026-12-04T05:37:56Z
|
||||
|
||||
160746 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `README.md` 7
|
||||
- `bin/claude_home/home.py` 4
|
||||
- `bin/loop_effects/doubles.py` 4
|
||||
- `bin/build_release/loop/main.py` 3
|
||||
- `bin/loop_state/paths.py` 3
|
||||
- `bin/test_env.py` 2
|
||||
- `.gitignore` 1
|
||||
- `bin/build-epic` 1
|
||||
- `bin/build-release` 1
|
||||
- `bin/build_release/loop/test_main.py` 1
|
||||
|
||||
## Reading cost, chunk e61c74f0c138, finished 2026-12-04T07:47:29Z
|
||||
|
||||
78968 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `bin/agent_cycle/judge.py` 4
|
||||
- `README.md` 3
|
||||
- `bin/claude_home/home.py` 3
|
||||
- `bin/agent_cycle/worker.py` 2
|
||||
- `bin/build_release/loop/main.py` 2
|
||||
- `bin/loop_effects/effects.py` 2
|
||||
- `.gitignore` 1
|
||||
- `bin/agent_cycle/verdicts.py` 1
|
||||
- `bin/transcript_archive/__init__.py` 1
|
||||
- `bin/transcript_archive/outcomes.py` 1
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# A newcomer's machine, with nothing of this repo. The python tag is ci.sh's. git and tmux come from Debian's current apt: the run needs no exact version.
|
||||
FROM python:3.14.8
|
||||
RUN apt-get update \
|
||||
&& apt-get install --yes --no-install-recommends git tmux \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
# Claude Code refuses to skip permission prompts as root.
|
||||
RUN useradd --create-home newcomer
|
||||
USER newcomer
|
||||
WORKDIR /home/newcomer
|
||||
ENV PATH=/home/newcomer/.local/bin:$PATH
|
||||
# The version the latest probes of docs/decisions.md → `Claude Code in a home of its own` ran on.
|
||||
RUN curl --fail --silent --show-error --location https://claude.ai/install.sh | bash -s 2.1.336
|
||||
@@ -0,0 +1,172 @@
|
||||
"""Runs a first chunk as a newcomer would, and checks that the person's own Claude home is left as it was.
|
||||
|
||||
It runs in the container of the Dockerfile beside it, from a clone of this repo: `first-chunk-e2e/run` starts it. The machine holds a stock Claude Code with its own `~/.claude`, to which this adds what a person keeps there: instructions, a rule, a skill, an agent, a command and a hook. build-release then runs a task in a small project, with claude calling the mock Messages API. The run passes where the chunk finished on the setup's instructions, no request held the person's own, and `~/.claude` and `~/.claude.json` hold what they held before.
|
||||
"""
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
import mock_messages_api
|
||||
|
||||
CLONE = pathlib.Path(__file__).resolve().parent.parent
|
||||
HOME = pathlib.Path.home()
|
||||
# Under ~/code, so the project's key is `first-project`: bin/transcript_archive/project_key.py.
|
||||
PROJECT = HOME / "code" / "first-project"
|
||||
ARCHIVE = HOME / ".local/state/build-release/transcripts/first-project"
|
||||
CONFIG = HOME / ".config/build-release/first-project/config.toml"
|
||||
# What the person's own `~/.claude` holds beside the stock install's files. None of it loads in the loop's home, so no request may hold any of OWN_TEXTS, and the hook never runs.
|
||||
OWN_INSTRUCTION = "Sign every reply as the newcomer's own claude."
|
||||
OWN_RULE = "Open every reply with the newcomer's own greeting."
|
||||
OWN_SKILL = "Folds the newcomer's own paper cranes."
|
||||
OWN_AGENT = "Waters the newcomer's own ferns."
|
||||
OWN_COMMAND = "Winds the newcomer's own clock."
|
||||
OWN_TEXTS = (OWN_INSTRUCTION, OWN_RULE, OWN_SKILL, OWN_AGENT, OWN_COMMAND)
|
||||
OWN_HOOK_RAN = HOME / "own-hook-ran"
|
||||
OWN_FILES = {
|
||||
"CLAUDE.md": OWN_INSTRUCTION + "\n",
|
||||
# In two parts: bin/repo_checks/test_citations.py takes a rule file's path written whole for a citation of the setup's rules, and fails where the setup has no such file.
|
||||
os.path.join("rules", "greeting.md"): OWN_RULE + "\n",
|
||||
"skills/cranes/SKILL.md": f"---\nname: cranes\ndescription: {OWN_SKILL}\n---\n\nFold one.\n",
|
||||
"agents/ferns.md": f"---\nname: ferns\ndescription: {OWN_AGENT}\n---\n\nWater one.\n",
|
||||
"commands/clock.md": f"---\ndescription: {OWN_COMMAND}\n---\n\nWind it.\n",
|
||||
"settings.json": json.dumps({"hooks": {"SessionStart": [{"hooks": [{"type": "command", "command": f"touch {OWN_HOOK_RAN}"}]}]}}) + "\n",
|
||||
}
|
||||
# A heading of the setup's CLAUDE.md, which the worker's request holds where the loop's home loaded.
|
||||
SETUP_INSTRUCTION = "## Working loop"
|
||||
# What build-release asks before a project's first chunk, and the model the newcomer types: one on the shipped routing ladder.
|
||||
MODEL_QUESTION = "name claude --model takes:"
|
||||
MODEL = "claude-opus-5-5"
|
||||
# The seconds build-release may take to return, and the seconds the chunk may take after that.
|
||||
PATIENCE = 300
|
||||
README = """# first-project
|
||||
|
||||
## Goals
|
||||
|
||||
1. **Achieve:** Keep a note of what the project is for.
|
||||
- Signal: the note exists.
|
||||
- Counter-signal: the note says what the project isn't for.
|
||||
- Why: a note that misleads is worse than none.
|
||||
|
||||
## Audience
|
||||
|
||||
Whoever runs the first chunk.
|
||||
"""
|
||||
# README.md → Install → "Set up a project" gives this config for a project of one's own.
|
||||
CONFIG_TEXT = """checkout = "~/code/first-project"
|
||||
plan = "checkout:todo.md"
|
||||
working-rules = "checkout:AGENTS.md"
|
||||
decisions = "checkout:docs/decisions.md"
|
||||
score-anchors = "checkout:docs/score-anchors.md"
|
||||
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 = "setup:principles"
|
||||
standards = "setup:skills/larv-review/standards"
|
||||
"""
|
||||
|
||||
|
||||
def snapshot(*roots: pathlib.Path) -> dict[str, str]:
|
||||
"""What each root holds: every path under it with its mode, and a file's content hash or a link's target."""
|
||||
held = {}
|
||||
for root in roots:
|
||||
for path in [root, *sorted(root.rglob("*"))] if root.is_dir() else [root]:
|
||||
status = path.lstat()
|
||||
if path.is_symlink():
|
||||
content = f"link to {os.readlink(path)}"
|
||||
elif path.is_file():
|
||||
content = hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
else:
|
||||
content = "folder"
|
||||
held[str(path)] = f"{status.st_mode:o} {content}"
|
||||
return held
|
||||
|
||||
|
||||
def git(*args: str) -> None:
|
||||
subprocess.run(["git", "-c", "user.name=Newcomer", "-c", "user.email=newcomer@example.com", "-c", "init.defaultBranch=main", *args], check=True, cwd=PROJECT, stdout=subprocess.DEVNULL)
|
||||
|
||||
|
||||
def project_made() -> None:
|
||||
"""Makes the project: a checkout with the premises in its README, a remote it is pushed to, and its config."""
|
||||
CONFIG.parent.mkdir(parents=True)
|
||||
CONFIG.write_text(CONFIG_TEXT, encoding="utf-8")
|
||||
PROJECT.mkdir(parents=True)
|
||||
(PROJECT / "README.md").write_text(README, encoding="utf-8")
|
||||
git("init", "--quiet")
|
||||
git("add", "README.md")
|
||||
git("commit", "--quiet", "-m", "State the goals and the audience")
|
||||
git("init", "--quiet", "--bare", str(HOME / "first-project.git"))
|
||||
git("remote", "add", "origin", str(HOME / "first-project.git"))
|
||||
git("push", "--quiet", "--set-upstream", "origin", "main")
|
||||
|
||||
|
||||
def chunk_finished() -> bool:
|
||||
return any("Verdict: finished" in outcomes.read_text(encoding="utf-8") for outcomes in ARCHIVE.glob("*/*.outcomes.md"))
|
||||
|
||||
|
||||
def windows() -> str:
|
||||
"""What each tmux window of the loop shows."""
|
||||
listed = subprocess.run(["tmux", "list-panes", "-a", "-F", "#{pane_id}"], capture_output=True, text=True).stdout.split()
|
||||
return "\n".join(subprocess.run(["tmux", "capture-pane", "-p", "-J", "-S", "-200", "-t", pane], capture_output=True, text=True).stdout.strip() for pane in listed)
|
||||
|
||||
|
||||
def chunk_awaited() -> None:
|
||||
"""Types the project's model into the chunk's window once build-release asks for it there, then waits until the chunk finishes or PATIENCE runs out."""
|
||||
deadline = time.monotonic() + PATIENCE
|
||||
while MODEL_QUESTION not in windows() and time.monotonic() < deadline:
|
||||
time.sleep(1)
|
||||
subprocess.run(["tmux", "send-keys", "-t", "loop-first-project:", MODEL, "Enter"], capture_output=True)
|
||||
while not chunk_finished() and time.monotonic() < deadline:
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
def failures(requests: mock_messages_api.Requests, before: dict[str, str]) -> list[str]:
|
||||
"""Each way the run broke what it checks."""
|
||||
found = []
|
||||
texts = requests.texts()
|
||||
if not chunk_finished():
|
||||
found.append(f"no chunk finished within {PATIENCE} s; the loop's tmux windows show:\n{windows()}")
|
||||
if not any(SETUP_INSTRUCTION in text for text in texts):
|
||||
found.append(f"none of claude's {len(texts)} requests held the setup's CLAUDE.md, so the loop's home did not load")
|
||||
for own in OWN_TEXTS:
|
||||
if any(own in text for text in texts):
|
||||
found.append(f"a request held the person's own `{own}`, so `~/.claude` loaded in the loop")
|
||||
if OWN_HOOK_RAN.exists():
|
||||
found.append("the hook of the person's own `~/.claude/settings.json` ran in the loop")
|
||||
after = snapshot(HOME / ".claude", HOME / ".claude.json")
|
||||
for path in sorted(before.keys() | after.keys()):
|
||||
if before.get(path) != after.get(path):
|
||||
found.append(f"the run changed the person's own {path}: {before.get(path, 'absent')} before, {after.get(path, 'absent')} after")
|
||||
return found
|
||||
|
||||
|
||||
def main() -> int:
|
||||
for name, text in OWN_FILES.items():
|
||||
(HOME / ".claude" / name).parent.mkdir(parents=True, exist_ok=True)
|
||||
(HOME / ".claude" / name).write_text(text, encoding="utf-8")
|
||||
before = snapshot(HOME / ".claude", HOME / ".claude.json")
|
||||
project_made()
|
||||
requests = mock_messages_api.Requests()
|
||||
server = mock_messages_api.serve(requests)
|
||||
# A made-up token, which doesn't grant access to anything. It signs claude in, as docs/decisions.md → `Claude Code in a home of its own` found, and the mock doesn't check it.
|
||||
env = {**os.environ, "ANTHROPIC_BASE_URL": f"http://127.0.0.1:{server.server_port}", "CLAUDE_CODE_OAUTH_TOKEN": "mock-token"}
|
||||
started = subprocess.run([str(CLONE / "bin" / "build-release"), "Write a note of what the project is for."], cwd=PROJECT, env=env, stdin=subprocess.DEVNULL, timeout=PATIENCE)
|
||||
if started.returncode:
|
||||
found = [f"build-release exited {started.returncode}"]
|
||||
else:
|
||||
chunk_awaited()
|
||||
found = failures(requests, before)
|
||||
subprocess.run(["tmux", "kill-server"], capture_output=True)
|
||||
for failure in found:
|
||||
print(f"FAILED: {failure}", file=sys.stderr)
|
||||
if not found:
|
||||
print("A first chunk finished in the loop's Claude home, and `~/.claude` is as it was.")
|
||||
return 1 if found else 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,119 @@
|
||||
"""A mock of Anthropic's Messages API for claude to call at `ANTHROPIC_BASE_URL`: it keeps each request and answers as a worker that is done, or as a judge that rules the chunk finished.
|
||||
|
||||
It answers no other path of the API: claude runs a chunk without them.
|
||||
"""
|
||||
import http.server
|
||||
import json
|
||||
import threading
|
||||
import typing
|
||||
|
||||
# What the worker says, whole. The judge quotes it as its evidence, which build-release checks against the transcript.
|
||||
WORKER_REPLY = "The note is written, so the chunk is finished."
|
||||
|
||||
|
||||
class Requests:
|
||||
"""Every body posted to the Messages API so far, oldest first."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.lock = threading.Lock()
|
||||
self.bodies: list[dict[str, typing.Any]] = []
|
||||
|
||||
def add(self, body: dict[str, typing.Any]) -> None:
|
||||
with self.lock:
|
||||
self.bodies.append(body)
|
||||
|
||||
def texts(self) -> list[str]:
|
||||
"""Each request as JSON text, to search for what claude sent."""
|
||||
with self.lock:
|
||||
return [json.dumps(body, ensure_ascii=False) for body in self.bodies]
|
||||
|
||||
|
||||
def verdict_tool(body: dict[str, typing.Any]) -> str | None:
|
||||
"""The name of the tool claude offers for a reply that fits build-release's judge schema, which is how `--json-schema` asks for one; None in any other request."""
|
||||
for tool in body.get("tools", []):
|
||||
if {"finished", "interrupt", "evidence"} <= set(tool.get("input_schema", {}).get("properties", {})):
|
||||
return tool["name"]
|
||||
return None
|
||||
|
||||
|
||||
def answered(body: dict[str, typing.Any]) -> bool:
|
||||
"""Whether the request's last message returns a tool's result, so the verdict was already given."""
|
||||
content = body["messages"][-1]["content"]
|
||||
return isinstance(content, list) and any(block.get("type") == "tool_result" for block in content)
|
||||
|
||||
|
||||
def verdict(schema: dict[str, typing.Any]) -> dict[str, typing.Any]:
|
||||
"""A reply that fits schema and rules the chunk finished on the worker's reply: every other field is empty or false."""
|
||||
empty = {name: "" if field["type"] == "string" else False if field["type"] == "boolean" else 0 for name, field in schema["properties"].items()}
|
||||
return {**empty, "finished": True, "evidence": WORKER_REPLY}
|
||||
|
||||
|
||||
def reply_block(body: dict[str, typing.Any]) -> dict[str, typing.Any]:
|
||||
"""The one content block that answers body."""
|
||||
tool = verdict_tool(body)
|
||||
if tool is None or answered(body):
|
||||
return {"type": "text", "text": WORKER_REPLY}
|
||||
schema = next(each["input_schema"] for each in body["tools"] if each["name"] == tool)
|
||||
return {"type": "tool_use", "id": "toolu_verdict", "name": tool, "input": verdict(schema)}
|
||||
|
||||
|
||||
def message(body: dict[str, typing.Any], block: dict[str, typing.Any]) -> dict[str, typing.Any]:
|
||||
return {
|
||||
"id": "msg_mock",
|
||||
"type": "message",
|
||||
"role": "assistant",
|
||||
"model": body.get("model", "mock"),
|
||||
"content": [block],
|
||||
"stop_reason": "tool_use" if block["type"] == "tool_use" else "end_turn",
|
||||
"stop_sequence": None,
|
||||
"usage": {"input_tokens": 1, "output_tokens": 1},
|
||||
}
|
||||
|
||||
|
||||
def stream(whole: dict[str, typing.Any]) -> bytes:
|
||||
"""whole as the server-sent events of a streamed reply."""
|
||||
block = whole["content"][0]
|
||||
if block["type"] == "text":
|
||||
start, delta = {"type": "text", "text": ""}, {"type": "text_delta", "text": block["text"]}
|
||||
else:
|
||||
start, delta = {**block, "input": {}}, {"type": "input_json_delta", "partial_json": json.dumps(block["input"])}
|
||||
events = [
|
||||
{"type": "message_start", "message": {**whole, "content": [], "stop_reason": None}},
|
||||
{"type": "content_block_start", "index": 0, "content_block": start},
|
||||
{"type": "content_block_delta", "index": 0, "delta": delta},
|
||||
{"type": "content_block_stop", "index": 0},
|
||||
{"type": "message_delta", "delta": {"stop_reason": whole["stop_reason"], "stop_sequence": None}, "usage": {"output_tokens": 1}},
|
||||
{"type": "message_stop"},
|
||||
]
|
||||
return "".join(f"event: {event['type']}\ndata: {json.dumps(event)}\n\n" for event in events).encode()
|
||||
|
||||
|
||||
def serve(requests: Requests) -> http.server.ThreadingHTTPServer:
|
||||
"""Starts the mock on a free port of this machine, and returns its server, whose `server_port` names the port."""
|
||||
|
||||
class Handler(http.server.BaseHTTPRequestHandler):
|
||||
def do_POST(self) -> None:
|
||||
body = json.loads(self.rfile.read(int(self.headers["Content-Length"])))
|
||||
if self.path.split("?")[0] != "/v1/messages":
|
||||
self.answer(404, "application/json", b'{"type": "error", "error": {"type": "not_found_error", "message": "the mock answers only /v1/messages"}}')
|
||||
return
|
||||
requests.add(body)
|
||||
whole = message(body, reply_block(body))
|
||||
if body.get("stream"):
|
||||
self.answer(200, "text/event-stream", stream(whole))
|
||||
else:
|
||||
self.answer(200, "application/json", json.dumps(whole).encode())
|
||||
|
||||
def answer(self, status: int, kind: str, content: bytes) -> None:
|
||||
self.send_response(status)
|
||||
self.send_header("Content-Type", kind)
|
||||
self.send_header("Content-Length", str(len(content)))
|
||||
self.end_headers()
|
||||
self.wfile.write(content)
|
||||
|
||||
def log_message(self, format: str, *args: typing.Any) -> None:
|
||||
"""Silent: the run's own output says what failed."""
|
||||
|
||||
server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Handler)
|
||||
threading.Thread(target=server.serve_forever, daemon=True).start()
|
||||
return server
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# Runs a first chunk of the committed HEAD as a newcomer would: in a container that holds only what README.md → Install asks for and a stock Claude Code, from a clone, against a mock Messages API.
|
||||
# first_chunk.py says what it checks. ci.sh runs this; run it yourself under run-heavy.
|
||||
# The repo goes in as a git bundle, as in ci.sh.
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
image=$(docker build --quiet --memory 2g --memory-swap 2g first-chunk-e2e)
|
||||
git bundle create - HEAD | docker run --rm -i --init --memory 4g --memory-swap 4g "$image" sh -euc '
|
||||
cat >/tmp/head.bundle
|
||||
git -c init.defaultBranch=main -c advice.detachedHead=false clone --quiet /tmp/head.bundle ~/build-release
|
||||
python3 ~/build-release/first-chunk-e2e/first_chunk.py
|
||||
'
|
||||
@@ -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").
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@
|
||||
},
|
||||
"permissions": {
|
||||
"additionalDirectories": [
|
||||
"~/.local/state/build-release/larv-review",
|
||||
"{reports}",
|
||||
"~/code"
|
||||
],
|
||||
"defaultMode": "bypassPermissions"
|
||||
|
||||
@@ -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".
|
||||
|
||||
@@ -89,7 +89,7 @@ Report, in this shape:
|
||||
3. Where a place you name backs a worse ruling and you want a more capable reader to check that ruling, the line `Rerun one rung up`.
|
||||
```
|
||||
|
||||
## claude-config's values
|
||||
## dev-factory's values
|
||||
|
||||
- `{language}`: Python
|
||||
- `{kind}`: a Claude Code configuration with an agent loop and review skills
|
||||
|
||||
+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.
|
||||
|
||||
|
||||
@@ -6,21 +6,17 @@
|
||||
|
||||
`Bar = 0.1`
|
||||
|
||||
`Next ID = 587`
|
||||
`Next ID = 591`
|
||||
|
||||
## Items
|
||||
|
||||
| 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 |
|
||||
| 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 |
|
||||
| 578 | 0.18.0 | 576, 577 | owner | **Ship one chunk of this repo, to a merged pull request, from a clone of `main` that runs in the generated home, beside the untouched `~/.claude`.** | 1 | 2 | 1 | 2 | 1 | 2 by 4 | 1.2 |
|
||||
| 582 | 0.18.0 | | | **Write the review folder under the state folder into the generated `settings.json`'s `additionalDirectories`, so a moved `XDG_STATE_HOME` needs no hand edit.** | 1 | 1 | 2 | 2 | 1 | 2 by 2 | 0.6 |
|
||||
| 586 | 0.19.0 | | | **Keep the person's own skills, agents and commands out of the loop's Claude home where `HOME` names the home folder through a symlink.** | 2 | 3 | 2 | 5 | 3 | 3 by 4 | 5.0 |
|
||||
| 585 | 0.19.0 | | | **Give this repo an `AGENTS.md` like any project, and drop the decision and the rule that say it keeps none.** | 3 | 1 | 3 | 5 | 4 | code health by 3 | 3.1 |
|
||||
| 580 | 0.19.0 | | | **Call no scoring run for a release already cut whose last item the chunk moved to a later release.** | 2 | 2 | 3 | 5 | 3 | 1.4 by 3, 1.5 by 3 | 1.6 |
|
||||
| 589 | 0.19.0 | | | **Count every turn of a bench run in its figures: sum the tokens and turns of each `result` event in the stream, and time the run from its first event to its last.** | 2 | 2 | 1 | 3 | 2 | 1.1 by 3 | 1.0 |
|
||||
| 590 | 0.19.0 | 589 | | **Report beside each bench run how far its change reached: the files and lines it changed, the files it changed outside the bug's file, and, for a bug, whether it restored the line the mutant changed.** | 2 | 2 | 1 | 3 | 4 | 1.1 by 4 | 1.0 |
|
||||
| 487 | 0.20.0 | | owner | **Run larv-review's passes from a program that picks them from the diff and the item, counts rounds against the cap and decides each rerun, with each reviewer returning its findings as JSON against a schema.** | 4 | 2 | 3 | 7 | 8 | 1.1 by 5, 1.4 by 5 | 0.4 |
|
||||
| 498 | 0.20.0 | 487 | owner | **Drive each chunk as a state machine in `build-release`, from preflight through implementing, review, the pull request and the merge to finishing its items, with the worker as one model step that ends in a result that code checks.** | 4 | 2 | 3 | 7 | 8 | 1.1 by 4, 1.4 by 4 | 0.3 |
|
||||
| 488 | 0.20.0 | 498 | owner | **Cut the larv-review skill, `CLAUDE.md` and rule-hook down to what `build-release` doesn't own: the judgement the model makes and the safety guards.** | 2 | 2 | 3 | 5 | 5 | 1.4 by 4, code health by 2 | 2.3 |
|
||||
@@ -32,7 +28,7 @@
|
||||
| 493 | 0.21.0 | 490, 491 | owner | **Add a second harness adapter and run one chunk of this repo on it end to end.** | 3 | 2 | 2 | 5 | 7 | 1.4 by 3, 1.3 by 2, 6 by 8 | 1.3 |
|
||||
| 495 | 0.22.0 | | owner | **Fail the gate where shipped content names a person, a client, a private host or a private URL.** | 2 | 1 | 3 | 4 | 3 | 5 by 5 | 6.2 |
|
||||
| 497 | 0.22.0 | 498 | decision | **Compare the first 10 chunks `build-release`'s state machine drove with the 10 before them on tokens, 🔴 and 🟡 findings and interrupts per chunk, and move back to prose each step whose figures got worse.** | 1 | 2 | 1 | 2 | 3 | 1.1 by 3, 1.4 by 3 | 1.7 |
|
||||
| 494 | 0.22.0 | 577 | owner | **Let a newcomer clone a release, sign in and run a first project from the README alone, with an example config.** | 2 | 2 | 2 | 4 | 5 | 1.6 by 4, 2 by 6 | 1.6 |
|
||||
| 494 | 0.22.0 | | owner | **Let a newcomer clone a release, sign in and run a first project from the README alone, with an example config.** | 2 | 2 | 2 | 4 | 5 | 1.6 by 4, 2 by 6 | 1.6 |
|
||||
| 496 | 0.22.0 | 491 | owner | **Rename what says Claude where it means any harness, such as `CLAUDE.md`.** | 3 | 2 | 3 | 6 | 6 | 6 by 2, code health by 2 | 1.2 |
|
||||
| 446 | 0.23.0 | | question | **Kill the process a stuck check names where its verdict is `stuck`, once the human says the recorded verdicts match what they would have done.** | 2 | 2 | 3 | 5 | 3 | 1.5 by 3 | 0.8 |
|
||||
| 521 | 0.23.0 | | | **Refuse a `.dockerignore` that leaves out a secret-named entry the `.gitignore` beside it ignores, where a Dockerfile copies the whole build context.** | 2 | 2 | 3 | 5 | 3 | 5 by 4 | 5.0 |
|
||||
@@ -45,7 +41,7 @@
|
||||
| 499 | 0.23.0 | | defect | **Stop `todo-item add` and `edit` from waiting on a stdin that stays open without data, so a call without a heredoc ends at once.** | 2 | 2 | 2 | 4 | 2 | 1.5 by 3, 1.4 by 2 | 1.5 |
|
||||
| 445 | 0.23.0 | | | **Refuse a plan that holds an item a `Finish item <ID>` commit already removed, so a merge resolution cannot bring a finished item back.** | 2 | 2 | 2 | 4 | 3 | 1.4 by 3, 1.1 by 2 | 1.4 |
|
||||
| 171 | 0.23.0 | | decision | **Group the routing figures' review rounds by the reviewers' rung as well as the worker's, so a call blames a rung only for rounds its own reviews raised.** | 3 | 2 | 2 | 5 | 4 | 1.2 by 3, 1.4 by 3 | 1.4 |
|
||||
| 300 | 0.23.0 | | owner | **Reach the comprehension floor: restructure the places the comprehension seats found hardest to follow, so the project reads at 7.0 or above on every dimension, Locality, Shape and Self-sufficiency first; today the second scoring run at 0aff7d39 scored Navigation 7.00, Locality 5.88, Shape 5.88, Self-sufficiency 6.00 and Overall 6.00.** | 4 | 2 | 3 | 7 | 8 | code health by 8 | 1.4 |
|
||||
| 300 | 0.23.0 | | owner | **Reach the comprehension floor: restructure the places the comprehension seats found hardest to follow, so the project reads at 7.0 or above on every dimension, Locality first; today the second scoring run at 5070d896 scored Navigation 7.00, Locality 5.75, Shape 6.00, Self-sufficiency 6.00 and Overall 6.13.** | 4 | 2 | 3 | 7 | 8 | code health by 8 | 1.4 |
|
||||
| 264 | 0.23.0 | | | **Report the comprehension seats and the escalated subagents as subagent types of their own in `routing-figures.md`, with their dollars.** | 2 | 2 | 1 | 3 | 3 | 1.4 by 5 | 1.4 |
|
||||
| 323 | 0.23.0 | | | **Count a release review as landed once its pull request has merged, whatever its commits are titled.** | 3 | 2 | 3 | 6 | 3 | 1.4 by 3, 1.5 by 2 | 1.4 |
|
||||
| 342 | 0.23.0 | | | **Research the tooling agents read, search and run commands with once more, and file an item for each tool that cuts tokens a replay shows keep quality.** | 1 | 2 | 1 | 2 | 3 | 1.4 by 3, 1.5 by 2 | 1.4 |
|
||||
@@ -76,7 +72,7 @@
|
||||
| 4 | 0.23.0 | | | **Name each chunk's archive folder by the chunk's start time, so `<key>/` lists chunks in the order they ran.** | 3 | 2 | 3 | 6 | 3 | 1.1 by 3 | 0.9 |
|
||||
| 324 | 0.23.0 | | | **Count in the routing figures the finished chunks whose worker wrote no `Chunk items:` line.** | 2 | 2 | 1 | 3 | 3 | 1.1 by 2, 1.4 by 1 | 0.9 |
|
||||
| 187 | 0.23.0 | | | **Count the tokens a worker spends reading reviewers' reports, so goal 1.4's signal shows whether report files lowered what a review costs the worker's context.** | 2 | 2 | 1 | 3 | 3 | 1.4 by 3 | 0.8 |
|
||||
| 266 | 0.23.0 | | | **Move the chunks archived under the key `home/lilleman/.claude` to the key `claude-config`, so the routing figures and `score-outcomes` count this repo's chunks as one project.** | 3 | 2 | 2 | 5 | 3 | 1.4 by 3 | 0.8 |
|
||||
| 266 | 0.23.0 | | | **Move the chunks archived under the key `home/lilleman/.claude` to the key `dev-factory`, so the routing figures and `score-outcomes` count this repo's chunks as one project.** | 3 | 2 | 2 | 5 | 3 | 1.4 by 3 | 0.8 |
|
||||
| 339 | 0.23.0 | | | **Lower the reading cost of the files a chunk reads most before its first commit.** | 2 | 2 | 1 | 3 | 3 | 1.4 by 3 | 0.8 |
|
||||
| 341 | 0.23.0 | | | **Hand each worker's claude a lower Read limit through `CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS`, kept only where replays of the archived review rounds find what two unchanged replays find.** | 2 | 2 | 3 | 5 | 3 | 1.4 by 3 | 0.8 |
|
||||
| 522 | 0.23.0 | | | **Let a subagent that ships a chunk in a worktree of another repo run larv-review's security pass on that worktree's diff.** | 2 | 2 | 3 | 5 | 3 | 1.5 by 3 | 0.8 |
|
||||
@@ -87,7 +83,6 @@
|
||||
| 534 | 0.23.0 | | | **Have the stability and product-owner reviewers follow three paths an outside reviewer found unchecked: the loser of a create race, a stored null reaching a typed parameter, and each documented outcome against the order of the code's branches.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 0.7 |
|
||||
| 535 | 0.23.0 | | | **Have stability-reviewer check four things an outside reviewer and two failed gate runs found unchecked: that a timeout bounds the I/O it wraps, that no early error hides an outcome's class, that a test takes its timestamps where the events happen, and that it waits for every state it depends on before it disrupts the system.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 0.7 |
|
||||
| 557 | 0.23.0 | | | **Make stability-reviewer check that a fix which makes a text match exact bounds the match on both sides, with a test for each side.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 0.7 |
|
||||
| 586 | 0.23.0 | | | **Make stability-reviewer trace each claim that a retried or re-received input stores nothing twice to the key the dedup rests on, and report the inputs that change that key.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 0.7 |
|
||||
| 298 | 0.23.0 | | | **Send the judge only the decision entries and the transcript tail a verdict needs, and keep the cut only where `judge-replay` changes no verdict kind.** | 3 | 3 | 3 | 7 | 4 | 1.4 by 2, 1.5 by 1 | 0.7 |
|
||||
| 265 | 0.23.0 | | | **Archive each wait that costs a chunk wall time, for a usage limit, low memory, a failed worker start or a heavy slot, with its start and end stamps, so goal 1.5's hours split waiting from work.** | 3 | 2 | 2 | 5 | 4 | 1.5 by 3 | 0.7 |
|
||||
| 475 | 0.23.0 | | | **Have stability-reviewer report, as a finding, each lookup that an input from outside the repo can make fail without an error naming what was missing.** | 1 | 1 | 2 | 2 | 2 | 1.1 by 2 | 0.7 |
|
||||
@@ -107,138 +102,20 @@
|
||||
|
||||
## Details
|
||||
|
||||
### 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`.
|
||||
### 586. Keep the person's own skills, agents and commands out of the loop's Claude home where `HOME` names the home folder through a symlink.
|
||||
|
||||
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:
|
||||
|
||||
- the config that `project-config --help` shows and `project_config/doubles.py` writes, whose `standards` is `~/.claude/skills/larv-review/standards`;
|
||||
- the label `chunk_driver/project/records.py`'s `named` gives each rule the judge reads, `~/.claude/<file>`, and the judge's prompt and build-release's help, which name `~/.claude/CLAUDE.md` and `~/.claude/rules/`;
|
||||
- each tool's help that names `~/.claude/bin/<tool>`;
|
||||
- `task-bench gather`, whose claude runs in the person's own home: start it with `loop_effects`' `claude_environment`, after the `claude_home` effect says the home is ready.
|
||||
|
||||
Choose one spelling for a file of the setup that holds wherever the clone lies, and bench it as "Bench a syntax" asks. Two candidates: the loop's home, which then also links `bin/` and `principles/`; or the clone, which build-release's prompt names. `~/.claude` stays only where it means the person's own home, as in goal 3 and rule-hook's `.env` rule. README.md already writes the clone as `~/build-release`.
|
||||
Item 577's stability review probed Claude Code 2.1.336 in a throwaway config home: with `HOME` set to a symlink to the home folder, a skill, an agent and a command under the person's `.claude` reached the request; with `HOME` as the real path none did. `claudeMdExcludes` kept `CLAUDE.md` and the rules out both ways. The probe ran outside a checkout, so first repeat it in a project, in `first-chunk-e2e/first_chunk.py`'s container. Where it holds, have `bin/claude_home` or `bin/loop_effects` name the home folder by its real path, and exclude both spellings of the person's Claude home. Record the probe in the decision that the home's settings comment in `bin/claude_home/home.py` cites.
|
||||
|
||||
Touches:
|
||||
|
||||
- `CLAUDE.md`
|
||||
- `rules/todo-items.md`
|
||||
- `rules/decisions.md`
|
||||
- `rules/goals-and-audience.md`
|
||||
- `skills/larv-review/SKILL.md`
|
||||
- `skills/larv-review/review-findings.md`
|
||||
- `skills/larv-review/standards/prose.md`
|
||||
- `skills/comprehension-panel/SKILL.md`
|
||||
- `principles/technical-principles.md`
|
||||
- `agents/override-reviewer.md`
|
||||
- `agents/principles-auditor.md`
|
||||
- `agents/product-owner-reviewer.md`
|
||||
- `agents/prose-reviewer.md`
|
||||
- `agents/stability-reviewer.md`
|
||||
- `agents/systems-architect.md`
|
||||
- `bin/project_config/main.py`: `(module)` (small)
|
||||
- `bin/project_config/doubles.py`
|
||||
- `bin/chunk_driver/project/records.py`: `named`
|
||||
- `bin/agent_cycle/judge.py`
|
||||
- `bin/build_release/loop/usage.py`
|
||||
- `bin/task_bench/figures/gather.py`
|
||||
- `bin/claude_home/home.py`: `LINKED` (small)
|
||||
|
||||
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`.
|
||||
|
||||
The test's own files, such as its Dockerfile and mock Messages API, are new, and their folder is not yet named, so the list leaves them out.
|
||||
|
||||
Touches:
|
||||
|
||||
- `ci.sh`
|
||||
- `.gitignore`
|
||||
- `README.md`: `## Test` (small)
|
||||
|
||||
### 583. Ignore only what the repo generates, in place of the allowlist that kept a Claude home's files out of the clone.
|
||||
|
||||
Since item 483 no Claude home is a clone of this repo, so Claude Code no longer writes credentials, transcripts or memory files into it. The ignore file still ignores everything and un-ignores each authored path, and its opening comment says Claude Code writes into this directory. Replace the allowlist with the few patterns the repo needs, such as `__pycache__/`. Keep the `ignorefile-sorted` rule as it is: other projects use it.
|
||||
|
||||
Touches:
|
||||
- `.gitignore`
|
||||
|
||||
### 576. Name the project `dev-factory` in the README, the prose and the tools, and say in the changelog that the repo moved.
|
||||
|
||||
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 496, which keeps the renames that wait for the harness interface, such as `CLAUDE.md`. Renaming the repo on the forge is lilleman's, and it changes every clone's remote. A project's key comes from its clone's folder name, and tmux session names from the key, so say in the changelog what renaming the clone's folder changes. Revise the decision "names", which still says the code keeps today's names and calls harness independence an open aim: it is goal 6.
|
||||
|
||||
Whether the trial records under `presentation/` and `reviewer-merge-trials/`, the adf-codec image tag and the test fixtures named for the repo change is not predictable, so the list holds every file that names `claude-config`.
|
||||
|
||||
Touches:
|
||||
|
||||
- `.claude/rules/this-repo-keeps-no-agents-md.md`: `` # This repo keeps no `AGENTS.md` ``
|
||||
- `CLAUDE.md`: `## Working loop`, `## Vocabulary`
|
||||
- `README.md`: `# Claude Code configuration`, `## Install`, `## Update`, `## Release`, `## Tools`, `## Test`
|
||||
- `bin/adf_codec/convert.py`: `image_tag`
|
||||
- `bin/agent_cycle/run.py`: `Cycle`
|
||||
- `bin/agent_cycle/spend.py`: `(module)`
|
||||
- `bin/agent_cycle/test_run.py`: `(module)`
|
||||
- `bin/agent_cycle/test_tmux.py`: `TmuxCommands`
|
||||
- `bin/agent_cycle/tmux.py`: `session_name`
|
||||
- `bin/cut_release/main.py`: `(module)`
|
||||
- `bin/cut_release/test_cut_release.py`: `Cut`
|
||||
- `bin/larv_review/main.py`: `(module)`
|
||||
- `bin/build_release/loop/test_routing_check.py`: `RoutingCheck`
|
||||
- `bin/build_release/loop/usage.py`: `HELP`
|
||||
- `bin/loop_state/paths.py`: `paths_from`
|
||||
- `bin/transcript_archive/outcomes.py`: `(module)`, `Annotation`
|
||||
- `presentation/README.md`: `## Where the figures come from`
|
||||
- `presentation/index.html`: lines 464-464, lines 488-488
|
||||
- `reviewer-merge-trials/README.md`: `## Samples`
|
||||
- `reviewer-merge-trials/cases-pair.json`: lines 3-6
|
||||
- `reviewer-merge-trials/cases-wave3.json`: lines 3-7
|
||||
- `reviewer-merge-trials/mkcases1.py`: `pick`
|
||||
- `skills/comprehension-panel/seat-prompts.md`: `## claude-config's values`
|
||||
|
||||
### 578. Ship one chunk of this repo, to a merged pull request, from a clone of `main` that runs in the generated home, beside the untouched `~/.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. This is the proof lilleman asked for before the cut. The chunk takes any item left in 0.18.0, or a tiny one filed for it. The machines themselves move after the cut, which is no plan item: the script that moves transcripts, archives, memory and plugins into the new home is thrown away once both machines have run it.
|
||||
|
||||
Touches nothing of its own: the chunk it ships carries its item's list.
|
||||
|
||||
Which file that chunk changes is not predictable until its item is chosen. The list holds `README.md` whole as the likeliest file of a tiny item, since a list needs one bullet.
|
||||
|
||||
Touches:
|
||||
|
||||
- `README.md`
|
||||
|
||||
### 582. Write the review folder under the state folder into the generated `settings.json`'s `additionalDirectories`, so a moved `XDG_STATE_HOME` needs no hand edit.
|
||||
|
||||
Found while shipping the loop's generated Claude home. The tracked `settings.json` names the default review folder, `~/.local/state/build-release/larv-review`, in `additionalDirectories`. Where `XDG_STATE_HOME` moves the state folder, README.md → Install asks the person to add the moved folder to the generated `settings.json` by hand, again after each build of the home. The code that builds the home can find the state folder through `loop_state.paths`, and write it.
|
||||
|
||||
Touches:
|
||||
|
||||
- `bin/claude_home/home.py`: `settings_written`, `unready` (small)
|
||||
- `bin/loop_effects/effects.py`: `system_effects` (small)
|
||||
- `settings.json`: lines 56-61
|
||||
- `README.md`: `## Install` (small)
|
||||
- `bin/claude_home/home.py`: `settings_written` (small)
|
||||
- `first-chunk-e2e/first_chunk.py`
|
||||
|
||||
### 585. Give this repo an `AGENTS.md` like any project, and drop the decision and the rule that say it keeps none.
|
||||
|
||||
Answer to question item 584: the decision "deploy: this repo keeps no `AGENTS.md`, since `~/.claude` is its checkout" lost its reason with item 483. A release is a clone anywhere, and the loop's Claude home links only `CLAUDE.md`, `rules/`, `agents/` and `skills/`, so an `AGENTS.md` here no longer loads into another project's session. Without the reason, the special case only costs: each rule that names a project's `AGENTS.md` needs a second reading for this repo. The loop took the recommended option, as "Ask, don't guess" allows for a choice the goals don't reserve; the human unmarks or drops this item to reverse it.
|
||||
|
||||
Move the head of `docs/decisions.md`, before `# Decisions`, into a new `AGENTS.md`: the project principles, the decision titles and the working rules. Move "claude-config's values" there from `skills/comprehension-panel/seat-prompts.md` as the scoring-run values. Drop the decision and `.claude/rules/this-repo-keeps-no-agents-md.md`, and let the tools read this repo as any project. The item waits for 0.18.0's cut: until then this repo is developed beside a `~/.claude` checkout on 0.17.0.
|
||||
Move the head of `docs/decisions.md`, before `# Decisions`, into a new `AGENTS.md`: the project principles, the decision titles and the working rules. Move "dev-factory's values" there from `skills/comprehension-panel/seat-prompts.md` as the scoring-run values. Drop the decision and `.claude/rules/this-repo-keeps-no-agents-md.md`, and let the tools read this repo as any project. The item waits for 0.18.0's cut: until then this repo is developed beside a `~/.claude` checkout on 0.17.0.
|
||||
|
||||
Touches:
|
||||
- `AGENTS.md`
|
||||
@@ -269,6 +146,35 @@ Touches:
|
||||
- `bin/larv_review/test_larv_review.py`: `ScoringRunDue`, `LarvReviewTool`
|
||||
- `bin/larv_review/main.py`: `(module)` (small)
|
||||
|
||||
### 589. Count every turn of a bench run in its figures: sum the tokens and turns of each `result` event in the stream, and time the run from its first event to its last.
|
||||
|
||||
Today `figures` in `bin/task_bench/figures/run_figures.py` reads only the last `result` event of a run's stream. Where Haiku starts a background task, such as a long `go test`, Claude Code ends the first turn with a result, then starts another turn when the task finishes and ends that with a second result. The bench then records only that second turn.
|
||||
|
||||
Seen in fejkdata's pilot bench of 2026-12-03, `bug-1-base-1.jsonl`: the fix took 12 turns and 152 s, and the table showed 1 turn, 188 output tokens and 1.7 s. That skewed the head's change against the base by several hundred percent.
|
||||
|
||||
Write the test first from that shape: a stream with two `result` events, whose figures are the sums of both.
|
||||
|
||||
Touches:
|
||||
|
||||
- `bin/task_bench/figures/run_figures.py`: `figures`
|
||||
- `bin/task_bench/figures/test_run_figures.py`
|
||||
|
||||
### 590. Report beside each bench run how far its change reached: the files and lines it changed, the files it changed outside the bug's file, and, for a bug, whether it restored the line the mutant changed.
|
||||
|
||||
Pass or fail says whether a fix works, not whether it was the small, local change a readable codebase allows. These figures need no model and cost nothing to collect. A fix that edits several files to repair a one-line mutant, or rewrites the line in place of restoring it, points at code that is hard to change safely.
|
||||
|
||||
For a feature, report the files changed outside those the reference patch touches, and the share of the reference patch's files the change touched.
|
||||
|
||||
Add a column per figure to the table, with its median per side and its change, as the token columns have. A model review of each fix waits until these show whether they track anything.
|
||||
|
||||
Touches:
|
||||
|
||||
- `bin/task_bench/tasks.py`
|
||||
- `bin/task_bench/figures/run_figures.py`: `Figures`, `Column`, `figures`, `table`
|
||||
- `bin/task_bench/figures/test_run_figures.py`
|
||||
- `bin/task_bench/test_task_bench.py`
|
||||
- `bin/task_bench/main.py`: `(module)` (small)
|
||||
|
||||
### 487. Run larv-review's passes from a program that picks them from the diff and the item, counts rounds against the cap and decides each rerun, with each reviewer returning its findings as JSON against a schema.
|
||||
|
||||
Part of the standalone-install plan lilleman approved on 2026-11-20. It applies the decision `loop: a step whose result a program can check …` in `docs/decisions.md`. The reviewer briefs stay prose. Start here, since larv-review holds the most sequencing rules.
|
||||
@@ -408,39 +314,32 @@ Have the gate, or `rank_todo.py --check` where it runs in a checkout, refuse a p
|
||||
|
||||
Raised by the goals audit of PR #296. `bin/routing_figures/calls.py` groups a chunk's review rounds by the rung its worker started on, and calls for a routing change when a lower rung took more of them. Since PR #296 the reviewers may run above the worker's rung, on the one their item's E + I picks, and no figure groups rounds by it, though the archived worker line names the E + I it follows from. A cheap worker on an item of high E + I gets stronger reviewers, who may raise more rounds, and a call could then blame the worker's rung for them: an interrupt of lilleman that settles nothing (goal 1.2).
|
||||
|
||||
### 300. Reach the comprehension floor: restructure the places the comprehension seats found hardest to follow, so the project reads at 7.0 or above on every dimension, Locality, Shape and Self-sufficiency first; today the second scoring run at 0aff7d39 scored Navigation 7.00, Locality 5.88, Shape 5.88, Self-sufficiency 6.00 and Overall 6.00.
|
||||
### 300. Reach the comprehension floor: restructure the places the comprehension seats found hardest to follow, so the project reads at 7.0 or above on every dimension, Locality first; today the second scoring run at 5070d896 scored Navigation 7.00, Locality 5.75, Shape 6.00, Self-sufficiency 6.00 and Overall 6.13.
|
||||
|
||||
Filed by the comprehension check of PR #473 at 13d1550 (`larv-review record-scoring`), which printed `Floor:` and `Next:`, refreshed from the two runs of item 525's chunk at 68611733, and then from the two runs of item 565's chunk at 98c49021. The lowest mean of the second run at 98c49021 is Self-sufficiency at 5.75, with Locality at 5.88 and Shape at 6.13; the first run put Self-sufficiency lowest at 5.63, with Locality and Shape at 5.75. Self-sufficiency: the why behind code sits in `docs/decisions.md`, cited by title from about 120 places, and the review loop's rules live in `skills/larv-review/SKILL.md`, not beside the unit that enforces them; `bin/agent_cycle/routing.py:115` `unfinished_route` keeps its reasons in the decision log too. Locality: build-epic and chunk-pr run order-dependent steps and keep state in tmux window names and between loop passes (`start_chunks`, `resumed_news`, `merged`, `merge_turn`), and no code enforces the order; `bin/build_epic/main.py:236` `chunk_run` and `bin/build_epic/scheduler.py:172` `start_chunks` are the hardest build-epic places, and the round cap is counted three ways (`bin/rule_hook/round_cap.py:28` `earlier_titles`, `bin/larv_review/reviewer_header.py:83` `branch_summaries`, `bin/review_rules/round_titles.py:39` `named_counts`). Shape: `bin/` stays flat at about 86 entries at one level, long functions carry several flags at once, and the OLD_SHAPE fork in `bin/plan/ranking.py` doubles the paths through ranking. Refresh this item's places and aim from the newest run before the chunk starts; do not file a second floor item.
|
||||
Filed by the comprehension check of PR #473 at 13d1550 (`larv-review record-scoring`), which printed `Floor:` and `Next:`, and refreshed from each later run; most recently from the two runs of item 578's chunk (PR #813) at 5070d896. Those scored Navigation 7.00, Locality 5.75, Shape 6.00, Self-sufficiency 6.00 and Overall 6.13. Locality is lowest, so this item aims at it first. Refresh this item's places and aim from the newest run before the chunk starts; do not file a second floor item.
|
||||
|
||||
Newest run, two runs of item 569's chunk at add7c09d: Locality is lowest at 5.63. It adds these places to the list below: `bin/rule_hook/reviewer_rung.py:28` `reviewer_breaches` refuses a launch for its rung and never for its round count, so the round cap has a launch-time gap beside the three counters; `bin/build_release/loop/chunk_windows.py:150` `chunks_to_start` is a near-twin of `bin/build_epic/scheduler.py:172` `start_chunks` with different rules and no stated reason for two; `bin/agent_cycle/tmux.py:92` `as_listed` keeps chunk state in window-name suffixes that other code matches on; `bin/plan/ranking.py:144` `weigh` checks the old table shape in every function; `bin/build_epic/__init__.py:1` has no map of its 25 modules.
|
||||
Aim: one ambitious refactor that puts each piece of chunk state, and each ordered protocol, in one unit that owns it, so a reader follows one merge, one park or one schedule without opening sibling modules. Size it so every mean reaches 7.0 on the chunk's own scoring run. Where a place is already easier to read when the chunk starts, drop it.
|
||||
|
||||
Newest run, two runs of item 579's chunk at 0aff7d39: Locality and Shape are lowest, both at 5.88, with Self-sufficiency at 6.00 and Navigation at 7.00. It adds these places to the list below: `bin/chunk_pr/main.py:601` `levelled_and_finished` is an order-dependent chain of git changes and a scoring-run check, with no statement of what holds after it returns; `bin/agent_cycle/run.py:160` `rule` decides the figures written by the order of its archive calls, and only a comment says so; `bin/larv_review/main.py:33` "needs-scoring-run" holds the whole rule for when a run is due and owed only in a long docstring; `bin/plan_store/jira_epic.py:200` `edit` hides the loop-filed against person-filed rule among about 45 lines of early returns; `bin/transcript_archive/outcomes.py:11` `outcomes` is a line format that four readers parse by regex; `bin/build_epic/main.py:236` `chunk_run` sits in a 520-line main that also holds help text and the issue-move policy.
|
||||
Locality: the seats' main complaint is that chunk state lives in tmux window-name suffixes, files, the forge and the scheduler's slots at once, written in one package and read in another, and that ordered steps keep their order unstated. Give that state one owner with a typed interface, and state each protocol's order beside the code that enforces it.
|
||||
|
||||
Aim: one ambitious refactor of the areas below, sized so every mean reaches 7.0 on the chunk's own scoring run. Where a place is already easier to read when the chunk starts, drop it.
|
||||
Places the seats named in the two runs at 5070d896, most repeated first (`larv-review places`):
|
||||
|
||||
Places the seats named in the two runs at 98c49021, hardest first (`larv-review places`), Self-sufficiency first:
|
||||
- Locality, Shape: `bin/chunk_pr/main.py:462` `merged`: a merge-queue loop carrying a flock, an approval wait and the by-human, to-epic and park flags, two of which switch each other off; a hidden `scoring-run-owed` call and a side trip to `remeasure`; what happens on a failure mid-merge is decided in sibling tools; the module is 778 lines with seven subcommands. With `:530` `merge_turn`: about seven decisions in a row whose side-effect order is load-bearing and unstated. Six seat reports named `merged`, and two more `merge_turn` or the module.
|
||||
- Locality, Shape: `bin/build_epic/scheduler.py:178` `start_chunks`: five derived sets and an elif ladder under a lock, and its correctness depends on window-name suffixes that `parking.py` and `tmux.py` write. Four seat reports named it.
|
||||
- Locality, Shape: `bin/build_epic/parking.py:26` `parked_through`: one chunk's parked state in a file, a window name, the forge and the slot scheduler, its order stated and not justified. With `:118` `resumed_news`: a polling loop whose mutable `Told` renames tmux windows. Four seat reports named them.
|
||||
- Locality, Shape: `bin/build_epic/main.py:241` `chunk_run`: one loop over `news` typed `str | Stop | Merged`, whose exit depends on `news == ""` together with `Finished`, the empty string never named; about 30 imports. Four seat reports named it.
|
||||
- Self-sufficiency, Locality: `bin/agent_cycle/routing.py:115` `unfinished_route`: five rungs, a floor, the cap and a counter held at once, the escalation mark in another module and the reason in the decision log. Four seat reports named it.
|
||||
- Navigation, Shape: `README.md:276` "Packages under bin/": the only map of a flat `bin/` of about 85 entries; with `bin/build_epic/__init__.py:1`, an empty package docstring over 22 modules. Group `bin/`'s packages by purpose, or give each package a map in its `__init__.py`. Both architect reports named it.
|
||||
- Locality: `bin/rule_hook/round_cap.py:10` `round_cap_breaches`: the round cap lives in prose, a constant and a hook, and the count in four places with two failure policies. Both architect reports named it.
|
||||
- Shape: `bin/task_bench/main.py:242` `Planner`: three layers of curried callables, and the Rust test-module rules in one chain of nested clauses. Three seat reports named it.
|
||||
- Self-sufficiency, Locality: `skills/larv-review/SKILL.md:109` "Re-entry": a nine-row table whose exceptions and the round cap sit in other sections.
|
||||
- Locality: `bin/agent_cycle/judge.py:79` `TASK_HEADING`: a heading's wording that replay parses, held by a comment alone.
|
||||
- Locality: `bin/build_release/loop/chunk_windows.py:46` `held_items`: which chunks start depends on a worker's `Chunk items:` line.
|
||||
- Locality: `bin/build_release/loop/reload.py:97` `exec_if_edited`: any edit under `bin/` reloads a live loop.
|
||||
- Shape: `bin/release_plan/release_standing.py:206` `next_release`: a boolean expression that reads as a puzzle.
|
||||
- Self-sufficiency: `.claude/rules/this-repo-keeps-no-agents-md.md:3`: its rationale says `~/.claude` is a checkout of this repo. Both architect reports named it.
|
||||
|
||||
- Self-sufficiency, Locality: `bin/agent_cycle/routing.py:115` `unfinished_route`: five rungs interact, and the reasons sit in the decision log or the module's table. Three seats named it.
|
||||
- Self-sufficiency, Locality: `skills/larv-review/SKILL.md:104` "Re-entry", with `:96` "Round cap": Re-entry depends on "Round cap" and "Mechanical answers" and is read twice to know which pass a fix reruns, and the cap's contract spans the skill, three modules and `bin/rule_hook/rules.py:85`. Two seats named it.
|
||||
- Self-sufficiency: `bin/build_epic/main.py:485` `next_cycle`: a tmux window name doubles as the Jira issue key, written down nowhere.
|
||||
- Self-sufficiency, Shape: `bin/release_plan/release_standing.py:206` `next_release`: one boolean packs three inputs.
|
||||
- Locality, Self-sufficiency, Shape: `bin/build_epic/parking.py:18` `parked_through`: a crash-ordering protocol of three ordered steps and a polling loop, with state in a file, tmux attributes, Jira and scheduler slots, and the order only in the docstring. Three seats named it.
|
||||
- Locality, Shape, Navigation: `bin/build_epic/scheduler.py:172` `start_chunks`: window sets and a parked map in a five-way branch under two nested locks, and the cap on running chunks lives here, in `resume` and in `bin/build_release/loop/chunk_windows.py:117` `start_chunks`. Three seats named it.
|
||||
- Locality: `bin/rule_hook/round_cap.py:28` `earlier_titles`, with `bin/larv_review/reviewer_header.py:83` `branch_summaries` and `bin/review_rules/round_titles.py:39` `named_counts`: three round counters, and `earlier_titles` fails open where the others don't. Two seats named it.
|
||||
- Locality, Shape: `bin/build_epic/main.py:402` `handed_on`: reads like a getter and writes Jira, the store and tmux.
|
||||
- Locality: `bin/chunk_pr/main.py:624` `levelled_and_finished`: the order of the scoring-run check and the remeasure isn't explained.
|
||||
- Locality: `bin/agent_cycle/judge.py:88` `Reply`: the prompt's wording is coupled to `judge_replay.archived_prompt`.
|
||||
- Locality: `bin/chunk_driver/chunk_run.py:44` `closed_cycle`: `Route.unfinished` and `Run.unfinished_run` have near-identical names and different meanings.
|
||||
- Locality: `bin/build_release/loop/reload.py:97` `exec_if_edited`: a new `LoopRun` field breaks running loops.
|
||||
- Shape, Locality, Self-sufficiency: `bin/chunk_pr/main.py:485` `merged`: a merge-queue loop interleaving approval, parking and a flock, with chained Failure ternaries, four flags whose combinations aren't all visibly handled, about eight functions to follow one merge, and git, forge and plan effects in an unexplained order. Five seats named it.
|
||||
- Shape, Locality: `bin/build_epic/main.py:236` `chunk_run`: a long loop mixing parking and reopening, with flags threaded through and a nested ternary at line 285. Three seats named it.
|
||||
- Shape: `bin/task_bench/main.py:241` `Planner`: three layers of curried callables. Two seats named it.
|
||||
- Shape: `bin/agent_cycle/run.py:33` `Cycle`, with `:160` `rule`: the dataclass has 17 fields, and `rule` has four near-identical archive names and one very long expression at line 255.
|
||||
- Shape, Navigation: `bin/rule_hook/rules.py:27` `RULES`: a prose table and the check functions share one file.
|
||||
- Shape: `bin/rule_hook/env_file.py:34` `reaching`: `and` over `or` without parentheses at line 41.
|
||||
- Navigation, Shape: `bin/agent_cycle/__init__.py:1` `agent_cycle`: 17 flat modules against its own "about seven" citation.
|
||||
- Navigation: `README.md:269` "build_epic": the only map of a 22-module package with an empty `__init__.py`.
|
||||
- Navigation: `bin/chunk_driver/this_loop.py:12` `Loop`: the name doesn't say it holds a chunk's run context.
|
||||
Earlier runs also named these, still open unless the chunk finds them easier: `bin/build_release/loop/chunk_windows.py:150` `chunks_to_start`, a near-twin of `start_chunks` with different rules and no stated reason for two; `bin/agent_cycle/tmux.py:92` `as_listed`, which keeps chunk state in window-name suffixes; `bin/chunk_pr/main.py:601` `levelled_and_finished`, an order-dependent chain with no statement of what holds after it returns; `bin/agent_cycle/run.py:160` `rule`, whose archive calls' order decides the figures; `bin/transcript_archive/outcomes.py:11` `outcomes`, a line format four readers parse by regex; `bin/plan/ranking.py:144` `weigh`, with the OLD_SHAPE fork doubling the paths through ranking.
|
||||
|
||||
### 264. Report the comprehension seats and the escalated subagents as subagent types of their own in `routing-figures.md`, with their dollars.
|
||||
|
||||
@@ -452,7 +351,7 @@ Seats launch as `general-purpose`, so they hide inside that type: $301.24 of the
|
||||
|
||||
### 342. Research the tooling agents read, search and run commands with once more, and file an item for each tool that cuts tokens a replay shows keep quality.
|
||||
|
||||
The next round of item 312's research, filed when 312's round ran on 2026-11-12. lilleman, 2026-11-11: repeat the round once per claude-config release, not per project. When this item's chunk finishes, file the next round into the next claude-config release with items left.
|
||||
The next round of item 312's research, filed when 312's round ran on 2026-11-12. lilleman, 2026-11-11: repeat the round once per dev-factory release, not per project. When this item's chunk finishes, file the next round into the next dev-factory release with items left.
|
||||
|
||||
Run it as 312's ran: a lead on the project's rung plans 6 to 10 searches where the archive's spend is, cheaper subagents with web access only return sourced findings, and the lead checks each claim against the archive's measured spend before filing.
|
||||
|
||||
@@ -469,7 +368,7 @@ Dropped in 312's round, and why; look again only where the reason has changed:
|
||||
|
||||
### 471. Ship `jira-rest METHOD PATH [BODY]`, which makes one Jira Cloud REST call with the credentials of the project's config, or build-epic's, reading the env file itself, so an agent calls Jira without naming a file rule-hook guards.
|
||||
|
||||
Once a Jira credentials file is a config's `env-file`, rule-hook's `env-file-read` refuses every Bash command that names it. A machine's own rules that tell agents to `source` it and `curl` Jira then stop working. On 2026-11-20 this happened on a machine whose rules call Jira that way, and a machine-only script, `~/.local/bin/jira-rest`, took their place. The human asked for it as a claude-config tool, so every machine has it.
|
||||
Once a Jira credentials file is a config's `env-file`, rule-hook's `env-file-read` refuses every Bash command that names it. A machine's own rules that tell agents to `source` it and `curl` Jira then stop working. On 2026-11-20 this happened on a machine whose rules call Jira that way, and a machine-only script, `~/.local/bin/jira-rest`, took their place. The human asked for it as a dev-factory tool, so every machine has it.
|
||||
|
||||
- `jira-rest METHOD PATH [BODY.json | -]` sends one call to a path under `/rest/`, with the body from the file or stdin, and prints Jira's JSON answer, or `null` for an empty one. A refused call exits non-zero with the message `atlassian.client.jira_errors` gives. No output, error or log line holds a credential.
|
||||
- The site and the env file come from the project's config where the checkout has one whose `plan` or `goals-and-audience` is a Jira epic: the epic's site and the config's `env-file`. Otherwise they come from build-epic's config: `jira-url` and `env-file`. Where neither holds them, it fails, naming both places.
|
||||
@@ -659,7 +558,7 @@ Today the folder is the SHA-256 of the transcript's first timestamped line, whic
|
||||
|
||||
Before PR #310, reports reached the worker as the Agent call's result, a median 19k tokens per chunk (2026-10-08, 68 archived transcripts). Now a reviewer returns its verdict and one line per finding, and the worker reads a 🔴 or 🟡 finding's entry from the report file. `reading-cost` counts only tracked files (`bin/reading_cost/measure.py`), and `routing-figures` counts only the Agent call's result (`bin/routing_figures/chunk.py`), so neither sees the report reads. Found by the architecture review of PR #310.
|
||||
|
||||
### 266. Move the chunks archived under the key `home/lilleman/.claude` to the key `claude-config`, so the routing figures and `score-outcomes` count this repo's chunks as one project.
|
||||
### 266. Move the chunks archived under the key `home/lilleman/.claude` to the key `dev-factory`, so the routing figures and `score-outcomes` count this repo's chunks as one project.
|
||||
|
||||
The archive holds 277 chunk folders under `home/lilleman/.claude`, from 2026-09-24 on, and 39 under `claude-config` (2026-11-10). The routing figures of 2026-11-04 list no project `home/lilleman/.claude`. They find a chunk's later fixes on the default branch of the checkout its key names (`bin/routing_figures/archive.py` `measure_project`), and `/home/lilleman/.claude` is a release checkout on a detached HEAD. Item 5 fixes how keys are derived, not the chunks already archived. `~/.claude/loop-claude-models.json` still holds a `home/lilleman/.claude` entry; it is machine state outside the repo, so removing it is a one-off step on each machine, not part of the change.
|
||||
|
||||
@@ -764,15 +663,6 @@ An outside reviewer found, on a pull request in another project, that a fix for
|
||||
|
||||
Chosen: one line in stability-reviewer's brief, or in the review standards' `quality.md` if a rule on matches already sits there. Where a change makes a match of an id, a key or a name exact, the reviewer asks for a test with the searched text inside a longer one at each end, and reports a missing side as a 🟡. No deterministic tool fits: a linter cannot tell a match meant to be exact from one meant to be loose.
|
||||
|
||||
### 586. Make stability-reviewer trace each claim that a retried or re-received input stores nothing twice to the key the dedup rests on, and report the inputs that change that key.
|
||||
|
||||
An outside reviewer found a gap that our stability and prose passes both missed. A README said that a file processed again adds only the records that are missing. The dedup key included each record's position in the parsed list. After a parser change that adds or drops a record, the same file therefore yields new keys: one record is skipped and another is stored twice.
|
||||
|
||||
The check: where a diff adds or keeps a claim that a retry, re-upload, replay or redelivery is idempotent, read how the key is derived, and list the inputs that change it. Report a 🟡 where an input that can change between two runs, such as a position, a parser version or a timestamp, isn't named beside the claim.
|
||||
|
||||
Touches:
|
||||
- `agents/stability-reviewer.md`: `## Review Focus Areas` (small)
|
||||
|
||||
### 298. Send the judge only the decision entries and the transcript tail a verdict needs, and keep the cut only where `judge-replay` changes no verdict kind.
|
||||
|
||||
153 `Judge cost:` entries total $109.76, a median of about $0.76 a verdict at every rung, and the cost follows the size of the records, not the transcript: about 76k characters in log and 188k in claude-config. In 224 of 251 recent verdicts (89%) the evidence sits in the worker's final message. A missed interrupt is the costly error, so the bar is zero changed interrupts and zero new rejections across the replay. The judge is about 4.5% of dollars, so the saving is small; each cycle also gets faster.
|
||||
@@ -854,6 +744,8 @@ First look for a maintained mutation tool for POSIX sh and Bash, and cite what w
|
||||
|
||||
Run the repo's own gate per mutant, as for the other languages, and print each survivor.
|
||||
|
||||
Shell files a chunk in this repo changed without a mutant: `ci.sh` and `first-chunk-e2e/run`, in item 577's chunk. Both run only in the gate.
|
||||
|
||||
### 423. Skip the judge's model call on a worker's final message that the offline classifier decides is finished.
|
||||
|
||||
On 2026-11-18 lilleman ruled that the classifier's miss rate of about 1 in 100 decided is close enough to no missed interrupt (`docs/decisions.md` → `routing: the offline classifier may decide finished, since lilleman ruled a miss rate of about 1 in 100 decided close enough to none; the judge's model keeps every other verdict kind`).
|
||||
|
||||
Reference in New Issue
Block a user