ci: trust same-head OpenCode review OID - #458
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts the CI PR review/merge scheduler so an OpenCode “APPROVED” review attached to the exact current PR head commit OID is treated as current-head approval, eliminating false negatives caused by relying on Git timestamps.
Changes:
- Simplifies current-head review validation to an OID equality check (
review.commit.oid == headRefOid). - Removes the committedDate/submittedAt ordering-based staleness logic and the related auto-merge disable branch.
- Updates
self_test()expectations to reflect the new approval semantics.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
OpenCode Review Overview
Pull request overviewReviewed workflow files and dependencies; no issues detected. FindingsNo blocking findings from OpenCode's independent review. Verification
Gate evidence
|
There was a problem hiding this comment.
OpenCode reviewed the current-head evidence but found unresolved human review threads before approval.
- Problem: OpenCode reached an APPROVE control result, but the approval step found unresolved, non-outdated human review thread evidence on the current pull request.
- Root cause: Human review feedback can arrive after bounded model evidence is prepared, so the approval step must re-query GitHub immediately before publishing an approval.
- Fix: Address or resolve the listed human review thread(s), then re-run OpenCode on the current head.
- Regression test: Keep the approval gate querying reviewThreads(first: 100) after model output and before create_pull_review APPROVE.
Review thread evidence
Latest unresolved human review thread evidence
scripts/ci/pr_review_merge_scheduler.py line 329
-
Latest human comment: @copilot-pull-request-reviewer at 2026-06-25T17:16:54Z
-
Comment URL: #458 (comment)
-
Comment excerpt: This PR removes the timestamp-based staleness helpers/messages (e.g.
stale_current_head_review_reason,review_submitted_datetime(review), and thesubmitted_at > head_time/ "does not postdate" text). The supply-chain policy testservices/analysis-engine/tests/test_supply_chain_policy.pycurrently asserts those exact strings exist in this file (around lines 5015–5023), so CI will fail unless that test is updated to match the new OID-only contract. Also, after removing the timestamp comparison logic, the GraphQLcommits(last: 1) { ... committedDate ... }fields appear unused by the sch -
Result: REQUEST_CHANGES
-
Reason: unresolved human review thread(s) were present before approval.
-
Head SHA:
99c9b98bfef9f8c25ed0faa10032f86f5f077b24 -
Workflow run: 28187945340
-
Workflow attempt: 1
There was a problem hiding this comment.
Pull request overview
Reviewed workflow files and dependencies; no issues detected.
Findings
No blocking findings from OpenCode's independent review.
Verification
- Review source: independent OpenCode review of the current checkout, focused changed hunks, and current-head GitHub Check evidence.
- Structural exploration: completed before approval; if structural exploration, changed-file inspection, or evidence completeness is missing, OpenCode must not approve.
- Result: APPROVE
- Reason: No source-backed blockers found and structural exploration completed.
Gate evidence
- Head SHA:
99c9b98bfef9f8c25ed0faa10032f86f5f077b24 - Workflow run: 28189055131
- Workflow attempt: 1
Summary
Evidence
review.commit.oid == headRefOid, but the scheduler blocked them as lacking current-head approval because committedDate was later than submittedAt.Validation
python3 scripts/ci/pr_review_merge_scheduler.py --self-testpython3 -m py_compile scripts/ci/pr_review_merge_scheduler.pypython3 scripts/ci/pr_review_merge_scheduler.py --repo ContextualWisdomLab/bandscope --base-branch develop --project-flow git-flow --dry-run --no-trigger-reviews --enable-auto-merge --update-branches --max-prs 100git diff --check