fix(agent-ops): Milestone 토큰 검증 범위를 정교화한다
This commit is contained in:
parent
df0ecdbf1d
commit
ba9c0717cf
2 changed files with 28 additions and 1 deletions
|
|
@ -343,7 +343,12 @@ def validate_pairs(
|
|||
pairs.append((plan, review, header))
|
||||
union.update(target_ids)
|
||||
contents = plan.read_text(encoding="utf-8") + "\n" + review.read_text(encoding="utf-8")
|
||||
if "[TODO" in contents or "<task_group>" in contents:
|
||||
unresolved_contents = contents.replace("`m-<milestone-slug>`", "")
|
||||
if (
|
||||
"[TODO" in unresolved_contents
|
||||
or "<task_group>" in unresolved_contents
|
||||
or "<milestone-slug>" in unresolved_contents
|
||||
):
|
||||
raise CycleError(f"unresolved template token: {plan.parent}")
|
||||
if dispatcher.is_file():
|
||||
run(
|
||||
|
|
|
|||
|
|
@ -286,6 +286,28 @@ class EpicCycleContractTest(unittest.TestCase):
|
|||
self.assertEqual(len(pairs), 1)
|
||||
self.assertEqual(union, {"inside"})
|
||||
|
||||
def test_validate_pair_rejects_bare_milestone_slug_placeholder(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as raw:
|
||||
workspace = Path(raw)
|
||||
command(workspace, "git", "init")
|
||||
task = workspace / "agent-task" / "m-sample" / "01_work"
|
||||
task.mkdir(parents=True)
|
||||
header = (
|
||||
"<!-- task=m-sample/01_work plan=0 tag=TEST "
|
||||
"milestone-task=inside -->\n"
|
||||
)
|
||||
(task / "PLAN-local-G01.md").write_text(
|
||||
header + "# Plan\n\nPath: agent-task/m-<milestone-slug>/\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
(task / "CODE_REVIEW-local-G01.md").write_text(
|
||||
header + "# Review\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
with self.assertRaisesRegex(MODULE.CycleError, "unresolved template token"):
|
||||
MODULE.validate_pairs(workspace, "m-sample", {"inside"})
|
||||
|
||||
def test_validate_pair_rejects_foreign_pair_outside_selected_batch(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as raw:
|
||||
workspace = Path(raw)
|
||||
|
|
|
|||
Loading…
Reference in a new issue