Answer prose round 1: move the tool paragraph below the reviewer prompt rule, name the commands its and it pointed at, state the seats file's first line and the migration's two lines, and rewrite four --help paragraphs

This commit is contained in:
2026-10-09 01:37:56 +02:00
parent 642a8bc80b
commit efed78bf5e
5 changed files with 33 additions and 30 deletions
+24 -21
View File
@@ -8,27 +8,29 @@ branch, or else the local main or master, as the default branch. When the fetch
reads origin as last fetched and says so on stderr; the other two exit 1. The history is
docs/comprehension-history.md in the checkout.
ruling-base prints the commit a paired ruling reads against, then how it was found: the default
branch's newest merged change that adds a scoring run to the history, or whose last added paired
ruling, by its heading's time, is better; a merge commit is one change against its first parent.
With none, the base the history's first paired ruling names; with no ruling either, the merge base
of HEAD and the default branch.
ruling-base prints the commit a paired ruling reads against, then a line saying how it found it.
The base is the default branch's newest merged change that adds a scoring run to the history, or
whose last added paired ruling, by heading time, is better. A merge commit counts as one change
against its first parent. With no such change, the base is the one the history's first paired
ruling names; with no ruling either, it is the merge base of HEAD and the default branch.
round-count prints, for each pass, the highest <n> among this branch's commit titles opening
`Answer <pass> round <n>:`, counting commits the default branch does not hold, and marks a pass at
the cap of {cap} rounds, and a name in such a title that is no pass.
round-count prints each pass's count: the highest <n> among the titles opening
`Answer <pass> round <n>:` of commits the default branch does not hold. It marks each pass at the
cap of {cap} rounds, and each name in such a title that is not a pass.
needs-scoring-run prints why the chunk shipping the given todo.md item IDs, none for a chunk that
ships no item, takes a scoring run, or `No scoring run due.` It is due when the chunk ships an item
whose tagline names the comprehension floor, or when a release the default branch's todo.md names
has no item left in the checkout's todo.md, less the items shipped, and work has landed towards
it: the chunk ships one of its items, or it is the earliest release the default branch's todo.md
names and the default branch has a commit after its newest v* tag, or has no such tag.
needs-scoring-run takes the IDs of the todo.md items the chunk ships, none when it ships none, and
prints why the chunk is due a scoring run, or `No scoring run due.` It is due when the chunk ships
an item whose tagline names the comprehension floor, or when it leaves a release with no item in
the checkout's todo.md, less the shipped items, and work has landed towards that release. Work has
landed when the chunk ships one of the release's items, or when the release is the earliest the
default branch's todo.md names and the default branch has a commit after its newest v* tag, or has
no v* tag.
record-ruling and record-scoring read a seats file: a first line naming what the seats read, then
each seat's line, each followed by its places, one `- ` bullet each, as the history writes them. A
seat's line opens with its label, written exactly: `Junior A:`, `Mid A:`, `Maintainability
senior:` or `Inherited architect:`.
record-ruling and record-scoring read a seats file: a first line naming what the seats read,
`<PR or branch> at <commit>`, ending `, against <base>` for a paired ruling, then each seat's
line, each followed by its places, one `- ` bullet each, as the history writes them. A seat's line
opens with its label, written exactly: `Junior A:`, `Mid A:`, `Maintainability senior:` or
`Inherited architect:`.
PR #231 at abc1234, against def5678
@@ -54,8 +56,9 @@ names no `, against`. It appends the seats' scores and their means, rounded half
decimals, and prints the means and each one under the floor of {floor}.
Each record is appended to the history, created when missing, under a heading of the current UTC
time and the seats file's first line, or of that line alone when it opens with a date. Each commit
the line names must be in the checkout. Each run appends, so record a ruling or a run once.
time and the seats file's first line. A file holding a `Mean:` line alone opens with the date or
time its decision entry gives, and that line alone is the heading. Each commit the line names
must be in the checkout. Each run appends, so record a ruling or a run once.
Exit 1, saying why, on unknown arguments, an unknown item ID, a seats file it cannot read or that
breaks the shape above, or when git cannot start, finds no checkout or no default branch, cannot
@@ -155,7 +158,7 @@ def needs_scoring_run(default: str, ids: list[int]) -> Failure | None:
after = pathlib.Path(checkout, "todo.md").read_text(encoding="utf-8")
except (OSError, UnicodeDecodeError) as failure:
return Failure(f"could not read todo.md: {failure}")
# A plan a chunk is reshaping into one table has none yet on the default branch.
# While a chunk reshapes todo.md into one table, the default branch's todo.md has no items table.
planned = plan_items(before) if ITEMS_HEADER in before.splitlines() else []
if isinstance(planned, Failure):
return Failure(f"{default}'s todo.md: {planned.reason}")
+1 -1
View File
@@ -103,7 +103,7 @@ def plan_items(todo: str) -> list[Item] | Failure:
def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], landed: bool) -> list[str] | Failure:
"""Why the chunk takes a scoring run, empty when it does not. before is the default branch's plan, after the chunk's, ships the IDs it ships, and landed whether the default branch holds a commit after the newest release tag. A release has work landed towards it when the chunk ships one of its items, or when it is the earliest release before names and landed holds."""
"""Why the chunk takes a scoring run, empty when it does not. before is the default branch's plan, after the chunk's, ships the IDs it ships, and landed whether the default branch holds a commit after the newest release tag. A release has work landed towards it when the chunk ships one of its items, or when it is the earliest release in before and landed holds."""
plan = {item.id: item for item in before + after}
if unknown := sorted(set(ships) - set(plan)):
return Failure(f"neither plan holds item {', '.join(map(str, unknown))}")
+1 -1
View File
@@ -279,7 +279,7 @@ class LarvReviewTool(unittest.TestCase):
def test_states_its_rules_and_finds_origins_default_branch_where_the_clone_recorded_none(self):
helped = self.run_tool("--help")
self.assertEqual(helped.returncode, 0, helped.stderr)
self.assertIn("the cap of 3 rounds", helped.stdout)
self.assertIn("cap of 3 rounds", helped.stdout)
self.git("remote", "set-head", "origin", "--delete")
self.assertEqual(self.run_tool("needs-scoring-run", "2").stdout, "No scoring run due.\n")