chore(web): address Copilot review on the tab smoke

Three findings, all valid.

**The read/get stages asserted an RPC status, not a render.** #2148 asks
for the resource content and the prompt messages to *render*, and
`data-read-status` / `data-get-status` flip the moment the call resolves
— so the smoke stayed green with the panel deleted. `ResourcePreviewPanel`
and `PromptMessagesDisplay` now carry `data-testid="resource-preview"` /
`"prompt-messages"`, and each stage waits on the status **and** the
rendered panel. Verified by breaking each testid: the smoke fails with
`reading `events` did not render a preview — last observed:
data-read-status="ok"`, which is the finding stated back exactly.

**`smoke:web:tabs` followed ambient `SMOKE_BROWSER`**, so
`SMOKE_BROWSER=firefox npm run ci` would have run the supposedly
Chromium-only smoke under Firefox — contradicting both this PR's stated
scope and the gated-tier invariant in `run-engine-smokes.test.mjs`. The
npm script now pins `chromium` on **both** halves (install and launch)
and the smoke resolves through `resolveRequestedBrowser(argv, env)`, where
an explicit argument wins over the environment; a new case in that same
test file pins it, including that the smoke stays out of `ENGINE_SMOKES`.

**The AGENTS rules were not mirrored into `.github/copilot-instructions.md`.**
Correct, and worse than an omission: that file's engine bullet asserts the
headless web smokes are "engine-parameterized, not Chromium-only", which
this PR made false. It now names `smoke:web:tabs` as the deliberate
exception, and carries the genuinely review-citable new rule — assert
`data-*`, never copy, and never stop at an RPC status where the ask was
that something render.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UL9retfvAXRgvi6EWk4SY4
Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-08-26 23:35:58 -04:00
commit 23088e9c69

View file

@ -90,6 +90,23 @@ describe("every engine tier consumes ENGINE_SMOKES", () => {
}
});
it("the Chromium-only tab smoke pins its engine on BOTH halves", () => {
// `smoke:web:tabs` is not engine-sensitive and deliberately stays out of
// ENGINE_SMOKES — but "Chromium-only" is a claim the script has to keep.
// Without the literal engine it followed ambient `SMOKE_BROWSER`, so
// `SMOKE_BROWSER=firefox npm run ci` would have run it under Firefox
// (Copilot, #2148). Both halves are pinned because they must AGREE: an
// install of one engine and a launch of another surfaces as a confusing
// "Executable doesn't exist" rather than as the wiring error it is.
assert.match(
scripts["smoke:web:tabs"],
/install-smoke-browser\.mjs chromium .*smoke-web-tabs\.mjs chromium$/,
);
// And it must not be in ENGINE_SMOKES, or the Firefox tier would pick it
// up regardless of what its own script pins.
assert.ok(!ENGINE_SMOKES.includes("smoke-web-tabs.mjs"));
});
it("each gated tier names its engine explicitly rather than reading the env", () => {
// An ambient SMOKE_BROWSER must not be able to redirect a gate: without the
// literal engine, `SMOKE_BROWSER=firefox npm run ci` would run Firefox twice