Repository navigation
chore: standardize PR agent and independent review labeling - #1918
Conversation
Add the PR triage label sync workflow, require agent and review labels in AGENTS.md and the pull request template, and document the new labels in CONTRIBUTING.
|
Review: approved Independent review completed across two rounds (all 4 blocking findings and 6 non-blocking improvements addressed and re-verified):
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b99a8663a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const current = await getCurrentLabels(owner, repo, issueNumber); | ||
| const toRemove = REVIEW_STATUS_LABELS.filter((l) => l !== parsed.status); | ||
| const toAdd = [parsed.status]; |
There was a problem hiding this comment.
Verify the reviewed commit before restoring review labels
When a trusted reviewer submits a pending review of an older commit after a new push, this handler removes review/re-review and restores review/approved even though the current head has not been reviewed. The same problem occurs with a regular comment whose Reviewer: line names an obsolete SHA: neither that SHA nor review.commit_id is checked. I reproduced this with the workflow script and mocked API calls: an old-commit approval replaced review/re-review with review/approved and reviewed-by/codex. Compare the reviewed SHA against the live PR head before applying the verdict so stale reviews cannot undo invalidation.
AGENTS.md reference: AGENTS.md:L65-L65
Useful? React with 👍 / 👎.
|
Review: changes-requested First-principles review found 3 real logic bugs in
|
Fetch the live PR head before applying review verdicts so stale reviews or comments referencing an older commit cannot overwrite review/re-review. Match known agent slugs strictly against the primary agent name before parenthesized model text, reject question marks in Review: lines, and require a Reviewer: header for non-re-review verdicts.
There was a problem hiding this comment.
Devin Review found 2 new potential issues.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| let statusCandidate = null; | ||
| for (const m of prose.matchAll(statusRe)) { | ||
| const candidate = unwrapInline(m[1]); | ||
| if (!candidate || candidate.includes('|') || /[??]/.test(candidate)) continue; |
There was a problem hiding this comment.
🟡 Decision requests with questions ignored
parseReviewComment drops a needs-decision verdict when the reviewer includes the decision question on the same line. Even with the correct commit SHA, the PR keeps its previous review status.
Learn more
A review status line can start with a recognized verdict and then give a reason. The question-mark guard runs before matching that verdict, so it also rejects an explicit request for a decision followed by the question the maintainer needs to answer. The event handler returns without updating labels when the parser rejects the comment.
Example: A collaborator posts Review: needs-decision — Keep the old API? followed by a valid Reviewer: line for the current head. An existing review/approved label stays in place instead of changing to review/needs-decision.
Recommended fix: Distinguish a question attached to the status itself from a question in the explanation. Keep rejecting tentative verdicts such as Review: approved?, but allow a question after a clearly separated needs-decision verdict.
Was this helpful? React with 👍 or 👎 to provide feedback.
| function extractReviewedSha(raw) { | ||
| const cleaned = unwrapInline(raw); | ||
| let last = null; | ||
| for (const m of cleaned.matchAll(/@[ \t]*[`*_]*([0-9a-f]{7,40})[`*_]*(?=$|[\s.,;:)/)\]—–-])/gi)) { |
There was a problem hiding this comment.
🟡 Chinese punctuation hides review commits
extractReviewedSha misses a valid commit SHA followed by 。 or ,. For regular PR comments, the commit check then drops the verdict as if no SHA were supplied.
| for (const m of cleaned.matchAll(/@[ \t]*[`*_]*([0-9a-f]{7,40})[`*_]*(?=$|[\s.,;:)/)\]—–-])/gi)) { | |
| for (const m of cleaned.matchAll(/@[ \t]*[`*_]*([0-9a-f]{7,40})[`*_]*(?=$|[\s.,;:。,;:)/)\]—–-])/gi)) { |
Was this helpful? React with 👍 or 👎 to provide feedback.
|
Review: approved Independent re-review passed on
|
Issue
No issue (repository workflow and contributor guidance).
Agent
Agent: Antigravity (Gemini 4 Neon)
What changed / 改了什么
.github/workflows/pr-triage-labels.yml(zero-checkoutactions/github-script) to automatically syncagent/*labels from the PRAgent:line, sync mutually-exclusivereview/*andreviewed-by/*labels from trusted collaborator review comments (Review:/Reviewer:), and invalidate stalereview/approved/review/changes-requestedlabels toreview/re-reviewwhen new commits are pushed..github/pull_request_template.mdwith an explicit## Agentsection.AGENTS.mdto requireAgent:lines,agent/*labels, release milestones when decided, and structured independent review comments +review/*/reviewed-by/*labels.agent/*,review/*, andreviewed-by/*labels inCONTRIBUTING.mdandCONTRIBUTING.zh.md.Changelog
none
How I checked it / 怎么验证的
npm test(inds-bot/): not run (only workflow and markdown documentation files changed)node scripts/build-client.mjs --check: not run (src/client/untouched)npm run lint: not run (ds-bot/untouched).github/workflows/pr-triage-labels.ymlwith Ruby YAML parser and 28 Node unit/event test cases covering CRLF, code fences, bold markdown, primary-name-first agent matching, Chinese punctuation, fork PR handling, closed PR gating, andsynchronizeinvalidation.git archive HEAD+node scripts/scan.mjs: 0 must-fix findings.Checklist / 检查
src/client/changed →npm run buildran andclient.jsis committed. (not changed)Co-authored-by.