Context
src/signals/focus-manifest.ts builds contributor-facing findings from a repo's maintainer focus manifest. For the linked-issue policy, the "required" branch (around line 773) is:
if (manifest.linkedIssuePolicy === "required" && linkedIssueCount === 0 && bodyObserved && !hasNoIssueRationale) {
findings.push({
code: "manifest_linked_issue_required",
...
The bodyObserved guard exists specifically to avoid a false positive on a sparse/incomplete webhook payload where the PR body wasn't actually observed (so linkedIssueCount === 0 might just mean "we don't know," not "there really is no linked issue").
The sibling "preferred" branch immediately below it does not have the same guard:
} else if (manifest.linkedIssuePolicy === "preferred" && linkedIssueCount === 0) {
findings.push({
code: "manifest_linked_issue_preferred",
...
Because bodyObserved is missing here, a repo configured with linkedIssuePolicy: "preferred" can surface a "Maintainer prefers a linked issue" nudge for a PR whose body was never actually observed (e.g. from a sparse webhook payload) — the exact false-positive class the "required" branch was already fixed to avoid, just still present in its "preferred" sibling.
Requirements
- Add the same
bodyObserved guard to the "preferred" branch's condition, so it reads manifest.linkedIssuePolicy === "preferred" && linkedIssueCount === 0 && bodyObserved.
- Do not add
hasNoIssueRationale to the "preferred" branch unless it is already meaningful there — check whether hasNoIssueRationale is scoped as a general "no issue" opt-out or specific to the "required" policy's stricter contract before deciding; if uncertain, leave hasNoIssueRationale out of the "preferred" branch and only add bodyObserved (the concretely-verified gap).
Deliverables
Test Coverage Requirements
This repo's Codecov patch gate requires 99%+ coverage of changed lines and branches. Cover both the new bodyObserved: false (finding suppressed) and the existing bodyObserved: true (finding fires) branches.
Expected Outcome
A repo with linkedIssuePolicy: "preferred" no longer nudges a contributor about a missing linked issue purely because a sparse webhook payload made the PR body appear unobserved — the "preferred" and "required" branches now share the same false-positive guard.
Links & Resources
src/signals/focus-manifest.ts — the "required"/"preferred" linked-issue branches, around line 773-788
Context
src/signals/focus-manifest.tsbuilds contributor-facing findings from a repo's maintainer focus manifest. For the linked-issue policy, the"required"branch (around line 773) is:The
bodyObservedguard exists specifically to avoid a false positive on a sparse/incomplete webhook payload where the PR body wasn't actually observed (solinkedIssueCount === 0might just mean "we don't know," not "there really is no linked issue").The sibling
"preferred"branch immediately below it does not have the same guard:Because
bodyObservedis missing here, a repo configured withlinkedIssuePolicy: "preferred"can surface a "Maintainer prefers a linked issue" nudge for a PR whose body was never actually observed (e.g. from a sparse webhook payload) — the exact false-positive class the"required"branch was already fixed to avoid, just still present in its"preferred"sibling.Requirements
bodyObservedguard to the"preferred"branch's condition, so it readsmanifest.linkedIssuePolicy === "preferred" && linkedIssueCount === 0 && bodyObserved.hasNoIssueRationaleto the"preferred"branch unless it is already meaningful there — check whetherhasNoIssueRationaleis scoped as a general "no issue" opt-out or specific to the"required"policy's stricter contract before deciding; if uncertain, leavehasNoIssueRationaleout of the"preferred"branch and only addbodyObserved(the concretely-verified gap).Deliverables
src/signals/focus-manifest.ts's"preferred"linked-issue branch gains thebodyObservedguard.linkedIssuePolicy: "preferred"repo withbodyObserved: falseandlinkedIssueCount: 0does NOT produce themanifest_linked_issue_preferredfinding.bodyObserved: trueandlinkedIssueCount: 0(no regression on the existing, intended behavior).Test Coverage Requirements
This repo's Codecov patch gate requires 99%+ coverage of changed lines and branches. Cover both the new
bodyObserved: false(finding suppressed) and the existingbodyObserved: true(finding fires) branches.Expected Outcome
A repo with
linkedIssuePolicy: "preferred"no longer nudges a contributor about a missing linked issue purely because a sparse webhook payload made the PR body appear unobserved — the"preferred"and"required"branches now share the same false-positive guard.Links & Resources
src/signals/focus-manifest.ts— the"required"/"preferred"linked-issue branches, around line 773-788