Skip to content

Scraper: cap research at N new topics, not N including seen ones - #53

Merged
jjosef merged 1 commit into
mainfrom
fix/scraper-topic-cap-after-dedupe
Sep 21, 2026
Merged

jjosef merged 1 commit into
mainfrom
fix/scraper-topic-cap-after-dedupe

Conversation

@jjosef

@jjosef jjosef commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #52, found while checking the first dev runs.

The scraper's per-run cap (MAX_TOPICS_PER_RUN) was applied before already-researched topics were filtered out. Search discovery returns ~80-90 names in a stable order, so once the first 8 were researched, later runs skipped them and researched nothing new (dev log: "8 topics, 6 skipped, 2 candidates written").

Now seen topics are filtered first and the run stops once N new topics are queued.

  • The new test fails on the old code and passes with the fix.
  • Scraper tests pass (45).
  • No infra or IAM change.

Dev results for #52 were good: 10 named, high-confidence candidates (Bromethalin, Metaldehyde, Zinc phosphide, ...), no footer junk.

The per-run cap was applied before already-researched topics were filtered
out. Search discovery returns ~80 names in a stable order, so after two
runs the first 8 were all seen and later runs researched nothing new
("8 topics, 6 skipped, 2 candidates written"). Filter seen topics first
and stop once N new ones are queued.
@jjosef
jjosef merged commit 1a69970 into main Sep 21, 2026
2 checks passed
@jjosef
jjosef deleted the fix/scraper-topic-cap-after-dedupe branch September 21, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant