Answer stability round 1: 0 🔴, 1 🟡 (1 misread); leave a human's task unmoved and unawaited where the team's automation moves issues

This commit is contained in:
Lilleman
2026-11-19 23:54:55 +01:00
parent daee3c671f
commit 535ad7fd6a
2 changed files with 14 additions and 10 deletions
+7 -6
View File
@@ -250,7 +250,7 @@ def chunk_run(key: str, epic: EpicRun) -> Stop:
return issue
if issue and isinstance(recorded(issue, epic.config.label_repos), HumanTask):
human_tasks.awaited(issue, epic.key, epic.store, epic.config.label_repos, epic.config.unblocking, tmux.Window(epic.session, key, pane), POLL_SECONDS, epic.paths.home, epic.effects)
return handed_on(key, epic, by_others=True)
return handed_on(key, epic, humans=True)
place = chunk_root(key, issue, epic)
if isinstance(place, Stop):
return place
@@ -424,12 +424,13 @@ def folder_made(root: str) -> Failure | None:
return None
def handed_on(key: str, epic: EpicRun, by_others: bool = False) -> Stop:
"""The stop of a do-epic whose chunk finished. It first moves the chunk's issue to done (the epic's finishing has none), and its split item too where that was the last of the item's sub-tasks, so that no finished chunk starts again and what they block may start, then starts each chunk that may start now. by_others says someone else moves the issue where the team's automation moves issues: the automation from a chunk's pull request, or the human whose task it is. There it waits for that move (`moved_by_automation`) and moves only a split item, once Jira counts each of its sub-tasks done; a chunk without a repo has no pull request, so its issue moves to done as ever. Its window closes as it exits."""
# The epic's finishing has no issue to move: the epic is closed by `--close-epic`.
if key == epic.key:
def handed_on(key: str, epic: EpicRun, in_repo: bool = False, humans: bool = False) -> Stop:
"""The stop of a do-epic whose chunk finished. It first moves the chunk's issue to done (the epic's finishing has none), and its split item too where that was the last of the item's sub-tasks, so that no finished chunk starts again and what they block may start, then starts each chunk that may start now. Where the team's automation moves issues, others move two kinds of issue. The automation moves the issue of a chunk in a repo, which in_repo marks, from its pull request: the stop waits for that move (`moved_by_automation`). The human moves their own task, which humans marks: the stop moves and awaits nothing. A chunk without a repo has no pull request, so its issue moves to done as ever, and so does a split item, once Jira counts each of its sub-tasks done. Its window closes as it exits."""
automated = epic.config.automation_moves
# The epic's finishing has no issue to move: the epic is closed by `--close-epic`. Nor has a human's task where the human moves it: its window waited until it holds up no issue.
if key == epic.key or humans and automated:
issues: list[EpicIssue] | Failure = epic.store.read()
elif by_others and epic.config.automation_moves:
elif in_repo and automated:
issues = moved_by_automation(key, epic)
else:
moved = epic.store.finish_issue(key)
+7 -4
View File
@@ -50,8 +50,8 @@ class AHumanTaskThatBlocksAnIssue(DoEpicTest):
self.slept = slept
return self.run_main(["--chunk", "ABC-19", "ABC-12"], fake, MODELS)
def moved_to_an_unblocking_status(self, switch: str) -> bool:
"""Whether Jira counts the task done after its window's run, where the human moved it to an unblocking status and the config ends with switch."""
def moved_to_an_unblocking_status(self, switch: str, frees: tuple[str, dict[str, object]] = ("ABC-19", {"status": "Release Ready"}), starts: str = "ABC-21") -> bool:
"""Whether Jira counts the task done after its window's run, where the config ends with switch. frees is the change in Jira that ends the wait: by default the human moves the task to an unblocking status. starts is what the window then starts."""
with (self.home / ".claude-projects" / "do-epic" / "config.toml").open("a") as config:
config.write('jira-unblocking-statuses = ["Release Ready"]\n' + switch)
fake = FakeEffects(git=UNREAD, windows=WINDOW)
@@ -61,11 +61,11 @@ class AHumanTaskThatBlocksAnIssue(DoEpicTest):
slept.append(seconds)
self.assertLess(len(slept), 5, "the window still waits")
if len(slept) == 2:
self.epic.change("ABC-19", status="Release Ready")
self.epic.change(frees[0], **frees[1])
fake.effects = lambda made=fake.effects(): dataclasses.replace(made, sleep=sleep) # type: ignore[method-assign]
code, out, err = self.run_main(["--chunk", "ABC-19", "ABC-12"], fake, MODELS)
self.assertEqual((code, err, slept), (0, "", [60, 60]))
self.assertIn("the chunk finished; started ABC-21\n", out)
self.assertIn(f"the chunk finished; started {starts}\n", out)
return next(each.done for each in self.epic.issues if each.key == "ABC-19")
def test_a_task_the_human_moves_to_an_unblocking_status_no_longer_holds_up_an_issue_and_moves_to_done(self) -> None:
@@ -74,6 +74,9 @@ class AHumanTaskThatBlocksAnIssue(DoEpicTest):
def test_where_the_teams_automation_moves_issues_the_humans_task_stays_where_the_human_moved_it(self) -> None:
self.assertFalse(self.moved_to_an_unblocking_status("jira-automation-moves-issues = true\n"))
def test_where_the_teams_automation_moves_issues_a_task_that_blocks_no_open_issue_any_more_ends_its_window_unmoved(self) -> None:
self.assertFalse(self.moved_to_an_unblocking_status("jira-automation-moves-issues = true\n", ("ABC-21", {"done": True}), starts="no other"))
def test_a_task_holds_up_only_the_issues_no_unblocking_status_settles(self) -> None:
issues = [issue("ABC-19", "do-epic-human"), issue("ABC-20", "do-epic-claude", blockers=("ABC-19",), status="Release Ready"), issue("ABC-21", "do-epic-claude", blockers=("ABC-19",))]
self.assertEqual(holds_up("ABC-19", issues, {}, ("Release Ready",)), ["ABC-21"])