# self-observing web fault bundler

- Status: `experiment`
- Track: [model cutoffs & self-observing browser telemetry](https://aifoc.us/labs/platform-observability/)
- Layer: 7. Self-Observing Web, Evaluation & Economics
- Updated: 1 December 2026
- Live demo: https://self-observing-web.kinlan-test.workers.dev
- Source: https://github.com/PaulKinlan/self-observing-web

## Inspired by

- [please mind the model gap](https://aifoc.us/please-mind-the-model-gap/)

## Hypothesis

- **Claim:** Capturing `PerformanceObserver` (LoAF/CLS), `ReportingObserver`, and failed `fetch()` telemetry in a bounded browser ring buffer emits compact JSON fault packets that make transient client regressions reproducible.
- **Confirms it:** Intentional layout shifts, main-thread stalls, HTTP 500s, and CSP blocks appear in strict causal order inside an exportable ring buffer JSON packet without bloating memory.
- **Falsifies or bounds it:** Third-party cross-origin frames suppress timing/error detail below actionable thresholds, or noise floods the ring buffer before the real fault triggers.

> **Why this exists:** Browser regressions—layout shifts, main-thread stalls, failed fetches, and CSP blocks—happen inside users' live tabs where automated test suites and coding models never see them unless someone manually copies console logs. Packaging live `PerformanceObserver` and `ReportingObserver` telemetry into a compact, reproducible fault bundle gives developers or debugging pipelines concrete runtime evidence in one JSON export.


## What this lab tests

[Self-Observing Web](https://self-observing-web.kinlan-test.workers.dev) ([GitHub](https://github.com/PaulKinlan/self-observing-web)) instruments [`PerformanceObserver`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver) (Long Animation Frames, CLS, resource timing), `ReportingObserver`, and `fetch()` telemetry inside a bounded ring buffer to emit exportable reproduction JSON packets on intentional fault triggers.


## Open questions to iterate on

- What sampling and deduplication window captures causal fault chains cleanly within ~2–4 KB JSON so it drops directly into a coding-agent context window?
- Can browser `ReportingObserver` integrity prevent untrusted content from spoofing synthetic violation reports?

## Iteration log

- **2026-12-01:** Built bounded LoAF/CLS/ReportingObserver/fetch ring buffer with deterministic JSON packet exporter and intentional fault triggers.
- **2026-12-01:** Reordered workbench around the hypothesis with live JSON byte-size and selectable ring-buffer capacity controls, unified CSP-safe DOM syntax highlighting across JSON/wire/policy/setup panels, routed static assets through the Worker for `no-cache` and strict CSP headers, and tightened 700px iframe responsiveness.

## Primitives tested

- `PerformanceObserver (LoAF/CLS)`
- `ReportingObserver`
- `Fetch Instrumentation`
- `Trace Export`

## Connected labs in other tracks

- [permission replay debugger](https://aifoc.us/labs/browser-containment/permission-replay-debugger/) — Focuses specifically on correlated permission queries and policy frame denials.
- [model-gap live conformance probe](https://aifoc.us/labs/platform-observability/model-gap-live-harness/) — Pairs runtime fault bundles with live feature-availability telemetry.

---
Canonical: https://aifoc.us/labs/platform-observability/self-observing-web/
