fix: move-codex-session should re-check goals, memories, queue and logs before deleting the source #138
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/move-codex-session-auxiliary-recheck"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #132 from its review (finding).
Before deleting the moved threads from the source, the script confirmed that the destination still held their state and history rows. It never checked the goals, memories, queue and logs copies. A destination writer could delete or change those rows after the copy, and the source deletion would then discard the only remaining copy. This gap predates #132.
Source deletion now compares every destination database with the source. It then write-locks all destination databases, confirms none changed since that comparison, and commits the source deletion while holding the locks. Log row IDs and queue revisions are generated in each home, so the comparison skips them.
The new test deletes a destination goal after the comparison. The script exits 1 with
destination goals table thread_goals changed during source deletionand keeps the source rows; on #132's head the same move exits 0 and deletes them. Edits to logs, memory jobs, stage-one outputs, queued items, queue revisions and goal deferrals stop the deletion the same way. A queue revision bump and an unrelated log row do not.The destination locks now cover six databases instead of two. In a fixture with logs at the partition limit, the hold took 39 ms. If another process keeps a destination database locked past the 30-second busy timeout, the move fails at this step and keeps the source.
move-codex-sessionshould re-check goals, memories, queue and logs before deleting the sourcemove-codex-sessionshould handle Codex 0.160.1 and large native homes #132Review
01M4H77GQHV2ND5246CEBAY52C— headeeed5507e7c7de2534abb487f0afa981c4a815d0Review — j4k-oss/agent-skills @
7f7243ecfaScope: diff against base tree
40154724b696Status: dispatched — coverage complete (3/3 slots terminal)
Facts: current review-wide projection
Computed under:
Findings (0)
No findings survived.
Reviewed:
Other claims
Coverage
Coverage pass: 01M4H77Y8JC183X1R1Q4ENHTWM
Accounting: complete
Slot health: healthy
63d639f142eeed5507e7move-codex-sessionleaks database connections when a later open throws #139