Read the prose language and the title and branch templates from the project's config

This commit is contained in:
2026-11-14 01:14:08 +01:00
parent 82f4bbd91b
commit ce87a519f0
22 changed files with 134 additions and 29 deletions
+3 -2
View File
@@ -34,7 +34,7 @@ Fewer items shipped per release is a price this goal accepts, not a counter-sign
## Prose
Everything written — chat, commit messages, comments, docs, code — is in **English**. Prose meets four priorities, in this order. When two pull against each other, the higher one wins.
Everything written — chat, commit messages, comments, docs, code — is in **English**. Where a project's config names another `language`, which `~/.claude/bin/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. Chat, names in code, and the fixed words a tool reads in a title, such as `Answer <pass> round <n>:`, stay English. Prose meets four priorities, in this order. When two pull against each other, the higher one wins.
1. **Easy to understand.** A reader with little time gets it on one read: one idea per sentence, and each term explained before it is used.
2. **Most important first**, judged by what the reader wants to know first.
@@ -91,10 +91,11 @@ The rules only reviewers apply, for quality, comments, READMEs and prose, live i
## Git, commits, and PRs
- Mark no commit, PR, issue comment or file as the work of Claude, Anthropic or an agent.
- Commit message and PR title: **one line**, prefixed with the ticket ID when the work has one. Example: `ABC-123 - Regression tests for GET /v4/clients`. Never include the repo/project name (like "twu-4") — we're already in that context.
- Where the project's config names a `commit-title`, `pull-request-title` or `branch` template, fill it instead of following the formats in this section: `{summary}` with that one line, `{id}` with the ID of the chunk's first item. `~/.claude/bin/project-config --help` describes the templates, and `chunk-preflight`'s facts quote them. A title a tool reads, such as `Answer <pass> round <n>: …`, `Drop item <ID>: …` or `Release review of <release>`, is the template's `{summary}`.
- When the work has a ticket, read it before starting: verify the change matches it and pull useful context from it.
- 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.
- 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. Under a `branch` template, `chunk-preflight` names both by the template.
- 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
View File
@@ -96,6 +96,8 @@ principles = "~/.claude/principles"
A project may also set `env-file`, the file of `KEY=value` credentials its tools read, such as `env-file = "~/.claude-projects/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.
A project whose owners write in another language than English, or title their commits, pull requests and branches otherwise than `CLAUDE.md` → "Git, commits, and PRs" does, sets `language`, `commit-title`, `pull-request-title` and `branch` in its config, as `project-config --help` describes. The worker writes the project's prose in that language and the prose reviewer judges it there. rule-hook refuses a commit, and `chunk-pr` a pull request, whose title doesn't fit its template, and `chunk-preflight` names the branch and the worktree by the `branch` template. Every tool that reads a commit title, such as a round's `Answer <pass> round <n>:`, reads it as the template's `{summary}`.
A project whose pull requests need a human's approval sets `wait-for-approval = true` in its config. `chunk-pr merge` then waits, once the checks have passed, until GitHub reports the pull request approved as its branch protection requires, and merges it. It refuses on Gitea, where a reviewer requested changes and where the protection requires no review. It gives up after 90 minutes without an approval; run it again once the pull request is approved. Left out, the setting is false.
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.
+2
View File
@@ -15,6 +15,8 @@ The bar, read each time, since it changes:
Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md.
Your prompt's `Prose language:` line names the language the project's config sets. Judge every check below in that language, by its own grammar and idiom: where the bar's examples are English, hold the prose to what they show, never to their English wording. Prose in another language is a finding, except chat, names in code and the fixed words a tool reads in a title. Write your report in English.
## Checks, in priority order
Run them in this order. A fix for a later check never breaks an earlier one.
+1 -1
View File
@@ -2,11 +2,11 @@ import dataclasses
import re
import typing
from project_config import templates
from failure import Failure
from review_rules.comprehension_history import HISTORY
from release_plan.todo_table import Item, items
from reading_cost.figures import RECORD
from project_config import templates
from text_files.utc_stamp import utc
# The plan, and the records tools append to: none of their lines are the chunk's work.
+1 -1
View File
@@ -6,8 +6,8 @@ from failure import Failure
from git_cli.git_repo import git, Git, text_at
from project_config.main import located
from project_config.settings import ProjectConfig
from project_config import templates
from record_store.stores import store
from project_config import templates
# Where branch_chunks reads the plan and the records, by the setting that names each in a project's config.
+2 -2
View File
@@ -82,10 +82,10 @@ class CutBranch(unittest.TestCase):
self.assertEqual([found.titles for found in found.chunks], [("Take \x1e and \x1f",)])
def test_reads_each_title_as_its_summary_in_the_projects_commit_title_template(self):
log = f"\x00{'a' * 40} 100 100 \x1faaaaaaa\x1fPAY-7 - Drop item 6: moot\n\nb.py\n\x00{'b' * 40} 90 90 \x1fbbbbbbb\x1fFrom before the template\n\nb.py\n"
log = f"\x00{'a' * 40} 100 100 {'b' * 40}\x1faaaaaaa\x1fPAY-7 - Drop item 6: moot\n\nb.py\n\x00{'b' * 40} 90 90 \x1fbbbbbbb\x1fFrom before the template\n\nb.py\n"
found = cut_branch(log, "PAY-{id} - {summary}")
self.assertNotIsInstance(found, Failure)
self.assertEqual([title for chunk in found.chunks for title in chunk.titles], ["Drop item 6: moot", "From before the template"])
self.assertEqual(sorted(title for chunk in found.chunks for title in chunk.titles), ["Drop item 6: moot", "From before the template"])
def test_fails_on_a_commit_it_cannot_read(self):
self.assertIsInstance(cut_branch(f"\x00{'a' * 40} 100\x1faaaaaaa\n"), Failure)
+17 -3
View File
@@ -11,7 +11,9 @@ pull request only while its head is the commit checked out, so push before you r
open pushes the branch, setting its upstream, and opens a draft pull request into origin's
default branch. <title> is one line, as ~/.claude/CLAUDE.md → "Git, commits, and PRs"
says, and <body> is the pull request's summary. Where the branch's pull request is open
says, and <body> is the pull request's summary. It refuses a <title> that doesn't fit the
`pull-request-title` template the project's config names (`project-config --help`), as
ready does, and fails where no config names the checkout. Where the branch's pull request is open
already, it opens no second one. On origin's default branch it refuses without pushing anything.
sync fetches origin and merges its default branch into the branch checked out, where the
branch does not hold it already, and prints which it did. Then, where the project's config
@@ -60,6 +62,7 @@ from deploy_release.forge import checks_passed, gitea, merged_pull, open_pull, r
from failure import Failure
from chunk_preflight.gathered import Forge
from chunk_preflight.choices import forge_of
from project_config import templates
BIN = pathlib.Path(__file__).resolve().parents[1]
# How long merge waits for a check to report before it takes a pull request without any as passed: CI queues its checks within seconds of a push, and merge may run right after one.
@@ -89,11 +92,11 @@ def step(argv: list[str], run: Run) -> str | Failure:
"""Run the step argv names: the line to print, or a Failure. A malformed argv doesn't run anything."""
match argv:
case ["open", title, *body] if len(body) <= 1 and not title.startswith("-"):
return Failure("give a title of one line") if not one_line(title) else opened(title, body[0] if body else "", run)
return Failure("give a title of one line") if not one_line(title) else misfit(title, run) or opened(title, body[0] if body else "", run)
case ["sync"]:
return synced(run)
case ["ready", *title] if len(title) <= 1 and not any(given.startswith("-") for given in title):
return Failure("give a title of one line") if title and not one_line(title[0]) else marked_ready(run, title[0] if title else None)
return Failure("give a title of one line") if title and not one_line(title[0]) else (misfit(title[0], run) if title else None) or marked_ready(run, title[0] if title else None)
case ["merge"]:
return merged(run)
case ["clean"]:
@@ -101,6 +104,17 @@ def step(argv: list[str], run: Run) -> str | Failure:
return Failure(USAGE)
def misfit(title: str, run: Run) -> Failure | None:
"""Why title doesn't fit the `pull-request-title` template the project's config names; None where it fits. A config that cannot be read fails, so that no pull request reaches the project's owners under a title they don't use."""
template = run([str(BIN / "project-config"), "pull-request-title"])
if isinstance(template, Failure):
return template
template = template.rstrip("\n")
if templates.fits(template, title.strip()):
return None
return Failure(f"title the pull request as the project's config asks, `{template}`, where {{id}} is the ID of the chunk's first item; {title.strip()!r} doesn't fit")
def one_line(title: str) -> bool:
return bool(title.strip()) and "\n" not in title
+18
View File
@@ -25,6 +25,7 @@ GH_CHECKS = ["gh", "pr", "checks", "12", "--watch", "--fail-fast"]
TEA_BRANCH = ["tea", "api", "repos/{owner}/{repo}/branches/main"]
TEA_STATUS = ["tea", "api", f"repos/{{owner}}/{{repo}}/commits/{HEAD}/status"]
OWED = [str(pathlib.Path(__file__).resolve().parents[1] / "larv-review"), "scoring-run-owed"]
TITLE = [str(pathlib.Path(__file__).resolve().parents[1] / "project-config"), "pull-request-title"]
WAITS = [str(pathlib.Path(__file__).resolve().parents[1] / "project-config"), "wait-for-approval"]
GH_DECISION = ["gh", "pr", "view", "12", "--json", "reviewDecision"]
@@ -50,6 +51,7 @@ class Checkout:
("git", "rev-parse", "HEAD"): f"{HEAD}\n",
("git", "symbolic-ref", "--short", "refs/remotes/origin/HEAD"): "origin/main\n",
tuple(WAITS): "false\n",
tuple(TITLE): "{summary}\n",
}
def __call__(self, command: list[str]) -> str | Failure:
@@ -105,6 +107,22 @@ class Open(unittest.TestCase):
self.assertIsInstance(step(["open", "Do it"], checkout), Failure)
self.assertEqual(checkout.acted(), [])
def test_a_title_that_does_not_fit_the_configs_template_is_refused_before_anything_runs(self):
for argv in (["open", "Do it"], ["ready", "Do it"]):
with self.subTest(argv=argv):
checkout = Checkout(GITHUB, open=argv[0] == "ready")
checkout.answers[tuple(TITLE)] = "PAY-{id} - {summary}\n"
refused = step(argv, checkout)
assert isinstance(refused, Failure), refused
self.assertIn("`PAY-{id} - {summary}`", refused.reason)
self.assertEqual(checkout.acted(), [])
self.assertNotIsInstance(step([argv[0], "PAY-7 - Do it"], checkout), Failure)
checkout.answers[tuple(TITLE)] = Failure("no config names the checkout")
self.assertEqual(step(argv, checkout), Failure("no config names the checkout"))
untitled = Checkout(GITHUB, open=True)
untitled.answers[tuple(TITLE)] = Failure("no config names the checkout")
self.assertNotIsInstance(step(["ready"], untitled), Failure)
def test_a_title_of_more_than_one_line_or_a_second_body_is_refused_before_anything_runs(self):
for argv, refusal in ((["open", "Do it\nand more"], "give a title of one line"), (["open", " "], "give a title of one line"), (["open", "Do it", "Body", "More"], USAGE)):
with self.subTest(argv):
+1 -1
View File
@@ -129,7 +129,7 @@ def preflight(root: pathlib.Path, timeout: float, make: bool) -> list[str] | Fai
if isinstance(config, Failure):
return config
outside = None if config.tracked("plan") else config.paths["plan"]
held = default_plan(str(root), ref, config.place("plan"), store(config, "changelog"))
held = default_plan(str(root), ref, config.place("plan"), store(config, "changelog"), title=config.commit_title)
plan = planned(held.todo, held.cut, ref, outside, config.branch)
item = plan if isinstance(plan, NoItem) else item_facts(root, ref, plan, timeout, make)
# A `checkout:` path lands in the worktree the chunk works in.
+4 -1
View File
@@ -161,6 +161,7 @@ import typing
from git_cli.git_repo import branch_titles, default_branch, git, top
from review_rules.round_titles import cap, CAP, RELEASE_REVIEW_CAP, round_counts
from project_config.main import commit_title
from failure import Failure
from review_rules.comprehension_history import FLOOR
from larv_review.history_changes import history_changes
@@ -174,6 +175,7 @@ from larv_review.plan import plan_reasons
from larv_review.scoring_setup import prepare_scoring
from larv_review.history_commands import read_agreement, read_places, record_ruling, record_scoring
from larv_review.reviewer_header import reviewer_header
from project_config import templates
class Command(typing.NamedTuple):
@@ -313,7 +315,8 @@ def round_count(default: str) -> Failure | None:
titles = branch_titles(default)
if isinstance(titles, Failure):
return titles
for name, count in round_counts(titles).items():
template = commit_title(None, pathlib.Path.home())
for name, count in round_counts([templates.summary_of(template, title) for title in titles]).items():
print(f"{name}: {count}{cap_note(count, cap(name)) if name in PASSES else ', not a pass: check the commit title'}")
return None
+1 -1
View File
@@ -75,7 +75,7 @@ def plan_reasons(ref: str, ids: list[int] | None, home: pathlib.Path) -> list[st
return decisions
if OPTED_OUT.search(decisions):
return []
held = default_plan(checkout, ref, config.place("plan"), stores.store(config, "changelog"))
held = default_plan(checkout, ref, config.place("plan"), stores.store(config, "changelog"), title=config.commit_title)
before = held.todo
if isinstance(before, Failure):
return before
+8 -3
View File
@@ -4,15 +4,16 @@ import pathlib
from git_cli.git_repo import branch_titles, git, top
from review_rules.round_titles import cap, round_counts
from project_config.main import commit_title, located
from failure import Failure
from chunk_preflight.choices import forge_of
from larv_review.history_commands import history_file, places_report
from record_store.stores import local_file, store
from project_config.main import located
from review_rules.review_folder import made_review_folder
from deploy_release.forge import open_pull, runner
from review_rules.reviewer_context import principles_line, starts_bare
from review_rules.review_passes import REVIEWERS
from project_config import templates
# The passes whose reviewer is given the places: skills/larv-review/SKILL.md → "Comprehension check" → "Places".
TAKE_PLACES = ("architecture", "stability")
@@ -37,6 +38,8 @@ class Launch:
# The project's `AGENTS.md`, where its config puts it, and a local file of its decision log.
rules: pathlib.Path
decisions: pathlib.Path
# The language the project's config names for its prose.
language: str
def asked(self) -> pathlib.Path:
"""The round's report, which asks for the rerun where there is one."""
@@ -54,6 +57,7 @@ class Launch:
f"Diff: {self.diff}",
f"Technical principles: {self.principles}",
f"Goals and audience: {self.goals}",
f"Prose language: {self.language}.",
*([f"Places: {self.folder / 'places.md'}"] if self.pass_ in TAKE_PLACES else []),
*([principles] if self.bare and (principles := principles_line(self.rules, self.decisions)) else []),
])
@@ -72,7 +76,8 @@ def reviewer_header(default: str, pass_: str, rerun: bool, home: pathlib.Path) -
titles = branch_titles(default)
if isinstance(titles, Failure):
return titles
round_ = unanswered_round(titles, pass_)
template = commit_title(None, home)
round_ = unanswered_round([templates.summary_of(template, title) for title in titles], pass_)
if isinstance(round_, Failure):
return round_
found = [top(), *(git(*args) for args in (["symbolic-ref", "--short", "HEAD"], ["rev-parse", "--short", "HEAD"], ["merge-base", "HEAD", default]))]
@@ -93,7 +98,7 @@ def reviewer_header(default: str, pass_: str, rerun: bool, home: pathlib.Path) -
decisions = local_file(store(config, "decisions"), folder / "decisions.md")
if isinstance(decisions, Failure):
return decisions
launch = Launch(pass_, round_, rerun, pull_named(worktree, branch), worktree, branch, base, default, folder, folder / f"branch-{head}.diff", principles, config.paths["goals-and-audience"], starts_bare(next((agent for name, agent in REVIEWERS.items() if name == pass_), ""), home), config.paths["working-rules"], decisions)
launch = Launch(pass_, round_, rerun, pull_named(worktree, branch), worktree, branch, base, default, folder, folder / f"branch-{head}.diff", principles, config.paths["goals-and-audience"], starts_bare(next((agent for name, agent in REVIEWERS.items() if name == pass_), ""), home), config.paths["working-rules"], decisions, config.language)
if rerun and not launch.asked().exists():
return Failure(f"no report asked for a rerun of {pass_}'s round {round_}: {launch.asked()} is missing; relaunch before you commit the round's answers")
written = write_inputs(launch, base, home)
+8
View File
@@ -1080,6 +1080,7 @@ class LarvReviewTool(unittest.TestCase):
f"Diff: {folder}/branch-{short}.diff\n"
f"Technical principles: {self.checkout.parent}/principles\n"
f"Goals and audience: {self.checkout}/README.md\n"
"Prose language: English.\n"
f"Places: {folder}/places.md\n"
)), ran.stderr)
self.assertEqual((folder / f"branch-{short}.diff").read_text(), self.git("diff", base, "HEAD"))
@@ -1163,6 +1164,13 @@ class LarvReviewTool(unittest.TestCase):
def test_reviewer_header_names_the_principles_folder_the_projects_config_sets(self):
self.assertEqual(self.header_line("Technical principles:", "prose"), f"Technical principles: {self.checkout.parent}/principles")
def test_reviewer_header_names_the_language_and_counts_rounds_through_the_commit_title_the_projects_config_sets(self):
self.config.write_text(PROJECT_CONFIG + 'language = "Swedish"\ncommit-title = "PAY-{id} - {summary}"\n')
self.commit("PAY-7 - Answer prose round 1: 0 🔴, 1 🟡 (0 misread); a")
self.assertEqual(self.header_line("Prose language:", "prose"), "Prose language: Swedish.")
self.assertEqual(self.header_line("Pass:", "prose"), "Pass: prose, round 2.")
self.assertIn("prose: 1\n", self.run_tool("round-count").stdout)
def test_reviewer_header_names_the_goals_file_the_projects_config_sets(self):
self.config.write_text(PROJECT_CONFIG.replace('"checkout:README.md"', '"folder:goals.md"'))
self.assertEqual(self.header_line("Goals and audience:", "principles"), f"Goals and audience: {self.config.parent}/goals.md")
+1 -1
View File
@@ -80,7 +80,7 @@ def fetched_plan(loop: Loop) -> DefaultPlan | Failure:
if config.tracked("plan") is None:
say(UNSEEN_RELEASES, loop.effects)
ref = default_ref(loop.root, ORIGIN_TIMEOUT, run=loop.effects.git)
return ref if isinstance(ref, Failure) else default_plan(loop.root, ref, config.place("plan"), store(config, "changelog"), loop.effects.git)
return ref if isinstance(ref, Failure) else default_plan(loop.root, ref, config.place("plan"), store(config, "changelog"), loop.effects.git, title=config.commit_title)
def plan_item(plan: DefaultPlan | Failure, effects: Effects) -> Item | None:
+20 -4
View File
@@ -6,7 +6,7 @@ Run inside a checkout, or a worktree of one. It finds the config that names the
~/.claude-projects/<key>/config.toml, and prints each setting and its absolute path, as in
`plan: /home/me/code/acme/todo.md`. Given a setting, it prints only that setting's path.
The config is TOML. `checkout` names the project's main checkout, and every other setting but `wait-for-approval` is a path:
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.
@@ -26,13 +26,29 @@ a path that starts with / or ~/ and lies outside the checkout and the config's f
"~/.claude-projects/acme-billing.env". Where it is left out, the project has no credentials file, and
a tool that needs one fails naming the setting. It is printed with the others only where it is set.
`wait-for-approval` is the other optional setting, true or false: whether `chunk-pr merge` waits for a human's
`wait-for-approval` is an optional setting, true or false: whether `chunk-pr merge` waits for a human's
approval of the pull request, as its branch protection requires on GitHub, before it merges. Left out, it is
false. `project-config wait-for-approval` prints true or false; the full listing shows the setting only where
it is true.
Four optional settings say how the project writes, for a project whose owners don't write as
~/.claude/CLAUDE.md does:
language = "Swedish"
commit-title = "PAY-{id} - {summary}"
pull-request-title = "PAY-{id} - {summary}"
branch = "feature/PAY-{id}"
`language` names the language of the project's prose by its English name; left out, it is English.
The others are templates. {summary} is the one line that says what a commit or pull request does,
and {id} is the ID of the chunk's first plan item. A title template holds {summary} once and {id}
at most once; left out, it is "{summary}". `branch` holds {id} once, among letters, digits and
. _ / -; left out, it is "item-{id}". A template has no way to write a literal { or }.
`project-config <setting>` prints each one's value, and the full listing shows it only where the
config sets it to something else than it is when left out.
Exit 1, naming each fault on stderr, where no config names the checkout, or its config leaves out a
setting, names an unknown one, misspells a path or sets `wait-for-approval` to anything but true or
setting, names an unknown one, misspells a path, a language or a template, or sets `wait-for-approval` to anything but true or
false, and where `env-file` is asked for and not set. No path setting has a default.
"""
import pathlib
@@ -40,8 +56,8 @@ import sys
from project_config.settings import CONFIG, ENV_FILE, load, OPTIONAL, ProjectConfig, SETTINGS, WAIT_FOR_APPROVAL
from failure import Failure
from project_config import templates
from git_cli.git_repo import git, Git
from project_config import templates
def main(argv: list[str]) -> int:
+8 -6
View File
@@ -9,6 +9,7 @@ from release_plan.todo_table import Item, items, next_item, renames
from project_config.settings import Place
from text_files.markdown_text import sections
from record_store import stores
from project_config import templates
# The version a branch with no v* tag and no dated CHANGELOG.md heading counts as cut: below every release, 0.0.0 included, so that every release todo.md names comes after it.
BEFORE_FIRST_RELEASE = (-1, 0, 0)
@@ -95,14 +96,14 @@ class DefaultPlan:
cut: LastCut
def default_plan(root: str, ref: str, plan: Place, changelog: stores.RecordStore, run: Git = git) -> DefaultPlan:
"""What ref, the default branch as last fetched, holds for the pick, read in the checkout at root through run. plan is where the project's config puts todo.md, and changelog the store it names for the changelog."""
def default_plan(root: str, ref: str, plan: Place, changelog: stores.RecordStore, run: Git = git, *, title: str = templates.TITLE) -> DefaultPlan:
"""What ref, the default branch as last fetched, holds for the pick, read in the checkout at root through run. plan is where the project's config puts todo.md, changelog the store it names for the changelog, and title its `commit-title` template."""
tag = newest_tag(root, merged_into=ref, run=run)
changes = stores.held_at(ref, changelog, root, run)
after = dated_cut(tag, changes)
since = tag if after is None else heading_commit(after, ref, changelog, root, run)
commits = since if isinstance(since, Failure) else commits_since(since, ref, root, run)
reviewed = tag if isinstance(tag, Failure) else release_reviewed(tag, ref, root, after, run)
reviewed = tag if isinstance(tag, Failure) else release_reviewed(tag, ref, root, after, run, title)
return DefaultPlan(held_at(ref, plan, root, run), LastCut(tag, changes, commits, todos_since(tag, ref, plan, root, run), reviewed))
@@ -127,15 +128,16 @@ def heading_commit(release: Release, ref: str, changelog: stores.RecordStore, cw
return added if isinstance(added, Failure) else next(iter(added.split()), None)
def release_reviewed(tag: str | None, ref: str, cwd: str, after: Release | None = None, run: Git = git) -> bool | Failure:
def release_reviewed(tag: str | None, ref: str, cwd: str, after: Release | None = None, run: Git = git, title: str = templates.TITLE) -> bool | Failure:
"""Whether ref holds a commit titled as a release review opens, `Release review of <release>`: after tag, or anywhere where tag is None.
after is the version a branch with no tag counts as cut, or None. Where it is given, a title counts only where its release is later than after.
Each title is read as its summary in title, the project's `commit-title` template. after is the version a branch with no tag counts as cut, or None. Where it is given, a title counts only where its release is later than after.
"""
titles = run("log", "--format=%s", f"{tag}..{ref}" if tag else ref, cwd=cwd)
if isinstance(titles, Failure):
return titles
reviews = [title.removeprefix("Release review of ") for title in titles.splitlines() if title.startswith("Release review of ")]
summaries = [templates.summary_of(title, line) for line in titles.splitlines()]
reviews = [summary.removeprefix("Release review of ") for summary in summaries if summary.startswith("Release review of ")]
return any(after is None or ((named := parsed(review)) is not None and named > after) for review in reviews)
@@ -164,6 +164,11 @@ class ChunkItem(unittest.TestCase):
self.assertIs(release_standing.release_reviewed(None, "main", repo), True)
self.assertIsInstance(release_standing.release_reviewed("v9.9.9", "main", repo), Failure)
self.assertEqual(release_standing.default_plan(repo, "main", "todo.md", changelog_of(repo)).cut.reviewed, True)
run("tag", "v0.2.0")
run("commit", "-q", "--allow-empty", "-m", "PAY-9 - Release review of 0.3.0")
self.assertIs(release_standing.release_reviewed("v0.2.0", "main", repo), False)
self.assertIs(release_standing.release_reviewed("v0.2.0", "main", repo, title="PAY-{id} - {summary}"), True)
self.assertEqual(release_standing.default_plan(repo, "main", "todo.md", changelog_of(repo), title="PAY-{id} - {summary}").cut.reviewed, True)
def test_counts_no_release_review_of_a_release_cut_under_a_dated_heading_on_a_branch_with_no_tag(self):
repo = tempfile.mkdtemp()
+1 -1
View File
@@ -8,8 +8,8 @@ import typing
from review_rules.round_titles import CAP, COUNTS, EXAMPLE, lacks_counts, OPENING, RELEASE_REVIEW_CAP
from project_config.main import commit_title
from git_cli.git_command import commits
from git_cli.git_repo import git
from run_heavy.capped_docker import finds_this_docker
from git_cli.git_repo import git
from rule_hook.heavy_command import heavy
from command_lines.shell_command import launched, Simple
from review_rules.review_folder import REPORTS
+1 -1
View File
@@ -95,13 +95,13 @@ import sys
from score_outcomes.anchors import anchor_lines, Anchors, ANCHORS_PATH, parse_anchors
from branch_chunks.read import branch_chunks, unsupported
from project_config.main import commit_title, project
from git_cli.git_repo import default_branch, full_history, git, top
from failure import Failure
from score_outcomes.results import file_lines, fixed_later, item_text, misreads, nearest, render, report, Result, results_of
from release_plan.todo_table import item_details, LEVELS, risk, TOP_SCORE
from text_files.markdown_text import listed
from release_plan.named_code import named_files
from project_config.main import commit_title, project
from transcript_archive.location import project_archive
from score_outcomes.reversals import reversal_lines
from record_store.stores import store
+12
View File
@@ -21,6 +21,7 @@ Each project principle states one rule that the decisions below apply; their ent
- machine load: a heavy command waits for one of the machine's heavy slots, one for every 4 CPUs, which every session shares, and loop-claude starts a worker only while at least a quarter of the machine's memory is available
- 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 tool that reads a file's commits says where it does not support that file, and the work goes on
- project config: `language` names the prose's language by its English name, and `commit-title`, `pull-request-title` and `branch` are brace templates over `{id}` and `{summary}`
- review: a release review fixes its findings in the release it reviews, and files under that release only a finding that needs a human answer, adds a feature or outlasts its five rounds
- review: a reviewer or comprehension seat that rules the work below standard may ask to rerun once, one rung up, in the same round; the ruling that stands is an escalation trigger for the worker unless the fix changes only prose, and never for the judge
- review: a reviewer under `agents/` marks a 🔴 or 🟡 `[misread]` where the implementer misread code that had already shipped, each round title counts the marked findings, and `score-outcomes` lists them per chunk
@@ -275,6 +276,17 @@ Valid while the later fixes per finished chunk, which `score-outcomes` and the r
Messages keep each file's usual name, such as `todo.md`, as its label, since the config keeps the names. Revisit at 0.13.0, which plans the support for `score-outcomes`, the routing figures, the release standing and the owed scoring run.
## project config: `language` names the prose's language by its English name, and `commit-title`, `pull-request-title` and `branch` are brace templates over `{id}` and `{summary}`
2026-11-14, larv-review. Serves goal 1.6: a client's team reads its docs, Jira text, commits and pull requests in its own language and format. Valid while one language and one template per title serve a project.
- **The spelling is benched.** Three fresh readers, seated as the person who writes a client's `config.toml`, each picked brace templates, these four keys and the language's English name (`"Swedish"`) over `%`-codes, regular expressions and language codes.
- **`{id}` is the ID of the chunk's first plan item, and `{summary}` the title a project without templates would have.** A title template holds `{summary}` once and may hold `{id}`; `branch` holds `{id}` and no `{summary}`. Any other brace is a fault the config's reader names: no template needs a literal brace, so there is no escape to learn.
- **A title that doesn't fit the template is its own summary.** History from before a template was set still reads, so every tool that parses a title, such as a round count or `Drop item`, parses the summary (`bin/project_config/templates.py`, `summary_of`). rule-hook's `commit-title` rule refuses a new commit that doesn't fit, and `chunk-pr` a pull request title.
- **The worktree is named after the branch**, `<checkout>-<branch>` with each `/` written `-`, so `feature/{id}` gets one folder beside the checkout.
- **The language covers what the project's readers read**: docs, comments, tickets, and the summary a title carries. What this setup's tools parse stays English: the round titles' fixed words, `todo.md`'s table, the review reports and chat with lilleman.
- **`deploy-release` titles its commit `Cut release <version>` whatever the template**, since a release has no plan item to give `{id}`, and the tool finds that commit again by its exact title.
## review: a release review fixes its findings in the release it reviews, and files under that release only a finding that needs a human answer, adds a feature or outlasts its five rounds
2026-10-30, lilleman through todo item 258. Serves goal 1.1. fejkdata.dev's release review of 0.1.0 filed the architect's findings as items 28 to 36, in releases after 0.1.0, so the release the human was about to cut still held the drift the review had found. A release review's branch opens with an empty commit, so under `larv-review` §3 → "Findings" → "Outside the chunk" every finding lay outside its change and was filed. The review's whole point is to leave the release without the drift the release's small changes made, so the whole project is its chunk and the passes fix within their five rounds. Three kinds of finding are still filed, each under the release being reviewed, or under the earliest release `rules/todo-items.md` allows where that release's semver bump forbids it, such as a feature in a patch release: one 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, so `CLAUDE.md` → "Working loop" calls a release finished only once its review has merged and it holds no item. Valid while a release review's rounds can fix what they find.
+17
View File
@@ -1987,3 +1987,20 @@ Read most (opens and searches):
- `docs/decisions.md` 1
- `rules/decisions.md` 1
- `todo.md` 1
## Reading cost, chunk 92ef669210e9, finished 2026-11-14T00:00:04Z
79184 new input tokens before the first commit.
Read most (opens and searches):
- `bin/project_config/test_project_config.py` 5
- `bin/chunk_pr/main.py` 4
- `bin/chunk_pr/test_chunk_pr.py` 4
- `README.md` 3
- `bin/project_config/settings.py` 3
- `skills/larv-review/SKILL.md` 3
- `CHANGELOG.md` 1
- `CLAUDE.md` 1
- `bin/deploy_release/forge.py` 1
- `bin/project_config/main.py` 1
+1 -1
View File
@@ -2,7 +2,7 @@
The full rules; `~/.claude/CLAUDE.md` → "Prose" keeps a core of them for the worker.
Everything written — chat, commit messages, comments, docs, code — is in **English**. Prose meets four priorities, in this order. When two pull against each other, the higher one wins.
Everything written — chat, commit messages, comments, docs, code — is in **English**. Where a project's config names another `language`, which `~/.claude/bin/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. Chat, names in code, and the fixed words a tool reads in a title, such as `Answer <pass> round <n>:`, stay English. Prose meets four priorities, in this order. When two pull against each other, the higher one wins.
1. **Easy to understand.** A reader with little time gets it on one read. Keep each sentence to one idea. Explain a term before using it, or use a plainer word. Never fold a clause into a noun phrase to save words. BANNED: `An empty earliest unreleased release with nothing shipped toward it is planned as this chunk`. GOOD: `When the next release has no items and no work has landed towards it, plan it.`
2. **Most important first**, judged by what this document's reader wants to know first. Put the most important section first. Within each section, put the most important paragraph first, and within each list the most important item. Order matters most in long documents; in a short one, don't spend a fix on it.