Skip to content

fix(dispatch): the awaiting sweep leaves a ticket whose PR is open - #107

Merged
Ardnived merged 1 commit into
mainfrom
claude/fix-106-sweep-awaiting-open-pr
Sep 18, 2026
Merged

Ardnived merged 1 commit into
mainfrom
claude/fix-106-sweep-awaiting-open-pr

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • sweep-awaiting no longer re-applies awaiting to an issue an open PR closes, so the reviewer is claimed once — on the PR — instead of twice.
  • The false awaiting-drift anomaly that write produced stops appearing in the journal.
  • The board stops disagreeing with itself: Status done from session-end no longer sits beside awaiting.

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

  • Lean gate: ✓ claude plugin validate ./workflow --strict
  • Targeted specs: 76 passed — node --test dispatcher/test/*.test.mjs
  • Build: N/A

Each assertion was checked against a reverted guard: dropping the new line fails the new test, and narrowing ?. to . fails it with a TypeError on the PR snapshot.

Manual verification

  1. The ticket's fourth verification item — a BOT_DISPATCH=dry sweep over a repo with an open bot PR, confirming the new note and no planned awaiting label (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.mjs shows 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 and CLAUDE.md requires for a rule whose story lives in docs/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 in gather.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 closingIssuesReferences query per swept bot PR. The ticket calls the ?. load-bearing for the same reason. decide.mjs already 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: false assertion was vacuous.
types() renders every note as the bare string note, so that case read ['note'] with the guard reverted too — it fell through to human 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-toolkit plugin 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.mjs skipped itself — it needs typescript resolvable, and this repo has no package manager.

Not owed. No skill or loop-config.json change, so no version bump in workflow/.claude-plugin/plugin.json and rule-delta.mjs does not apply.

Closes #106

🤖 Generated with Claude Code

https://claude.ai/code/session_014YmxKFCM1vqsYzshYAMiTH


Generated by Claude Code

`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
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Sep 17, 2026
@sydevs-bot

sydevs-bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 05:12Z address-review · attempt 1 · session · done
  • 05:12Z address-review · attempt 1 · session
  • 05:05Z adversarial-review · attempt 1 · session · done
  • 05:05Z adversarial-review · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 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.mjs at 3b2464e — 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 with TypeError.
  • apply.mjs:87 only logs a note, 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

Comment thread dispatcher/decide.mjs Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Sep 17, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

One thread, adopted. The fourth openPrsClosingIt copy has an owner: #110. Thread resolved.

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 3b2464e is the one already reported. The gate had nothing new to check.

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 Notes for reviewer, and the BOT_DISPATCH=dry sweep, which needs an attended run.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Sep 17, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review September 17, 2026 05:18
@sydevs-bot
sydevs-bot requested a review from Ardnived September 17, 2026 05:18
@Ardnived
Ardnived merged commit b4aa42b into main Sep 18, 2026
24 checks passed
@Ardnived
Ardnived deleted the claude/fix-106-sweep-awaiting-open-pr branch September 18, 2026 00:15
@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

fix(dispatch): sweep-awaiting re-labels an issue whose PR is already open

3 participants