Skip to content

audit --max-duration: a whole-audit time budget that writes a partial report instead of being killed #1271

Closed

Description

@nc9

squirrel audit has no overall wall-clock budget. [rules] time_budget_ms bounds one rule on one page, but nothing bounds the whole audit. A slow or throttling site (adaptive backoff from #1829 working as intended) can keep a 30-page audit running for 5+ minutes.

Batch and CI callers have to wrap the CLI in an external timeout and kill it. A killed audit writes nothing, so every page already crawled and every rule already evaluated is lost.

Seen in a 656-site batch on v0.0.140 with a 240 s external timeout: 2 audits were killed (exit 143) with no report. A throttled site that was re-run alone finished after 322 s with 19 of 30 pages.

Acceptance Criteria

  • squirrel audit --max-duration <secs> (and a matching squirrel.toml key) stops discovery and fetching when the budget is reached, then evaluates rules on the pages already fetched and writes the report as usual.
  • A report cut short by the budget has status: "partial" with a reason code that names the budget, and lists how many discovered pages were not fetched.
  • Rule evaluation after the cut-off is bounded too, so the process exits within a stated margin of the budget, and the docs give that margin.
  • Unset means today's behaviour, with no budget.
  • Docs (CLI audit reference and configuration) and shell completions are updated in the same PR.

Activity

  1. added
    enhancement
    on Oct 29, 2026
  2. added theissue type on Oct 29, 2026
  3. added
    size: M
    on Oct 29, 2026
  4. nc9 commented on Oct 30, 2026

    @nc9
    ContributorAuthor

    Decision (Nik, 2026-10-29): the cut-off contract is report status partial, reason code max_duration, and a count of unfetched pages. The audit stops launching new work at the budget, finishes in-flight pages, and exits within a margin of max(10% of the budget, 15 s). Documented in the audit reference and exit codes. No budget set means no limit (today's behaviour). Queued with the CLI audit-controls group (#1260, #1258).

  5. nc9 commented on Oct 30, 2026

    @nc9
    ContributorAuthor

    Shipped in v0.0.144 (commits 58aa113, 6f0715e, 9988f02, cee2780). Checked every acceptance criterion against current main: --max-duration writes a partial report at the wall-clock budget.

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clienhancementsize: M

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions