Merge remote-tracking branch 'origin/main' into item-501
CI / tests (pull_request) Has been cancelled
CI / tests (pull_request) Has been cancelled
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- larv-review now runs each command that a changed doc line says prints something and hands the real output to the product-owner and prose reviewers, so a claim about output is checked by running it.
|
||||
- `do-epic` moves a parent issue whose sub-tasks a person filed: to done by `jira-finish-transition` once every sub-task is done, and before that by the transition the new setting `jira-sub-tasks-landed-transition` names, once each sub-task is done or in one of `jira-unblocking-statuses`. The transition must lead to one of those statuses. `--dry-run` prints each such move.
|
||||
- mutate-changes now mutates the Go lines a branch changes with Gremlins, as it does Python, Rust, TypeScript and PHP, and prints each mutant the tests do not kill.
|
||||
- A project's config may set `epic-branch`, such as `epic-branch = "{epic}"`: do-epic then keeps one working branch per epic, level with the default branch by merge commits, and each chunk branches off it and merges into it without waiting for a person, even under `merge = "human"`. `chunk-pr open-epic` opens the finished epic's pull request into the default branch for a person to merge. `review-request-comment` names a comment `chunk-pr` posts after each push to ask a forge's reviewer for a review, and `jira-pull-request-open-status` and `jira-pull-request-merged-status` name the statuses do-epic moves an issue to as its pull request opens and merges.
|
||||
- `mutate-changes` mutates a Python script from its own folder where a test beside it imports it by its file name, as in `import run_harness`, so mutmut finds the tests' calls to it. A crash inside mutmut now becomes one report line that names mutmut's error, not a traceback, and the other folders still report.
|
||||
|
||||
@@ -161,6 +161,7 @@ The last line prints each setting's path once the config is complete.
|
||||
- `jira-unblocking-statuses` lists the statuses at which an issue's work has landed though Jira doesn't count it done yet, such as `["Release Ready"]`, in upper or lower case. An issue in one of them takes no chunk and no longer blocks the issues it blocks, and `--status` names the statuses beside each blocker. A status Jira counts as done always does both. The release reviews, which are the epic's last chunk, still wait until Jira counts every issue done: run `do-epic <EPIC-KEY>` then, to start them.
|
||||
- `jira-automation-moves-issues = true` keeps do-epic from moving the issue of a finished chunk in a repo: the automation moves it, and do-epic waits for that move before it starts what the issue blocks. An issue without a repo has no pull request, so do-epic still moves it, with `jira-finish-transition`. The setting needs `jira-unblocking-statuses`, which names the status the automation gives an issue whose pull request merged.
|
||||
- `config.toml` names the statuses do-epic itself gives an issue whose chunk merges into an epic's working branch, in a repo whose config sets `epic-branch`. A team's automation moves an issue only for a pull request into the default branch, so there do-epic makes both moves, whatever `jira-automation-moves-issues` says. `jira-pull-request-open-status`, such as `"Code Review"`, is the status of an issue whose chunk parks with its pull request open; a pull request that opens and merges within one run of the worker skips it, unless the workflow leads to the merged status only through it. `jira-pull-request-merged-status`, such as `"Release Ready"`, is the status once the pull request has merged into the working branch. `jira-unblocking-statuses` must list it, and an issue that has it counts as done when the release reviews and the finishing chunk fall due, since both come before a person merges the working branch. Without it, do-epic moves a finished chunk's issue to done. Where `jira-automation-moves-issues` is set, it stops instead and asks you to move the issue.
|
||||
- `config.toml` names how do-epic moves a parent issue whose sub-tasks a person filed. Once every sub-task is done, the parent moves to done by `jira-finish-transition`; without that setting it stays. Before that, once each sub-task is done or in one of `jira-unblocking-statuses`, the parent moves by the transition `jira-sub-tasks-landed-transition` names, such as `"Release Ready"`; without that setting it stays. The transition must lead to one of `jira-unblocking-statuses`, or do-epic doesn't make it. do-epic makes these moves as each run plans and as each chunk finishes, and `--dry-run` prints them. A parent that is done, or already in one of `jira-unblocking-statuses`, never moves back. A move that is not made is said, and the run goes on.
|
||||
- `config.toml` also says how a starting chunk's issue shows on its team's board. A starting chunk always assigns its issue to the account do-epic works as, unless someone else holds it; that issue keeps its assignee, and moves and joins the sprint like any other. `jira-start-transition` names the workflow transition that then moves the issue, such as `"In Progress"`; an issue whose work has started already keeps its status. `jira-sprint-board` is the ID of the board whose active sprint the issue joins, such as `6`. Where a setting is left out, do-epic doesn't take its step.
|
||||
- `config.toml` may set `jira-finding-type`, the issue type do-epic files a finding as, and `jira-review-type`, the one it files a repo's release review as, such as `"Feature"` and `"Chore"`. Both are Task where left out. do-epic doesn't file anything where the Jira project lacks the type, and says which types it has.
|
||||
- `config.toml` may set `sub-task-summary`, which shapes the summary of each sub-task do-epic files for an issue that changes several repos, such as `sub-task-summary = "{label}: {Summary}"`. `{label}` is the team's label for the repo, else the repo's name, and `{Summary}` is the issue's summary with a capital first letter. It must hold `{Summary}`. Without it a summary is `[<repo>] <the issue's summary>`.
|
||||
@@ -241,7 +242,21 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a
|
||||
- `chunk_driver/` holds what the entry points share. An entry point is a tool that drives chunks through `agent_cycle`: `loop_claude` and `do_epic` are the two. They share how a cycle starts (`cycle_start.py`) and closes (`chunk_run.py`), the claim on a checkout before a chunk starts in it (`claims.py`), the prompts every worker gets (`prompts.py`), and a checkout's premises, records and saved models (`project/`). It imports neither entry point, and `repo_checks` fails any package that imports one of the two. `agent_cycle` is the layer below it, and `repo_checks` fails `agent_cycle` where it imports `chunk_driver`, tests included.
|
||||
- `command_lines/` reads a shell command: its simple commands, and a docker call's subcommand and memory limits, for `command_patterns`, `reading_cost`, `routing_figures`, `rule_hook` and `run_heavy`.
|
||||
- `deploy_release` imports `release_plan`'s `release_standing`.
|
||||
- `do_epic/` holds `do-epic`, the tool that drives one Jira epic. `main.py` starts the epic's chunks and runs one chunk's cycles in its window, through `agent_cycle`. `planning.py` settles, before the chunks start, where each open issue is worked, its scores and the order the issues start in, through `split.py`, `repo_pick.py`, `issue_scores.py` and `ranking.py`. `scheduler.py` says which issues run now: as many as the epic's cap and each repo's `parallel-chunks` allow, and none in a repo where loop-claude runs chunks. `gates.py` reads once whether a chunk's pull request waits on its checks, an approval or a new review, and `parked.py` keeps each chunk that does in a state file, so it takes no running slot while it waits and goes on waiting after a reboot. `chunk_prompt.py` words what a chunk's worker reads. Through `findings.py` that worker files a finding as an issue of the epic, with `--file`, and appends a decision to its description, with `--record-decision`. `finish.py` ends an epic that holds no open issue: its finishing chunk files a release review of each repo the epic changed, has the human confirm each goal, and with `--close-epic` posts the summary on the epic and closes it. `config.py` reads its machine-wide settings, importing `project_config`'s settings and `model_routing`'s ladder file, and `epic_record.py` reads and writes an epic's description by section, language line and cap line, through `record_store`'s `EpicDescription`. `repos.py` finds a repo's checkout and project config by its name, and clones a missing checkout from the host and owner of the epic's other repos, through `forge`'s `url_beside`. `repo_pick.py` asks claude, by `repo-rule.md`, where an epic item is worked, and records the answer as a label on the issue. `split.py` has claude predict from the code which repos an item changes, and files a sub-task per repo under it where there are several. `ranking.py` orders an epic's items by score over one chain of goals, the epic's, then code health, then the item's repo's, through `plan`'s ranking, and re-ranks the tracker's backlog to that order through `backend/`. `backend/` reads, files and ranks the epic's issues, adds the labels `repo_pick.py` and `split.py` record, posts comments, moves a finished chunk's issue to done, and closes the epic. `e2e/` holds `do-epic-e2e`.
|
||||
- `do_epic/` holds `do-epic`, the tool that drives one Jira epic:
|
||||
- `main.py` starts the epic's chunks and runs one chunk's cycles in its window, through `agent_cycle`.
|
||||
- `planning.py` settles, before the chunks start, where each open issue is worked, its scores and the order the issues start in, through `split.py`, `repo_pick.py`, `issue_scores.py` and `ranking.py`.
|
||||
- `scheduler.py` says which issues run now: as many as the epic's cap and each repo's `parallel-chunks` allow, and none in a repo where loop-claude runs chunks.
|
||||
- `gates.py` reads once whether a chunk's pull request waits on its checks, an approval or a new review, and `parked.py` keeps each chunk that does in a state file, so it takes no running slot while it waits and goes on waiting after a reboot.
|
||||
- `chunk_prompt.py` words what a chunk's worker reads. Through `findings.py` that worker files a finding as an issue of the epic, with `--file`, and appends a decision to its description, with `--record-decision`.
|
||||
- `finish.py` ends an epic that holds no open issue: its finishing chunk files a release review of each repo the epic changed, has the human confirm each goal, and with `--close-epic` posts the summary on the epic and closes it.
|
||||
- `config.py` reads its machine-wide settings, importing `project_config`'s settings and `model_routing`'s ladder file, and `epic_record.py` reads and writes an epic's description by section, language line and cap line, through `record_store`'s `EpicDescription`.
|
||||
- `repos.py` finds a repo's checkout and project config by its name, and clones a missing checkout from the host and owner of the epic's other repos, through `forge`'s `url_beside`.
|
||||
- `repo_pick.py` asks claude, by `repo-rule.md`, where an epic item is worked, and records the answer as a label on the issue.
|
||||
- `split.py` has claude predict from the code which repos an item changes, and files a sub-task per repo under it where there are several.
|
||||
- `parent_moves.py` moves a parent whose sub-tasks a person filed, once those have landed or are done.
|
||||
- `ranking.py` orders an epic's items by score over one chain of goals, the epic's, then code health, then the item's repo's, through `plan`'s ranking, and re-ranks the tracker's backlog to that order through `backend/`.
|
||||
- `backend/` reads, files and ranks the epic's issues, adds the labels `repo_pick.py` and `split.py` record, posts comments, moves a finished chunk's issue to done, and closes the epic.
|
||||
- `e2e/` holds `do-epic-e2e`.
|
||||
- `forge/` tells a GitHub origin from a Gitea one, names a repo beside an origin's and runs that forge's CLI (`commands.py`), finds a pull request, lists the ready ones and reads its checks, once or until they settle (`pulls.py`), and reads a pull request's review state (`reviews.py`), for `chunk_preflight`, `chunk_pr`, `deploy_release`, `do_epic` and `larv_review`.
|
||||
- `git_cli/` runs git for every tool (`git_repo.py`), reads the git calls in a shell command (`git_command.py`), and keeps an epic's working branch level with the default branch (`epic_branch.py`).
|
||||
- `judge_replay` imports `agent_cycle`'s judge and verdicts, and `chunk_driver`'s premises, records and `ANSWER_DESTINATIONS`.
|
||||
|
||||
@@ -45,6 +45,8 @@ Before anything else, **read the technical principles** in the folder your promp
|
||||
|
||||
6. **Assess reasonableness of usage paths**: Are there paths that exist but no real persona would use?
|
||||
|
||||
7. **Check each claim about output against its run.** A changed doc line that says what a command, flag or error prints is true only if the real output says so. Where your prompt has a `Claimed output:` line, that file holds each such claim's command and real output. Report a claim the output doesn't bear out, such as an error said to name the fix that doesn't, and name the missing words. Never settle one by reading code. A claim marked `not run`, or one you find that the prompt doesn't hand you a run of, is a ❓ naming the command that would run it.
|
||||
|
||||
## Your Output Format
|
||||
|
||||
Report only a defect a persona hits; a requirement that the change breaks, of the plan in the file your prompt's `Plan:` line names, of the goals in the file your prompt's `Goals and audience:` line names, or of code health (`~/.claude/CLAUDE.md` → "Shared goal", unless that file voids it); or a breach of a technical principle, or of a coding convention, which counts as one. Friction that is none of these is not a finding.
|
||||
|
||||
@@ -28,6 +28,8 @@ Run them in this order. A fix for a later check never breaks an earlier one.
|
||||
|
||||
Also report a list whose order carries no meaning and is not sorted (the technical principles' "Deterministic order", in the folder your prompt's `Technical principles:` line names; without one, open your report by saying so), a sentence contradicting another, a claim the code shows false, and a word used against `CLAUDE.md` → "Vocabulary".
|
||||
|
||||
Where your prompt has a `Claimed output:` line, that file holds the command and real output of each changed line that says what a command prints. Report a claim its output doesn't bear out, and name the missing words. A claim marked `not run` is a ❓ naming the command that would run it.
|
||||
|
||||
## Growth
|
||||
|
||||
Report the lines each file gained and lost. A line an earlier pass's fix added that names no reader need is a finding.
|
||||
|
||||
@@ -16,6 +16,9 @@ class EpicStoreContract:
|
||||
assertIsNone: typing.Callable[..., None]
|
||||
subTest: typing.Callable[..., typing.ContextManager[None]]
|
||||
|
||||
# The name of a transition the tracker offers an open issue, which leads to the done status "Done".
|
||||
transition = "Done"
|
||||
|
||||
def new_store(self) -> EpicStore:
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -193,6 +196,25 @@ class EpicStoreContract:
|
||||
self.assertIsInstance(store.move_issue("ZZZ-1", "Done"), Failure)
|
||||
self.assertEqual([issue.status for issue in self.issues(store)], ["To Do"])
|
||||
|
||||
def test_moves_a_child_issue_or_a_sub_task_by_the_transition_named_and_answers_the_status_it_leads_to(self) -> None:
|
||||
store = self.new_store()
|
||||
child = self.filed(store, store.epic_key, "Count the runs.")
|
||||
task = self.filed(store, child, "Count them in the api.")
|
||||
self.assertEqual([store.move_issue_by(task, self.transition, ("Done",)), store.move_issue_by(child, self.transition, ("Done",))], ["Done", "Done"])
|
||||
self.assertEqual({issue.key: (issue.status, issue.done) for issue in self.issues(store)}, {child: ("Done", True), task: ("Done", True)})
|
||||
|
||||
def test_leaves_an_issue_already_at_a_status_asked_for_where_it_is(self) -> None:
|
||||
store = self.new_store()
|
||||
child = self.filed(store, store.epic_key, "Count the runs.")
|
||||
self.assertEqual(store.move_issue_by(child, self.transition, ("Done",)), "Done")
|
||||
self.assertEqual(store.move_issue_by(child, "Release Ready", ("done",)), "Done")
|
||||
|
||||
def test_refuses_to_move_an_issue_outside_the_epic_by_a_transition(self) -> None:
|
||||
store = self.new_store()
|
||||
self.filed(store, store.epic_key, "Count the runs.")
|
||||
self.assertIsInstance(store.move_issue_by("ZZZ-1", self.transition, ("Done",)), Failure)
|
||||
self.assertEqual([issue.status for issue in self.issues(store)], ["To Do"])
|
||||
|
||||
def test_finishes_a_sub_task_of_a_child_issue_and_leaves_its_parent_open(self) -> None:
|
||||
store = self.new_store()
|
||||
child = self.filed(store, store.epic_key, "Count the runs.")
|
||||
|
||||
@@ -126,6 +126,19 @@ class MemoryEpic:
|
||||
self.writes.append(f"move {key} to {status}")
|
||||
return None
|
||||
|
||||
def move_issue_by(self, key: str, transition: str, to: tuple[str, ...]) -> str | Failure:
|
||||
# The fake holds no workflow, so it cannot tell where a transition leads: each leads to the first status asked for.
|
||||
if self.fails:
|
||||
return Failure(self.fails)
|
||||
issue = self.within(key)
|
||||
if issue is None:
|
||||
return no_child(self.epic_key, key, "moved")
|
||||
if issue.status.casefold() in {name.casefold() for name in to}:
|
||||
return issue.status
|
||||
self.change(key, status=to[0], done=to[0].casefold() == "done")
|
||||
self.writes.append(f"move {key} by {transition}")
|
||||
return to[0]
|
||||
|
||||
def finish_issue(self, key: str) -> None | Failure:
|
||||
if self.fails:
|
||||
return Failure(self.fails)
|
||||
|
||||
@@ -10,7 +10,7 @@ from project_config.settings import DEFAULT_ISSUE_TYPE, Epic, Finish, JIRA_FINDI
|
||||
from atlassian.jira import DONE, entry_of, finishing_transition, ISSUE_KEY, issue_type_refusal, issue_types_of, MAX_PAGES, move_refusal, PERHAPS_FILED, PERHAPS_MOVED, project_of, rank_refusal, searched, SHAPE, status_category, unshaped
|
||||
from do_epic.backend.protocol import EpicIssue, no_blocker, no_child, no_parent, no_scores, no_words, unfit, unfit_label
|
||||
from failure import Failure
|
||||
from do_epic.backend.jira_status import moved_to
|
||||
from do_epic.backend.jira_status import moved_by, moved_to
|
||||
from plan.todo_table import MOVES
|
||||
from do_epic.repo_pick import REVIEW_LABEL
|
||||
from do_epic.backend.jira_start import Start, started
|
||||
@@ -215,6 +215,13 @@ class JiraEpic:
|
||||
within = self.within(key, authorization, "move", "moved")
|
||||
return within if isinstance(within, Failure) else moved_to(self.epic.site, key, status, authorization, self.http)
|
||||
|
||||
def move_issue_by(self, key: str, transition: str, to: tuple[str, ...]) -> str | Failure:
|
||||
authorization = basic_auth(self.env_file)
|
||||
if isinstance(authorization, Failure):
|
||||
return authorization
|
||||
within = self.within(key, authorization, "move", "moved")
|
||||
return within if isinstance(within, Failure) else moved_by(self.epic.site, key, transition, to, authorization, self.http)
|
||||
|
||||
def finish_issue(self, key: str) -> None | Failure:
|
||||
authorization = basic_auth(self.env_file)
|
||||
if isinstance(authorization, Failure):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Moves a Jira issue to a status by name, for a team whose own automation doesn't see the move's cause, such as a pull request into an epic's working branch."""
|
||||
"""Moves a Jira issue to a named status, or through a named transition, for a team whose own automation doesn't see the move's cause, such as a pull request into an epic's working branch."""
|
||||
import typing
|
||||
|
||||
from failure import Failure
|
||||
@@ -6,15 +6,22 @@ from atlassian.client import Http
|
||||
from atlassian.jira import offers_of, unshaped
|
||||
|
||||
|
||||
def moved_to(site: str, key: str, status: str, authorization: str, http: Http) -> Failure | None:
|
||||
"""Moves the issue named key to the status named status, in upper or lower case, by the first transition to that status the issue's workflow offers. An issue already there stays as it is. Why Jira did not take the move; None where the issue has the status."""
|
||||
def status_of(site: str, key: str, authorization: str, http: Http) -> str | Failure:
|
||||
"""The name of the status the issue named key has now, read from the issue itself, since a search may lag behind a move."""
|
||||
answered: typing.Any = http("GET", f"{site}/rest/api/3/issue/{key}?fields=status", authorization, None)
|
||||
if isinstance(answered, Failure):
|
||||
return Failure(f"cannot read {key} to move it: {answered.reason}")
|
||||
try:
|
||||
now = str(answered["fields"]["status"]["name"])
|
||||
return str(answered["fields"]["status"]["name"])
|
||||
except (KeyError, TypeError) as failure:
|
||||
return Failure(unshaped(key, failure))
|
||||
|
||||
|
||||
def moved_to(site: str, key: str, status: str, authorization: str, http: Http) -> Failure | None:
|
||||
"""Moves the issue named key to the status named status, in upper or lower case, by the first transition to that status the issue's workflow offers. An issue already there stays as it is. Why Jira did not take the move; None where the issue has the status."""
|
||||
now = status_of(site, key, authorization, http)
|
||||
if isinstance(now, Failure):
|
||||
return now
|
||||
if now.casefold() == status.casefold():
|
||||
return None
|
||||
offered = http("GET", f"{site}/rest/api/3/issue/{key}/transitions", authorization, None)
|
||||
@@ -29,3 +36,25 @@ def moved_to(site: str, key: str, status: str, authorization: str, http: Http) -
|
||||
return Failure(f"{key} has no transition to the status {status!r} from its status {now!r}, " + (f"only {others}" if offers else "nor any other the account may make"))
|
||||
moved = http("POST", f"{site}/rest/api/3/issue/{key}/transitions", authorization, {"transition": {"id": leading[0]}})
|
||||
return Failure(f"cannot move {key} to {status!r}: {moved.reason}") if isinstance(moved, Failure) else None
|
||||
|
||||
|
||||
def moved_by(site: str, key: str, transition: str, to: tuple[str, ...], authorization: str, http: Http) -> str | Failure:
|
||||
"""Moves the issue named key by the transition named transition, where that transition leads to one of the statuses to. Names match in upper or lower case. An issue already at one of those statuses stays as it is. The name of the status the issue has afterwards; why the move was not made."""
|
||||
accepted = {name.casefold() for name in to}
|
||||
now = status_of(site, key, authorization, http)
|
||||
if isinstance(now, Failure) or now.casefold() in accepted:
|
||||
return now
|
||||
offered = http("GET", f"{site}/rest/api/3/issue/{key}/transitions", authorization, None)
|
||||
if isinstance(offered, Failure):
|
||||
return Failure(f"cannot read {key}'s transitions: {offered.reason}")
|
||||
offers = offers_of(offered, key)
|
||||
if isinstance(offers, Failure):
|
||||
return offers
|
||||
named = [(id_, to) for id_, name, to, _ in offers if name.casefold() == transition.casefold()]
|
||||
if not named:
|
||||
others = " and ".join(f"{name!r} to {to!r}" for _, name, to, _ in offers)
|
||||
return Failure(f"{key} has no transition {transition!r} from its status {now!r}, " + (f"only {others}" if offers else "nor any other the account may make"))
|
||||
if named and named[0][1].casefold() not in accepted:
|
||||
return Failure(f"the transition {transition!r} leads {key} to the status {named[0][1]!r}, not to {' or '.join(repr(name) for name in to)}")
|
||||
moved = http("POST", f"{site}/rest/api/3/issue/{key}/transitions", authorization, {"transition": {"id": named[0][0]}})
|
||||
return Failure(f"cannot move {key} by {transition!r}: {moved.reason}") if isinstance(moved, Failure) else named[0][1]
|
||||
|
||||
@@ -73,6 +73,9 @@ class EpicStore(typing.Protocol):
|
||||
def move_issue(self, key: str, status: str) -> None | Failure:
|
||||
"""Moves the epic's child issue named key, or a sub-task of one, to the status named status, in upper or lower case; one already there stays as it is. An issue outside the epic is refused. A Failure says why the move could not be made, such as a workflow that gives no way from the issue's status to that one."""
|
||||
|
||||
def move_issue_by(self, key: str, transition: str, to: tuple[str, ...]) -> str | Failure:
|
||||
"""Moves the epic's child issue named key, or a sub-task of one, by the workflow transition named transition, where that transition leads to one of the statuses to. Names match in upper or lower case. An issue already at one of those statuses stays as it is. Answers the name of the status the issue has afterwards. An issue outside the epic is refused. A Failure says why the move was not made, such as a workflow that offers the issue no transition of that name from its status, or a transition that leads to another status."""
|
||||
|
||||
def finish_issue(self, key: str) -> None | Failure:
|
||||
"""Moves the epic's child issue named key, or a sub-task of one, to a done status, so that read answers it as done; one already done stays as it is. An issue outside the epic is refused. A Failure says why the move could not be made: the issue's workflow gives no way to a done status, gives several the backend cannot choose between, or refuses the move."""
|
||||
|
||||
|
||||
@@ -190,6 +190,8 @@ class Case(unittest.TestCase):
|
||||
|
||||
|
||||
class JiraEpicContract(Case, EpicStoreContract):
|
||||
transition = "Mark as done"
|
||||
|
||||
def assign(self, store: JiraEpic, key: str, name: str) -> None: # type: ignore[override]
|
||||
self.jira.change(key, assignee={"accountId": "5b10a2844c20165700ede21g", "displayName": name})
|
||||
|
||||
@@ -407,6 +409,54 @@ class Jira(Case):
|
||||
self.assertIsNone(store.move_issue(key, "Code Review"))
|
||||
self.assertEqual(self.jira.transitioned, ["51"])
|
||||
|
||||
def test_moves_an_issue_by_the_transition_named_in_any_case_and_answers_the_status_it_leads_to(self) -> None:
|
||||
store = self.new_store()
|
||||
key = store.file("ABC-12", "Count the runs.", "", ())
|
||||
ready = {"name": "Release Ready", "statusCategory": {"key": "indeterminate"}}
|
||||
self.jira.workflow = [{"id": "31", "name": "Mark as done", "to": DONE}, {"id": "61", "name": "Ready for release", "to": ready}]
|
||||
self.assertEqual(store.move_issue_by(key, "ready for release", ("Teach & Learn", "RELEASE READY")), "Release Ready")
|
||||
self.assertEqual((self.jira.transitioned, self.jira.issues[0]["fields"]["status"]), (["61"], ready)) # type: ignore[index]
|
||||
|
||||
def test_an_issue_already_at_a_status_the_transition_may_lead_to_stays_as_it_is(self) -> None:
|
||||
store = self.new_store()
|
||||
key = store.file("ABC-12", "Count the runs.", "", ())
|
||||
self.jira.issues[0]["fields"]["status"] = {"name": "Release Ready", "statusCategory": {"key": "indeterminate"}} # type: ignore[index]
|
||||
self.assertEqual(store.move_issue_by(key, "Mark as done", ("Done", "release ready")), "Release Ready")
|
||||
self.assertEqual(self.jira.transitioned, [])
|
||||
|
||||
def test_a_transition_that_leads_to_another_status_than_those_asked_for_is_not_made(self) -> None:
|
||||
store = self.new_store()
|
||||
key = store.file("ABC-12", "Count the runs.", "", ())
|
||||
self.assertEqual(store.move_issue_by(key, "Mark as done", ("Release Ready", "Teach & Learn")), Failure(f"the transition 'Mark as done' leads {key} to the status 'Done', not to 'Release Ready' or 'Teach & Learn'"))
|
||||
self.assertEqual(self.jira.transitioned, [])
|
||||
|
||||
def test_a_transition_the_workflow_does_not_offer_fails_naming_what_it_offers(self) -> None:
|
||||
store = self.new_store()
|
||||
key = store.file("ABC-12", "Count the runs.", "", ())
|
||||
self.assertEqual(store.move_issue_by(key, "Release Ready", ("Release Ready",)), Failure(f"{key} has no transition 'Release Ready' from its status 'To Do', only 'Mark as done' to 'Done'"))
|
||||
self.jira.workflow.append({"id": "11", "name": "Start", "to": {"name": "In Progress", "statusCategory": {"key": "indeterminate"}}})
|
||||
self.assertEqual(store.move_issue_by(key, "Release Ready", ("Release Ready",)), Failure(f"{key} has no transition 'Release Ready' from its status 'To Do', only 'Mark as done' to 'Done' and 'Start' to 'In Progress'"))
|
||||
self.jira.workflow = []
|
||||
self.assertEqual(store.move_issue_by(key, "Release Ready", ("Release Ready",)), Failure(f"{key} has no transition 'Release Ready' from its status 'To Do', nor any other the account may make"))
|
||||
self.assertEqual(self.jira.transitioned, [])
|
||||
|
||||
def test_a_move_by_a_transition_that_jira_refuses_or_cannot_be_read_fails_with_the_reason(self) -> None:
|
||||
store = self.new_store()
|
||||
key = store.file("ABC-12", "Count the runs.", "", ())
|
||||
self.jira.issues.append({"key": "ABC-61", "fields": {"summary": "Other.", "description": None, "labels": [], "assignee": None, "status": TO_DO, "parent": None, "issuelinks": []}})
|
||||
self.assertEqual(store.move_issue_by("ABC-61", "Mark as done", ("Done",)), Failure("ABC-61 is not one of the child issues of the epic ABC-12, so it cannot be moved"))
|
||||
transitions = f"{ISSUES}/{key}/transitions"
|
||||
self.jira.answers = {("POST", transitions): Failure("Jira answered 400")}
|
||||
self.assertEqual(store.move_issue_by(key, "Mark as done", ("Done",)), Failure(f"cannot move {key} by 'Mark as done': Jira answered 400"))
|
||||
self.jira.answers = {("GET", transitions): Failure("Jira answered 503")}
|
||||
self.assertEqual(store.move_issue_by(key, "Mark as done", ("Done",)), Failure(f"cannot read {key}'s transitions: Jira answered 503"))
|
||||
self.jira.answers = {("GET", transitions): {"transitions": [{"id": "31"}]}}
|
||||
self.assertEqual(store.move_issue_by(key, "Mark as done", ("Done",)), Failure(f"Jira answered {key}'s transitions in a shape other than the one it documents"))
|
||||
self.jira.answers = {("GET", f"{ISSUES}/{key}?fields=parent,status"): Failure("Jira answered 503")}
|
||||
self.assertEqual(store.move_issue_by(key, "Mark as done", ("Done",)), Failure(f"cannot read {key} to move it: Jira answered 503"))
|
||||
self.jira.answers = {("GET", f"{ISSUES}/{key}?fields=status"): Failure("Jira answered 502")}
|
||||
self.assertEqual(store.move_issue_by(key, "Mark as done", ("Done",)), Failure(f"cannot read {key} to move it: Jira answered 502"))
|
||||
|
||||
def test_a_move_the_workflow_does_not_offer_fails_naming_what_it_offers(self) -> None:
|
||||
store = self.new_store()
|
||||
key = store.file("ABC-12", "Count the runs.", "", ())
|
||||
|
||||
@@ -55,9 +55,10 @@ AUTOMATION_MOVES = "jira-automation-moves-issues"
|
||||
# Three readers, seated as those who write and read this config, picked `jira-pull-request-open-status` from four candidates, 2-1, and the merged status's name was spelt to pair with it. Each names a status, not a transition as `jira-start-transition` does: do-epic takes whichever transition leads there.
|
||||
PULL_OPEN_STATUS = "jira-pull-request-open-status"
|
||||
PULL_MERGED_STATUS = "jira-pull-request-merged-status"
|
||||
SUB_TASKS_LANDED_TRANSITION = "jira-sub-tasks-landed-transition"
|
||||
SUB_TASK_SUMMARY = "sub-task-summary"
|
||||
ISSUE_TYPES = (JIRA_FINDING_TYPE, JIRA_REVIEW_TYPE)
|
||||
OPTIONAL = (CLONE_FOLDER, LANGUAGE, *JIRA_FINISH, START_TRANSITION, SPRINT_BOARD, UNBLOCKING_STATUSES, AUTOMATION_MOVES, PULL_OPEN_STATUS, PULL_MERGED_STATUS, LABEL_REPOS, SUB_TASK_SUMMARY, *ISSUE_TYPES)
|
||||
OPTIONAL = (CLONE_FOLDER, LANGUAGE, *JIRA_FINISH, START_TRANSITION, SPRINT_BOARD, UNBLOCKING_STATUSES, AUTOMATION_MOVES, PULL_OPEN_STATUS, PULL_MERGED_STATUS, SUB_TASKS_LANDED_TRANSITION, LABEL_REPOS, SUB_TASK_SUMMARY, *ISSUE_TYPES)
|
||||
LISTED = f"The settings are {', '.join(SETTINGS)}, and optionally {listed(OPTIONAL, 'and')}."
|
||||
|
||||
|
||||
@@ -86,6 +87,8 @@ class DoEpicConfig:
|
||||
finding_type: str = DEFAULT_ISSUE_TYPE
|
||||
review_type: str = DEFAULT_ISSUE_TYPE
|
||||
start: Start = Start()
|
||||
# The SUB_TASKS_LANDED_TRANSITION transition, which `parent_moves` moves a parent by; None where the config doesn't name it.
|
||||
sub_tasks_landed_transition: str | None = None
|
||||
|
||||
|
||||
def label_repo_faults(table: object) -> list[str]:
|
||||
@@ -127,12 +130,12 @@ def start_faults(values: dict[str, object]) -> list[str]:
|
||||
]
|
||||
|
||||
|
||||
def pull_status_faults(values: dict[str, object]) -> list[str]:
|
||||
"""What is wrong with the PULL_OPEN_STATUS and PULL_MERGED_STATUS settings in values."""
|
||||
def jira_name_faults(values: dict[str, object]) -> list[str]:
|
||||
"""What is wrong with the PULL_OPEN_STATUS, PULL_MERGED_STATUS and SUB_TASKS_LANDED_TRANSITION settings in values."""
|
||||
merged, unblocking = name_of(values.get(PULL_MERGED_STATUS)), values.get(UNBLOCKING_STATUSES, [])
|
||||
listed_statuses = [status.casefold() for status in unblocking if isinstance(status, str)] if isinstance(unblocking, list) else []
|
||||
return [
|
||||
*(f"`{name}` is {values[name]!r}, not the name Jira shows, such as \"{example}\"" for name, example in ((PULL_OPEN_STATUS, "Code Review"), (PULL_MERGED_STATUS, "Release Ready")) if name in values and not name_of(values[name])),
|
||||
*(f"`{name}` is {values[name]!r}, not the name Jira shows, such as \"{example}\"" for name, example in ((PULL_OPEN_STATUS, "Code Review"), (PULL_MERGED_STATUS, "Release Ready"), (SUB_TASKS_LANDED_TRANSITION, "Release Ready")) if name in values and not name_of(values[name])),
|
||||
*([f"`{PULL_MERGED_STATUS}` is {merged!r}, so `{UNBLOCKING_STATUSES}` must list it: an issue at any other status reads as open, and its chunk would start again"] if merged and merged.casefold() not in listed_statuses else []),
|
||||
]
|
||||
|
||||
@@ -180,7 +183,7 @@ def load(home: pathlib.Path, ladder_file: pathlib.Path = SHIPPED) -> DoEpicConfi
|
||||
*finish_faults(values),
|
||||
*workflow_faults(values),
|
||||
*start_faults(values),
|
||||
*pull_status_faults(values),
|
||||
*jira_name_faults(values),
|
||||
*(summary_template_faults(values[SUB_TASK_SUMMARY]) if SUB_TASK_SUMMARY in values else []),
|
||||
*label_repo_faults(values.get(LABEL_REPOS, {})),
|
||||
*(f"`{name}` is {values[name]!r}, {fault}" for name, example in zip(ISSUE_TYPES, ("Feature", "Chore")) if name in values and (fault := type_fault(values[name], example))),
|
||||
@@ -199,4 +202,4 @@ def load(home: pathlib.Path, ladder_file: pathlib.Path = SHIPPED) -> DoEpicConfi
|
||||
finding_type, review_type = (str(values.get(name, DEFAULT_ISSUE_TYPE)) for name in ISSUE_TYPES)
|
||||
board = values.get(SPRINT_BOARD)
|
||||
assert board is None or isinstance(board, int)
|
||||
return DoEpicConfig(folder, url, env_file, clone_folder, language, model, rule, finish_of(values), types.MappingProxyType(labels), tuple(statuses), values.get(AUTOMATION_MOVES) is True, name_of(values.get(PULL_OPEN_STATUS)), name_of(values.get(PULL_MERGED_STATUS)), template, finding_type, review_type, Start(name_of(values.get(START_TRANSITION)), board))
|
||||
return DoEpicConfig(folder, url, env_file, clone_folder, language, model, rule, finish_of(values), types.MappingProxyType(labels), tuple(statuses), values.get(AUTOMATION_MOVES) is True, name_of(values.get(PULL_OPEN_STATUS)), name_of(values.get(PULL_MERGED_STATUS)), template, finding_type, review_type, Start(name_of(values.get(START_TRANSITION)), board), name_of(values.get(SUB_TASKS_LANDED_TRANSITION)))
|
||||
|
||||
+22
-7
@@ -1,6 +1,6 @@
|
||||
"""The do-epic command (docs/decisions.md → `do-epic: drives one Jira epic …`).
|
||||
|
||||
`do-epic <EPIC-KEY>` first plans the epic's open issues (`planning`): each that no label places is split by repo or gets its pick, and the scored issues do-epic filed are re-ranked. Then it starts each of the epic's chunks that may start now, each in a window of the epic's tmux session, as `scheduler` picks them, and puts that session on the terminal. Each window runs `do-epic --chunk <ISSUE-KEY> <EPIC-KEY>`: the cycles of one issue's chunk, run by the code that runs loop-claude's (`agent_cycle`), until the judge rules it finished. Then it starts the chunks that may start now, and its window closes. The window of a human's task runs no cycle: it waits until the task no longer holds up an issue (`human_tasks`), then does the same.
|
||||
`do-epic <EPIC-KEY>` first plans the epic's open issues (`planning`): each that no label places is split by repo or gets its pick, and the scored issues do-epic filed are re-ranked. Then it moves each parent whose sub-tasks a person filed, where those sub-tasks have landed or are done (`parent_moves`). Then it starts each of the epic's chunks that may start now, each in a window of the epic's tmux session, as `scheduler` picks them, and puts that session on the terminal. Each window runs `do-epic --chunk <ISSUE-KEY> <EPIC-KEY>`: the cycles of one issue's chunk, run by the code that runs loop-claude's (`agent_cycle`), until the judge rules it finished. Then it starts the chunks that may start now, and its window closes. The window of a human's task runs no cycle: it waits until the task no longer holds up an issue (`human_tasks`), then does the same.
|
||||
|
||||
After each cycle of a chunk in a repo, the window reads what the chunk's pull request waits on (`gates`). While that is a gate only time or a person passes, the chunk is parked (`parked`): the window frees its running slot and polls the forge, and the chunk's next cycle starts once the worker has something to do and a slot is free. `do-epic <EPIC-KEY> --status` prints what each open issue does."""
|
||||
import dataclasses
|
||||
@@ -11,7 +11,7 @@ import typing
|
||||
|
||||
from chunk_driver.cycle_start import announced_route, cycle_of, project_routing, routing_on
|
||||
from chunk_driver.claims import CHUNK_FLAG
|
||||
from do_epic import chunk_prompt, dry_run, findings, finish, gates, human_tasks, parked, planning, scheduler, split, status
|
||||
from do_epic import chunk_prompt, dry_run, findings, finish, gates, human_tasks, parent_moves, parked, planning, scheduler, split, status
|
||||
from chunk_driver.chunk_run import ChunkRun, closed_cycle
|
||||
from do_epic.repo_pick import ClaudeWork, HumanTask, recorded, Repo
|
||||
from project_config.main import located as config_located
|
||||
@@ -53,7 +53,7 @@ Before it starts chunks, do-epic <EPIC-KEY> plans each open issue that has none
|
||||
`repo:<name>` for its repo, `do-epic-claude` for work of Claude's that changes no repo, `do-epic-human` for a task of yours.
|
||||
A label that `[label-repos]` in config.toml maps to a repo counts as that repo's.
|
||||
Where such an issue changes several repos, it files a sub-task per repo. Otherwise it gives the issue its label, as repo-rule.md says.
|
||||
An issue under which a person filed a sub-task is not planned: its sub-tasks run, each needs a label of its own, and you close the issue in Jira.
|
||||
An issue under which a person filed a sub-task is not planned: its sub-tasks run, each needs a label of its own, and do-epic moves the issue once they have landed or are done, as config.toml names how.
|
||||
Where the rule leaves the label unclear, it asks you on the terminal. Answer with the label, or with Enter alone to leave the issue waiting.
|
||||
Where two or more issues may start, it then scores each of them that holds no scores, and tells the issue's team the scores in a comment on the issue. It scores by the `Score = ...` line under the epic's ## Scoring, and moves the issues do-epic itself filed into that order on the board.
|
||||
An open issue labelled `repo:<name>` or `do-epic-claude` runs as a chunk once no issue blocks it.
|
||||
@@ -67,7 +67,7 @@ on once the checks pass, the approval comes or a reviewer comments, and a place
|
||||
name says `awaits a slot`. In a repo whose config sets `merge = "human"`, a chunk never merges: once its pull
|
||||
request is ready, with nothing else to wait on, the window's name says `awaits your merge`, and its worker goes on once you merged it. A parked chunk survives a reboot: run do-epic <EPIC-KEY> again to go on polling.
|
||||
--status doesn't start any chunk. It prints a line per open issue: that its chunk runs or asks you a question, or why it waits, such as the gate a parked chunk awaits and since when.
|
||||
--dry-run runs the planning and the scheduling against the epic as Jira holds it. It doesn't write anything to Jira, start a window or ask a question, and it doesn't start any issue in Jira as a real run's chunk does. It prints each label, sub-task, comment, score and rank move that planning would write, the order the issues would start in, each chunk that would start and why each other issue waits. A sub-task not yet filed shows a key such as ABC-new1. A question planning would ask is printed instead of asked. Planning's claude calls still run.
|
||||
--dry-run runs the planning and the scheduling against the epic as Jira holds it. It doesn't write anything to Jira, start a window or ask a question, and it doesn't start any issue in Jira as a real run's chunk does. It prints each label, sub-task, comment, score and rank move that planning would write, each move of a parent issue whose sub-tasks a person filed, the order the issues would start in, each chunk that would start and why each other issue waits. A sub-task not yet filed shows a key such as ABC-new1. A question planning would ask is printed instead of asked. Planning's claude calls still run.
|
||||
A repo that is missing isn't cloned. Planning then stops there, so its writes are only those made before it, and the issues of that repo wait, and a chunk of another repo may start in the place a real run gives them; a real run would clone it and go on.
|
||||
{findings.HELP}
|
||||
{finish.HELP}
|
||||
@@ -195,7 +195,9 @@ def planned_and_started(epic: EpicRun, dry: bool = False) -> scheduler.Started |
|
||||
read = epic.store.read()
|
||||
if isinstance(read, Failure):
|
||||
return Stop(1, read.reason)
|
||||
issues, stopped = planning.planned(planned_epic(epic), read)
|
||||
planned, stopped = planning.planned(planned_epic(epic), read)
|
||||
# After the planning, which reads the epic again and would drop a move a search doesn't show yet.
|
||||
issues = parents_moved(epic, planned)
|
||||
if isinstance(stopped, Limited):
|
||||
return Stop(1, f"the epic is not planned, so no chunk started: {stopped.said}")
|
||||
if stopped is not None:
|
||||
@@ -534,7 +536,7 @@ class Landed(enum.Enum):
|
||||
|
||||
|
||||
def handed_on(key: str, epic: EpicRun, landed: Landed = Landed.NOWHERE) -> 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 whose work landed on the default branch, from its pull request: the stop waits for that move (`moved_by_automation`). The human moves their own task: the stop doesn't move or await anything. 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. The automation doesn't see a pull request that merged into an epic's working branch: the stop moves that chunk's issue to the status `jira-pull-request-merged-status` names. Where none is named, it moves the issue to done, or stops where the automation moves issues, since then nobody would move it. do-epic's window closes as it exits."""
|
||||
"""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 parent too where the parent's sub-tasks now let it move (`parents_settled`), 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 whose work landed on the default branch, from its pull request: the stop waits for that move (`moved_by_automation`). The human moves their own task: the stop doesn't move or await anything. 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. The automation doesn't see a pull request that merged into an epic's working branch: the stop moves that chunk's issue to the status `jira-pull-request-merged-status` names. Where none is named, it moves the issue to done, or stops where the automation moves issues, since then nobody would move it. do-epic's 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 (landed is Landed.WITH_A_HUMAN and automated):
|
||||
@@ -562,7 +564,7 @@ def handed_on(key: str, epic: EpicRun, landed: Landed = Landed.NOWHERE) -> Stop:
|
||||
issues = issues if isinstance(issues, Failure) else [dataclasses.replace(each, done=True) if each.key == key else each for each in issues]
|
||||
if isinstance(issues, Failure):
|
||||
return Stop(1, f"the chunk finished, but the next could not start: {issues.reason}")
|
||||
closed = split_items_closed(epic, issues)
|
||||
closed = parents_settled(epic, issues)
|
||||
if isinstance(closed, Stop):
|
||||
return closed
|
||||
started = chunks_started(epic, closed, key)
|
||||
@@ -592,6 +594,19 @@ def moved_by_automation(key: str, epic: EpicRun) -> list[EpicIssue]:
|
||||
epic.effects.sleep(POLL_SECONDS)
|
||||
|
||||
|
||||
def parents_moved(epic: EpicRun, issues: list[EpicIssue]) -> list[EpicIssue]:
|
||||
"""The issues as they read once `parent_moves.moved` has moved each parent whose sub-tasks a person filed; a search may not show those moves yet. A move that was not made is said, and the run goes on: the parent holds back only what it blocks."""
|
||||
issues, refused = parent_moves.moved(epic.store, issues, epic.config.unblocking, epic.config.sub_tasks_landed_transition, epic.config.finish is not None)
|
||||
for reason in refused:
|
||||
say(reason, epic.effects, stdout=True)
|
||||
return issues
|
||||
|
||||
|
||||
def parents_settled(epic: EpicRun, issues: list[EpicIssue]) -> list[EpicIssue] | Stop:
|
||||
"""The issues once each parent has moved as its sub-tasks let it: one whose sub-tasks a person filed (`parents_moved`), then one do-epic split (`split_items_closed`); the stop where a split item cannot move."""
|
||||
return split_items_closed(epic, parents_moved(epic, issues))
|
||||
|
||||
|
||||
def split_items_closed(epic: EpicRun, issues: list[EpicIssue]) -> list[EpicIssue] | Stop:
|
||||
"""The issues, with each item split by repo whose sub-tasks are all done moved to done in the tracker and read as done; the stop where one cannot move. Its last sub-task to finish closes it, and one an earlier run left open closes with it."""
|
||||
for item in issues:
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
"""Moves a parent issue whose sub-tasks a person filed, once those sub-tasks have landed or are done. Until the parent moves, every issue it blocks waits, and nobody else moves it: the team's automation sees a pull request only on the sub-task that carries it. `main.split_items_closed` closes an item that do-epic split itself."""
|
||||
import dataclasses
|
||||
|
||||
from do_epic.backend.protocol import EpicIssue, EpicStore
|
||||
from failure import Failure
|
||||
from do_epic.split import SPLIT_LABEL
|
||||
from do_epic.config import SUB_TASKS_LANDED_TRANSITION
|
||||
from do_epic.scheduler import unblocks
|
||||
|
||||
|
||||
def moved(store: EpicStore, issues: list[EpicIssue], unblocking: tuple[str, ...], landed_by: str | None, finishes: bool) -> tuple[list[EpicIssue], list[str]]:
|
||||
"""The issues as they read once each parent has moved, and why each move that failed was not made. A parent that did not move holds back only itself, so the others still move.
|
||||
|
||||
A parent whose sub-tasks are all done moves to done, where finishes says the config names how. One whose sub-tasks have all landed, each done or at one of the unblocking statuses, moves by the transition landed_by names, where the config names one and it leads to one of those statuses. A parent that is done, or has landed itself, never moves back. One without a sub-task, or with one still open, stays as it is."""
|
||||
refused: list[str] = []
|
||||
for parent in issues:
|
||||
tasks = [task for task in issues if task.parent == parent.key]
|
||||
# A sub-task do-epic filed under an item it didn't mark is a split that failed halfway, which the next run completes.
|
||||
if parent.done or SPLIT_LABEL in parent.labels or all(task.by_loop for task in tasks):
|
||||
continue
|
||||
if all(task.done for task in tasks):
|
||||
done = store.finish_issue(parent.key) if finishes else None
|
||||
if isinstance(done, Failure):
|
||||
refused.append(f"{parent.key}'s sub-tasks are all done, but it did not move to done: {done.reason}; close it in Jira")
|
||||
elif finishes:
|
||||
issues = [dataclasses.replace(each, done=True) if each.key == parent.key else each for each in issues]
|
||||
elif landed_by and not unblocks(parent.status, unblocking) and all(task.done or unblocks(task.status, unblocking) for task in tasks):
|
||||
status = store.move_issue_by(parent.key, landed_by, unblocking)
|
||||
if isinstance(status, Failure):
|
||||
refused.append(f"{parent.key}'s sub-tasks have all landed, but it did not move by {landed_by!r}, the transition `{SUB_TASKS_LANDED_TRANSITION}` names: {status.reason}; move it in Jira")
|
||||
else:
|
||||
issues = [dataclasses.replace(each, status=status) if each.key == parent.key else each for each in issues]
|
||||
return issues, refused
|
||||
@@ -113,7 +113,7 @@ def task_summary(repo: str, summary: str, team: LabelRepos, template: str | None
|
||||
|
||||
|
||||
def finished(issues: list[EpicIssue], key: str) -> bool:
|
||||
"""Whether the item named key is done. An item marked SPLIT_LABEL that has sub-tasks is done once each of them is, whatever its own status. Any other item is done by its own status, also one a person's sub-tasks split: do-epic filed those for every repo the item changes, and a person's may cover only a part of it. A key no issue has isn't done."""
|
||||
"""Whether the item named key is done. An item marked SPLIT_LABEL that has sub-tasks is done once each of them is, whatever its own status. Any other item is done by its own status, also one under which a person filed sub-tasks: `parent_moves` moves that item to done once every sub-task is done. A key no issue has isn't done."""
|
||||
item = next((issue for issue in issues if issue.key == key), None)
|
||||
tasks = [issue for issue in issues if issue.parent == key]
|
||||
if item is None:
|
||||
|
||||
@@ -128,6 +128,18 @@ class ConfigTest(unittest.TestCase):
|
||||
self.write(SETTINGS + f'jira-start-transition = " "\njira-sprint-board = {board}\n')
|
||||
self.assertIn(f"`jira-start-transition` is ' ', not the name Jira shows, such as \"In Progress\"; `jira-sprint-board` is {read}, not a board's ID, the whole number in the board's address, such as 6", self.failure())
|
||||
|
||||
def test_reads_the_transition_that_moves_a_parent_whose_sub_tasks_have_all_landed(self) -> None:
|
||||
self.write(SETTINGS)
|
||||
found = load(self.home)
|
||||
assert isinstance(found, DoEpicConfig), found
|
||||
self.assertIsNone(found.sub_tasks_landed_transition)
|
||||
self.write(SETTINGS + 'jira-sub-tasks-landed-transition = "Release Ready"\n')
|
||||
found = load(self.home)
|
||||
assert isinstance(found, DoEpicConfig), found
|
||||
self.assertEqual(found.sub_tasks_landed_transition, "Release Ready")
|
||||
self.write(SETTINGS + 'jira-sub-tasks-landed-transition = 5\n')
|
||||
self.assertIn("`jira-sub-tasks-landed-transition` is 5, not the name Jira shows, such as \"Release Ready\"", self.failure())
|
||||
|
||||
def test_reads_the_unblocking_statuses_and_that_the_teams_automation_moves_issues(self) -> None:
|
||||
self.write(SETTINGS)
|
||||
found = load(self.home)
|
||||
|
||||
@@ -513,6 +513,29 @@ class AChunksRun(DoEpicTest):
|
||||
self.assertEqual({each.key: each.done for each in store.issues}, {"ABC-20": False, "ABC-21": True, "ABC-23": True, "ABC-24": True, "ABC-22": False})
|
||||
self.assertIn("the chunk finished; started ABC-22\n", out)
|
||||
|
||||
def test_the_last_sub_task_a_person_filed_to_finish_moves_its_parent_to_done_and_starts_what_it_blocks(self) -> None:
|
||||
(self.home / ".claude-projects" / "do-epic" / "config.toml").write_text(SETTINGS + 'jira-finish-transition = "Mark as done"\njira-finish-status = "Done"\n', encoding="utf-8")
|
||||
tasks = [issue("ABC-23", "do-epic-claude", parent="ABC-21"), issue("ABC-24", "do-epic-claude", parent="ABC-21", done=True)]
|
||||
store = MemoryEpic("ABC-12", [self.issues[0], issue("ABC-21"), *tasks, issue("ABC-22", "do-epic-claude", blockers=("ABC-21",))])
|
||||
self.backend = lambda config, key: (store, EpicRecord(Description(self.description))) # type: ignore[method-assign,arg-type]
|
||||
fake = FakeEffects(streams=[self.worker()], claude=[judged("finished")], git=UNREAD, windows="ABC-23\t0\t@9\n")
|
||||
code, out, err = self.run_main(["--chunk", "ABC-23", "ABC-12"], fake, MODELS)
|
||||
self.assertEqual(code, 0, err)
|
||||
self.assertEqual({each.key: each.done for each in store.issues}, {"ABC-20": False, "ABC-21": True, "ABC-23": True, "ABC-24": True, "ABC-22": False})
|
||||
self.assertIn("the chunk finished; started ABC-22\n", out)
|
||||
|
||||
def test_a_parent_jira_will_not_move_is_said_and_the_next_chunk_still_starts(self) -> None:
|
||||
(self.home / ".claude-projects" / "do-epic" / "config.toml").write_text(SETTINGS + 'jira-finish-transition = "Mark as done"\njira-finish-status = "Done"\n', encoding="utf-8")
|
||||
store = MemoryEpic("ABC-12", [self.issues[0], issue("ABC-21"), issue("ABC-23", "do-epic-claude", parent="ABC-21"), issue("ABC-22", "do-epic-claude")])
|
||||
finish = store.finish_issue
|
||||
store.finish_issue = lambda key: Failure("no way to done") if key == "ABC-21" else finish(key) # type: ignore[method-assign]
|
||||
self.backend = lambda config, key: (store, EpicRecord(Description(self.description))) # type: ignore[method-assign,arg-type]
|
||||
fake = FakeEffects(streams=[self.worker()], claude=[judged("finished")], git=UNREAD, windows="ABC-23\t0\t@9\n")
|
||||
code, out, err = self.run_main(["--chunk", "ABC-23", "ABC-12"], fake, MODELS)
|
||||
self.assertEqual(code, 0, err)
|
||||
self.assertIn("ABC-21's sub-tasks are all done, but it did not move to done: no way to done; close it in Jira\n", out)
|
||||
self.assertIn("the chunk finished; started ABC-22\n", out)
|
||||
|
||||
def test_a_sub_task_that_leaves_another_open_leaves_its_split_item_open(self) -> None:
|
||||
parent = issue("ABC-21", "split-by-repo")
|
||||
store = MemoryEpic("ABC-12", [self.issues[0], parent, issue("ABC-23", "do-epic-claude", parent="ABC-21"), issue("ABC-24", "do-epic-claude", parent="ABC-21")])
|
||||
@@ -1285,6 +1308,14 @@ class TheDryRun(DoEpicTest):
|
||||
changing = {"new-session", "new-window", "kill-window", "set-option", "rename-window"}
|
||||
self.assertEqual([args for args in fake.tmux_calls if args[0] in changing], [])
|
||||
|
||||
def test_prints_each_move_of_a_parent_whose_sub_tasks_a_person_filed(self) -> None:
|
||||
(self.home / ".claude-projects" / "do-epic" / "config.toml").write_text(SETTINGS + 'jira-unblocking-statuses = ["Release Ready"]\njira-sub-tasks-landed-transition = "Release Ready"\njira-finish-transition = "Mark as done"\njira-finish-status = "Done"\n', encoding="utf-8")
|
||||
self.issues = [issue("ABC-20", status="In Progress"), issue("ABC-30", "do-epic-claude", parent="ABC-20", status="Release Ready"), issue("ABC-21"), issue("ABC-31", "do-epic-claude", parent="ABC-21", done=True), issue("ABC-22", "do-epic-claude", blockers=("ABC-20",))]
|
||||
code, out, err = self.run_main(["ABC-12", "--dry-run"], FakeEffects())
|
||||
self.assertEqual((code, err), (0, ""))
|
||||
self.assertIn("planning would write to Jira:\n- move ABC-20 by Release Ready\n- finish ABC-21\nwould start ABC-22\n", out.replace("<1790000000> ", ""))
|
||||
self.assertEqual(self.stores[0].writes, [])
|
||||
|
||||
def test_prints_the_label_a_pick_would_give_an_issue(self) -> None:
|
||||
self.issues = [issue("ABC-20")]
|
||||
code, out, _ = self.run_main(["ABC-12", "--dry-run"], FakeEffects(claude=[structured({"parts": []}), structured({"pick": "claude"})]))
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
import dataclasses
|
||||
import pathlib
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from do_epic.backend.protocol import EpicIssue
|
||||
from failure import Failure
|
||||
from do_epic.test_scheduler import issue
|
||||
from do_epic.backend.fake import MemoryEpic
|
||||
from do_epic.parent_moves import moved
|
||||
|
||||
UNBLOCKING = ("Release Ready", "Teach & Learn")
|
||||
|
||||
|
||||
def family(*tasks: EpicIssue, parent: EpicIssue | None = None) -> list[EpicIssue]:
|
||||
"""ABC-20, or parent in its place, followed by tasks as its sub-tasks."""
|
||||
above = parent or issue("ABC-20", status="In Progress")
|
||||
return [above, *(dataclasses.replace(task, parent=above.key) for task in tasks)]
|
||||
|
||||
|
||||
class MovingAParentWhoseSubTasksAPersonFiled(unittest.TestCase):
|
||||
def moves(self, issues: list[EpicIssue], landed_by: str | None = "Release Ready", finishes: bool = True) -> tuple[list[str], dict[str, tuple[str, bool]], list[str]]:
|
||||
"""The writes moved made, each issue's status and whether it is done as moved answers them, and the reasons it gave."""
|
||||
store = MemoryEpic("ABC-12", list(issues))
|
||||
after, refused = moved(store, issues, UNBLOCKING, landed_by, finishes)
|
||||
return store.writes, {each.key: (each.status, each.done) for each in after}, refused
|
||||
|
||||
def test_sub_tasks_that_have_all_landed_move_their_parent_by_the_landed_transition(self) -> None:
|
||||
for tasks in ([issue("ABC-30", status="Release Ready"), issue("ABC-31", status="teach & learn")], [issue("ABC-30", status="Release Ready"), issue("ABC-31", done=True)]):
|
||||
with self.subTest(tasks=tasks):
|
||||
writes, after, refused = self.moves(family(*tasks))
|
||||
self.assertEqual((writes, refused), (["move ABC-20 by Release Ready"], []))
|
||||
self.assertEqual(after["ABC-20"], ("Release Ready", False))
|
||||
|
||||
def test_sub_tasks_that_are_all_done_finish_their_parent(self) -> None:
|
||||
for status in ("In Progress", "Release Ready"):
|
||||
with self.subTest(status=status):
|
||||
writes, after, refused = self.moves(family(issue("ABC-30", done=True), issue("ABC-31", done=True), parent=issue("ABC-20", status=status)))
|
||||
self.assertEqual((writes, refused), (["finish ABC-20"], []))
|
||||
self.assertTrue(after["ABC-20"][1])
|
||||
|
||||
def test_a_parent_at_or_past_the_target_stays(self) -> None:
|
||||
landed = [issue("ABC-30", status="Release Ready"), issue("ABC-31", done=True)]
|
||||
for parent in (issue("ABC-20", status="Release Ready"), issue("ABC-20", status="teach & learn"), issue("ABC-20", done=True)):
|
||||
with self.subTest(parent=parent):
|
||||
self.assertEqual(self.moves(family(*landed, parent=parent))[0], [])
|
||||
self.assertEqual(self.moves(family(issue("ABC-30", done=True), parent=issue("ABC-20", done=True)))[0], [])
|
||||
|
||||
def test_a_parent_with_no_sub_task_or_with_one_still_open_is_left_alone(self) -> None:
|
||||
self.assertEqual(self.moves(family())[0], [])
|
||||
self.assertEqual(self.moves(family(issue("ABC-30", done=True), issue("ABC-31", status="Release Ready"), issue("ABC-32", status="In Progress")))[0], [])
|
||||
|
||||
def test_without_a_landed_transition_only_the_move_to_done_happens_and_only_where_the_config_names_how(self) -> None:
|
||||
landed = family(issue("ABC-30", status="Release Ready"))
|
||||
done = family(issue("ABC-30", done=True))
|
||||
self.assertEqual(self.moves(landed, landed_by=None)[0], [])
|
||||
self.assertEqual(self.moves(done, landed_by=None)[0], ["finish ABC-20"])
|
||||
self.assertEqual(self.moves(done, finishes=False), ([], {"ABC-20": ("In Progress", False), "ABC-30": ("Done", True)}, []))
|
||||
|
||||
def test_an_item_do_epic_split_or_half_split_is_left_to_its_own_closing(self) -> None:
|
||||
done = dataclasses.replace(issue("ABC-30", done=True), by_loop=True)
|
||||
self.assertEqual(self.moves(family(done, parent=issue("ABC-20", "split-by-repo")))[0], [])
|
||||
self.assertEqual(self.moves(family(done))[0], [])
|
||||
|
||||
def test_a_parent_with_a_sub_task_a_person_filed_beside_one_do_epic_filed_moves(self) -> None:
|
||||
ours = dataclasses.replace(issue("ABC-31", done=True), by_loop=True)
|
||||
self.assertEqual(self.moves(family(issue("ABC-30", status="Release Ready"), ours))[0], ["move ABC-20 by Release Ready"])
|
||||
self.assertEqual(self.moves(family(issue("ABC-30", done=True), ours))[0], ["finish ABC-20"])
|
||||
|
||||
def test_a_landed_transition_named_unlike_its_status_moves_the_parent_to_an_unblocking_status(self) -> None:
|
||||
writes, after, refused = self.moves(family(issue("ABC-30", status="Teach & Learn")), landed_by="Mark ready")
|
||||
self.assertEqual((writes, after["ABC-20"], refused), (["move ABC-20 by Mark ready"], ("Release Ready", False), []))
|
||||
|
||||
def test_a_move_jira_refuses_is_answered_with_its_reason_and_the_other_parents_still_move(self) -> None:
|
||||
issues = [*family(issue("ABC-30", status="Release Ready")), *family(issue("ABC-31", done=True), parent=issue("ABC-21")), *family(issue("ABC-32", done=True), parent=issue("ABC-22"))]
|
||||
store = MemoryEpic("ABC-12", list(issues))
|
||||
finish = store.finish_issue
|
||||
store.move_issue_by = lambda key, transition, to: Failure("ABC-20 has no transition 'Release Ready' from its status") # type: ignore[method-assign]
|
||||
store.finish_issue = lambda key: Failure("Jira answered 400") if key == "ABC-21" else finish(key) # type: ignore[method-assign]
|
||||
after, refused = moved(store, issues, UNBLOCKING, "Release Ready", True)
|
||||
self.assertEqual(refused, [
|
||||
"ABC-20's sub-tasks have all landed, but it did not move by 'Release Ready', the transition `jira-sub-tasks-landed-transition` names: ABC-20 has no transition 'Release Ready' from its status; move it in Jira",
|
||||
"ABC-21's sub-tasks are all done, but it did not move to done: Jira answered 400; close it in Jira",
|
||||
])
|
||||
self.assertEqual({each.key: (each.status, each.done) for each in after if each.parent == "ABC-12"}, {"ABC-20": ("In Progress", False), "ABC-21": ("To Do", False), "ABC-22": ("To Do", True)})
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
+1
-1
@@ -160,7 +160,7 @@ Valid while `~/.claude` is a checkout of this repo.
|
||||
- **Machine settings.** `~/.claude-projects/do-epic/` holds `config.toml` (the Jira site, env-file, the folder repos are cloned into, the default language, and the model for a no-repo item) and `repo-rule.md`. `repo-rule.md` is a prose instruction that says how to tell an item's repo. It is the same for every epic on the machine. On the first machine, an item's label that equals a repo's name names that repo. A `[label-repos]` table in `config.toml` maps a team's own label to a repo, so do-epic reads that label as a pick without a claude call.
|
||||
- **The epic's description is its record.** It holds `## Goals`, `## Audience`, `## Scoring` (formula and bar), `## Decisions` and a language line. do-epic writes all of it, but it changes Goals or Audience only after the human approves in an interrupt.
|
||||
- **Items live only in the epic.** A repo's own plan never mirrors them. Where `repo-rule.md` leaves an item's repo unclear, do-epic asks. An item without a repo is either Claude's work, done without a PR, or a human task; where the item doesn't say which, do-epic asks.
|
||||
- **One item, several repos.** do-epic splits such an item when it plans it, into one Jira sub-task per repo, each labelled for its repo. The parent tracks the whole change. A person's issue is split too, with a comment for the team. An item a person filed a sub-task under counts as split already: do-epic works it through the team's own sub-tasks and doesn't file any of its own. It plans no such sub-task, so one without a label waits for the team's. It never closes such an item, since a person's sub-tasks may cover only a part of it: once they are done, the item waits for the team to close it.
|
||||
- **One item, several repos.** do-epic splits such an item when it plans it, into one Jira sub-task per repo, each labelled for its repo. The parent tracks the whole change. A person's issue is split too, with a comment for the team. An item a person filed a sub-task under counts as split already: do-epic works it through the team's own sub-tasks and doesn't file any of its own. It plans no such sub-task, so one without a label waits for the team's. It moves such an item itself (lilleman's call of 2026-11-20), since every issue the item blocks waits until the item moves, and the team's automation sees a pull request only on the sub-task that carries it. Once every sub-task is done, the item moves to done. Once every sub-task has landed, each done or in one of `jira-unblocking-statuses`, the item moves by the transition `jira-sub-tasks-landed-transition` names, which must lead to one of those statuses. A move that is not made is said, and the run goes on.
|
||||
- **Ranking.** Score, then Blocked by, in one weight chain: the epic's achieve goals, then code health, then the repo's goals. Where the epic and a repo disagree, the epic wins. do-epic re-ranks the issues it filed in Jira's backlog to match. A person's issue keeps its rank there: goal 1.6 has the loop plug in without changing what the owners keep. On 2026-11-20 the human chose that the order the issues start in is do-epic's, while the board's order stays the team's: do-epic starts the open issues by score. Where two or more may start, it scores each of them that holds no scores, a person's included but not a human's task, and tells the team the scores in a comment. It never overwrites scores an issue holds. An issue that cannot be scored starts after those that can, in the backlog's order; where no order of score can be made at all, such as without the epic's formula, every issue starts in the backlog's order and do-epic says why.
|
||||
- **Releases.** An epic item has no release. It ships into its repo's unreleased work: where the repo publishes something others consume, a bullet under `CHANGELOG.md` → `## Unreleased`, or nothing where the repo's plan is in Jira. The issue is no item of the repo's plan, so the chunk's worker writes the bullet in its branch and runs `chunk-pr merge` without `--finish`.
|
||||
- **Repos.** A repo's name is its main checkout's folder name, and a project config names that checkout. A missing checkout is cloned from the host of the epic's other repos; where unsure, do-epic asks. Unsure means the other repos don't all sit under one host and owner (the same host spelt as https and as ssh counts as two), an origin can't be read or isn't an https, ssh or scp-style address, the folder to clone into holds something else, or the clone fails. A repo no config names is cloned into the clone folder, and the human is asked to write its config. Each chunk uses its repo's model, routing, and language for commits and PRs. Jira text is in the epic's language, or else the machine's default.
|
||||
|
||||
@@ -74,6 +74,11 @@ Give a reviewer without Bash `git ls-files`'s output in its prompt, since some h
|
||||
|
||||
**Reports.** Run `~/.claude/bin/larv-review reviewer-header <pass>` in the chunk's worktree, and open each prompt to an agent under `~/.claude/agents/` with what it prints; then say in a few lines what the change does and which files it touches. The command makes the chunk's review folder and writes the branch diff and the plan's listing into it. The header names that diff, the reviewer's full report, `<pass>-round-<n>.md`, in the folder, the folders of technical principles and review standards the project's config sets, the files of coding conventions where it lists any, the listing, and for architecture and stability the places too. For a reviewer whose definition starts it without `CLAUDE.md`, the header's last line names the file that holds the project principles and decision titles, which the reviewer reads first. For a relaunch one rung up, add `--rerun`: the report becomes `<pass>-round-<n>-rerun.md`, and the header names the report that asked. Before you answer a 🔴 or 🟡, read its entry: Grep the report for the finding's place, with the lines after it, rather than Read the whole report. rule-hook refuses a reviewer's Edit and MultiEdit, and any Write outside `~/.local/state/larv-review/`. Keep the folder after the merge: `review-replay` replays a round from the reports its prompt names, and `compress-archives` gzips each file 30 days after it last changed.
|
||||
|
||||
**Claimed output.** Before the Product-owner or Prose pass launches in a round, find the lines the diff adds or changes that say what a command, flag or error prints, such as "the error names the fix". In round 2, take only the lines the round's fixes changed. Those reviewers have no shell, and reading code can't show that an output holds the words a line claims.
|
||||
|
||||
- **Run.** Run each claim's command in the chunk's worktree, the way the project runs its tools (its container setup, unless its config sets `tooling-on-host`), with the input that triggers the output the line describes, such as the input that raises the error. Run only a command that leaves every file as it was, in the worktree and outside it, and sends no data out. List any other claim as `not run: <why>`.
|
||||
- **Hand over.** Write each claim into `claimed-output-round-<n>.md` in the chunk's review folder, `<n>` the round's number: its file and line, the command, the exit code and the real output, or `not run: <why>`. Add `Claimed output: <that path>` to the prompts of the Product-owner and Prose reviewers. With no claim, write no file and add no line.
|
||||
|
||||
**Precedent, then ask** — for the full scan:
|
||||
|
||||
- **Skip.** A precedent is a `docs/decisions.md` entry, or a plan item crediting the pass, that the repo held before the chunk began. Where one holds the decision this change executes, skip the pass and cite that entry or item.
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| 501 | 0.15.0 | | owner | **Ship `task-bench`, which plants a bug the tests catch at the places the comprehension seats found hardest, has Haiku fix it in a vanilla Claude Code at a base and a head, and prints for each side how often the fix passes, with its median tokens, turns, wall time and reads before it opens a file the bug is in.** | 4 | 2 | 1 | 5 | 9 | 1.1 by 5, code health by 4 | 0.6 |
|
||||
| 502 | 0.15.0 | 501 | owner | **Distil each `task-bench` run into a digest of short traces and decoys, the files most failing runs read but no fix touches, and have a stronger model turn it into plan items before the transcripts are deleted.** | 3 | 2 | 1 | 4 | 5 | 1.1 by 4, code health by 4 | 4.8 |
|
||||
| 469 | 0.15.0 | | | **Move a do-epic parent issue whose sub-tasks a person filed to Release Ready once every sub-task has landed, and to Done once every sub-task is done, by transitions its config names.** | 3 | 2 | 2 | 5 | 4 | 1.2 by 4, 1.5 by 4, 1.6 by 3 | 3.1 |
|
||||
| 503 | 0.15.0 | 502 | owner | **Calibrate `task-bench` on fejkdata: bench a head against itself for the noise floor, then one finished chunk at its base and head, and record in a decision how many tasks and runs the bench needs.** | 1 | 2 | 1 | 2 | 2 | 1.1 by 3 | 1.2 |
|
||||
| 511 | 0.15.0 | | | **Hand the product-owner and prose reviewers the real output of each command a changed doc line says prints something, so a claim about output is checked by running it, not by reading code.** | 2 | 2 | 3 | 5 | 3 | 1.1 by 3 | 1.1 |
|
||||
| 509 | 0.16.0 | 503 | owner | **Run `task-bench` beside the scoring run in larv-review comprehension check, and record its figures in the comprehension history beside the panel scores.** | 3 | 2 | 3 | 6 | 5 | code health by 5, 1.1 by 3 | 5.6 |
|
||||
| 504 | 0.16.0 | 503 | owner | **Bench new features in `task-bench`, each a spec for Haiku with acceptance tests it never sees and a reference patch that proves it can be built, kept in a `bench-tasks` folder the project config names, starting with six for fejkdata.** | 3 | 2 | 1 | 4 | 6 | 1.1 by 4, code health by 3 | 2.6 |
|
||||
| 505 | 0.16.0 | 504 | owner | **Bench adding source data in `task-bench`: hand Haiku a fake register that a seeded script generates for a made-up country, and check the importer, the data and the licence entry it adds, starting with five tasks for fejkdata.** | 3 | 2 | 1 | 4 | 5 | 1.1 by 3, code health by 2 | 2.6 |
|
||||
@@ -148,37 +146,6 @@ Touches:
|
||||
- `bin/task_bench/main.py`: `main` (small)
|
||||
- `bin/task_bench/test_task_bench.py`
|
||||
|
||||
### 469. Move a do-epic parent issue whose sub-tasks a person filed to Release Ready once every sub-task has landed, and to Done once every sub-task is done, by transitions its config names.
|
||||
|
||||
do-epic moves to done only a parent it split itself (`split_items_closed`). A parent whose sub-tasks a person filed stays as Jira holds it, and `--status` says "its sub-tasks are done; close it in Jira". Until someone moves it, the parent blocks every issue it blocks, and through it their sub-tasks. On TW-13503, TW-13505 blocks most of the critical path this way, and TW-13547's sub-tasks are all Release Ready while the parent stays In Progress. The human asked, on 2026-11-20, for deterministic code to move these parents, not a worker or a person.
|
||||
|
||||
- A parent whose sub-tasks have all landed, each in one of `jira-unblocking-statuses` or done, with at least one not yet done, moves by a transition the config names, such as `jira-landed-transition = "Release Ready"`.
|
||||
- A parent whose sub-tasks are all done moves by `jira-finish-transition`, as a split item does today.
|
||||
- do-epic moves such parents as each run plans, and after each chunk finishes, where it now closes split items. A parent already at or past the target status stays: one in a done status never moves back.
|
||||
- A parent with no sub-tasks, or with one sub-task still open, is left alone.
|
||||
- Without `jira-landed-transition`, only the move to Done happens, and only where `jira-finish-transition` is set, as today.
|
||||
- `--dry-run` prints each parent move it would make.
|
||||
|
||||
Choice, made 2026-11-20: a sub-task in any of `jira-unblocking-statuses` counts as landed, so TW's "Teach & Learn" counts as "Release Ready" does. The human named Release Ready and Done; Teach & Learn also means the work merged.
|
||||
|
||||
Release: lilleman moved it back into 0.15.0 on 2026-11-20, after dropping the plan to cut 0.15.0 early. A chunk had started it in 0.15.0 and was stopped before it committed; its naming panel picked `jira-sub-tasks-landed-transition` for the setting, 2 to 1.
|
||||
|
||||
Touches:
|
||||
|
||||
- `bin/do_epic/main.py`: `split_items_closed`, `planned_and_started` (small)
|
||||
- `bin/do_epic/planning.py`: `planned` (small)
|
||||
- `bin/do_epic/scheduler.py`: `chunks` (small)
|
||||
- `bin/do_epic/split.py`: `finished` (small)
|
||||
- `bin/do_epic/config.py`: `DoEpicConfig`, `load` (small)
|
||||
- `bin/do_epic/backend/protocol.py`: `EpicStore`
|
||||
- `bin/do_epic/backend/jira.py`: `JiraEpic`
|
||||
- `bin/do_epic/backend/fake.py`: `MemoryEpic`
|
||||
- `bin/do_epic/backend/contract.py`
|
||||
- `bin/do_epic/dry_run.py`
|
||||
- `bin/do_epic/test_do_epic.py`
|
||||
- `bin/do_epic/backend/test_jira.py`
|
||||
- `README.md`: `### Set up a project` (small)
|
||||
|
||||
### 503. Calibrate `task-bench` on fejkdata: bench a head against itself for the noise floor, then one finished chunk at its base and head, and record in a decision how many tasks and runs the bench needs.
|
||||
|
||||
The decision records the spread of the pass rate and of the median tokens when both sides are the same commit, the task and run counts at which a chunk's change rises above that spread, and what one bench costs in tokens and hours. Where no affordable count rises above the noise, it says so, and files what to try instead. The bench's defaults take the counts it picks.
|
||||
@@ -188,16 +155,6 @@ Touches:
|
||||
- `docs/decisions.md`: `## task-bench: how many tasks and runs a bench takes`
|
||||
- `bin/task_bench/main.py`: `main` (small)
|
||||
|
||||
### 511. Hand the product-owner and prose reviewers the real output of each command a changed doc line says prints something, so a claim about output is checked by running it, not by reading code.
|
||||
|
||||
An outside reviewer found a README line, in a persona's description, that said a CLI error names the fix. Our product-owner pass checked the exit code claim against the source and corrected it, but passed the "names the fix" half, since the pass has Read, Grep and Glob and cannot run the command: the one-character input that triggers the error prints an error with no fix in it. A deterministic check would be better than a reviewer's reading, but no tool can tell which doc lines claim an output. The orchestrator can: where a doc line a chunk changes says what a command, flag or error prints, larv-review's text has it run that command in the chunk's worktree, through the project's container setup, and give each reviewer the real output beside the claim. Applies to every project whose docs state outputs; a reviewer still gets no shell.
|
||||
|
||||
Touches:
|
||||
|
||||
- `skills/larv-review/SKILL.md`
|
||||
- `agents/product-owner-reviewer.md`
|
||||
- `agents/prose-reviewer.md`
|
||||
|
||||
### 509. Run `task-bench` beside the scoring run in larv-review comprehension check, and record its figures in the comprehension history beside the panel scores.
|
||||
|
||||
It stays a report beside the panel until about 10 chunks show whether the two agree; whether it can replace the scoring run or gate a merge is the human's call then.
|
||||
|
||||
Reference in New Issue
Block a user