Repository navigation
fix(dispatch): the awaiting sweep leaves a ticket whose PR is open - #107
Conversation
`session-end` removes `awaiting` from an issue an open PR closes, because the PR is where the work is tracked (`decide.mjs:374`). `sweep-awaiting` put it back. It reads `locked`, `stuck`, `awaiting` and `botSpokeLast`, and never `openPrsClosingIt`, though `gather.mjs:117` sets it on every issue snapshot. So any bot comment on the ticket after the PR opens — an `answer` reply, a `revise` note — made the bot last speaker, and the next sweep pass re-labelled the ticket. The reviewer was then claimed twice for one piece of work: on the PR, which is the real turn, and on a ticket with nothing left to do. The `awaiting-drift` anomaly it raised was false — the label was removed on purpose — and the board disagreed with itself, Status `done` against `awaiting`. One guard, after the existing early return so the note names the reason. The `?.` is load-bearing: `sweep.mjs:112` pushes `sweep-awaiting` for PRs as well as issues, and `gather.mjs` sets `openPrsClosingIt` on the issue arm alone, so a bare `.length` throws on a PR snapshot. The test pins that case. The test pins the note text, not just the action types. `types()` renders every note as the bare string `note`, so a `botSpokeLast: false` case asserted on types alone passes with the guard reverted — it falls through to `human spoke last`, which is also one note. Closes #106 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014YmxKFCM1vqsYzshYAMiTH
|
🤖 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
The diff is the size of the ticket: one guard, one test, one why.md paragraph, nothing the ticket did not name. The fix sits where the data already is — gather.mjs:117 sets openPrsClosingIt on every issue snapshot the sweep produces, so the guard fires in production, not only in the test. It suppresses a write and never adds one, so the five-repo blast radius is as narrow as claimed. Leaving the PR arm alone is right: dropping it would change behaviour for human PRs, which the ticket did not study.
One consider, at decide.mjs:399. Yours to settle on merge, not blocking: the line 398 comment explains the ?., while its anchor covers the rule.
What was checked
node --test dispatcher/test/*.test.mjsat3b2464e— 76 pass, 0 fail, from an archive of the head.- Both counterfactuals hold: delete the guard and the new test fails; narrow
?.to.and it fails withTypeError. apply.mjs:87only logs anote, so the new note cannot make the bot last speaker again.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
One thread, adopted. The fourth Nothing rebutted. Nothing asked. No code change here. #110 rewrites three arms this PR does not own, and a combined change in this repo cannot be attributed after the fact. So nothing was pushed, and the diff at The body's rejected-finding note now names #110, so a later run grounding on the body alone will not file it twice. Its line reference is corrected to 399. Two things still wait on you: the checklist deviation under 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
sweep-awaitingno longer re-appliesawaitingto an issue an open PR closes, so the reviewer is claimed once — on the PR — instead of twice.awaiting-driftanomaly that write produced stops appearing in the journal.donefrom session-end no longer sits besideawaiting.Contract impact
dispatcher/is the shared workflow all five sydevs repos call, so this reaches them on their next event with no merge anywhere else. The change only ever suppresses a write, and the PR arm of the sweep is untouched.Test results
claude plugin validate ./workflow --strictnode --test dispatcher/test/*.test.mjsEach assertion was checked against a reverted guard: dropping the new line fails the new test, and narrowing
?.to.fails it with aTypeErroron the PR snapshot.Manual verification
BOT_DISPATCH=drysweep over a repo with an open bot PR, confirming the new note and no plannedawaitinglabel (docs/routine-setup.md§6) — was not run. A routine cannot reach the GitHub API, so this needs an attended run.Notes for reviewer
One deviation from the ticket. Its checklist predicts
git diff main -- dispatcher/decide.mjsshows one added line; it shows two. The second is a(why: docs/why.md#a-pr-is-the-answer-to-an-implement-verb)anchor on the guard, which two review lenses asked for independently andCLAUDE.mdrequires for a rule whose story lives indocs/why.md. The sibling arm 25 lines above carries the same anchor. Drop the comment if you would rather hold the checklist literally.Three review findings were rejected — reasons below.
Detail
Rejected: normalize
openPrsClosingIt: []into the base snapshot ingather.mjs, so the guard needs no?..The key is meaningless on a PR snapshot, and an empty array there asserts "no open PR closes this PR" — a category error that invites a future arm to read it as informative. It would also put the field on the PR gather path, where making it real costs a
closingIssuesReferencesquery per swept bot PR. The ticket calls the?.load-bearing for the same reason.decide.mjsalready uses?.for kind-specific fields (s.linkedLocked?.length,s.park?.until).Rejected: extract an
inFlight(s)predicate and call it from lines 288, 372, 374 and 399.A fair reading — the fact is now written four times in three shapes. But it rewrites three arms this ticket does not own, in a repo where a merge is the deploy and a combined PR cannot be attributed after the fact. Worth its own ticket; not worth widening this one. Filed as #110, which carries the shape decision as its open question.
Rejected in part: trim the new test to ~8 lines.
The vacuous half of that finding was real and is fixed — see below. The PR-snapshot case stays, because it is the ticket's third acceptance criterion.
Accepted: the
botSpokeLast: falseassertion was vacuous.types()renders every note as the bare stringnote, so that case read['note']with the guard reverted too — it fell through tohuman spoke last. Both PR-open cases now pin the note text, and the PR-snapshot case asserts the arm's unchanged plan (['label', 'anomaly']) rather than a fallthrough note, so it fails if the?.is ever dropped.Lenses run. The
pr-review-toolkitplugin is not installed in this environment, so step 2 ran as/simplify(reuse, simplification, efficiency, altitude) plus/code-review. Reuse, efficiency and correctness came back clean with evidence.comment-lint.mjsskipped itself — it needstypescriptresolvable, and this repo has no package manager.Not owed. No skill or
loop-config.jsonchange, so noversionbump inworkflow/.claude-plugin/plugin.jsonandrule-delta.mjsdoes not apply.Closes #106
🤖 Generated with Claude Code
https://claude.ai/code/session_014YmxKFCM1vqsYzshYAMiTH
Generated by Claude Code