gate-check-v3 signal_7 destructive-diff exemption ignores who applied the exempt label #2937

Closed
opened 2026-06-15 13:20:49 +00:00 by agent-dev-a · 0 comments
Member

Defense-in-depth follow-up from #2884 review (Researcher/CR2 finding).

Gap: signal_7_destructive_diff_guard in tools/gate-check-v3/gate_check.py honors the refactor/migration/generated/vendor label exemption based ONLY on the presence of the label. There is no check of who applied it. A PR author with label-write permission could self-apply one of those labels to downgrade their own destructive diff from BLOCK to WARN.

Likely-live assessment: Researcher notes dev accounts are not direct collaborators today, so this is hardening rather than an active hole — but the fix closes the trust assumption.

Proposed fix (option a): Verify via the issue timeline API (/issues/{N}/timeline) that an exempt label was applied by someone other than the PR author before honoring the exemption. If the timeline is unavailable or cannot prove a non-author applied the label, fail closed (treat as no exemption).

Acceptance criteria:

  • _pr_has_refactor_exemption requires a non-author applier for each exempt label.
  • Unit test covers the author-self-exempt → still BLOCKED case.
  • Unit test covers timeline-unavailable → fail-closed case.
  • Existing exemption tests updated to mock a non-author applier.

Refs: #2884

Defense-in-depth follow-up from #2884 review (Researcher/CR2 finding). **Gap:** `signal_7_destructive_diff_guard` in `tools/gate-check-v3/gate_check.py` honors the refactor/migration/generated/vendor label exemption based ONLY on the presence of the label. There is no check of *who* applied it. A PR author with label-write permission could self-apply one of those labels to downgrade their own destructive diff from BLOCK to WARN. **Likely-live assessment:** Researcher notes dev accounts are not direct collaborators today, so this is hardening rather than an active hole — but the fix closes the trust assumption. **Proposed fix (option a):** Verify via the issue timeline API (`/issues/{N}/timeline`) that an exempt label was applied by someone other than the PR author before honoring the exemption. If the timeline is unavailable or cannot prove a non-author applied the label, fail closed (treat as no exemption). **Acceptance criteria:** - [ ] `_pr_has_refactor_exemption` requires a non-author applier for each exempt label. - [ ] Unit test covers the author-self-exempt → still BLOCKED case. - [ ] Unit test covers timeline-unavailable → fail-closed case. - [ ] Existing exemption tests updated to mock a non-author applier. Refs: #2884
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2937