Lead a role in several cities with the one nearest the viewing agent, in the row, the reader and the posting link

Places are ordered in tiers off the agent's gates (the any group, then the require scope, then the rest), and within a tier by the home the any group gives, since the gazetteer holds no coordinates. GET /api/roles and /api/roles/{uid} carry place_texts, lead_place and lead_url for the roles served; the gates and the dupes rule are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-10-04 08:15:26 +02:00
1 parent ac4cdb8a48
commit fb24c8e4c9
8 files changed
+277 -29

No files matched your search

+3 -1
View File
@@ -118,7 +118,9 @@ What was decided for roledesk and the one reason for each. The longer reasoning
**The agents set the reach of a pull.** `app/jobs/reach.py` computes it once per pull: the union of the enabled agents' `any` gates on country, town (as its country) and remote, or everything when one agent has none. Fetching has two filters, countries and role types, and a company has an override for each. A company set to **All countries** (`companies.all_countries`, migration 24) is read with the wide reach: the union of the enabled agents' `require` reach, Europe today, and the union of the `any` gates, so the override never reads less than the board would without it. An agent with no `require` gate on place makes the wide reach everywhere. For a company the owner cares about, a role in Freiburg may be open to remote, or worth asking about for Denmark, while Microsoft Germany is not wanted. The overrides are separate from favourite and liked, and global rather than per agent, because they decide what is fetched and fetching is shared. They matter only for a board of 300 roles or more on a host that filters, so a small company is affected once it grows past that. The Companies list states both halves per board, e.g. "follows agents: DK, SE, remote · all roles" or "all countries (Europe) · follows agents' terms: engineer, product, data", or why the board is read whole. Favourite (affinity 2) affects scoring only, where it skips the `any` gates; it used to widen the fetch to its agent's `require` reach, and migration 21 tagged every company that was a favourite of any agent so nothing read before is lost. That tag, first named All roles in `companies.all_roles`, also replaced a board's `{"reach": "all"}` param, which read everywhere: migration 21 tagged those companies and logged each such board, since no everywhere level is left. Migration 24 renamed the tag to All countries and gave its companies (Mistral AI and OpenAI on live) All roles as well, since the owner wanted their every role. A board's `params` override the agents' reach and All countries. Boards under 300 roles, and hosts with a one-country filter over more than 8 countries, are read whole. A board's size (`ats:size:<target>`, with `ats:sizechecked:<target>`) is set once, not by every read: `set_board` sizes a new board with `ats.board_size` (a stated total from one unfiltered page 1, else a whole read), a board with no size is sized in its batch before its reach is chosen, and Recheck on the Companies row, `app companies size <key>` and `--missing` size it again. Before, a new board had no size and was read whole on its first pull: Infineon read 999 roles worldwide and cut at page 100. A board whose reader cannot filter is sized by its whole read instead of a second request. On 2026-09-30 `--missing` sized 38 boards the old open-role fallback had sized, among them Bosch 4,830, Verisure 3,447, Microsoft 2,345 and NVIDIA at Workday's 2,000. For a Workday or Oracle site, which filters by its own location ids, the Companies line names a country the site does not list and a missing remote option ("follows agents: DK, remote · SE not on this site"), and "nothing asked" when it lists none, where it used to name what was meant to be asked. SmartRecruiters, Eightfold, SuccessFactors, Phenom, Workday and Oracle filter at the source; countries and remote go as separate series, because the hosts intersect two facets. A complete filtered read closes roles outside the filter, except roles with a vote or an application; a filtered read, or one from a host whose unknown slug answers empty, that lists under 10% of the last read with the same filter counts as failed.
**A role has a list of places, resolved against a gazetteer.** Readers kept one place of several, joined them, or the host posted a copy per place. A reader now returns every place and never multiplies a row. `places` (city, region, country, continent, with `place_includes` for Øresund across two countries) and `place_aliases` are seeded from the dictionaries that were in code; `role_places` links each place of a role, and an unknown text is listed by `unresolved_places` until an alias links it. The Place filter and the gates join over the tree, which halved their time and dropped the `EU` fallback. Copies of one posting per place, same host, company and title and texts at least 30% alike, fold into one role that keeps each copy's place and link; the rule applies to every host, since the 5,024 such roles came mostly from hosts that do not declare copies. A place text resolves by its own words (`Gazetteer.resolve`), never by the role's stated `country`, which names one country of a multi-place line: `San Francisco; London, UK` with `US` is in Europe through London. The gates and the Place filter read every place of a kept role, a folded copy's included, so OpenAI's San Francisco role with a Dublin copy meets a Europe gate although its `place` and `country` are San Francisco's; its row reads "San Francisco +1". On 2026-10-03 this kept 45 open roles in agent 2's feed that its own places alone would gate.
**A role has a list of places, resolved against a gazetteer.** Readers kept one place of several, joined them, or the host posted a copy per place. A reader now returns every place and never multiplies a row. `places` (city, region, country, continent, with `place_includes` for Øresund across two countries) and `place_aliases` are seeded from the dictionaries that were in code; `role_places` links each place of a role, and an unknown text is listed by `unresolved_places` until an alias links it. The Place filter and the gates join over the tree, which halved their time and dropped the `EU` fallback. Copies of one posting per place, same host, company and title and texts at least 30% alike, fold into one role that keeps each copy's place and link; the rule applies to every host, since the 5,024 such roles came mostly from hosts that do not declare copies. A place text resolves by its own words (`Gazetteer.resolve`), never by the role's stated `country`, which names one country of a multi-place line: `San Francisco; London, UK` with `US` is in Europe through London. The gates and the Place filter read every place of a kept role, a folded copy's included, so OpenAI's San Francisco role with a Dublin copy meets a Europe gate although its `place` and `country` are San Francisco's; its row read "San Francisco +1" until a row led with the place nearest the agent (below). On 2026-10-03 this kept 45 open roles in agent 2's feed that its own places alone would gate.
**A role in several cities leads with the one nearest the viewing agent** (`places.Nearness`). Mistral's Forward Deployed role, kept as its Montréal posting with Abu Dhabi, New York and Paris copies, read "Montréal +3" and opened the Montréal page, while for the owner it is a Paris role. A role's places, its copies' included, are ordered in three tiers read off the agent's gates: a place that meets the `any` group (under one of its `country` or `place` values, or a remote part whose area is open to it through `remote_from`, or that meets the scope with a plain `remote` any gate), then a place inside the `require` scope on country, then the rest, a remote part with no stated area among them. The gazetteer holds no coordinates, so within a tier the home stands in for distance: the first value of the first `any` gate on country or place. A place in one of the group's own towns inside the home leads, then one elsewhere in the home, then the host's order; for agent 2 Copenhagen leads "Denmark", Billund and Stockholm. `GET /api/roles` and `GET /api/roles/{uid}` compute it for the agent the feed is viewed as and only for the roles served: the row carries `place_texts`, `lead_place` and `lead_url` (the leading copy's link, '' when the role's own place leads), and `place` is the lead and "+N" as before. The reader's Places list follows the order, and its posting links and the `o` key open `lead_url`. Without an agent the host's order stands. The gates and the dupes rule do not read the order. On the live copy of 2026-10-04 agent 2 sees the Mistral role as "Paris +3" linking the Paris copy, OpenAI's Applied AI Architect as "Dublin, Ireland +1", and 277 of the 279 kept roles with Copenhagen among several places lead with it; the other two lead with a joined line that names København.
**A remote role has a remote area: the places a remote hire may live in** (migration 27, `role_remote`, `app/prep/area.py`). On 2026-09-30 the Place field listed "USA (Remote)", "Remote US" and "United States (Remote)" as three towns, and no filter said which of 3,177 remote roles someone in Denmark could take. Those lines came from a few whole-read Greenhouse and Ashby boards (Grafana Labs, Cloudflare, Monzo, Talkdesk), not from an ingest filter. Danish employers barely post remote roles (11 of 1,395 open Danish roles). The remote roles open to Denmark are the roughly 300 scoped to Europe or EMEA and the 210 scoped to anywhere. The area is the first of these that names a place: the model's `remote_where`, the parts of the place texts that say remote ("Germany (Remote)", "Home Based - EMEA"; "Worldwide" or "Global" in such a part is Anywhere), and the role's resolved places lifted to their countries. "Remote" alone names none, so such a role is remote with no stated area. Anywhere is a standalone place with no aliases and nothing under it, so the Place filter and `under` never reach every role through it, and it never counts as a place for a country gate's empty check. Remote lines are no longer suggested as towns.