Skip to content

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

Closed

Description

@nc9

What

Follow-up to #1387 (PR #1392). Two limits upstream of tech detection decide what it can see, and neither is reported:

  1. The crawl fetches a script only up to 5 MB (SCRIPT_FETCH_LIMITS.MAX_SCRIPT_SIZE_BYTES) and tech detection sees only the scripts the resource phase kept (10 for a small audit, at most 50, even with --store-scripts, which stores up to 60). A 6 MB bundle with a fingerprint at 3 MB is not detected, and nothing says so.
  2. technologies.truncated is only on a section that has items: when the cut hid every technology there is no section, so the note is not shown either (the local scan returns nothing when it detects nothing).

Acceptance Criteria

  • A script the crawl dropped for size (over 5 MB) or never fetched because of the script count limit is counted in technologies.truncated with its own reason (for example script-too-large, script-limit) and a script count.
  • The 5 MB fetch cap and the script count are documented in docs/cloud/technologies.mdx and tied to a setting where one exists.
  • When detection finds nothing but a cap or budget cut it short, the report carries a technologies section with an empty items list and truncated, in every format that shows technologies, without clearing technologies synced from earlier cloud scans.
  • Tests: a 6 MB bundle with a fingerprint inside, 12 scripts with the fingerprint in the 11th, and a crawl where nothing is detected but a cap cut the scan.

nik

Metadata

Metadata

Assignees

No one assigned

    Labels

    clienhancementsize: M

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions