Simplify standalone SourceHunt resume around work-item memoization - #143
Open
auroter wants to merge 1 commit into
Open
Simplify standalone SourceHunt resume around work-item memoization#143auroter wants to merge 1 commit into
auroter wants to merge 1 commit into
Conversation
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.
What this does
Adds
--resume SESSION_IDto standalone legacy SourceHunt runs. A resumed run reuses hunter work that completed successfully, including work that completed with zero findings. Missing, interrupted, or corrupt work runs again.The repository and hunt options must still match the original run, but the model, endpoint, credentials, output format, and later stages such as verification or exploitation can change.
How it works
Resume fits into the existing pipeline as a cache around
WorkItem -> TargetResult; it is not a second workflow.Preprocessing always runs and verifies that the selected source files have not changed. A valid completed rank plan is restored so the same work is scheduled.
HunterPoolgives each file/band/attempt/context combination a deterministic ID and loads an immutable completed result when one exists. Cached findings then go through the normal findings-pool and promotion paths, while verification, exploitation, enrichment, and reporting run normally.The existing spend ledger is reopened so the budget remains a lifetime session cap, and a session lock prevents concurrent writers. Campaign-owned and proof-flow runs keep their existing orchestration and are not supported by this resume path.
Testing
Run the focused and SourceHunt suites:
To test the behavior manually, start a small run and interrupt it after at least one file finishes:
Then repeat the same repository and hunt options with the printed session ID:
The resumed run should log cache reuse for completed files, rerun only unfinished work, preserve existing
work-resultsfiles, and continue from the prior lifetime spend.