Skip to content

Commit 6f0219f

Browse files
authored
feat(pipeline): implement 3-phase slop detection pipeline architecture (#107) (#116)
* feat(pipeline): implement 3-phase slop detection pipeline architecture (#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 * feat(cli-enhancers): add language-aware tool detection with caching - 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 * fix(cli-enhancers): prevent command injection in path handling - 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. * docs: update deslop-around documentation for pipeline architecture 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 * fix(pipeline): honor language filter for non-JS language runs 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. * refactor(tests): remove unused variables in test files 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
1 parent 965a77e commit 6f0219f

30 files changed

Lines changed: 8572 additions & 146 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Added
11+
- **Slop Detection Pipeline Architecture** - 3-phase detection pipeline with certainty-tagged findings (#107)
12+
- **Phase 1** (always runs): Built-in regex patterns + multi-pass analyzers
13+
- **Phase 2** (optional): CLI tool integration (jscpd, madge, escomplex) - if available
14+
- **Phase 3**: LLM handoff with structured findings
15+
- Certainty levels: HIGH (regex), MEDIUM (multi-pass), LOW (CLI tools)
16+
- Thoroughness levels: quick (regex only), normal (+multi-pass), deep (+CLI)
17+
- Mode inheritance from deslop-around: report (analyze only) vs apply (fix issues)
18+
- New `runPipeline()` function in lib/patterns/pipeline.js
19+
- New lib/patterns/cli-enhancers.js for optional tool detection
20+
- deslop-work.md agent updated to use pipeline orchestrator
21+
- Graceful degradation when CLI tools not installed
22+
1123
- **Buzzword Inflation Detection** - New project-level analyzer for `/deslop-around` command (#113)
1224
- Detects quality claims in documentation without supporting code evidence
1325
- 6 buzzword categories: production, enterprise, security, scale, reliability, completeness

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,28 @@ Ship your code from commit to production with full validation and state integrat
152152

153153
### `/deslop-around` - AI Slop Cleanup
154154

155-
Remove debugging code, old TODOs, and AI slop from your codebase.
155+
Remove debugging code, old TODOs, and AI slop from your codebase with a 3-phase detection pipeline.
156156

157157
```bash
158158
/deslop-around # Report mode - analyze only
159159
/deslop-around apply # Apply fixes with verification
160160
/deslop-around apply src/ 10 # Fix up to 10 issues in src/
161161
```
162162

163+
**Architecture:**
164+
- **Phase 1** - Built-in regex patterns (HIGH certainty)
165+
- **Phase 2** - Multi-pass analyzers (MEDIUM certainty)
166+
- **Phase 3** - Optional CLI tools (LOW certainty, graceful degradation)
167+
- JavaScript/TypeScript: jscpd, madge, escomplex
168+
- Python: pylint, radon
169+
- Go: golangci-lint
170+
- Rust: clippy
171+
172+
**Thoroughness levels:**
173+
- `quick` - Phase 1 only (fastest)
174+
- `normal` - Phase 1 + Phase 2 (default)
175+
- `deep` - Phase 1 + Phase 2 + Phase 3 (if tools available)
176+
163177
**Detects:**
164178
- Console debugging (`console.log`, `print()`, `dbg!()`)
165179
- Old TODOs and commented code
@@ -170,6 +184,7 @@ Remove debugging code, old TODOs, and AI slop from your codebase.
170184
- Phantom references (issue/PR mentions, file path references in comments)
171185
- Infrastructure components configured but never used (unused DB clients, caches, API clients)
172186
- Code smells: boolean blindness, message chains, mutable globals, dead code, shotgun surgery
187+
- Buzzword inflation (quality claims without evidence)
173188

174189
---
175190

0 commit comments

Comments
 (0)