From a2b6520289b39c7600f8f5898de8ff3046029930 Mon Sep 17 00:00:00 2001 From: graphlemon Date: Sat, 8 Aug 2026 11:53:41 +0800 Subject: [PATCH] graphlemon: sdd artifact for task 2084590a-7096-456d-a49f-a92be3dd175c --- .graphlemon/runs/2084590a-7096-456d-a49f-a92be3dd175c/sdd.md | 9 +++++++++ 1 file changed, 9 insertions(+), 0 deletions(-) create mode 100644 .graphlemon/runs/2084590a-7096-456d-a49f-a92be3dd175c/sdd.md diff --git a/.graphlemon/runs/2084590a-7096-456d-a49f-a92be3dd175c/sdd.md b/.graphlemon/runs/2084590a-7096-456d-a49f-a92be3dd175c/sdd.md new file mode 100644 index 0000000..4d14278 --- /dev/null +++ b/.graphlemon/runs/2084590a-7096-456d-a49f-a92be3dd175c/sdd.md @@ -0,0 +1,9 @@ +The graphlemon Work Node (planner) workflow finished. It produced an SDD design doc (status: ready for coding, not yet implemented) for fixing a real bug in `src/work_node_run.py::run_work_node()`: + +**Bug**: `execution_log_file` is inserted unconditionally on every call. If a Work Node is re-invoked for the same `node_exec_id` (e.g. after a crash mid-execution, or a `blocked` node resumed via `manual_resume`), the second call hits the table's `UNIQUE(node_exec_id)` constraint and raises `sqlite3.IntegrityError`, permanently blocking REQ-06's break-point resume. + +**Proposed fix**: replace the blind `INSERT` with a `SELECT`-then-branch: reuse the existing `log_file_id` row (resetting its `status` back to `'active'`) if one exists for that `node_exec_id`, otherwise insert as before. Scope is narrowly the ~10-line block at `work_node_run.py:272-280`; no changes to `resume_work_graph_run()`, `work_graph_execute.py`, or the worktree-restore logic (which already follows this query-then-create pattern). + +**Test plan**: adds `ExecutionLogFileIdempotentInsertTest` in `src/test_work_node_run.py`, which fails with the `IntegrityError` on current code and should pass once the fix lands, plus a run of the full existing `test_work_node_run.py` suite as a regression check. + +This is planning output only — no code was written yet. Awaiting direction on whether to proceed to implementation (Coder step). \ No newline at end of file -- libgit2 0.21.4