Quote the detail of each item that may join a chunk in chunk-preflight's facts, so a worker stops opening todo.md for it
CI / tests (pull_request) Successful in 4m38s

This commit is contained in:
2026-11-09 03:24:06 +01:00
parent 4593c2969a
commit 447653fda5
9 changed files with 27 additions and 12 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ def planned(todo: str | Failure, cut: LastCut, default: str) -> Plan | NoItem:
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.")
details = item_details(todo)
detail = details.get(first.id, "") if isinstance(details, dict) else f"(todo.md's details cannot be read: {details.reason})"
return Plan(found, first, f"{first.tagline}\n\n{detail}".strip())
return Plan(found, first, f"{first.tagline}\n\n{detail}".strip(), details if isinstance(details, dict) else {})
def worktree_on(porcelain: str, branch: str) -> pathlib.Path | None:
+1
View File
@@ -42,6 +42,7 @@ def item_lines(default: str, item: ItemFacts) -> list[str]:
*bundled(item.plan),
*named_lines(item.named),
f"\nItem {first.id}'s tagline and detail:\n\n{quoted(item.plan.text)}",
*(f"\nItem {joining.id}'s detail:\n\n{quoted(item.plan.details[joining.id])}" for joining in bundle_candidates(item.plan.items, first) if item.plan.details.get(joining.id)),
*(f"\n{printed(shown, done)}" for shown, done in item.tools),
]
+2
View File
@@ -26,6 +26,8 @@ class Plan:
first: Item
# first's tagline and detail.
text: str
# Every item's detail by its ID; empty where todo.md's details cannot be read.
details: dict[int, str]
@property
def branch(self) -> str:
+1 -1
View File
@@ -34,7 +34,7 @@ todo.md as the default branch holds it, the plan loop-claude routes on. It print
them on a github.com origin, and else as tea does. No title reaches the output;
- the items of that release that a chunk taking the item may take too: those that are not
questions, that have R 5 or less, and that no item outside the chunk blocks; none where the
item's own R is above 5;
item's own R is above 5, each with its detail;
- each file or folder git tracks that the item's tagline or detail names in backticks, with a
file's lines or a folder's files, and the item's tagline and detail;
- where it made or continued the worktree, what `rank_todo.py --check todo.md`,
@@ -340,6 +340,14 @@ class Render(unittest.TestCase):
self.assertIn("item 7, L 1, E + I 2, S 1: **Do the thing after.**", said)
self.assertNotIn("item 8,", said)
def test_quotes_the_detail_of_each_item_that_may_join_the_chunk(self):
said = rendered(item_facts(TODO + "\n### 7. Do the thing after.\n\nTouch `src/other.py`.\n\nRun the e2e leg.\n\n### 8. Do the answered thing.\n\nNot quoted.\n"))
self.assertIn("Item 7's detail:\n\n> Touch `src/other.py`.\n> \n> Run the e2e leg.", said)
self.assertNotIn("Not quoted", said)
def test_quotes_no_detail_for_a_joining_item_that_has_none(self):
self.assertNotIn("Item 7's detail", rendered(item_facts()))
def test_states_the_items_worktree_or_why_none_was_made(self):
self.assertIn("/c/proj-item-3", rendered(item_facts()))
self.assertIn("none made: path taken", rendered(item_facts(worktree=Failure("none made: path taken"))))