Repository navigation
trusted direction: only a trusted author's comment, review or inline comment counts, in pr-poll, pr-watch and pr-qa; pr-thread.mjs (#151) - #152
Merged
Conversation
deanbot
marked this pull request as ready for review
November 2, 2026 01:19
# Conflicts: # adapters/kiro/skills/start-executor/SKILL.md
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.
What changed and why
An unprefixed comment, a formal review or an inline comment was taken as the operator's direction from anyone who could comment on the PR. #148 limited role-prefixed comments to trusted authors; this does the same for everything else in a PR thread.
lib/block.mjs:trustedItems(agents, items)keeps only a trusted author's items (trusted-authors, elseallow-author-associations). It keeps nothing when the block is unreadable.ROLE_PREFIXis gone.pr-poll.mjs,pr-watch.mjs,pr-qa.mjsfilter every comment, review and inline comment through it before reading the thread. An outsider's item wakes no waiter, raises noNEW_*,REVIEW_COMMENTSorQA_READYsignal, and is not an unanswered inline thread that holds backMERGE_READY.NEW_*signal, and the stderr line now says(MERGE_READY and comments withheld). CI_FAILING, MERGE_CONFLICT and MERGED still come through. No cursor is seeded or moved, so the next run that reads the block is a first run and doesn't replay old comments as new. This also fixes verdicts: only a trusted author's role-prefixed comment counts, in pr-poll and pr-watch (#148) #150's first-poll replay, where a blind first poll seeded nothing useful and a later run re-reported old comments. pr-qa prints NONE and keeps its state. A waiter's pass throws, so the failure is logged and retried.scripts/pr-thread.mjs --repo <owner/repo> --pr <n>prints the trusted thread, oldest first:COMMENT,REVIEWandINLINEblocks with indented bodies, thenUNTRUSTED <count>(the count only, with no text and no logins), orEMPTY. It exits 2 with apr-thread:line when the block can't be read, and then reads no comments at all. It exits 1 on bad arguments without callinggh.pr-thread.mjs. They never fetch the items it leaves out and act on nothing when it exits 2.gh pr view --commentsis gone from every text except the rule that forbids it.Done, and the checks that show it
All of these are in
scripts/test/run.mjs, section "trusted direction (#151)", unless a section is named.id:.trusted-authorslist overrides the associations.NEW_*, CI_FAILING still comes through, exit 0, and none of the three cursors is seeded. The next readable run replays no history. The pr-poll section also covers MERGE_CONFLICT with the block unreadable, and the 404 and over-1 MB cases.--max.REVIEW_COMMENTS:7.pr-qa:stderr line, exit 0), then givesQA_READY:7once the block is readable.trusted-authors, exit 2 on an unreadable block with no comment read, exit 2 on a gh failure, bad arguments, and#7.Mutation-checked, each caught by the tests above:
Calls a reviewer might push back on
id:.pr-thread.mjs. Putting ids in the signal and having the model filter would still let the model read an outsider's text. This way the adapter contract doesn't change.reviewDecisionis left as GitHub computes it. I haven't verified that GitHub counts only write-access reviews there.Known limits
Restart note
All three roles (executor, reviewer, QA) need a fresh session: the texts and the signal scripts changed. Setup does not need to be re-run (
setup-project.shis unchanged).Closes #151