Skip to content

Commit 30442d5

Browse files
TMHSDigitalclaude
andcommitted
Say "stopped run" in resume messages, not "interrupt" (#341)
Since #294 a run stopped by -max-duration or the reliability guard can be resumed too, but the resume messages still called it "the interrupted run" or said what happened "before the interrupt". The seven user-facing messages now say "the stopped run" and "before the run stopped"; two tests that match the text follow. The other two parts of #341 (excluded candidates counted twice and processed above the total after a resume) are left open. Refs #341 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 95b1bac commit 30442d5

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎internal/cli/permute.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func runPermutationPass(ctx context.Context, s *session, p permuteInput) *permut
128128
if prev := p.prev; prev != nil {
129129
left, ok := remainingBudget(s.f.maxQueries, prev.Processed)
130130
if !ok {
131-
out.Info("Permutation pass for %s: the -max-queries budget of %d was spent before the interrupt", target, s.f.maxQueries)
131+
out.Info("Permutation pass for %s: the -max-queries budget of %d was spent before the run stopped", target, s.f.maxQueries)
132132
res.pass = targetResult{done: true, final: prev.event()}
133133
return res
134134
}

‎internal/cli/resume.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (st *resumeState) checkSettings(fs *flag.FlagSet, d *defaultsLoader) error
182182
sort.Strings(names)
183183
for _, name := range names {
184184
if v, ok := now[name]; ok && v != st.Settings[name] {
185-
return fmt.Errorf("-%s is %q now but was %q in the interrupted run (now set by %s); start a new scan instead of resuming", name, v, st.Settings[name], d.describe(fs, name))
185+
return fmt.Errorf("-%s is %q now but was %q in the stopped run (now set by %s); start a new scan instead of resuming", name, v, st.Settings[name], d.describe(fs, name))
186186
}
187187
}
188188
return nil
@@ -323,7 +323,7 @@ func (st *resumeState) checkInputs(f cliFlags) error {
323323
}
324324
for path, want := range st.Inputs {
325325
if now[path] != want {
326-
return fmt.Errorf("%s changed since the interrupted run; start a new scan instead of resuming", path)
326+
return fmt.Errorf("%s changed since the stopped run; start a new scan instead of resuming", path)
327327
}
328328
}
329329
return nil

‎internal/cli/resume_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ func TestE2EResumeRefusesBadState(t *testing.T) {
594594
t.Fatal(err)
595595
}
596596
for _, tc := range []struct{ path, want string }{
597-
{changed, "changed since the interrupted run"},
597+
{changed, "changed since the stopped run"},
598598
{corrupt, "-resume " + corrupt + ":"},
599599
{future, "unsupported state version 999"},
600600
{filepath.Join(dir, "missing.json"), "reading -resume state"},

‎internal/cli/session.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ func (s *session) loadInputs() bool {
420420
out.Error("cannot resume: %v", err)
421421
return false
422422
}
423-
out.Info("Resuming the interrupted run of: subenum %s", strings.Join(s.args, " "))
423+
out.Info("Resuming the stopped run of: subenum %s", strings.Join(s.args, " "))
424424
}
425425
// Normalized once, while it is read, for every target; per target only
426426
// the name-length limit differs (#182, #248).
@@ -440,7 +440,7 @@ func (s *session) loadInputs() bool {
440440
for _, target := range s.targets {
441441
if t := s.resume.target(target); t != nil && !t.Done && t.Entries != "" {
442442
if entries, _, _ := s.words.For(target); entryDigest(entries) != t.Entries {
443-
out.Error("cannot resume: the wordlist for %s changed since the interrupted run (a different -w file or subenum version); start a new scan instead", target)
443+
out.Error("cannot resume: the wordlist for %s changed since the stopped run (a different -w file or subenum version); start a new scan instead", target)
444444
return false
445445
}
446446
}
@@ -698,7 +698,7 @@ func (s *session) scanOneTarget(ctx context.Context, i int, target string) (next
698698
if saved != nil {
699699
mainSaved, restoredHits = s.restoreTarget(saved)
700700
if saved.Done {
701-
out.Info("%s was finished before the interrupt; %d results restored", target, len(saved.Results))
701+
out.Info("%s was finished before the run stopped; %d results restored", target, len(saved.Results))
702702
// The report keeps what the finished run found (#315).
703703
res := targetResult{done: true, final: mainSaved.event(), sources: sourceInfo, axfr: axfrInfo, foundBy: s.foundBy}
704704
if s.f.permute {
@@ -763,7 +763,7 @@ func (s *session) mainPass(ctx context.Context, p scanPass, saved *resumePass) t
763763
if saved != nil {
764764
left, ok := remainingBudget(s.f.maxQueries, saved.Processed)
765765
if !ok {
766-
s.out.Info("%s: the -max-queries budget of %d was spent before the interrupt", p.domain, s.f.maxQueries)
766+
s.out.Info("%s: the -max-queries budget of %d was spent before the run stopped", p.domain, s.f.maxQueries)
767767
return targetResult{done: true, final: saved.event()}
768768
}
769769
p.maxQueries = left

‎internal/cli/session_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func TestE2EResumeSkipsFinishedTarget(t *testing.T) {
6363
t.Errorf("results = %v, want each of %v once", seen, want)
6464
}
6565
for _, msg := range []string{
66-
"a.example was finished before the interrupt; 3 results restored",
66+
"a.example was finished before the run stopped; 3 results restored",
6767
fmt.Sprintf("Resuming b.example at wordlist entry 2 of %d (2 results restored)", len(entries)),
6868
} {
6969
if !strings.Contains(stderr, msg) {

0 commit comments

Comments
 (0)