fix(rules): surface missing-linked-issue in predictor under composite mergeReadiness gate - #1447
Conversation
… mergeReadiness gate The pre-submission gate predictor derived requireLinkedIssue from gate.linkedIssue alone, omitting the composite mergeReadiness term. Since applyMergeReadinessGate forces the linked-issue sub-gate to block when mergeReadiness is enabled, and the live path collects linked-issue evidence whenever merge-readiness is on (shouldCollectLinkedIssueEvidence), a repo with mergeReadiness:block and linkedIssue unset got a false 'success' prediction while the live gate one-shot auto-closes the PR on the missing-linked-issue blocker. Include the mergeReadiness term so the predictor matches the live gate, and add a regression test pinning both the new blocker path and the no-gate arm.
|
Superagent did not 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 #1447 +/- ##
=======================================
Coverage 95.53% 95.53%
=======================================
Files 204 204
Lines 22090 22090
Branches 7975 7975
=======================================
Hits 21103 21103
Misses 412 412
Partials 575 575
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review — held for maintainer review
⏸️ Held for maintainer review — Touches a guarded path — held for manual review Review summary
Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
Review detailsGenerated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative. The change correctly closes a real predictor/live-gate parity gap: when `gate.linkedIssue` is unset but `gate.mergeReadiness` is active, the old predictor derived `requireLinkedIssue = false`, never created the `missing_linked_issue` finding in the advisory, and returned a false `success` — while the live gate (via `applyMergeReadinessGate` + `shouldCollectLinkedIssueEvidence`) would collect linked-issue evidence, surface the finding, and one-shot close the PR. The new OR term `|| (gate.mergeReadiness !== null && gate.mergeReadiness !== 'off')` mirrors `shouldCollectLinkedIssueEvidence` exactly. The regression test is well-constructed: it exercises both the new blocker arm (mergeReadiness:block + linkedIssue unset → `missing_linked_issue` in blockers → `failure`) and the false/false base arm (neither set → no finding), and it would have failed on the old code. Nits (5)
🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
…merge-readiness-linked-issue
Summary
Fixes #1446. The pre-submission gate predictor (
buildPredictedGateVerdict,src/rules/predicted-gate.ts) derivedrequireLinkedIssuefromgate.linkedIssuealone, omitting the composite merge-readiness term. SinceapplyMergeReadinessGate(src/rules/advisory.ts) forces the linked-issue sub-gate to block whenmergeReadinessis enabled, and the live review path collects linked-issue evidence whenever merge-readiness is on:a repo with
gate.mergeReadiness: blockandgate.linkedIssueunset got a falsesuccessprediction while the live gate creates themissing_linked_issuefinding and one-shot auto-closes the PR. The predictor's contract is to compute the same verdict the live gate would, so this defeats its purpose and causes the exact loss it exists to prevent.The fix derives
requireLinkedIssuefrom the merge-readiness term as well, mirroringshouldCollectLinkedIssueEvidence:A regression test pins both the new blocker path (mergeReadiness:block + linkedIssue unset →
missing_linked_issueblocker → failure) and the false/false arm (neither set → no finding); it fails before the fix and passes after.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally; both sides of the new||are covered (mergeReadiness term true via the new blocker test; both-false via the no-gate arm; the linkedIssue term remains covered by the existinglinkedIssue:blocktest).npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run test:cigate locally; all checks green.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.This is a backend predictor-logic change with no UI/API surface impact, so the UI Evidence section is omitted.
Notes
predicted-gate.tsplus a regression test. No schema, OpenAPI, wrangler, or migration impact;applyMergeReadinessGate/evaluateGateCheckalready do the right thing once the finding exists.