Repository navigation
feat(rules): add reliability/js-errors for rendered-page JavaScript errors #704 - #2049
Merged
Merged
Conversation
nc9
force-pushed
the
boat/js-errors-704
branch
from
November 16, 2026 11:55
46a4240 to
cb64edf
Compare
nc9
marked this pull request as ready for review
November 16, 2026 13:11
…ed runtime requests on rendered pages #704 Signed-off-by: Nik Cubrilovic <[email protected]>
…ility/js-errors #704 Signed-off-by: Nik Cubrilovic <[email protected]>
…t-off prefetch reports its coded reason #704 Signed-off-by: Nik Cubrilovic <[email protected]>
… the renderer records no runtime yet #704 Rebased onto main: the CHANGELOG.md bullet moved to changelog.d/704-js-errors.added.md, the canonical golden takes one totals line (reliability/js-errors: 1; score unmoved at 58), and RenderResultItem keeps main's `requests` beside the new `runtime`. Main now requires every new rule to declare meta.checks (the undeclared baseline only shrinks) and findingScope. js-errors declares its five problem checks, the js-errors pass that clears them, and the two skipped names, and is "resource" scoped (one finding per error or failing URL shared across pages). Regenerated the check-names and cloud rules blocks. The live rule count is 358 (floor stays 350). The cloud renderer does not fill RenderResultItem.runtime yet, so the docs page and the changelog entry say the rule is skipped until it does, instead of claiming the renderer keeps listening after load. Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
marked this pull request as draft
November 19, 2026 13:08
nc9
force-pushed
the
boat/js-errors-704
branch
from
November 19, 2026 13:08
e18f47b to
bf12b6d
Compare
…ap, never a pass #704 A page the rule has to judge with no runtime data (the render recorded none, or there is no render result for it) is now the coded skip reason `runtime-not-recorded` (gap, listed as not checked). With no runtime data anywhere the js-errors check is skipped with it; with only some pages measured the rule still reports what it saw and adds a skipped `unchecked-pages` check with that reason instead of a pass plus an info, so a stored site-scope finding is never resolved while part of the site went unseen. A pass needs runtime data from every page judged. A WAF or bot challenge page is still left out and only noted (info), not a gap. The reason is in SKIP_REASON_CLASSES with an exported constant, the predicates table and a Not checked hint in the report. Tests: the whole-site and partial cases (no runtime, no render result, errors beside the gap) and the report listing it under notChecked. The cloud renderer does not record runtime data yet; the docs say that work is tracked privately. Signed-off-by: Nik Cubrilovic <[email protected]>
…unread-page gap #704 When every rendered page was a WAF or bot challenge the rule read nothing, but it returned a free-text skip, which the outcome table reads as "does not apply", so a stored js-errors finding could resolve on such an audit. It now skips with the coded rule-wide gap `unread-page` (coverage gap, not listed as not checked: the audit already carries its own blocked notice). Test: the all-challenge run is skipped with `unread-page` and classifies as coverage_gap. The docs page says so. Signed-off-by: Nik Cubrilovic <[email protected]>
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.
Adds the cloud-only rule reliability/js-errors (site scope, meta.cloud render), the optional RenderResultItem.runtime contract it reads (pageErrors, consoleErrors, failedRequests), docs page, hub, changelog.
Closes #704.
Dependency: nothing fills
runtimeyet. The cloud renderer side (record pageerror, console.error and requestfailed intoruntime, with bounded listening after load, caps, redaction and WAF pages excluded) is tracked in the private squirrelscan/repo#4940. Until it lands the rule is skipped with the coded reasonruntime-not-recordedand listed under Not checked, never a pass. The rule can land inert and honest. Fixtures are hand-built render results, not a live browser.Acceptance criteria
Gates
rules js-errors.test.ts 13 pass; broken-resources.test.ts still passes; audit-engine locked test 2 pass; streaming golden updated (333->334 rules) passes; typecheck rules, core-contracts, audit-engine clean; docs make validate passes.
Agent skill: no change needed.
Rebased onto main (2026-11-20)
changelog.d/704-js-errors.added.md. The entry and the docs page now say the renderer does not record runtime data yet, instead of claiming it keeps listening after load.meta.checks(the undeclared baseline only shrinks) andfindingScope. The rule declares its five problem checks, thejs-errorspass that clears them, the two skipped names, andfindingScope: "resource". It is no longer added torule-checks-undeclared.json.reliability/js-errors: 1).healthScore.overallis unmoved at 58. The live rule count is 358 (the floor stays 350). The check-names and cloud-rules docs blocks were regenerated.make validatein docs passes, and the changelog guard passes.Partial runtime coverage is a coded gap (087d2d4)
runtime-not-recorded(gap, listed as not checked). It is inSKIP_REASON_CLASSESwith an exportedRUNTIME_NOT_RECORDED_SKIP_REASON, in the predicates table, and has a Not checked hint in the report.js-errorscheck is skipped with it.unchecked-pagescheck with that reason instead of a pass plus an info. "Some pages" covers a render with noruntimeblock and a page with no render result. So a stored site-scope finding is never resolved while part of the site went unseen. A pass is emitted only when every page the rule judged carried runtime data.js-errors.test.ts), plus the report listing it undernotChecked(not-checked-runtime-704.test.ts).runtime-not-recordedline inNOT_CHECKED_REASONSinpackages/issuesprompts.ts. The audit-summary-not-checked test goes red without it.test-suites.ts --checkpasses,make validatein docs passes, and the changelog guard passes. oxlint is clean on the changed files except a pre-existingno-control-regexatpackages/report/src/not-checked.ts:191, which was already on main.All-challenge run is an
unread-pagegap (ed99381)unread-pageinstead of a free-text skip (which read as "does not apply"). A stored js-errors finding is no longer resolved by such an audit. It adds no Not checked line, because the audit already carries its own blocked notice. A test asserts the skipReasonunread-pageand outcomecoverage_gap.make validateand oxlint pass.