diff --git a/bin/chunk_preflight/test_chunk_preflight.py b/bin/chunk_preflight/test_chunk_preflight.py index 8cfabda7..7a644844 100644 --- a/bin/chunk_preflight/test_chunk_preflight.py +++ b/bin/chunk_preflight/test_chunk_preflight.py @@ -884,6 +884,11 @@ class UnpredictedTest(unittest.TestCase): self.assertEqual(self.said(self.LISTED.replace(f"\n### 7. Do it.\n{self.LIST}", "")), ['- Item 7 of release 0.2.0 has no `Touches:` list. Before the chunk, have one subagent write it, as `~/.claude/CLAUDE.md` → "Working loop" says.']) self.assertEqual(self.said(TODO), ['- Items 5, 3, 7 and 8 of release 0.2.0 have no `Touches:` list. Before the chunk, have one subagent write them, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + def test_names_two_items_and_one_of_two(self): + self.assertEqual(self.said(self.LISTED.replace(f"### 5. Do it.\n{self.LIST}", "").replace(f"### 7. Do it.\n{self.LIST}", "")), ['- Items 5 and 7 of release 0.2.0 have no `Touches:` list. Before the chunk, have one subagent write them, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + pair = "\n".join(line for line in TODO.splitlines() if not re.match(r"\| [58] \|", line)) + "\n" + self.assertEqual(self.said(pair + self.LIST), ['- Item 7 of release 0.2.0 has no `Touches:` list. Before the chunk, have one subagent write it, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + def test_says_nothing_of_an_item_alone_in_its_release(self): alone = "\n".join(line for line in TODO.splitlines() if not re.match(r"\| [578] \|", line)) + "\n" self.assertEqual(self.said(alone), []) diff --git a/bin/plan_store/todo_md.py b/bin/plan_store/todo_md.py index 72ff7873..26fa8925 100644 --- a/bin/plan_store/todo_md.py +++ b/bin/plan_store/todo_md.py @@ -98,10 +98,10 @@ class FilePlan: def warnings(self) -> list[str]: """What `rank_todo.py --check` says of the file without failing on it: which items of its earliest release hold no `Touches:` list.""" plan = self.read() - if isinstance(plan, Failure) or not plan.items: + if isinstance(plan, Failure): return [] - missing = unpredicted(plan.items, min(item.release for item in plan.items)) - return [f"{self.path}: warning: {missing}; write each as `~/.claude/rules/todo-items.md` says"] if missing else [] + earliest = sorted({item.release for item in plan.items})[:1] + return [f"{self.path}: warning: {missing}; write each as `~/.claude/rules/todo-items.md` says" for release in earliest if (missing := unpredicted(plan.items, release))] def reported(self, ranked: ranking.Ranked) -> list[str]: """Ranking's notes and under-bar lines, each prefixed with the file's path, as a tool prints them on stderr."""