Skip to content

feat(signals): slop signal — duplicate-cluster membership (#563) - #944

Closed
oktofeesh1 wants to merge 1 commit into
JSONbored:mainfrom
oktofeesh1:feat/issue-563-duplicate-cluster-slop-v2
Closed

feat(signals): slop signal — duplicate-cluster membership (#563)#944
oktofeesh1 wants to merge 1 commit into
JSONbored:mainfrom
oktofeesh1:feat/issue-563-duplicate-cluster-slop-v2

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Closes #563 (epic #530). Resubmit of the closed #942 with the review note addressed.

What

Adds the duplicate-cluster-membership slop signal: it fires when a PR sits in a high-risk collision cluster that holds 2+ open pull requests — i.e. genuine overlapping/duplicate work.

How (precise, zero added gate cost)

  • Reuses the collision report the gate already builds for queue health, passed into the slop input — no extra DB load or O(n²) compute on the hot gate path.
  • False-positive-averse (this score can gate): the 2+-pull-request bar excludes a healthy issue↔its-own-linking-PR pair, which buildCollisionReport also marks high-risk (the feat(api): maintainer quality-dashboard service + endpoint #557 lesson).
  • Weighted 15 (secondary signal); static, public-safe text. Inert on the local lint surfaces (no repo collision context). Undefined context is handled gracefully (returns no finding).

Change since #942

Both reviewers found the implementation correct; the only actionable note (Reviewer A) was to add a test for the combined slopRisk band when the duplicate-cluster weight stacks with other weights. Done — added one test: duplicate-cluster + missing-test-evidence → slopRisk 45 → elevated band, both findings present. No implementation change.

Tests

test/unit/slop.test.ts: fires for a high-risk 2-PR cluster containing the PR; no fire for missing context / issue+PR pair / non-high-risk / non-member; combined-weight band. Full npm run test:coverage green (branches 97.03%); new lines fully covered.

Files: src/signals/slop.ts, src/queue/processors.ts (2 lines reusing the existing collisions), slop test.

🤖 Generated with Claude Code

)

Adds the duplicate-cluster-membership deterministic slop signal (epic JSONbored#530).
Fires when a PR sits in a HIGH-risk collision cluster that holds 2+ open pull
requests — genuine overlapping/duplicate work.

- Reuses the collision report the gate already builds (buildCollisionReport,
  reused via the slop input — no extra DB load or compute on the hot gate path).
- High-precision: the 2+-pull-request bar deliberately excludes a healthy
  issue↔its-own-linking-PR pair, which buildCollisionReport also marks high-risk
  (the JSONbored#557 lesson) — so this blocking signal stays false-positive-averse.
- Weighted 15 (a secondary signal, like empty-description); static, public-safe
  detail text. Inert on the local lint surfaces (no repo collision context).

Tests in slop.test.ts cover: fires for a high-risk 2-PR cluster containing the
PR; no fire for missing context, an issue+PR pair, a non-high-risk cluster, or a
cluster the PR isn't a member of; and the combined-weight band (duplicate-cluster
+ missing-test-evidence → elevated). Full test:coverage green (branches 97.03%).

Closes JSONbored#563

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@oktofeesh1
oktofeesh1 requested a review from JSONbored as a code owner June 20, 2026 16:49
@dosubot dosubot Bot added the size:M label Jun 20, 2026
@ghost ghost added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jun 20, 2026
@ghost

ghost commented Jun 20, 2026

Copy link
Copy Markdown

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

⛔ Maintainer review — Not merged

Reviewed 3 changed file(s) — two independent AI reviewers, synthesized.

ℹ️ This PR conflicts with main and can't be merged as-is. Conflicting file(s): src/queue/processors.ts, src/signals/slop.ts, test/unit/slop.test.ts. Resolve the conflict(s) and open a fresh PR.

Merge readiness: ✅ Mergeable (conflicting) · all CI checks green/neutral/skipped.

Summary

The change correctly adds a duplicate‑cluster slop signal, updates the assessment input type, weights, rubric, and integrates the new finding into the risk calculation. All new code is type‑safe, uses static public‑safe text, and does not introduce security or privacy issues. Tests cover the new behavior and all CI checks pass.

💡 Nits — non-blocking, optional

  • Minor style: import ordering could be adjusted per lint rules.
  • Consider adding a brief comment in the import block indicating why CollisionReport is imported.
  • Run the linter to ensure import ordering conforms to project style.
  • Consider adding a comment explaining the purpose of the collisions and pullNumber fields in the SlopAssessmentInput type.
  • Consider adding a test case for the scenario where the collisions field is present but pullNumber is not.
  • Consider adding a test case for the scenario where the collisions field is not present but pullNumber is.

This repo uses one-shot review: a rejected PR is closed, not iterated in place. Address the above and open a new focused PR.

@ghost ghost added the reviewbot-review label Jun 20, 2026
@ghost

ghost commented Jun 20, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #944 is no longer open. No action.

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

@ghost ghost added the gittensory:reviewed label Jun 20, 2026
@superagent-security

superagent-security Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

⚠️ Contributor trust inconclusive. Click here for more info: Superagent Dashboard

@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.62%. Comparing base (9cbdc6a) to head (59e168d).
⚠️ Report is 22 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #944   +/-   ##
=======================================
  Coverage   96.62%   96.62%           
=======================================
  Files         110      110           
  Lines       14997    15008   +11     
  Branches     5419     5424    +5     
=======================================
+ Hits        14491    14502   +11     
  Misses        104      104           
  Partials      402      402           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ghost ghost closed this Jun 20, 2026
@ghost ghost removed reviewbot-review labels Jun 20, 2026
@JSONbored JSONbored reopened this Jun 21, 2026
@ghost ghost closed this Jun 21, 2026
@JSONbored JSONbored reopened this Jun 21, 2026
@ghost ghost closed this Jun 21, 2026
@JSONbored JSONbored reopened this Jun 21, 2026
@ghost ghost closed this Jun 21, 2026
@JSONbored JSONbored reopened this Jun 21, 2026
@ghost ghost closed this Jun 21, 2026
@JSONbored JSONbored reopened this Jun 21, 2026
@ghost ghost closed this Jun 21, 2026
This pull request was closed.
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.

feat(signals): slop signal — duplicate-cluster membership

2 participants