How to: Browser Size Workflow
The [📦 Browser Size](.github/workflows/size-check.yml) job ensures the
Insight archive stays under 500 MiB (with a 750 MiB hard cap). Open **Actions → 📦 Browser Size** and click
**Run workflow** to start the check. Repository owners can leave `run_token`
blank. Others must provide the `run_token` that matches the `DISPATCH_TOKEN`
secret. The workflow caches pip and npm dependencies using
`actions/setup-python` and `actions/setup-node`. Node uses `cache-dependency-path` to reference
`alpha_factory_v1/demos/alpha_agi_insight_v1/insight_browser_v1/package-lock.json`,
`alpha_factory_v1/core/interface/web_client/package-lock.json`,
`alpha_factory_v1/core/interface/web_client/staking/package-lock.json` and
`alpha_factory_v1/demos/alpha_agi_insight_v1/src/interface/web_client/package-lock.json` so repeat runs
skip redundant downloads and avoid the “Dependencies lock file is not found”
warning. `ci.yml` stores these paths in the `NODE_LOCKFILES` environment
variable so every `setup-node` step uses the same list. It
applies the same paths for the tests, docs-build and Docker jobs. It
preinstalls `numpy`, `pandas`, `pytest` and `PyYAML` so the environment check
passes without network hiccups. During the run it also updates the
`browserslist` cache inside
`alpha_factory_v1/demos/alpha_agi_insight_v1/insight_browser_v1` **and**
`alpha_factory_v1/core/interface/web_client` using
`update-browserslist-db` to ensure the generated assets target the latest
browsers. When running offline or if the update fails, set
`BROWSERSLIST_IGNORE_OLD_DATA=true` to continue without refreshing the cache.
Update the version in `.github/workflows/ci.yml` and rerun
`npx update-browserslist-db --update-db --yes` whenever dependencies change.