Skip to content

feat(pipeline): implement 3-phase slop detection pipeline architecture (#107) - #116

Merged
avifenesh merged 6 commits into
mainfrom
feature/107-slop-detection-pipeline
Jan 22, 2026
Merged

feat(pipeline): implement 3-phase slop detection pipeline architecture (#107)#116
avifenesh merged 6 commits into
mainfrom
feature/107-slop-detection-pipeline

Conversation

@avifenesh

Copy link
Copy Markdown
Collaborator

Summary

Implements a 3-phase slop detection pipeline architecture as specified in #107:

  • Phase 1 (Built-in): Zero-dependency regex patterns + multi-pass analyzers (always runs)
  • Phase 2 (CLI Enhancement): Optional language-aware CLI tools with graceful degradation
  • Phase 3 (LLM Handoff): Certainty-tagged findings formatted for agent review

Key Features

  • Certainty tagging: HIGH (direct matches), MEDIUM (multi-pass analysis), LOW (heuristics)
  • Thoroughness levels: quick, normal, deep
  • Language detection: Auto-detects project languages from config files
  • Tool recommendations: jscpd, madge, escomplex (JS), pylint, radon (Python), golangci-lint (Go), clippy (Rust)
  • Per-repo caching: 5-minute TTL for tool availability checks
  • Mode inheritance: report (analyze only) vs apply (fix issues) from deslop-around

Files Created

  • lib/patterns/pipeline.js - 3-phase pipeline orchestrator
  • lib/patterns/cli-enhancers.js - Language-aware CLI tool integration with caching
  • __tests__/pipeline.test.js - Pipeline tests
  • __tests__/cli-enhancers.test.js - CLI enhancer tests with security validation

Security

  • Command injection prevention via shell escaping for all CLI tool invocations
  • Security tests added to validate path sanitization

Test Plan

  • All existing tests pass (1053+ tests)
  • New pipeline tests pass
  • New CLI enhancer tests pass (including security tests)
  • Synced to all 5 plugins

Closes #107

Copilot AI review requested due to automatic review settings January 22, 2026 08:23

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7106ea918a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/patterns/pipeline.js Outdated

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

Pull request overview

This PR implements a 3-phase slop detection pipeline architecture to enhance AI-generated code detection. The implementation adds structured certainty tagging (HIGH/MEDIUM/LOW) and optional CLI tool integration with graceful degradation.

Changes:

  • Introduces pipeline.js and cli-enhancers.js modules synced across 5 plugins + root lib
  • Adds 3-phase detection: regex patterns (Phase 1), multi-pass analyzers (Phase 2), CLI tools (Phase 3)
  • Implements certainty-tagged findings with thoroughness levels (quick/normal/deep)
  • Updates agent workflows, documentation, and exports

Reviewed changes

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

Show a summary per file
File Description
lib/patterns/pipeline.js Core pipeline orchestrator with 3-phase detection logic
lib/patterns/cli-enhancers.js Optional CLI tool integration with caching and security
plugins/*/lib/patterns/pipeline.js Synced pipeline across ship, reality-check, project-review, next-task, deslop-around
plugins/*/lib/patterns/cli-enhancers.js Synced CLI enhancers across all 5 plugins
plugins/*/lib/index.js Export updates for new pipeline and cliEnhancers modules
plugins/*/lib/config/index.js Placeholder config modules
plugins/next-task/agents/deslop-work.md Updated agent workflow to use pipeline
tests/pipeline.test.js Comprehensive test suite (627 lines)
docs/USAGE.md Documentation of pipeline architecture
README.md Updated feature descriptions
CHANGELOG.md Release notes for pipeline feature

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

Comment thread __tests__/cli-enhancers.test.js Outdated
Comment thread __tests__/cli-enhancers.test.js Outdated
Comment thread __tests__/cli-enhancers.test.js Outdated
Comment thread __tests__/pipeline.test.js Outdated
Comment thread __tests__/pipeline.test.js Outdated
@avifenesh

Copy link
Copy Markdown
Collaborator Author

Fixed the language filter issue in 0d977f1. The filter now correctly:

  • Only allows JS files through when the language filter IS javascript or typescript
  • For other languages (python, go, rust), only files matching that specific language are processed

Thanks for catching this @chatgpt-codex-connector!

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • Not run (not requested).

View task →

Copilot AI review requested due to automatic review settings January 22, 2026 08:32
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @avifenesh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant architectural enhancement to the slop detection mechanism, moving from a monolithic approach to a modular, multi-phase pipeline. This change improves the accuracy and flexibility of identifying code quality issues by incorporating various analysis techniques, from simple regex to advanced CLI tools, and provides a structured output for AI agents to act upon. The new design also includes robust security measures and configurable analysis depth.

Highlights

  • 3-Phase Slop Detection Pipeline: Implemented a new architecture for slop detection, comprising three phases: built-in regex patterns and multi-pass analyzers (always runs), optional language-aware CLI tools, and a structured LLM handoff for findings.
  • Certainty Tagging: Introduced certainty levels (HIGH, MEDIUM, LOW) for detected findings, allowing for prioritized review and action based on the confidence of the detection.
  • Thoroughness Levels: Added configurable thoroughness levels ('quick', 'normal', 'deep') to control the depth of analysis, from basic regex scans to comprehensive CLI tool integration.
  • Language-Aware CLI Tool Integration: Integrated optional external CLI tools (e.g., jscpd, madge, escomplex for JS; pylint, radon for Python; golangci-lint for Go; clippy for Rust) with project language detection, graceful degradation, and per-repository caching.
  • Enhanced Security: Implemented command injection prevention via shell escaping for all CLI tool invocations and added security tests to validate path sanitization.
  • Agent Workflow Update: The deslop-work.md agent has been updated to leverage the new pipeline orchestrator, processing findings based on their certainty levels for more intelligent auto-fixing and manual review flagging.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

#107)

Implement a pipeline-based detection system with certainty-tagged findings:

Phase 1 (always runs):
- Built-in regex patterns from slop-patterns.js
- Multi-pass analyzers (doc/code ratio, verbosity, over-engineering, buzzwords)
- HIGH certainty findings - can be auto-fixed directly

Phase 2 (optional - if tools available):
- jscpd for duplicate code detection
- madge for circular dependency detection
- escomplex for cyclomatic complexity analysis
- LOW certainty findings - need verification

Phase 3 (LLM handoff):
- Certainty-tagged findings for agent review
- Token-efficient prompt format
- Action guidance by certainty level

New files:
- lib/patterns/pipeline.js - Pipeline orchestrator
- lib/patterns/cli-enhancers.js - Optional CLI tool integration
- lib/config/index.js - Config stub
- __tests__/pipeline.test.js - Pipeline tests
- __tests__/cli-enhancers.test.js - CLI enhancers tests

Updates:
- deslop-work.md - Now uses pipeline orchestrator
- lib/index.js - Exports new modules

Features:
- Thoroughness levels: quick (regex), normal (+analyzers), deep (+CLI)
- Mode inheritance: report vs apply from deslop-around
- Graceful degradation when CLI tools not installed
- Missing tools notification at end of analysis
- Detect project languages (JS/TS, Python, Go, Rust) from config files
- Recommend CLI tools appropriate for detected languages
- Add per-repo caching with 5-minute TTL for tool availability
- Support jscpd (cross-lang), madge/escomplex (JS), pylint/radon (Python),
  golangci-lint (Go), clippy (Rust)
- Update tests with 61 new test cases for language detection
- Fix pipeline tests to use functions meeting minimum thresholds

Relates to #107
- Escape user-provided paths with escapeDoubleQuotes() before shell execution
- Affects runDuplicateDetection, runDependencyAnalysis, runComplexityAnalysis
- Add 3 security tests for shell metacharacter handling
- Synced fix to all 5 plugin lib directories

Security: Prevents command injection via malicious paths containing
$, backticks, $(cmd), or quotes.
Added comprehensive documentation for the new 3-phase slop detection
pipeline introduced in #107:

- **Architecture section**: Explains Phase 1 (regex), Phase 2 (multi-pass),
  Phase 3 (CLI tools) with certainty levels (HIGH/MEDIUM/LOW)
- **Thoroughness levels**: Documents quick/normal/deep modes
- **Language-aware tools**: Lists recommended tools per language
  - JavaScript/TypeScript: jscpd, madge, escomplex
  - Python: pylint, radon
  - Go: golangci-lint
  - Rust: clippy
- **Enhanced detection list**: Added buzzword inflation and code smells

Updated files:
- README.md: Main command reference
- docs/USAGE.md: Detailed usage guide

Refs #107
When a non-JS language filter is set (e.g., python), the previous logic
incorrectly allowed JS files through. Now the special case for 'js'
detection only applies when the language filter IS javascript or
typescript.

Addresses review feedback from Codex.
Address Copilot review feedback:
- Remove unused 'name' in CLI_TOOLS iteration
- Use more descriptive variable names in cache refresh test
- Remove unused multiPassFindings and mediumFindings variables
@avifenesh
avifenesh force-pushed the feature/107-slop-detection-pipeline branch from 79a6568 to 105be67 Compare January 22, 2026 08:36

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

Pull request overview

Copilot reviewed 30 out of 30 changed files in this pull request and generated no new comments.


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

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a 3-phase slop detection pipeline architecture, enhancing the /deslop-around command with certainty-tagged findings and optional CLI tool integration. The changes include new pipeline.js and cli-enhancers.js modules, updated documentation in CHANGELOG.md, README.md, and docs/USAGE.md, and corresponding test files. The deslop-work.md agent has also been updated to leverage the new pipeline orchestrator. The new architecture provides a structured approach to identifying and addressing code quality issues, categorizing findings by certainty (HIGH, MEDIUM, LOW) to guide subsequent actions. Overall, the implementation is robust, with good test coverage for the new modules, including security validation for command injection prevention. The caching mechanism for CLI tool availability is a thoughtful addition for performance. The documentation updates clearly explain the new architecture and thoroughness levels.

@github-actions

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@avifenesh
avifenesh merged commit 6f0219f into main Jan 22, 2026
7 checks passed
@avifenesh
avifenesh deleted the feature/107-slop-detection-pipeline branch January 22, 2026 08:45
avifenesh added a commit that referenced this pull request Jan 22, 2026
…116)

- Added details about deslop-work agent rewrite (pseudo-JS to explicit tool usage)
- Documented formatHandoffPrompt() for token-efficient LLM handoff
- Added Changed section for agent refactor and deslop-around docs enhancements
- Clarified certainty-based decision making architecture
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.

Slop Detection Pipeline Architecture

2 participants