Files
pbakaus_impeccable/tests/fixtures/antipatterns/numbered-section-labels.html
T
Paul BakausandClaude Fable 5 7a99e1725d detector: four human-review rules — nav-CTA oklch contrast, numbered section labels, floating side-tab stripes, repeated card text
Four gaps found shipping in Opus 4.8 eval samples during human review:

1. low-contrast (extended): the browser adapters parsed text/own-bg
   colors with parseRgb only, so Chrome's oklch()-serialized computed
   colors silently skipped every contrast check — a flat dark-on-dark
   nav CTA (broader nav selector beating the button class) shipped at
   1.5:1 undetected. checkElementColorsDOM and readOwnBackgroundColor
   now fall back to parseAnyColor. Near-threshold ratios print two
   decimals so a 4.497 finding no longer reads "4.5 needs 4.5".

2. NEW numbered-section-labels (slop, advisory): tiny (<=13px) styled
   numeric index labels riding beside section headings, repeated across
   2+ sections with distinct indices. Sibling of repeated-section-kickers
   (which deliberately excludes bare numeric labels); handles both the
   direct prev-sibling shape and label-before-heading-wrapper shape.
   List/nav/table/card-item numbering is exempt.

3. side-tab (extended): the vertical pseudo-element stripe scan required
   the stripe to touch both corners (top/bottom 0 or height 100%), so a
   left accent bar inset a few px from each end evaded it; small end
   insets (<=20px each) now count. Added a browser-side pseudo-element
   check (getComputedStyle(el, '::before'/'::after')) since runtime-
   assigned custom-property colors are invisible to the text scanner.
   Selection-state exemptions stay as narrowed: only aria-selected=true /
   aria-current / active-class markers exempt, plus button/link
   affordances on the horizontal variant.

4. NEW repeated-container-text (quality): the same literal string (>=4
   chars, contains letters) rendered 3+ times at 3+ structurally distinct
   positions inside one bordered/elevated container. Parallel/templated
   repetition (table cells, calendar grids, nav lists, identical sibling
   rows) never counts — structural signatures, not word lists.

Verified: each rule fires on its repro sample via the file:// browser
scan; clean eval samples add no new findings (the new low-contrast hits
on other samples are genuine sub-AA oklch button pairs). Full test
suite green; browser bundle regenerated; README/homepage rule counts
bumped 49 -> 51 (docs-integrity test enforces them).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 13:09:54 -07:00

152 lines
3.6 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Numbered Section Labels Fixture</title>
<style>
body {
font-family: Georgia, serif;
font-size: 16px;
margin: 0;
padding: 40px;
background: #ffffff;
color: #222222;
}
.column { width: 520px; padding: 20px; }
h2 { font-size: 28px; margin: 0 0 12px; }
h3 { font-size: 22px; margin: 0 0 10px; }
section { margin-bottom: 48px; }
/* ── flag column styles ── */
.sec-index {
font-family: monospace;
font-size: 11px;
font-weight: 700;
color: #b45309;
display: block;
margin-bottom: 8px;
}
.sec-index-micro {
font-family: monospace;
font-size: 12px;
font-weight: 700;
letter-spacing: 2px;
color: #b45309;
display: block;
margin-bottom: 8px;
}
/* ── pass column styles ── */
.big-index {
font-size: 16px;
font-weight: 700;
font-family: monospace;
display: block;
}
.plain-note {
font-size: 12px;
font-weight: 400;
letter-spacing: 0;
color: #666666;
display: block;
}
.step-label {
font-family: monospace;
font-size: 11px;
font-weight: 700;
display: block;
}
.card {
border: 1px solid #d4d4d4;
border-radius: 8px;
padding: 16px;
}
</style>
</head>
<body>
<!-- ══ SHOULD FLAG: tiny numeric index labels repeated across sections ══ -->
<div class="column">
<section>
<span class="sec-index">01</span>
<h2>Alpha ships first</h2>
<p>Direct previous-sibling label: tiny, mono, bold, zero-padded index.</p>
</section>
<section>
<span class="sec-index">02</span>
<h2>Beta earns trust</h2>
<p>Second section repeating the same index scaffold.</p>
</section>
<section>
<span class="sec-index">03</span>
<div>
<h2>Gamma holds the line</h2>
<p>Label precedes the wrapper; the heading leads the wrapper.</p>
</div>
</section>
<section>
<span class="sec-index-micro">04 / ROLLOUT</span>
<h2>Delta closes the loop</h2>
<p>Index joined to a tracked micro-label by a separator glyph.</p>
</section>
</div>
<!-- ══ SHOULD PASS ══ -->
<div class="column">
<section>
<span class="big-index">05</span>
<h2>Epsilon reads large</h2>
<p>16px index is a deliberate display device, not a micro label.</p>
</section>
<section>
<span class="plain-note">12 · minute read</span>
<h2>Zeta stays plain</h2>
<p>Parses as an index but carries no micro-label styling: regular weight, neutral color, no tracking, serif body face.</p>
</section>
<section>
<span class="sec-index">Step 6</span>
<h2>Eta walks steps</h2>
<p>Word-first label is not a numeric index.</p>
</section>
<section>
<span class="sec-index">7</span>
<h2>Theta counts casually</h2>
<p>A bare unpadded single digit is ordinary list numbering.</p>
</section>
<ol>
<li>
<span class="step-label">08</span>
<h3>Iota lives in a list</h3>
</li>
<li>
<span class="step-label">09</span>
<h3>Kappa lives in a list too</h3>
</li>
</ol>
<article class="card">
<span class="sec-index">10</span>
<h3>Lambda sits in a card</h3>
<p>Per-card indices are item numbering, not section scaffolding.</p>
</article>
<nav aria-label="Progress">
<span class="sec-index">11</span>
<h3>Mu tracks progress</h3>
</nav>
</div>
</body>
</html>