Skip to content

fix(core-contracts): raise runPerPageMs to 7200 so a 500-page full audit gets the 1h budget - #222

Merged
nc9 merged 1 commit into
mainfrom
fix/run-per-page-budget
Sep 7, 2026
Merged

nc9 merged 1 commit into
mainfrom
fix/run-per-page-budget

Conversation

@nc9

@nc9 nc9 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Why

A 500-page full-coverage cloud audit of a site with ~1 MB HTML pages (drscholls.com, Shopify, ~820 KB inline script per page) takes ~27 min to crawl with rendering and ~16 min in the rules phase on the container. runPerPageMs = 4_800 pinned the 500-page preset to exactly the 2400 s full base, so the run timed out at 310/474 pages after the memory problem (private #1862) had already been fixed.

What

runPerPageMs: 4_800 → 7_200. A 500-page full audit now scales to the existing 1 h ceiling (maxRunTimeoutMs). quick (25 × 7.2 s = 180 s) and surface (100 × 7.2 s = 720 s) stay below their base budgets, so nothing changes for them. Crawl-phase budget scales with the same extra (worker-agent CRAWL_PHASE_EXTRA_FRACTION = 0.75): 1800 s + 900 s = 45 min for the 500-page preset, above the observed 27 min crawl. The container hard-kill (runtime + 180 s) and the API reaper (staleRunThresholdMs 75 min) already assume the 1 h cap.

The rule cost itself is tracked in private #1864; this PR only stops the budget from being the thing that fails.

Verification

No public test pins the constant (grep runPerPageMs/4_800 in packages/ and apps/ is only the definition). Private worker-agent/api timeout tests are updated in the gitlink-bump PR.

…dit gets the 1h budget

A 474-page rendered crawl of ~1MB Shopify pages takes ~27min to crawl and
~16min of rules on the cloud container; with the 500-page preset pinned to
the 2400s base it timed out at 310/474 pages with memory to spare. The scalar
is shared by the container runtime cap and the API reaper, so both move
together. quick/surface presets are unaffected.

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 merged commit 4496d4b into main Sep 7, 2026
13 checks passed
@nc9
nc9 deleted the fix/run-per-page-budget branch September 7, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant