fix(review): pin expectedHeadSha on the contributor_cap close action - #6466
Merged
Conversation
The contributor_cap close action (per-contributor / install-wide open-item
cap short-circuit) never pinned expectedHeadSha, unlike the sibling
blacklist, review_nag, copycat, and screenshot_table close actions. Under
autonomy.close = "auto_with_approval" this left params.expectedHeadSha
undefined on the persisted pending row, which made
decidePendingAgentAction's isUnpinnedRatifyingAction guard unconditionally
reject the maintainer's accept before the close ever executed, silently
neutering the anti-abuse cap for any repo using the approval-gated close
policy.
Add the same `...(input.pr.headSha ? { expectedHeadSha: input.pr.headSha } : {})`
spread already used by the other closeKinds, and add regression tests
covering the pinned and defensive-fallback (no headSha) cases.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6466 +/- ##
=======================================
Coverage 95.59% 95.59%
=======================================
Files 589 589
Lines 47025 47026 +1
Branches 14951 14952 +1
=======================================
+ Hits 44952 44953 +1
Misses 1291 1291
Partials 782 782
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 1 confirmed adversarial-audit finding(s) in
src/settings/agent-actions.ts:src/settings/agent-actions.ts)Each fix follows the audit's own verified failure scenario and root-cause analysis (2-independent-skeptic adversarial verification pass, both had to vote "confirmed").
Closes #6405
Test plan
npm run test:ci) green