// lib/dom-dump-script.ts — the rendered-DOM dump script design-review evaluates // in the page before handing the result to the design detector. // // Pure module: no I/O, no imports from scripts/. Consumers: // scripts/resolvers/design.ts Phase 3 prose tells the agent to load lib/dom-dump.js // lib/dom-dump.js committed copy gen-skill-docs writes; the engines load it at runtime // test/fixtures/*.dom.html captured by running it through the browse engine // test/impeccable-fixtures.test.ts pins that the committed dump came from THIS script // // Contract (one script, two engines): // - An arrow-FUNCTION expression, never a self-calling IIFE: Aside's // `pg.evaluate(fn)` receives the function and runs it in the page (an IIFE // would execute in the repl sandbox, where there is no `document`), and the // fallback engine calls it with `$B js "($_DUMP)()"`. Both splice the file's // text into bash, so it contains NO single quotes, no backticks, and no `${`. // - Works on a CLONE of document.documentElement, never the live page. // - Inlines only the stylesheets a owns (inline