`pnpm lighthouse` in apps/repl serves the production build and runs
Lighthouse 13 (the version of pagespeed.web.dev, with the agentic
browsing category) on three pages, three runs each, and takes the
median run.
What makes it exit with code 1 depends on what we ship, not on the
speed of the machine: each scored audit of the accessibility, best
practices, SEO, and agentic browsing categories, a CLS budget, and a
transfer size budget. Known failures have a list with reasons. The
performance score and TBT only warn.
With GITHUB_STEP_SUMMARY set, the result table goes to the job summary.
@lhci/cli is not used, because its newest release has Lighthouse 12.6.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
pnpm build:prod && pnpm lighthouseinapps/replruns Lighthouse on the production build and exits with code 1 on new accessibility, best practices, SEO, or agentic browsing findings, on layout shift, and on transfer size. It takes about 70 seconds.The CI job is not in this PR
My GitHub token has no
workflowscope, so I cannot push a change to.github/workflows/ci.yml. Add this job toci.yml, before thelintsjob. It uses the artifact of thebuild_prodjob, and the action pins are the ones that the repo already uses:I did not run this job, so it is not verified. The script reads
GITHUB_STEP_SUMMARYand writes the result table there.How the script works
apps/repl/scripts/lighthouse.mjs:distwith brotli and anindex.htmlfallback, close to Cloudflare Pages./editwith the welcome document,/editwith a gjs document (this loads Babel and content-tag), and/docs.lighthouse-reports/(ignored by git).What fails
KNOWN_FAILURESexcuses two audits, both from thetabsterelements that #2264 describes:aria-hidden-focusandagent-accessibility-tree. I checked that the gate can fail: without that list, the script exits with code 1 and names both audits for each page.What only warns
The performance score (below 70) and TBT (above 300 ms). They change with the speed of the machine, and a flaky gate gets ignored.
Why not
@lhci/cliIts newest release (0.15.1) has Lighthouse 12.6. PageSpeed uses 13.4, which has the agentic browsing category.
Limits
agent-accessibility-treeis one audit for the whole tree, so the known failure also hides other findings of that audit. The accessibility category still reports those by their own audit ids.🤖 Generated with Claude Code