Compare commits

...

8 Commits

11 changed files with 235 additions and 44 deletions
+1
View File
@@ -2,6 +2,7 @@
## Unreleased
- The loop commits each change it makes to a file in the config's folder, such as a plan kept there, in that folder's git repo, titled as it titles its commits in the checkout. rule-hook ranks the plan on such a commit; before, it refused the commit.
- Every tool, prompt, rule and skill reads and writes the plan, `AGENTS.md`, the records and the changelog at the paths the project's config names. A plan outside the checkout is read as it stands; the tools that need a file's commits say what they leave undone for it, and the loop goes on.
- loop-claude, `rank_todo.py`, `todo-item` and rule-hook's `todo.md` checks now fail in a checkout no config names: write a config for each project, with `goals-and-audience = "checkout:README.md"` where its goals stay in its README. They read the goals and audience from the file that setting names, in place of `README.md`. `larv-review reviewer-header` names it on a `Goals and audience:` line, and the reviewers read it from there. A client's project can keep the file, named `goals.md`, in its config's folder, and void code health there as a README can.
- Reviewers read the technical principles from the folder a project's config sets as `principles`, in place of `~/.claude/principles/`. `larv-review reviewer-header` names the folder on a `Technical principles:` line and fails where no config sets it, or the folder is missing or empty. Write a config for each project before its next review; a project that keeps today's principles sets `principles = "~/.claude/principles"`.
+1
View File
@@ -94,6 +94,7 @@ The rules only reviewers apply, for quality, comments, READMEs and prose, live i
- PR summary: short and concise. No test plan (it lives in the ticket), no link to the ticket (it's in the title).
- Branch for a ticket: exactly the ticket ID, nothing more. `ABC-123`, never `ABC-123-some-description`.
- Branch for a `todo.md` item without a ticket: `item-<ID>`, in the worktree `<checkout>-item-<ID>` beside the checkout, as `chunk-preflight` makes them.
- Where the project's config keeps a file in the config's folder, `~/.claude-projects/<key>/`, such as the plan or a record, commit each change you make to that file in the folder's own git repo, on its only branch. Title that commit as you would title the change in the checkout: where a commit in the checkout goes with it, give it the same title.
- Use `gh` on GitHub remotes and `tea` on Gitea remotes (e.g. `gitea.larvit.se`) — same command shape: `tea pr list|create`, `tea issue`, `tea release`, `tea api`. Everything in this section applies to both.
- On GitHub and Gitea, open a chunk's pull request as a draft, mark it ready and merge it with `~/.claude/bin/chunk-pr`, which picks `gh` or `tea` from the remote; `chunk-pr --help` says how. Once it has merged, run `chunk-pr clean` in the chunk's worktree: it removes the worktree and the branch and fast-forwards the main checkout.
+2 -2
View File
@@ -77,7 +77,7 @@ To get loop-claude's questions and stops as Mattermost DMs from a bot, write the
### Set up a project
Each project the loop runs in has a folder, `~/.claude-projects/<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. A project is a whole git checkout, never a subfolder of one.
Each project the loop runs in has a folder, `~/.claude-projects/<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 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. 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 in its checkout:
@@ -94,7 +94,7 @@ goals-and-audience = "checkout:README.md"
principles = "~/.claude/principles"
```
For a client's project, use one sandbox VM per client, so that one client's code, transcripts and credentials never share a machine with another's. What the client's repo should not hold lives in the config's folder, at paths written as `folder:<path>`, as `project-config --help` shows: the plan, the working rules in an `AGENTS.md` I write for the agents, the records, and the goals and audience, as `goals-and-audience = "folder:goals.md"`. Name that file `goals.md`, so the rules for goals and audience load when an agent writes it. A file outside the checkout has no commits, so four things are not supported for it yet. `score-outcomes` and loop-claude's routing figures count a project's chunks only where `todo.md`, `docs/comprehension-history.md` and `docs/reading-cost.md` are at those paths in the checkout; otherwise each says so, and the loop goes on. For a plan or a comprehension history outside the checkout, `larv-review` says it cannot tell whether a scoring run is owed, and for such a history it cannot find a paired ruling's base. For a plan outside the checkout, chunk-preflight and loop-claude don't see a release whose last item has shipped, and say that its release review and its cut are yours to call. And rule-hook checks a plan outside the checkout on every call, not only when it changed.
For a client's project, use one sandbox VM per client, so that one client's code, transcripts and credentials never share a machine with another's. What the client's repo should not hold lives in the config's folder, at paths written as `folder:<path>`, as `project-config --help` shows: the plan, the working rules in an `AGENTS.md` I write for the agents, the records, and the goals and audience, as `goals-and-audience = "folder:goals.md"`. Name that file `goals.md`, so the rules for goals and audience load when an agent writes it. A file outside the checkout has no commits in the checkout's history, so four things are not supported for it yet. `score-outcomes` and loop-claude's routing figures count a project's chunks only where `todo.md`, `docs/comprehension-history.md` and `docs/reading-cost.md` are at those paths in the checkout; otherwise each says so, and the loop goes on. For a plan or a comprehension history outside the checkout, `larv-review` says it cannot tell whether a scoring run is owed, and for such a history it cannot find a paired ruling's base. For a plan outside the checkout, chunk-preflight and loop-claude don't see a release whose last item has shipped, and say that its release review and its cut are yours to call. And rule-hook checks a plan outside the checkout on every call, not only when it changed.
```sh
mkdir -p ~/.claude-projects/acme && cd ~/.claude-projects/acme
+12 -2
View File
@@ -14,7 +14,7 @@ SETTINGS = ("plan", "working-rules", "decisions", "score-anchors", "comprehensio
# 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 ~/'
# Where a project keeps a file, for a tool that reads it at a commit: a path from the checkout's top, as git names it; or, outside the checkout, the file itself, which the tool reads as it stands, since git holds no version of it.
# Where a project keeps a file, for a tool that reads it at a commit: a path from the checkout's top, as git names it; or, outside the checkout, the file itself, which the tool reads as it stands, since the checkout's commits hold no version of it.
Place = str | pathlib.Path
@@ -27,7 +27,7 @@ class ProjectConfig:
paths: dict[str, pathlib.Path]
def tracked(self, setting: str) -> str | None:
"""setting's path from top, as git names a file in a commit; None where the config puts it outside the checkout, where git holds no version of it."""
"""setting's path from top, as git names a file in a commit; None where the config puts it outside the checkout, whose commits hold no version of it."""
path = self.paths[setting]
return path.relative_to(self.top).as_posix() if path.is_relative_to(self.top) else None
@@ -64,6 +64,16 @@ def load(top: pathlib.Path, main: pathlib.Path, home: pathlib.Path) -> ProjectCo
return ProjectConfig(file.parent.name, file.parent, top, {name: path for name, path in paths.items() if path})
def held(folder: pathlib.Path, home: pathlib.Path) -> ProjectConfig | Failure | None:
"""The config in folder, read as its project's main checkout reads it; None where folder is not a config's folder under home."""
# Matched on resolved paths, as git names a folder, so a config's folder reached through a symlink is still found.
file = next((file for file in (home / PROJECTS).glob(f"*/{CONFIG}") if file.parent.resolve() == folder.resolve()), None)
if file is None:
return None
config = read(file, home)
return config if isinstance(config, Failure) else load(config[0], config[0], home)
def read(file: pathlib.Path, home: pathlib.Path) -> tuple[pathlib.Path, dict[str, object]] | Failure:
"""The checkout a config names, as an absolute path, and its other values."""
try:
+24 -1
View File
@@ -9,8 +9,8 @@ import unittest.mock
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from failure import Failure
from project_config.settings import held, load, ProjectConfig
from test_env import isolated_env
from project_config.settings import load, ProjectConfig
TOOL = pathlib.Path(__file__).resolve().parents[1] / "project-config"
@@ -171,6 +171,29 @@ class LoadTest(ConfigCase):
self.assertIsInstance(load(self.checkout, self.checkout, self.home), ProjectConfig)
class HeldTest(ConfigCase):
def test_a_configs_folder_holds_its_config_as_the_main_checkout_reads_it(self) -> None:
folder = self.write("acme", CLIENT)
found = held(folder, self.home)
assert isinstance(found, ProjectConfig), found
self.assertEqual((found.folder, found.top, found.paths["plan"]), (folder, self.checkout, folder / "todo.md"), "the config's ~/ checkout read under home")
def test_a_folder_holds_no_config_unless_it_is_under_the_projects_folder_and_has_one(self) -> None:
self.assertIsNone(held(self.home / ".claude-projects" / "empty", self.home), "no config.toml")
elsewhere = self.home / "code" / "acme"
elsewhere.mkdir()
(elsewhere / "config.toml").write_text(CLIENT, encoding="utf-8")
self.assertIsNone(held(elsewhere, self.home), "a config.toml outside ~/.claude-projects/")
def test_a_configs_folder_reached_through_a_symlink_holds_its_config(self) -> None:
target = self.home / "kept" / "acme"
target.mkdir(parents=True)
(target / "config.toml").write_text(CLIENT, encoding="utf-8")
(self.home / ".claude-projects").mkdir()
(self.home / ".claude-projects" / "acme").symlink_to(target)
self.assertIsInstance(held(target, self.home), ProjectConfig, "git names the folder by its resolved path")
class ToolTest(ConfigCase):
def run_tool(self, *args: str, cwd: pathlib.Path | None = None) -> subprocess.CompletedProcess[str]:
return subprocess.run([sys.executable, str(TOOL), *args], cwd=cwd or self.checkout, env={**isolated_env(), "HOME": str(self.home)}, capture_output=True, text=True)
+1 -1
View File
@@ -81,7 +81,7 @@ RULES: dict[RuleName, Rule] = {
),
"todo-rank-check": Rule(
"while todo.md has changes, staged or not, a git commit waits until rank_todo.py --check passes on it: the checkout's own bin/rank_todo.py where the checkout is of this setup's repo, else ~/.claude/bin/rank_todo.py",
"a git commit in a checkout whose todo.md has changes, and every git commit where the project's config puts todo.md outside the checkout, where no commit says whether it changed",
"a git commit in a checkout whose todo.md has changes, and every git commit where the project's config puts todo.md outside the checkout, where the checkout's commits don't say whether it changed; and a git commit in the config's folder, `~/.claude-projects/<key>/`, whose todo.md has changes",
),
}
# The lookahead ends each reason at the next marker on its line, or at the line's end. The reason is lazy, so it stops at the next marker instead of running on and swallowing the markers after it.
+31
View File
@@ -927,6 +927,37 @@ class TodoRankCheck(unittest.TestCase):
(self.config.parent / "todo.md").write_text("# todo\n")
self.assertEqual(self.details(checkout), [f"own script checked {self.config.parent}/todo.md"])
def test_a_commit_in_the_configs_folder_checks_the_plan_it_keeps_there_once_it_changes(self):
checkout = self.changed_plan(f"{self.folder}/clone", self.STUB)
folder = str(self.config.parent)
git(folder, "init", "-q", "-b", "main")
self.assertEqual(self.details(folder), [], "the plan is the checkout's todo.md, which a commit here doesn't hold")
self.config.write_text(self.config.read_text().replace('"checkout:todo.md"', '"folder:todo.md"'))
(self.config.parent / "todo.md").write_text("# todo\n")
self.assertEqual(self.details(folder), [f"own script checked {folder}/todo.md"], "checked with the checkout's own rank_todo.py, as a commit there would be")
self.assertEqual([(breach.rule, breach.directory) for breach in todo_breaches(folder, pathlib.Path(self.own))], [("todo-rank-check", str(pathlib.Path(folder).resolve()))])
git(folder, "add", "-A")
git(folder, "commit", "-q", "-m", "plan")
self.assertEqual(self.details(folder), [], "committed, so unchanged")
def test_an_unreadable_config_does_not_block_a_commit_in_its_folder(self):
self.changed_plan(f"{self.folder}/clone", self.STUB)
folder = str(self.config.parent)
git(folder, "init", "-q", "-b", "main")
self.config.write_text("checkout = 3\n")
(self.config.parent / "todo.md").write_text("# changed\n")
self.assertEqual(self.details(folder), [], "the commit that fixes the config goes through")
def test_a_commit_in_the_configs_folder_of_another_repo_checks_its_plan_with_the_hooks_ranking(self):
self.changed_plan(self.other, self.STUB)
self.config.write_text(self.config.read_text().replace('"checkout:todo.md"', '"folder:todo.md"'))
folder = str(self.config.parent)
git(folder, "init", "-q", "-b", "main")
(self.config.parent / "todo.md").write_text("# todo\n")
reasons = self.details(folder)
self.assertTrue(reasons)
self.assertNotIn("own script", " ".join(reasons))
def test_a_plan_in_a_folder_of_the_checkout_is_checked_once_it_changes(self):
checkout = self.changed_plan(f"{self.folder}/clone", self.STUB)
self.config.write_text(self.config.read_text().replace('"checkout:todo.md"', '"checkout:plan/todo.md"'))
+18 -3
View File
@@ -8,9 +8,9 @@ from rule_hook.rules import Breach
from failure import Failure
from git_cli.git_repo import git
from rule_hook.git import guarded_git
from project_config.settings import held, ProjectConfig
from project_config.main import located
from release_plan import plan_file
from project_config.settings import ProjectConfig
# The checkout this hook runs from: bin/rule_hook/ sits two folders below it.
@@ -20,22 +20,37 @@ OWN_CHECK_SECONDS = 20
def todo_breaches(directory: str, own: pathlib.Path = OWN) -> list[Breach]:
"""Why the plan of directory's project is not ranked, where the plan has changed; the plan is the todo.md its config names."""
"""Why the plan of directory's project is not ranked, where the plan has changed; the plan is the todo.md its config names. directory may also be in a config's folder, a git repo of its own."""
top = guarded_git(directory, "rev-parse", "--show-toplevel")
if isinstance(top, Failure):
return []
held_here = held(pathlib.Path(top), pathlib.Path.home())
if held_here is not None:
return folder_breaches(top, held_here, own)
config = located(top, pathlib.Path.home(), functools.partial(git, guarded=True))
if isinstance(config, Failure):
# A checkout whose todo.md changes with no config is one whose config is still to write. An unchanged todo.md may be a third party's, whose clone needs no config.
unconfigured = pathlib.Path(top) / "todo.md"
return [Breach("todo-rank-check", config.reason, top)] if unconfigured.is_file() and changed(top, unconfigured, "todo.md") else []
todo, tracked = config.paths["plan"], config.tracked("plan")
# A plan outside the checkout has no commit to differ from, so it is checked on every call.
# A plan outside the checkout has no commit in the checkout to differ from, so it is checked on every call.
if not todo.is_file() or (tracked is not None and not changed(top, todo, tracked)):
return []
return [Breach("todo-rank-check", line, top) for line in check_failures(top, todo, config, own)]
def folder_breaches(top: str, config: ProjectConfig | Failure, own: pathlib.Path) -> list[Breach]:
"""Why the plan kept in top, a config's folder, is not ranked, where the plan has changed in that folder's repo; ranked as for a commit in the project's checkout.
A config that fails to load doesn't block anything here, so that the commit that fixes it goes through."""
if isinstance(config, Failure) or not config.paths["plan"].is_relative_to(config.folder):
return []
todo = config.paths["plan"]
if not todo.is_file() or not changed(str(config.folder), todo, todo.relative_to(config.folder).as_posix()):
return []
return [Breach("todo-rank-check", line, top) for line in check_failures(str(config.top), todo, config, own)]
def check_failures(top: str, todo: pathlib.Path, config: ProjectConfig, own: pathlib.Path) -> list[str]:
"""Why rank_todo.py --check fails on todo. A checkout of the repo the hook runs from checks with its own bin/rank_todo.py, so a branch that changes the table's shape is held to its own rules. Any other checkout checks with the hook's ranking: running its script would run its code before every commit."""
script = pathlib.Path(top) / "bin" / "rank_todo.py"
+103
View File
@@ -3686,3 +3686,106 @@ Ruling: same
|---|---|---|---|---|---|
| Mid A | same | same | same | same | same |
| Inherited architect | same | same | same | same | same |
## 2026-11-13T01:19:17Z, PR #520 at 8f03747
| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |
|---|---|---|---|---|---|
| Junior A | 7 | 5.5 | 6 | 5.5 | 6 |
| Mid A | 6.5 | 5.5 | 6 | 5 | 6 |
| Maintainability senior | 7 | 6 | 6 | 6 | 6.5 |
| Inherited architect | 7 | 6 | 6 | 6.5 | 6.5 |
| Mean | 6.88 | 5.75 | 6.00 | 5.75 | 6.25 |
Junior A, hardest first:
- Locality, Self-sufficiency: `bin/loop_claude/routing.py:93` `unfinished_route`: five notions of rung plus the escalation mark and `UNFINISHED_PER_STEP`, with each step's reason in the decision log
- Locality: `bin/loop_claude/cycle/run.py:154` `rule`: stamps, annotates, steps up and archives in an order only the code states, with `close.py` archiving again
- Locality, Shape: `bin/release_plan/ranking.py:304` `score`: every function forks on `SHAPE` versus `OLD_SHAPE`, with no word on when the old one goes
- Shape: `bin/release_plan/release_standing.py:168` `next_release`: six `Pick` types and `| Failure` or `| None` fields in `LastCut`
- Shape: `bin/rule_hook/todo_check.py:22` `todo_breaches`: three config paths, and why the checkout's own script runs only under `same_repo` stays unclear
- Shape: `bin/loop_claude/loop/reload.py:220` `decoded_route`: one dense guard, and renaming a `LoopRun` field stops a running loop
- Self-sufficiency: `skills/larv-review/SKILL.md:82` "Round cap": needs `CLAUDE.md`, `review-findings.md` and the rules files open at once
Mid A, hardest first:
- Locality, Self-sufficiency: `bin/loop_claude/routing.py:93` `unfinished_route`: five rung notions across four helpers and the escalation mark, the cap's reason only in the decision log
- Shape, Locality: `bin/rule_hook/todo_check.py:22` `todo_breaches`: four paths, `held()` and `located()` answering similar questions differently, and `changed` hashing a blob by hand
- Shape: `bin/release_plan/release_standing.py:168` `next_release`: three-way `LastCut` fields whose `None` means different things per field
- Locality: `bin/release_plan/ranking.py:304` `score`: two table shapes branch through scoring, and the weights' reasons sit elsewhere
- Locality: `bin/loop_claude/cycle/judge.py:196` `quotes_checked`: six checks each turn the verdict into something different
- Shape: `bin/larv_review/plan.py:66` `plan_reasons`: several failing reads threaded through every branch, and `ids=None` means something only the callers say
- Locality: `bin/loop_claude/cycle/run.py:154` `rule`: a fixed order nothing enforces, and an 18-field `Cycle` passed everywhere
- Self-sufficiency: `bin/larv_review/main.py:1` help: about 150 lines of rules a reader needs before any handler
Maintainability senior, hardest first:
- Locality, Self-sufficiency: `bin/loop_claude/routing.py:93` `unfinished_route`: six things held at once, and why the rules combine sits behind the decision log
- Shape: `bin/rule_hook/todo_check.py:42` `folder_breaches`: four cases and a second fork in `check_failures`, and `held` neither says what it tells nor that `config.top` is the main checkout
- Shape: `bin/rule_hook/rules.py:82` `todo-rank-check`: one help sentence carries three conditions joined by "and"
- Locality: `bin/loop_claude/cycle/run.py:154` `rule`: archives twice in a set order, and `stepped_to` changes `cycle.route` outside the state machine
- Locality, Self-sufficiency: `bin/release_plan/ranking.py:160` `weigh`: two table formats, and constants whose reason is only "docs/decisions.md records the choice"
- Shape: `bin/rule_hook/main.py:116` `bash_breaches`: a 200-character return line joining four kinds of breach
- Locality: `bin/larv_review/main.py:1` help: the only full statement of `needs-scoring-run` and `scoring-run-owed`, implemented in other modules
Inherited architect, would restructure first:
- Locality, Shape: `bin/chunk_preflight/choices.py:80` `forge_of`: forge code split across `chunk_preflight` and `deploy_release`, which three tools reach into
- Navigation: `bin/records/__init__.py:1` `records`: file utilities share a name with the judge's records in `loop_claude/project/records.py`
- Shape: `README.md:3` dated experiments: five research and outreach folders at the root beside the working areas
- Navigation, Shape: `README.md:131` `bin/`: 66 entries at one level, navigable only through the README's prose map
- Locality: `bin/loop_claude/cycle/run.py:154` `rule`: `rule`, `close` and `keep_rejection` each archive and map a Failure to `Stop(1)`
- Self-sufficiency: `bin/rule_hook/round_cap.py:26` `earlier_titles`: fails open when git cannot list the branch's titles, so a mislabelled round passes
## 2026-11-13T01:23:02Z, PR #520 rerun at 8f03747
| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |
|---|---|---|---|---|---|
| Junior A | 6.5 | 5 | 5.5 | 5 | 5.5 |
| Mid A | 7 | 5.5 | 6 | 5.5 | 6 |
| Maintainability senior | 7 | 6 | 6 | 6 | 6.5 |
| Inherited architect | 6.5 | 6 | 5.5 | 6 | 6 |
| Mean | 6.75 | 5.63 | 5.75 | 5.63 | 6.00 |
Junior A, hardest first:
- Shape: `bin/release_plan/release_standing.py:168` `next_release`: a before-first-release constant, cut and named releases, and `str | None | Failure` fields tracked to where each is checked
- Locality, Self-sufficiency: `bin/loop_claude/routing.py:93` `unfinished_route`: the escalation rule split across four files, five ideas in a few lines, and the reasons in the decision log
- Shape: `bin/rule_hook/todo_check.py:22` `todo_breaches`: three paths, the checkout's own script only under `same_repo`, and a blob hashed by hand
- Locality: `bin/loop_claude/cycle/run.py:67` `run_cycle`: changes `cycle.route` away from where the 17-field `Cycle` is built
- Locality: `bin/larv_review/owed.py:46` `shortfall`: logic hangs on the exact wording of a sentence SKILL.md also depends on
- Shape: `bin/rule_hook/committed_files.py:14` `committed_file_breaches`: a reversed-dict dedupe whose choice of copy no comment explains
- Self-sufficiency: `skills/larv-review/SKILL.md:82` "Round cap": every sentence points to another rule, and the code read easier than the prose
- Shape: `bin/release_plan/ranking.py:315` `weight_of`: old and new table shapes in five functions, and a docstring packing three rules into one sentence
Mid A, hardest first:
- Locality, Self-sufficiency: `bin/loop_claude/routing.py:93` `unfinished_route`: five things held for one step-up, and why the rules interact lives in the decision log
- Locality: `bin/loop_claude/cycle/run.py:154` `rule`: archives twice in an order that matters, repeated across `run.py` and `close.py`, and nothing guards it
- Self-sufficiency: `bin/release_plan/release_standing.py:168` `next_release`: `BEFORE_FIRST_RELEASE` and the earliest test need `CLAUDE.md` → "Working loop" open beside them
- Shape: `bin/release_plan/ranking.py:56` `rank`: each function reads as two algorithms interleaved, old shape and new
- Self-sufficiency: `bin/larv_review/plan.py:66` `plan_reasons`: the 155-line help and the code each state part of when a scoring run is due
- Self-sufficiency: `bin/loop_claude/cycle/judge.py:21` `INTERRUPT_RULES`: behaviour held in prompt text and schema descriptions the code can't explain
- Shape: `bin/rule_hook/todo_check.py:22` `todo_breaches`: three branches, and a subprocess path I would not have guessed
- Self-sufficiency: `skills/larv-review/SKILL.md:82` "Round cap": dense rules pointing at each other, some at files out of reach
Maintainability senior, hardest first:
- Shape, Self-sufficiency: `bin/release_plan/release_standing.py:168` `next_release`: `Failure` in every `LastCut` field, a sentinel version and a `nothing_cut` flag worked through as truth tables
- Locality: `bin/loop_claude/routing.py:93` `unfinished_route`: five helpers and the escalation mark held at once, the rule kept in no one place
- Shape: `bin/release_plan/ranking.py:160` `weigh`: the legacy shape doubles every scoring function, and nothing says when it can go
- Shape: `bin/rule_hook/committed_files.py:14` `committed_file_breaches`: a double-reverse dedupe with no comment
- Locality: `bin/loop_claude/cycle/run.py:154` `rule`: five steps in a row, overlapping archive helpers, and an order that is the trap
- Shape: `bin/rule_hook/todo_check.py:42` `folder_breaches`: `config.folder` to `changed` but `config.top` to `check_failures`, right but a stop to confirm
- Shape: `bin/model_routing/route.py:28` `levels_fit`: two rules in one boolean, and `route_of` packs its type checks into one long line
- Self-sufficiency: `skills/larv-review/SKILL.md:82` "Round cap": dense bullets pointing elsewhere, reread before the code matched
Inherited architect, would restructure first:
- Navigation, Shape: `README.md:131` `bin/`: about 63 entries at one level, with the shared libraries told apart only by README prose
- Locality, Shape: `bin/chunk_preflight/choices.py:80` `forge_of`: forge identity and forge calls in two tool packages, so a second forge lands in three
- Navigation: `bin/records/__init__.py:1` `records`: a utility package named like the judge's records, and quote semantics in `claude_code/transcript.py:85` `verbatim`
- Locality: `bin/loop_claude/cycle/run.py:94` `archived`: archive helpers in the cycle runner, which `loop/close.py` imports
- Shape: `README.md:3` trial folders: four finished experiments at the root beside the working areas
- Locality: `bin/rule_hook/rules.py:61` `round-cap`: the cap's wording spelled in SKILL.md, `rules.py` and `round_titles.py`
- Self-sufficiency: `bin/rule_hook/round_cap.py:26` `earlier_titles`: fails open on the unattended path when git cannot list the branch's titles
+17
View File
@@ -1873,3 +1873,20 @@ Read most (opens and searches):
- `bin/release_plan/test_ranking.py` 5
- `bin/rule_hook/test_rule_hook.py` 5
- `bin/judge_replay/test_judge_replay.py` 4
## Reading cost, chunk ed034b89322e, finished 2026-11-13T00:56:13Z
102937 new input tokens before the first commit.
Read most (opens and searches):
- `bin/todo_item/test_todo_item.py` 6
- `bin/project_config/test_project_config.py` 3
- `bin/rank_todo.py` 3
- `bin/release_plan/release_standing.py` 3
- `bin/test_env.py` 3
- `bin/test_rank_todo.py` 3
- `bin/todo_item/main.py` 3
- `docs/decisions.md` 3
- `bin/release_plan/plan_file.py` 2
- `bin/release_plan/test_ranking.py` 2
+25 -35
View File
@@ -12,7 +12,6 @@
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 345 | 0.10.0 | | | **Commit each change a chunk makes to a plan or record outside the checkout into the project's `~/.claude-projects/<key>/` repo, titled like the chunk's own commits.** | 3 | 2 | 3 | 6 | 4 | 1.6 by 4 | 1.1 |
| 348 | 0.11.0 | | | **Read each project's credentials from the env file its config names, fail naming each missing key, and keep every value out of prompts, transcripts, logs and the archive.** | 2 | 2 | 4 | 6 | 3 | 1.6 by 2, 4 by 5 | 6.9 |
| 354 | 0.11.0 | | | **Read and write the decisions, score anchors, comprehension history, reading cost and changelog each through the backend its project's config names, with markdown files as one backend.** | 3 | 2 | 3 | 6 | 6 | 1.6 by 4, code health by 1 | 1.2 |
| 364 | 0.11.0 | 354 | | **Read a client repo's own `CLAUDE.md` and `AGENTS.md`, propose to its team each change that aligns them with this setup, and record each conflict left as a decision in the project's records.** | 2 | 2 | 2 | 4 | 2 | 1.6 by 4, 1.2 by 2 | 2.2 |
@@ -22,7 +21,7 @@
| 349 | 0.11.0 | | | **Convert markdown to ADF and back with `@larvit/adf-codec`'s portable calls, through a pinned Node shim run in a container with a memory limit.** | 2 | 1 | 2 | 3 | 2 | 1.6 by 3 | 1.1 |
| 351 | 0.11.0 | 348, 349, 350 | | **Read a project's plan from the child issues of a Jira Cloud epic its config names, ranked in Jira's backlog order.** | 3 | 2 | 3 | 6 | 5 | 1.6 by 6 | 1.2 |
| 353 | 0.11.0 | 351 | | **Let a project's config take its goals and audience from a Jira epic's description, under the same two headings.** | 2 | 2 | 3 | 5 | 3 | 1.6 by 4 | 1.3 |
| 358 | 0.11.0 | | | **Let a project's config allow its runtime and tests on the host, and set the comprehension floor that marks code health very important.** | 2 | 2 | 3 | 5 | 3 | 1.6 by 4 | 1.3 |
| 358 | 0.11.0 | | | **Let a project's config allow its runtime and tests on the host, and set the comprehension score under which code health is very important.** | 2 | 2 | 3 | 5 | 3 | 1.6 by 4 | 1.3 |
| 362 | 0.11.0 | 348 | | **Send loop-claude's notices through the notifier a project's config names, with Mattermost as the first backend.** | 2 | 1 | 2 | 3 | 3 | 1.6 by 3 | 1.0 |
| 363 | 0.11.0 | 362 | | **Add a Slack backend to the notifier, sending each notice as a DM from a bot.** | 2 | 1 | 2 | 3 | 3 | 1.6 by 4 | 1.3 |
| 352 | 0.11.0 | 351 | | **Write a project's plan to its Jira epic: file items as child issues, edit those the loop filed, score unscored issues with a comment, and move a finished item to the status its config names.** | 3 | 2 | 3 | 6 | 5 | 1.6 by 6 | 1.2 |
@@ -41,9 +40,9 @@
| 298 | 0.12.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.9 |
| 331 | 0.12.0 | | | **Reword four decisions to expire when the rungs their replays tested change, not whenever a model joins the ladder.** | 1 | 1 | 1 | 1 | 2 | 1.4 by 2 | 0.8 |
| 327 | 0.12.0 | | | **Have `larv-review` print a round commit's title prefix, counted from the round's report, and have rule-hook refuse a round title whose counts differ from it.** | 3 | 2 | 3 | 6 | 4 | 1.1 by 1, 1.4 by 1 | 0.6 |
| 365 | 0.13.0 | 345, 352 | | **Have `score-outcomes` read the finished and dropped items of a plan outside the checkout, from the project repo's history or from Jira's issue changelogs.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 |
| 368 | 0.13.0 | 345, 352 | | **Call a release review due, call a release ready to cut, and tell whether a chunk owes a scoring run, for a plan outside the checkout, from the project repo's history or from Jira.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 |
| 366 | 0.13.0 | 345, 352 | | **Count the chunks of a project whose plan sits outside the checkout in the routing figures, from the project repo's history or from Jira.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.4 by 2 | 1.1 |
| 365 | 0.13.0 | 352 | | **Have `score-outcomes` read the finished and dropped items of a plan outside the checkout, from the project repo's history or from Jira's issue changelogs.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 |
| 368 | 0.13.0 | 352 | | **Call a release review due, call a release ready to cut, and tell whether a chunk owes a scoring run, for a plan outside the checkout, from the project repo's history or from Jira.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 |
| 366 | 0.13.0 | 352 | | **Count the chunks of a project whose plan sits outside the checkout in the routing figures, from the project repo's history or from Jira.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.4 by 2 | 1.1 |
| 367 | 0.13.0 | 352 | | **Check that every write to a Jira plan leaves it ranked, as rule-hook's `todo-rank-check` checks `todo.md` today.** | 2 | 2 | 3 | 5 | 3 | 1.6 by 2 | 0.7 |
| 303 | 0.14.0 | | defect | **Archive each judge run's prompt and json reply beside the verdict it gave, so judge cost, replays and backups cover the judge as they cover the worker.** | 2 | 2 | 3 | 5 | 3 | 1.4 by 3, 3 by 2 | 4.2 |
| 306 | 0.14.0 | | | **Set a strategy that keeps loop-claude's archive and larv-review's review folders backed up and small over the years, compressing older entries without losing any.** | 3 | 2 | 4 | 7 | 5 | 3 by 5 | 3.9 |
@@ -57,7 +56,7 @@
| 273 | 0.14.0 | | decision | **Re-tune the E + I steps of `REVIEW_STEPS` for 6 to 8 once 10 finished chunks have scored an E + I of 6 or more, from how well E + I orders their review rounds and 🔴 findings.** | 1 | 2 | 2 | 3 | 2 | 1.1 by 2, 1.4 by 3 | 2.0 |
| 268 | 0.14.0 | | | **End a run whose release is ready to cut with a notice on loop-claude's terminal, in place of an interrupt that waits for an answer.** | 2 | 2 | 3 | 5 | 3 | 1 by 5 | 1.9 |
| 171 | 0.14.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.8 |
| 300 | 0.14.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, Self-sufficiency first; today the scoring run at fba48f3 scored Navigation 6.88, Locality 5.63, Shape 6.00, Self-sufficiency 5.00 and Overall 5.88.** | 4 | 2 | 3 | 7 | 8 | code health by 8 | 1.7 |
| 300 | 0.14.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 and Self-sufficiency first; today the scoring run at 8f03747 scored Navigation 6.75, Locality 5.63, Shape 5.75, Self-sufficiency 5.63 and Overall 6.00.** | 4 | 2 | 3 | 7 | 8 | code health by 8 | 1.7 |
| 264 | 0.14.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.7 |
| 323 | 0.14.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.7 |
| 342 | 0.14.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.7 |
@@ -88,10 +87,6 @@
## Details
### 345. Commit each change a chunk makes to a plan or record outside the checkout into the project's `~/.claude-projects/<key>/` repo, titled like the chunk's own commits.
lilleman's call, 2026-11-12: each `~/.claude-projects/<key>/` is a git repo of its own, so plan and record edits keep a history. Those edits don't ride the chunk's branch: one loop runs per project, and it commits to the project repo's only branch. rule-hook's rank check, and the `Drop item` title rule, apply to these commits as they do in the checkout. Whether these repos are pushed anywhere for backup is a call for later: client data stays on the client's VM (goal 4).
### 348. Read each project's credentials from the env file its config names, fail naming each missing key, and keep every value out of prompts, transcripts, logs and the archive.
lilleman's call, 2026-11-12: credentials (Jira and Confluence API token, GitHub, Mattermost or Slack token) come from a per-project env file such as `~/.claude-projects/<key>.env`, outside the project's repo and named in the config. Which account each service uses is a config setting: a bot account or lilleman's own. A test shows a value never reaches a worker or judge prompt, a log line or the transcript archive, which guards goal 4. Today `~/.claude/.env` serves every project.
@@ -128,7 +123,7 @@ lilleman's calls, 2026-11-12. One epic is one project's plan. An item is a child
lilleman's call, 2026-11-12: this client keeps its goals and audience in the plan epic's description. The source is a config setting, never hard-coded; item 346 builds the file source this one adds to. Read through the adf-codec shim.
### 358. Let a project's config allow its runtime and tests on the host, and set the comprehension floor that marks code health very important.
### 358. Let a project's config allow its runtime and tests on the host, and set the comprehension score under which code health is very important.
lilleman's calls, 2026-11-12. Legacy products may have no container setup, so the config may allow host tooling; `CLAUDE.md`'s container rule and rule-hook then follow it. In 0.10.0 a decision in the project's records can put tooling on the host instead. The comprehension panel will score legacy code low, and today code health under 7.0 is very important. The config sets that floor, 7.0 in the configs of the projects under `~/code`; the signal stays that the score rises.
@@ -352,36 +347,31 @@ Releases are the human's, and `CLAUDE.md` → "Working loop" already ends the lo
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, Self-sufficiency first; today the scoring run at fba48f3 scored Navigation 6.88, Locality 5.63, Shape 6.00, Self-sufficiency 5.00 and Overall 5.88.
### 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 and Self-sufficiency first; today the scoring run at 8f03747 scored Navigation 6.75, Locality 5.63, Shape 5.75, Self-sufficiency 5.63 and Overall 6.00.
Filed by the comprehension check of PR #473 at 13d1550 (`larv-review record-scoring`), which printed `Floor:` and `Next:`, and refreshed from the second run of PR #510 at fba48f3. The lowest mean is Self-sufficiency, 5.00: all four seats name a reason that sits in `docs/decisions.md`, in the vocabulary at the end of `CLAUDE.md` or in `skills/larv-review/SKILL.md` rather than beside the code. 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 the second run of PR #520 at 8f03747. The lowest means are Locality and Self-sufficiency, 5.63 each: the seats name state shared across modules, such as the route and the archive order, and reasons that sit in `docs/decisions.md`, `CLAUDE.md` or `skills/larv-review/SKILL.md` rather than beside the code. Refresh this item's places and aim from the newest run before the chunk starts; do not file a second floor item.
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, hardest first (`larv-review places`):
- Locality, Shape: `bin/loop_claude/routing.py:93` `unfinished_route`: the floor rung, the escalation cap, the escalation mark, the unfinished count and the taken-in E + I are held at once, across about six helpers in five files. The mark's meaning lives in `escalation_mark.py`, and the reason for the floor and the cap sits in the decision log.
- Locality, Shape: `bin/release_plan/release_standing.py:145` `next_release`: the tag, changelog, before-first-release and renamed branches meet in the `is_earliest` expression, which took a senior three reads. Nothing comments the `None` and `nothing_cut` case.
- Locality: `bin/loop_claude/cycle/judge.py:211` `quotes_checked`: the judge's contract is split over prose constants, schema descriptions and checks after the fact. A bad quote silently changes the verdict's type.
- Locality, Shape: `bin/loop_claude/cycle/run.py:146` `rule`, with `loop/close.py:18` `closed_cycle`: the order of the ruling, rejection and step-up archive writes carries meaning, and nothing enforces it. Four near-identical archive helpers, `run.py:86` `archived` among them, sit in the cycle runner though `loop/close.py` imports them, and `run_cycle` replaces the route partway through its loop.
- Locality, Self-sufficiency: `bin/larv_review/reviewer_header.py:49` `unanswered_round` and `skills/larv-review/SKILL.md:76` "Round cap": the cap counts answer commits, so a worker that relaunches without committing gets the same round number. The cap is enforced in four units, split over SKILL.md and three modules.
- Locality, Shape: `bin/larv_review/plan.py:66` `plan_reasons`: a merge-base commit enters the parameter that item 296's chunk renamed `ref`, eight failure branches mix git reads, file reads and logic, and `after` means the checkout's text and then its items.
- Locality: `bin/larv_review/owed.py:37` `shortfall`: the one-run-or-two rule is keyed on the wording `EMPTIED_WORDS` that plan.py builds and SKILL.md quotes, and `scoring_runs` defines a scoring run differently from `Entry.scored`. Give the scoring-run logic one module, and have the number of runs owed come from a value, not from a sentence.
- Locality: `bin/chunk_pr/main.py:42` `forge`: the forge helpers live in `chunk_preflight` and `deploy_release`, so a second forge needs edits in four packages.
- Locality: `bin/rule_hook/reviewer_rung.py:40` `skill_breaches`: three cases rest on assumptions made in another function.
- Locality: `bin/rule_hook/repeat_read.py:119` `shown_lines`: it rebuilds from transcript entries which lines are in the agent's context.
- Locality: `bin/model_routing/route.py:88` `route_of`: a route has two serializations, a flat archive line and a nested handover.
- Self-sufficiency, Locality: `bin/loop_claude/cycle/prompts.py:59` `review_launches` and `:119` `escalation`: the worker's prompt is built from about 20 conditional sentence builders, which restate the routing logic.
- Shape: `bin/release_plan/ranking.py:56` `rank`, `:304` `score` and `:315` `weight_of`: nearly every function forks on `SHAPE` versus `OLD_SHAPE`, which doubles the module; item 156 removes the old shape. The constants read as magic until `rules/todo-items.md` is open.
- Shape: `bin/review_rules/comprehension_history.py:127` `entries`: a line-by-line parser that tolerates two legacy formats.
- Shape: `bin/records/__init__.py:1` `records`: one name for three concepts, as `cut` and `Plan` also name several.
- Shape: `bin/rule_hook/rules.py:25` `RULES`: rules sit inline in one module while five others have a module each.
- Navigation, Shape: `README.md:116` `bin/`: about 64 entries in one flat list, some 35 of them packages, the worst fan-out level.
- Self-sufficiency: `skills/larv-review/SKILL.md:147` "Scoring run": dense rule prose with many cross-references; three sections rebuild one rule.
- Locality: `bin/review_rules/round_titles.py:1` `ROUND`: the commit-title protocol `Answer <pass> round <n>: …` is parsed in `round_titles.py`, `rule_hook/round_cap.py`, `score_outcomes`, `branch_chunks` and `routing_figures`, and written in SKILL.md.
- Locality: `bin/larv_review/scoring_setup.py:156` `prepare_scoring`: code parses the headings and fences of SKILL.md and `seat-prompts.md`, so a prose edit can break it.
- Shape: `bin/command_lines/shell_command.py:46` `segments`: a hand-written shell tokenizer whose regexes stay opaque.
- Shape: `reviewer-merge-trials/driver.py:1` `driver`: one-off trial scripts space-indented and tersely named, against the repo's tabs and naming.
- Locality, Self-sufficiency: `bin/loop_claude/routing.py:93` `unfinished_route`, with `escalated_route`: the floor, the cap counted from `item_rung`, the escalation mark, the unfinished count and the E + I taken in are held at once across four files, and why they combine sits in the decision log. Every seat named it; three would least want to change it.
- Shape, Self-sufficiency: `bin/release_plan/release_standing.py:168` `next_release`, with `standing`: `str | None | Failure` fields in `LastCut`, the `BEFORE_FIRST_RELEASE` sentinel and `nothing_cut` meet in the `is_earliest` test, read as truth tables; four tools choose the next release through it.
- Locality: `bin/loop_claude/cycle/run.py:154` `rule`, with `:67` `run_cycle` and `:94` `archived`: archives twice in an order that matters and that nothing enforces, the archive helpers sit in the cycle runner though `loop/close.py` imports them, and `run_cycle` replaces `cycle.route` outside the state machine.
- Shape: `bin/release_plan/ranking.py:56` `rank`, `:160` `weigh`, `:304` `score` and `:315` `weight_of`: every function forks on `SHAPE` versus `OLD_SHAPE`, and the constants' reasons are only "docs/decisions.md records the choice".
- Shape: `bin/rule_hook/todo_check.py:22` `todo_breaches`, with `:42` `folder_breaches`: three paths, `held()` beside `located()`, the checkout's own script only under `same_repo`, and a blob hashed by hand.
- Locality, Self-sufficiency: `bin/larv_review/plan.py:66` `plan_reasons` and `bin/larv_review/owed.py:46` `shortfall`: the rule for when a scoring run is due is split between the 155-line help and the code, and the number owed hangs on the wording `EMPTIED_WORDS`.
- Self-sufficiency: `bin/loop_claude/cycle/judge.py:21` `INTERRUPT_RULES`, with `:196` `quotes_checked`: behaviour held in prompt text and schema descriptions the code can't explain, and prompts that quote `CLAUDE.md` wording.
- Self-sufficiency: `skills/larv-review/SKILL.md:82` "Round cap": dense rules that point at `CLAUDE.md`, `review-findings.md` and the rules files, read three times before the code matched.
- Self-sufficiency: `bin/rule_hook/round_cap.py:26` `earlier_titles`: fails open on the unattended path where git cannot list the branch's titles, and the cap's wording is spelt in SKILL.md, `rules.py:61` and `round_titles.py`.
- Locality, Shape: `bin/chunk_preflight/choices.py:80` `forge_of`: forge identity and forge calls live in two tool packages, so a second forge lands in three.
- Navigation, Shape: `README.md:131` `bin/`: about 63 entries at one level, the shared libraries told apart only by README prose.
- Navigation: `bin/records/__init__.py:1` `records`: utility code named like the judge's records, and quote semantics in `claude_code/transcript.py:85` `verbatim`.
- Shape: `bin/rule_hook/committed_files.py:14` `committed_file_breaches`: a double-reverse dedupe whose choice of copy no comment explains.
- Shape: `bin/model_routing/route.py:28` `levels_fit`, with `route_of`: two rules in one boolean, and type checks packed into one long line.
- Shape: `bin/loop_claude/loop/reload.py:220` `decoded_route`: one dense guard, and renaming a `LoopRun` field stops a running loop.
- Shape: `bin/rule_hook/main.py:116` `bash_breaches`: a 200-character return line joining four kinds of breach.
- Shape: `README.md:3` trial folders: four finished experiments at the root beside the working areas.
- Self-sufficiency: the seats on this run name the decision-log titles that code cites for a constant's reason (`routing: …` in `routing.py`, `ladder.py`, `judge.py`) as the largest cost; state each reason beside its constant.
Scored L 4 because the refactor touches several components that hold known defects, E 2 because review and a manual check see a regression, I 3 because every session runs these tools. The chunk runs a scoring run, since it is a floor item.