Repository navigation
feat(dispatcher): resolve a conflict once the base has settled - #317
Conversation
Every merge re-derives the repo's other open PRs, and each conflicted one got a resolve-conflicts session at once, so a burst of merges resolved the same branch once per merge. SahajAtlasWeb#466 took five sessions in four days, and the 2026-11-22 WeMeditateWeb reorganisation set off 35 in an afternoon: resolve-conflicts was 61 of 214 sessions (about 19% of session time) from 2026-11-22 to 2026-11-25. A conflicted PR now waits until the base tip has been still for dispatch.conflictQuietMinutes (60). The wait never outlasts pendingDueMinutes, and an unreadable base time resolves at once, so a base that never settles costs no more than before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Holistic assessment. The harm is counted, not guessed — 61 of 214 sessions, two named bursts — so this guard earns its place, and conflicts really are the one handler whose work a later base move invalidates, which is why a conflict-specific window beats a general fire debounce. Value, rule and story sit in their three homes, and the diff is four lines of logic plus its tests. But the bound the body promises does not hold: overdue reads pendingSince, which the board nulls the moment a conflicted PR derives Awaiting, and that is where a bot PR sits once the critic's threads are answered. A direct push whose committer date predates it reads as settled and resolves at once — today's behaviour, so no regression.
Findings
blocker— the wait has no bound on an Awaiting PR (dispatcher/decide.mjs:351).consider— a second committer-date read beside the first (dispatcher/gather.mjs:383).
What was checked. Read whole: decide.mjs (conflictPlan, overdue, quietSweep, evaluateOpenPr), gather.mjs, status.mjs prStatus, apply.mjs syncStatus, predicates.mjs threadsWaiting, plus sweep.mjs, reconcile.mjs and the 7,37 * * * * cron — a conflicted PR is re-derived every half hour, so a 60-minute window does gate. new-pieces.mjs → NONE, so no streamliner ran; the ladder walked the one new read and the repo already has it (gather.mjs:396), which is the consider. node --test dispatcher/test/*.test.mjs on main: 440 pass, so the body's 444 is the four new cases. No dependency added. docs/why.md checked against docs/documentation.md: it names both constants and copies neither value. No question threads, no preview links, no contract surface touched.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The quiet window deferred `resolve-conflicts` while `!overdue(s, config)`,
which reads `record.pendingSince`. `syncStatus` nulls that field on every
pass whose derived Status is not pending-with-due, and `prStatus` returns
Awaiting for `threadsWaiting` before it reaches CONFLICTING — the normal
state of a bot PR while a thread waits on the reviewer. `overdue` was then
always false there, so a base moving more often than the window deferred the
resolution for good, and `quietSweep` hid the note on each `sweep-pr`.
The guard now records `conflictWait: { sha, since }` on its first deferral
and bounds the wait at `dispatch.pendingDueMinutes` from it. The key is the
head, so a push restarts the window; a clock that cannot be read, or one
left by another head, resolves at once. `overdue` stays as the Pending
path's shortcut: it fires before `reconcile`'s `dueStep` can hand a deferred
conflict back as "the PR has not moved". The record renders a line for the
wait, which is otherwise invisible while `quietSweep` is silencing the note.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ37KBTSFa8KBNf76f
`gather` read `repos.getCommit` twice, fifteen lines apart, digging the same `commit.committer.date` out behind the same try/catch: the head's, for the author at the repair cap, and the base tip's, for the conflict window. `commitFacts` returns both fields, or nulls when the read fails, and each caller keeps the comment that says what its null means. No behaviour change: the same condition gates each read, the author keeps its committer fallback, and a throw still leaves nulls. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZ37KBTSFa8KBNf76f
|
Both findings from the adversarial review are built, on Adopted — the wait has no bound on an Awaiting PR ( Adopted — a second committer-date read beside the first ( Body refreshed — its bound bullet promised what the code did not do. 446 tests pass, two new. Lean gate green. Security review, triggered by 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
There was a problem hiding this comment.
Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is
Three conflicts, all from #320 landing on main: - dispatcher/gather.mjs: #320 widened the head-commit read to a stood-down repair; this branch folded that read into `commitFacts`. Kept both — the helper, called under the widened condition. - dispatcher/test/decide.test.mjs: both sides appended a suite at the end of the file. Kept both suites. - loop-config.json: #320 cut the dispatch `$comment` to one line, which is what it set out to do, and the three-homes rule wants. Took main's line; `conflictQuietMinutes` keeps its story in docs/why.md. dispatcher/test: 453 pass. Lean gate green. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZ2VcTtaLzy8VMJ15p
|
Merged
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
dispatch.conflictQuietMinutes(60) beforeresolve-conflictsfires.dispatch.pendingDueMinutes, counted from the deferral the guard records in the status comment asconflictWait, keyed by head. An overdue conflict, a base time that can't be read, or a clock left by another head is resolved at once, as before.gatherreads the base tip's committer date, and only for a conflicted PR, so this adds one REST call where a conflict already exists. Its two commit reads — that one and the head's author — are now onecommitFactshelper.The failure this prevents
Each merge to main fires
conflict-scanacross the other open PRs, and every conflicted one got a session at once. A burst of merges therefore resolved the same branch once per merge. Each resolution after the first redid work that the next merge undid.From the journals for 2026-11-22 to 25:
resolve-conflictsran 61 of 214 sessions, about 19% of session time. sydevs/SahajAtlasWeb#466 took five; the WeMeditateWeb reorganisation took 35 in one afternoon. We keep hitting the Routines account's usage limits, and this is the cheapest cut that leaves review and implementation untouched.Tests
node --test dispatcher/test/*.test.mjs: 446 pass. Six cases cover the window: a recent base waits and starts its clock,conflict-scanwaits too, a still base fires, an overdue conflict fires, no window or an unreadable base time fires, the clock bounds the wait wherependingSinceis null, and the clock is written once per head.The real gate is a supervised dispatch. After merge, watch the next merge burst: conflicted PRs should log
the base moved at …, showconflict held since …in the status comment, and fire once on the following sweep.Notes for reviewer
The adversarial review's
blockerwas real:overduereadspendingSince, whichsyncStatusnulls on every pass whose derived Status is not pending-with-due, andprStatusreturns Awaiting forthreadsWaitingbefore it reachesCONFLICTING. The bound the first bullet promised did not hold there. The guard now keeps its own clock, andoverduestays as the Pending path's shortcut so a deferred conflict never reachesreconcile'sdueStepas "the PR has not moved".🤖 Generated with Claude Code