Skip to content

Commit 4fc1e04

Browse files
Merge pull request #59 from StepenkoAnatoli/fix/perquery-ceiling
max_pages was capped at 3 by perQuery, on every dispatched collection
2 parents 5f54d98 + bdc4294 commit 4fc1e04

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎.github/workflows/collect.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,18 @@ jobs:
374374
const plan = JSON.parse(fs.readFileSync("research/plan.json", "utf8"));
375375
plan.topic = topic;
376376
plan.maxScrapes = Number(process.env.MAX_PAGES);
377+
// perQuery is the REAL ceiling on breadth: selectCandidates slices the
378+
// results of each query to it, so one seeded query and a default of 3
379+
// capped every dispatched run at three candidates however large max_pages
380+
// was. Matching it to max_pages is what makes the advertised 1..25 control
381+
// mean what it says. Nothing about SPEND changes - maxScrapes still bounds
382+
// the fetches, and this only widens the list they are chosen from.
383+
plan.perQuery = Number(process.env.MAX_PAGES);
384+
plan.limit = Math.max(Number(process.env.MAX_PAGES), plan.limit ?? 8);
377385
plan.queries = [{ q: topic, why: "the dispatched topic", prefer: [] }];
378386
plan.urls = [];
379387
fs.writeFileSync("research/plan.json", `${JSON.stringify(plan, null, 2)}\n`, "utf8");
380-
console.log(`plan written: 1 query, maxScrapes ${plan.maxScrapes}`);
388+
console.log(`plan written: 1 query, maxScrapes ${plan.maxScrapes}, perQuery ${plan.perQuery}`);
381389
'
382390
383391
- name: seed the map, spending nothing

‎.github/workflows/live-collection.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ jobs:
205205
const p = "research/plan.json";
206206
const plan = JSON.parse(fs.readFileSync(p, "utf8"));
207207
plan.maxScrapes = Number(process.env.MAX_PAGES);
208+
plan.perQuery = Number(process.env.MAX_PAGES);
208209
fs.writeFileSync(p, JSON.stringify(plan, null, 2));
209210
console.log("plan written: maxScrapes " + plan.maxScrapes);
210211
'

0 commit comments

Comments
 (0)