Skip to content

feat(tech-detect): count scripts dropped by the fetch cap or script limit in truncated, keep an empty cut section #1408 - #1417

Closed
nc9 wants to merge 1 commit into
mainfrom
feat/tech-truncation-1408
Closed

nc9 wants to merge 1 commit into
mainfrom
feat/tech-truncation-1408

Conversation

@nc9

@nc9 nc9 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1408. #1392 is in v0.0.147 (main b94a3a8); this is rebased onto it and is one commit.

Two limits upstream of tech detection decided what it could see and neither was reported; and a cut that hid everything showed nothing.

  • script-too-large. A first-party script the crawl dropped for being over its 5 MB fetch cap (SCRIPT_TOO_LARGE_ERROR, now one constant in script-fetcher.ts) is counted in technologies.truncated, once however many pages reference it. buildTechInputs reads it from the script's error.
  • script-limit. The audit fetches a share of the page count (10 to 50) and tech detection reads those. PreFetchedAssets.scriptsNotRead (referenced first-party scripts minus the ones the rules got) is passed through detectLocalTechnologies and runCloudTechDetect into buildTechInputs and counted once, on the home page's input. Both reasons are skipped when bundle_bytes = 0 (bundle reading turned off by the user).
  • Nothing detected but cut. detectLocalTechnologies still returns null for an uncut empty scan (so a weak guess never clears synced tech), but returns the empty section with truncated when a cap or the budget cut it short. Every format shows it (text, markdown, console, html, llm and xml attribute, json); an empty uncut section stays hidden. The audit command does not sync such a section to the dashboard (an empty items list there means "found nothing" and clears the stack an earlier scan found); the hosted side needs the same rule (note on squirrelscan/repo#3697).
  • Report note text and docs (docs/cloud/technologies.mdx, output.mdx) name both reasons; the fetch cap and script count are documented as upstream limits.
  • meta.schemaVersion stays 1.3: the new reasons are additions to the truncated field feat(tech-detect): local scan reads bundles whole up to 8 MB, reports truncation, linear comment scan #1387 #1392 introduces.

Tests: tech-script-gaps-1408.test.ts (8: counted once, not counted with a body or another error, off with bundle_bytes = 0, limit count on the home page only, adds up), report tests for the new reasons and for empty sections with and without a cut (every renderer), cli tests for the local and cloud results and the null-when-uncut case, and an e2e (tech-truncated-1408-e2e.test.ts): twelve scripts with the firebase config in the eleventh (limit 10: two counted, firebase not found) and a 6 MB bundle with a Supabase call at 3 MB (counted, not found). Gates: tsgo in audit-engine, report, core-contracts and cli, cli lint and format, make validate, changelog guard.

Skill: no change beyond squirrelscan/repo#3698 (already filed for #1392).

nik

…pt limit in truncated; keep an empty cut section #1408

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 force-pushed the feat/tech-truncation-1408 branch from 7f1c1ca to a89ba48 Compare October 31, 2026 03:13
@nc9 nc9 mentioned this pull request Oct 31, 2026
@nc9

nc9 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

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.

tech-detect: count scripts dropped by the 5 MB fetch cap and the script limit, and show truncation when nothing was detected

1 participant