Skip to content

feat(review): wire linked_issue_scope_mismatch into the shared signal-tracking module - #8109

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-signal-wire-8101
Jul 22, 2026
Merged

feat(review): wire linked_issue_scope_mismatch into the shared signal-tracking module#8109
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-signal-wire-8101

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥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:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Ran the exact suites for both touched functions: 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 root npm run typecheck. Verified per-diff-line coverage via lcov intersection: every changed line and branch in both processors.ts and outcomes-wire.ts is 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 .catch paths exercised explicitly via a rejecting SignalStore double — 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

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section 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.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

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

  • The fail-open tests use a rejecting SignalStore double via vi.spyOn(signalTrackingWire, "createSignalStore") — the issue's explicit requirement that a test exercising the failure path is mandatory, not optional. The write path in processors.ts keeps its own .catch(() => undefined) even though the live adapter's writes are internally best-effort, so the review pass stays safe under any future SignalStore implementation.
  • The 30-day lookback is a fixed constant (LINKED_ISSUE_SCOPE_MISMATCH_LOOKBACK_MS), not configurable, per the issue's requirement.

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 22, 2026 22:42
@superagent-security

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.28%. Comparing base (d07b057) to head (3fc2bed).
⚠️ Report is 3 commits behind head on main.

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     
Flag Coverage Δ
shard-1 77.34% <40.00%> (+22.25%) ⬆️
shard-2 33.67% <80.00%> (-17.49%) ⬇️
shard-3 38.56% <20.00%> (-17.62%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/queue/processors.ts 95.76% <100.00%> (+<0.01%) ⬆️
src/review/outcomes-wire.ts 90.10% <100.00%> (+0.43%) ⬆️

... and 658 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 22, 2026
@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-22 22:57:16 UTC

4 files · 1 AI reviewer · no blockers · readiness 98/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR wires the linked_issue_scope_mismatch AI finding into the shared signal-tracking module: recordRuleFired is called only in the block-mode + unaddressed finding-push branch of runLinkedIssueSatisfactionForAdvisory (processors.ts), and a 30-day queryRuleHistory lookback in recordReversalSignals (outcomes-wire.ts) records a 'reversed' HumanOverrideEvent when a matching target is later reversed via contributor-reopen or the owner reopen-then-merge path. Both writes use .catch(() => undefined) matching the file's existing best-effort discipline, and the tests directly verify the fired/no-fired/override/no-override/failure-degrades-silently matrix end-to-end. The change is narrowly scoped to exactly one rule and one override direction as described, with no change to gate-blocking behavior itself.

Nits — 3 non-blocking
  • src/review/outcomes-wire.ts: recordLinkedIssueScopeMismatchOverride's own internal store.recordHumanOverride call is not wrapped in try/catch — it only becomes safe because every call site externally chains .catch(() => undefined); worth a comment noting this function is not itself safe to call unguarded.
  • The 30-day fixed lookback in queryRuleHistory (LINKED_ISSUE_SCOPE_MISMATCH_LOOKBACK_MS) is a magic window with no config knob — fine per the issue's stated boundaries, but worth confirming that's intentional versus reusing OWNER_REOPEN_MERGE_WINDOW_MS-style named constants elsewhere in the file for consistency.
  • Consider extracting a short doc-comment on recordLinkedIssueScopeMismatchOverride noting its caller-must-catch contract, since a future caller might reasonably assume it's self-contained given how consistently other helpers in this file use internal try/catch.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8101
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 361 registered-repo PR(s), 144 merged, 38 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 361 PR(s), 38 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff wires recordRuleFired at the exact block-mode+unaddressed finding-push site in processors.ts and wires a 'reversed' recordHumanOverride into both reversal paths of recordReversalSignals gated on a prior fired event via queryRuleHistory, matching the issue's scope and fail-open .catch discipline exactly as specified, with tests covering fired/no-fired cases, both reversal paths, no-prior-f

Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, Ruby, JavaScript, Svelte, TypeScript, Markdown, MDX, Rust
  • Official Gittensor activity: 361 PR(s), 38 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

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.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit a2d2517 into JSONbored:main Jul 22, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

calibration: wire linked_issue_scope_mismatch into the shared signal-tracking module (fired + reversal)

1 participant