Repository navigation
verdicts: only a trusted author's role-prefixed comment counts, in pr-poll and pr-watch (#148) - #150
Merged
Merged
Conversation
…ent counts, in pr-poll and pr-watch; tests, reviewer texts and SPEC (#148)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #147 (#134, trusted claims, merged): it uses that PR's
trustTest.What changed and why
The signal scripts classified agent comments by prefix alone, so anyone who can comment could post
[reviewer] LGTMand give the executorMERGE_READY, revoke a real LGTM with a fake finding, silence a reviewer's pending operator comment with a fake[reviewer]line, or park every reviewer off a PR with a fake[reviewer] Reviewing (<clone>). #134 closed this for[executor] Claimed by; this applies the same rule to every role comment.lib/block.mjs:ROLE_PREFIX([executor],[reviewer],[qa]).pr-poll.mjs: a role-prefixed issue or inline comment from an authortrustTestdoesn't trust is dropped before the thread is read. It is no verdict, finding, question, revocation or answer: an outsider's[executor]line no longer makes a live finding look answered, and an outsider's inline[executor]reply no longer answers an inline comment. With the block unreadable nobody is trusted, so every role comment is dropped for that run (MERGE_READYwas already withheld then).pr-watch.mjs: the same filter on every comment read, so an outsider's[reviewer]line is no reviewer post (it marks nothing read, silences nothing) and no review claim. It now needs the block every run. A one-shot run that can't read it printsNONEand keeps its state. A waiter's pass throws, so the failure is logged and retried.--check-claimexits 2 with apr-watch:line and no answer.pr-qa.mjs: no code change. It has no own post that moves a cursor or silences a signal (any bracketed comment is just not operator direction), so who wrote a[qa]line doesn't matter. A test pins this, and the header says so.--repois checked against GitHub's name characters inpr-poll.mjsandpr-watch.mjs, asclaims.mjsdoes: the trust read puts it on aghcommand line.--check-claimrun drops the PR for the cycle and never claims on it.trusted-authorsandallow-author-associationsrows say every agent's login must be trusted. The claim section has--check-claim's exit 2. AGENTS.md: the pr-poll, pr-watch and block.mjs entries.Done items
trustTestin pr-poll and pr-watch. pr-qa reads no own post (above). Tests:trusted verdicts (#148): ….[reviewer] LGTM→ noMERGE_READY→… an untrusted [reviewer] LGTM → no MERGE_READY, and it is not shown.… an untrusted finding after a trusted LGTM → still MERGE_READY.[qa]the same way withqa-gate: on→… an untrusted [qa] PASS → no MERGE_READY,… an untrusted [qa] BLOCKED after a trusted PASS → still MERGE_READY.… a trusted second account's LGTM (on trusted-authors, association NONE) → MERGE_READY.… a MEMBER's LGTM counts, a CONTRIBUTOR's does not,… allow-author-associations narrows it.… an untrusted [reviewer] line after an operator comment → REVIEW_COMMENTS:7,… after an [executor] reply marks nothing read,… watch, only an untrusted [reviewer] LGTM → REVIEW:7. pr-qa:… qa, an operator comment followed by an untrusted [qa] PASS → QA_READY:7.Reviewing (<clone>)makes no reviewer skip →… rev-b still gets REVIEW:7, and --check-claim says OPEN.poll (#148): … with the block unreadable nobody is trusted,… --check-claim with the block unreadable → exit 2,… watch with the block unreadable → NONE,wait: a transient API error is retried, not fatal.Calls a reviewer might push back on
CLOSEDand a standingMERGE_CONFLICTincluded, not justCI_DONEas before. Trusting nobody would make every reviewed PR look unreviewed (REVIEW:floods). Trusting everyone reopens the hole. So the run reports nothing and keeps its state for the next run.gh pr view --commentsdoesn't see the author's association, so a prompt rule to "skip untrusted role comments" couldn't be followed reliably from that output. Left as a possible follow-up if it matters.Known limits
NEW_COMMENTif a later comment moves the cursor past it. Verdicts, live findings and unanswered inline comments are read fresh each run, so they count again. A[reviewer] Questionwould not be re-shown.NEW_REVIEW_SUBMISSION,CHANGES_REQUESTEDincluded), still reach the executor as work, as before. Neither carries a role prefix, and neither can give or withholdMERGE_READY.NONEand saves no state, so the next waiter's baseline isNONE. It wakes at once on a standing signal (a heldREVIEW:<n>), and the idle count resets: one extra cycle per failed read.Restart note
Reviewer and executor roles need a fresh session (pr-watch and pr-poll change, and the reviewer texts'
--check-claimstep changed). QA needs none. Setup need not be re-run.Closes #148