fix(issue-34): review - a correction round keeps the earlier creator jobs' sub-jobs in the evidence table

round_roots was replaced by the correction job, so an implementation
job's open or failed sub-job vanished from the next review and the loop
could pass (planner-reviewer-codex-01, P2). The run's creator jobs now
accumulate; each wait still covers only the new job's tree, so the wait
cap is not paid again per round. T9 covers open / error / completed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GodopuandClaude Opus 5.5 committed 2026-09-24 14:17:12 +00:00
1 parent 8690ef4bd2
commit 3fdbb626de
3 files changed
+32 -3

No files matched your search

+27
View File
@@ -278,6 +278,8 @@ else:
rule = os.environ.get("FAKE_REVIEW", "pass")
unfinished = re.search(r"(열린|미확인 종결|실패) [1-9]", prompt)
verdict = "NOT PASS" if rule == "rule" and unfinished else "PASS"
if os.environ.get("FAKE_FIRST_NOT_PASS") and n == 1: # forces a correction round
verdict = "NOT PASS"
report = "reviewed\n\n[VERDICT: %s]\n" % verdict
late = os.environ.get("FAKE_LATE_WRITE") == str(n)
dest = jobs / jid / "agent-reports"
@@ -483,3 +485,28 @@ def test_t8_the_stale_review_guard_without_worktree_or_base(tmp_path):
assert res_plain.returncode == 0, res_plain.stdout + res_plain.stderr
assert "the stale-review guard is off for this run" in res_plain.stdout
assert "100% PASS" in res_plain.stdout
@pytest.mark.parametrize("child_end, rc", [("open", 1), ("error", 1), ("completed", 0)])
def test_t9_a_correction_round_keeps_the_earlier_creator_jobs_sub_jobs(tmp_path, child_end, rc):
"""Review of round 2 (after a correction job with no sub-job of its own)
still sees the implementation job's sub-job; the correction does not claim
to have replaced it. Success pair: the completed child passes in round 2."""
ctl = _loop_ctl(tmp_path)
env = _loop_env(ctl, FAKE_WORKER="child", FAKE_REVIEW="rule", FAKE_FIRST_NOT_PASS="1",
MAM_CHILD_WAIT_S="0")
jobs = ctl / ".mam" / "jobs"
on_child = {"open": None,
"error": lambda cid: _publish(env, jobs, cid, "error", "simulated"),
"completed": lambda cid: _publish(env, jobs, cid, "completed", "figures drawn")}[child_end]
if child_end != "open":
env["MAM_CHILD_WAIT_S"] = "60" # wait for the helper to close it
res = _run_loop(ctl, env, "--max-loop", "2", on_child=on_child)
out = res.stdout + res.stderr
assert res.returncode == rc, out
assert "Applying straight bugfixes" in res.stdout # a correction round ran
cid = (ctl / ".mam" / "child-id").read_text().strip()
second = _review_prompt(ctl, 2)
state = {"open": "OPEN", "error": "error", "completed": "completed"}[child_end]
assert re.search(rf"\| {cid} \| .* \| {state} \|", second), second
assert ("100% PASS" in res.stdout) == (rc == 0)