Ask a host that cannot filter on remote for the agents' world where it takes the world in one read, and keep the per-office fold within one country, as ADR 1.2 and 1.4 have it

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-10-06 13:56:01 +02:00
1 parent 0c4f3c9bbe
commit 1976f6a353
4 files changed
+67 -14

No files matched your search

+13 -3
View File
@@ -111,6 +111,12 @@ def same_posting(a: Copy, b: Copy) -> bool:
return not ta or not tb or bool(ta & tb)
def _same_country(a: Copy, b: Copy) -> bool:
"""Whether two rows can be in one country: equal, or either unknown."""
ca, cb = _country(a), _country(b)
return not ca or not cb or ca == cb
def keep_order(c: Copy) -> tuple[bool, bool, bool, str, str]:
"""The sort key that picks the kept copy of a group, smallest first: a
board over a search provider, then one with a description, then the
@@ -193,12 +199,16 @@ def fold(rows: Iterable[Copy]) -> Folded:
Within a `(company_key, title_key)` the kept rows of `assign` are grouped
again, in `keep_order`: a row joins the first group whose members are all
of its host, `similar` to it and remote as it is or not. Only a row with
of its host, in its country (equal, or either unknown, as `same_posting`
reads it), `similar` to it and remote as it is or not. Only a row with
a link can be folded, as its link is what the kept role keeps. Every row
of a merged group points at its first row, the rows that pointed at a
folded one included.
A remote listing and an office listing stay two roles: the kept role
One country, as ADR Fetch prep and score 1.4 has it: a job posted once
per office in several countries is several roles, one per country, which
keeps a different opening with an alike text (a federal sales role in
the US and one in Australia) from merging. A remote listing and an office listing stay two roles: the kept role
takes a copy's places and not its remote, so the fetch gate, which reads
a remote role by its area, would reject the remote listing with an
office role elsewhere, and the office one with a remote role elsewhere."""
@@ -216,7 +226,7 @@ def fold(rows: Iterable[Copy]) -> Folded:
for row in sorted(part, key=keep_order):
for group in groups:
if all(m.host == row.host and m.remote == row.remote
and similar(m.text, row.text) for m in group):
and _same_country(m, row) and similar(m.text, row.text) for m in group):
group.append(row)
break
else: