Skip to content

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

Description

@JSONbored

Context

packages/loopover-engine/src/signals/engine.ts:1419-1424 — for publicAudienceMode === "oss_maintainer", the function returns settings.commentMode === "all_prs" || detection.detected || detection.source !== "official_gittensor_api". In every real construction site, 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 the third disjunct is true whenever detected is false, making the whole expression unconditionally true: for any oss_maintainer-audience repo, commentMode: "detected_contributors_only" behaves identically to "all_prs". The correct semantics already exist in the actual production implementation, shouldPublishPrComment in src/signals/settings-preview.ts:31-36 (the documented single source of truth for the live webhook processor and dry-run preview), which correctly gates on commentMode with no audience carve-out. shouldPublishPrIntelligenceComment has zero production callers anywhere in src/ — it's a superseded duplicate, still exported and able to mislead a future caller. Every existing test uses publicAudienceMode: "gittensor_only"; the oss_maintainer branch has zero test coverage, which is why the always-true collapse was never caught.

Requirements

  • Either delete shouldPublishPrIntelligenceComment in favor of the already-correct shouldPublishPrComment/decidePublicSurface, or fix the oss_maintainer branch to actually respect commentMode (e.g. settings.commentMode === "all_prs" || detection.detected, dropping the disjunct that defeats the gate).
  • Add test coverage for the oss_maintainer branch either way.

Deliverables

  • shouldPublishPrIntelligenceComment deleted or fixed
  • Regression test: oss_maintainer + commentMode: "detected_contributors_only" + an undetected contributor returns false
  • Regression test: same settings + a non-official detected contributor locks in the intended semantics

Test Coverage Requirements

99%+ Codecov patch coverage on every changed line and branch, plus a regression test that reproduces the exact failure mode described above and asserts it's fixed.

Expected Outcome

No exported function in this codebase silently ignores commentMode for oss_maintainer-audience repos.

Links & Resources

packages/loopover-engine/src/signals/engine.ts:1419-1424, src/signals/settings-preview.ts:31-36,127-131, src/queue/processors.ts:7886,13843-13875.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions