AI Focus

web + ai spec polyfill testbed

Why this matters

Draft browser standards like navigator.modelContext (WebMCP), isolated <web-island> elements, and Connection-Allowlist read cleanly in markdown explainers, but API ergonomics, schema validation edge cases, and security boundaries remain hidden until teams execute concrete conformance checks in a real browser.

What this opens up

Testing draft browser specs early before engines ship native implementations. The testbed separates Native Browser Pass vs. Polyfill Pass scores, times polyfill overhead via PerformanceObserver, and demonstrates the exact boundary where JavaScript shims cannot emulate browser-engine isolation.

How the tests work

  1. Click Run Conformance Suite to run all 15 assertions (5 per spec) and compare Native Browser Pass counts against Polyfill Pass counts.
  2. Click Register & Execute Tool (or edit the tool name, query, and <web-island capabilities> fields) to test JSON-Schema validation, AbortSignal cleanup, and ElementInternals form participation live.
  3. Test RFC 9651 fail-closed header parsing ((), malformed strings, response-origin) beside the live GET /probe/connection-allowlist edge iframe.
  4. Run the two What Polyfills Cannot Fake probes (<link rel="prefetch"> egress bypass and Shadow DOM vs. opaque <iframe>) and inspect PerformanceObserver marks in the Wire Inspector.
15-assertion conformance harness splitting Native vs. Polyfill pass scores across navigator.modelContext (WebMCP), <web-island> with ElementInternals, Connection-Allowlist: (); report-to=allowlist, and engine-gap falsification probes. Open web + ai spec polyfill testbed full screen ↗

Hypothesis

Running executable 15-assertion conformance suites across draft Web + AI proposals (navigator.modelContext, <web-island> + ElementInternals, and Connection-Allowlist) with explicit Native vs. Polyfill score splits surfaces naming conflicts and engine-only security boundaries far earlier than reading explainer docs.

What confirms it: All 15 assertions run reproducibly with PerformanceObserver mark/measure timing, report accurate Native vs. Polyfill score splits without miscounting shims as native, and verify live HTTP Connection-Allowlist: (); report-to=allowlist headers.

What bounds or disproves it: The <link rel="prefetch"> and Shadow DOM vs. opaque <iframe> probes prove that JavaScript shims cannot block declarative browser prefetching, pre-connect handshakes, or cross-origin paint/DOM boundaries without native engine hooks.

Under the hood

Spec Polyfill Testbed (GitHub) splits its modular polyfills across public/lib/model-context.js, public/lib/web-island.js, public/lib/egress-guard.js, and public/lib/conformance-runner.js. Every polyfill marks itself with isPolyfill so the conformance runner never mistakes a JavaScript shim for native engine support, outputting independent Native Browser Pass and Polyfill Pass totals.

On the edge, src/worker.ts serves /api/specs, /island-frame (a sandboxed connect-src 'none' iframe document), /probe/connection-allowlist (emitting Connection-Allowlist: (); report-to=allowlist and Reporting-Endpoints), /api/egress-report (with a streaming byte cap), and /api/prefetch-canary so the <link rel="prefetch"> probe proves whether a declarative browser request still reached the origin despite JavaScript guardedFetch() enforcement.

Key terms & further reading

WebMCP (navigator.modelContext) ↗
A draft browser API allowing web pages to register structured, schema-validated tools that agents can invoke directly.
Custom Elements & ElementInternals ↗
Standard DOM primitives letting custom elements participate in native form submission, constraint validation, and ARIA roles.
Connection-Allowlist header ↗
A proposed HTTP header enforcing which network origins a document may contact at the browser networking layer, failing closed on () or syntax errors.
RFC 9651 Structured Fields ↗
The strict syntax specification for HTTP header inner lists and parameters used by Connection-Allowlist.
PerformanceObserver marks & measures ↗
A browser timing API recording sub-millisecond durations for polyfill setup, schema validation, and policy checks.
Speculative prefetch (<link rel="prefetch">) ↗
A declarative browser fetch that bypasses JavaScript fetch() wrappers, exposing where only native engine enforcement holds.

Open questions

  • Which polyfill assertions fail ONLY because of missing engine hooks (such as pre-connect allowlists or cross-origin intrinsic sizing)?
  • Can this testbed generate WPT-shaped conformance cases cleanly as drafts stabilize?

Iteration log

  • — Shipped 15-assertion interactive polyfill suite across WebMCP, <web-island>, and Connection-Allowlist with live header probe.
  • — Moved the 15-assertion conformance matrix and polyfill workbench ahead of setup docs for 700px embeds, added CSP-safe DOM syntax highlighting to code and JSON wire panes, hardened responsive wrapping, and routed all static assets through the Worker with Cache-Control: no-cache and 19 passing tests.
  • — Moved into Track 8 (platform-observability), fixed isPolyfill detection with explicit Native vs. Polyfill pass score splits, updated the live probe header to Connection-Allowlist: (); report-to=allowlist, unified <web-island> registration into modular polyfill files, added the ‘What Polyfills Cannot Fake’ prefetch probe, and shipped dark mode, ?embed=1 height bridging, and @container diagrams.

Primitives tested: Custom Elements v1 (<web-island>), ElementInternals, navigator.modelContext Polyfill, PerformanceObserver, Connection-Allowlist (report-to), Prefetch Boundary Probe.

This is an active lab under /labs/ and stays off the main RSS feed until graduated into a full essay.

More in crawler visibility, model cutoffs & quality evals

Connected labs

← crawler visibility, model cutoffs & quality evals · All labs