Skip to content

feat: rebalanced tier-weighted scoring and structured audit trail (0.2.0)#5

Merged
metehankurucu merged 4 commits into
mainfrom
feat/scoring-rebalance-audit-trail
Jul 4, 2026
Merged

feat: rebalanced tier-weighted scoring and structured audit trail (0.2.0)#5
metehankurucu merged 4 commits into
mainfrom
feat/scoring-rebalance-audit-trail

Conversation

@metehankurucu

Copy link
Copy Markdown
Member

What

Rebalances the composite score so the grade finally differentiates sites, and adds a structured audit trail to every check.

Before: the deployed 0.1.0 scored only the single error-tier check, so any site passing markdown negotiation got A/100 (cloudflare.com: A/100 with 11 failing checks). Now: tier-weighted ratio (error 4x, warning 2x, notice 1x), bands A>=90 / B>=72 / C>=50 / D>=30, and a failing error-tier check caps the grade at C.

Live calibration under the new model: cloudflare.com C/59, codixus.com C/52, vercel.com D/30. A perfect site is 100/A; an A now requires real emerging-standard adoption.

Audit trail

Every CheckResult gains optional transcript (per-hop HTTP steps recorded centrally in followRedirects, bounded by MAX_REDIRECTS), goal, issue, and resources (spec links). evidence stays the one-line string summary, so the CLI human output and existing JSON consumers keep working. New types (HttpStep, CheckResource) are exported. CheckMeta.goal is required, which is breaking only for external custom-check authors (noted in the new CHANGELOG).

Verification

  • 76 tests green (was 62): band edges pinned on both sides, C-cap x3, transcript on network error, partial redirect chains, parallel-probe ordering.
  • Live scans through the CLI and through codixus-backend (locally linked) match the plan's calibration table exactly.
  • Review (5-lens): READY, R1-R7 all MET. Applied P3 fixes: dns-aid keeps network-error details on null-status steps, robots-derived checks copy the shared prefetch transcript, CHANGELOG names the CheckMeta.goal break. Deferred with reasons: stalled-body 200 step note (status is factually correct for headers), mid-redirect-throw transcript test (edge-case floor already met).

Plan: ~/.claude/plans/agentradar-scoring-audit-trail.md (approved 2026-07-04). Both packages bumped to 0.2.0; publish is manual after merge.

…rror-tier cap

Notice-tier checks now carry weight 1 instead of being excluded, so adopting
emerging standards is what lifts a site from B into A. TIER_WEIGHT is error 4,
warning 2, notice 1; grade bands are extracted to a named table (A>=90, B>=72,
C>=50, D>=30, else F). Any non-inferred error-tier failure caps the grade at C
so a site that cannot serve a load-bearing signal never reads as A or B.

Under the old error-tier-only model a Cloudflare-shaped site (every established
signal, zero emerging ones) scored A/100; it now lands at C/59.
…issue)

Every CheckResult now carries additive audit-trail fields alongside the
evidence summary that stays: goal (what good looks like) and resources
(authoritative RFC/spec links) copied from the check meta, a one-line issue on
a verified failure, and a transcript of the HTTP steps the check made.

followRedirects records each hop as an HttpStep (method, absolute URL, status
or null on a network error/timeout, one-line detail); fetchRaw/fetchText take an
optional steps collector so the ~14 callers stay a minimal diff. The shared
robots.txt prefetch records its steps once and hands them to robots-txt,
ai-bot-rules and content-signals via ctx. mpp makes no probe and carries no
transcript. New HttpStep/CheckResource types are exported from the package
entry point.
Bump agentradar and agentradar-core to 0.2.0, add a CHANGELOG covering 0.1.0,
0.1.1, and 0.2.0 (flagged as a data-shape change for consumers), and correct
the stale README sentences that still described error-tier-only scoring.
…pt, copy shared robots transcript, precise CHANGELOG breaking note

Review findings F-1, F-2, F-5: dns-aid no longer overwrites the network-error
detail on null-status steps; robots-derived checks each get their own copy of
the shared prefetch transcript instead of aliasing one array; CHANGELOG now
names the required CheckMeta.goal field as breaking for custom check authors.
@metehankurucu metehankurucu marked this pull request as ready for review July 4, 2026 17:07
@metehankurucu metehankurucu merged commit 8fa9f68 into main Jul 4, 2026
1 check passed
@metehankurucu metehankurucu deleted the feat/scoring-rebalance-audit-trail branch July 4, 2026 17:07
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