Skip to content

Enhance slop detection and update sloplist.json#1

Open
Louis27940 wants to merge 5 commits into
Dan-Cleary:mainfrom
Louis27940:main
Open

Enhance slop detection and update sloplist.json#1
Louis27940 wants to merge 5 commits into
Dan-Cleary:mainfrom
Louis27940:main

Conversation

@Louis27940

@Louis27940 Louis27940 commented Apr 5, 2026

Copy link
Copy Markdown

This pull request enhances the detection of overused phrases in LLM responses by adding a new category for closing phrases ("ending slop") and updating the data and detection logic. It also expands the lists of common opening and validation phrases.

Improvements to slop phrase detection :

  • Added a new "ending_slop" category to "sloplist.json" for detecting overused LLM closing phrases, with a description, detection type, and sample phrases.

  • Implemented the "detectEnding" function in "scripts/scoring.ts" to scan the end of responses for these closing phrases and integrated it into the overall scoring logic.

  • Updated the "SlopList" type in "scripts/scoring.ts" to include the new "ending_slop" category.

Expansion of slop phrase lists :

  • Added new common opening and validation phrases ("Let’s break it down", "Great catch") to the respective sections in "sloplist.json".

Update of the display of the category of slop detected :

  • Added the "ending_slop" category in "scr/components/responceexplorer.ts" to display the detection of ending slop in the result on the website

Summary by CodeRabbit

  • New Features
    • Detection now identifies common assistant-style closing/ending phrases.
    • Phrase library expanded with two variants of an opener ("Let's break it down") and a new validation phrase ("Great catch").
    • Response analysis updated to show ending-phrase detections alongside existing categories.

Copilot AI review requested due to automatic review settings April 5, 2026 00:10
@vercel

vercel Bot commented Apr 5, 2026

Copy link
Copy Markdown

@Louis27940 is attempting to deploy a commit to the dan-1729's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Apr 5, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: db10b5bc-0587-4cdf-9452-4827dd2fbff5

📥 Commits

Reviewing files that changed from the base of the PR and between 8d76fea and c5475ba.

📒 Files selected for processing (1)
  • data/sloplist.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • data/sloplist.json

📝 Walkthrough

Walkthrough

Added a new ending_slop category and detection to identify assistant-style closing phrases; extended opener_slop and validation_slop phrase lists; added detectEnding() logic and included ending_slop in the UI breakdown rendering.

Changes

Cohort / File(s) Summary
Slop data
data/sloplist.json
Added new top-level ending_slop category with detection: "string_match_response_end" and items; expanded opener_slop.items with Let’s break it down/Let's break it down and added Great catch to validation_slop.items.
Scoring / Detection
scripts/scoring.ts
Added exported detectEnding(text, items): SlopHit[], extended SlopList typings to include ending_slop, and integrated detectEnding into scoreResponse to append ending slop hits.
UI Display
src/components/ResponseExplorer.jsx
Included ending_slop in the slop breakdown categories so ending hits are rendered in the breakdown view.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client (UI)
  participant Scorer as Scoring Service (`scripts/scoring.ts`)
  participant Data as Slop Data (`data/sloplist.json`)
  Client->>Scorer: Submit response text
  Scorer->>Data: Load slop items (opener, validation, ending)
  Scorer->>Scorer: detectEnding(last 220 chars) / other detectors
  Scorer-->>Client: Return slop_hits (including ending_slop)
  Client->>Client: Render breakdown (includes ending_slop)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nibble at tails and endings bright,

"I hope this helps" caught in my sight.
A hop, a sniff, the slop I find,
Closing phrases neatly lined.
Hooray — the breakdown's feeling right!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding a new slop detection category (ending_slop) and updating the sloplist.json file with new phrases and categories.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI 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.

Pull request overview

This PR expands SlopBench’s phrase detection by introducing an “ending_slop” category to catch common assistant-style closing phrases, wiring it into scoring, and surfacing it in the UI breakdown.

Changes:

  • Added ending_slop category and items to data/sloplist.json.
  • Implemented detectEnding and integrated it into scoreResponse in scripts/scoring.ts.
  • Updated ResponseExplorer to include ending_slop in displayed category breakdown.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/components/ResponseExplorer.jsx Adds ending_slop to the list of categories shown in the breakdown UI.
scripts/scoring.ts Adds end-of-response phrase detection and includes it in response scoring.
data/sloplist.json Expands slop phrase lists and introduces the new ending_slop category metadata/items.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/scoring.ts
Comment on lines +67 to +70
const tail = text.slice(-220).toLowerCase();
const hits: SlopHit[] = [];
for (const item of items) {
if (tail.includes(item.toLowerCase())) {

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

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

detectEnding is labeled/used as an end-of-response detector, but it currently uses tail.includes(...), which will flag phrases anywhere in the last 220 chars (not necessarily as a closing). This can create false positives and makes the implementation inconsistent with string_match_response_end semantics; consider trimming trailing whitespace/punctuation and using endsWith, or requiring the match index to be within a small window of the actual end.

Suggested change
const tail = text.slice(-220).toLowerCase();
const hits: SlopHit[] = [];
for (const item of items) {
if (tail.includes(item.toLowerCase())) {
const normalizeEnding = (value: string): string =>
value.toLowerCase().replace(/[\s.!?,;:'")\]]+$/g, "");
const tail = normalizeEnding(text.slice(-220));
const hits: SlopHit[] = [];
for (const item of items) {
const normalizedItem = normalizeEnding(item);
if (normalizedItem && tail.endsWith(normalizedItem)) {

Copilot uses AI. Check for mistakes.
Comment thread scripts/scoring.ts
Comment on lines +67 to +68
const tail = text.slice(-220).toLowerCase();
const hits: SlopHit[] = [];

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

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

The 220 tail length in text.slice(-220) is an unexplained magic number. Please pull this into a named constant (and ideally comment/justify it) so it’s clear how much of the response is considered “the end” and easy to tune later.

Copilot uses AI. Check for mistakes.
Comment thread data/sloplist.json Outdated
Comment thread data/sloplist.json
Comment on lines +185 to +186
"If you want, I can help you",
"Feel free to ask"

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

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

ending_slop.items contains both "Feel free to ask if you have any more questions" and the shorter substring "Feel free to ask". With the current substring matching, the longer phrase will trigger both entries and double-count hits. Consider removing/rewriting the shorter entry for this category, or updating the detection logic to prefer the longest match / deduplicate overlaps.

Suggested change
"If you want, I can help you",
"Feel free to ask"
"If you want, I can help you"

Copilot uses AI. Check for mistakes.
Comment thread src/components/ResponseExplorer.jsx
@Louis27940 Louis27940 closed this Apr 5, 2026
@Louis27940 Louis27940 reopened this Apr 5, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants