Metadata-Version: 2.4
Name: ai-slop-scorer
Version: 1.1.0
Summary: Deterministic multi-axis AI slop scorer for web pages: content, visual, copy, craft. Stdlib only, zero tokens.
Author: Shridhar Ashok Yadav
License: MIT
Project-URL: Homepage, https://github.com/shridharyadav88/ai-slop-detector
Keywords: ai-slop,content-quality,accessibility,seo,lint
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# WASS — Website AI Slop Scorer

Scores any single web page **0–100 for AI slop** (higher = worse): low-value, generic,
repetitive, or misleading content, whether written by a human or a machine.

AI-generated content can be excellent. This tool doesn't detect AI authorship —
it measures **content quality** across 10 weighted dimensions and explains every point.

```bash
# Zero-setup version: pure Python, no keys, no tokens, no network (except fetching the page itself)
python3 wass.py https://example.com/some-article --out report/

# Full version: adds one AI reading for the 4 dimensions that need understanding
python3 wass_hybrid.py https://example.com/some-article --out report/
```

Each run writes a JSON file (for tooling) and a Markdown report (for humans) with a
worst-first **"Fix first"** list — every flagged dimension names its cost in points,
a concrete fix, and the exact evidence behind the score.

## Install (pip)

```bash
pip install ai-slop-scorer
wass good.md --out report/   # entry points: wass wass-visual wass-copy wass-craft wass-site wass-hybrid wass-sample
```

Stdlib only — installing adds no dependencies. `python3 wass.py` from a clone works identically.

## Publishing (maintainers)

Releases publish to PyPI via Trusted Publishing (OIDC — no tokens anywhere):

1. One-time, on pypi.org (needs your login): account Settings → Publishing → Add a new
   **pending publisher**: owner `shridharyadav88`, repo `ai-slop-detector`,
   workflow `publish.yml`, environment `pypi`. The `ai-slop-scorer` name registers itself
   on first publish (verified free).
2. One-time, on GitHub: repo Settings → Environments → new environment `pypi`
   (protection rules optional but recommended).
3. Release: `git tag v1.1.0 && git push origin v1.1.0` — the workflow builds and publishes.
   Keep `version` in `pyproject.toml` and the tag in sync.

## CI gate

Every scorer takes `--max-slop N` (slop direction: higher = worse). Breach exits 2, pass exits 0:

```bash
wass https://example.com/post --out report/ --max-slop 50 && echo SHIP IT
```

## Try it in 30 seconds

```bash
git clone https://github.com/shridharyadav88/ai-slop-detector.git
cd ai-slop-detector
python3 wass.py good.md --out demo/
cat demo/good-md.md
```

Included fixtures show both ends of the scale: `good.md` (a concrete engineering
postmortem) scores **13.2 — High quality**; `slop.md` (generic filler) scores
**70.0 — High AI slop**. A 56-point gap, computed with zero tokens.

## How scoring works

Ten dimensions, each rated 0 (excellent) to 5 (severe), combined as a weighted sum:

```
WASS = Σ ( weightᵢ × ratingᵢ / 5 )        → 0–100, higher = more slop
```

| # | Dimension | Weight | What it measures |
|---|-----------|--------|------------------|
| 1 | Originality | 15 | Genuinely new vs paraphrased boilerplate |
| 2 | Factual accuracy | 15 | Verifiable claims vs fabricated-sounding stats |
| 3 | Information density | 10 | Useful content per paragraph vs padding |
| 4 | Expertise & experience | 10 | First-hand depth vs generic summary |
| 5 | Research & citations | 10 | Real, supporting sources vs name-dropping links |
| 6 | Repetitiveness | 10 | Same ideas repeated with different words |
| 7 | Generic AI patterns | 8 | Formulaic phrasing, filler transitions, dash habits |
| 8 | SEO manipulation | 8 | Built to rank vs built to help |
| 9 | Authorship | 7 | Identifiable, credible author vs anonymous text |
| 10 | Editorial quality | 7 | Placeholders, errors, broken references |

**Bands:** 0–15 High quality · 16–30 Generally good · 31–50 Mixed quality ·
51–70 High AI slop · 71–100 Severe AI slop.

Six dimensions are pure code (regex, counts, ratios — byte-identical every run).
Four need reading comprehension (is this claim plausible? does this link support
that sentence?), so the hybrid version asks **one** AI call to *extract checkable
facts with exact page quotes* — and then **code** turns those facts into 0–5
ratings with fixed, published rules. The AI never scores anything directly, and
any quote it invents that isn't in the page is dropped automatically.

## Visual slop axis: VASS

Content is only half the slop. `wass_visual.py` scores the page's **design** 0–100
against 50 checkable UI patterns (tiers: Clean 0–9 / Mild 10–27 / Heavy 28+):

```bash
python3 wass_visual.py https://example.com/some-article --out report/
```

