You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
-max-duration time budget with graceful partial stop #190
The only scan budget is -max-queries. Scheduled CI runs can bound time only with the job's timeout-minutes, which kills the process and loses the report and verdict the Action depends on.
action.yml:159-199 (the Action errors when run.json is missing after a kill)
Proposal
Add -max-duration 20m. Reuse the -max-queries stop path: remaining candidates are counted as skipped_by_cap, the verdict becomes degraded with reason "time budget", the report gains stopped_by: "duration". Add a max-duration input to the Action and MaxDuration to pkg/subenum.Config.
Who benefits
Action and CI users get a report every run; -dL users can bound a whole batch.
Open questions
Whether the budget is per target or per run under -dL (suggest per run, with the per-target remainder reported)
Acceptance criteria
Scan stops cleanly at the deadline with one EventDone, a report and the degraded verdict
-max-duration <d> (e.g. 20m): once the budget runs out no new names are tested, lookups already under way finish, and the run ends normally with one done event, results, the -stats report and a degraded verdict ("time budget (-max-duration) reached; N candidates not tested"). The report adds stopped_by: "duration" (and "queries" for -max-queries); untested names are in skipped_by_cap.
Open question resolved as suggested: under -dL the budget covers the whole run, and each target reports what it skipped. It is not a resume setting, so each invocation gets its own budget.
Action: new max-duration input, documented in docs/monitoring.md. Library: Config.MaxDuration and Stats.Expired.
Verified: new tests TestRunDeadlineStopsAdmission (engine, budget already past and running out mid-scan, one EventDone), TestE2EMaxDuration (CLI report and verdict, negative value is a usage error) and TestMaxDuration (library). Full suite, lint and -race -shuffle=on on the touched packages pass.
Note: with -rate, a lookup that already started may still wait on the rate limiter, so the overrun past the budget is at most about -t / -rate seconds.
Activity
TMHSDigital commentedon Nov 9, 2026
Implemented in 26a6179.
-max-duration <d>(e.g.20m): once the budget runs out no new names are tested, lookups already under way finish, and the run ends normally with one done event, results, the-statsreport and adegradedverdict ("time budget (-max-duration) reached; N candidates not tested"). The report addsstopped_by: "duration"(and"queries"for-max-queries); untested names are inskipped_by_cap.-dLthe budget covers the whole run, and each target reports what it skipped. It is not a resume setting, so each invocation gets its own budget.max-durationinput, documented indocs/monitoring.md. Library:Config.MaxDurationandStats.Expired.Verified: new tests
TestRunDeadlineStopsAdmission(engine, budget already past and running out mid-scan, oneEventDone),TestE2EMaxDuration(CLI report and verdict, negative value is a usage error) andTestMaxDuration(library). Full suite, lint and-race -shuffle=onon the touched packages pass.Note: with
-rate, a lookup that already started may still wait on the rate limiter, so the overrun past the budget is at most about-t / -rateseconds.