Send fetch terms to every big board whose host takes one query, and on a series overflow let a narrow read keep its places and drop the terms

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Sonnet 5.5 committed 2026-10-04 14:50:33 +02:00
1 parent 060ccf66e6
commit 5fe5a31747
6 files changed
+159 -62

No files matched your search

+33 -28
View File
@@ -35,21 +35,22 @@ A reach of more countries than a `one`-filter host should be asked one by
one (the wide reach's Europe on SmartRecruiters) is dropped by `ask_for`,
which knows the reader (`MAX_SERIES`), so such a board is read whole.
**Fetch terms** (`Agent.fetch_terms`) narrow a wide read by words, so a big
**Fetch terms** (`Agent.fetch_terms`) narrow a read by words, so a big
board sends the roles that match one of them rather than every role:
- The terms of a pull are the union over the enabled agents. An enabled
agent with none wants every role, so then there are none.
- They go only with the wide reach: a company set to All countries (`wide`
in the reach), and a board whose reach `ask_for` drops as too many
countries for a `one` host. The narrow reach (DK, SE) already leaves at
most about 150 roles on any big board, and small, unknown and overridden
- They go to every company board of `SMALL` roles or more whose reach reason
is `agents` or `countries`, on the narrow reach (DK, SE) as on the wide
one, if its reader declares `query="one"`. Small, unknown and overridden
boards get no reach at all, so none of those take terms.
- A company set to All roles (`companies.all_roles`, global) takes none on
any of its boards, and no later role filter (category, level) either. It
changes nothing on the narrow reach today, which takes no terms.
any of its boards: no fetch terms and no titles to leave out (the scoring
side is in `app/jobs/score.py`).
- Only a reader that declares `query="one"` takes them, one series a term;
`ask_for` has the rule for terms times the reach's series.
`ask_for` has the rule for terms times the reach's series. Over the cap, a
wide read keeps the terms and drops the places, a narrow read keeps the
places and drops the terms.
- A read with terms is never the whole board: the pull closes nothing
against it (`app/jobs/pull.py`).
- The search providers take none. Every saved search has a query of its
@@ -254,7 +255,7 @@ def _continent(codes: Iterable[str], gaz: places.Gazetteer) -> str:
class Plan:
"""The reach of one pull: `base` for every board, `wide` for the boards
of the companies in `all_countries`, each board's size by target, the
fetch `terms` of the wide reads, which skip the companies in
fetch `terms` of the big boards, which skip the companies in
`all_roles`, `wide_names`, what the agents call the wide reach, and
`facets`, the host ids the runner keeps for a board on a host that
filters by them, for the Companies line."""
@@ -294,10 +295,10 @@ class Plan:
def for_subscription(self, sub: Subscription) -> dict[str, Any] | None:
"""The `reach` a board's batch hands `ask_for`; None for none. With
fetch terms, and unless its company is set to All roles, a board on
the wide reach carries them and `wide`, and a board on the agents'
reach carries them for `ask_for` to use if it drops the countries as
too many (see the module docstring). A board with no size carries
fetch terms, and unless its company is set to All roles, a big board
carries them, and `wide` when its company is set to All countries, for
`ask_for` to decide which side gives way over `MAX_SERIES` (see the
module docstring). A board with no size carries
`unsized` and `small`, and the reach of a big board unless its params
set their own, for its batch to size it first."""
found, why = self.why(sub)
@@ -437,8 +438,8 @@ def _site(module: Any, ask: readers.Ask, facets: Mapping[str, Mapping[str, str]]
def _roles(ask: readers.Ask) -> str:
"""The role-type half of the line: the agents' terms the board is
asked for, or all roles."""
"""The role half of the line: the agents' terms the board is asked for,
or all roles."""
if not ask.terms:
return "all roles"
terms = ", ".join(ask.terms) if len(ask.terms) <= 5 else f"{len(ask.terms)} terms"
@@ -448,18 +449,21 @@ def _roles(ask: readers.Ask) -> str:
def line(found: Plan, sub: Subscription) -> str:
"""What a pull asks `sub`'s board for, once its reader has narrowed the
reach, in plain words, countries first and role types second:
"follows agents: DK, SE, remote · all roles", "all countries (Europe) ·
follows agents' terms: engineer, product, data", "all countries (Europe)
· all roles", "set here: DE · all roles", "all places, too many countries
to ask · follows agents' terms: engineer", or, for a board read whole,
why: "under 300 roles: read whole", "Greenhouse cannot filter: read
whole". A board with no size yet says it is sized on the next pull. On
a host that filters by its own ids, the line names what the site does
not know once the runner has asked it (`_site`): "follows agents: DK ·
SE not on this site · no remote option · all roles", or "site lists
none of DK, SE: nothing asked, not closing", or, on a host with no remote
filter while the agents want remote, "follows agents: DK, SE · remote not
asked on SmartRecruiters · all roles"."""
"follows agents: DK, SE, remote · follows agents' terms: engineer,
product", "follows agents: DK, SE, remote · all roles" (a company set to
All roles, or a reader without a query, or terms over `MAX_SERIES`),
"all countries (Europe) · follows agents' terms: engineer, product,
data", "all countries (Europe) · all roles", "set here: DE · all roles",
"all places, too many countries to ask · follows agents' terms:
engineer", or, for a board read whole, why: "under 300 roles: read
whole", "Greenhouse cannot filter: read whole". A board with no size yet
says it is sized on the next pull. On a host that filters by its own ids,
the line names what the site does not know once the runner has asked it
(`_site`): "follows agents: DK · SE not on this site · no remote option ·
all roles", or "site lists none of DK, SE: nothing asked, not closing",
or, on a host with no remote filter while the agents want remote,
"follows agents: DK, SE · remote not asked on SmartRecruiters · all
roles"."""
module = readers.HOSTS.get(sub.target.partition(":")[0])
if module is None:
return ""
@@ -487,7 +491,8 @@ def line(found: Plan, sub: Subscription) -> str:
return f"follows agents: {_places(ask)}{unasked} · {roles}"
if ask.terms:
if given.everywhere:
return f"all countries (everywhere) · {roles}"
what = "all countries (everywhere)" if why == "countries" else _WHOLE[why]
return f"{what} · {roles}"
return f"all places, too many countries to ask · {roles}"
if why in ("agents", "countries") and given.everywhere:
return f"{_WHOLE[why]}: read whole"