You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs(issues): add specification for PR review wait poller - #2584
Adds the issue specification for a deterministic wait-for-review poller that lets AI agents block until reviewers submit reviews on a pull request, without using an MCP server to poll GitHub.
This PR contains the specification only. The poller script and skill changes are implemented later.
Specify a deterministic wait-for-review poller that lets AI agents
block until reviewers submit reviews on a pull request, without
using an MCP server to poll.
Related to torrust#2581
Related to torrust#2003
Co-authored-by: Copilot <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds a spec-only issue document describing a deterministic, gh-backed wait-for-review poller so AI agents can block until PR review activity occurs without MCP polling.
Changes:
Adds a new issue specification for the wait-for-review poller (scope, contracts, decisions, verification policy).
Records baseline/event semantics, CLI behavior expectations, and reviewer-loop exit conditions.
Document that manual verification redirects or pipes the poller's stdout,
since the tool refuses to run on a TTY. Align the folder prefix decision
with the create-issue convention ({issue}-{epic}-).
Related to torrust#2584
Co-authored-by: Copilot <[email protected]>
The repo-level pulls/N/comments listing can omit a reply that is already
visible on its own review (pulls/N/reviews/<id>/comments). The validator then
failed with "reply does not exist" for a reply that GitHub returned on its
thread.
Merge each review's comment listing into the comment set, deduplicated by
comment ID. The in_reply_to check is unchanged.
Co-authored-by: Copilot <[email protected]>
Record the processing of Copilot review 5589436901 on torrust#2584:
- F1 (manual verification vs TTY wording): fixed in ccfde7b
- F2 (folder prefix wording): fixed in ccfde7b
- F3 (last-updated-utc format): no action, the repository uses
"YYYY-MM-DD HH:MM" as documented in docs/templates/ISSUE.md
Related to torrust#2584
Co-authored-by: Copilot <[email protected]>
Mark F1, F2, and F3 as RESOLVED in the Copilot review audit and log the
resolution. Replies were posted before resolving each thread.
Related to torrust#2584
Co-authored-by: Copilot <[email protected]>
[Major][WAIT-001] Check unresolved threads across the whole PR
Restricting this gate to the latest commit lets the loop finish while actionable feedback from an earlier commit remains unresolved. A push and a clean subsequent review do not resolve those threads. .github/skills/dev/pr-reviews/process-pr-review/SKILL.md:98-101 requires no unresolved actionable threads across the PR. Require a latest-head review and check all PR threads, including older or outdated threads.
Post-merge triage of Copilot review 5591068061 (submitted 2026-10-20 20:10 UTC, before the merge at 20:45 UTC).
Finding [Major][WAIT-001]: the spec's review-loop exit condition checks only the latest commit, so unresolved threads from earlier commits can be missed. The finding is still live on develop at fcd78975c (docs/issues/open/2581-2003-pr-review-wait-poller/ISSUE.md, lines 108-110 and 156).
Maintainer decision (José Celano, 2026-10-20 20:53 UTC): audit only. Record WAIT-001 in this PR's audit as FOLLOW_UP with no spec change in this round. The spec fix is deferred to the implementation of #2581.
Record Copilot review 5591068061 finding WAIT-001 in the PR 2584 audit.
The maintainer approved an audit-only disposition in
#2584 (comment).
The spec's latest-commit exit condition is still live on develop; the
fix belongs with the implementation of #2581.
Co-authored-by: Copilot <[email protected]>
…-001
15d17ad docs(pr-reviews): record WAIT-001 audit-only disposition for PR 2584 (Jose Celano)
Pull request description:
Records the maintainer-approved audit-only disposition for Copilot review 5591068061, finding WAIT-001, in the PR 2584 audit record. The review was submitted before PR 2584 merged, and the finding remains live on develop, so this PR adds only the audit record and makes no product change. Approval: #2584 (comment) File: docs/pr-reviews/pr-2584-review/PR-REVIEW.md. Validation: validate-audit-record.py --pr-number 2584 returned status ok with 0 failures, linter all passed, and the pre-commit and pre-push checks passed. Follow-up: the exit condition in the poller spec (docs/issues/open/2581-2003-pr-review-wait-poller/ISSUE.md, lines 108-110 and 156) is still flawed and must be fixed when #2581 is implemented. Related to #2581 and #2584.
ACKs for top commit:
josecelano:
ACK 15d17ad
Tree-SHA512: 6d2a91b119560b6a0435c86ea8dcfa59133a36661592c8868d9ee716915905a78b0fce5d929e50bf73b2124e42700f4dc972746764ace8d4f2e8c26bf6f9b832
Record the maintainer's waiver of the reviewer ACK and the Copilot-approval
merge gate for PR #2584 in the audit Ownership section and Processing Log,
citing the durable waiver comment on the PR.
Co-authored-by: Copilot <[email protected]>
…ocument merge readiness
e31992b docs(skills): document merge-readiness checks in merge-pull-request (Jose Celano)
c2b18f6 docs(pr-reviews): record merge-gate waiver for PR 2584 (Jose Celano)
Pull request description:
## Summary
PR #2584 merged without a reviewer ACK from `da2ce7` or the `Maintainers` team, and Copilot never approved it (Copilot only submits `COMMENTED` reviews). The maintainer waived both for that PR.
## Changes
- `docs(pr-reviews)`: record the waiver in the #2584 audit (Ownership and Processing Log), citing the durable waiver comment #2584 (comment) (created 2026-10-21 07:25:32 UTC).
- `docs(skills)`: add a **Merge Readiness** section to the `merge-pull-request` skill. The repo documented no merge gate before: the ruleset requires 0 approvals and the merge tool only warns about missing ACKs. The rule, as chosen by the maintainer:
- the latest Copilot review is on the head commit and no actionable thread is unresolved (no wait for `APPROVED`);
- the reviewer ACK is recommended and waivable with a recorded maintainer decision;
- the review audit validates;
- agents report unmet checks and never waive them.
## Validation
- `validate-audit-record.py --pr-number 2584`: ok, 0 failures.
- `linter all` and the pre-commit and pre-push hooks passed.
## Related
Related to #2581 and #2584. The poller spec exit-condition fix (WAIT-001) is a separate follow-up PR.
ACKs for top commit:
josecelano:
ACK e31992b
Tree-SHA512: 04c9e647183e58575b61d709d604b760e24b7b35f8e1ccdf62ada83d7a9abaf2e9cc600d42f1f8b4b26b7de1734b8f580d5ceefe025197dca03fbbce851d073f
…he poller exit condition
Copilot finding WAIT-001 on PR #2584 noted that checking unresolved threads
only on the latest commit can overlook actionable feedback from earlier
commits. Count unresolved actionable threads over the whole PR, and align the
end state and ACK requirement with the Merge Readiness section of the
merge-pull-request skill (ACK recommended, waivable with a recorded decision).
Co-authored-by: Copilot <[email protected]>
… in the poller exit condition
f8f53e8 docs(issues): [#2581] count unresolved threads over the whole PR in the poller exit condition (Jose Celano)
Pull request description:
## Summary
Fixes the exit condition in the #2581 poller spec, as approved in the audit-only follow-up for Copilot finding `WAIT-001` (`review-finding:pr-2584-wait-001`) on merged PR #2584. The old condition checked unresolved threads only on the latest commit, so unresolved feedback from earlier commits could be overlooked.
## Changes
- Exit condition: Copilot's latest review is on the head commit, **and** no unresolved actionable thread exists anywhere in the PR, **and** the ACK is present or a waiver is recorded.
- Note that review-body findings without a thread are handled through the audit workflow, not the thread check.
- Align the end state (goal 4) and Decision 1 with the Merge Readiness section added to the `merge-pull-request` skill in #2592 (ACK recommended and waivable).
- Progress log entry and `last-updated-utc` updated.
Spec only: no code, script or skill changes. The implementation stays with #2581.
## Validation
- `linter all` and the pre-commit and pre-push hooks passed.
## Related
Related to #2581, #2584, #2588 and #2592. After this merges, the #2584 audit row for `WAIT-001` should move from `FOLLOW_UP` to `FIXED` with the merge reference (post-merge workflow step 6).
ACKs for top commit:
josecelano:
ACK f8f53e8
Tree-SHA512: ef787b8fddeeba8c437f025c6bd2ef2a7d38b7fbaa6a4cfc7899b78024b9c2365d648c41228f00d6c35050b33e9bca607202c3636f61e4f0899e497de078618c
ae26e2c docs(pr-reviews): record the review audit for PR 2599 (Jose Celano)
5781fb3 docs(pr-reviews): move the WAIT-001 closure entry into the Processing Log (Jose Celano)
46f2c63 docs(pr-reviews): mark WAIT-001 fixed in the PR 2584 audit (Jose Celano)
Pull request description:
## Summary
Closes the loop on Copilot finding `WAIT-001` (`review-finding:pr-2584-wait-001`), step 6 of the post-merge workflow in the `process-pr-review` skill. PR #2596 merged the spec fix (merge commit `d21282aa4`, 2026-10-21 09:33:59 UTC).
## Changes
- WAIT-001: disposition `FOLLOW_UP` -> `FIXED`; resolution reference is the fix commit subject; follow-up PR URL is #2596; current-tree verification re-derived on `develop` at `d21282aa4`.
- Processing Log entry appended. Earlier entries are unchanged. Thread state stays `NON_RESOLVABLE` (review-body finding, no thread). No GitHub thread to resolve.
## Validation
- `validate-audit-record.py --pr-number 2584 --base fcd7897^1`: ok, 0 failures. With the default `--base develop` the validator cannot see commit subjects of an already merged fix, so a wider base was used; F1 and F2 fail with the default for the same reason.
- `linter all` and the pre-commit and pre-push hooks passed.
## Related
Related to #2581, #2584 and #2596.
ACKs for top commit:
josecelano:
ACK ae26e2c
Tree-SHA512: 1ac6fac6510cd96d72ab79e97770a6cb59146e928a25238948ccb40f482604b9d72646efd8b5c365ec4f164209e912fdc19c09ca7568b53ae91a5a149b2850fa
…d-fix subject fix
dca0cd6 docs(pr-reviews): record the review audit for PR 2607 (Jose Celano)
7d1469f docs(issues): update local develop separately in the #2606 M2 scenario (Jose Celano)
6f55bb5 docs(issues): require test-design review gates in the #2606 plan (Jose Celano)
2dbe0d8 docs(issues): record the #2606 reproduction evidence before spec review (Jose Celano)
a18cd04 docs(issues): add issue specification for #2606 (Jose Celano)
Pull request description:
## Summary
Spec-only PR for #2606. `validate-audit-record.py` requires each `FIXED` resolution reference to be a commit subject in `<base>..HEAD`. With an up-to-date base, a merged fix is outside that range, so valid audits fail. With the default local `develop`, they pass only when that branch is stale.
## Evidence
Reproduced on 2026-10-21 at `torrust/develop` = `6da62f0ee`: `--base torrust/develop` fails 3 rows of the PR #2584 audit (F1, F2, WAIT-001) and 1 row of the PR #2599 audit (AUDIT-001). WAIT-001's fix merged in PR #2596, not #2584.
## Proposed fix
Valid subjects come from `<base>..HEAD`, the audited PR's commits, and the commits of every PR in a `Follow-up PR URL` field (`gh api .../pulls/<n>/commits`). The script is 227 lines and the faulty check is one function, so the spec sizes this as a small fix and not a Rust migration.
## Correction
The description of #2599 said the default `--base develop` fails on merged audits. That was wrong: I had tested `--base d21282a^1`. The spec records the accurate behaviour.
## Validation
`linter all` and the pre-commit and pre-push hooks passed. Spec only: no script or skill changes.
## Related
Related to #2606 (EPIC #2278), #2584, #2596 and #2599.
ACKs for top commit:
josecelano:
ACK dca0cd6
Tree-SHA512: 62daafe95dece3470e619ff64cb283e14fc4dc0e64be329d50e5b61b3755cc554e604801179cffbfb79f9999af5837629080695cbc10e072d26ebba4566949ac
…de the local commit range
453c6fa docs(issues): [#2606] cite the checked commit by subject in the evidence (Jose Celano)
1e249e2 docs(issues): [#2606] correct the completion review stamp (Jose Celano)
3e3df26 docs(issues): [#2606] mark the implementation tasks, checks, and criteria done (Jose Celano)
298370c docs(issues): [#2606] record the final recheck, V3, and the existing-audit rerun (Jose Celano)
c888ca0 docs(pr-reviews): [#2606] describe the three commit-subject sources of validate-audit-record (Jose Celano)
b6daa32 fix(pr-reviews): [#2606] exit 2 naming the endpoint when listing PR commits fails (Jose Celano)
ceebff0 test(pr-reviews): [#2606] reject unknown subjects and report gh failures as usage errors (Jose Celano)
097a86f fix(pr-reviews): [#2606] accept fix subjects from follow-up PRs named in the audit (Jose Celano)
bf9928b test(pr-reviews): [#2606] accept a fix subject found only in a follow-up PR's commits (Jose Celano)
1e28a2c fix(pr-reviews): [#2606] accept fix subjects from the audited PR's commits (Jose Celano)
f42bf3e test(pr-reviews): [#2606] accept a fix subject found only in the audited PR's commits (Jose Celano)
445fa35 docs(issues): [#2606] record maintainer decisions and follow-up URL parsing in the spec (Jose Celano)
Pull request description:
## Summary
`validate-audit-record.py` required every `Resolution reference` commit subject to exist in `<base>..HEAD`. With an up-to-date base, a merged fix is no longer in that range, so valid audits failed (`--base torrust/develop` failed 3 rows of the PR #2584 audit and 1 row of the PR #2599 audit). With the default base, a stale local `develop` made the same audits pass by accident. A fix can also merge in another pull request, as the WAIT-001 fix of the PR #2584 audit did in PR #2596.
The valid subjects now come from three sources: the commits of the audited pull request, the commits of every pull request named in a `Follow-up PR URL` field (both fetched with `gh api repos/<owner>/<repo>/pulls/<n>/commits --paginate`, which works after merge), and `<base>..HEAD` for commits not pushed yet. A failed `gh` call while listing commits exits 2 and names the endpoint; it never falls back to `<base>..HEAD`. The script stays a Python prototype.
Closes#2606
## Files touched
- `.github/skills/dev/pr-reviews/process-pr-review/scripts/validate-audit-record.py`: `valid_subjects` replaces `branch_subjects`, new `pulls_to_check`, usage-error exit, help text.
- `.github/skills/dev/pr-reviews/process-pr-review/scripts/test_validate_audit_record.py`: new standard-library `unittest` module with `git` and `gh` faked at the process boundary (7 tests).
- `.github/skills/dev/pr-reviews/process-pr-review/SKILL.md`: the "Validation Script" section describes the three sources.
- `docs/issues/open/2606-2278-validate-audit-record-merged-fix-subjects/`: spec progress, `manual-verification-evidence.md`, and the new `test-design-review.md`.
## Validation
- `python3 -m unittest discover -s .github/skills/dev/pr-reviews/process-pr-review/scripts`: 7 tests pass. Each test increment has its red run and prose-first design review in `test-design-review.md`.
- `linter all` exits 0, and the pre-push hook (nightly checks and the full stable test suite) passed.
- M1: with `--base torrust/develop`, the PR #2584 and PR #2599 audits pass (4 failures before the fix).
- M2: the result is identical with a stale and a current local `develop`, with `HEAD` unchanged.
- M3: an audit copy with a subject that exists in no commit still fails with exit 1.
- Rerun of the 157 audits that have a `FIXED` row: 146 pass; the other 11 also fail with the unmodified script (with more subject failures), for reasons in their own content, so nothing regresses.
- A transient GitHub HTTP 502 during the rerun produced the designed exit 2 naming the endpoint.
The commands, runtime versions, and output are in `manual-verification-evidence.md`. Two `pulls_to_check` tests go beyond the spec's case list; they pin the follow-up URL parsing rule recorded in the spec. The branch was not rebased onto the latest `torrust/develop`.
ACKs for top commit:
da2ce7:
ACK 453c6fa — the three-source subject check, its seven faked-process tests and the #2606 records were recomputed at this head.
josecelano:
ACK 453c6fa
Tree-SHA512: 7fb11856234bf229b672985f2558dc467c8dc9c71f3ef506bb4165b4d1fdf57cde3e4f9784de3a515e8e3b2980105a32fb06ee871a0792dc20c1b0e07c3eda0a
The reason will be displayed to describe this comment to others. Learn more.
This is a post-merge review of the change from #2584 as it stands at e170b9620 on the default branch.
What still runs: the description scopes #2584 as specification only, but 10c2586 in it also changed the audit-record validator and its guide. Its parse_json_arrays, gh_paginated and load_comments are unchanged at .claude/skills/process-pr-review/scripts/validate-audit-record.py:83-112, where the file moved in e3c24d6. Without --comments-file, load_comments unions the pulls/<n>/comments listing with pulls/<n>/reviews/<id>/comments for every review, deduplicated by comment id, and check_row uses that set for the source-comment, review-id, severity and reply-thread checks. valid_subjects now also lists commits through gh_paginated.
[Minor] The per-review loop at .claude/skills/process-pr-review/scripts/validate-audit-record.py:110-111 also takes the authenticated user's own PENDING review, which the reviews listing returns (the repository's review poller filters that state out at .claude/skills/wait-for-pr-review/tool/src/event.rs:84 and .claude/skills/wait-for-pr-review/tool/src/event.rs:296), and that review's comment listing returns its unsubmitted comments. Sequence: a thread reply is left in the auditor's started, unsubmitted review; the audit records its discussion_r<id> as the Reply URL; the reply check at validate-audit-record.py:191-196 finds it with the right in_reply_to_id and the run reports ok, so the guide's "reply before resolving" instruction resolves a thread whose reply no other account can see. Smallest fix: skip reviews whose state is PENDING in that loop, so such a reply fails as reply r<id> does not exist until its review is submitted.
[Minor] The gh calls in load_comments at .claude/skills/process-pr-review/scripts/validate-audit-record.py:107-111 are unguarded, and main calls load_comments (:223) before valid_subjects (:224). In the default mode without --comments-file, a missing gh, an authentication failure, a 404 from a wrong --pr-number, or a 5xx on any one of the 2 + N listings ends the run with an uncaught FileNotFoundError or CalledProcessError traceback, exit status 1 (the status the docstring at :38-39 gives an inconsistent audit) and no JSON summary line. The exit-2 handling that 0d26ebb added for a missing gh (:142-147) is therefore reached only with --comments-file; the tests at .claude/skills/process-pr-review/scripts/test_validate_audit_record.py:98-104 call valid_subjects alone and do not see this. Smallest fix: move that try/except into gh_paginated (:97-99) so every listing exits 2 naming its endpoint, and add the same missing-gh test for load_comments.
[Minor] The merge runs only when the script fetches. The replacement-pull-request recipe at .claude/skills/process-pr-review/SKILL.md:211-221, added by 102036e, builds --comments-file from the two pulls/<n>/comments listings alone, so the spurious reply r<id> does not exist failure that 10c2586 fixed comes back in that flow, and .claude/skills/process-pr-review/SKILL.md:298-301 does not say the merge is skipped with --comments-file. Smallest fix: have the recipe also append each submitted review's pulls/<n>/reviews/<id>/comments listing for both pull requests, and say at SKILL.md:298-301 that the merge applies only when the script fetches.
[Nit] parse_json_arrays at .claude/skills/process-pr-review/scripts/validate-audit-record.py:89-91 extends its result with whatever value it decodes. A JSON object in a --comments-file, such as an error body captured when one listing in the brace group at .claude/skills/process-pr-review/SKILL.md:216-218 fails, contributes its keys as strings, and validate-audit-record.py:104 then raises TypeError: string indices must be integers; a truncated file raises an uncaught JSONDecodeError. Both end in a traceback with exit status 1 that names neither the file nor the offset. Smallest fix: reject a non-list value and a decode error with a message naming the file and offset, and exit 2.
[Nit] The comment at .claude/skills/process-pr-review/scripts/validate-audit-record.py:108-109 and the text at .claude/skills/process-pr-review/SKILL.md:299-301 call repos/<owner>/<repo>/pulls/<n>/comments the "repo-level listing"; the repository-level listing is repos/<owner>/<repo>/pulls/comments, which the script never reads. Smallest fix: call it the pull-request listing.
Checked and found sound: decoding of concatenated pages with whitespace between them, and of an empty file; deduplication by comment id, which keeps one entry per comment whichever listing returned it; --paginate on the reviews listing and on each review's listing; the unchanged source-comment, review-id, severity and in_reply_to_id checks that consume the merged set; and the verbatim move of lines 83-112 to their current path, with no later edit to them.
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
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.
Summary
Adds the issue specification for a deterministic wait-for-review poller that lets AI agents block until reviewers submit reviews on a pull request, without using an MCP server to poll GitHub.
This PR contains the specification only. The poller script and skill changes are implemented later.
Related to #2581
Related to #2003
Review scope
docs/issues/open/2581-2003-pr-review-wait-poller/ISSUE.md