Skip to content

Restore the slop index on three axes: Noise, Lies and Soul - #108

Merged
CodeDeficient merged 2 commits into
mainfrom
feat/three-axis-index
Oct 26, 2026
Merged

CodeDeficient merged 2 commits into
mainfrom
feat/three-axis-index

Conversation

@CodeDeficient

@CodeDeficient CodeDeficient commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

User description

Closes #103.

KarpeSlop started as a slop index: one score that says how much of a codebase is slop, and what kind. 2.0.0 dropped the 1.x point total because it grew with repository size, and the three axes went with it. This brings them back, normalized.

What changes

  • Every built-in rule has an axis: noise (information utility), lies (information quality) or soul (style and taste). --help lists it next to the severity.

  • Every run that scans application code ends with a score per axis and a total:

    Slop index (application code, higher is worse):
      Noise  information utility     0.6  restating_comment, production_console_log, filler_comment
      Lies   information quality     7.8  unsafe_object_assertion, unsafe_double_type_assertion, unsafe_array_assertion
      Soul   style and taste         3.5  type_assertion, non_null_assertion, any_type_usage
      Total                         11.9
    
  • Each rule adds weight(severity) × ln(1 + findings per 1,000 lines) to its axis, with weights 8/4/2/1. Only findings in application source count: tests and package manifests are left out.

    • Per 1,000 lines, so repositories of different sizes compare.
    • Logarithmic, so one rule repeated hundreds of times cannot outweigh several different kinds of slop. v1's Soul score was 95% magic_css_value.
  • The JSON report adds slopIndex and an axis on every issue and byType entry.

  • customPatterns take an optional axis (default soul); an unknown value makes the config invalid.

  • The README, package description and codemeta lead with the three axes again, and the README credits Karpathy's "slop index" idea.

Numbers

Testing

  • npm test: 157 pass, 4 of them new. They cover size-independence, a repeated rule versus varied slop, axes in the report and summary, and invalid axis values.
  • npm run typecheck is clean.
  • Reviewed with /review (reviewer on Haiku 5.5): both commits PASS. The P2 notes from the first review are fixed in the second commit. The remaining P3 is filed as a follow-up issue.

Follow-ups: #107 (taste rules for the Soul axis), #106 (type_assertion volume).

🤖 Generated with Claude Code


CodeAnt-AI Description

Score code findings across noise, lies, and soul

What Changed

  • Each scan now ends with a score for Noise, Lies, and Soul, plus a total.
  • Scores use application-code findings per 1,000 lines, making results comparable across repository sizes. Test files and package-age warnings are not scored.
  • The JSON report includes the scores and an axis for each finding. Custom rules can choose an axis; the default is Soul.

Impact

✅ Comparable scores across repository sizes
✅ Clearer separation of noise, misleading code, and style findings
✅ Package-age warnings stay out of code scores

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

CodeDeficient and others added 2 commits October 26, 2026 07:55
KarpeSlop started as a slop index: one score that says how much of a
codebase is slop and what kind. 2.0.0 dropped the 1.x point total
because it grew with repository size, and the three axes went with it.

Every rule now belongs to an axis: noise (information utility), lies
(information quality) or soul (style and taste). The summary ends with
a score per axis and a total, computed from application-code findings
as weight(severity) * ln(1 + findings per 1,000 lines) per rule. Scores
compare across repository sizes, and one rule repeated hundreds of
times cannot outweigh several different kinds of slop.

The JSON report adds slopIndex and an axis on every issue and byType
entry. customPatterns take an optional axis (default soul), and --help
lists each rule's axis. README and package description lead with the
three axes again.

Refs #103

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fresh_package_version findings come from package.json, which is not
application source, so they never count toward the slop index. The
README and CHANGELOG now say so.

The summary test required a particular rule to be listed first on the
Lies line, which held only because of the alphabetical tie-break. It
now checks that each expected rule appears on its axis line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codeant-ai

codeant-ai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  Reviewed your PR 2548a62 Oct 26, 2026 · 12:00 12:04

@codeant-ai

codeant-ai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Oct 26, 2026
@CodeDeficient
CodeDeficient merged commit 8b2b564 into main Oct 26, 2026
2 of 3 checks passed
@codeant-ai

codeant-ai Bot commented Oct 26, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt Nitpicks

1 code suggestion

1. When a scan has application lines but no findings, generateReport returns above this line, so the promised three axis scores and total are never printed.

Logic error · ai-slop-detector.ts:1045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore the three-axis slop index (Noise / Lies / Soul), normalized per KLOC

1 participant