⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
src/queue/processors.ts:2071-2072's derivePublicCommentMergeFacts computes its neverClosed
flag using only two conditions: authorLogin === repoOwner or isProtectedAutomationAuthor.
The real close-eligibility formula used elsewhere in this same file (closeWithheldReason, lines
2226-2229) and in the canonical planner logic
(packages/loopover-engine/src/settings/agent-actions.ts:955) is:
closeEligible = isContributor || ((authorIsOwner || authorIsAdmin) && closeOwnerAuthors === true).
derivePublicCommentMergeFacts's neverClosed computation diverges from this in two ways:
- It never checks
authorIsAdmin (only the repo owner), so a per-repo admin author (non-owner) is
incorrectly NOT flagged as neverClosed, when the planner actually protects them the same as the
owner.
- It never checks
closeOwnerAuthors, so a repo with closeOwnerAuthors: true (explicitly opting
in to closing owner-authored PRs) still shows neverClosed: true in the public comment for an
owner-authored PR the planner can actually close.
test/unit/processors-public-comment-merge-facts.test.ts never exercises closeOwnerAuthors: true
or an admin (non-owner) author, confirming this divergence is untested.
Requirements
- Update
derivePublicCommentMergeFacts's neverClosed computation to match the real
close-eligibility formula exactly: check authorIsAdmin in addition to authorIsOwner, and
respect closeOwnerAuthors the same way closeWithheldReason already does.
Deliverables
All Deliverables above are required in the same PR.
Test Coverage Requirements
src/** is measured by codecov/patch (99%+ target, branch-counted). The two new tests must
exercise the previously-uncovered closeOwnerAuthors: true and admin-author branches directly.
Expected Outcome
The public comment's neverClosed claim matches the real close-eligibility formula the planner
actually uses, so the public-facing text is never wrong about whether a PR could be auto-closed.
Links & Resources
src/queue/processors.ts:2071-2072 (derivePublicCommentMergeFacts, the function to fix), :2226-2229
(closeWithheldReason, the already-correct sibling to mirror)
packages/loopover-engine/src/settings/agent-actions.ts:955 (the canonical formula)
test/unit/processors-public-comment-merge-facts.test.ts (existing test file to extend)
Context
src/queue/processors.ts:2071-2072'sderivePublicCommentMergeFactscomputes itsneverClosedflag using only two conditions:
authorLogin === repoOwnerorisProtectedAutomationAuthor.The real close-eligibility formula used elsewhere in this same file (
closeWithheldReason, lines2226-2229) and in the canonical planner logic
(
packages/loopover-engine/src/settings/agent-actions.ts:955) is:closeEligible = isContributor || ((authorIsOwner || authorIsAdmin) && closeOwnerAuthors === true).derivePublicCommentMergeFacts'sneverClosedcomputation diverges from this in two ways:authorIsAdmin(only the repo owner), so a per-repo admin author (non-owner) isincorrectly NOT flagged as
neverClosed, when the planner actually protects them the same as theowner.
closeOwnerAuthors, so a repo withcloseOwnerAuthors: true(explicitly optingin to closing owner-authored PRs) still shows
neverClosed: truein the public comment for anowner-authored PR the planner can actually close.
test/unit/processors-public-comment-merge-facts.test.tsnever exercisescloseOwnerAuthors: trueor an admin (non-owner) author, confirming this divergence is untested.
Requirements
derivePublicCommentMergeFacts'sneverClosedcomputation to match the realclose-eligibility formula exactly: check
authorIsAdminin addition toauthorIsOwner, andrespect
closeOwnerAuthorsthe same waycloseWithheldReasonalready does.Deliverables
neverClosedisfalsefor an owner-authored PR when the repo hascloseOwnerAuthors: true(currently
true).neverClosedistruefor an admin (non-owner) author when the repo does not havecloseOwnerAuthors: truefor admins (currentlyfalse).test/unit/processors-public-comment-merge-facts.test.ts.closeOwnerAuthors) continue to pass unchanged.All Deliverables above are required in the same PR.
Test Coverage Requirements
src/**is measured bycodecov/patch(99%+ target, branch-counted). The two new tests mustexercise the previously-uncovered
closeOwnerAuthors: trueand admin-author branches directly.Expected Outcome
The public comment's
neverClosedclaim matches the real close-eligibility formula the planneractually uses, so the public-facing text is never wrong about whether a PR could be auto-closed.
Links & Resources
src/queue/processors.ts:2071-2072(derivePublicCommentMergeFacts, the function to fix),:2226-2229(
closeWithheldReason, the already-correct sibling to mirror)packages/loopover-engine/src/settings/agent-actions.ts:955(the canonical formula)test/unit/processors-public-comment-merge-facts.test.ts(existing test file to extend)