Fix Graphify writer lock races and pin query snapshots - #645
Conversation
🧹 Develop S3 preview removedThe PR-specific alias and every workflow-created develop deployment were removed when this PR closed. The ordinary generated Vercel Preview remains available on the shared development runtime. |
|
Lopu · review of the writer-lock rewrite — head The lock change is correct, and the mechanism is the interesting part: acquisition moves from That closes the window properly. I walked the release interleaving that would break a naive version of this:
Non-recursive Two supporting changes are right for the same reason — they refuse to guess:
No deadlock from moving Two things worth knowing, neither blockingQueries now serialise. Holding the writer lock across the whole child process is the right call — it's what stops
Changes I madeOnly prose, in the two docs this PR already edits — no logic touched:
Validation
Checks on this head: 16 success, 66 skipped, 0 failures. CodeQL: 0 open alerts, nothing dismissed. |
Lopu repository reviewLopu reviewed this PR against develop as Thingtime's principal PR and repository manager. Using Claude Opus 5. Lopu made justified improvements and pushed eba1224 to codex/graphify-writer-lock. Lopu review — PR #645 · Fix Graphify writer lock races and pin query snapshotsCompared head Check stateNo failing checks on What the change doesReplaces the Assessment — correctnessThe core invariant holds. Two supporting changes are also right:
No re-entrancy risk from moving Every symbol the new code needs is imported ( Assessment — behaviour changes worth knowing
Changes I madeTwo formatting regressions in the prose this PR touched. No logic was changed.
Validation
VerdictThe concurrency work is sound, well-tested, and the documentation matches the |
|
🤖 Promotion conflict resolution was queued automatically for Conflicted source paths: The trusted worker will reconstruct, verify, publish, and attest the review branch; no manual branch update is needed. |
|
Branch: No newer branch work was overwritten or deleted. The same immutable snapshot will not spend AI again; a changed source/base snapshot retries automatically. Review the run. |
|
🤖 Promotion conflict resolution was queued automatically for Conflicted source paths: The trusted worker will reconstruct, verify, publish, and attest the review branch; no manual branch update is needed. |
Concurrent Graphify queries could delete a replacement writer's lock while reclaiming an old owner, causing
ENOENTduring owner-file creation. Queries also released the lock before their Graphify child finished, allowing another command to prune the snapshot being read.Publish a populated lock directory atomically, use unique owner records, and remove only the releasing owner's record plus an empty directory. Keep the selected snapshot locked through query completion. Preserve bounded timeouts and refuse to reclaim unknown/live ownership.
Validation:
testingID collision between TESTING.md and RecoveryCoreTests.swift; this warning is separate from locking.Upgrade note: finish pre-upgrade Graphify processes in a checkout before replacing its router; old recursive cleanup cannot participate safely in the new protocol. The LLM proxy request-size change is being handled separately.
Control-plane counterpart: #644