Skip to content

Add an author preflight for Pyright changes - #12037

Merged
Bill Schnurr (bschnurr) merged 2 commits into
microsoft:mainfrom
bschnurr:docs/pyright-author-preflight
Nov 18, 2026
Merged

Bill Schnurr (bschnurr) merged 2 commits into
microsoft:mainfrom
bschnurr:docs/pyright-author-preflight

Conversation

@bschnurr

@bschnurr Bill Schnurr (bschnurr) commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Why

A PR can fix its motivating example and still regress a nearby case. In #11951, a call spelled issubclass could refer to a shadowing function rather than the builtin, and a bad return in a reachable branch went undiagnosed. The goal is to help authors catch assumptions like this while the change is still local or in draft, without waiting for a full review.

What changes

  • Add an opt-in author preflight to pyright-pr-review. It reviews selected local changes or a draft PR directly, without launching the five specialists. For typing changes, it compares the motivating case, a nearby valid case, and a nearby invalid case against the base. It checks exact inferred types and diagnostic locations rather than just error counts. It reports what ran, how to replay findings, and what remains untested. It does not edit tracked files, post to GitHub, or issue a merge verdict. Full review remains the default.
  • Make shortcut assumptions explicit in the shared TypeSpec skill. For every new or changed early exit, fast path, cache reuse, or fallback that skips work, identify what triggers it, what that condition actually guarantees, and what the skipped path would have produced or done. Then try to keep the shortcut active while changing something its condition does not check. In the issubclass example, shadow the name and check whether the diagnostic inside the reachable branch is preserved. Preflight probes the riskiest contracts first and marks the rest untested.

What the review feedback added

A qualitative pass over public feedback on the original 60-PR queue surfaced gaps beyond shortcut assumptions:

How to try it

Select pyright-pr-review and ask: “Preflight my local analyzer changes against upstream main. Run the motivating case and nearby valid and invalid controls. Show me how to replay any failures. Do not edit or publish anything.”

Validation

Prettier, git diff --check, and links between the agent, skill, and guide passed. The new mode has not been exercised end to end. This PR changes instructions and docs only; it does not change the analyzer or add a CI gate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bschnurr
Bill Schnurr (bschnurr) marked this pull request as ready for review November 18, 2026 17:49
@rchiodo

Rich Chiodo (rchiodo) commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR.

@rchiodo

Copy link
Copy Markdown
Collaborator

Reviewed commit: ba08f648bd206a26ae3715f8a5716090709c4a11

Result: 🔴 could-not-verify

Verification details

Verification: Automated verification is best effort. The PR author remains responsible for testing.

Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: C:\Users\rchiodo\AppData\Local\Programs\Podman\podman.EXE --connection pyrx-automation failed: stderr: Error: unable to start container "35b98b7c3c1af0c646c3287227daca1a51cfb3be5271c6bc109c7cf8da1eda10": crun: open `memory.max` for writing: No such file or directory: OCI runtime attempted to invoke a command that was not found

Test runs: none recorded.

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@rchiodo Rich Chiodo (rchiodo) added the review-auto:approved Automated review: no blocking findings (approval posted). label Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@bschnurr
Bill Schnurr (bschnurr) merged commit 8daba0c into microsoft:main Nov 18, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants