Skip to content

The design language that makes your AI harness better at design.

JavaScript

Merge corpus/stack-6-round7 into corpus/stack-7-premise4

Paul Bakaus7c64932bb8b9
diff --cc docs/CLI-CONTRACT.md
index ed87dc3a2,dae648114..d43dc5b44
--- a/docs/CLI-CONTRACT.md
+++ b/docs/CLI-CONTRACT.md
@@@ -347,12 -347,8 +347,12 @@@ Optional keys added later by engines (a
- **React invariants read as their message.** A production React build throws `Minified React error #<n>; visit <url> for the full message or use the non-minified dev environment for full errors and additional helpful warnings.` For a common invariant number the boilerplate from `; visit ` on is replaced by the message React's error decoder prints, the number kept: `Uncaught Error: Minified React error #418: Hydration failed because the initial UI does not match what was rendered on the server.` The table (`REACT_INVARIANTS` in `crates/browser/src/cdp.rs`) covers 31, 130, 185, 300, 301, 310, 321, 418, 419, 421, 422, 423, 425 and 426. The message is added after the 160-character cut, so it is never cut. A number the table does not know, text after the number other than `; visit `, and any message that is not an invariant stay as they were. Deduping compares the decoded messages, so both reports of one invariant still share a key.
- **One throw, one report.** Deduping compares messages with the `(in promise)` marker read as a plain `Uncaught`, so a throw that surfaces both synchronously and as an unhandled rejection (a consent manager's patched `document.createElement` called from a script and from a promise) reports once, with the first report's text and source. Messages that differ in anything else stay separate. The three-error cap applies after deduping, and after classing (next item): counted errors and advisory ad-tech errors are capped at three each, in arrival order, so ad-tech errors never take a slot a counted error needs. Three failing ad scripts ahead of the site's own broken bundle still leave the bundle's error reported as `error`; a scan reports at most six script errors.
- **Ad-tech script errors are advisory and name the vendor** (corpus decision r3-31-script-error-ad-tech). A script error thrown from a known ad-tech script (its source URL contains `anymind360.com` (AnyMind), a script file name beginning `prebid`, wherever it is hosted (Prebid), `connect.facebook.net` (Meta Pixel), `googletagmanager.com` (Google Tag Manager), `cookielaw.org` (OneTrust, the consent layer that holds ad tags back), or `googlesyndication.com` / `doubleclick.net` / `googleadservices.com` (Google Ads), `nagich.co.il` (Nagich, an accessibility overlay), or `asset.chase.com/web/library/digddsautomation/reportingjs/` (Chase Reporting, a shared reporting tag)), or whose message names an ad API (`browsingTopics`, `joinAdInterestGroup`, `runAdAuction` (vendor `ad tech`), `adsbygoogle` (Google Ads), `_prebidjs` (Prebid)), reports with `severity: 'advisory'`, its snippet ends ` (third-party: <vendor>)`, and it carries `thirdParty: "<vendor>"` after `ignoreValue`. The source is checked first. Product analytics and a site's own bundles and chunks (ad code served from the site's own host included) are not on the list and stay `error`. The list lives in `crates/core/src/third_party.rs` and holds only vendors the corpus has evidence for.
+ - **React's recoverable hydration errors are advisory** (corpus decision r5-p13-script-error-hydration). A script error whose message is `Minified React error #<n>` with `<n>` one of 418, 419, 422, 423 or 425, decoded or in the build's own `; visit <url>` form, reports with `severity: 'advisory'`: React renders the page again on the client and the page shows complete. Its snippet is unchanged and it carries no `thirdParty`. Every other error stays `error`, other React invariants included (#185, #421, any number outside the five). The three caps are separate: at most 3 counted errors, 3 ad-tech errors and 3 hydration errors per scan, so a hydration chain never takes the slot a first-party error needs. The ad-tech check runs first. The list lives in `crates/core/src/script_errors.rs`.
+ - **Closed interface is left out of `content-hidden-at-rest`** (corpus decision r5-p5-content-hidden-closed-navigation). The measure already skipped `display: none`, the `hidden` attribute, `aria-hidden="true"`, `content-visibility: hidden` and `dialog`. It now also skips, from both the hidden count and the page total, every subtree that starts at a box which is itself at opacity 0.02 or less or `visibility: hidden | collapse` and is closed interface by any one of: (1) the box or an ancestor is a `nav` or has `role` `navigation`, `menu` or `menubar`; (2) the box or an ancestor has the `inert` attribute; (3) the box or an ancestor has an `id` that an `[aria-controls]` element names while saying `aria-expanded="false"` or `aria-selected="false"`, and no element naming that id says `true`; (4) the box itself has `role` `dialog`, `alertdialog` or `tabpanel`; (5) the box itself has a class token whose words (split at non-alphanumerics and lower-to-upper steps) include `offcanvas`, `drawer`, `megamenu`, `submenu`, `dropdown`, `flyout`, `modal`, `tabpanel` or `tabpane`, the pairs `off canvas`, `mega menu` or `sub menu`, or one of `tab` / `tabs` / `accordion` together with one of `content` / `panel` / `pane` / `body`; (6) the element just before the box says `aria-expanded="false"`, or that element is a heading (`h1` to `h6`, `role="heading"`) or has a single element child and its first element child says it (an accordion heading wrapping its button; a site header that opens with a closed menu button says nothing about the box after it); (7) the box itself is `position: fixed` with area and wholly left or right of the viewport. A box none of these describe counts as before: an in-flow section a scroll reveal never showed, a hover overlay, a carousel slide, an unmarked panel. A bare `menu`, `tab`, `panel` or `popup` class is not enough. The thresholds and the snippet are unchanged. The predicate is `closed_container` in `crates/core/src/browser/page_checks.rs`.
- **Findings on third-party widget markup name the vendor** (corpus decision r4-p24-third-party-widget-markup). A finding whose element is a known widget vendor's markup keeps its severity; its snippet ends ` (third-party: <vendor>)` and it carries `thirdParty: "<vendor>"` (after `selector`). Taboola owns its whole feed: an element with an id starting `taboola-` or `internal_trc_`, a class starting `trc_rbox`, or the class `trc_related_container`, and everything under it. Swiper owns only its structural elements: the element itself has the class `swiper`, `swiper-container`, `swiper-wrapper` or `swiper-slide`, or an id starting `swiper-wrapper-`; the site's content inside a slide is the site's. Slick owns its structural elements the same way (the class `slick-slider`, `slick-list`, `slick-track`, `slick-slide` or `slick-arrow`) and its whole dot list (the class `slick-dots` and everything under it); SuperSlide owns its `tempWrap`; react-fast-marquee owns everything under an element with a class starting `rfm-`; Kaltura owns everything under a class starting `playkit-` or the class `kaltura-player` or `kaltura-player-container`. The rule pass tags in `serialize_findings` (so the in-page bundle and the extension see it too), the visual-contrast pass by its selector's first match. Page-level findings are never tagged. The static engine does not tag.
- - **Purple headings in the brand hue** (corpus decision r3-23-ai-color-palette-brand-hue). The heading forms of `ai-color-palette` (a snippet ending ` on heading`) do not report when the heading's computed `color` is within 12 degrees of hue of a brand surface on the same page: the solid `background-color` (alpha at least 0.9, chroma at least 50, no gradient painted over it) of the logo (an element whose `id`, `class`, `alt` or `aria-label` contains `logo`; its text colour too when it has text of its own), the nav bar (`nav`, `header`, `role=navigation|banner`, at least half the viewport wide), or a band across the page (at least 90% of the viewport's width) covering a fifth of the viewport's area or more. Headings are never brand surfaces, and the gradient and neon forms keep reporting: purple that shows up only in headings and gradients is the tell. URL engine only (the static engine has no rendered page to read surfaces from).
+ - **Purple headings in the brand hue** (corpus decision r3-23-ai-color-palette-brand-hue). The heading forms of `ai-color-palette` (a snippet ending ` on heading`) do not report when the heading's computed `color` is within 12 degrees of hue of a brand surface on the same page: the solid `background-color` (alpha at least 0.9, chroma at least 50, no gradient painted over it) of the logo (an element whose `id`, `class`, `alt` or `aria-label` contains `logo`; its text colour too, read from the first element in it with text of its own, so a type logo set in a child `span` counts), the nav bar (`nav`, `header`, `role=navigation|banner`, at least half the viewport wide), neither inside `main` or an `article` (an article's own header, a pagination nav and a row of partner logos are local chrome), or a band across the page (at least 90% of the viewport's width) covering a fifth of the viewport's area or more. Headings are never brand surfaces, and the gradient and neon forms keep reporting: purple that shows up only in headings and gradients is the tell. URL engine only (the static engine has no rendered page to read surfaces from).
+ - **Category colours** (corpus decision r5-p28-ai-color-palette-category-colours). An element-level `ai-color-palette` finding does not report when its element wears the colour as one of a category system's hues: the elements in the same role on the page carry six or more distinct hues between them, at least half of them outside the violet (260 to 310 degrees) and cyan (160 to 200 degrees) bands. For the ink forms (` on heading`, ` neon text on dark background`) the role is the tag plus the computed `font-size` and `font-weight`, and an element's hue is its computed `color` (alpha at least 0.5, chroma at least 50). For the fill forms (` gradient background`, `Purple/violet gradient (Tailwind)`) the role is the tag plus the rounded box size, and the hue is the first chromatic stop of the computed `background-image` gradient. Two hues less than 5 degrees apart count once. Such an element does not vote in the two-hue ink gate either. The page-level `Purple/violet accent colors detected` is unaffected. URL engine only (the static engine reads no rendered roles and reports as before).
+ - **Footer column titles** (corpus decision r5-p29-skipped-heading-footer-titles; static HTML engine and URL engine alike). `skipped-heading` does not report a skip into the footer: the skipped heading is inside `footer`, `[role="contentinfo"]` or `#footer`, and the heading it follows is either outside that footer (the last heading before it) or that footer's first heading when that heading did not itself skip into the footer (a closing call to action inside the footer; a first heading that skipped in is a column title). A skip between two later footer headings reports, and so does every skip outside a footer. A footer built from unmarked `div`s is not recognised and reports as before.
- **Contrast ratios in snippets.** Every `low-contrast` producer (the element text path shared by both engines, which covers links, spans and placeholders, the static engine's `:hover state`, and the URL engine's `browser contrast` sampling and `pixel contrast` passes, verdict and median) prints a ratio against its threshold: one decimal; two when one decimal would round a failing ratio up to the threshold; and those two cut, not rounded, when rounding them would reach it too. A ratio under the bar never prints as the bar: `4.49:1 (need 4.5:1)`, never `4.5:1` or `4.50:1`. A ratio at or above the threshold, such as a median over it, prints one decimal.
- **Page validity gate.** After `goto` (and settle), before injecting anything, the engine classifies the page (`crates/browser/src/validity.rs`) from the main document's final CDP response and an in-page probe (title, visible text length, final URL, challenge-widget markers). Challenge: an `x-amzn-waf-action` header, `cf-mitigated: challenge`, a final URL on a challenge-only host (`perfdrive.com`, `captcha-delivery.com`), or, on a page with at most 3000 characters of visible text, a challenge title prefix ("Just a moment", "Attention Required! | Cloudflare", "Human Verification", "Access Denied", "Radware Bot Manager", "Captcha", ...) or a full-page widget marker (Cloudflare challenge form, PerimeterX, DataDome, Imperva, Akamai, AWS WAF, slider captchas). On a page of any size, a bot manager's challenge sheet laid over the rendered page is a challenge too: HUMAN Security's (PerimeterX's) "Press & hold" check, `#px-captcha-modal` or `#px-captcha-wrapper`, while it is showing (not `display: none`, not `visibility: hidden`, opacity over 0.02) and covers at least half the viewport; the signal reads `overlay human-press-and-hold`, and the probe records `overlays` only when one shows. HTTP error: a final status >= 400 with no challenge signal. A blocked page throws `the page is a bot challenge, not the site (<signals>). Findings would describe the challenge page, so none are reported.` or `the page returned an error (HTTP <status>). Findings would describe the error page, so none are reported.`, which the CLI prints as `Error: ...` and counts as an operational failure (exit 1). A `file://` load has no response, so only the probe signals apply.
Consent wall: a page where a known consent manager (next item) is showing (its text counted with the text of open shadow roots under its roots, where Usercentrics renders), hiding it would leave next to nothing (fewer than 20 visible characters outside its roots, and no visible form control (`input` other than hidden, `select`, `textarea`, `button`) and no `img`, `svg`, `video`, `canvas`, `iframe`, `object` or `embed` of 10,000 square pixels or more outside them), and the manager holds at least 100 characters. It throws `the page is a consent wall, not the site (consent manager <names>, <n> of <total> visible characters outside it, no control or image outside it). Findings would describe the consent dialog, so none are reported.` A short page under an ordinary banner (a sign-in form, a splash page with a button, an image-first page) is scanned. The probe runs before any banner is hidden, and again before the hide pass after the reveal sweep, so a wall that arrives after load is refused too (the evidence then carries that later probe). With `--no-consent-hiding` the gate is off and the page is scanned with its banner, which is what that flag asks for. The probe object (evidence) carries `consent` (the names of the managers showing), `consentChars` (visible characters inside them) and `consentOutside` (visible controls and sizable media outside them, counted up to 20).