Skip to content

store_scripts changes audit results: rules evaluate all 200 stored scripts, js-file-size fails on 36.5% vs 29.8% of the same sites #1280

Closed

Description

@nc9

[storage] store_scripts = true / --store-scripts (#1255) is documented as a storage option ("Off by default: nothing changes unless you set it"). With it on, the audit fetches up to store_scripts_max_scripts (default 200) first-party scripts instead of the usual 10 to 50, and holds all of them for the rules phase. So every script-based rule evaluates a different, larger input, and findings and scores change.

The same 597 sites, same Boat environment, a few hours apart (-C surface --max-pages 30 --offline --passive):

rule v0.0.140, storage off v0.0.141, store_scripts = true
perf/js-file-size 29.8% of sites (181 checks) 36.5% (223)
perf/total-byte-weight 37.7% (225) 40.0% (239)
perf/unminified-js 47.7% (285) 49.6% (296)
perf/source-maps 4.4% (32) 5.2% (42)
security/leaked-secrets 4.0% (25) 5.2% (32)
perf/ttfb (control) 36.9% 37.2%

Seeing more of the site is arguably better for leaked-secrets. But a flag named and documented as storage shouldn't silently change audit results: a corpus run with storage on can't be compared with one without it, and a user who turns it on to keep data sees their score move.

Acceptance Criteria

  • Pick one behaviour and document it:
    • (a) Storage only: with store_scripts on, the rules phase sees the same script set it would see with it off, and the extra scripts are fetched and stored for later analysis only. A test pins identical findings with the flag on and off on a fixture with more than 50 scripts.
    • (b) Coverage is a separate setting (e.g. [rules] script_coverage / --scan-all-scripts) that store_scripts doesn't imply. The report's coverage block says how many scripts the rules evaluated.
  • The report states how many first-party scripts the script rules evaluated, so two runs can be compared.
  • The store_scripts docs describe the effect (or the lack of one) on findings.

Activity

  1. added
    bug
    on Oct 29, 2026
  2. added theissue type on Oct 29, 2026
  3. added
    size: M
    rules
    on Oct 29, 2026
  4. nc9 commented on Oct 30, 2026

    @nc9
    ContributorAuthor

    Decision (Nik, 2026-10-29): storage-only. With store_scripts on, rules evaluate exactly the same script set as with it off; the extra scripts (up to the store cap) are only stored. A test will pin identical findings and scores with and without the flag.

  5. nc9 commented on Oct 30, 2026

    @nc9
    ContributorAuthor

    Shipped in v0.0.143 (commits 07ebcb3, 929e398). Checked every acceptance criterion against current main: store_scripts is storage only: the rules see the same scripts as with it off, meta.scriptsEvaluated, docs.

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclirulessize: M

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions