Commit a2b6520289b39c7600f8f5898de8ff3046029930
1 parent
a044b73d
graphlemon: sdd artifact for task 2084590a-7096-456d-a49f-a92be3dd175c
Showing
1 changed file
with
9 additions
and
0 deletions
.graphlemon/runs/2084590a-7096-456d-a49f-a92be3dd175c/sdd.md
0 → 100644
| 1 | +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()`: | |
| 2 | + | |
| 3 | +**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. | |
| 4 | + | |
| 5 | +**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). | |
| 6 | + | |
| 7 | +**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. | |
| 8 | + | |
| 9 | +This is planning output only — no code was written yet. Awaiting direction on whether to proceed to implementation (Coder step). | |
| 0 | 10 | \ No newline at end of file | ... | ... |