Skip to content

fix(rules): integrity controlsUnread counts a control once however many bounds it hit #1491 - #1525

Closed
nc9 wants to merge 3 commits into
mainfrom
fix/1491-unread-once
Closed

nc9 wants to merge 3 commits into
mainfrom
fix/1491-unread-once

Conversation

@nc9

@nc9 nc9 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1491.

controlsUnread counted a control once when its attribute windows were cut and again when its text read was cut, so a control that hit both (an attribute over 16,000 characters with more cue windows than the cap, and a text read past the visit allowance) was counted twice. Each control now counts at most once, through one set of control indexes shared by the attribute bounds, the window caps and the text read. Controls cut by the prepared-controls cap or the logo-alt cap are still counted; templates past the limit stay in templatesUnread.

Acceptance criteria

  • details.controlsUnread counts each control at most once (a control over the attribute bound, the window cap and the text read: 1; three of them: 3)
  • a control that hits both the attribute bound and a window cap is counted once, with a test
  • the count still includes controls cut by the prepared-controls cap (60,500 decoys: exactly 500), the logo-alt cap (templates stay in templatesUnread)

integrity-unread-once-1491.test.ts (11 cases, with killer cases for the constant, even-index, position and rank >= 2 mutants); 4 of the first 8 fail on main's controls.ts (the three-control, finding-count, mixed-cause and mixed-rank cases), checked by running the file against origin/main's source. Docs state the once-per-control rule.

Skill change: none.

nc9 added 3 commits November 2, 2026 08:53
…s; docs say templates stay in templatesUnread #1491

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9 nc9 mentioned this pull request Nov 2, 2026
@nc9

nc9 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Landed in v0.0.159 as e0a5f4ff, 5004bdc2, bd23811c via #1531 (the commits were re-created by the rebase-merge; matched by their cherry-pick trailers). Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.159

nik

@nc9 nc9 closed this Nov 2, 2026
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.

integrity/brand-impersonation: controlsUnread can count one control twice

1 participant