@flemo/devtools 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,69 +1,36 @@
1
1
  # @flemo/devtools
2
2
 
3
- Zero-config flight recorder for [flemo](https://flemo.dev) screen transitions.
3
+ Zero-dependency flight recorder and optional visual panel for [flemo](https://flemo.dev) transitions. It observes existing `data-flemo-*` surfaces, `window.__flemoPlayerGaps`, leftover `flemo:*` keys, `MutationObserver`, `PerformanceObserver("longtask")`, and rAF. It imports neither `@flemo/core` nor `@flemo/react` and does not alter measured motion.
4
4
 
5
- It watches the DOM surfaces flemo already exposes — `data-flemo-*` attributes,
6
- `window.__flemoPlayerGaps`, the `flemo:*` storage registry — plus standard
7
- observers (`MutationObserver`, `PerformanceObserver("longtask")`, rAF), and
8
- condenses every navigation into one structured JSON report. The goal: a coding
9
- agent can diagnose a transition problem from the report alone, without
10
- round-tripping through the user ("which browser? was DevTools open? did you
11
- leave a toggle set?").
5
+ ## Quickstart
12
6
 
13
- Zero dependencies. No imports from `@flemo/core` or `@flemo/react`; attaching
14
- the recorder never changes the motion it measures.
7
+ ```ts
8
+ import { attachFlightRecorder } from "@flemo/devtools";
9
+
10
+ const recorder = attachFlightRecorder({ log: true });
11
+ // ...navigate...
12
+ const report = recorder.report(); // JSON-serializable FlemoReport
13
+ recorder.detach();
14
+ ```
15
+
16
+ Unless `installGlobal: false` or the name is already owned, the recorder installs `window.flemo`:
17
+
18
+ ```js
19
+ copy(JSON.stringify(window.flemo.report(), null, 2));
20
+ ```
21
+
22
+ Use `/playground?devtools=on` to enable the playground recorder. `flemo:devtools` persists in `sessionStorage`; `?devtools=off` disables it. `attachFlightRecorder()` is idempotent while attached and returns an inert handle during SSR.
15
23
 
16
24
  ## Production safety
17
25
 
18
- `@flemo/devtools` resolves to an inert entry when your bundler builds for
19
- production, so the ordinary import is the safe one:
26
+ Normal imports use `development` and `production` export conditions. The production implementation is inert and records nothing:
20
27
 
21
28
  ```ts
22
29
  import { attachFlightRecorder } from "@flemo/devtools";
23
-
24
- // Development: the real recorder. Production: a no-op that records nothing
25
- // and whose implementation never enters the bundle.
26
30
  const { detach } = attachFlightRecorder({ log: true });
27
31
  ```
28
32
 
29
- This is done with the `development` / `production` export conditions rather
30
- than left to the caller, because the failure is silent: a normal import of a
31
- dev-time tool builds clean, warns about nothing, and ships to every visitor.
32
- It happened to this project — the recorder's strings were found in a
33
- production chunk of flemo.dev and had to be removed.
34
-
35
- Two things to know:
36
-
37
- - **Not every bundler sets those conditions.** Vite and Next do. If yours does
38
- not, keep the module behind a dynamic import guarded by a build-time
39
- constant (`process.env.NODE_ENV !== "production"`, Vite's
40
- `import.meta.env.DEV`) so the branch — and the module behind it — is
41
- eliminated. There is no automatic fallback for that case, and the shape of
42
- this package is why: `@tanstack/react-query-devtools` gets one by importing
43
- its implementation statically and swapping it on `process.env.NODE_ENV`, so
44
- the bundler folds the constant and drops the now-unreferenced module. That
45
- works because their implementation stays a separate module file. Ours cannot
46
- — `dist/index.mjs` is self-contained on purpose, so it can be loaded
47
- directly in a page — and measured with esbuild (which sets neither
48
- condition), the same swap strips nothing: production and development bundles
49
- came out byte-identical in size with the recorder present in both. The guard
50
- is the answer there, not a trick inside the package.
51
- - **`@flemo/devtools/force` is the escape hatch.** It resolves to the real
52
- tool whatever the build mode, for when you deliberately want the recorder in
53
- a production build (a staging deploy, an e2e suite that must run against a
54
- production build). Import it dynamically behind your own opt-in flag.
55
-
56
- ## Keeping it out of your production bundle
57
-
58
- Install it as a **devDependency** — and know that this alone is not enough.
59
- `devDependencies` decides what gets INSTALLED (consumers of _your_ package do
60
- not receive it); it does not decide what gets BUNDLED. A plain top-level import
61
- of a package you call at runtime ships to every visitor regardless of which
62
- dependency field it sits in. We measured exactly that on the flemo docs site
63
- before fixing it.
64
-
65
- What actually removes it is a **dynamic import behind a build-time constant**,
66
- which bundlers replace before dead-code elimination:
33
+ Vite and Next set these conditions. For bundlers that do not, guard a dynamic import with a build-time constant:
67
34
 
68
35
  ```ts
69
36
  // Vite
@@ -79,270 +46,80 @@ if (process.env.NODE_ENV !== "production") {
79
46
  }
80
47
  ```
81
48
 
82
- The package ships `"sideEffects": false` and has no import-time side effects,
83
- so nothing is pulled in by the import statement itself — but a binding you
84
- actually call cannot be shaken out. Verify with a production build: the string
85
- `present-pipeline pacing` (from the blind-spot list) must not appear in it.
49
+ Install as a devDependency, but do not rely on dependency fields for bundle exclusion. A used top-level import can ship even though the package has `"sideEffects": false` and no import-time effects. `dist/index.mjs` is self-contained; an internal `process.env.NODE_ENV` substitution did not reduce measured esbuild bundles when no export condition was set. Use the guarded import and verify production output lacks `present-pipeline pacing`. See `apps/web/app/[lang]/playground/_hooks/useDevtoolsRecorder`.
86
50
 
87
- `apps/web/app/[lang]/playground/_hooks/useDevtoolsRecorder` in this repo is a
88
- working reference.
51
+ `@flemo/devtools/force` always loads the recorder. Import it dynamically behind an explicit opt-in only for staging or production-build E2E.
89
52
 
90
- ## Quickstart
53
+ ## Visual panel
91
54
 
92
55
  ```ts
93
- import { attachFlightRecorder } from "@flemo/devtools";
56
+ import { attachDevtoolsPanel } from "@flemo/devtools";
57
+ const panel = attachDevtoolsPanel();
58
+ // panel.detach();
59
+ ```
94
60
 
95
- const recorder = attachFlightRecorder({ log: true });
61
+ Consumers must opt in behind a development-only flag; flemo and its playground neither attach nor ship the panel automatically. The floating toggle shows flight count and an anomaly dot. The drawer shows flights, details, active overrides, and blind spots.
96
62
 
97
- // ...navigate around...
63
+ Options are `recorder`, `initialOpen` (`false`), and `position` (`"bottom-right"` or `"bottom-left"`). Without `recorder`, the panel reuses this package's `window.flemo` or owns a new recorder. It is idempotent while mounted and inert without a DOM.
98
64
 
99
- const report = recorder.report(); // JSON-serializable FlemoReport
100
- recorder.detach();
101
- ```
65
+ The framework-free panel uses an open shadow root. Its fixed, zero-sized host has `data-flemo-devtools-panel`, no screen `data-flemo-*` attributes, and cannot join a flight. Drawer height persists as `flemo:devtools-panel-height` in `sessionStorage`.
102
66
 
103
- The recorder also installs `window.flemo` (unless something else already owns
104
- that name, or you pass `installGlobal: false`):
67
+ The panel must not repaint during a flight:
105
68
 
106
- ```js
107
- copy(JSON.stringify(window.flemo.report(), null, 2)); // DevTools console
108
- ```
69
+ - Refresh with a `setTimeout` chain about three times per second while open and once every two seconds while closed; never keep an rAF loop.
70
+ - Skip refreshes and deferred actions while any screen has transitional `data-flemo-status`, then retry next tick.
71
+ - Render only the toggle while closed.
72
+ - Add no CSS transitions, keyframes, or live-dashboard behavior.
109
73
 
110
- In the flemo playground it is pre-wired: visit `/playground?devtools=on` (the
111
- toggle is stored in `sessionStorage` under `flemo:devtools`, so it survives
112
- navigation; `?devtools=off` disarms it).
74
+ ## Report schema v2
113
75
 
114
- `attachFlightRecorder()` is idempotent — while a recorder is attached, further
115
- calls return the same handle. In non-DOM environments (SSR) it returns an
116
- inert handle.
76
+ Reports contain:
117
77
 
118
- ## Visual panel
78
+ - `generatedAt`, `version: "2"`, and `environment`: user agent and brands, engine, platform, touch count, DPR, screen and viewport sizes, visual viewport scale, idle `rafCadence`, reduced motion, emulation suspicion, and support for long tasks, element animations, and the player-gap mirror.
79
+ - `overrides.active`: all `flemo:*` keys in both storages, unknown keys, keys cleared since attachment, and retired persisted keys marked inert. Since 2026-08-31, flemo reads no `flemo:*` engine key; `overrides.warnings` explains each residue key.
80
+ - `flights[]`: identity, router, navigation kind, timestamps, duration, detected driver, participants, holds, frame and phase statistics, motion, images, player gaps, long tasks, landing checks, and stable anomaly strings.
81
+ - Session `anomalies`, constant `blindSpots`, and constant `judgingProtocol`.
119
82
 
120
- The same data, on screen. `attachDevtoolsPanel()` mounts a floating `flemo`
121
- toggle (flight count, plus a red dot when any flight carries an anomaly) and a
122
- bottom drawer with the flight list, the per-flight detail, the active
123
- overrides, and the blind-spot list.
83
+ `driver` is classified per flight as `compiled`, `player`, `mixed`, or `unknown`; never infer it from platform policy. `holds.releasedAtMs` is the last release relative to `t0`. Held work is intentionally absorbed, so frame gaps and long tasks are separated into held and released phases; held gaps do not raise anomalies.
124
84
 
125
- ```ts
126
- import { attachDevtoolsPanel } from "@flemo/devtools";
85
+ `motion` measures pose advancement independently of frame arrival. It records sampled and stalled frames, `longestStallMs` with an anomaly threshold of 48 ms, `pausedAfterRelease`, and `holdReassertedAtMs`, using animation clocks or inline poses without a style flush. Stationary closing frames are tails, not mid-flight stalls.
127
86
 
128
- const panel = attachDevtoolsPanel(); // reads window.flemo, or attaches its own
129
- // panel.detach();
130
- ```
87
+ `images` records loading at start, additions, completions, held images, and `completedUnheld`; count per image so a held loading image cannot cancel an unheld completion. `longTasks` covers visible motion and `holdLongTasks` covers absorbed work. Landing is audited two rAFs after `COMPLETED` for residual inline transforms, off-viewport rest, statuses stuck over 10 seconds, and orphaned holds. Skip orphan auditing when another flight is running.
131
88
 
132
- The panel is opt-in and mounted by the consumer: nothing in flemo attaches it
133
- for you, and the flemo playground deliberately arms the recorder only (the
134
- site should not ship a debug UI). Mount it behind your own dev-only flag.
135
-
136
- Options: `recorder` (a handle from `attachFlightRecorder`; defaults to this
137
- package's `window.flemo`, otherwise the panel attaches and owns one),
138
- `initialOpen` (default false), `position` (`"bottom-right"` default, or
139
- `"bottom-left"`). Zero dependencies, no framework: vanilla DOM inside an open
140
- shadow root, so no consumer CSS reaches in and none of the panel's reaches
141
- out. The host is `position: fixed`, zero-sized, marked
142
- `data-flemo-devtools-panel`, and carries no `data-flemo-*` screen attributes
143
- the recorder never sees the panel as a flight participant. Drag the drawer's
144
- top edge to resize; the height persists in `sessionStorage` under
145
- `flemo:devtools-panel-height`.
146
-
147
- **It never repaints during a flight.** That is the design constraint, not a
148
- nicety: this project once spent weeks chasing stutter that turned out to be
149
- _DevTools being open_, and a measurement surface
150
- that repaints mid-transition reproduces that artifact and then reports it as a
151
- finding. So the panel
152
-
153
- - refreshes on a `setTimeout` chain (~3×/s open, once per 2s closed) — never a
154
- persistent `requestAnimationFrame` loop competing with the motion,
155
- - **skips any refresh while a screen carries a transitional
156
- `data-flemo-status`** and retries on the next tick — deferred user actions
157
- (open/close, row selection) included,
158
- - renders only the toggle button while closed,
159
- - ships no CSS transitions and no keyframes at all.
160
-
161
- Do not turn it into a live-updating dashboard.
162
-
163
- ## Report schema (version "2")
164
-
165
- ```jsonc
166
- {
167
- "generatedAt": "2026-08-17T09:00:00.000Z",
168
- "version": "2",
169
- "environment": {
170
- "userAgent": "…",
171
- "uaBrands": [{ "brand": "Chromium", "version": "126" }],
172
- "engine": "blink", // blink | webkit | gecko | unknown
173
- "platform": "MacIntel",
174
- "maxTouchPoints": 0,
175
- "devicePixelRatio": 2,
176
- "screen": { "width": 1728, "height": 1117 },
177
- "viewport": { "width": 1280, "height": 720 },
178
- "visualViewportScale": 1,
179
- "rafCadence": { "medianGapMs": 16.67, "sampleCount": 20 }, // idle sample at attach
180
- "reducedMotion": false,
181
- "emulationSuspected": false, // DevTools device-toolbar signature
182
- "observation": { "longTasks": true, "elementAnimations": true, "playerGapMirror": false }
183
- },
184
- "overrides": {
185
- // Every flemo:* storage key currently set (both storages), including
186
- // unknown keys and keys present at attach but cleared since (marked).
187
- // Retired keys still persisted on the device are listed too, marked
188
- // "(retired — the library no longer reads this)", so residue is ruled out
189
- // rather than chased.
190
- "active": { "flemo:layers": "resident" },
191
- // Read these FIRST. A non-empty warnings list means the session does not
192
- // run stock behavior.
193
- "warnings": ["flemo:layers=resident — opt-in diagnostic active (…)"]
194
- },
195
- "flights": [
196
- {
197
- "id": "flight-1",
198
- "routerId": "…", // when the screen stamps data-flemo-router
199
- "kind": "PUSH", // PUSH | POP | REPLACE
200
- "t0": { "ms": 1234.5, "iso": "…" }, // performance.now + wall clock
201
- "t1": { "ms": 1834.5, "iso": "…" },
202
- "durationMs": 600,
203
- // compiled | player | mixed | unknown — detected per flight from the
204
- // DOM signature (inline animation suppression + advancing inline pose
205
- // = player; a running flemo-* CSSAnimation = compiled). Never assume a
206
- // platform always routes one tier; routing policies evolve.
207
- "driver": "compiled",
208
- "participants": { "screens": 2, "bars": 0, "decorators": 1, "parts": 0 },
209
- // data-flemo-anim-hold: releasedAtMs = when the LAST hold released,
210
- // relative to t0. The engine absorbs heavy commits INTO the hold (the
211
- // screen is posed, not moving), so everything below is segmented on
212
- // this boundary.
213
- "holds": { "kind": "park-under", "releasedAtMs": 120 },
214
- "frameSamples": {
215
- "count": 36,
216
- "medianGapMs": 16.7,
217
- "maxGapMs": 17.2,
218
- "longGaps": [],
219
- // held-phase gaps are absorbed by design — no anomaly ever fires on them;
220
- "held": { "count": 7, "medianGapMs": 18.1, "maxGapMs": 45.0, "over30Count": 1 },
221
- // released-phase gaps are visible motion — the anomaly rules key on these.
222
- "released": { "count": 29, "medianGapMs": 16.7, "maxGapMs": 17.2, "over30Count": 0 }
223
- },
224
- // Did it MOVE — a different question from "did frames arrive". A
225
- // compiled flight is read off its own animation clock, a player flight
226
- // off the inline pose it writes; neither forces a style flush.
227
- "motion": {
228
- "sampledFrames": 29,
229
- "stalledFrames": 0, // released frames where neither clock nor pose moved
230
- "longestStallMs": 0, // >= 48ms raises an anomaly
231
- "pausedAfterRelease": false, // playState went "paused" mid-motion
232
- "holdReassertedAtMs": null // a hold went back ON after releasing
233
- },
234
- // Images inside the participants. One still-loading <img> completing
235
- // mid-flight costs one skipped present (glass-measured 1:1), which is
236
- // why the engine holds them; an unheld completion is that regression.
237
- // completedUnheld is the number that matters, counted PER IMAGE: a
238
- // held-but-still-loading image must not cancel out an unheld completed
239
- // one. addedDuringFlight covers images a data commit inserts mid-
240
- // navigation, which is the case core's image hold also watches for.
241
- "images": {
242
- "loadingAtStart": 12,
243
- "addedDuringFlight": 0,
244
- "completedDuringFlight": 0,
245
- "heldDuringFlight": 12,
246
- "completedUnheld": 0
247
- },
248
- "playerGaps": { "maxMs": 42.3, "over30Count": 1 }, // only if the player mirror grew
249
- "longTasks": [{ "startMs": 1200.0, "durationMs": 180.0 }], // intersecting visible motion
250
- "holdLongTasks": [], // fully absorbed by the hold — engine working as designed
251
- "landing": {
252
- // Audited 2 rAF after COMPLETED:
253
- "residualInlineTransforms": [], // inline transform/opacity leftovers
254
- "offViewportAtRest": false, // the blank-viewport (PR #259) signature
255
- "stuckStatuses": [], // transitional statuses >10s old
256
- // Hold markers still on the page at rest. Skipped (left empty) when
257
- // another flight is already running: two frames after a landing, a
258
- // fast back-to-back navigation legitimately owns holds of its own.
259
- "orphanedHolds": []
260
- },
261
- "anomalies": ["long task 180ms overlapped flight start (opening-swallow risk)"]
262
- }
263
- ],
264
- "anomalies": [], // session-level: active pins, emulation, stuck flights
265
- "blindSpots": ["…"], // constant — see below
266
- "judgingProtocol": ["…"] // constant — the preconditions a verdict needs
267
- }
268
- ```
89
+ ## Detected defects
90
+
91
+ Stable anomaly signatures include:
92
+
93
+ - `hold re-asserted …ms into the flight`: a stale paused hold was rewritten during motion.
94
+ - `motion stalled …ms mid-flight`: motion froze or froze then leapt despite continuing rAF.
95
+ - `playState=paused`: posed motion stopped rather than suffering frame starvation.
96
+ - `image(s) finished loading mid-flight without a hold`: decode rastered on the moving layer.
97
+ - `hold markers left on the page at rest`: hidden content has no owner to reveal it.
98
+ - `screen resting at from-pose while COMPLETED+active`: blank-viewport landing.
99
+ - `long task …ms overlapped the visible-motion start`: swallowed opening.
100
+ - `transitional status stuck >10s`: the navigation queue remains locked.
101
+ - `active force pin flemo:motion-driver-force=…`: diagnostic residue pins a driver.
102
+
103
+ These defects have occurred with clean frame timing.
104
+
105
+ ## Judging protocol and blind spots
106
+
107
+ A valid verdict requires DevTools closed, no capture, real input, emulation off, and known display, refresh rate, HiDPI scaling, and Low Power Mode state. The page cannot verify these, so every report includes `judgingProtocol`. Open DevTools caused 2026-08 residual stutter; capture can suppress symptoms; synthetic dispatch bypasses `pointerdown` gesture behavior.
108
+
109
+ In-page tools cannot observe macOS Chrome present-pipeline pacing on 120 Hz ProMotion (Chromium issues 40062488/345275139), display hardware, compositor-internal present skips, or the post-scale DevTools emulation surface. These remain in `blindSpots`. If a correctly judged report is clean but jank is visible, investigate those layers instead of adding in-page instrumentation.
110
+
111
+ ## Hand a report to an agent
112
+
113
+ 1. Reproduce once with the recorder attached.
114
+ 2. Run `copy(JSON.stringify(window.flemo.report(), null, 2))`.
115
+ 3. Paste the JSON into the issue or conversation.
269
116
 
270
- ## What it is built to catch
271
-
272
- Every rule below exists because the matching defect actually shipped, was
273
- lived with, and cost days. They share one property: **frame timing was clean
274
- through all of them.** A recorder that only measured gaps would have called
275
- each of these sessions healthy.
276
-
277
- | Signature in `anomalies` | The defect it guards against |
278
- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
279
- | `hold re-asserted …ms into the flight` | An interleaved commit writing the stale paused hold attribute over a running flight — froze motion ~250ms, intermittently |
280
- | `motion stalled …ms mid-flight` | Any freeze / freeze-then-leap: the pose stopped advancing while rAF kept ticking |
281
- | `playState=paused` | The flight was posed and then stopped, rather than starved of frames |
282
- | `image(s) finished loading mid-flight without a hold` | Warm-side image decode rastering on the sliding layer — one skipped present per decode |
283
- | `hold markers left on the page at rest` | Orphaned image/arrival holds: content hidden with no owner left to reveal it (the permanently-blank-avatar class) |
284
- | `screen resting at from-pose while COMPLETED+active` | The blank-viewport landing (PR #259) |
285
- | `long task …ms overlapped the visible-motion start` | The swallowed opening (씹힘) |
286
- | `transitional status stuck >10s` | A locked navigation queue — every later navigation is silently ignored |
287
- | `active force pin flemo:motion-driver-force=…` | A/B residue pinning the whole session to one driver (this one burned a multi-day investigation) |
288
-
289
- ## The judging protocol
290
-
291
- Every report also carries `judgingProtocol`. It is not derived — the page
292
- cannot check it — so it is stated instead:
293
-
294
- - **DevTools closed.** The 2026-08 campaign's entire residual "stutter" was
295
- the open inspector, verified bidirectionally on the reporting machine. A
296
- clean report from a DevTools-open session proves nothing.
297
- - **No screen capture running.** A capture client forces the compositor to a
298
- steady cadence and _suppresses_ the symptom.
299
- - **Real input.** Synthetic dispatch never fires `pointerdown`, so it bypasses
300
- the gesture machinery a real navigation goes through.
301
- - **Known viewing configuration.** Emulation off; which display, refresh rate,
302
- HiDPI scaling, Low Power Mode.
303
-
304
- ## Blind spots
305
-
306
- Every report ends with a constant `blindSpots` list: the layers **no in-page
307
- instrument can see**, each of which once consumed a real investigation:
308
-
309
- - macOS Chrome present-pipeline pacing (Chromium issues 40062488/345275139) —
310
- frames judder on 120Hz ProMotion while every in-page metric reads clean;
311
- proven with a no-script pure-CSS control page.
312
- - Display-hardware effects (local dimming, backlight modulation).
313
- - Compositor-internal present skips invisible to rAF.
314
- - DevTools device emulation composites to a rescaled surface — instruments
315
- read the pre-scale surface, the eye watches the post-scale one.
316
-
317
- If the report is clean and the user still sees jank, the cause lives in one of
318
- these. Do not chase them with in-page tooling.
319
-
320
- ## Handing a report to an agent
321
-
322
- 1. Reproduce the problem once with the recorder attached (playground:
323
- `/playground?devtools=on`).
324
- 2. `copy(JSON.stringify(window.flemo.report(), null, 2))` in the console.
325
- 3. Paste the JSON into the issue/conversation.
326
-
327
- Reading order for the agent: `overrides.warnings` (is this session even
328
- stock?) → `environment.emulationSuspected` + `rafCadence` (is the observation
329
- trustworthy? what display cadence?) → per-flight `driver` + `anomalies`
330
- (which tier ran, what went wrong, when) → `blindSpots` (what not to chase).
331
- All anomaly strings are stable, grep-friendly signatures.
117
+ Read `overrides.warnings`, `environment.emulationSuspected`, `rafCadence`, each flight's `driver` and `anomalies`, then `blindSpots`.
332
118
 
333
119
  ## API
334
120
 
335
- - `attachFlightRecorder(options?)` `{ report(), detach() }` options:
336
- `maxFlights` (default 50), `log` (default false), `installGlobal`
337
- (default true).
338
- - `attachDevtoolsPanel(options?)` `{ detach() }` options: `recorder`,
339
- `initialOpen` (default false), `position` (default `"bottom-right"`).
340
- Idempotent while mounted; inert without a DOM.
341
- - Pure helpers (unit-testable, no DOM): `deriveFlightAnomalies`,
342
- `deriveReportAnomalies`, `deriveOverrideWarnings`, `classifyDriver`,
343
- `computeFrameStats`, `computePlayerGapStats`, `parseTranslateX`,
344
- `kindFromStatus`.
345
- - Constants/registries: `BLIND_SPOTS`, `FLAG_REGISTRY`, `LONG_GAP_MS`,
346
- `STUCK_STATUS_MS`, `REPORT_SCHEMA_VERSION`.
347
- - Environment probes: `captureEnvironment`, `detectEngine`,
348
- `isEmulationSuspected`, `sampleRafCadence`.
121
+ - `attachFlightRecorder(options?)` returns `{ report(), detach() }`; options: `maxFlights` (50), `log` (`false`), `installGlobal` (`true`).
122
+ - `attachDevtoolsPanel(options?)` returns `{ detach() }`; options: `recorder`, `initialOpen` (`false`), `position` (`"bottom-right"`).
123
+ - Pure helpers: `deriveFlightAnomalies`, `deriveReportAnomalies`, `deriveOverrideWarnings`, `classifyDriver`, `computeFrameStats`, `computePlayerGapStats`, `parseTranslateX`, `kindFromStatus`.
124
+ - Constants and registries: `BLIND_SPOTS`, `FLAG_REGISTRY`, `LONG_GAP_MS`, `STUCK_STATUS_MS`, `REPORT_SCHEMA_VERSION`.
125
+ - Environment probes: `captureEnvironment`, `detectEngine`, `isEmulationSuspected`, `sampleRafCadence`.