diff --git a/CHANGELOG.md b/CHANGELOG.md index 28c9e798..e25e2efb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Fix for an outside reviewer's comment on a PR now ends with a change to the setup that would have caught it, in claude-config first, then the principles and standards, then the project. - larv-review reruns the pass that raised a ๐ŸŸก when the fix removes or loosens an assertion, changes an expected value, or skips, deletes or guards a test. Other ๐ŸŸก fixes still rerun no pass. - Add `markdown-section `, which prints the section of a markdown file under the heading the fragment picks, to the next heading of its level or a higher one. It fails, listing the headings, where several hold the fragment. - loop-claude and subagent-rung run an L 3 task one rung above the project's rung and an L 4 task two above it: on an Opus 5.5 project, Fable 5.2 at low and at medium. diff --git a/CLAUDE.md b/CLAUDE.md index 5934ac61..2cc96719 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -18,6 +18,12 @@ How work proceeds in any repo, unless the repo's `AGENTS.md` says otherwise. The - **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 loop-claude'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 (`~/.claude/bin/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 reasonable fix an outside reviewer asked for on a PR.** An outside reviewer is a forge's auto-reviewer or a human, not one of larv-review's reviewer agents. When you fix a comment of theirs, ask why our review didn't catch the fault 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. claude-config's core: the reviewers' agents, `larv-review`, the hooks and tools, so every project gains. + 2. claude-config's technical principles or review standards, where a rule was missing or too vague. + 3. The project's own settings, principles folder or `AGENTS.md`, only where the gap is that project's alone. A client repo's `AGENTS.md` changes by a proposal of its own, per "A client project's `CLAUDE.md` and `AGENTS.md`" above. + + In claude-config, the change is a fix of the chunk. In another project, places 1 and 2 are 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 place holds the gap, 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. `~/.claude/bin/todo-item finish ` removes the item with its detail, and adds the bullet you pass with `--changelog `; 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 `, 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`. diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index 978fd9c8..3f3ca97a 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -196,7 +196,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 โ†’ mark the PR ready with `~/.claude/bin/chunk-pr ready ''`, 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 is what summons it. 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. +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 is what summons it. 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. A fix of its finding ends with the setup change that `~/.claude/CLAUDE.md` โ†’ "Working loop", "Change the setup for each reasonable fix an outside reviewer asked for on a PR" asks for. ## 5. Goal alignment, then merge @@ -207,7 +207,7 @@ Launch prose-reviewer with what the diff touched and every section this review c - **A merge conflict.** Resolve it, commit and push. Rerun only the passes whose triggers the resolution's own lines meet (ยง3), each in a round of its own. - **A paired ruling to run again.** `chunk-pr merge` has merged the default branch in and pushed. Run the ruling at that head, record it, commit and push. Don't return to ยง4 for it: the next turn waits for the checks at the new head. - **An owed scoring run, or a queue another pull request holds.** Record the run, or wait, as the message says. - - **A reviewer's comment**, where the project's config sets `wait-for-approval` (`chunk-pr --help`) and the pull request waits for a human's approval. Answer it in its thread on the forge, and fix what it asks as a finding of the chunk. The wait doesn't hold the queue, so other chunks merge meanwhile. + - **A reviewer's comment**, where the project's config sets `wait-for-approval` (`chunk-pr --help`) and the pull request waits for a human's approval. Answer it in its thread on the forge, and fix what it asks as a finding of the chunk. A fix of it ends with the same setup change (ยง4 step 6). The wait doesn't hold the queue, so other chunks merge meanwhile. A repo whose `AGENTS.md` names another method merges that way with the forge's CLI instead, after it finishes the chunk's items with `todo-item finish` in the branch, and once the pull request's checks pass, `~/.claude/bin/larv-review scoring-run-owed` exits 0 and, where `~/.claude/bin/project-config wait-for-approval` prints `true`, GitHub reports the pull request approved. A repo withholds this in its `AGENTS.md` โ†’ leave the PR ready and unmerged, and say which line withheld it. 5. Merged โ†’ run `~/.claude/bin/chunk-pr clean` in the chunk's worktree, and put a failure it prints in the summary. @@ -215,4 +215,4 @@ Launch prose-reviewer with what the diff touched and every section this review c ## 6. Wrap up -Summarize: PR URL and final state, every reviewer's verdict, rounds per pass, passes skipped, principles files left out with why, findings fixed vs answered vs declined vs open โ€” each answer with what settles it, each decline with its reason, a ๐ŸŸก's with the goal or technical principle it rests on โ€” CI status, rule overrides with their rulings, decisions recorded (file paths), `todo.md`/`CHANGELOG.md` updated, and any ๐Ÿ”€ escalation left for the user. +Summarize: PR URL and final state, every reviewer's verdict, rounds per pass, passes skipped, principles files left out with why, findings fixed vs answered vs declined vs open โ€” each answer with what settles it, each decline with its reason, a ๐ŸŸก's with the goal or technical principle it rests on โ€” CI status, rule overrides with their rulings, decisions recorded (file paths), for each fixed outside-reviewer comment, the setup change it led to, or that no setup gap caused it, `todo.md`/`CHANGELOG.md` updated, and any ๐Ÿ”€ escalation left for the user. diff --git a/todo.md b/todo.md index d87173f9..10af86ae 100644 --- a/todo.md +++ b/todo.md @@ -12,7 +12,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| -| 398 | 0.12.0 | | | **Make each reasonable fix an outside reviewer asks for on a PR trigger a reflection that changes the setup so review would have caught it, in this repo first.** | 2 | 2 | 3 | 5 | 3 | 1.1 by 6, 1.2 by 2 | 2.9 | | 404 | 0.12.0 | | | **Read do-epic's machine-wide settings from `~/.claude-projects/do-epic/config.toml` and its prose repo rule from `repo-rule.md` beside it, and refuse to start while either is missing or misspelt.** | 2 | 1 | 1 | 2 | 3 | 1 by 5 | 1.9 | | 407 | 0.12.0 | 404 | | **Find an epic repo's checkout and project config by the repo's name, clone a missing one from the host of the epic's other repos, and ask the human where unsure.** | 2 | 2 | 2 | 4 | 3 | 1 by 5 | 1.9 | | 401 | 0.12.0 | | | **Move loop-claude's cycle, judge, interrupt, tmux and routing into a package a second entry point drives, with loop-claude's behaviour unchanged.** | 3 | 2 | 3 | 6 | 6 | 1 by 3, code health by 2 | 1.8 | @@ -84,22 +83,6 @@ ## Details -### 398. Make each reasonable fix an outside reviewer asks for on a PR trigger a reflection that changes the setup so review would have caught it, in this repo first. - -Applies to any reviewer outside the review passes: a forge's auto-reviewer such as CodeRabbit, a human, or any other. When such a reviewer's feedback on a PR is reasonable and we fix it, we also ask why our setup didn't catch 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. - -Where the change goes, in this order of preference: -1. This repo's core: the reviewers' agents, `larv-review`, the hooks and tools, so every project gains. -2. The technical principles or review standards, where a rule was missing or too vague. -3. The project's own settings or instructions (`config.toml`, `AGENTS.md`), only where the gap is that project's alone. - -Where the cause is a gap in none of these, say so in the chunk's summary rather than inventing a change. File a change too big for the chunk as its own item (`~/.claude/CLAUDE.md` โ†’ "Working loop"). The reflection is part of answering the feedback, so `larv-review` ยง4 step 6 and ยง3 โ†’ "Other scales" are the places to start. - -Touches: - -- `skills/larv-review/SKILL.md`: `## 4. Gate` (small), `## 3. Passes` (small) -- `CLAUDE.md`: `## Working loop` (small) - ### 404. Read do-epic's machine-wide settings from `~/.claude-projects/do-epic/config.toml` and its prose repo rule from `repo-rule.md` beside it, and refuse to start while either is missing or misspelt. Settings: the Jira site, `env-file`, the folder repos are cloned into (`~/code` by default), the default language, and the model for a no-repo item (`docs/decisions.md` โ†’ `do-epic: drives one Jira epic โ€ฆ`). Reuse `project_config/settings.py`'s parsing helpers: `read`, `anywhere`, `Scalar`, `language_fault`, and the `env-file` check that keeps credentials outside a checkout.