Repository navigation
Conversation
… requested but stored no page for #1396 Signed-off-by: Nik Cubrilovic <[email protected]>
Signed-off-by: Nik Cubrilovic <[email protected]>
…query string, token or response text #1396 Signed-off-by: Nik Cubrilovic <[email protected]>
… typed reasons, anchored classifier, errors before skips under the cap, carried checks are not executed rules #1396 Signed-off-by: Nik Cubrilovic <[email protected]>
… unstored cap; changelog clause on carried findings #1396 Signed-off-by: Nik Cubrilovic <[email protected]>
Merged
Contributor
Author
|
Landed in v0.0.156 as nik |
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 #1396.
What
executedRules(JSON report,meta.schemaVersion1.5): the sorted ids of the rules that produced at least one non-skipped check on this audit. A rule whose checks were all skipped (a scan limit, a missing probe, an internal error) or that was disabled is not listed, so every rule inissues,passedRulesandskippedChecksthat ran is in it. Bounded by the rule catalog. Omitted when no rule produced a check, and on a report read back withsquirrel report --input(no rule results), which the docs say, likepassedRules.--include-pagesrows for URLs with no stored page: the crawl's frontier entries that failed (a connection error, a rate limit with no stored response, an HTTP error with no stored response) or were skipped (excluded, out of scope, robots.txt, URL too long) and have no stored page are listed after the crawled pages withstatus0,ruleCount0,outcomeerrororskippedand areason(rate-limited,excluded,not-included,other-site,robots-disallowed,url-too-long, or, for a failed request, a short code:http-<status>,timeout,dns,tls,connection-refused,connection-reset,too-many-redirects,off-site-redirect,unreadable-body,request-failed). They count towardpagesTotaland the 2,000-entry cap; unstored rows are loaded up to the cap andpagesTotalcarries the real count.outcomegainsskipped.How
packages/report:collectExecutedRules,unstoredPageRow, rowreason,pagesTotaloverride.packages/crawler:getUnstoredFrontierEntries(crawlId, limit)(frontier failed/skipped with no row inpages, oldest first, plus the true total; read-only SQL, no schema change).apps/cli:reconstructReportreads them only for--include-pages(andsquirrel report --include-pages);generateJsonReportappends the rows.Tests
executed-rules-1396.test.ts(report, 16 with the schema test): fully skipped, empty and mixed rules; every issue and passed rule is executed; rows carry outcome and reason;pagesTotalis the real count under the cap; reason mapping, bounded and cleaned.unstored-frontier-1396.test.ts(crawler, 2): failed and skipped with no page, oldest first, true total, a stored page not listed, another crawl not listed.reconstruct-page-rule-counts-1260.test.ts(CLI, 5 + 3): an errored fetch, a rate-limited request with no stored response, an excluded URL and a robots-blocked URL are listed; a default report does not read them; the JSON report lists them after the crawled pages andexecutedRulesomits a fully skipped rule.audit-unstored-pages-1396-e2e.test.ts(CLI e2e, 2): a realsquirrel audit --include-pagesagainst a raw local server (one path drops the connection, one is excluded insquirrel.toml, one is robots-disallowed): the three rows carry the right outcome and reason, crawled pages come first,pagesTotalcounts every row; without the flag nothing is listed andexecutedRulesis sorted and covers every issue. Existing include-pages e2e updated to schema 1.5.tsgoon core-contracts, report, crawler and cli; cliformat:checkandlint; docsmake validate.Docs and skill
docs/configuration/output.mdx(schema 1.5 text,executedRules, the unstored rows),docs/cli/audit.mdxanddocs/cli/report.mdx(the pages-list sections). CHANGELOG bullet under Added. Skill change: none (the agent skill does not describe the JSON report fields).Not covered: the cloud publish path does not call
reconstructReportwith--include-pages, so published reports are unchanged.nik
Review item: what
reasoncan carryThe crawl's error text can hold a URL (an off-site redirect target with its query), a host, an address or the start of a response body, so a failed request's
reasonis never that text:unstoredPageRowmaps it onto the fixed codes above (a skipped entry's reason is a code from the crawl's own set, anything else isskipped). The testthe reason carries no URL, query string, token, address or response textfeeds redirect targets with tokens and fragments, userinfo URLs, an HTTP error with a body naming a password and an address, a JSON error naming an API key, and control and bidi characters, and requires the reason to match^[a-z0-9-]{1,40}$and to contain none of them. The row's ownurlis the URL the crawl requested, as in the crawled rows (the docs already say a URL carrying credentials appears as stored).Review round 2
Server error: 500ishttp-500,Request blocked by serverisblocked; the crawl's own messages (rate limit, off-site redirect, decode, TLS, timeout) are matched at their start, and for a transport error's free text URLs are removed first, so a path such as/timeoutor/sslcannot name a cause (a decode error for.../timeoutisunreadable-body).UnstoredPageReasonis a literal union (UNSTORED_PAGE_REASONSplushttp-<n>) onUnstoredPageandJsonPageRow;skippedis the documented fallback for a skip with an unknown reason; the deadinvalid_urlmapping is gone.urlis cut at 2,048 characters (aurl-too-longrow).executedRulesin a smart audit: a check carried over from an earlier audit (provenance: "carried") no longer makes a rule executed; the docs say "in this audit".pagesTotalwithunstoredPagesTotalbeyond the rows loaded, a failing read that leaves the rows out without failing the report, carried-only rules.Round 3
Blocked by <provider> challenge (403)now maps toblocked(test with the real WAF wording); spy test pins the cap passed to getUnstoredFrontierEntries (mutation to 1,000,000 fails it); CHANGELOG clause that a smart-audit carried finding does not make a rule executed. Skill change: none.