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:
1 parent
060ccf66e6
commit
5fe5a31747
6 files changed
+159
-62
No files matched your search
+18
-14
@@ -391,16 +391,18 @@ def ask_for(module: ModuleType, subscription_params: Mapping[str, Any] | None =
|
||||
A remote the reader cannot filter on is dropped here; `remote_wanted`
|
||||
still says it was wanted.
|
||||
|
||||
Fetch terms (`reach["terms"]`) go only to a board reader that declares
|
||||
`query="one"`, and only on a wide read: `reach["wide"]` (a company set
|
||||
to All countries), or a reach this rule just dropped as too many
|
||||
countries. A company set to All roles gets no terms in its reach (see
|
||||
`app/jobs/reach.py`), and a board whose params name a query of their
|
||||
own takes none. Terms times the reach's series (`_cost`) may cost
|
||||
at most `MAX_SERIES`: over it, the place part of the reach goes first,
|
||||
whole, since remote without its countries would read only the remote
|
||||
roles; over it with terms alone, the terms go too and the board is read
|
||||
unfiltered."""
|
||||
Fetch terms (`reach["terms"]`) go to a board reader that declares
|
||||
`query="one"`, on the wide and the narrow read alike. A company set to All
|
||||
roles, and a board that is small, unknown or overridden, gets no terms in
|
||||
its reach (see `app/jobs/reach.py`), and a board whose params name a query
|
||||
of their own takes none. Terms times the reach's series (`_cost`) may cost
|
||||
at most `MAX_SERIES`. Over it, a wide read (`reach["wide"]`, a company set
|
||||
to All countries, or a reach this rule just dropped as too many
|
||||
countries) drops the place part, whole, since remote without its
|
||||
countries would read only the remote roles, and keeps the terms. A narrow
|
||||
read keeps the places, which the agent's fetch gate needs, and drops the
|
||||
terms, so it is not `narrowed`. Terms alone over it are dropped on either
|
||||
and the board is read unfiltered."""
|
||||
reads: Reads = module.READS
|
||||
params = dict(subscription_params or {})
|
||||
given = reach or {}
|
||||
@@ -408,12 +410,14 @@ def ask_for(module: ModuleType, subscription_params: Mapping[str, Any] | None =
|
||||
declared_now = reads.filters.declared()
|
||||
wanted = {name: value for name, value in wanted.items() if name in declared_now}
|
||||
terms = _terms(given.get("terms"))
|
||||
if (not wide or reads.scope != "board" or reads.filters.query != "one"
|
||||
or "query" in wanted):
|
||||
if reads.scope != "board" or reads.filters.query != "one" or "query" in wanted:
|
||||
terms = ()
|
||||
if terms and len(terms) * _cost(reads, wanted) > MAX_SERIES:
|
||||
wanted = {name: value for name, value in wanted.items()
|
||||
if name not in ("country", "place", "remote")}
|
||||
if wide:
|
||||
wanted = {name: value for name, value in wanted.items()
|
||||
if name not in ("country", "place", "remote")}
|
||||
else:
|
||||
terms = ()
|
||||
if len(terms) > MAX_SERIES:
|
||||
terms = ()
|
||||
fields: dict[str, Any] = {_ASK_FIELD[name]: value for name, value in wanted.items()}
|
||||
|
||||
Reference in new issue
Block a user