Answer stability round 1: 0 🔴, 4 🟡 (0 misread); carry into a release named since the cut

This commit is contained in:
2026-11-16 01:26:49 +01:00
parent 30129051ad
commit 37078cffa9
11 changed files with 43 additions and 29 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ How work proceeds in any repo, unless the repo's `AGENTS.md` says otherwise. The
- **Read and change the plan's items only with `~/.claude/bin/todo-item`**, which lists, shows, files, edits, moves and finishes them; `todo-item --help` says how. It reads a plan in Jira as it does a file, and there it files and finishes an item but doesn't edit or move one yet. Two open the file itself: whoever plans a release, to compare Scores across releases, which `todo-item list` doesn't print; and whoever edits `## Scoring` or `## Renamed`, or reshapes an old table.
- **When the next release has no items and no work has landed towards it, plan it as this chunk.** Move the highest-scoring items of later releases into it, and get the human's approval of that set before writing any code.
- **When the next release has no items left and work has landed towards it, its release review is the chunk** (`larv-review` §3 → "Release review"). **Once that has merged and the release holds no item, the release is finished: stop.** Report what it holds and that it is ready to cut. Under `/loop`, this ends the loop. Until the human cuts it, only a security fix, or an item its release review filed, lands, into that release; never start a later release's items or plan a new one.
- **Where someone cut a release that still holds items, those items are the next release's:** the earliest the plan names after the cut. Move them there as the chunk's first change and say so in its opening line. Where the plan names no later release, ask the human which one they belong to.
- **Where someone cut a release that still holds items, those items are the next release's.** Move them there as the chunk's first change and say so in its opening line; where `todo-item` cannot move this plan's items, as in a Jira plan, ask the human in the chunk's summary to move them. Where the plan names no later release, ask the human which one they belong to.
- **Open every chunk with one line:** the last version cut, how many changes are unreleased (the entries under `CHANGELOG.md` → `## Unreleased`, or else the commits since the last tag), and the release this chunk ships into. A repo that doesn't publish anything says so once.
- **A client project's `CLAUDE.md` and `AGENTS.md` in its repo belong to its team.** Read both at the start of each chunk there. Propose each change that aligns them with this setup in a pull request of its own, never inside a chunk's; the one edit a chunk makes there is a decision's title in `AGENTS.md`. Until the team accepts a proposal, and after it declines or doesn't answer, follow the team's rule unless it breaks one of the project's goals. Record each such conflict as a decision in the `decisions` record, as `rules/decisions.md` asks: which rule you follow, why, and the open proposal's PR. Then nobody is asked twice.
- **Read the goals file's `## Goals` and `## Audience` before starting a chunk, unless your prompt quotes them.** The chunk's items set its scope. The goals choose between ways to deliver those items, and never add to them.
@@ -139,7 +139,7 @@ Claude Code reads this section by its heading when it compacts a conversation. K
- **premises** — the goals and audience under `## Goals` and `## Audience` in the project's goals file, with code health ("Shared goal") first among the goals unless the goals file voids it.
- **project's rung** — the cheapest rung on loop-claude's routing ladder of the project's model, which is the model loop-claude's prompt names as the project's, or else your own.
- **project record** — one of five documents a project keeps beside its plan, each where its config names it: `decisions`, `score-anchors`, `comprehension-history`, `reading-cost` and `changelog`.
- **release** — a semver version the human cuts.
- **release** — a semver version the human cuts, or in a client's project someone on its team.
- **release review** — a release's last chunk: the architecture and principles passes over the whole project, before the release is ready to cut; `larv-review` §3 → "Release review".
- **reviewer** — a reporter of findings: an agent under `~/.claude/agents/`, `/security-review` or a forge's auto-reviewer.
- **round cap** — the rounds one pass may take per chunk; `larv-review` §3 → "Round cap".
+5 -4
View File
@@ -52,10 +52,11 @@ def planned(todo: plan_stores.Plan | Failure, cut: LastCut, default: str, branch
first = pick.item
if first is None:
return NoItem(f"every item of release {version(pick.release)} in {where} waits." if pick.release is not None else f"{where}'s items table holds no item.")
moved = [(was, now) for was, now in zip(found, carried(found, cut)) if was.release != now.release]
# Every carried item takes one release, the next; the newest release they were filed under names the cut.
over = CarriedOver(max(was.release for was, _ in moved), moved[0][1].release, tuple(was.id for was, _ in moved)) if moved else None
return Plan(carried(found, cut), first, f"{first.tagline}\n\n{first.detail}".strip(), branch, over)
held = carried(found, cut)
moved = [(was, now) for was, now in zip(found, held) if was.release != now.release]
# Every carried item takes one release, the next.
over = CarriedOver(moved[0][1].release, tuple(was.id for was, _ in moved)) if moved else None
return Plan(held, first, f"{first.tagline}\n\n{first.detail}".strip(), branch, over)
def worktree_on(porcelain: str, branch: str) -> pathlib.Path | None:
+2 -2
View File
@@ -45,7 +45,7 @@ def item_lines(plan: str, item: ItemFacts) -> list[str]:
first = item.plan.first
worktree = item.worktree.reason if isinstance(item.worktree, Failure) else f"{item.worktree.path}, {item.worktree.how}"
return [
f"- The earliest release in {plan}: {version(first.release)}. Its first item that does not wait: item {first.id}, {levels(first)}.",
f"- The {'next release, after the last cut, that ' + plan + ' names' if item.plan.carried else 'earliest release in ' + plan}: {version(first.release)}. Its first item that does not wait: item {first.id}, {levels(first)}.",
*carried_lines(item.plan),
f"- Worktree: {worktree}",
f"- Open pull requests from {item.plan.branch}: {pulls_text(item.pulls, item.plan.branch)}",
@@ -64,7 +64,7 @@ def carried_lines(plan: Plan) -> list[str]:
if over is None:
return []
items, count, them = (f"Items {listed([str(id_) for id_ in over.ids], 'and')} are", "they count", "them") if len(over.ids) > 1 else (f"Item {over.ids[0]} is", "it counts", "it")
return [f"- {items} filed under release {version(over.cut)}, which is cut, so {count} as release {version(over.into)}'s, the next. Move {them} there in this chunk, with `~/.claude/bin/todo-item` where it moves this plan's items, and say so in the chunk's opening line."]
return [f"- {items} filed under a release already cut, so {count} as release {version(over.into)}'s, the next. Move {them} there as this chunk's first change, with `~/.claude/bin/todo-item move`, and say so in the chunk's opening line. Where todo-item cannot move this plan's items, as in a Jira plan, leave {them} and ask the human, in the chunk's summary, to move {them}."]
def joining_details(plan: Plan) -> list[str]:
+2 -3
View File
@@ -23,8 +23,7 @@ class Ran:
@dataclasses.dataclass(frozen=True)
class CarriedOver:
"""The items, by ID in the plan's order, that the plan files under `cut`, a release already cut, and that count as `into`'s, the next release: release_standing.carried."""
cut: Release
"""The items, by ID in the plan's order, that the plan files under a release already cut, and that count as `into`'s, the next release: release_standing.carried."""
into: Release
ids: tuple[int, ...]
@@ -37,7 +36,7 @@ class Plan:
# first's tagline and detail.
text: str
branch_template: str
# The items of a release already cut, which `items` and `first` hold as the next release's; None where the plan files none under one.
# The items of a release already cut, which `items` and `first` hold as the next release's. None where every item's release is after the last cut.
carried: CarriedOver | None = None
@property
+3 -1
View File
@@ -27,7 +27,9 @@ and prints that the release reviews and the cuts are the human's to call. It pri
commits since the cut) and no commit titled `Release review of <release>` followed the tag,
finished and ready to cut once one did, and else to be planned first. On a branch with no tag,
such a commit counts only where its <release> is after the version under the dated heading.
Where todo.md's earliest release is x.y.z or earlier, it says todo.md files items under a release
Where todo.md files items under x.y.z or earlier, someone cut a release that still held them:
they count as the next release, the earliest after x.y.z that todo.md names or has named
since the cut, and a line says to move them there. Where there is no such release, it says todo.md files items under a release
already cut;
- with --worktree, the item's worktree: a sibling of the checkout named <checkout>-<branch>,
each / of the branch a dash, on the branch the config's `branch` template names, which is
+7 -5
View File
@@ -584,17 +584,19 @@ class Plans(unittest.TestCase):
plan = planned(TODO, LastCut("v0.2.0", "", 4, []), "origin/main", BRANCH)
self.assertEqual((plan.first.id, plan.first.release), (3, (0, 3, 0)))
self.assertEqual({item.release for item in plan.items}, {(0, 3, 0)})
self.assertEqual(plan.carried, CarriedOver((0, 2, 0), (0, 3, 0), (5, 3, 7, 8)))
self.assertEqual(plan.carried, CarriedOver((0, 3, 0), (5, 3, 7, 8)))
said = rendered(dataclasses.replace(item_facts(), plan=plan), LastCut("v0.2.0", "", 4, []))
self.assertIn("- Items 5, 3, 7 and 8 are filed under release 0.2.0, which is cut, so they count as release 0.3.0's, the next. Move them there in this chunk, with `~/.claude/bin/todo-item` where it moves this plan's items, and say so in the chunk's opening line.", said)
self.assertNotIn("which is cut", rendered(item_facts()))
self.assertIn("- Items 5, 3, 7 and 8 are filed under a release already cut, so they count as release 0.3.0's, the next.", said)
self.assertIn("`~/.claude/bin/todo-item move`", said)
self.assertIn("- The next release, after the last cut, that origin/main's todo.md names: 0.3.0. Its first item that does not wait: item 3,", said)
self.assertNotIn("already cut", rendered(item_facts()))
def test_says_to_move_one_or_two_items_of_a_release_already_cut_in_the_singular_or_the_plural(self):
cut = LastCut("v0.2.0", "", 4, [])
for todo, ids, said in ((SHIPPED_BUT_3, (3,), "- Item 3 is filed under release 0.2.0, which is cut, so it counts as release 0.3.0's, the next. Move it there in this chunk,"), (SHIPPED_BUT_3 + NINTH.replace("| 9 | 0.3.0 |", "| 4 | 0.1.0 |"), (3, 4), "- Items 3 and 4 are filed under release 0.2.0, which is cut, so they count as release 0.3.0's, the next. Move them there in this chunk,")):
for todo, ids, said in ((SHIPPED_BUT_3, (3,), "- Item 3 is filed under a release already cut, so it counts as release 0.3.0's, the next. Move it there"), (SHIPPED_BUT_3 + NINTH.replace("| 9 | 0.3.0 |", "| 4 | 0.1.0 |"), (3, 4), "- Items 3 and 4 are filed under a release already cut, so they count as release 0.3.0's, the next. Move them there")):
with self.subTest(ids=ids):
plan = planned(todo, cut, "origin/main", BRANCH)
self.assertEqual(plan.carried, CarriedOver((0, 2, 0), (0, 3, 0), ids))
self.assertEqual(plan.carried, CarriedOver((0, 3, 0), ids))
self.assertIn(said, rendered(dataclasses.replace(item_facts(), plan=plan), cut))
def test_says_the_plan_files_items_under_a_release_already_cut(self):
+2 -2
View File
@@ -984,9 +984,9 @@ class Routing(unittest.TestCase):
def test_routes_on_no_item_where_the_release_after_the_last_cut_has_none(self):
self.assertEqual(routed_item(TODO, LastCut("v0.1.0", "", 3, [TODO])).id, 3)
# Someone cut 0.2.0 while it held items: they count as 0.3.0's, the next the plan names, and where it names none, no item routes.
# Someone cut 0.2.0 while it held items: they count as 0.3.0's, the next release, and where no later release is known, no item routes.
self.assertEqual(routed_item(TODO, LastCut("v0.2.0", "", 3, [TODO])).id, 3)
self.assertIsNone(routed_item(re.sub(r"(?m)^\| \d+ \| 0\.3\.0 \|.*\n", "", TODO), LastCut("v0.2.0", "", 3, [TODO])))
self.assertIsNone(routed_item(re.sub(r"(?m)^\| \d+ \| 0\.3\.0 \|.*\n", "", TODO), LastCut("v0.2.0", "", 3, [])))
later_only = TODO[:TODO.index("| 7 |")] + TODO[TODO.index("| 1 | 0.3.0 |"):]
self.assertIsNone(routed_item(later_only, LastCut("v0.1.0", "", 3, [TODO])))
self.assertIsNone(routed_item(later_only, LastCut("v0.1.0", "", 0, [TODO])))
-1
View File
@@ -350,7 +350,6 @@ def item(issue: Issue, project: str, ids: set[int]) -> Item | Failure:
"""The item an issue holds, without its detail. It is blocked by each of its blockers among ids, the plan's items: a blocker that is done or lies outside the epic doesn't make the item wait."""
release = earliest_release(issue.fix_versions)
if release is None:
# A release is a semver version in every project, so an item with no release cannot be placed in the plan.
return Failure(f"{issue.key} names no Fix Version that is a semver version, such as 1.2.0; set one in Jira")
scored = scores(issue.key, issue.scores)
if isinstance(scored, Failure):
+8 -6
View File
@@ -160,21 +160,23 @@ def chunk_item(found: list[Item], cut: LastCut) -> Pick:
def carried(found: list[Item], cut: LastCut) -> list[Item]:
"""found, with each item filed under the last cut's version or earlier filed under the next release instead: the earliest the plan names after the cut.
"""found, with the release of each item that the plan files under the last cut's version, or an earlier one, replaced by the next release: the earliest after the cut that the plan holds or todo.md has named since it.
Someone cut a release while it held those items, and the loop works on: lilleman's call, 2026-11-16. found itself where nothing is cut, where no item is so filed, and where the plan names no release after the cut, since naming one is the human's.
Someone cut a release while it held those items, and the loop works on: lilleman's call, 2026-11-16. found itself where nothing is cut, and where no release after the cut is known, since naming one is the human's.
"""
version = cut_version(cut)
later = min((item.release for item in found if version is not None and item.release > version), default=None)
if version is None or later is None or all(item.release > version for item in found):
named = named_releases(cut.todos_since)
known = {item.release for item in found} | (set() if isinstance(named, Failure) else named)
after = set() if version is None else {release for release in known if release > version}
if not after or all(item.release >= min(after) for item in found):
return found
return [dataclasses.replace(item, release=max(item.release, later)) for item in found]
return [dataclasses.replace(item, release=max(item.release, min(after))) for item in found]
def next_release(found: list[Item], cut: LastCut) -> Upcoming | Cut | Unknown:
"""The next release after cut, and whether work has landed towards it. found holds the plan's items.
Cut where the plan files items under the last cut's version or earlier and names no later release for carried to file them under, and Unknown where the tags, or todo.md's texts since the cut, cannot be read.
Cut where the plan files items under the last cut's version or earlier and no later release is known for carried to file them under, and Unknown where the tags, or todo.md's texts since the cut, cannot be read.
Where the branch has no tag, todos_since holds every version of todo.md, so a release todo.md named whose items are all done still reads as the next release.
"""
if isinstance(cut.tag, Failure):
+11 -2
View File
@@ -89,6 +89,13 @@ class Carried(unittest.TestCase):
with self.subTest(tag=tag):
self.assertIs(release_standing.carried(held, release_standing.LastCut(tag, "", 4, [])), held)
def test_files_them_under_a_release_todo_md_named_since_the_cut_though_the_plan_holds_no_item_of_it(self):
held = [one((1, 2, 3)), dataclasses.replace(one((1, 4, 0)), id=2)]
cut = release_standing.LastCut("v1.2.3", "", 4, naming({(1, 2, 3), (1, 3, 0)}))
self.assertEqual([item.release for item in release_standing.carried(held, cut)], [(1, 3, 0), (1, 4, 0)])
self.assertEqual(release_standing.chunk_item(held, cut), release_standing.Next((1, 3, 0), dataclasses.replace(held[0], release=(1, 3, 0))))
self.assertEqual(release_standing.carried(held[:1], dataclasses.replace(cut, todos_since=Failure("log unreadable"))), held[:1])
def test_takes_the_cut_releases_item_first_as_the_next_releases(self):
held = [dataclasses.replace(one((1, 2, 3)), id=1), dataclasses.replace(one((1, 3, 0)), id=2)]
cut = release_standing.LastCut("v1.2.3", "", 4, [])
@@ -111,7 +118,8 @@ class ChunkItem(unittest.TestCase):
(Failure("tags unreadable"), 4, (0, 2, 0), set(), release_standing.Unknown()),
(Failure("tags unreadable"), 4, None, set(), release_standing.Unknown()),
("v1.2.3", 4, (1, 2, 3), set(), release_standing.Cut((1, 2, 3))),
("v1.2.3", 4, (1, 2, 2), {(1, 2, 4)}, release_standing.Cut((1, 2, 2))),
("v1.2.3", 4, (1, 2, 2), set(), release_standing.Cut((1, 2, 2))),
("v1.2.3", 4, (1, 2, 2), {(1, 2, 4)}, release_standing.Next((1, 2, 4), one((1, 2, 4)))),
("v1.2.3", 4, (1, 3, 0), {(1, 2, 4), (1, 3, 0)}, release_standing.ReadyToCut((1, 2, 4))),
("v0.9.2", 4, (1, 0, 0), {(0, 9, 3)}, release_standing.ReadyToCut((0, 9, 3))),
("v1.2.3", 4, (1, 4, 0), {(1, 2, 2), (1, 3, 0)}, release_standing.ReadyToCut((1, 3, 0))),
@@ -160,7 +168,8 @@ class ChunkItem(unittest.TestCase):
self.assertNotEqual(release_standing.chunk_item([], without_unreleased), release_standing.ReviewDue((0, 0, 1)), "0.0.1 is cut under its dated heading")
later = [HEADER + ROW.format(id=1, release="0.0.1") + ROW.format(id=2, release="0.1.0"), HEADER + ROW.format(id=2, release="0.1.0")]
self.assertEqual(release_standing.chunk_item(plan_under((0, 1, 0)), release_standing.LastCut(None, changelog, 4, later)), release_standing.Next((0, 1, 0), one((0, 1, 0))))
self.assertEqual(release_standing.chunk_item(plan_under((0, 0, 1)), release_standing.LastCut(None, changelog, 4, later)), release_standing.Cut((0, 0, 1)))
self.assertEqual(release_standing.chunk_item(plan_under((0, 0, 1)), release_standing.LastCut(None, changelog, 4, later)), release_standing.Next((0, 1, 0), one((0, 1, 0))))
self.assertEqual(release_standing.chunk_item(plan_under((0, 0, 1)), release_standing.LastCut(None, changelog, 4, history)), release_standing.Cut((0, 0, 1)))
def test_counts_neither_an_undated_heading_nor_a_heading_behind_a_tag_as_cut(self):
history = [HEADER + ROW.format(id=1, release="0.0.1"), HEADER]
+1 -1
View File
@@ -113,7 +113,7 @@ Today the loop sees a cut from a `v<x.y.z>` tag on the default branch or a dated
lilleman's answers, 2026-11-16:
- The loop proceeds: the cut release's open items count as the next release's, the earliest the plan names after the cut. The chunk moves them in the plan and says so in its opening line.
- The loop proceeds: the cut release's open items count as the next release's. The chunk moves them in the plan and says so in its opening line; in a Jira plan, where `todo-item` moves no item yet, it asks the human to.
- The loop reads no other mark of a cut yet, such as a tag spelled otherwise or a Jira Fix Version marked released. lilleman returns to that later.
Readers: `release_standing.next_release` and `Cut`, chunk-preflight's choices, loop-claude's "release ready to cut", larv-review's `landed_towards`, `CLAUDE.md` → "Working loop". Item 368 covers calling a release review due for a plan outside the checkout. Cutting a release stays the human's or their team's, never the loop's.