#!/usr/bin/env node /** * verify-shell-scroll.mjs — THE GATE FOR BUG-STILL-CANNOT-SCROLL-DOWN-TO-THE-GRID. * * ★ WHAT IT ASSERTS, and why each assertion exists rather than the obvious one. * * The obvious assertion — `scrollHeight > innerHeight` — is a FALSE PASS and was used twice to * close this bug while the agent could still not scroll. In the cap-5 shell the document measures * scrollHeight 900 === clientHeight 900 while the composite element measures 3380/769: the * overflow is real, but it belongs to an element with `overflow:visible` that no scroller owns. * Geometry said "tall"; the user's wheel moved nothing. * * So this gate asserts the ONLY thing the agent actually cares about: that a REAL WHEEL GESTURE * over the map area moves the grid up the screen and brings it into view. It measures the grid's * position before and after, in the SHELL, which is the surface he uses — not the standalone leaf, * which passed all along and is why the two previous fixes looked green. * * ★ NEGATIVE-TESTED. Reverting the fix (restoring `.ps-pane`/`.vtl-host` to `position:absolute; * inset:0` with no overflow, and `.vtl-content` to `contain:layout paint`) makes this exit 1 with * "grid did not move". A gate nobody has broken is a gate nobody knows works. * * Usage: node internal/verify-shell-scroll.mjs [baseUrl] * (defaults to http://localhost:8899; serve ./public) */ import { chromium } from './lib/playwright-guarded.mjs' import { dirname, resolve } from 'node:path' import { fileURLToPath } from 'node:url' import { requireThisTree } from './_serves-this-tree.mjs' import { TREE_NAME } from './_tree-name.mjs' // Default matches every other browser gate in this repo: `bun run serve` on loopback 4173. // It was `localhost:8899` — one of the ad-hoc ports a previous session happened to have running, // which meant the gate failed with ERR_CONNECTION_REFUSED for anyone else and looked like a broken // gate rather than a missing server. Prefer BASE_URL (env) over a positional argument, because // `bun run