Skip to content

Quality tool: audit, overview & dedupe with HTML dashboard and agent skills#11

Open
MirjamOdile wants to merge 1 commit into
mainfrom
pr/05-quality-tool
Open

Quality tool: audit, overview & dedupe with HTML dashboard and agent skills#11
MirjamOdile wants to merge 1 commit into
mainfrom
pr/05-quality-tool

Conversation

@MirjamOdile

Copy link
Copy Markdown

What this adds

A project-wide quality layer over data/<project>/ crawl output — three CLI
commands, an HTML dashboard, three agent skills, docs, and tests. Built and
battle-tested against live production projects before this handover.

Commands

  • ./scrapai audit --project <name> — read-only. Per-spider coverage +
    extraction scoring (crawl_audit.csv / audit_<project>.md), compliance
    lenses (robots/llms/legal-page snapshots with conflict flagging),
    external-PDF host analysis, and a self-contained HTML dashboard
    (_audit/dashboard_<project>.html, tabs: Coverage · Compliance · PDFs).
    Every spider is classified into a status worklist (ok / manual review /
    too few pages / incomplete / extraction broken) — the goal, stated on
    the report itself: every spider ends in ok (or deliberately discarded).
  • ./scrapai overview --project <name> — read-only. Per-spider content
    profile: sections, date span + per-year histogram + null %, field coverage,
    thin/constant/off-domain checks.
  • ./scrapai dedupe --project <name> — the ONE mutating command, kept
    separate so the audit never rewrites data. Consolidates crawls/*.jsonl
    reversibly (originals kept as *.superseded).

Design points reviewers will care about

  • PDF row model: PDFs follow the framework's links_only harvest —
    URL-only rows with metadata_json.content_type="pdf". Extraction quality is
    judged over HTML rows only; the PDFs lens splits same-org vs external by URL
    host against allowed_domains (finding an org's documents stored off its
    own domain is the lens's whole purpose).
  • Crawl-recorded stats first: coverage denominators and liveness come from
    _audit/crawl_stats/ when a crawl recorded them (no re-fetch, no drift, no
    CF problems); fetched sitemaps are the fallback.
  • Human review records: _audit/audit_sitemap_skip.json corrects the
    yardstick BEFORE scoring; _audit/audit_notes.json records the verdict
    AFTER (promote/discard). Both are self-documenting (embedded, auto-refreshed
    _instructions), both suggest-only for agents, and stale notes are policed
    (a note can never vouch for broken extraction or an empty corpus).
  • Performance: per-file scan counts are cached by (size, mtime) — GB-scale
    corpora re-audit in seconds; caches migrate themselves on format change.
  • Dashboard is dependency-free: one static HTML file, inline CSS/JS, every
    dynamic value escaped; markdown/CSVs remain the untouched ground truth.

Also in this PR

  • Three slash-command skills (.claude/commands/): /spider-review (evidence-
    based triage/repair of the audit's problem groups), /spider-align
    (fleet-wide conformance sweep), /spider-slow (live-crawl ops via
    crawl-status/Pueue) — plus the .gitignore pattern that tracks shipped
    skills while keeping teams' local ones untracked.
  • Docs: docs/quality.md (full reference), docs/skills-overview.md, CLAUDE.md
    §6.9 + README wiring, and docs/requests/ — the per-change design write-ups
    behind this PR series (the earlier small PRs reference them).

Verification

~100 dedicated unit tests across corpus scanning + caching, scoring (including
PDF-row arithmetic and the reviewed-stale guards), compliance capture/report,
external-PDF partitioning, dashboard rendering, and an end-to-end synthetic
project flow. Full suite green. Restructures were gated by byte-identical
golden-master runs against real project output.

…nt skills

Adds the read-only quality layer over data/<project>/ and its one
mutating counterpart:

- ./scrapai audit    — coverage + extraction scoring per spider (CSV/MD),
  compliance lenses (robots/legal snapshots, conflict flags), external-PDF
  host analysis, and a self-contained HTML dashboard (Coverage ·
  Compliance · PDFs tabs). PDFs follow the framework's row model:
  URL-only rows with content_type="pdf"; scraped/content% are judged over
  HTML rows only; same-org vs external is derived from allowed_domains.
- ./scrapai overview — per-spider content profile: sections, date span,
  field coverage, thin/constant/off-domain checks.
- ./scrapai dedupe   — the ONE mutating command, kept separate so the
  audit never rewrites data; consolidates crawls/*.jsonl reversibly
  (originals kept as *.superseded).

Ships with three slash-command skills (.claude/commands/: spider-review,
spider-align, spider-slow) that consume the audit's status groups,
docs (docs/quality.md, docs/skills-overview.md, request write-ups under
docs/requests/), and the .gitignore pattern for teams to keep local
skills/docs untracked alongside the shipped ones.

Engine tests cover corpus scanning + caching, scoring (incl. PDF-row
arithmetic and reviewed-stale guards), compliance capture/report,
external-PDF partitioning, dashboard rendering, and an end-to-end
synthetic-project flow.
@iRanadheer iRanadheer force-pushed the pr/05-quality-tool branch from 3a4035b to 64d2f8a Compare July 10, 2026 06:03
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.

1 participant