diff --git a/CHANGELOG.md b/CHANGELOG.md index c75121b4..b969f95c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- A release someone else cut while it still held plan items no longer stops the loop: those items count as the next release's, `chunk-preflight` tells the worker to move them there, and `loop-claude` routes on them. Where the plan names no later release and `todo.md` named none since the cut, the loop still asks which release they belong to. - `project-record open` now writes the copy of a record kept outside a file under a folder of the worktree that ran it, `~/.local/state/project-record///`, so two chunks of one project no longer overwrite each other's unsaved edit. It also removes the folders of worktrees git no longer lists. - `chunk-pr merge` merges the chunks of one project on a machine one at a time, and `--finish ` finishes each plan item in the chunk's turn, so `todo.md` and `CHANGELOG.md` no longer conflict between open chunks. A pull request that waits for an approval leaves the queue while it waits, and merge stops where a reviewer's comment waits for an answer. - Two loop-claude runs in one project now work side by side, each on its own chunk. Each loop holds a slot of the project, a locked file under `~/.local/state/loop-claude//`, and names its session after it: the first loop's session keeps its name, `A loop-claude`, and the second's is `A loop-claude 2`. A rerun resumes a chunk left open first. A commit in the config's folder now takes only the file it changed, as `git commit -m -- <file>`. diff --git a/CLAUDE.md b/CLAUDE.md index 53f22091..617d4f78 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,6 +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.** 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. @@ -138,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". diff --git a/bin/chunk_preflight/choices.py b/bin/chunk_preflight/choices.py index b8ec48a1..30a76c73 100644 --- a/bin/chunk_preflight/choices.py +++ b/bin/chunk_preflight/choices.py @@ -1,9 +1,9 @@ """The pure choices the preflight's steps act on.""" import pathlib -from release_plan.release_standing import chunk_item, Cut, dated_cut, LastCut, ReadyToCut, ReviewDue, Unknown, Unplanned +from release_plan.release_standing import carried, chunk_item, Cut, dated_cut, LastCut, ReadyToCut, ReviewDue, Unknown, Unplanned +from chunk_preflight.gathered import CarriedOver, Forge, NoItem, Plan from failure import Failure -from chunk_preflight.gathered import Forge, NoItem, Plan from release_plan.todo_table import NoItemsTable from plan_store import stores as plan_stores from release_plan.release import version @@ -52,7 +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.") - return Plan(found, first, f"{first.tagline}\n\n{first.detail}".strip(), branch) + 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: diff --git a/bin/chunk_preflight/facts.py b/bin/chunk_preflight/facts.py index 74e80acb..be957712 100644 --- a/bin/chunk_preflight/facts.py +++ b/bin/chunk_preflight/facts.py @@ -45,7 +45,8 @@ 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)}", *bundled(item.plan), @@ -57,6 +58,15 @@ def item_lines(plan: str, item: ItemFacts) -> list[str]: ] +def carried_lines(plan: Plan) -> list[str]: + """What the worker does about the items of a release someone cut while it held them.""" + over = plan.carried + 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 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]: """The detail of each of the first JOINING_DETAILS items that may join the chunk, in the table's order, and what the worker lacks: an item with no detail, or the items left out.""" joining = bundle_candidates(plan.items, plan.first) diff --git a/bin/chunk_preflight/gathered.py b/bin/chunk_preflight/gathered.py index bdc18fef..e7c118b2 100644 --- a/bin/chunk_preflight/gathered.py +++ b/bin/chunk_preflight/gathered.py @@ -6,6 +6,7 @@ import typing from failure import Failure from release_plan.todo_table import Item from release_plan.release_standing import LastCut +from release_plan.release import Release from project_config import templates # The CLI that lists a forge's pull requests: gh for a github.com origin, tea for any other. @@ -20,6 +21,13 @@ class Ran: stderr: str +@dataclasses.dataclass(frozen=True) +class CarriedOver: + """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, ...] + + @dataclasses.dataclass(frozen=True) class Plan: """The default branch's plan items, each with its detail, and `first`: the item the next chunk takes first.""" @@ -28,6 +36,8 @@ 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 every item's release is after the last cut. + carried: CarriedOver | None = None @property def branch(self) -> str: diff --git a/bin/chunk_preflight/main.py b/bin/chunk_preflight/main.py index ef9f7ba8..6d66449c 100644 --- a/bin/chunk_preflight/main.py +++ b/bin/chunk_preflight/main.py @@ -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 diff --git a/bin/chunk_preflight/test_chunk_preflight.py b/bin/chunk_preflight/test_chunk_preflight.py index afb30b6c..5c41cf0c 100644 --- a/bin/chunk_preflight/test_chunk_preflight.py +++ b/bin/chunk_preflight/test_chunk_preflight.py @@ -10,10 +10,10 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from project_config.templates import BRANCH +from chunk_preflight.gathered import CarriedOver, Gathered, ItemFacts, NamedPath, NoItem, Ran, Worktree from chunk_preflight import choices from failure import Failure from chunk_preflight.choices import forge_of, worktree_add -from chunk_preflight.gathered import Gathered, ItemFacts, NamedPath, NoItem, Ran, Worktree from test_env import isolated_env from release_plan.release_standing import LastCut, UNSEEN_RELEASES from chunk_preflight.main import line_count, ran, seconds, TIMEOUT @@ -54,6 +54,10 @@ Change `src/app.py`'s `run` and the files under `src`, not `gone.py`. SHIPPED = TODO.replace("| 3 | 0.2.0 | | | **Do the next thing.** | 2 | 2 | 3 | 5 | 3 | 1 by 9 | 56.2 |\n", "").replace("| 7 | 0.2.0 | 3 |", "| 7 | 0.2.0 | |").replace("### 3. Do the next thing.", "### 7. Do the thing after.") # The plan once release 0.2.0 has shipped all its items: only release 0.3.0's item 9 is left. LATER = TODO[:TODO.index("| 5 |")] + "| 9 | 0.3.0 | | | **Do a later thing.** | 1 | 1 | 1 | 1 | 1 | 1 by 9 | 90.0 |\n" +# Item 9's row, the only one under release 0.3.0. +NINTH = "| 9 | 0.3.0 | | | **Do a later thing.** | 1 | 1 | 1 | 1 | 1 | 1 by 9 | 90.0 |\n" +# A plan whose release 0.2.0 holds item 3 alone, before release 0.3.0's item 9. +SHIPPED_BUT_3 = TODO[:TODO.index("| 5 |")] + "| 3 | 0.2.0 | | | **Do the next thing.** | 2 | 2 | 3 | 5 | 3 | 1 by 9 | 56.2 |\n" + NINTH # An items table that holds no row. EMPTY = TODO[:TODO.index("| 5 |")] CHANGELOG = "# Changelog\n\n## Unreleased\n\n- One.\n - A nested line.\n- Two.\n\n## 0.1.0\n\n- Old.\n" @@ -576,8 +580,27 @@ class Plans(unittest.TestCase): def test_takes_the_earliest_release_where_no_earlier_one_was_named_since_the_last_cut(self): self.assertEqual(planned(LATER, LastCut("v0.1.0", "", 4, [LATER]), "origin/main", BRANCH).first.id, 9) + def test_counts_the_items_of_a_release_already_cut_as_the_next_releases_and_says_to_move_them(self): + 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, 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 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 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, 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): - why = planned(TODO, LastCut("v0.2.0", "", 4, []), "origin/main", BRANCH).why + why = planned(TODO.replace(NINTH, ""), LastCut("v0.2.0", "", 4, []), "origin/main", BRANCH).why self.assertIn("release 0.2.0", why) self.assertIn("v0.2.0", why) self.assertIn("not after", why) diff --git a/bin/loop_claude/test_loop_claude.py b/bin/loop_claude/test_loop_claude.py index 970149d3..d5bc624c 100644 --- a/bin/loop_claude/test_loop_claude.py +++ b/bin/loop_claude/test_loop_claude.py @@ -984,7 +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) - self.assertIsNone(routed_item(TODO, LastCut("v0.2.0", "", 3, [TODO]))) + # 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, []))) 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]))) @@ -1125,7 +1127,7 @@ class RouteSources(unittest.TestCase): def test_routes_on_the_plan_item_and_says_why_it_routes_on_the_projects_rung(self): self.assertIsNone(chunk_start.plan_item(DefaultPlan(plan_of(""), NO_CUT), FakeEffects().effects())) self.assertEqual(chunk_start.plan_item(DefaultPlan(plan_of(TODO), LastCut("v0.1.0", "", 3, [TODO])), FakeEffects().effects()).id, 3) - self.assertIsNone(chunk_start.plan_item(DefaultPlan(plan_of(TODO), LastCut("v0.2.0", "", 3, [TODO])), FakeEffects().effects())) + self.assertIsNone(chunk_start.plan_item(DefaultPlan(plan_of(TODO), LastCut("v0.3.0", "", 3, [TODO])), FakeEffects().effects())) unreadable = Failure("git show origin/main:todo.md printed text that is not UTF-8") for plan, said in ((DefaultPlan(plan_of(TODO.replace("| 4 | 2 | 3 |", "| x | 2 | 3 |")), NO_CUT), "routing on the project's rung: item 3's L 'x' is not a whole number from 1 to 4\n"), (DefaultPlan(unreadable, NO_CUT), f"routing on the project's rung: {unreadable.reason}\n"), (Failure("no origin remote"), "routing on the project's rung: no origin remote\n")): with self.subTest(said=said): diff --git a/bin/plan_store/jira_epic.py b/bin/plan_store/jira_epic.py index 2ea50986..ac4cdecc 100644 --- a/bin/plan_store/jira_epic.py +++ b/bin/plan_store/jira_epic.py @@ -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: - # Until a project can tie its releases to something other than semver versions, 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): diff --git a/bin/release_plan/release_standing.py b/bin/release_plan/release_standing.py index ae22c9a8..5fbb4bc4 100644 --- a/bin/release_plan/release_standing.py +++ b/bin/release_plan/release_standing.py @@ -156,18 +156,32 @@ def todos_since(tag: str | None | Failure, ref: str, plan: str | None, cwd: str, def chunk_item(found: list[Item], cut: LastCut) -> Pick: """The pick from todo.md's items, weighed against the last cut. Routing and chunk-preflight both pick with it, so they name one item.""" upcoming = next_release(found, cut) - return standing(upcoming, next_item(found), cut.reviewed) if isinstance(upcoming, Upcoming) else upcoming + return standing(upcoming, next_item(carried(found, cut)), cut.reviewed) if isinstance(upcoming, Upcoming) else upcoming + + +def carried(found: list[Item], cut: LastCut) -> list[Item]: + """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, and where no release after the cut is known, since naming one is the human's. + """ + version = cut_version(cut) + 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, 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 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): return Unknown() - earliest = min((item.release for item in found), default=None) + earliest = min((item.release for item in carried(found, cut)), default=None) version = cut_version(cut) if version is None: return Upcoming(earliest, True, has_unreleased(cut)) diff --git a/bin/release_plan/test_release_standing.py b/bin/release_plan/test_release_standing.py index a4d0da8e..b1f564c7 100644 --- a/bin/release_plan/test_release_standing.py +++ b/bin/release_plan/test_release_standing.py @@ -77,6 +77,33 @@ class NextRelease(unittest.TestCase): self.assertEqual(release_standing.next_release([one((1, 3, 0))], cut(Failure("count unreadable"))), release_standing.Upcoming((1, 3, 0), True, Failure("count unreadable"))) +class Carried(unittest.TestCase): + def test_files_each_item_of_a_release_already_cut_under_the_earliest_release_the_plan_names_after_the_cut(self): + held = [dataclasses.replace(one((1, 2, 3)), id=1), dataclasses.replace(one((1, 2, 0)), id=2), dataclasses.replace(one((1, 4, 0)), id=3), dataclasses.replace(one((1, 3, 0)), id=4)] + carried = release_standing.carried(held, release_standing.LastCut("v1.2.3", "", 4, [])) + self.assertEqual([(item.id, item.release) for item in carried], [(1, (1, 3, 0)), (2, (1, 3, 0)), (3, (1, 4, 0)), (4, (1, 3, 0))]) + + def test_leaves_the_plan_as_it_is_where_nothing_is_cut_or_it_names_no_release_after_the_cut(self): + held = [one((1, 2, 3))] + for tag in ("v1.2.3", "v1.2.2", None, Failure("tags unreadable")): + 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, []) + 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.next_release(held, cut), release_standing.Upcoming((1, 3, 0), True, True)) + self.assertEqual(release_standing.next_release(held[:1], cut), release_standing.Cut((1, 2, 3))) + + class ChunkItem(unittest.TestCase): def test_takes_the_earliest_release_where_it_is_the_next_and_else_says_whether_the_next_is_ready_to_cut_or_to_plan(self): cases = ( @@ -91,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))), @@ -140,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] diff --git a/docs/decisions.md b/docs/decisions.md index ce810584..c56ae338 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -335,7 +335,7 @@ Messages keep each file's usual name, such as `todo.md`, as its label, since the - **A bench of readers picked the spelling.** Three fresh readers, seated as the person who writes a client's `config.toml`, each picked `plan = "jira:https://<site>/browse/<key>"` over the bare address, a `jira:<key>` beside a `jira-site` key, and a `[plan]` table. Each also picked one pair of env-file keys, `ATLASSIAN_EMAIL` and `ATLASSIAN_API_TOKEN`, for Jira and Confluence over a pair for each, since one account's token opens both. - **An item's ID stays a whole number: the issue's number in the epic's Jira project.** About 30 modules read an ID as an int, and the `branch` and title templates already spell a ticket's name, as `ABC-{id}`. So the store refuses a child issue from another Jira project, and counts a blocker only among the plan's own items (`bin/plan_store/jira_epic.py`). - **The scores sit in one issue property, `plan-item`**, which needs no Jira admin (lilleman, 2026-11-12). An issue without it reads as an item nobody scored. -- **The release is the earliest Fix Version named as a semver version**, and an issue with none fails the read, naming it, until todo.md's item 359 ties releases to something else. +- **The release is the earliest Fix Version named as a semver version**, and an issue with none fails the read, naming it. - **The loop files an item as a Task under the epic, and marks it as its own** (lilleman's calls of 2026-11-12). `"Filed by": "loop"` in the `plan-item` property tells such an issue from one a person filed, whose summary and description the loop never edits. Task is an issue type every Jira Software project template has; a project without it refuses the issue, saying so. The issue takes the project's Fix Version named as the release, with a leading v or without, and the store refuses an item whose release the project has no Fix Version for, before it files anything. A security finding also gets the label `security`, and its text never holds a secret's value. Jira ranks the new issue last, and no bar or goals check applies, until todo.md's item 384 says where a plan in Jira states its formula. Jira takes a blocker's link only after the issue exists, so the store first checks that each blocker is an open child. A link Jira still refuses leaves the issue filed: the write counts as landed, with a note naming the link to make by hand. A failed create says the issue may exist all the same, since a lost answer doesn't tell. - **The store reads, files and finishes, and doesn't edit an issue** until todo.md's item 382. It finishes an item with the transition that the config's `jira-finish-transition` names, which must lead to the status `jira-finish-status` names, since each Jira workflow differs (lilleman's call, 2026-11-12); any open child of the epic may move. It refuses a status outside Jira's done status category: the read counts an issue as finished only in that category, so the item would stay in the plan. Where the issue's present status has no direct transition to the status `jira-finish-status` names, `todo-item finish` fails and a person moves the issue in Jira: the store never walks an issue through other statuses to reach it. lilleman answered on 2026-11-15: "If it is possible to move it to done without a transisiont, that should happen. If not, fail." The implementer read "without a transition" as "without a transition in between". `rank_todo.py` refuses to rank a plan in Jira, and its `--check` passes, since Jira's backlog ranks it; rule-hook's rank check skips it. Each read first asks Jira for the epic itself, since a search under an epic the account cannot see answers no issues, as a finished plan does. diff --git a/docs/reading-cost.md b/docs/reading-cost.md index 4e3f01f1..f1872c59 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -2283,3 +2283,18 @@ Read most (opens and searches): - `rules/todo-items.md` 4 - `bin/project_config/main.py` 3 - `bin/chunk_pr/approval.py` 2 + +## Reading cost, chunk 0851f830bb67, finished 2026-11-15T22:41:58Z + +50560 new input tokens before the first commit. + +Read most (opens and searches): + +- `README.md` 1 +- `bin/project_config/main.py` 1 +- `bin/project_config/settings.py` 1 +- `bin/project_record/main.py` 1 +- `bin/project_record/test_project_record.py` 1 +- `docs/decisions.md` 1 +- `rules/decisions.md` 1 +- `settings.json` 1 diff --git a/todo.md b/todo.md index 2a13e0fb..a6872a59 100644 --- a/todo.md +++ b/todo.md @@ -12,7 +12,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| -| 359 | 0.11.0 | | | **Tie a project's releases to what its config names: semver tags, Jira Fix Versions, sprints, or none.** | 3 | 2 | 3 | 6 | 4 | 1.6 by 3 | 0.8 | | 382 | 0.11.0 | | | **Edit a Jira issue the loop filed, and score an unscored issue a teammate filed with a comment saying why.** | 4 | 2 | 3 | 7 | 4 | 1.6 by 3 | 0.8 | | 384 | 0.11.0 | | | **Rank an issue the loop files in Jira by its score among the issues the loop filed, a security finding first.** | 3 | 2 | 2 | 5 | 3 | 1.6 by 2 | 0.7 | | 375 | 0.11.0 | | decision | **Run up to the project's configured number of chunks at once, each in its own window of one tmux session named for the project, mark a window whose chunk waits for the human, and refuse to start without tmux at the needed version.** | 4 | 2 | 3 | 7 | 7 | 1.5 by 7 | 0.6 | @@ -77,10 +76,6 @@ ## Details -### 359. Tie a project's releases to what its config names: semver tags, Jira Fix Versions, sprints, or none. - -lilleman's call, 2026-11-12: what a release is differs per client. With none, items name no release, and the architecture and principles passes the release review runs need another trigger, which this item settles and records. Readers: `rank_todo.py`'s release order, chunk-preflight's next release, loop-claude's "release ready to cut", larv-review's release review, `CLAUDE.md` → "Working loop". Cutting a release stays the human's. - ### 382. Edit a Jira issue the loop filed, and score an unscored issue a teammate filed with a comment saying why. Split from item 352 on 2026-11-15; lilleman's calls, 2026-11-12. The loop edits the summary, description and scores of issues it created, which the `Filed by` mark in the `plan-item` property tells apart, and never the summary or description of an issue a person filed. An issue a teammate files without scores gets scored like any item, with a short comment saying it was scored and why; its scope stays as written. The comment reaches the client's team, so it is in the project's `language`, and its reason comes from whoever scores: `PlanStore.edit` and `todo-item edit` gain a way to pass it, whose spelling a bench of readers picks. Say in `docs/decisions.md` whether the loop may re-score or move a person's issue that already holds scores; the calls name neither.