Skip to content

fix(audit-engine): always fetch assets through the tarpit-aware budget - #2395

Open
longshore-nc9[bot] wants to merge 2 commits into
mainfrom
fix/2340-cli-tarpit-fetch-budget
Open

longshore-nc9[bot] wants to merge 2 commits into
mainfrom
fix/2340-cli-tarpit-fetch-budget

Conversation

@longshore-nc9

@longshore-nc9 longshore-nc9 Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #2340.

The asset and script fetchers take a shared tarpit-aware FetchBudget, but the engine only built one when resourceCheckBudgetMs was set (cloud, or the CLI's --max-duration). A default CLI audit could keep requesting a host that was tarpitting it. The budget is now always built with tarpit detection; resourceCheckBudgetMs only adds the wall-clock bound.

Also: the script fetcher now treats an HTTP status answer (a 404 script) as a responding host, not a strike, whatever the caller's content-type policy. Without it, three broken scripts on a healthy host would skip the rest, changing results for normal sites. Only latency, timeouts and network errors strike.

Tests:

  • New apps/cli/tests/cli/audit-script-tarpit-2340-e2e.test.ts: a default CLI audit against a host that stalls every script; fails before the fix (40 of 40 scripts requested), passes after (fewer).
  • analyze-streaming-1021.test.ts: its fixture linked to uncrawled paths on a non-resolving host, whose probe errors now trip the budget in one of two runs; the link was removed.

Commands run: bun run scripts/test-suites.ts --run audit-engine (2471 pass, 0 fail), --run cli (4669 pass, 0 fail), bun run format:check and bun run typecheck in apps/cli, typecheck in packages/audit-engine, bun scripts/changelog.ts check.

Docs: none. Skill: none.

nc9 added 2 commits November 25, 2026 18:33
…#2340

Signed-off-by: longshore-nc9[bot] <360568931+longshore-nc9[bot]@users.noreply.github.com>
Signed-off-by: longshore-nc9[bot] <360568931+longshore-nc9[bot]@users.noreply.github.com>
@nc9
nc9 marked this pull request as ready for review November 25, 2026 18:57

This branch has not been deployed

No deployments
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.

CLI audits should always fetch scripts and assets through the tarpit-aware fetch budget

1 participant