diff --git a/AGENTS.md b/AGENTS.md index 3fad43af..4103ee82 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,3 +33,4 @@ Decisions live in `docs/decisions.md`: - loop-claude: every claude it starts bypasses permissions inside its sandbox - stats: a chunk's cost and review numbers are kept in the transcript archive - bench: a workflow change merges only once three benches rule it better +- chunk: as large as one purpose allows diff --git a/CLAUDE.md b/CLAUDE.md index d7e3b270..6f963e20 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -11,7 +11,7 @@ How work proceeds in any repo, unless the repo's `AGENTS.md` says otherwise. The - **When the next release has no items and no work has landed towards it, plan it as this chunk.** Weigh the unscheduled items against the goals, put them in order, and get the human's approval before writing any code. - **When the next release has no items left and work has landed towards it, it is finished: stop.** Report what it holds and that it is ready to cut. Under `/loop`, this ends the loop. Until the human cuts it, only a security fix lands, into that release; never start a later release's items or plan a new one. - **Open every chunk with one line:** the last version cut, what is unreleased (`CHANGELOG.md` → `## Unreleased`, or else the log since the last tag), and the release this chunk ships into. A repo that publishes nothing says so once. -- **Work one chunk at a time, and make it as large as one purpose allows.** Every review has a fixed cost, so a chunk takes every related plan item that passes three tests: one line states the purpose of them all, as the PR title; they sit under one release; and if one part proved wrong, reverting the whole chunk would be acceptable. Split a milestone into items in `todo.md` before starting it. Fix a finding in the chunk's own change within the chunk. File a finding about anything else in `todo.md`, under a release. +- **Work one chunk at a time, and make it as large as one purpose allows.** Every review has a fixed cost, so a chunk is the next plan item plus every other item for which three things hold together: one PR title states what they achieve together, without listing them; they sit under one release; and they fire the same review passes (`larv-review` §3). Split a milestone into items in `todo.md` before starting it. Fix a finding in the chunk's own change within the chunk. File a finding about anything else in `todo.md`, under a release. - **Ask, don't guess.** First check whether the goals already answer the question. 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. Write every answer once, where it belongs, never only in chat: a goal in `README.md`, a working rule in `AGENTS.md`, a standing choice in `docs/decisions.md`. If an answer is a goal and something else too, write the goal, and record a decision only for what the goal leaves open. - **Ship every chunk with `/larv-review`.** - **Remove a finished item from `todo.md`; keep its release heading until the version is cut.** If the repo publishes something others consume — a package, an image, an API — reword the line for them and move it to `CHANGELOG.md` under `## Unreleased`. A changelog is for the public, never for the next agent. Otherwise delete the line; git history is the record. @@ -142,7 +142,7 @@ The rules every project follows, compose-not-entangle first: `~/.claude/principl ## Vocabulary -- **chunk** — the unit of work: the largest change that still has one purpose; "Working loop" says how large that is. +- **chunk** — the unit of work: the largest change with one purpose; "Working loop" says how large that is. - **cycle** — one worker run and the judge's verdict on it, in `loop-claude`. - **gate** — the merge gate: the checks a PR passes before it merges. - **interrupt** — `loop-claude` handing the terminal to the human, `claude --resume`, for a decision that is theirs. diff --git a/agents/systems-architect.md b/agents/systems-architect.md index 8c57133a..2ce6979c 100644 --- a/agents/systems-architect.md +++ b/agents/systems-architect.md @@ -140,7 +140,7 @@ You review the seams that make verification possible and the strategy that uses How a change ships — merge gate, pipeline, deployment, dependencies — is a designed property of the system. This is its one home; other sections point here. You review the gate's existence and check classes and the delivery strategy — never individual lint rules, pipeline syntax, or vendor choice. A missing check class is a finding; a disagreeable lint threshold is below your altitude. - **One enforced path to production.** The pipeline is the only way code reaches any environment. A manual deploy lane or a human-waivable gate is a bypass, and the bypass is the finding — a gate people route around launders unverified changes as verified. -- **The merge gate is fast, deterministic, and blocks on both tests and static analysis.** It admits only quick, hermetic checks (minutes, not an hour); slow or probabilistic suites run scheduled outside it (see Testability). A slow gate breeds long-lived branches and big batches — small changes through a fast gate beat big ones through a thorough gate; incomplete work hides behind flags with an owner and an expiry, not behind a branch. +- **The merge gate is fast, deterministic, and blocks on both tests and static analysis.** It admits only quick, hermetic checks (minutes, not an hour); slow or probabilistic suites run scheduled outside it (see Testability). A slow gate breeds long-lived branches; incomplete work hides behind flags with an owner and an expiry, not behind a branch. - **Static analysis is its own quality dimension, not a kind of testing.** Tests sample points in the input space; types and analyzers quantify over it. Types at full strictness, warnings-as-errors, and the Fits in a head thresholds as machine rules belong in the gate from the first commit — strictness is near-impossible to retrofit, so it is skeleton, never ceremony. - **Deployment is designed, not improvised.** Build one artifact and promote it — a per-environment build voids what the gate verified. Config comes from the environment. Rollback is a standing requirement, which forces expand–contract migrations with N-1 compatibility between running code and schema; an unrollbackable change is a defect class. A deploy completes when the post-deploy smoke confirms the surface (see Testability). - **Dependencies follow a strategy.** Each one earns its existence (Core Philosophy); versions are locked; updates flow small-and-often through the gate via automation. Automation presupposes the gate — on a gateless project the finding is the missing gate, not the missing bot. diff --git a/bin/loop_claude/cycle/worker.py b/bin/loop_claude/cycle/worker.py index a000da35..664bd940 100644 --- a/bin/loop_claude/cycle/worker.py +++ b/bin/loop_claude/cycle/worker.py @@ -30,7 +30,7 @@ def worker_args(task, session, model, resuming) -> list[str]: if resuming: start = ["-p", "Continue the task; the previous run stopped before it was finished.", "--resume", str(session.id)] else: - start = ["-p", f"{task}\n\nContinue any open draft PR or worktree for the item before creating a new one.", "--name", session.name, "--session-id", str(session.id)] + start = ["-p", f"{task}\n\nContinue any open draft PR or worktree for the chunk before creating a new one.", "--name", session.name, "--session-id", str(session.id)] return [ *start, "--output-format", "stream-json", diff --git a/docs/decisions.md b/docs/decisions.md index 9af8ceab..1052c76f 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -114,4 +114,8 @@ ## bench: a workflow change merges only once three benches rule it better -2026-10-01, lilleman. Serves goals 4.1 and 4.4. The 2026-09-30 bench showed one run cannot tell a workflow's effect from the variance between runs. Three is a starting number, to be evaluated against the stats. One bench ruling it worse closes the PR; only what was learned is kept. Valid until that evaluation changes the number. +2026-10-01, lilleman. Serves goals 4.1 and 4.4. The 2026-09-30 bench showed one run cannot tell a workflow's effect from the variance between runs. One bench ruling it worse closes the PR, since quality comes first (goal 4.1), and `docs/workflow-learnings.md` keeps what the PR changed and why it lost. Three is a starting number, to be evaluated against the stats. Valid until that evaluation changes the number. + +## chunk: as large as one purpose allows + +2026-10-01, lilleman. Serves goal 4.4. Every review has a fixed cost: each reviewer reloads the rules and the files around the change. On 2026-10-01 the prose reviews cost 50,000 to 150,000 tokens each, for changes of 1 to 30 lines. Purpose caps a chunk, never a line count. Valid until the stats or a bench show that larger chunks lower what reviews catch. diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index 493fb950..472a51eb 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -84,7 +84,7 @@ Launch prose-reviewer with what the diff touched and every section this review c 1. Read the finished PR against the README goals: does anything in it work against one? Misaligned → do not merge; ask the human, stating the conflict. 2. Aligned, every pass done and everything green → **merge**. Follow the repo's merge method (`AGENTS.md`; ff-only where that is the convention). A repo withholds this in its `AGENTS.md` → leave the PR ready and unmerged, and say which line withheld it. -3. Merged → tick the chunk's items off `todo.md` per `~/.claude/CLAUDE.md` → "Working loop". +3. Merged → remove the chunk's items from `todo.md` per `~/.claude/CLAUDE.md` → "Working loop". 4. Stop. The next chunk gets a fresh session. ## 6. Wrap up diff --git a/todo.md b/todo.md index ce3146ac..a07e8c5a 100644 --- a/todo.md +++ b/todo.md @@ -4,7 +4,7 @@ **⚠️ THE REBUILD NEVER MERGES INTO MAIN WITHOUT THE HUMAN'S EXPLICIT APPROVAL.** Every rebuild chunk is a worktree based on `origin/rebuild` with its PR into `rebuild`, never into main. Other sessions run on `~/.claude` main throughout; only the human merges `rebuild` into main, once they have approved the finished whole. -The rebuild lifts every dimension, until the last item opens `rebuild`'s PR into main. The sketches, the judges' verdicts and what to take from each: `~/code/claude-handoffs/claude-config_2026-09-28.md`. +The sketches, the judges' verdicts and what to take from each: `~/code/claude-handoffs/claude-config_2026-09-28.md`. - **Carry main's #155 into `grounded()`: match the judge's quote with markdown emphasis and whitespace ignored.** The judge drops a bold line's closing `**` when quoting it; `rebuild` still rejects that, so merging it into main would bring back loops stopping on a correct verdict. - **Score `rebuild` with the four-seat panel at 7.0 or above on every dimension and the overall, none below the last run, and open its PR into main for the human.** ⚠️ Leave that PR ready and unmerged: only the human merges it, after approving the whole rebuild. A dimension under the floor gets its places filed above this item. The PR deletes main's `AGENTS.md` paragraph on a rebuild chunk's larv-review, which only main holds.