# web + ai spec polyfill testbed

- Status: `experiment`
- Track: [post-<a> hypermedia & composable islands](https://aifoc.us/labs/hypermedia-and-islands/)
- Layer: 4. Network Stack, Content Negotiation & Protocols
- Updated: 1 December 2026
- Live demo: https://spec-polyfill-browser.kinlan-test.workers.dev
- Source: https://github.com/PaulKinlan/spec-polyfill-browser

## Inspired by

- [webmcp is the new web intents ... maybe](https://aifoc.us/webmcp-is-the-new-web-intents/)
- [embedding is the web's composability superpower](https://aifoc.us/embedding/)

## Hypothesis

- **Claim:** Exercising draft Web + AI browser proposals (`navigator.modelContext`, `<web-island>` + `ElementInternals`, and `Connection-Allowlist`) in executable polyfill test suites surfaces naming conflicts and security gaps far earlier than reading explainer docs.
- **Confirms it:** All 15 structured assertions execute reproducibly with `PerformanceObserver` timing across engines and verify live HTTP `Connection-Allowlist: ()` frame blocking.
- **Falsifies or bounds it:** Polyfills diverge on subtle browser timing semantics (`Connection-Allowlist` pre-connection DNS blocking, native `<web-island>` cross-origin paint isolation) that JavaScript cannot replicate.

> **Why this exists:** Proposed browser standards like `navigator.modelContext` (WebMCP), isolated `<web-island>` elements, and `Connection-Allowlist` sound good in explainer docs, but teams cannot tell how ergonomic or costly they are until running real code against them. A live conformance harness tests those polyfills side by side in any current browser and measures exact overhead before engines ship everything natively.


## What this lab tests

[Spec Polyfill Testbed](https://spec-polyfill-browser.kinlan-test.workers.dev) ([GitHub](https://github.com/PaulKinlan/spec-polyfill-browser)) runs 15 structured assertions with `PerformanceObserver` timing across polyfilled `navigator.modelContext`, `<web-island>` with `ElementInternals`, and declarative `Connection-Allowlist` rules alongside a live HTTP `Connection-Allowlist: ()` probe.


## Open questions to iterate on

- 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

- **2026-12-01:** Shipped 15-assertion interactive polyfill suite across WebMCP, `<web-island>`, and `Connection-Allowlist` with live header probe.
- **2026-12-01:** 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.

## Primitives tested

- `Custom Elements v1`
- `ElementInternals`
- `navigator.modelContext Polyfill`
- `PerformanceObserver`
- `Connection-Allowlist`

## Connected labs in other tracks

- [model-gap live conformance probe](https://aifoc.us/labs/platform-observability/model-gap-live-harness/) — Measures live browser support gaps against shipped platform baselines.
- [agent containment lab](https://aifoc.us/labs/browser-containment/agent-containment-lab/) — Tests deep `Connection-Allowlist` tiers with SQLite Durable Object canaries.

---
Canonical: https://aifoc.us/labs/hypermedia-and-islands/spec-polyfill-browser/
