feat(review): wire linked_issue_scope_mismatch into the shared signal-tracking module - #8109
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…-tracking module (JSONbored#8101) The AI-confidence-driven linked_issue_scope_mismatch finding carries real gate authority (block mode + unaddressed hard-blocks a PR) yet was invisible to the shared calibration module (JSONbored#7982): createSignalStore's ORB adapter existed with zero live callers, so neither the self-correction pipeline (JSONbored#7983/JSONbored#7984) nor the backtest primitives (JSONbored#8083-JSONbored#8086) could see this judgment's history. Wire exactly one finding code and one override direction, per the issue scope: - processors.ts: inside the existing block-mode+unaddressed finding-push block (and ONLY there -- advisory mode never pushes, so it never records either), record a RuleFiredEvent {ruleId, targetKey repo#pr, outcome, occurredAt, metadata.confidence} via createSignalStore(env).recordRuleFired, best-effort with .catch(() => undefined) matching the adjacent cache-write discipline and SignalStore's own never-fail-the-review contract. - outcomes-wire.ts: when recordReversalSignals records a reversal (both the contributor-reopen path and JSONbored#7985's owner reopen-then-merge path), check a fixed 30-day queryRuleHistory lookback for a linked_issue_scope_mismatch firing against the same target and, if present, record a "reversed" HumanOverrideEvent -- the human undoing of the bot action IS the judgment on that finding. Same .catch(() => undefined) discipline: a SignalStore failure (including the deliberately-propagating queryRuleHistory read error) never affects whether the underlying reversal records. No "confirmed" path, per the issue's Boundaries. Tests extend both existing suites: fired recorded exactly at block+unaddressed (with confidence metadata) and NOT for advisory mode or addressed/partial; "reversed" recorded on both reversal paths only when a prior firing exists for that target; and both write paths degrade silently -- normal return values and the reversal itself unaffected -- when the SignalStore call rejects.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8109 +/- ##
==========================================
- Coverage 92.01% 90.28% -1.74%
==========================================
Files 757 99 -658
Lines 77228 25905 -51323
Branches 23346 5027 -18319
==========================================
- Hits 71061 23388 -47673
+ Misses 5061 2245 -2816
+ Partials 1106 272 -834
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-22 22:57:16 UTC
Review summary Nits — 3 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.
|
Summary
linked_issue_scope_mismatchfinding carries real gate authority (blockmode +unaddressedhard-blocks a PR) yet was invisible to the shared calibration module (Extract a shared, deployment-agnostic calibration/signal-tracking module for ORB + AMS #7982):createSignalStore's ORB adapter existed with zero live callers, so neither the self-correction pipeline (Same-rule repeat alarm: fast-path detection when one deterministic rule rejects N distinct targets in a short window #7983/Per-rule (not just per-project) precision tracking in the gate-eval pipeline #7984) nor this epic's backtest primitives (calibration: pure BacktestCase corpus builder from RuleFiredEvent/HumanOverrideEvent pairs #8083–calibration: Pareto-floor comparator between two BacktestScoreReports #8086) could see this judgment's history. This wires exactly one finding code and one override direction (reversal), per the issue's scope.block-mode +unaddressedfinding-push block insrc/queue/processors.ts— and ONLY there (advisory mode never pushes the finding, so it never records either) —createSignalStore(env).recordRuleFired(...)records{ruleId, targetKey: repo#pr, outcome, occurredAt: nowIso(), metadata: {confidence}}, best-effort with.catch(() => undefined), matching the adjacent cache-write discipline andSignalStore's own never-fail-the-review contract.recordReversalSignals(src/review/outcomes-wire.ts) records a reversal — both the contributor-reopen path and Count an owner reopen-then-merge as a real reversal signal, not administrative noise #7985's owner reopen-then-merge path — a fixed 30-dayqueryRuleHistorylookback checks for alinked_issue_scope_mismatchfiring against the same target and, if present, records a"reversed"HumanOverrideEvent: the human undoing of the bot action IS the human judgment on that finding. Same.catch(() => undefined)discipline — a SignalStore failure (including the deliberately-propagatingqueryRuleHistoryread error) never affects whether the underlying reversal itself records."confirmed"path, per the issue's Boundaries (no positive-confirmation signal exists anywhere in the codebase to mirror), and no change tolinkedIssueSatisfactionGateMode's blocking behavior — this only records data about decisions already being made.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.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:
vitest run test/unit/outcomes-wire.test.ts test/unit/linked-issue-satisfaction-run.test.ts— 123 tests green, including the new cases — plus the full rootnpm run typecheck. Verified per-diff-line coverage via lcov intersection: every changed line and branch in bothprocessors.tsandoutcomes-wire.tsis covered (fired at block+unaddressed with confidence metadata; NO fired for advisory mode or addressed/partial;"reversed"on both reversal paths gated on a prior firing; no override without one; and both fail-open.catchpaths exercised explicitly via a rejectingSignalStoredouble — normal return values and the underlying reversal unaffected). Also simulated the scoped-CI shard condition with the exact CI invocation (--changed=origin/main --coverage.all=false): the lcov is non-empty and contains both changed instrumented files.actionlint/workers/mcp/ui checks are untouched surfaces; CI runs them all.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.UI Evidence
Not applicable — backend-only wiring (no UI, docs, or extension surface touched; no visible behavior change — the finding's blocking behavior is untouched).
Notes
SignalStoredouble viavi.spyOn(signalTrackingWire, "createSignalStore")— the issue's explicit requirement that a test exercising the failure path is mandatory, not optional. The write path inprocessors.tskeeps its own.catch(() => undefined)even though the live adapter's writes are internally best-effort, so the review pass stays safe under any futureSignalStoreimplementation.LINKED_ISSUE_SCOPE_MISMATCH_LOOKBACK_MS), not configurable, per the issue's requirement.