fix: preserve stale task identity history
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a053ff-1d6f-7fe2-ac1c-a6eb40a42a0c
This commit is contained in:
parent
ddce470944
commit
a32112e5ab
4 changed files with 65 additions and 44 deletions
|
|
@ -1156,6 +1156,23 @@ class TestExistingWorkplanTasks:
|
|||
assert out.refused[0]["reason"].startswith("current workplan contains duplicate")
|
||||
assert session.added == []
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_duplicate_stale_history_inside_current_workplan_does_not_block(self):
|
||||
row = _Row(slug="demo-wp-0001", status="active", path="workplans/a.md")
|
||||
desired = _TaskRow("DEMO-WP-0001-T01", status="todo", workplan_id=row.id)
|
||||
stale_a = _TaskRow("DEMO-WP-0001-T09", status="done", workplan_id=row.id)
|
||||
stale_b = _TaskRow("demo-wp-0001-t09", status="done", workplan_id=row.id)
|
||||
session = _FakeSession(
|
||||
repo=_Repo(), rows=[row], task_rows=[desired, stale_a, stale_b]
|
||||
)
|
||||
out = await fp.reset_repository_projection(
|
||||
session,
|
||||
"demo",
|
||||
derived=self._derived(("DEMO-WP-0001-T01", "Do it", "todo")),
|
||||
)
|
||||
assert out.status in {"applied", "noop"}
|
||||
assert out.refused == []
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_derived_task_uuid_held_elsewhere_is_refused_before_insert(self):
|
||||
row = _Row(slug="demo-wp-0001", status="active", path="workplans/a.md")
|
||||
|
|
@ -1170,7 +1187,7 @@ class TestExistingWorkplanTasks:
|
|||
)
|
||||
out = await fp.reset_repository_projection(session, "demo", derived=derived)
|
||||
assert out.status == "refused"
|
||||
assert out.refused[0]["reason"].startswith("task identity already belongs")
|
||||
assert out.refused[0]["reason"].startswith("derived task identifier already belongs")
|
||||
assert session.added == []
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue