Repository navigation
feat[ci]: add AI review disposition checks - #24
liaoxiang0304 wants to merge 21 commits into
Conversation
Problem: - AI review findings need explicit, auditable handling before merge. Solution: - Require each configured bot to complete review for the current PR head. - Validate authorized dispositions, supporting evidence, and resolved threads. - Add a reusable workflow, integration examples, and setup documentation. Test: - Add unit tests for disposition rules, permissions, pagination, and API failures. - Tests not run for this draft. JIRA: PDIST-770
Problem: - Every event scanned all open PRs and shared a repository-wide queue. Solution: - Require a positive PR number and evaluate only that PR. - Pass review-event PR numbers via collector run names. - Serialize check updates per PR and simplify the GitHub.com client. Test: - Python 3.11: 40 unit tests passed. - 12 workflow routing and concurrency cases passed with @actions/expressions. - Workflow YAML contracts and git diff --check passed. - Live Bot review and target-repository deployment were not run. JIRA: PDIST-770
Restore documentation, summary punctuation, and Unicode test fixtures to the exact UTF-8 contents validated locally. Test: - Python 3.11: 40 unit tests passed on these exact contents. - 12 workflow expression cases passed. JIRA: PDIST-770
Problem: - Jira URLs were accepted without checking that a follow-up item exists. Solution: - Remove Jira options and configuration from the checker and callers. - Accept only readable open GitHub issues verified through the Issues API. - Reject missing, closed, inaccessible issues and pull requests. Test: - Python 3.11: 44 unit tests passed. - 12 workflow expression cases passed. - Four read-only live Issue API probes passed; Check writes were mocked. JIRA: PDIST-770
Problem: - Human reviewer threads were skipped by the disposition check. Solution: - Include published inline threads from humans other than the PR author. - Reuse the existing template, evidence, permission and resolution checks. - Require a fresh disposition after the originating reviewer updates a thread. - Preserve configured bot identity precedence and the bot completion protocol. Test: - Python 3.11: all 57 tests passed, including 50 disposition tests. - AST checks confirm both bot completion loops and other functions are unchanged. - git diff --check passed. JIRA: PDIST-770
Problem: - Human follow-up discussion invalidated an existing disposition. - Fix required manually copying a full commit SHA. Solution: - Invalidate human dispositions only when the root review comment changes. - Accept current-repository commit URLs alongside full SHAs. - Reuse PR commit membership checks without extra API requests. - Keep AI comment freshness and bot completion rules unchanged. Test: - Python 3.11: all 63 tests passed. - Regression cases cover human follow-ups, root edits and Unresolve. - Commit URL cases cover repository, host, SHA, force-push and API request counts. - AST checks confirm unchanged bot completion loops and existing API reads. - git diff --check passed. JIRA: PDIST-770
Problem: - Requiring a current-head review marker blocks bots that review once per PR. Solution: - Accept submitted reviews or exact successful Codex/infiscale completion comments. - Keep disposition evidence, reply permissions and conversation resolution checks. Test: - 71 unit tests, Ruff checks and 48 real Codex comment replays pass. JIRA: PDIST-770
|
👀 收到,开始 review 检测到 PR 需要 review,正在处理,通常需要 5-10 分钟。完成后会在变更行上留 inline comment。 🤖 Hermes Agent 自动 review |
|
@infiscale-bot review |
Codex Review SummaryThis 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. |
|
👀 收到,开始 review 已收到 🤖 Hermes Agent 自动 review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Problem: - Resolve and Unresolve do not trigger the disposition workflow, leaving stale Check results. Solution: - Validate AI review completion and disposition replies independently of resolution. - Exclude isResolved from snapshots so resolution changes cannot invalidate the second read. - Require GitHub native conversation resolution alongside the required Check in setup docs. Test: - Python 3.11: all 71 unit tests passed. - Ruff lint and format checks passed for both changed Python files. - Regression coverage includes all dispositions and Resolve/Unresolve during evaluation. - Patch whitespace check and AST checks for unchanged bot identity/completion logic passed. JIRA: PDIST-770
Track review rounds and dismissal fallback, restrict Deferred to open issues in the PR repository, and recheck open PRs when an issue changes. Prevent older evaluations from replacing newer check results and revalidate permissions and tracking issues before success. Validation: 94 unit tests, Ruff lint/format, actionlint, and a read-only snapshot of the live PR review data.
|
@infiscale-bot review |
|
👀 收到,开始 review 已收到 🤖 Hermes Agent 自动 review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be25a22a1c
ℹ️ 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".
|
@infiscale-bot review |
|
👀 收到,开始 review 已收到 🤖 Hermes Agent 自动 review |
Problem: - Interrupted evaluations can leave stale or unfinished merge checks. - Edited comments and truncated commit lists can invalidate disposition evidence. Solution: - Pre-register sweep checks, evaluate four PRs in parallel, and recover interrupted runs. - Validate comment editors, complete large PR commit lists, and bound read retries. - Document Codex completion precedence and asynchronous recovery limits. Test: - Python 3.11: 123 unit tests passed. - Ruff lint/format, actionlint, and git diff --check passed. - Read-only GitHub probes verified editor fields and all 794 comparison commits. JIRA: PDIST-770
Problem: - Repeated evaluations create superseded Checks on the same PR head. - Single-PR, sweep and recovery writers can overlap. Solution: - Reopen and update one managed Check ID per PR head without renaming history. - Route every entry point through the same serialized per-PR worker queue. - Keep different PRs parallel and re-evaluate live state during recovery. Test: - Python 3.11: 124 unit tests passed, including 20 evaluations reusing one Check. - Ruff lint/format, actionlint and git diff --check passed. JIRA: PDIST-770
Problem: - GitHub retains a completed Check's conclusion when only its status changes. - A reused Check can otherwise remain successful while evaluation is running. Solution: - Publish a temporary failure with a Checking title before re-evaluation. - Reuse the same ID for interruption cleanup and refresh completion timestamps. - Document the live REST and GraphQL reset limitations. Test: - Python 3.11: 126 unit tests passed; Ruff lint/format and diff checks passed. - Real sandbox probes confirmed status-only and null resets do not revoke success. JIRA: PDIST-770
e727d45 to
0d6ca9c
Compare
Problem: - AI disposition exposed helper checks and could not reset completed results to pending. Solution: - Publish one fixed commit status through a serialized background worker. - Preserve review policies and revalidate live evidence before passing. - Replace PR event collectors with background triggers and five-minute scans. - Skip unchanged scans and block before exhausting the status update quota. - Document the caller migration required for a single visible PR check. Test: - 141 unit tests passed, including repeated pending/success/failure transitions. - Ruff lint/format, actionlint, and git diff --check passed. JIRA: PDIST-770
Problem: - GitHub combined statuses omit creator, preventing repeated disposition updates. Solution: - Read newest-first full status records and stop at the latest matching context. - Model the distinct list and combined response schemas in the test fixture. Test: - Live Actions API probe reproduced the missing creator field. - 143 unit tests passed, including ownership and bounded history reads. - Ruff lint/format and git diff --check passed. JIRA: PDIST-770
Problem: - The first live probe exposed an incomplete creator schema in combined statuses. Solution: - Pin the worker to the corrected PR #24 candidate and retain the same isolated target. Test: - Rerun pending, success, failure and interruption transitions with the Actions token. JIRA: PDIST-770
Problem: - Expected review blocks could cause an unnecessary recovery scan after every poll. Solution: - Report business failures through the single PR status while treating publication as successful execution. - Keep API errors, interrupted verification, and quota exhaustion eligible for recovery. Test: - 146 unit tests passed, including background blocking and execution error cases. - Ruff lint/format, actionlint, and git diff --check passed. - Live API verification of the status lifecycle passed on the prior publisher implementation. JIRA: PDIST-770
为 PR 提供一个固定名称
AI Review / Disposition Check的 AI 审查处理门禁。每个配置的机器人完成审查、所有应处理线程都有授权人工的有效模板及证据时才通过;conversation resolution 和人工 approval 继续由 GitHub 原生规则单独要求。PR Checks 列表使用一个 Commit Status context,显式复查先发布真正的 pending,再更新为 success / failure。后台路由、评估、发布和收尾合并为一个 worker,不再创建自定义 Check Run 或 superseded 项。状态历史仍保留,但不增加当前 PR 的同名条目。
事件入口只在默认分支后台运行:已有 CI 完成、顶层评论、Issue 变化及手动 dispatch 触发复查,每五分钟扫描补全 review、行内回复和 head 变化。定时扫描读取实时证据、权限与 Issue;未变化的终态不重复写入。所有入口共用仓库级串行队列,业务阻断通过唯一 PR 状态表达,执行器错误才触发恢复。接近 GitHub 同一 SHA/context 的 1000 次状态写入上限时保持阻断并提示新提交。
验证(最终候选
e774814f6bbe9f520c3abb6e39d0b1b89e82dfa9):接入与迁移:
statuses: write,并匹配现有 CI 的 workflow 名称。仅升级共享脚本不能隐藏下游旧工作流产生的 Checks。边界:五分钟是计划扫描频率,仍受 GitHub 排队/调度影响;事件发生到 worker 处理前旧状态可能短暂可见。API 所有权读取与写入不原子,硬取消/API 不可用仍存在异步窗口。只支持 GitHub.com 同仓库 PR/Issue;同一 head 被多个 PR 共用、fork 和 merge queue 不在本次验收范围。
JIRA: PDIST-770