File a finding and record a decision in a do-epic epic, and give the judge the epic's records beside the repo's
CI / tests (pull_request) Failing after 4m22s

This commit is contained in:
2026-11-18 23:13:43 +01:00
parent 36dbddfa0b
commit d0ecdd6359
19 changed files with 334 additions and 47 deletions
+11 -2
View File
@@ -1,5 +1,8 @@
"""What a do-epic cycle's worker is told: its task, from the issue, and its first prompt. The resumed prompt and the rung sentences are the ones loop-claude's cycles use, naming do-epic."""
from do_epic.backend.protocol import EpicIssue
from do_epic import findings
from loop_claude.project.records import HUMAN_RULE_NAMES, RECORD_FILES
from text_files.markdown_text import listed
from model_routing.ladder import ProjectRung
from loop_claude.cycle import prompts
from model_routing.route import Route
@@ -11,7 +14,7 @@ DRIVER = "do-epic"
def task(issue: EpicIssue, epic: str, checkout: str | None) -> str:
"""The task of the chunk that works issue, of the epic with the key epic: in checkout, or without a repo where it is None."""
where = f"in the checkout {checkout}, on the branch {issue.key}" if checkout else "which changes no repo: work in the folder you start in"
return f"Work the Jira issue {issue.key} of the epic {epic} as one chunk, {where}. Its summary: {issue.summary}" + (f"\n\nIts description:\n\n{issue.detail}" if issue.detail else "")
return f"Work the Jira issue {issue.key} of the epic {epic} as one chunk, {where}. {findings.instructions(epic)} Its summary: {issue.summary}" + (f"\n\nIts description:\n\n{issue.detail}" if issue.detail else "")
CODE_HEALTH = '~/.claude/CLAUDE.md → "Shared goal"'
@@ -25,4 +28,10 @@ def fresh(task: str, premises: str, route: Route, project: ProjectRung | None, f
# The worker names no plan items: the chunk's one item is its issue.
WORKER = prompts.worker_prompts(DRIVER, fresh, "")
# The epic's records come first, as its goals do; a chunk without a repo has only those and the human's rules.
NAMES = prompts.RecordNames(
quote_sources=listed(("the epic's description", "the repo's goals file's Goals and Audience", *RECORD_FILES, *HUMAN_RULE_NAMES), "or"),
answer_destinations="the epic's description under ## Decisions, the repo's goals file's Goals or Audience, " + ", ".join(RECORD_FILES) + ", the repo's plan or a comment",
records_named="the epic's scoring and decisions, then the repo's working rules and decisions, then the human's rules for every project",
)
WORKER = prompts.worker_prompts(DRIVER, fresh, "", NAMES)
+13
View File
@@ -110,6 +110,19 @@ class EpicRecord:
"""Writes body as the ## name section. approved says the human approved the change in an interrupt, which Goals and Audience need."""
return self.written(lambda text: with_section(text, name, body), frozenset({name}) if approved else frozenset())
def append_decision(self, title: str, entry: str) -> Held | Failure:
"""Adds entry under a ### title heading at the end of ## Decisions, leaving the decisions before it as they are."""
if not title.strip() or "\n" in title:
return Failure("the title must be one line of text")
if not entry.strip():
return Failure("pipe the decision's text in")
def appended(text: str) -> str | Failure:
before = read_section(text, "Decisions")
return before if isinstance(before, Failure) else with_section(text, "Decisions", f"{before}\n\n### {title.strip()}\n\n{entry.strip()}".strip())
return self.written(appended, frozenset())
def write_language(self, language: str) -> Held | Failure:
return self.written(lambda text: with_language(text, language), frozenset())
+59
View File
@@ -0,0 +1,59 @@
"""What a chunk's worker writes into its epic: a finding, filed as an issue, and a decision, appended to the description.
A finding about one of the epic's goals is filed in the epic, and one about a repo's goals by that repo's rules (docs/decisions.md → `do-epic: drives one Jira epic …` → "Findings"). A decision that governs the epic goes under the description's ## Decisions, where the judge of each later chunk reads it."""
import typing
from do_epic.backend.protocol import EpicStore
from do_epic.epic_record import EpicRecord
from failure import Failure
from text_files.piped_text import piped
# Three readers, seated as the human and as a chunk's worker, ranked four spellings of each flag: `<EPIC-KEY> --file` came first, second and second, ahead of `--file <EPIC-KEY>`, `add` and `--finding`; `--record-decision` won 2-1 over `--decision`, since `--decide` reads as do-epic deciding.
FILE = "--file"
LABEL = "--label"
RECORD_DECISION = "--record-decision"
USAGE = f"""do-epic <EPIC-KEY> {FILE} <summary> [{LABEL} <label>] [<<'EOF' detail EOF]
do-epic <EPIC-KEY> {RECORD_DECISION} <title> <<'EOF' entry EOF"""
HELP = f"""{FILE} files a finding about one of the epic's goals as an open issue of the epic, with the markdown piped in as its description.
{LABEL} names its repo, or says the work changes no repo; without one the issue waits.
A finding about a repo's own goals goes into that repo's plan instead.
{RECORD_DECISION} appends a decision that governs the epic to its description's ## Decisions, under the title, with the markdown piped in as its text."""
def instructions(epic: str) -> str:
"""What a chunk's first prompt says about filing a finding and recording a decision in the epic with the key epic."""
return (
f"File a finding about one of the epic's goals in the epic, with `do-epic {epic} {FILE} \"<summary>\" [{LABEL} <label>]` and its detail on stdin. "
"File one about a repo's goals by that repo's rules. Where unsure which, ask the human. "
f"Record a decision that governs the epic, such as an answer the human typed, with `do-epic {epic} {RECORD_DECISION} \"<title>\"` and its text on stdin."
)
def parsed(words: list[str]) -> tuple[str, str, str | None] | None:
"""The flag, its one value and the label of the words after the epic's key; None where they aren't a filing or a decision spelt as USAGE has them. A word that opens with `--` is no summary, title or label."""
if not words or words[0] not in (FILE, RECORD_DECISION):
return None
label: str | None = None
rest = words[1:]
if words[0] == FILE and LABEL in rest:
at = rest.index(LABEL)
if at + 1 >= len(rest):
return None
label, rest = rest[at + 1], rest[:at] + rest[at + 2:]
if len(rest) != 1 or any(word.startswith("--") for word in (*rest, label or "")):
return None
return words[0], rest[0], label
def written(epic: str, flag: str, value: str, label: str | None, store: EpicStore, record: EpicRecord, stdin: typing.TextIO) -> str | Failure:
"""Files the finding or records the decision, as flag says, and answers the line to print."""
text = piped(stdin)
if flag == FILE:
key = store.file(epic, value, text, (label,) if label else ())
if isinstance(key, Failure):
return Failure(f"cannot file the finding in the epic {epic}: {key.reason}")
return f"Filed {key} in the epic {epic}." + ("" if label else " It waits until a label names its repo.")
recorded = record.append_decision(value, text)
if isinstance(recorded, Failure):
return Failure(f"cannot record the decision in the epic {epic}'s description: {recorded.reason}")
return f"Recorded the decision in the epic {epic}'s description."
+34 -8
View File
@@ -3,12 +3,14 @@
`do-epic <EPIC-KEY>` 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."""
import dataclasses
import pathlib
import sys
import typing
from loop_claude.loop.chunk_start import archived_route, routed
from do_epic import chunk_prompt, scheduler
from do_epic import chunk_prompt, findings, scheduler
from do_epic.repo_pick import ClaudeWork, HumanTask, recorded, Repo
from loop_claude.loop.close import closed_cycle
from loop_claude.project.records import CONSEQUENCE, read_records
from agent_cycle.run import Cycle, run_cycle
from do_epic.config import DoEpicConfig, load
from loop_effects.effects import Effects, say
@@ -29,7 +31,6 @@ from loop_state.paths import Paths
from transcript_archive.project_key import project_key
from model_routing.ladder_file import project_ladder_file, read_ladder, SHIPPED
from loop_claude.project.premises import read_premises
from loop_claude.project.records import read_records
from claude_code.session import session_named
from loop_claude.loop.main import setup_version
from agent_cycle.stop import Stop
@@ -37,12 +38,14 @@ from agent_cycle.direct_message import tell
from agent_cycle import tmux
HELP = f"""usage: do-epic <EPIC-KEY>
{findings.USAGE}
Runs the chunks of one Jira epic, such as ABC-12, each in its own window of the tmux session epic-<EPIC-KEY>.
An open issue of the epic runs as a chunk once it has a label and no issue blocks it.
The label names the issue's repo, or says the work changes no repo.
As many run at once as the epic's description allows with a line such as `**Max parallel chunks:** 2`, one where it has none.
A repo takes as many chunks as its `parallel-chunks`, and none while loop-claude runs chunks in it.
{findings.HELP}
The Jira site and its credentials are set in ~/.claude-projects/do-epic/config.toml."""
# Under the home folder, where a chunk's cycles are archived, a folder per epic. It is not loop-claude's archive, since that archive's readers, such as judge-replay and the routing figures, read loop-claude's prompts.
ARCHIVE = ".claude/do-epic-transcripts"
@@ -73,9 +76,9 @@ class EpicRun:
return tmux.session_name(tmux.EPIC, self.key)
def main(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: pathlib.Path, effects: Effects, backend: Backend = jira_backend) -> int:
def main(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: pathlib.Path, effects: Effects, backend: Backend = jira_backend, stdin: typing.TextIO = sys.stdin) -> int:
try:
stop = run(argv, env, paths, launcher, effects, backend)
stop = run(argv, env, paths, launcher, effects, backend, stdin)
except KeyboardInterrupt:
stop = Stop(130, "")
except Exception as crash:
@@ -89,10 +92,14 @@ def main(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher:
return stop.code
def run(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: pathlib.Path, effects: Effects, backend: Backend) -> Stop:
def run(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: pathlib.Path, effects: Effects, backend: Backend, stdin: typing.TextIO) -> Stop:
chunk, words = (argv[1], argv[2:]) if len(argv) >= 2 and argv[0] == scheduler.CHUNK_FLAG else (None, argv)
if len(words) != 1 or not ISSUE_KEY.fullmatch(words[0]) or (chunk is not None and not ISSUE_KEY.fullmatch(chunk)):
# What the words after the epic's key write into the epic, where they are a filing or a decision.
writes = findings.parsed(words[1:]) if chunk is None else None
if (len(words) != 1 and not writes) or not ISSUE_KEY.fullmatch(words[0]) or (chunk is not None and not ISSUE_KEY.fullmatch(chunk)):
return Stop(0 if words in (["-h"], ["--help"]) else 1, HELP)
if writes:
return epic_written(words[0], writes, paths, backend, stdin)
# Before anything starts: a clone, a claude session or a tmux window.
if reason := tmux.unusable(effects.tmux, chunk_prompt.DRIVER):
return Stop(1, reason)
@@ -104,6 +111,15 @@ def run(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher:
return windows_opened(epic) if chunk is None else chunk_run(chunk, epic)
def epic_written(key: str, writes: tuple[str, str, str | None], paths: Paths, backend: Backend, stdin: typing.TextIO) -> Stop:
"""Files a finding in the epic, or records a decision in its description. It needs no tmux, so a chunk's worker may run it anywhere."""
config = load(paths.home)
if isinstance(config, Failure):
return Stop(1, config.reason)
done = findings.written(key, *writes, *backend(config, key), stdin)
return Stop(1, done.reason) if isinstance(done, Failure) else Stop(0, done)
def windows_opened(epic: EpicRun) -> Stop:
"""What the do-epic the human runs does: starts each chunk that may start now, says why each other open issue waits, then puts the epic's session on the terminal until the human detaches."""
started = chunks_started(epic, None)
@@ -239,8 +255,7 @@ def next_cycle(loop_run: LoopRun, loop: Loop, in_repo: bool, epic: EpicRun) -> C
premises = premises_read(loop.root if in_repo else None, epic)
if isinstance(premises, Failure):
return Stop(1, premises.reason)
# The epic's records join the repo's with todo.md item 413; until then a chunk without a repo has none.
records = read_records(loop.root, epic.paths.home, epic.paths.claude_dir) if in_repo else ""
records = records_read(loop.root if in_repo else None, epic)
if isinstance(records, Failure):
return Stop(1, records.reason)
models = get_or_ask_models(project_key(loop.root, epic.paths.home), epic.paths, epic.env, chunk_prompt.DRIVER, epic.effects) if in_repo else repoless_models(epic)
@@ -264,6 +279,17 @@ def repoless_models(epic: EpicRun) -> Models:
return Models(epic.env.get("LOOP_CLAUDE_JUDGE_MODEL") or epic.config.repoless_model, epic.env.get("LOOP_CLAUDE_WORKER_MODEL") or epic.config.repoless_model)
def records_read(root: str | None, epic: EpicRun) -> str | Failure:
"""The epic's Scoring and Decisions, from its description, then the records of the repo checked out at root, where the chunk has one, then the human's rules."""
sections: list[tuple[str, str]] = []
for name in ("Scoring", "Decisions"):
body = epic.record.section(name)
if isinstance(body, Failure):
return Failure(f"the epic {epic.key}'s description: {body.reason} - {CONSEQUENCE}.")
sections.append((f"the epic {epic.key}'s description, ## {name}", body))
return read_records(root, epic.paths.home, epic.paths.claude_dir, tuple(sections))
def premises_read(root: str | None, epic: EpicRun) -> str | Failure:
"""The epic's Goals and Audience, from its description, then those of the repo checked out at root, where the chunk has one. A Failure where the epic lacks either: no chunk runs without premises."""
bodies: list[str] = []
+111
View File
@@ -0,0 +1,111 @@
import contextlib
import dataclasses
import io
import pathlib
import sys
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from do_epic import main
from do_epic.backend.fake import MemoryEpic
from do_epic.epic_record import EpicRecord
from do_epic.test_main import DESCRIPTION, DoEpicTest
from failure import Failure
from loop_claude.test_loop_claude import FakeEffects
from loop_state.paths import paths_from
from record_store.held import Held
@dataclasses.dataclass(frozen=True)
class WrittenDescription:
"""Stands in for an epic's description in Jira that takes writes: kept holds each text it held, the last one now."""
kept: list[str]
approved: frozenset[str] = frozenset()
@property
def text(self) -> str:
return self.kept[-1]
def read(self) -> str | Failure:
return self.text
def held(self) -> Held | Failure:
return Held(self.text)
def write(self, text: str, version: str | None) -> Held | Failure:
self.kept.append(text)
return Held(text)
class FindingsTest(DoEpicTest):
def setUp(self) -> None:
super().setUp()
self.store = MemoryEpic("ABC-12", list(self.issues))
self.written = WrittenDescription([DESCRIPTION])
def backend(self, config: object, key: str) -> tuple[MemoryEpic, EpicRecord]:
return self.store, EpicRecord(self.written) # type: ignore[arg-type]
def run_with(self, argv: list[str], stdin: str = "") -> tuple[int, str, str, FakeEffects]:
out, err, fake = io.StringIO(), io.StringIO(), FakeEffects()
with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err):
code = main.main(argv, {}, paths_from(self.home), pathlib.Path("/b/do-epic"), fake.effects(), self.backend, io.StringIO(stdin))
# Without the time each line of do-epic opens with.
return code, out.getvalue().replace("<1790000000> ", ""), err.getvalue().replace("<1790000000> ", ""), fake
class FilingAFinding(FindingsTest):
def test_files_an_issue_under_the_epic_with_the_detail_piped_in_and_starts_nothing(self) -> None:
code, out, err, fake = self.run_with(["ABC-12", "--file", "Retry the import on a 503"], "The client times out.\n")
self.assertEqual((code, out, err), (0, "Filed ABC-102 in the epic ABC-12. It waits until a label names its repo.\n", ""))
filed = self.store.issues[-1]
self.assertEqual((filed.key, filed.summary, filed.detail, filed.labels, filed.parent, filed.by_loop), ("ABC-102", "Retry the import on a 503", "The client times out.", (), "ABC-12", True))
self.assertEqual(fake.calls, [], "filing needs no tmux, clone or claude")
def test_a_label_names_the_issues_repo(self) -> None:
for argv in (["ABC-12", "--file", "Retry", "--label", "api"], ["ABC-12", "--file", "--label", "api", "Retry"]):
with self.subTest(argv=argv):
code, out, _, _ = self.run_with(argv)
filed = self.store.issues[-1]
self.assertEqual((code, out, filed.labels, filed.detail), (0, f"Filed {filed.key} in the epic ABC-12.\n", ("api",), ""))
def test_says_why_an_issue_was_not_filed(self) -> None:
code, out, err, _ = self.run_with(["ABC-12", "--file", "Retry", "--label", "a b"])
self.assertEqual((code, out, len(self.store.issues)), (1, "", 2))
self.assertEqual(err, "cannot file the finding in the epic ABC-12: the label 'a b' is empty or holds white space\n")
self.store.fails = "Jira answered 401"
code, _, err, _ = self.run_with(["ABC-12", "--file", "Retry"])
self.assertEqual((code, err), (1, "cannot file the finding in the epic ABC-12: Jira answered 401\n"))
def test_prints_the_help_for_a_filing_spelt_wrong(self) -> None:
for argv in (["ABC-12", "--file"], ["ABC-12", "--file", "a", "b"], ["ABC-12", "--file", "a", "--label"], ["ABC-12", "--file", "a", "--labels", "x"], ["--file", "ABC-12", "a"], ["ABC-12", "--file", "--label", "x"]):
with self.subTest(argv=argv):
code, out, err, _ = self.run_with(argv)
self.assertEqual((code, out, err, len(self.store.issues)), (1, "", main.HELP + "\n", 2))
class RecordingADecision(FindingsTest):
def test_appends_the_entry_to_the_descriptions_decisions(self) -> None:
code, out, err, fake = self.run_with(["ABC-12", "--record-decision", "Imports retry three times"], "2026-11-18, the human's answer. Valid while the client's API rate-limits.\n")
self.assertEqual((code, out, err, fake.calls), (0, "Recorded the decision in the epic ABC-12's description.\n", "", []))
self.assertEqual(self.written.text, DESCRIPTION + "\n## Decisions\n\n### Imports retry three times\n\n2026-11-18, the human's answer. Valid while the client's API rate-limits.\n")
self.assertEqual(self.run_with(["ABC-12", "--record-decision", "Merges squash"], "Always.")[0], 0)
self.assertTrue(self.written.text.endswith("rate-limits.\n\n### Merges squash\n\nAlways.\n"), self.written.text)
self.assertIn("## Goals\nShip the import.\n\n## Audience\nThe client's team.\n", self.written.text)
def test_refuses_a_decision_without_a_title_or_a_body(self) -> None:
for argv, stdin, reason in ((["ABC-12", "--record-decision", "Merges squash"], " \n", "pipe the decision's text in"), (["ABC-12", "--record-decision", "two\nlines"], "Always.", "the title must be one line of text"), (["ABC-12", "--record-decision", "Merges squash"], "## Goals\nNone.", "the body of ## Decisions holds a level 1 or 2 heading, which would start another section")):
with self.subTest(argv=argv, stdin=stdin):
code, out, err, _ = self.run_with(argv, stdin)
self.assertEqual((code, out, err, self.written.text), (1, "", f"cannot record the decision in the epic ABC-12's description: {reason}\n", DESCRIPTION))
def test_prints_the_help_for_a_decision_spelt_wrong(self) -> None:
for argv in (["ABC-12", "--record-decision"], ["ABC-12", "--record-decision", "a", "b"], ["ABC-12", "--decide", "a"]):
with self.subTest(argv=argv):
code, out, err, _ = self.run_with(argv, "Always.")
self.assertEqual((code, out, err, self.written.text), (1, "", main.HELP + "\n", DESCRIPTION))
if __name__ == "__main__":
import unittest
unittest.main()
+12 -3
View File
@@ -142,11 +142,17 @@ class ACycleOfAChunkWithoutARepo(DoEpicTest):
cycle = self.cycle()
self.assertEqual((cycle.root, cycle.project_archive, cycle.records), (str(self.home / ".local/state/do-epic/ABC-12"), self.home / ".claude/do-epic-transcripts/ABC-12", ""))
def test_the_records_are_the_epics_scoring_and_decisions_then_the_humans_rules(self) -> None:
self.description = DESCRIPTION + "\n## Scoring\nE + I, bar 4.\n\n## Decisions\n### Merges squash\nAlways.\n"
(self.home / ".claude").mkdir()
(self.home / ".claude/CLAUDE.md").write_text("# Global\n", encoding="utf-8")
self.assertEqual(self.cycle().records, "From the epic ABC-12's description, ## Scoring:\nE + I, bar 4.\n\nFrom the epic ABC-12's description, ## Decisions:\n### Merges squash\nAlways.\n\nFrom ~/.claude/CLAUDE.md:\n# Global")
def test_the_premises_are_the_epics_goals_and_audience(self) -> None:
self.assertEqual(self.cycle().premises, "the epic ABC-12's description:\n## Goals\nShip the import.\n\n## Audience\nThe client's team.")
def test_the_task_is_the_issue(self) -> None:
self.assertEqual(self.cycle().task, "Work the Jira issue ABC-21 of the epic ABC-12 as one chunk, which changes no repo: work in the folder you start in. Its summary: Do ABC-21\n\nIts description:\n\nTidy the docs.")
self.assertEqual(self.cycle().task, "Work the Jira issue ABC-21 of the epic ABC-12 as one chunk, which changes no repo: work in the folder you start in. File a finding about one of the epic's goals in the epic, with `do-epic ABC-12 --file \"<summary>\" [--label <label>]` and its detail on stdin. File one about a repo's goals by that repo's rules. Where unsure which, ask the human. Record a decision that governs the epic, such as an answer the human typed, with `do-epic ABC-12 --record-decision \"<title>\"` and its text on stdin. Its summary: Do ABC-21\n\nIts description:\n\nTidy the docs.")
def test_an_issue_without_scores_runs_on_the_projects_rung(self) -> None:
self.issues[1] = dataclasses.replace(self.issues[1], scores={})
@@ -299,16 +305,19 @@ class AChunksRun(DoEpicTest):
(checkout / "README.md").write_text("## Goals\nServe the API.\n\n## Audience\nIts callers.\n", encoding="utf-8")
(checkout / "AGENTS.md").write_text("Squash every merge.\n", encoding="utf-8")
self.issues = [dataclasses.replace(issue("ABC-20", "repo:api"), scores={"L": 2, "E": 1, "I": 1})]
self.description = DESCRIPTION + "\n## Decisions\nKeep the v1 endpoints.\n"
fake = FakeEffects(streams=[self.worker()], claude=[judged("finished")], git=UNREAD)
code, out, err = self.run_main(["--chunk", "ABC-20", "ABC-12"], fake, MODELS)
self.assertEqual(code, 0, err)
prompt = " ".join([what for seam, what in fake.calls if seam == "stream_claude"][0])
self.assertIn(f"Work the Jira issue ABC-20 of the epic ABC-12 as one chunk, in the checkout {checkout}, on the branch ABC-20.", prompt)
self.assertIn(f"Work the Jira issue ABC-20 of the epic ABC-12 as one chunk, in the checkout {checkout}, on the branch ABC-20. File a finding", prompt)
self.assertIn("Ship the import.", prompt)
self.assertIn("The repo's goals, which rank after the epic's and after code health, are from", prompt)
self.assertIn("Serve the API.", prompt)
self.assertIn("the chunk finished; started no other\n", out)
self.assertIn("Squash every merge.", [what[1] for seam, what in fake.calls if seam == "claude"][0])
judge_prompt = [what[1] for seam, what in fake.calls if seam == "claude"][0]
self.assertIn("The records: the epic's scoring and decisions, then the repo's working rules and decisions, then the human's rules for every project:\nFrom the epic ABC-12's description, ## Decisions:\nKeep the v1 endpoints.\n\nFrom AGENTS.md:\nSquash every merge.", judge_prompt)
self.assertIn("writing it into the epic's description under ## Decisions, the repo's goals file's Goals or Audience, AGENTS.md, docs/decisions.md, the repo's plan or a comment", judge_prompt)
def repo_chunk(self) -> pathlib.Path:
"""Makes ABC-20 the one issue, a chunk in the repo api whose checkout holds its premises; the folder of the repo's config."""
+1 -1
View File
@@ -197,7 +197,7 @@ class StartingAnEpicsChunks(unittest.TestCase):
class TheFirstPrompt(unittest.TestCase):
def test_the_task_names_the_checkout_and_branch_and_quotes_a_description_only_where_there_is_one(self) -> None:
self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", "/code/api"), "Work the Jira issue ABC-20 of the epic ABC-12 as one chunk, in the checkout /code/api, on the branch ABC-20. Its summary: Do ABC-20")
self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", "/code/api"), "Work the Jira issue ABC-20 of the epic ABC-12 as one chunk, in the checkout /code/api, on the branch ABC-20. File a finding about one of the epic's goals in the epic, with `do-epic ABC-12 --file \"<summary>\" [--label <label>]` and its detail on stdin. File one about a repo's goals by that repo's rules. Where unsure which, ask the human. Record a decision that governs the epic, such as an answer the human typed, with `do-epic ABC-12 --record-decision \"<title>\"` and its text on stdin. Its summary: Do ABC-20")
def test_opens_with_the_task_then_the_rung_then_the_premises(self) -> None:
rest = f"The issue sets the chunk's scope. The goals below choose between ways to deliver that scope, and never widen it. The epic's goals rank first, then code health ({chunk_prompt.CODE_HEALTH}), then the repo's.\n\nFrom P"