File: action/src/capture/iteration-capture.ts lines 43-65
Summary: Re-running workflow on same commit via "Re-run all jobs" button or workflow_dispatch with same PR_NUMBER creates duplicate phantom iteration rows. captureIteration computes revision = getIterationCount() + 1 and calls insertIteration unconditionally -- no head_sha dedup check, and schema only has UNIQUE(revision) not UNIQUE(head_sha).
Fix direction: short-circuit when iteration with same head_sha already exists, or add UNIQUE(head_sha) with ON CONFLICT DO NOTHING.
File:
action/src/capture/iteration-capture.tslines 43-65Summary: Re-running workflow on same commit via "Re-run all jobs" button or
workflow_dispatchwith same PR_NUMBER creates duplicate phantom iteration rows.captureIterationcomputesrevision = getIterationCount() + 1and callsinsertIterationunconditionally -- nohead_shadedup check, and schema only hasUNIQUE(revision)notUNIQUE(head_sha).Fix direction: short-circuit when iteration with same
head_shaalready exists, or addUNIQUE(head_sha)withON CONFLICT DO NOTHING.