Repository navigation
Conversation
4 tasks done
Contributor
Author
|
Follow-up for the known limit (hung request in the pre-page-rule stage): #1327 |
This was referenced Oct 30, 2026
Contributor
Author
|
Follow-up for the single-large-page overrun (parse blocks the event loop in the crawl and in the rules phase): #1332 |
nc9
force-pushed
the
feat/max-duration-1271
branch
2 times, most recently
from
October 30, 2026 07:18
8bf17de to
4a133bd
Compare
…es a partial report #1271 Signed-off-by: Nik Cubrilovic <[email protected]>
…overy, 7-day ceiling, MCP maxDuration #1271 Signed-off-by: Nik Cubrilovic <[email protected]>
…nfig and degraded-note tests #1271 Signed-off-by: Nik Cubrilovic <[email protected]>
…probe in budget, timeout class, resource checks named, redacted unreachable #1271 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
feat/max-duration-1271
branch
2 times, most recently
from
October 30, 2026 10:03
7d8a457 to
27dc982
Compare
…1271 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
feat/max-duration-1271
branch
from
October 30, 2026 10:04
27dc982 to
babb42e
Compare
Contributor
Author
|
Landed in v0.0.144 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.
Fixes #1271
squirrel audit --max-duration <seconds>(and[crawler] max_duration): a wall-clock budget for the whole audit. Contract from the decision on the issue: statuspartial, reason codemax_duration, count of unfetched pages; stop launching new work at the budget, finish in-flight pages, exit within max(10% of the budget, 15 s); unset means no limit.What happens at the limit
crawler.stop()(idle workers exit, in-flight fetches get the crawler's 5 s grace). A budget reached with zero pages stored fails with a clear message (exit 1).resourceCheckBudgetMsand the external-linkbudgetMs, both existing engine knobs. The signed-in cloud prefetch is skipped when no budget is left.deadlineAtonstreamPageRules/runStreamingRules(40% of the margin): no further page starts its rules, the pass ends cleanly,pagesNotEvaluatedis returned.Effect.timeoutOption); the page results already went to the store batch by batch, so the report is written from the store.status: "partial",statusReasonCode: "max_duration",maxDuration: { seconds, unfetchedPages, pagesNotEvaluated, siteChecksCut }. Only when the budget actually cut something and the run was not already failed/blocked/partial. Persisted inscanScope.maxDuration, sosquirrel reportandreport --inputrestore it.scanScope.stopReason = "time"is set too (the existing partial-scan hint fires).--fail-ongate still decides). No new code, so nothing collides with fix(cli): offline level snapshot reports what ran; unreachable start URL writes a report, exit 5 #1275 #1269 #1297 (unreachable, exit 5) or feat(cli): audit where a start URL redirects, with consent for another site (#1281) #1282 (exit 4redirected);partialalready exists inAuditStatus.statusReasonCodewidened toAuditStatusReasonCode = AuditFailureReasonCode | "max_duration";max_durationis deliberately not a failure class, soclassifyAuditFailureReasonTextand the failure notices are untouched.Known limit (said in the docs)
If a request made BEFORE the page-rule loop (the site-fetch stage: soft-404 and internal-link probes) is hanging when the hard stop comes, the whole rules phase is cut: site-wide checks and, in that case, the page checks too are missing (
siteChecksCut: true). The e2e fixture hits exactly this (one URL never answers). Making that stage deadline-aware is a deeper engine change; happy to file a follow-up.Tests
apps/cli/tests/cli/audit-max-duration-e2e.test.ts: the real CLI against a local site whose pages are slow and one URL never answers: partial report in JSON and text, exit 0, elapsed inside budget + 15 s; a budget that is never reached changes nothing;0,-5,abc,1e3, empty are rejected with exit 1.apps/cli/tests/audit/max-duration.test.ts: margin math, deadline order, flag parser, reason sentence, saved-JSON round trip (and a malformedmaxDurationdropped).packages/audit-engine/tests/streaming-page-rules-deadline-1271.test.ts: no deadline, past deadline, deadline passing mid-run.packages/report/tests/max-duration-partial-1271.test.ts: JSON, text, markdown and llm.make validateindocs/.scripts/test-suites.ts), a signed-in or cloud-prefetch run with a budget, a large-site run where the report build itself is slow. Local Bun is 1.4.3, not the pinned 1.4.0.Docs:
docs/cli/audit.mdx(flag row, "Time limit" section with the margin, exit codes),docs/configuration/crawler.mdx,docs/configuration/output.mdx. Completions: bash, zsh, fish. Skill: needs a short note (agents should readstatusandmaxDurationof a partial report); private issue filed.Review round (fa39fec)
discoveryDeadlineAtcrawler option (30% of the budget) cuts the root-probe preamble and the sitemap walk; the reviewer fixture with hung robots, sitemaps and llms.txt now completes 40 pages in 14 s at a 10 s budget (was 67 s and exit 1).maxDurationStartedAt) and the reachability probe is cut to what is left; a black-hole seed at a 10 s budget fails at 11 s with "the time limit (--max-duration) was reached before the site answered" (was 31 s). Docs sentence fixed.hugefixture at 15 s: crawl 13.5 s, rules 37.6 s, 53 s wall. The time is one synchronous parse and rule run on the huge page, whichtimeoutOptioncannot preempt. Not fixed; documented under "Limits" (the margin covers waiting, not computation). A size cap for budgeted runs would silently skip real pages, so I left it as a decision for you.[crawler] max_durationare capped at 604800 s (7 days) with a clear error;createDurationBudgetclamps defensively.audit_websitetakesmaxDuration(same cap), documented indocs/cli/mcp.mdx, with a test.--max-durationrun that cuts the resource checks stores the engine'scrawl/asset-fetch-degradedinfo note; the CLI no longer prints "Rule not found in registry" for it.statusReasonCode/maxDurationto zod stripping; needs the private change at the gitlink bump (not filed yet, say if you want an issue).Delta review round (rebased onto v0.0.143)
stop()called before the crawl loop existed was lost when the run setisRunning = true. A seed that sends headers and then a never-ending body now exits at the budget plus the seed probes (budget 8: exit 1 at 10 s, "no pages collected"; it hung to the watchdog before).detectRedirects(url, { deadlineAt })): budget 3 exits at 4 s (was 10 s).timeout; both unreachable paths useredactUrl/redactUrlsInText(the merge kept chore(release): v0.0.143 #1341's redaction); a real-CLI test withuser:pass@host/?token=#fragasserts none of it appears in output for the budget and the non-budget case.maxDuration.resourceChecksCutand the reason sentence (real-CLI test with 60 slow stylesheets). XML and HTML carry the coverage notice only; the docs say so.auditableUrlgate plusstartedAt; completion keeps--no-store-scriptsand adds--max-durationto bash, zsh and fish.--include-info(feat(report): infoChecks in json and llm; rule-timed-out in skippedChecks #669 #518 #1344) is not on main yet, so the union is yours at that merge.