fix(tasktree): complete tasks when reports are written

This commit is contained in:
root
2026-07-21 14:09:06 +02:00
parent 50c693fc50
commit bb5452930b
3 changed files with 73 additions and 27 deletions
+9
View File
@@ -166,11 +166,20 @@ test("native PostgreSQL store exposes overview and three task levels", async ()
(error: any) => error?.code === "execution_report_required"
);
const firstReport = await store.writeReport({ taskId: task.id, title: "Execution", body: "passed" });
assert.equal(firstReport.task.status, "completed");
assert.equal(firstReport.taskMutation, true);
const repeatedReport = await store.writeReport({ taskId: task.id, title: "Execution", body: "passed" });
assert.equal(repeatedReport.taskMutation, false);
await store.updateTask(task.id, { status: "blocked" });
const correctedReport = await store.writeReport({ taskId: task.id, title: "Execution", body: "passed" });
assert.equal(correctedReport.mutation, false);
assert.equal(correctedReport.taskMutation, true);
assert.equal(correctedReport.task.status, "completed");
const changedReport = await store.writeReport({ taskId: task.id, title: "Execution", body: "passed with evidence" });
assert.equal(firstReport.mutation, true);
assert.equal(repeatedReport.mutation, false);
assert.equal(changedReport.mutation, true);
assert.equal(changedReport.taskMutation, false);
assert.equal(firstReport.report.id, repeatedReport.report.id);
assert.equal(firstReport.report.id, changedReport.report.id);
assert.equal((await store.completeTask(task.id))?.status, "completed");