The design language that makes your AI harness better at design.
JavaScript
Contract: Prebid is named by its script file
Paul Bakausde282b8801e0
diff --git a/docs/CLI-CONTRACT.md b/docs/CLI-CONTRACT.mdindex 63777413a..4c33004f4 100644--- a/docs/CLI-CONTRACT.md+++ b/docs/CLI-CONTRACT.md@@ -339,7 +339,7 @@ Optional keys added later by engines (appended after the above): `ignoreValue` (- **One message shape.** Every script-error message reads the way the console prints it, `Uncaught <Type>: <message>`, whatever path the throw took, where the JS printed puppeteer's `err.message` with the type stripped on one path and CDP's typed text on another. CDP's marker comes first: `Uncaught`, or `Uncaught (in promise)` for an unhandled rejection. An `Error` reads the first line of its description, which names its type (`TypeError: ...`, or the name a library gave it, `ChunkLoadError: ...`); a description that names no type gets the class in front, and an empty message is the type alone (`Uncaught AbortError`). A thrown value that is not an `Error` (CDP `type: object` with no `subtype`: a plain object, a class instance, a rejected object) reads its class and V8's property preview, `Uncaught Object {code: "E_CONFIG", message: "config missing"}` (strings JSON-quoted, other values as previewed, `...` when the preview overflowed). A primitive reads as `String(value)`, `Uncaught boom`. A throw that arrives with no exception object (a cross-origin script) keeps CDP's text, which is typed already (`Uncaught TypeError: ...`, or `Uncaught [object Object]`). The body after the marker is its first line, trimmed, and the message after its type (`TypeError: `) is cut at 160 characters, the cut the JS applied to the untyped message, so naming the type costs the message nothing it showed before; a throw whose body is empty reports nothing.- **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), `/prebid` (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)), or whose message names an ad API (`browsingTopics`, `joinAdInterestGroup`, `runAdAuction` (vendor `ad tech`), `adsbygoogle` (Google Ads)), 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.+ - **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)), or whose message names an ad API (`browsingTopics`, `joinAdInterestGroup`, `runAdAuction` (vendor `ad tech`), `adsbygoogle` (Google Ads)), 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.- **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. 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).- **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.