Skip to content

feat: critical per-page defects, agent-native audit output (2.0.0)#44

Merged
arberx merged 4 commits into
mainfrom
arberx/aeo-audit-issue-42
Jun 4, 2026
Merged

feat: critical per-page defects, agent-native audit output (2.0.0)#44
arberx merged 4 commits into
mainfrom
arberx/aeo-audit-issue-42

Conversation

@arberx

@arberx arberx commented Jun 3, 2026

Copy link
Copy Markdown
Member

Resolves #42: binary structural defects (an H1 count other than one, a missing <title> or meta description) were detected per page but lost in sitemap aggregation, so a homepage split across four H1s surfaced nowhere in the summary. This adds a criticalDefects rollup and a Critical Defects report section that surface them by impact (offending pages named, homepage first) regardless of prevalence, detected independently of scoring so no existing scores, grades, or exit codes change. To make the output agent-consumable, prioritizedFixes is now a structured PrioritizedFix[] (stable id/kind, full untruncated affectedPages, human summary) and every report carries a schemaVersion. This is a breaking change (2.0.0) with docs ported into docs/cli.md and docs/api.md, CHANGELOG and SKILL updated, and typecheck, 270 tests, lint, and e2e all passing.

🤖 Generated with Claude Code

arberx and others added 2 commits June 3, 2026 16:08
…ve (2.0.0)

Resolves #42. Binary structural defects (an H1 count other than one, a
missing <title>, a missing meta description) were detected per page but
lost in sitemap aggregation: prioritizedFixes ranked by prevalence only,
the factor score averaged them away to a passing grade, and
crossCuttingIssues was keyed by factor. A homepage split across four H1s
appeared nowhere in the summary.

- Detect critical defects straight from the DOM, independent of scoring,
  so no existing score, grade, or exit code changes. New criticalDefects
  rollup on sitemap/static reports plus a Critical Defects section in the
  text and markdown output, grouped by defect with every affected page
  named (homepage and high sitemap-priority pages first). Shown even with
  --top-issues.
- Make the output agent-native: prioritizedFixes is now a structured
  PrioritizedFix[] (stable id, kind, severity, full affectedPages,
  affectsHomepage, prevalencePct, summary) instead of prose strings, and
  every report carries a schemaVersion so parsers detect shape drift.
- No truncation in the end-of-report sections: every issue and every
  affected page is listed.

BREAKING CHANGE: SitemapAuditReport.prioritizedFixes is now PrioritizedFix[]
(read .summary for the previous one-liner); reports gain a required
schemaVersion field. Bumped to 2.0.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Returns { schemaVersion, tool, mode, url, score, grade, pass,
criticalDefectCount, issues } as JSON, where issues is the ranked
PrioritizedFix[] and the per-factor/per-page detail is omitted, so an
agent can act on the decision without averaging and re-ranking scores.
Single-page reuses the sitemap critical-defect and cross-cutting
aggregation over a one-page site; --detect-platform falls back to JSON.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
arberx and others added 2 commits June 3, 2026 16:53
* feat: add stable codes to every finding (2.1.0)

Every AuditFinding now carries a `code` namespaced as
<factor-id>.<check>[.<variant>] (e.g. technical-seo.h1.multiple), so
agents and integrations key on a stable machine identifier instead of
regex-matching the human message (which can change between releases).
212 codes across all 19 analyzers; the registry is in
docs/finding-codes.md. `code` is required on AuditFinding, so the
compiler guarantees coverage, and a test enforces the convention and
global uniqueness.

hasMissingMetaDescription (the --require-meta gate) now keys on the
technical-seo.meta-description.missing code rather than a message prefix
— the first consumer migrated to codes. schemaVersion bumped to 1.1
(additive: findings gained the code field).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs: correct schemaVersion example value to 1.1

The api.md runSitemapAudit example printed '1.0', but SCHEMA_VERSION
was bumped to '1.1' in 2.1.0. Align the doc with the actual value.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
buildPrioritizedFixes derived a cross-cutting fix's affectedPages,
prevalencePct, and affectsHomepage from only the top recommendation's
affectedUrls. The entry is identified by the factor (factorId /
factorName), so its reach must cover the whole factor: a homepage hit
only by a secondary recommendation read as affectsHomepage=false, and
prevalence undercounted. Union every recommendation's pages instead,
sorted homepage-first, so the three fields stay consistent and
factor-level. Adds a regression test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arberx arberx merged commit d135ad6 into main Jun 4, 2026
2 checks passed
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.

Single-page critical defects (multiple/missing H1) never reach prioritizedFixes — ranking is prevalence-only

1 participant