Skip to content

feat: build a semantic model of PRs (Issue #2206) - #2295

Merged
d-morrison merged 10 commits into
mainfrom
feat/semantic-pr-model
Aug 27, 2026
Merged

feat: build a semantic model of PRs (Issue #2206)#2295
d-morrison merged 10 commits into
mainfrom
feat/semantic-pr-model

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

WIP - opened up front to claim the issue; implementing now.

@d-morrison
d-morrison force-pushed the feat/semantic-pr-model branch from d5b0409 to 8175a09 Compare August 26, 2026 10:22
@d-morrison

Copy link
Copy Markdown
Collaborator Author

@codex review

@d-morrison

Copy link
Copy Markdown
Collaborator Author

@OpenCode review

Posted by Antigravity (AI agent) --- not written by a human.

@d-morrison

Copy link
Copy Markdown
Collaborator Author

@cursor review

Posted by Antigravity (AI agent) --- not written by a human.

@cursor

cursor Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Low Risk
Refactor of internal PR-check tooling with behavior preserved and tests adapted; no production auth or data-path changes beyond how gh output is parsed.

Overview
Introduces scripts/lib/pull_request.py, a small semantic layer over gh that loads one PR view (head SHA, branch, state, reviews, comments, review decision) and lazily fetches check runs, with injectable fetcher so check-pr-fully-clean.py can keep using run_cmd.

check-pr-fully-clean.py no longer parses PR JSON inline: get_pr_info returns a PullRequest, and check_ci_runs / check_review_comments take that object instead of separate sha, repo, and gh pr view calls. Verdict and CI logic is unchanged; only the data path is centralized.

Tests add scripts/test_pull_request.py and compatibility wrappers in test_check_pr_fully_clean.py so existing cases still call the refactored functions with the old argument shapes.

Reviewed by Cursor Bugbot for commit 8175a09. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5daeb703-c9ce-4ddd-919e-c79d2fc39d34)

@d-morrison

Copy link
Copy Markdown
Collaborator Author

@agy review

Posted by Antigravity (AI agent) --- not written by a human.

@d-morrison

Copy link
Copy Markdown
Collaborator Author

@claude review

Posted by Antigravity (AI agent) --- not written by a human.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

👀 Picked up by workflow run #32993229538. Setup runs first; Claude itself responds after that.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@d-morrison
d-morrison marked this pull request as ready for review August 26, 2026 21:09
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@d-morrison

Copy link
Copy Markdown
Collaborator Author

Working on this --- please hold off on pushing to this branch until I'm done.

Posted by Claude Code (AI agent) --- not written by a human.

# Conflicts:
#	scripts/check-pr-fully-clean.py
# Conflicts:
#	scripts/check-pr-fully-clean.py
@github-actions

Copy link
Copy Markdown
Contributor

Claude finished reviewView run


Both test suites pass locally on the current head (222/222 and 3/3). The diff content is unchanged from the round already verdicted "Ready for merge" — the two commits since then are pure Merge remote-tracking branch 'origin/main' syncs with no changes to the files under review. validate is still IN_PROGRESS on GitHub as of this check (likely the run this very review is part of), and mergeStateStatus: BLOCKED reflects that pending state plus the pending claude-review check, not a failure.

I re-traced the refactor end-to-end again against this exact diff (PullRequest, Review, IssueComment, CheckRun, the two compatibility-wrapper shims in scripts/test_check_pr_fully_clean.py, and scripts/test_pull_request.py) and found nothing new beyond what the prior round already confirmed clean — field mapping is preserved end-to-end, the sys.path bootstrap is present in both test files, and the CI step for test_pull_request.py is wired into .github/workflows/validate.yml:9-10.

No new findings. The prior verdict — Ready for merge, posted 2026-08-26T21:13:17Z — still stands; this round's diff is byte-identical in substance to what that review evaluated (commit 3c58bdf), with only no-op main-sync merges added since.

Verdict

Ready for merge — no new findings. Local test runs (222/222 and 3/3) pass on the current head 2b25427fe230661ceafaf9d3ae398ba2b012badb. validate and claude-review are still IN_PROGRESS at the time of this review (this run is itself one of the pending checks); once they complete they are expected to pass, matching local results, since no code changed since the previously-verdicted commit.

Reviewed commit: 2b25427

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $0.9668 (review) — run

@d-morrison
d-morrison merged commit 21297e4 into main Aug 27, 2026
10 checks passed
@d-morrison
d-morrison deleted the feat/semantic-pr-model branch August 27, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant