Repository navigation
Conversation
[ghstack-poisoned]
PR Status: in progressA maintainer requested changes. Please address their feedback before the PR returns to maintainer review. To become ready for review, the change must pass automated review and every maintainer comment must be addressed, either with a code change or a reply explaining why no change is needed. A fresh automated review checks that the feedback has been addressed. All CI must finish and Dr. CI must classify every failure as unrelated to your PR. Fix the failures it attributes to your PR (see status below in this comment). Workflows waiting for a maintainer to approve their run do not block this. To minimize iteration time, feel free to run the pr-review skill from the repo locally. If you address comments without pushing, comment 🟡 AUTOMATED REVIEW - Changes requested:
Findings (17): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/202962
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 493a386 with merge base 78def3c ( 🟡 GREEN LIGHT - OUTDATED (earlier commit) - PR requires human review:
reason: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
[ghstack-poisoned]
## Human Note Often issues come in that match umbrellas, there are 2 types -> close the sub issue and put inot the main umbrealla, or open up subissues and link back. This supports both ## Agent Notes Give each approved umbrella a checked-in `link` or `close` rule: #195547 closes covered hardening reports, while #198017 and #197554 keep individual issues open with a reference. The model identifies a covered or uncertain match; the trusted apply step chooses the action, verifies the current source and target, and posts a fixed source-only comment. Pending information, uncertainty, review, and priority prevent umbrella closure. Duplicate closure records the validated target's database ID. Retries avoid repeated comments, and umbrella bodies/checklists are untouched. The first-pass workflow explicitly checks related issues and the catalog before submitting a plan. A bot-authored pending-close receipt lets the apply step finish or retry a close after adding its own PT2 routing label, without bypassing genuinely pre-routed issues. Existing unannotated triage decisions retain their behavior. ### Test Plan ```sh python3 -m unittest discover -s scripts/issue_triage_pi -v ``` 108 tests pass, including source-only writes, target validation, and stateful PT2-routing retry regressions. Two new regressions failed before the routing fix and pass afterward. ## Validation [Read-only ciforge replay](https://github.com/pytorch/ciforge/actions/runs/41334550185) exercised close, link, and no-umbrella cases. [Real Actions-token write probe](https://github.com/pytorch/ciforge/actions/runs/41339792819) verified linking and duplicate closure with zero-write retries on disposable fixtures. The job failed its obsolete event-based check; subsequent direct API reads confirmed [#704](pytorch/ciforge#704) has `duplicateOf` pointing to [#702](pytorch/ciforge#702). All fixtures were closed and the temporary probe deployment was removed. No existing PyTorch reports were changed. The later PT2-routing receipt fix is covered by local stateful tests, not this live probe. ## Linked issue or supporting maintainer Umbrella policy evidence: #195547, #198017, and #197554. This does not modify their existing members. ## BC-breaking? No public PyTorch API change. ## Summary (human written only) ## Agent details (if applicable) AI-assisted implementation and validation are described in Agent Notes above. ghstack-source-id: 61bee31 Pull-Request: #202962
## Human Note Often issues come in that match umbrellas, there are 2 types -> close the sub issue and put inot the main umbrealla, or open up subissues and link back. This supports both ## Agent Notes Give each approved umbrella a checked-in `link` or `close` rule: #195547 closes covered hardening reports, while #198017 and #197554 keep individual issues open with a reference. The model identifies a covered or uncertain match; the trusted apply step chooses the action, verifies the current source and target, and posts a fixed source-only comment. Pending information, uncertainty, review, and priority prevent umbrella closure. Duplicate closure records the validated target's database ID. Retries avoid repeated comments, and umbrella bodies/checklists are untouched. The first-pass workflow explicitly checks related issues and the catalog before submitting a plan. A bot-authored pending-close receipt lets the apply step finish or retry a close after adding its own PT2 routing label, without bypassing genuinely pre-routed issues. Existing unannotated triage decisions retain their behavior. ### Test Plan ```sh python3 -m unittest discover -s scripts/issue_triage_pi -v ``` 108 tests pass, including source-only writes, target validation, and stateful PT2-routing retry regressions. Two new regressions failed before the routing fix and pass afterward. ## Validation [Read-only ciforge replay](https://github.com/pytorch/ciforge/actions/runs/41371417099) proposed closing #201797 into #195547, linking #196694 to #198017 while keeping it open, and keeping #202948 open without an umbrella. Apply was skipped; no issues were changed. [Real Actions-token write probe](https://github.com/pytorch/ciforge/actions/runs/41339792819) verified linking and duplicate closure with zero-write retries on disposable fixtures. The job failed its obsolete event-based check; subsequent direct API reads confirmed [#704](pytorch/ciforge#704) has `duplicateOf` pointing to [#702](pytorch/ciforge#702). All fixtures were closed and the temporary probe deployment was removed. No existing PyTorch reports were changed. The later PT2-routing receipt fix is covered by local stateful tests, not this live probe. ## Linked issue or supporting maintainer Umbrella policy evidence: #195547, #198017, and #197554. This does not modify their existing members. ## BC-breaking? No public PyTorch API change. ## Summary (human written only) ## Agent details (if applicable) AI-assisted implementation and validation are described in Agent Notes above. ghstack-source-id: 61bee31 Pull-Request: #202962
[ghstack-poisoned]
## Human Note Often issues come in that match umbrellas, there are 2 types -> close the sub issue and put inot the main umbrealla, or open up subissues and link back. This supports both ## Agent Notes Give each approved umbrella a checked-in `link` or `close` rule: #195547 closes covered hardening reports, while #198017 and #197554 keep individual issues open with a reference. The model identifies a covered or uncertain match; the trusted apply step chooses the action, verifies the current source and target, and posts a fixed source-only comment. Pending information, uncertainty, review, and priority prevent umbrella closure. Duplicate closure records the validated target's database ID. Retries avoid repeated comments, and umbrella bodies/checklists are untouched. The first-pass workflow explicitly checks related issues and the catalog before submitting a plan. A bot-authored pending-close receipt lets the apply step finish or retry a close after adding its own PT2 routing label, without bypassing genuinely pre-routed issues. Existing unannotated triage decisions retain their behavior. ### Test Plan ```sh python3 -m unittest discover -s scripts/issue_triage_pi -v ``` 108 tests pass, including source-only writes, target validation, and stateful PT2-routing retry regressions. Two new regressions failed before the routing fix and pass afterward. ## Validation [Read-only ciforge replay](https://github.com/pytorch/ciforge/actions/runs/41371417099) proposed closing #201797 into #195547, linking #196694 to #198017 while keeping it open, and keeping #202948 open without an umbrella. Apply was skipped; no issues were changed. [Real Actions-token write probe](https://github.com/pytorch/ciforge/actions/runs/41339792819) verified linking and duplicate closure with zero-write retries on disposable fixtures. The job failed its obsolete event-based check; subsequent direct API reads confirmed [#704](pytorch/ciforge#704) has `duplicateOf` pointing to [#702](pytorch/ciforge#702). All fixtures were closed and the temporary probe deployment was removed. No existing PyTorch reports were changed. The later PT2-routing receipt fix is covered by local stateful tests, not this live probe. ## Linked issue or supporting maintainer Umbrella policy evidence: #195547, #198017, and #197554. This does not modify their existing members. ## BC-breaking? No public PyTorch API change. ## Summary (human written only) ## Agent details (if applicable) AI-assisted implementation and validation are described in Agent Notes above. ghstack-source-id: 5d405cd Pull-Request: #202962
[ghstack-poisoned]
[ghstack-poisoned]
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9524e2ca6
ℹ️ 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".
| and any( | ||
| pt2_close_receipt(repo, annotation["issue"], target["id"]) | ||
| in body.splitlines() | ||
| for body in bot_comments |
There was a problem hiding this comment.
Reject completed close receipts after a human reopens the issue
If a maintainer reopens an issue after a successful PT2 umbrella closure, rerunning the apply job with its saved plan closes the issue again. The receipt remains in the bot comment permanently, so pending_pt2_close() treats the completed operation as interrupted and bypasses the existing oncall: pt2 skip. This is reproducible with the stateful test mock: apply successfully, reopen the source, then reapply the same plan; another closing PATCH is issued. Distinguish an unfinished close from a completed close followed by reopening, for example by checking subsequent close/reopen timeline events before accepting the receipt.
Useful? React with 👍 / 👎.
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
There was a problem hiding this comment.
Automated review of 493a386: changes requested before human review.
The PR adds a checked-in umbrella catalog (umbrellas.json) and apply_plan.py logic so the triage bot can link a new issue to an approved umbrella or close it as a duplicate. This re-review at 493a386 finds every finding from the earlier review still unaddressed. Recommendation: Request Changes.
🔴 4 blocking findings are attached to the code below.
⚪ 13 non-blocking findings
pytorch/scripts/issue_triage_pi/apply_plan.py
Line 360 in 493a386
A rerun can close an issue a human reopened. The state_reason != "reopened" guard only covers the PT2 bypass, although the comment at :357 states it as a general rule. On a non-PT2 # 195547 issue, a manual rerun or dispatch of apply finds the marker and no stops, so it sends the close PATCH again. Fix: apply the reopened check to every umbrella close.
pytorch/scripts/issue_triage_pi/apply_plan.py
Line 205 in 493a386
The PT2 close-receipt mechanism adds a lot of state for a narrow case (:201-236, :306-316, :357-364, :446). It opens a second way past the "already has an oncall: label, skip" rule, which SKILL.md Step 0 (:92-100) doesn't document. pending_pt2_close re-derives the close predicate and its set literals from umbrella_comment (:280-292), so the two can drift. "oncall: pt2" in valid_labels (:359) is always true. Fix: treat a newly added oncall: pt2 as link-only, or skip routing labels when closing. Either removes this machinery and about 140 lines of tests.
pytorch/scripts/issue_triage_pi/apply_plan.py
Line 580 in 493a386
The apply_effects contract is confusing. For umbrella plans the effects argument is discarded and recomputed, so callers must use the return value. The plan is None raise at :612-613 can never fire, because :581-582 already raises for the same condition. A close run makes 3 issue GETs, 3 paginated comment fetches and 3 target GETs, re-reads the catalog about 6 times, and reloads labels and templates in current_reference_effects (:558-559). Fix: compute effects once on the apply path and do a single targeted recheck.
pytorch/.github/workflows/issue-triage-pi.yml
Line 136 in 493a386
The workflow prompt change is out of scope. It replaces the explicit instruction to read labels.json, templates.json and pt2-triage-rubric.md with "Consult its reference files as relevant". That changes every triage run, not just umbrella plans, and the PR description neither mentions it nor gives replay evidence for it. Fix: revert it, or move it to its own PR with that evidence.
pytorch/scripts/issue_triage_pi/apply_plan.py
Line 319 in 493a386
The user-facing close text is hard-coded jargon (:317-322). "Covered by the umbrella's scope" doesn't tell the reporter the close was automated or how to dispute it, unlike redirect_to_forum or numerical_accuracy. Also, .agents/skills/triaging-issues/README.md:11 still says templates are "the only comments the bot can post", and this PR doesn't update it. Fix: move the text into a trusted section the model can't select (e.g. in umbrellas.json), add reopen guidance, and update the README.
pytorch/scripts/issue_triage_pi/apply_plan.py
Line 311 in 493a386
Marker detection uses a substring match, while the receipt checks at :233 and :314 match whole lines. Comments from every workflow appear as github-actions[bot], so a bot comment quoting issue text that contains the marker would suppress the reference comment, and the close would still go ahead. Fix: match the marker on a whole line, like the receipt.
pytorch/scripts/issue_triage_pi/apply_plan.py
Line 666 in 493a386
Umbrella closes are reported with the wrong outcome. classify (apply_plan.py:89-96) checks oncall: and triaged before closed, so an umbrella duplicate-close is reported as "triaged" or "routed", never "closed".
pytorch/scripts/issue_triage_pi/apply_plan.py
Line 185 in 493a386
umbrellas.json bypasses the shared loaders and is never validated. umbrella_policy re-reads and re-parses the file on every call, while templates.json and labels.json use loaders in labels.py:56-68. Nothing checks the catalog's shape: "action": "Close" or a missing action silently becomes a link (:290), and a mistyped key sends every plan for that umbrella to review. Fix: add a validating load_umbrellas() to labels.py, load it once in main, and pass it down.
The tests are tied to the live catalog, and no contract test covers it (:15, :69, :133-135, :220). They hard-code 195547 as close, 198017/197554 as link and 69512 as absent, and umbrella_policy always reads the real file. This suite is the "Contract tests" gate in the production prepare job (issue-triage-pi.yml:66-71), so dropping a resolved umbrella from the catalog would fail the gate and stop triage. Fix: patch in a fixture catalog. Add a PlanSchemaTest-style test (test_apply_plan.py:300-315) that checks the catalog shape and that the schema's umbrella.required and match enum match apply_plan.py:179-182.
The test double enforces the disputed rule. It asserts the target read must not retry (:71-74) and only ever raises RuntimeError, so TimeoutExpired is never simulated.
Some assertions can't fail. At :192 triaged is already an existing label, so assertNotIn("triaged", result.add_labels) passes whatever the code does. The loop at :286-290 has no subTest and never asserts umbrella_action == "skip". The failed-close retry test (:354-357) compares only HTTP method names. It never checks state_reason=duplicate or duplicate_issue_id on the retried PATCH.
Several paths have no test. Replay: --replay with an umbrella plan never runs, because the double rejects the events read (:78). Comment/label failures: the double can't fail a comment or label POST. Self-reference guard: number == source (apply_plan.py:191, :265) never decides a test, since SOURCE=203001 isn't a catalog key. Mid-apply human stops: this test only uses PT2 plans, so it reaches only the early return at apply_plan.py:365. It asserts no final labels, comment text or umbrella_action, so it misses the missing review label. Reopened non-PT2 issues: no rerun test, and one would fail today. Also untested: the ValueError paths (:581-582, :637-638), the redirect_oncall umbrella path (:257) and the "invalid target" summary branch.
The schema's umbrella description is narrower than what the code does. It only says "Do not combine with a close decision". The code also sends transfer to review (apply_plan.py:274) and silently drops the umbrella for redirect_oncall or any non-PT2 oncall: label (:257-262). SKILL.md Step 3.5 doesn't mention the redirect skip either, so the model can't tell when the field will be ignored.
Please address the findings and push; a new commit normally gets a fresh automated review.
This review is AI-generated and advisory. Each new automated review replaces the previous one.
| "pytorch/pytorch": { | ||
| "195547": { | ||
| "action": "close", | ||
| "scope": "Missing shape, size, list-length, or boundary validation causing out-of-bounds access, SIGFPE, or sanitizer-only undefined behavior in the missing-validation hardening class: invalid direct ATen/internal calls, extreme parameters, or empty/degenerate inputs. The check is absent in eager, not just lost under compilation. A fully covered instance may use this close policy without adding review solely for its OOB/SIGFPE/sanitizer symptom. Uncertain scope or additional unresolved impact requires review.", |
There was a problem hiding this comment.
🔴 Crash reports can be auto-closed with no human review, and no high-risk label stops it (raised before, no reply). The # 195547 scope lets a covered OOB/SIGFPE/sanitizer report close "without adding review". A covered close gets triaged and bot-triaged but no review label (apply_plan.py:483-497). Only triage review, high priority and needs reproduction stop a close (:224, :281, :283), and the model can't add the last two (labels.py:31,34), so only a label a human applied stops it. security, release triage and module: correctness (silent) are valid labels but don't stop it: a plan with security plus a covered # 195547 annotation still closes. SKILL.md Step 5a (:276-284, :237) still says crashes MUST get triage review. These are likely memory-safety bugs, and closing them rests on one model-written "covered" after reading untrusted text. Ask: add a trusted-code stop for those labels, or add a review label to every bot duplicate-close. Document the exception in SKILL.md and get explicit maintainer sign-off (the cited approval comment can't be checked offline).
| return None | ||
| try: | ||
| return json.loads( | ||
| gh_api([f"repos/{repo}/issues/{annotation['issue']}"], retry=False) |
There was a problem hiding this comment.
🔴 The umbrella target read is never retried (blocking earlier, unchanged). retry=False goes against the gh_api docstring (:73), which reserves no-retry for writes built from a mutable snapshot. In the first evaluation, one transient error returns None. The plan then becomes "review" with triage review (:449-454), and that label blocks closure on every later run (:281). In the final recheck (:614), the same error cancels an approved close after the comment and labels were already posted. subprocess.TimeoutExpired (from timeout=30, :77) is not a RuntimeError, so it escapes the except at :197 and crashes apply halfway through. Fix: use the default retry and catch the timeout.
| if effects.close and effects.umbrella_action: | ||
| if plan is None: | ||
| raise ValueError("umbrella closure requires a plan") | ||
| checked = current_reference_effects(repo, issue, plan) |
There was a problem hiding this comment.
🔴 The "Duplicate of" comment and triaged are posted (:598-610) before the final recheck and the close (blocking earlier, unchanged). If the recheck cancels because a stop label appeared, the issue stays open with duplicate wording and triaged, so it is out of the queue. For PT2 plans the recheck returns early (:358-366): umbrella_action becomes "review" (:618) but no triage review label is posted (:620-625). If the target is closed, the issue gets both triaged and triage review, against :455. The close PATCH runs once with no retry (:640), so one 5xx leaves an open, triaged issue with duplicate wording, and nothing reruns because issue-triage.yml only fires on opened. The marker records only the target, not the action (:305, :311-316). Fix: run the recheck before any write, post the wording and triaged only once the close succeeds (or retry the idempotent PATCH), and put the action in the marker.
|
|
||
| def fetch_umbrella_target(repo: str, source: int, plan: dict) -> dict | None: | ||
| annotation = plan.get("umbrella") | ||
| if not umbrella_policy(repo, annotation) or annotation["issue"] == source: |
There was a problem hiding this comment.
🔴 Every finding from the previous automated review (19b0194) still holds at HEAD. None has a reply and the cited code is unchanged. The only fix since then is a triage review assertion in test_final_recheck_cancels_close_and_marks_review. There are no maintainer comments on the PR. This is one of the reasons given for Request Changes.
|
Starting merge as part of PR stack under #202981 |
…202981) ## Human Note Let agents suggest duplicate issues ## Agent Notes ### Why Finding a likely duplicate should help the reporter, not silently discard their report. Add a suggestion-only path for ordinary issues: explain the possible match, ask the reporter to check it, and leave the final decision to them. This is separate from approved umbrella closure policies. ### What happens After reading a candidate's body and relevant comments, the model can propose `possible_duplicate: <issue number>`. The trusted apply step validates the reference and posts fixed copy linking that issue. It keeps the source open and never writes to the candidate, which may already be open or closed. ```mermaid flowchart TD M["Model reads candidate and proposes possible_duplicate"] --> V{"Source, target and plan are eligible?"} V -->|No| R["No duplicate suggestion; skip or flag review"] V -->|Yes| B{"Matching bot suggestion already posted?"} B -->|Yes| N["Do not repeat the comment"] B -->|No| C["Post fixed linked suggestion"] N --> O["Keep source open; finish any pending labels"] C --> O O --> H["Reporter can confirm the match or explain the difference"] ``` | Scenario | Outcome | | --- | --- | | Plausible same underlying bug, with candidate context read | Suggest the linked issue and ask the reporter to confirm. No automatic closure. | | Similar operator/title, or a report that still reproduces after the candidate's fix | Do not infer a duplicate; keep investigating the new report. | | Self-reference, foreign/PR/unavailable target, catalog umbrella, or conflicting close/umbrella annotation | No ordinary duplicate suggestion; skip or route to review. | | Retry after comment succeeded but label writing failed | Do not repost; finish the pending labels. | The comment asks reporters to move any new reproduction details to the linked issue and close their own issue **only if it is the same problem**. Otherwise they can explain what differs. The model supplies neither a URL nor free-form comment text; same-repository links and the wording are constructed by trusted code. Semantic matching still depends on the model and human judgment. ### Test Plan ```sh PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s scripts/issue_triage_pi -v git diff --check ``` 106 Python tests pass, including 11 new suggestion tests. The initial comment test and a closed-source skip-fallback regression failed before their fixes and pass afterward. [Current PyTorch PR test job](https://github.com/pytorch/pytorch/actions/runs/41384204576/job/125081314456). The Python suite also runs in triage preparation, before the model. ## Validation Before test consolidation, [pinned-runtime ciforge CI](https://github.com/pytorch/ciforge/actions/runs/41379809233) passed 119 Python tests and 4 search-tool tests with Pi 0.99.1. [Read-only ciforge replay](https://github.com/pytorch/ciforge/actions/runs/41379809226) searched and read #200935's body/comments, then proposed it as a possible duplicate of #202764 with no automatic closure. The related-only case stayed open, and the two umbrella controls retained their close/link proposals. Apply was skipped; no comments or issue changes were posted. The positive candidate's comments explicitly confirmed the duplicate relationship, so this is current-context integration evidence, not a blind accuracy benchmark. The related-only case had empty search results. Real-write behavior for this new suggestion path has not been exercised in ciforge; source-only writes and retries are covered by the local tests. ## Linked issue or supporting maintainer Triage-tooling follow-up; #202764 and #200935 were used as a confirmed duplicate replay case. ## BC-breaking? No public PyTorch API change. ## Summary (human written only) ## Agent details (if applicable) AI-assisted implementation and validation are described in Agent Notes above. Pull Request resolved: #202981 Approved by: https://github.com/ezyang, https://github.com/malfet ghstack dependencies: #203124, #202961, #202962
## Human Note
Often issues come in that match umbrellas, there are 2 types -> close the sub issue and
put inot the main umbrealla, or open up subissues and link back. This supports both
## Agent Notes
### Why
An umbrella can mean two different things: a place to consolidate repeated reports, or a tracker
whose individual reproducers must stay open. Similarity alone cannot tell the bot which action is
appropriate. Put that decision in a checked-in catalog, separate from the model's match judgment.
### What happens
The model proposes an umbrella issue and a `covered` or `uncertain` match. The trusted apply step
validates the source, target and decision, then uses the catalog's `link` or `close` policy. All
writes go to the source issue; the umbrella body, checklist and existing members are untouched.
```mermaid
flowchart TD
P["Model proposes umbrella and coverage"] --> V{"Reference permitted?"}
V -->|No| R["Skip or flag for review; no umbrella close"]
V -->|Yes| C{"Covered, close-enabled, and no review or information stop?"}
C -->|No| L["Post fixed reference; keep source open"]
C -->|Yes| W["Post fixed reference and labels"]
W --> F{"Fresh source and target checks still allow closing?"}
F -->|No| O["Do not close; flag review where needed"]
F -->|Yes| D["Close source as duplicate of the validated umbrella"]
```
| Scenario | Policy |
| --- | --- |
| Covered missing-validation hardening report → pytorch#195547 | Close is allowed, subject to the safety checks. This is not permission to dismiss ordinary supported public-API failures. |
| Forward-AD derivative report → pytorch#198017 | Link only; keep the individual reproducer open. |
| Lost compiled validation → pytorch#197554 | Link only; keep the individual report open. |
| Uncertain coverage, review/priority, or pending information/reproduction | Do not close. |
| Invalid target or conflicting close/transfer decision | No umbrella reference; route to review. |
| Already-routed source outside an eligible bot-owned retry, ineligible source, or non-PT2 oncall redirect | Skip the umbrella action. |
A target-specific bot marker avoids repeated comments. For the PT2 case, a pending-close receipt
lets the bot finish its own interrupted operation after adding its routing label, without treating
ordinary preexisting routing as permission to close. Fresh checks still apply on retry. GitHub's
reads and writes are not an atomic transaction.
### Test Plan
```sh
python3 -m unittest discover -s scripts/issue_triage_pi -v
```
95 Python tests pass, including 13 grouped umbrella tests covering source-only writes, target validation, human stops, and retries. The smaller suite still catches the original PT2 first-close and retry failures.
[Current PyTorch PR test job](https://github.com/pytorch/pytorch/actions/runs/41384203855/job/125081309383). The Python suite also runs in triage preparation, before the model.
## Validation
[Read-only ciforge replay](https://github.com/pytorch/ciforge/actions/runs/41371417099) proposed closing pytorch#201797 into pytorch#195547, linking pytorch#196694 to pytorch#198017 while keeping it open, and keeping pytorch#202948 open without an umbrella. Apply was skipped; no issues were changed.
<details>
<summary>Live write-path probe and its limitation</summary>
[Real Actions-token write probe](https://github.com/pytorch/ciforge/actions/runs/41339792819) verified linking and duplicate closure with zero-write retries on disposable fixtures. The job failed its obsolete event-based check; subsequent direct API reads confirmed [pytorch#704](https://github.com/pytorch/ciforge/issues/704) has `duplicateOf` pointing to [pytorch#702](https://github.com/pytorch/ciforge/issues/702). All fixtures were closed and the temporary probe deployment was removed. No existing PyTorch reports were changed. The later PT2-routing receipt fix is covered by local stateful tests, not this live probe.
</details>
## Linked issue or supporting maintainer
Umbrella policy evidence: pytorch#195547, pytorch#198017, and pytorch#197554. This does not modify their existing members.
## BC-breaking?
No public PyTorch API change.
## Summary (human written only)
## Agent details (if applicable)
AI-assisted implementation and validation are described in Agent Notes above.
Pull Request resolved: pytorch#202962
Approved by: https://github.com/ezyang, https://github.com/malfet
ghstack dependencies: pytorch#203124, pytorch#202961
…ytorch#202981) ## Human Note Let agents suggest duplicate issues ## Agent Notes ### Why Finding a likely duplicate should help the reporter, not silently discard their report. Add a suggestion-only path for ordinary issues: explain the possible match, ask the reporter to check it, and leave the final decision to them. This is separate from approved umbrella closure policies. ### What happens After reading a candidate's body and relevant comments, the model can propose `possible_duplicate: <issue number>`. The trusted apply step validates the reference and posts fixed copy linking that issue. It keeps the source open and never writes to the candidate, which may already be open or closed. ```mermaid flowchart TD M["Model reads candidate and proposes possible_duplicate"] --> V{"Source, target and plan are eligible?"} V -->|No| R["No duplicate suggestion; skip or flag review"] V -->|Yes| B{"Matching bot suggestion already posted?"} B -->|Yes| N["Do not repeat the comment"] B -->|No| C["Post fixed linked suggestion"] N --> O["Keep source open; finish any pending labels"] C --> O O --> H["Reporter can confirm the match or explain the difference"] ``` | Scenario | Outcome | | --- | --- | | Plausible same underlying bug, with candidate context read | Suggest the linked issue and ask the reporter to confirm. No automatic closure. | | Similar operator/title, or a report that still reproduces after the candidate's fix | Do not infer a duplicate; keep investigating the new report. | | Self-reference, foreign/PR/unavailable target, catalog umbrella, or conflicting close/umbrella annotation | No ordinary duplicate suggestion; skip or route to review. | | Retry after comment succeeded but label writing failed | Do not repost; finish the pending labels. | The comment asks reporters to move any new reproduction details to the linked issue and close their own issue **only if it is the same problem**. Otherwise they can explain what differs. The model supplies neither a URL nor free-form comment text; same-repository links and the wording are constructed by trusted code. Semantic matching still depends on the model and human judgment. ### Test Plan ```sh PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s scripts/issue_triage_pi -v git diff --check ``` 106 Python tests pass, including 11 new suggestion tests. The initial comment test and a closed-source skip-fallback regression failed before their fixes and pass afterward. [Current PyTorch PR test job](https://github.com/pytorch/pytorch/actions/runs/41384204576/job/125081314456). The Python suite also runs in triage preparation, before the model. ## Validation Before test consolidation, [pinned-runtime ciforge CI](https://github.com/pytorch/ciforge/actions/runs/41379809233) passed 119 Python tests and 4 search-tool tests with Pi 0.99.1. [Read-only ciforge replay](https://github.com/pytorch/ciforge/actions/runs/41379809226) searched and read pytorch#200935's body/comments, then proposed it as a possible duplicate of pytorch#202764 with no automatic closure. The related-only case stayed open, and the two umbrella controls retained their close/link proposals. Apply was skipped; no comments or issue changes were posted. The positive candidate's comments explicitly confirmed the duplicate relationship, so this is current-context integration evidence, not a blind accuracy benchmark. The related-only case had empty search results. Real-write behavior for this new suggestion path has not been exercised in ciforge; source-only writes and retries are covered by the local tests. ## Linked issue or supporting maintainer Triage-tooling follow-up; pytorch#202764 and pytorch#200935 were used as a confirmed duplicate replay case. ## BC-breaking? No public PyTorch API change. ## Summary (human written only) ## Agent details (if applicable) AI-assisted implementation and validation are described in Agent Notes above. Pull Request resolved: pytorch#202981 Approved by: https://github.com/ezyang, https://github.com/malfet ghstack dependencies: pytorch#203124, pytorch#202961, pytorch#202962
## Human Note
Often issues come in that match umbrellas, there are 2 types -> close the sub issue and
put inot the main umbrealla, or open up subissues and link back. This supports both
## Agent Notes
### Why
An umbrella can mean two different things: a place to consolidate repeated reports, or a tracker
whose individual reproducers must stay open. Similarity alone cannot tell the bot which action is
appropriate. Put that decision in a checked-in catalog, separate from the model's match judgment.
### What happens
The model proposes an umbrella issue and a `covered` or `uncertain` match. The trusted apply step
validates the source, target and decision, then uses the catalog's `link` or `close` policy. All
writes go to the source issue; the umbrella body, checklist and existing members are untouched.
```mermaid
flowchart TD
P["Model proposes umbrella and coverage"] --> V{"Reference permitted?"}
V -->|No| R["Skip or flag for review; no umbrella close"]
V -->|Yes| C{"Covered, close-enabled, and no review or information stop?"}
C -->|No| L["Post fixed reference; keep source open"]
C -->|Yes| W["Post fixed reference and labels"]
W --> F{"Fresh source and target checks still allow closing?"}
F -->|No| O["Do not close; flag review where needed"]
F -->|Yes| D["Close source as duplicate of the validated umbrella"]
```
| Scenario | Policy |
| --- | --- |
| Covered missing-validation hardening report → pytorch#195547 | Close is allowed, subject to the safety checks. This is not permission to dismiss ordinary supported public-API failures. |
| Forward-AD derivative report → pytorch#198017 | Link only; keep the individual reproducer open. |
| Lost compiled validation → pytorch#197554 | Link only; keep the individual report open. |
| Uncertain coverage, review/priority, or pending information/reproduction | Do not close. |
| Invalid target or conflicting close/transfer decision | No umbrella reference; route to review. |
| Already-routed source outside an eligible bot-owned retry, ineligible source, or non-PT2 oncall redirect | Skip the umbrella action. |
A target-specific bot marker avoids repeated comments. For the PT2 case, a pending-close receipt
lets the bot finish its own interrupted operation after adding its routing label, without treating
ordinary preexisting routing as permission to close. Fresh checks still apply on retry. GitHub's
reads and writes are not an atomic transaction.
### Test Plan
```sh
python3 -m unittest discover -s scripts/issue_triage_pi -v
```
95 Python tests pass, including 13 grouped umbrella tests covering source-only writes, target validation, human stops, and retries. The smaller suite still catches the original PT2 first-close and retry failures.
[Current PyTorch PR test job](https://github.com/pytorch/pytorch/actions/runs/41384203855/job/125081309383). The Python suite also runs in triage preparation, before the model.
## Validation
[Read-only ciforge replay](https://github.com/pytorch/ciforge/actions/runs/41371417099) proposed closing pytorch#201797 into pytorch#195547, linking pytorch#196694 to pytorch#198017 while keeping it open, and keeping pytorch#202948 open without an umbrella. Apply was skipped; no issues were changed.
<details>
<summary>Live write-path probe and its limitation</summary>
[Real Actions-token write probe](https://github.com/pytorch/ciforge/actions/runs/41339792819) verified linking and duplicate closure with zero-write retries on disposable fixtures. The job failed its obsolete event-based check; subsequent direct API reads confirmed [pytorch#704](https://github.com/pytorch/ciforge/issues/704) has `duplicateOf` pointing to [pytorch#702](https://github.com/pytorch/ciforge/issues/702). All fixtures were closed and the temporary probe deployment was removed. No existing PyTorch reports were changed. The later PT2-routing receipt fix is covered by local stateful tests, not this live probe.
</details>
## Linked issue or supporting maintainer
Umbrella policy evidence: pytorch#195547, pytorch#198017, and pytorch#197554. This does not modify their existing members.
## BC-breaking?
No public PyTorch API change.
## Summary (human written only)
## Agent details (if applicable)
AI-assisted implementation and validation are described in Agent Notes above.
Pull Request resolved: pytorch#202962
Approved by: https://github.com/ezyang, https://github.com/malfet
ghstack dependencies: pytorch#203124, pytorch#202961
…ytorch#202981) ## Human Note Let agents suggest duplicate issues ## Agent Notes ### Why Finding a likely duplicate should help the reporter, not silently discard their report. Add a suggestion-only path for ordinary issues: explain the possible match, ask the reporter to check it, and leave the final decision to them. This is separate from approved umbrella closure policies. ### What happens After reading a candidate's body and relevant comments, the model can propose `possible_duplicate: <issue number>`. The trusted apply step validates the reference and posts fixed copy linking that issue. It keeps the source open and never writes to the candidate, which may already be open or closed. ```mermaid flowchart TD M["Model reads candidate and proposes possible_duplicate"] --> V{"Source, target and plan are eligible?"} V -->|No| R["No duplicate suggestion; skip or flag review"] V -->|Yes| B{"Matching bot suggestion already posted?"} B -->|Yes| N["Do not repeat the comment"] B -->|No| C["Post fixed linked suggestion"] N --> O["Keep source open; finish any pending labels"] C --> O O --> H["Reporter can confirm the match or explain the difference"] ``` | Scenario | Outcome | | --- | --- | | Plausible same underlying bug, with candidate context read | Suggest the linked issue and ask the reporter to confirm. No automatic closure. | | Similar operator/title, or a report that still reproduces after the candidate's fix | Do not infer a duplicate; keep investigating the new report. | | Self-reference, foreign/PR/unavailable target, catalog umbrella, or conflicting close/umbrella annotation | No ordinary duplicate suggestion; skip or route to review. | | Retry after comment succeeded but label writing failed | Do not repost; finish the pending labels. | The comment asks reporters to move any new reproduction details to the linked issue and close their own issue **only if it is the same problem**. Otherwise they can explain what differs. The model supplies neither a URL nor free-form comment text; same-repository links and the wording are constructed by trusted code. Semantic matching still depends on the model and human judgment. ### Test Plan ```sh PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s scripts/issue_triage_pi -v git diff --check ``` 106 Python tests pass, including 11 new suggestion tests. The initial comment test and a closed-source skip-fallback regression failed before their fixes and pass afterward. [Current PyTorch PR test job](https://github.com/pytorch/pytorch/actions/runs/41384204576/job/125081314456). The Python suite also runs in triage preparation, before the model. ## Validation Before test consolidation, [pinned-runtime ciforge CI](https://github.com/pytorch/ciforge/actions/runs/41379809233) passed 119 Python tests and 4 search-tool tests with Pi 0.99.1. [Read-only ciforge replay](https://github.com/pytorch/ciforge/actions/runs/41379809226) searched and read pytorch#200935's body/comments, then proposed it as a possible duplicate of pytorch#202764 with no automatic closure. The related-only case stayed open, and the two umbrella controls retained their close/link proposals. Apply was skipped; no comments or issue changes were posted. The positive candidate's comments explicitly confirmed the duplicate relationship, so this is current-context integration evidence, not a blind accuracy benchmark. The related-only case had empty search results. Real-write behavior for this new suggestion path has not been exercised in ciforge; source-only writes and retries are covered by the local tests. ## Linked issue or supporting maintainer Triage-tooling follow-up; pytorch#202764 and pytorch#200935 were used as a confirmed duplicate replay case. ## BC-breaking? No public PyTorch API change. ## Summary (human written only) ## Agent details (if applicable) AI-assisted implementation and validation are described in Agent Notes above. Pull Request resolved: pytorch#202981 Approved by: https://github.com/ezyang, https://github.com/malfet ghstack dependencies: pytorch#203124, pytorch#202961, pytorch#202962
Stack from ghstack (oldest at bottom):
Human Note
Often issues come in that match umbrellas, there are 2 types -> close the sub issue and
put inot the main umbrealla, or open up subissues and link back. This supports both
Agent Notes
Why
An umbrella can mean two different things: a place to consolidate repeated reports, or a tracker
whose individual reproducers must stay open. Similarity alone cannot tell the bot which action is
appropriate. Put that decision in a checked-in catalog, separate from the model's match judgment.
What happens
The model proposes an umbrella issue and a
coveredoruncertainmatch. The trusted apply stepvalidates the source, target and decision, then uses the catalog's
linkorclosepolicy. Allwrites go to the source issue; the umbrella body, checklist and existing members are untouched.
flowchart TD P["Model proposes umbrella and coverage"] --> V{"Reference permitted?"} V -->|No| R["Skip or flag for review; no umbrella close"] V -->|Yes| C{"Covered, close-enabled, and no review or information stop?"} C -->|No| L["Post fixed reference; keep source open"] C -->|Yes| W["Post fixed reference and labels"] W --> F{"Fresh source and target checks still allow closing?"} F -->|No| O["Do not close; flag review where needed"] F -->|Yes| D["Close source as duplicate of the validated umbrella"]A target-specific bot marker avoids repeated comments. For the PT2 case, a pending-close receipt
lets the bot finish its own interrupted operation after adding its routing label, without treating
ordinary preexisting routing as permission to close. Fresh checks still apply on retry. GitHub's
reads and writes are not an atomic transaction.
Test Plan
95 Python tests pass, including 13 grouped umbrella tests covering source-only writes, target validation, human stops, and retries. The smaller suite still catches the original PT2 first-close and retry failures.
Current PyTorch PR test job. The Python suite also runs in triage preparation, before the model.
Validation
Read-only ciforge replay proposed closing #201797 into #195547, linking #196694 to #198017 while keeping it open, and keeping #202948 open without an umbrella. Apply was skipped; no issues were changed.
Live write-path probe and its limitation
Real Actions-token write probe verified linking and duplicate closure with zero-write retries on disposable fixtures. The job failed its obsolete event-based check; subsequent direct API reads confirmed #704 has
duplicateOfpointing to #702. All fixtures were closed and the temporary probe deployment was removed. No existing PyTorch reports were changed. The later PT2-routing receipt fix is covered by local stateful tests, not this live probe.Linked issue or supporting maintainer
Umbrella policy evidence: #195547, #198017, and #197554. This does not modify their existing members.
BC-breaking?
No public PyTorch API change.
Summary (human written only)
Agent details (if applicable)
AI-assisted implementation and validation are described in Agent Notes above.