diff --git a/compiler/src/capture/capture.ts b/compiler/src/capture/capture.ts index 010a2aa..e6f45a8 100644 --- a/compiler/src/capture/capture.ts +++ b/compiler/src/capture/capture.ts @@ -15,6 +15,8 @@ import { discoverBreakpoints } from "./breakpoints.js"; import { writeJSON, writeJSONCompact, writeBytes, ensureDir } from "../util/fsx.js"; import { sha1_12, round } from "../util/canonical.js"; import { isZipArchive, extractDotLottieJson } from "./dotlottie.js"; +import { buildDeterministicEnvShim, captureEpochMs, DEFAULT_PRNG_SEED } from "../util/envShim.js"; +import { isBotWall, classifyNavFailure } from "../util/captureFailure.js"; export const REQUIRED_VIEWPORTS = [375, 768, 1280, 1920] as const; // The dense width set captured for SIZE INFERENCE: a node sampled at 9 widths reveals its sizing @@ -65,6 +67,10 @@ export type SeoResource = { export type CaptureResult = { sourceUrl: string; capturedAt: string; + // Deterministic-env shim parameters actually used for this run (Item 1). Recorded + // so a recapture can reuse the exact {seed, epochMs} — the pinned wall clock is a + // run-metadata value, not a hardcoded constant. Absent when the shim was disabled. + deterministicEnv?: { seed: number; epochMs: number }; viewports: number[]; // Browser-as-oracle: the widths where the SOURCE layout actually restructures (display / // flex-direction / wrap / grid-track-count / position / visibility flips), found by sweeping the @@ -797,6 +803,66 @@ async function captureCanvasStills(page: import("playwright").Page): Promise fallback markup (the walker skips