Skip to content

fix(signals): make shouldPublishPrIntelligenceComment respect commentMode for oss_maintainer (#6776)#6853

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
real-venus:fix/pr-intelligence-comment-oss-maintainer-tautology-6776
Jul 17, 2026
Merged

fix(signals): make shouldPublishPrIntelligenceComment respect commentMode for oss_maintainer (#6776)#6853
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
real-venus:fix/pr-intelligence-comment-oss-maintainer-tautology-6776

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

Summary

shouldPublishPrIntelligenceComment (packages/loopover-engine/src/signals/engine.ts) gated the
oss_maintainer audience on:

return settings.commentMode === "all_prs" || detection.detected || detection.source !== "official_gittensor_api";

The third disjunct is a tautology. detection.source is only ever "official_gittensor_api" (always
paired with detected: true) or undefined — no construction path produces detected: false with
source: "official_gittensor_api". So detection.source !== "official_gittensor_api" is true exactly when
detected is false, making the whole expression unconditionally true. For every oss_maintainer-audience
repo, commentMode: "detected_contributors_only" silently behaved identically to "all_prs", defeating the gate.

This drops the tautological disjunct:

return settings.commentMode === "all_prs" || detection.detected;

so the branch now respects commentMode (matching the documented single source of truth,
shouldPublishPrComment in src/signals/settings-preview.ts, which gates on commentMode with no audience
carve-out). The function has zero production callers today — it's a superseded duplicate — so this only removes a
latent trap for a future caller; live behavior is unchanged.

Adds the previously-absent oss_maintainer-branch test coverage, including the two regression cases the issue
calls for.

Closes #6776

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • 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 (Closes #6776).

Validation

  • git diff --check
  • npm run typecheck
  • npm run test:coverage locally — the one changed executable line (the oss_maintainer return) is exercised on both branches (commentMode: all_prs short-circuit true; detected_contributors_only with an undetected contributor → false; with a detected contributor → true), verified via coverage-final.json.
  • npx vitest run test/unit/signals.test.ts test/unit/signals-coverage.test.ts (92 passing)
  • engine build + node --test (588 passing) + engine-parity:drift-check

If any required check was skipped, explain why:

  • No UI/OpenAPI/MCP/migration surface changed (a single backend predicate + its unit test), so ui:* / ui:openapi:check / cf-typegen / migration checks are N/A to this diff.

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. — N/A: no auth/session surface touched.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — N/A: no API/MCP surface changed.
  • No visible UI changes (backend predicate only), so no UI Evidence section is required.
  • Public docs/changelogs: none needed; no changelog edited.

Notes

  • shouldPublishPrIntelligenceComment has zero production callers in src/ (verified), so this is behavior-preserving for the live webhook/preview paths — it removes a tautology that would otherwise mislead any future caller relying on commentMode for an oss_maintainer repo.

…Mode for oss_maintainer (JSONbored#6776)

The oss_maintainer branch returned `commentMode === "all_prs" || detection.detected ||
detection.source !== "official_gittensor_api"`. The third disjunct is a tautology: `detection.source`
is only ever "official_gittensor_api" (paired with detected: true) or undefined, so it is true whenever
`detected` is false — making the whole branch unconditionally true. For every oss_maintainer-audience
repo, `commentMode: "detected_contributors_only"` silently behaved like `"all_prs"`, defeating the gate.

Drops the tautological disjunct so the branch gates on commentMode + detection, matching the
documented single source of truth (`shouldPublishPrComment`). Adds the previously-absent oss_maintainer
branch tests, including the regression: detected_contributors_only + an undetected contributor now
returns false.

Closes JSONbored#6776
@real-venus
real-venus requested a review from JSONbored as a code owner July 17, 2026 08:35
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.64%. Comparing base (b9e39dd) to head (f0f19f6).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6853   +/-   ##
=======================================
  Coverage   93.63%   93.64%           
=======================================
  Files         683      683           
  Lines       68163    68163           
  Branches    18706    18706           
=======================================
+ Hits        63827    63828    +1     
  Misses       3350     3350           
+ Partials      986      985    -1     
Flag Coverage Δ
shard-1 43.69% <100.00%> (+<0.01%) ⬆️
shard-2 36.86% <0.00%> (+0.12%) ⬆️
shard-3 32.81% <0.00%> (+0.05%) ⬆️
shard-4 34.75% <0.00%> (-0.06%) ⬇️
shard-5 31.70% <0.00%> (-0.08%) ⬇️
shard-6 45.46% <0.00%> (ø)

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

Files with missing lines Coverage Δ
packages/loopover-engine/src/signals/engine.ts 97.67% <100.00%> (+0.06%) ⬆️

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 17, 2026
@loopover-orb

loopover-orb Bot commented Jul 17, 2026

Copy link
Copy Markdown

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-17 08:45:52 UTC

2 files · 1 AI reviewer · no blockers · readiness 88/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR removes a tautological disjunct (`detection.source !== "official_gittensor_api"`) from the oss_maintainer branch of shouldPublishPrIntelligenceComment, correctly reducing the gate to `commentMode === "all_prs" || detection.detected`, which now matches the documented contract in settings-preview.ts. The description's claim that source is only ever "official_gittensor_api" (paired with detected:true) or undefined is consistent with the visible fix and the new tests correctly lock in the regression case (detected_contributors_only + undetected → false). The PR is narrow, closes issue #6776, and includes targeted test coverage for exactly the changed line.

Nits — 4 non-blocking
  • The description states the function has zero production callers today, but this isn't verifiable from the diff alone — worth double-checking since dead code with a fixed tautology has limited practical impact until wired to a caller.
  • The inline comment in engine.ts:1422-1425 is fairly long for a one-line fix; could be tightened to just the invariant and issue reference.
  • Consider a follow-up issue/PR to actually wire shouldPublishPrIntelligenceComment into a real caller if it's meant to eventually replace or coexist with shouldPublishPrComment, since an unused function with corrected logic still doesn't affect production behavior.
  • The test at test/unit/signals.test.ts:832-833 asserting on cachedDetected.source is a sanity check on the fixture, not the function under test — fine as documentation but not itself functional coverage.

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 #6776
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High 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: 157 registered-repo PR(s), 86 merged, 20 issue(s).
Contributor context ✅ Confirmed Gittensor contributor real-venus; Gittensor profile; 157 PR(s), 20 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The diff drops the tautological disjunct exactly as the issue requested (settings.commentMode === "all_prs" || detection.detected) and adds both regression tests called for: detected_contributors_only + undetected returns false, and detected_contributors_only + a non-official detected contributor returns true.

Review context
  • Author: real-venus
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript, Python, Rust, CSS, MDX, Svelte, Swift
  • Official Gittensor activity: 157 PR(s), 20 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 1 step in the Signals table above.
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

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 fa8f577 into JSONbored:main Jul 17, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shouldPublishPrIntelligenceComment's oss_maintainer branch is a tautology that defeats the documented commentMode contract

1 participant