zz_

a7e871b3 ยท zzmq.dev@gmail.com/zz

Commit

a7e871b341d6e893913df9c3541dfc186eb8a6eb

Resolve concurrent-edit conflicts as a visible ask, and fix a stale-read bug that caused most of them Reproduced with 4 "work" asks posted at once against two concurrent agents: the first proposal to reach commit_changeset wins; the other three get denied by the existing dropped-exports guard rather than silently corrupting the file. That part was already correct. What was missing: a denied proposal had nowhere to go -- the parent "work" ask was already answered complete, so the change just vanished with no retry and no visible trace of the conflict. Add a new "resolve_conflict" ask kind: when commit_changeset denies a submit_changeset specifically for dropped exports (a real race, not a bug in the proposal), post a new open-scope ask carrying the original task description, the rejected files, and the reason. Any contributor can claim it and reconcile -- framed as the same additive "add X to the current file" task that already works reliably, with the rejected draft as a reference for what to add, not a second file version to merge in (an earlier "merge the two blobs" framing made gpt-oss-120b drop the same export on every retry, identically). The actual root cause of why all four proposals collided in the first place: commit_changeset commits via git plumbing and never checks out a working copy, so reading "current files" via node:fs on the real working tree returned stale content on every call, not just after a race -- every contributor saw the same pre-isOdd snapshot regardless of what had actually landed by the time it read. Fixed by reading HEAD directly (`git ls-tree` + `git show`) instead, and by re-reading on every retry attempt instead of once before the loop, since HEAD can legitimately move between attempts. Verified live: re-ran the same 4-ask scenario after the fix and two of three conflicts reconciled and committed cleanly on the first resolve_conflict attempt.

Troy Howard <thoward37@gmail.com> -- 2026-10-11T09:03:06.000Z

Tree at this commit