Repository navigation
fix(loop): a review comment is feedback, whatever its association - #113
Conversation
Four cases the suite never had. All 76 existing tests pass with and without
the fix that follows, because nothing covered the mapping at all: a review
comment resolved to reason `issue_comment` and no test asserted otherwise.
Committed red on purpose, so the evidence the fix is load-bearing is in the
history rather than in a claim. Against this commit's parent:
not ok 2 - resolve gives a review comment its own reason
not ok 20 - a review comment on a bot PR re-derives the PR
not ok 21 - a review comment from the bot, or from outside the allowlist
not ok 22 - a review comment carrying a verb on a human PR
Two of them pin note text, not just action types. `types()` renders every
note as the bare string `note`, and an unhandled reason returns exactly one
note, so the bot and stranger cases would both stay green on shape alone.
Refs #109
Claude-Session: https://claude.ai/code/session_01MZsMPSJuc6xW1xwMZpKu5w
Co-authored-by: Claude <[email protected]>
A CHANGES_REQUESTED review with four inline comments landed on `sydevs/SahajAtlasWeb#212` and dispatched nothing. The PR sat untouched until the reviewer asked why, eleven minutes later. `resolve.mjs` mapped every review comment to reason `issue_comment`, whose row gates on `hasAccess(association)` — OWNER | MEMBER | COLLABORATOR. GitHub sends `CONTRIBUTOR` for a review comment by the same login it sends `MEMBER` for on every issue comment, so both surviving runs logged `comment by Ardnived without write access — not feedback` and returned a note. The gate is redundant where it fired: the line above already requires `respondTo(author)`, an explicit allowlist of three logins, and a payload-derived check over an allowlist can only subtract. The review's own event is the one path with no such gate, and it was cancelled. Submitting a review with inline comments emits five events in one second, all resolving to the same target and so to one concurrency group; three of the five were cancelled, `pull_request_review.submitted` among them. Cancelling is safe only because the decision is re-derived, which `dispatcher.yml` says itself. The association gate is what broke that: the survivors returned before reaching `evaluatePr`, so nothing re-derived anything. So the reason, not the gate. A review comment resolves to `review_comment` and delegates to `case 'review'`, which re-derives the PR through `evaluatePr` — the invariant the concurrency block assumes, restored rather than replaced. Whichever of the five survives now sees the thread the cancelled comment created, since `gather.mjs` fetches review threads for any open PR. Only the bot guard differs from `case 'review'`: that case's bot branch carries the critic-header exception, which belongs to reviews alone. Everything after it — the allowlist, bot PR to `evaluatePr`, human PR to `parseVerb` — is shared rather than copied. `association` leaves the review-comment facts with the reason; nothing on the new path reads it. `triggerType` is untouched and still reaches the record, so a handler still finds the comment it was woken for. The gate at `decide.mjs` still guards `issue_comment` proper, where the author is not otherwise bounded, and its test stays green. `dispatcher.yml` is unchanged. Closes #109 Claude-Session: https://claude.ai/code/session_01MZsMPSJuc6xW1xwMZpKu5w Co-authored-by: Claude <[email protected]>
Comment volume, and one fixture that was not earning its place. Three comment blocks restated the narrative that `docs/why.md` already carries under the anchor each of them links — the `CONTRIBUTOR` stamp said in full in three files, and the SahajAtlasWeb#212 incident twice. Each keeps its imperative half and its breadcrumb; the story stays in one place, where it cannot drift. The bot half of the ignore test is what this row's own guard buys, and its fixture did not punish removing it: a body of `finding` fails the critic-header test, so `case 'review'` would have noted it either way. The comment now opens with the critic header on a bot PR with an unanswered own-rooted thread, which is the case the guard exists for. Delete the guard and the test goes red on address-review firing against the bot's own words. Checked by deleting it. Kept, against the pass: the verb-on-a-human-PR test, which reaches `case 'review'`'s verb tail that nothing covered before, and the inert `association: 'CONTRIBUTOR'` in its fixture, because that is the stamp GitHub really sends on that payload. Claude-Session: https://claude.ai/code/session_01MZsMPSJuc6xW1xwMZpKu5w Co-authored-by: Claude <[email protected]>
The review pass caught the comment and `why.md` claiming more than the code does. Both said a surviving leg re-derives the PR's whole state, full stop. That is true through `evaluatePr`, which only bot PRs reach. A human PR takes `case 'review'`'s verb tail, which reads the body the event carried — so a verb left in the review body is still lost when that leg is the cancelled one. The gap predates this change and survives it. Closing it means widening what `gather.mjs` collects, since the snapshot carries issue comments and not review-comment bodies. Named rather than fixed, because it is nobody's surprise the next time it fires. Claude-Session: https://claude.ai/code/session_01MZsMPSJuc6xW1xwMZpKu5w Co-authored-by: Claude <[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
The diff is the ticket and nothing more — one mapping, one row, four tests, one why.md section. Nothing here should not exist. The contract holds: dispatcher.yml is unchanged and the fire record still carries triggerType: 'review_comment', so no handler in the other four repos sees a new shape. The structural question — every PR-surface row reaches evaluatePr by hand — is left to you rather than built.
Findings — one, consider.
decide.mjs:317— the loop's own critic review is the one storm where a surviving leg still does not re-derive, andwhy.md:1184claims otherwise.
What was checked
node --test dispatcher/test/*.test.mjs→ 80 pass. Both sources atmain→ exactly those 4 fail, 76 pass.- Deleted the bot guard, re-ran, test 21 went red. Checked, not trusted.
associationis read only atdecide.mjs:275. Dropping it here breaks nothing.- Nothing downstream branches on the reason name —
fire,apply,gather,sweep, everySKILL.md. git merge-treeagainstmainis clean.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The restored invariant was stated too broadly. On the loop's own critic review every review-comment leg stops at the bot guard, so only the `pull_request_review.submitted` leg re-derives, and cancelling it leaves nothing behind it. The `unlock` the critic's own lock release fires is what covers that case, not this row. why.md now says which legs the claim holds for and names the mechanism that covers the remaining one. The comment above `case 'review_comment'` carried the same overclaim in one clause; it now reads "from a human on a bot PR", which is what the guard two lines below already enforces. Prose only. No behaviour changes: 80/80 specs unchanged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Qcz8KMA9UAMtFUnkJkTAJy
|
One thread, adopted. The critic's finding — Checked before adopting. The claim is wrong, and the work is not lost either way — the
Nothing rebutted, nothing asked. Your two open questions and the structural design question stay in the PR body, untouched. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
hasAccessgate GitHub'sCONTRIBUTORstamp was tripping on every inline comment.dispatcher.ymlstates for itself.Changes
dispatcher/resolve.mjs—pull_request_review_comment.created→ reasonreview_comment, andassociationdrops out of the facts with it.dispatcher/decide.mjs— areview_commentrow abovecase 'review': a bot guard, then delegation.hasAccessatdecide.mjs:275is untouched.dispatcher/test/— four cases, committed red before the fix.docs/why.md— the incident, and what the fix does and does not restore.One commit per behaviour:
3c5bc42the red tests,0a9edd9the fix,22dd968the simplify pass,6a67449a prose correction the review pass earned,bfe449da second the critic earned.Contract impact
dispatcher.ymlis unchanged, but it is the reusable workflow all five repos call, and it checks outmainon every event. This reaches SahajCloud, SahajAtlasWeb, WeMeditateWeb and SahajAtlasWordpress on their next event after merge, with no merge in any of them. Nothing outside this repo's files changes.Test results
claude plugin validate ./workflow --strictnode --test dispatcher/test/*.test.mjsdispatcher/decide.mjsanddispatcher/resolve.mjsrestored toorigin/main, exactly the four new cases fail and the other 76 passManual verification
The suite cannot post a live review, so the combination that caused the outage is only reachable by hand. Both steps want a scratch bot PR.
BOT_DISPATCH=dry, submit a review with two inline comments, and read eachdispatch / actjob log. Every review-comment leg should printreview_comment: plan = label, note, fire:address-review, and none should printwithout write access.BOT_DISPATCH=on, repeat, and confirmaddress-reviewfires once even with thepull_request_review.submittedrun cancelled — one fired session in the PR's status comment, not four.Notes for reviewer
Your two open questions are still yours. The ticket asked to leave
hasAccessalone, so I did, and the existingassociation: 'NONE'case stays green. Flagging thatdocs/why.mdargues the gate "can only ever subtract" while this PR keeps it — that is prose about the general case, not licence for a later reader to delete the remaining gate on its strength alone. Deciding that is a separate change.The invariant is restored for a human's review, not the loop's own. A human PR takes
case 'review''s verb tail, which reads the one body its event carried — so a verb left in a review body is still lost when that leg is the cancelled one. And on the loop's own critic review every review-comment leg stops at the bot guard, so onlypull_request_review.submittedre-derives; theunlockfired when the critic releases its lock is what covers that, by a different mechanism. Both gaps are pre-existing, unchanged by this PR, and now written down —6a67449andbfe449d.Detail — review findings, kept and dismissed
Reuse and efficiency lenses: clean. Both noted the recursive delegation matches
case 'sweep-recheck'→reason: 'unlock'atdecide.mjs:398, so it is the file's existing idiom rather than a new one.Applied from the adversarial review. Its one
considerfinding —why.md:1184claimed whichever of the five legs survives re-derives on a bot PR, which the bot guard makes false for the critic's own review. Checked againstdecide.mjs:317andcase 'unlock'before adopting: the claim is wrong and the work is not lost.bfe449dnarrows the claim and names theunlock. No behaviour change.Applied from the simplify pass. Three comment blocks re-narrated the
docs/why.mdsection they each link — theCONTRIBUTORstamp stated in full in three files, the SahajAtlasWeb#212 incident in two. Each keeps its imperative half and its breadcrumb.Applied, reworked. The pass called the ignore test's fixture dead, and it was right for the wrong reason: a body of
findingfails the critic-header test, socase 'review'would have noted a bot comment either way and the guard bought nothing the assert could see. The comment now opens with the critic header on a bot PR with an unanswered own-rooted thread — the case the guard exists for. Deleting the guard and re-running turns that test red onaddress-reviewfiring against the bot's own words. Checked, not assumed.Dismissed. Collapsing
case 'review_comment'into a fallthrough label: it saves four lines and gives up the distinct note text plus that bot-critic behaviour, which the test above now pins. Dropping the third test as redundant: it is the ticket's fifth acceptance criterion, and it is the only coveragecase 'review''s human-PR verb tail has ever had. Dropping the inertassociation: 'CONTRIBUTOR'from that test's fixture: it is the stamp GitHub really sends on that payload, and a fixture should look like the world it claims to model.Raised, not acted on — a design question for you. The altitude lens argues the fix should be structural rather than per-row: either key the concurrency group so a no-op survivor cannot cancel an actionable sibling, or make every PR-surface reason fall through to
evaluatePrand never return a barenote, with a test enumerating them. Today the invariantdispatcher.ymlrests on is maintained by hand, one case at a time. Filing that as its own ticket is your call — it needs the decision before the code, and this PR is not the place to take it.Noticed, outside the diff, not touched.
gather.mjs:14writesassociationinto every snapshot comment and nothing reads it — that is your second open question, so it stays there rather than becoming a second ticket.gather.mjsalso buildsinlineCountsand then hard-codesinline_count: 0inreviewsShaped, which makes ther.inline_count > 0clause atdecide.mjs:102dead. Harmless today, because the thread loop above it catches the same case — but it sits in exactly the failure domain this PR is about.Not run.
securityReview.triggerPatternmatches no changed path, so the security sweep was skipped.comment-lint.mjsskipped itself — no TypeScript in this repo.Closes #109
🤖 Written by the sydevs autonomous loop — see what this is
🤖 Generated with Claude Code
https://claude.ai/code/session_01MZsMPSJuc6xW1xwMZpKu5w
Generated by Claude Code