Same guarantees as the content scorer: stdlib only, $0, no rendering, no screenshots —
pure static HTML+CSS analysis with a mini cascade engine. Pattern weights are borrowed
verbatim from the calibrated `slop-detect` table (MIT), plus 6 added checks of our own
(marked `[OURS]`); review-status items report at 0 points. Included fixtures:
`good-visual.html` scores **0 — Clean**, `slop-visual.html` scores **100 — Heavy**.
Your own site scores both: WASS for words, VASS for pixels.

## Copy-tells axis: CASS

`wass_copy.py` scores the page's **prose** 0–100 against 27 LLM-writing tells
(tiers: Clean 0–7 / Mild 8–19 / Heavy 20+):

```bash
python3 wass_copy.py https://example.com/some-article --out report/
```

Same stdlib-only, $0 guarantees. Pattern weights are verbatim from the calibrated
`slop-detect` copy-axis table (MIT), plus 3 of our own (numbers-as-words,
noun-stack headlines, Lucide-default icons). Prose-length gates apply as specified:
under 150 words statistical checks report unknown, 150–299 score at half weight.
Fixtures: `copy-good.md` scores **0 — Clean**, `copy-slop.md` scores **34 — Heavy**.

## Craft axis: CRFT

`wass_craft.py` scores the page's **craft** — accessibility and functional basics —
as trigger-count tiers (0 Clean / 1–2 Needs work / 3+ Failing):

```bash
python3 wass_craft.py https://example.com/some-article --out report/
```

Check IDs and weights are verbatim from the calibrated `slop-detect` craft table (MIT):
missing viewport, disabled zoom, dead CTAs, generic labels, stripped focus rings, grey-on-color
text, hidden content, wide body tracking. Checks needing a renderer or interaction
(mobile reflow, form probing) report unknown and never score. Fixtures: `craft-good.html`
scores **0 — Clean**, `craft-slop.html` scores **75 — Failing**, `craft-empty.html` is
declined as `not_scored` (thin page).

## Site sampler: all four axes at once

`wass_site.py` scores N pages on WASS + VASS + CASS + CRFT and rolls up per-axis
mean/median/max, with a flags column (low-confidence, skipped stylesheets, failure reasons):

```bash
python3 wass_site.py page1.html page2.md https://example.com/post --out report/
```

Deliberately no single-number site score — the axes measure different things, and the
report says so. Same $0, stdlib-only, deterministic guarantees; reruns are byte-identical.

## Cost & reliability

- `wass.py`: **$0 always.** Standard library only, no network except fetching the page you point it at.
- `wass_hybrid.py`: one AI call per fresh page (~$0.004 with the default Haiku seat —
  verified at parity with a 20x-pricier seat on a labeled set). Verdicts are cached
  by content hash, so re-runs are **free and identical**.
- If the AI seat fails, a fallback seat on a different provider tries next; if both
  fail you get labeled code-only scores — never a silent zero, never a crash.
- Inputs under 30 words are declined as `not_scored` instead of judged.
- AI judgments vary slightly run to run (all LLM judges do — it's inherent to how
  they're served, not a bug in this tool). The cache makes reruns exact; reports
  always state which seat judged and whether the result was fresh or cached.

## Honest limits (read before citing a score)

- **Scores pages, not sites.** For a whole site, use `wass_sample.py`: it scores
  every page with the free code pass and calls the AI seat only for uncertain pages
  (near a band edge), then rolls up mean/median/max plus total spend.
- **Knowledge cutoff, no live verification.** Factual checks are plausibility
  judgments from the model's training, not web fact-checks.
- **Originality is intra-page.** Without a web corpus it can't tell you the text
  was copied from elsewhere — only that it repeats itself.
- **Built for experience-driven content** (blogs, reviews, marketing, portfolios —
  the natural habitat of slop). Reference works like encyclopedias read as Mixed
  by construction: they contain no first-hand markers by design.

## Requirements

- Python 3 (standard library only — no `pip install` anything).
- For `wass_hybrid.py`: the `claude` CLI logged in. The fallback seat uses
  `cursor-agent`. Everything else degrades gracefully without them.

## Layout

- `wass.py` — deterministic scorer (10 dims, stdlib only).
- `wass_visual.py` — visual scorer (50 UI patterns, stdlib only).
- `wass_copy.py` — copy-tells scorer (27 prose patterns, stdlib only).
- `copy-good.md`, `copy-slop.md` — copy fixtures (0 vs 34).
- `wass_craft.py` — craft/a11y scorer (11 checks, stdlib only).
- `craft-good.html`, `craft-slop.html` — craft fixtures (0 vs 75).
- `wass_site.py` — 4-axis site sampler (rollup, no single score).
- `good-visual.html`, `slop-visual.html` — visual fixtures (0 vs 100).
- `wass_hybrid.py` — hybrid scorer (code + one AI extraction seat + fallback ladder).
- `wass_sample.py` — multi-page sampling with code pre-filter and rollup.
- `good.md`, `slop.md`, `fix-*.md/.html` — labeled fixtures that double as regression tests.
