Gates reject on evidence only, any gates are one group, remote is read off the location line
A require gate on an empty column gated the role ("country unknown"), and extract, the stage that fills the column, is bounded to the roles that rank, so 2,281 of 15,556 open roles could never come back: every board that writes "Remote", "Hybrid" or "Distributed" as its location. An empty column now neither passes nor fails a gate; the role ranks, extract reads it, the rescore decides.
`any` is a third gate mode: the any gates are one group a role must match one of, so a ranking can say "in Denmark, or remote", which require alone could not. The group is gated only when some member had evidence against it.
`remote_of(place)` fills `remote` from the location line the way `country_of` fills `country`, and the startup backfill does both, since Greenhouse writes "Hybrid" as the location and gives no flag.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
e602eb3388
commit
fb83ae5099
10 files changed
+143
-28
No files matched your search
+30
-3
@@ -188,6 +188,30 @@ def country_of(place: str) -> str:
|
||||
Remote = Literal["", "remote", "hybrid", "onsite"]
|
||||
REMOTE: tuple[str, ...] = get_args(Remote)
|
||||
|
||||
#: Words in a location line that say how the role is worked, for a board that
|
||||
#: gives no remote flag of its own: Greenhouse writes "Remote", "Hybrid" or
|
||||
#: "Distributed" as the location and nothing else.
|
||||
_REMOTE_WORDS: tuple[tuple[str, str], ...] = (
|
||||
("hybrid", "hybrid"),
|
||||
("remote", "remote"), ("distributed", "remote"), ("home based", "remote"),
|
||||
("home-based", "remote"), ("work from home", "remote"), ("anywhere", "remote"),
|
||||
("worldwide", "remote"), ("telecommute", "remote"),
|
||||
("on-site", "onsite"), ("onsite", "onsite"), ("on site", "onsite"),
|
||||
("in-office", "onsite"), ("in office", "onsite"),
|
||||
)
|
||||
|
||||
|
||||
def remote_of(place: str) -> str:
|
||||
"""How a board's location line says the role is worked, as one of
|
||||
`REMOTE`, or '' when it does not say. "Hybrid" wins over "remote" in the
|
||||
same line ("Remote or hybrid, Berlin" is hybrid: some days in an office),
|
||||
and a line that names only a place is ''."""
|
||||
folded = _fold(place or "")
|
||||
for word, mode in _REMOTE_WORDS:
|
||||
if word in folded:
|
||||
return mode
|
||||
return ""
|
||||
|
||||
Seniority = Literal["", "intern", "junior", "mid", "senior", "staff", "lead", "manager",
|
||||
"director", "exec"]
|
||||
SENIORITIES: tuple[str, ...] = get_args(Seniority)
|
||||
@@ -363,13 +387,16 @@ GateField = Literal["place", "country", "remote", "seniority", "function", "sala
|
||||
"currency", "permit", "languages", "company"]
|
||||
GATE_FIELDS: tuple[str, ...] = get_args(GateField)
|
||||
|
||||
GateMode = Literal["require", "prefer"]
|
||||
GateMode = Literal["require", "any", "prefer"]
|
||||
|
||||
|
||||
class Gate(Model):
|
||||
"""One condition of an agent. `require` gates a role that fails it (the
|
||||
row is kept with the reason); `prefer` adds `weight` to its score when it
|
||||
matches."""
|
||||
row is kept with the reason); the `any` gates together are one group a
|
||||
role must match at least one of ("in Denmark, or remote"); `prefer` adds
|
||||
`weight` to its score when it matches. A gate rejects on evidence only: a
|
||||
role whose column is empty is not rejected, since `extract` fills the
|
||||
column later for the roles that rank, and only for those."""
|
||||
|
||||
field: GateField
|
||||
values: list[str | int | float] = Field(min_length=1)
|
||||
|
||||
Reference in new issue
Block a user