fix(services): report eligible:true when no linked issue was required - #7813
Conversation
deriveEligibilityPlan's `eligible` boolean gated on
`result.linkedIssueMultiplier.eligible && branchConfirmed`. For the default
`linkedIssueMode: "none"` case, decideLinkedIssueMultiplier returns
`{ status: "not_required", eligible: false }`, so `eligible` was always false
even for an otherwise-clean branch -- contradicting the plan's own
publicSummary ("...not required for this contribution type") and telling any
client reading the structured boolean (the loopover_get_eligibility_plan MCP
tool, the POST route, and buildLocalBranchAnalysis) that a clean contribution
is ineligible.
Apply the same special case eligibilityStatusKey already uses: when the linked
issue is not_required and the branch is confirmed (eligible or not_required),
`eligible` is true rather than gated on the meaningless
linkedIssueMultiplier.eligible.
Updated eligibility-plan / eligibility-scenarios / mcp-eligibility-plan /
mcp-output-schemas tests that asserted the old (buggy) eligible:false for the
mode=none case to the corrected value.
Closes JSONbored#7809
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
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 #7813 +/- ##
==========================================
Coverage 88.57% 88.58%
==========================================
Files 725 84 -641
Lines 76409 20701 -55708
Branches 22762 3663 -19099
==========================================
- Hits 67682 18338 -49344
+ Misses 7681 2184 -5497
+ Partials 1046 179 -867
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-21 13:59:13 UTC
Review summary Nits — 2 non-blocking
Flagged checks (non-blocking)
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
What
deriveEligibilityPlan'seligibleboolean (src/services/eligibility-plan.ts) was:ScorePreviewInput.linkedIssueModedefaults to"none", and for that modedecideLinkedIssueMultiplierreturns{ status: "not_required", eligible: false }. SobranchConfirmedistruebuteligible = false && true = false— always false whenever no linked issue was required, the common case for any contribution that doesn't reference one.This contradicts the plan's own
publicSummary("...not required for this contribution type") and the file's owneligibilityStatusKeyhelper, which already special-casesnot_requiredcorrectly (line 64). Any client reading the structured boolean — theloopover_get_eligibility_planMCP tool, the POST API route, andbuildLocalBranchAnalysis— was told an otherwise-clean branch/PR is ineligible.Fix
Apply the same special case
eligibilityStatusKeyalready uses, to theeligibleboolean:When no linked issue was required,
linkedIssueMultiplier.eligibleis meaningless, so a confirmed branch (eligibleornot_required) is eligible. All other modes are unchanged.Tests
test/unit/eligibility-plan.test.ts's "no linked issue + non-required branch" test now assertsplan.eligible === true(matching its sibling tests), plus a new case fornot_required+ aneligiblebranch.eligible: falsefor themode=nonecase — ineligibility-scenarios.test.ts,mcp-eligibility-plan.test.ts, andmcp-output-schemas.test.ts— are updated to the corrected value.The fix is proven to fail against the pre-fix
&&.linkedIssueMultiplier.eligible: falseassertions inscoring.test.tsare a different field and are unaffected.Validation
scoring.test.ts88/88.npm run typecheck— exit 0.git diff --checkclean.Closes #7809