Repository navigation
fix(rules): skip, not pass, when a work cap cut the hidden-text or dev-leakage scan short #501 - #509
Merged
Merged
Conversation
nc9
marked this pull request as ready for review
October 6, 2026 23:24
…v-leakage scan short #501 A pass is evaluation evidence: the publish resolution signal counted the page as evaluated clean and the merge resolved a prior finding that may sit past the cap. Both rules now skip with skipReason scan-truncated, and the signal registers the check's key for that skip, so the page lands in notEvaluated and its priors carry even when no other page evaluated the check. Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/501-scan-cap-not-pass
branch
from
October 6, 2026 23:24
98e8411 to
3f631fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #501.
Score-adjacent: on a page whose scan a work cap cut short, the rule now skips instead of passing. Skipped checks are left out of the score, so that page leaves the rule's pass denominator on the sampled path.
Cause
content/hidden-textstops its element walk at 20,000 elements and its stylesheet index at 400,000 characters or 4,000 rules.content/dev-leakagestops at 50,000 elements, 2,000href/srcvalues or 500,000 characters of copy. When the part they did read held nothing, both reportedpass.A pass is evaluation evidence.
buildResolutionSignal(packages/rules/src/resolution.ts) counted the page as evaluated clean, so the publish merge resolved a prior finding on it, even though that finding can sit past the cap and still be there.Fix
scanTruncatedis true and nothing was found, both rules emitstatus: "skipped"withskipReason: "scan-truncated"anddetails: { scanTruncated: true, foldKey: "scan-truncated" }. The constant is the newSCAN_TRUNCATED_SKIP_REASONin@squirrelscan/core-contracts/resolution. ThefoldKeykeeps the skip apart from the rules' other skips when checks fold. A page read in full still passes.scan-truncatedskip, with no evaluated page, which puts the page innotEvaluated.docs/rules/content/hidden-text.mdxanddocs/rules/content/dev-leakage.mdxdescribe the new skip, its message, and why it is not a pass.Tests
packages/audit-engine/tests/scan-truncated-carry.test.ts(new) runs the real rules on generated pages and the realbuildResolutionSignalandrunCloudSmartAudits, two publishes to one store. For each rule:skipped,scan-truncated;pass;It also covers hidden-text's stylesheet rule budget, dev-leakage's
hrefvalue cap, and a folded aggregate of the skip (beside ano-bodyskip), whose pages stay not evaluated.Before/after. On
origin/main's rules and builder, 8 of the 12 per-rule tests fail: the rules returnpass, the signal has nonotEvaluatedentry, and the prior resolves. With the rules fixed but the old builder, the two "no other page evaluated the check" tests still fail (the prior resolves). With both changes, all pass.Other results:
rules:hidden-text,content-dev-leakage,resolution,noindex-skip,item-cap-remainder: 200 pass.audit-engine:cloud-merge,item-locator-resolve: 41 pass.tsgo --noEmitin packages/rules, core-contracts and audit-engine: clean.make validateis not run locally (the docs workspace is not installed in this lane); CI runs the docs build.Codex review: no rule-level pass leak; every cap that can end with zero findings reaches the skip. The noindex merge and folding were confirmed. It also raised two limits that are not specific to this rule; I filed them as #508:
notEvaluatedcomplement is exhausted, the merge's fallback resolves;Changelog
content/hidden-textandcontent/dev-leakageno longer pass a page whose scan a work cap cut short. They skip it, so a finding from an earlier audit stays open.