Repository navigation
fix(leads): honour scan_prospects on the discovery path too - #136
Merged
Merged
Conversation
The setting was threaded into the runner's stage-3 research call and nowhere else, so the discovery top-up — the path that sees every newly discovered domain — kept queueing a scan per candidate no matter what the campaign asked for. A campaign with scanning off still scanned everything it found, which is exactly the behaviour the setting exists to prevent. Observable in the audits table: a tick on a scan_prospects=false campaign produced fresh audits of artstation.com, adobe.com and every other domain discovery turned up. The guard asserts every researchProspect call in the runner passes skipScan, and derives it from the campaign rather than hardcoding it. Source-level, because the alternative is standing up the runner with a live database and a scan worker to watch for a call that should not happen. Reverting the fix fails it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
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.
scan_prospectswas threaded into the runner's stage-3 research call and nowhere else. The discovery top-up — the path that sees every newly discovered domain — kept queueing a scan per candidate regardless of the setting.So a campaign with scanning off still scanned everything it found, which is exactly what the setting exists to prevent. #135 fixed the one-shot finder; this is the same bug on the campaign path, and I missed it when adding the setting in #129.
Observable in the
auditstable — a tick on ascan_prospects=falsecampaign produced fresh audits ofartstation.com,adobe.com,elevify.comand friends.Guard
Asserts every
researchProspectcall in the runner passesskipScan, and derives it from the campaign rather than hardcoding it. It also asserts there's more than one call site, so the test can't quietly stop proving anything if the code is refactored.Source-level, because the alternative is standing up the runner against a live database and a scan worker to watch for a call that shouldn't happen. Verified it bites: reverting the fix fails 2 of 3.
Checks
tsc --noEmitclean🤖 Generated with Claude Code