Skip to content

security/sri and content/meta-in-body switch between singular and plural wording, splitting one defect's identity #231

Closed

Description

@nc9

Found while measuring #1881 (PR #228) against the whole production page_findings corpus.

After #228, an item finding's message is the page-invariant part of its check's message plus the item id, so one defect on many pages gets one identity. Measured across 296 sites and 545,822 item rows, that holds for all but 22 of 91,944 (site, rule, check, locator, status) groups. 21 of the 22 are one avoidable cause: two rules alternate between singular and plural wording, so the same item splits depending on how many siblings its page happened to have.

security/sri          cross-origin resource  without Subresource Integrity
security/sri          cross-origin resources without Subresource Integrity
content/meta-in-body  Found N meta tag  in <body>
content/meta-in-body  Found N meta tags in <body>

Most of the rule surface already writes the invariant form (potential source map(s) detected, image(s) missing width/height, cookie(s) missing the Secure flag), which is both consistent copy and identity-safe. These two should match it.

  • packages/rules/src/security/sri.ts:127 builds ${flagged.length} cross-origin ${flagged.length === 1 ? "resource" : "resources"} without Subresource Integrity.
  • content/meta-in-body does the same for "meta tag" / "meta tags".

The 22nd group is separate and smaller: schema/rating-scope interpolates the product name into the message (AggregateRating N from N reviews on Product "DEXTER" ... vs ... "FLOYD" ...), so one locator carries two messages. Per-page content in a check message is what makes a finding's identity page-dependent; the product name belongs in the item or in details, not the message.

Impact is small (0.024% of item rows) and #228 does not depend on this. It is worth fixing so the identity guarantee is clean rather than nearly clean.

Acceptance Criteria

  • security/sri and content/meta-in-body use one invariant wording regardless of count, matching the (s) form used elsewhere in the rule surface
  • schema/rating-scope does not interpolate the product name into its check message
  • Existing tests for those three rules are updated to the new wording
  • Re-running the identity projection over production item rows leaves no residual split for these three rules

Activity

  1. added
    bug
    rules
    P3
    size: XS
    on Sep 23, 2026
  2. reopened this on Oct 9, 2026
  3. nc9 commented on Oct 9, 2026

    @nc9
    ContributorAuthor

    Reopened: #611 fixed the wording split, but the criterion to re-run the identity projection over production page_findings needs prod DB access and has not been done. Close after that check.

  4. nc9 commented on Oct 10, 2026

    @nc9
    ContributorAuthor

    Ticked the three criteria #611 meets (shipped in v0.0.108): sri.ts:130 and meta-in-body.ts:68 use the (s) wording, rating-scope no longer puts the entity name in its message, and sri.test.ts, meta-in-body.test.ts and schema-rating-scope.test.ts cover it. Left: re-running the identity projection over production item rows, which needs prod DB access.

  5. nc9 commented on Oct 17, 2026

    @nc9
    ContributorAuthor

    Status: the code is shipped. #611, in v0.0.108, gave security/sri and content/meta-in-body their invariant (s) wording and took the entity name out of the schema/rating-scope message, with tests. The one criterion left is re-running the identity projection over production item rows. That stays with Nik, because it needs prod DB access, so the box stays unticked until then.

  6. nc9 commented on Oct 26, 2026

    @nc9
    ContributorAuthor

    Criterion 4 checked against production page_findings (read-only, counts only, open findings last seen in the 10 days before 2026-10-27, current code):

    rule groups (site, rule, check, locator, status) of fresh (non-carried) rows groups with more than one message
    security/sri 851 0
    content/meta-in-body 70 0
    schema/rating-scope 35 1
    • security/sri and content/meta-in-body: every fresh row uses the invariant (s) wording; the old singular/plural wording survives only in carried rows from before fix(rules): one message wording per count, no entity name in rating-scope (#231) #611 (13,894 security/sri rows and 38 content/meta-in-body rows), which heal as their pages are re-audited.
    • schema/rating-scope: no fresh row interpolates the product name any more (0 of 3,469); the 12 carried rows that still do are pre-fix. The one fresh split group is the same locator carrying two messages over time because the rating, the review count or the page-type word (product page / article page) in it changed between audits, which is a content change, not rule instability.

    So the identity projection leaves no residual split from these three rules on fresh rows. Closing.

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

    P3bugrulessize: XS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions