Split the All tag into two company overrides: All countries and All roles (WP L)

Fetching has two filters, and a company now overrides each on its own.
All countries (companies.all_countries) is the old All roles tag: its big
boards are read with the agents' wide reach. All roles (companies.all_roles,
new meaning) drops the agents' fetch terms and any later role filter.

- Migration 24 copies the old tag to all_countries and keeps all_roles for
  those companies, and moves a board's {"terms": false} to its company.
- The runner no longer reads {"terms": false}; the plan leaves the terms out
  for a company set to All roles.
- POST /api/companies/{key}/all-countries and /all-roles, each queueing a
  pull when turned on; CompanyOut carries both.
- Two toggles replace All on the Companies row, the reader and the Roles
  strip; the reach line states countries and role types in plain words;
  the filter select gets both options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 12:50:45 +02:00
1 parent 795ca3628c
commit e52857dea5
23 files changed
+602 -215

No files matched your search

+15 -16
View File
@@ -111,14 +111,14 @@ def test_a_company_tagged_all_roles_is_read_across_the_require_reach(store: Stor
_wolf(store)
_board(store, "workday:mistral.wd3/Jobs", "Mistral AI")
_board(store, "workday:acme.wd3/Jobs", "Acme")
store.set_all_roles("mistral-ai", True)
store.set_all_countries("mistral-ai", True)
plan = reach.plan(store)
subs = {s.target.split(".")[0]: s for s in store.subscriptions(source="ats")}
wide, why = plan.why(subs["workday:mistral"])
# Europe, and the base's remote, which a tag never reads less than.
assert why == "tag" and {"DE", "FR", "DK"} <= wide.countries and wide.remote
assert reach.line(plan, subs["workday:mistral"]) == \
f"{len(wide.countries)} countries, remote · company tag"
assert why == "countries" and {"DE", "FR", "DK"} <= wide.countries and wide.remote
# The gate lists Europe's countries one by one; the line names the continent.
assert reach.line(plan, subs["workday:mistral"]) == "all countries (Europe) · all roles"
assert plan.why(subs["workday:acme"]) == (plan.base, "agents")
@@ -135,39 +135,38 @@ def test_a_favourite_does_not_widen_the_fetch(store: Store) -> None:
def test_a_tag_too_wide_for_a_one_host_reads_the_board_whole(store: Store, host: str) -> None:
_wolf(store)
_board(store, f"{host}:mistral", "Mistral AI")
store.set_all_roles("mistral-ai", True)
store.set_all_countries("mistral-ai", True)
[sub] = store.subscriptions(source="ats")
assert reach.line(reach.plan(store), sub) == \
"all roles · company tag, too many countries to ask"
assert reach.line(reach.plan(store), sub) == "too many countries to ask: read whole"
def test_a_tag_asks_phenom_for_europe_in_one_request(store: Store) -> None:
_wolf(store)
_board(store, "phenom:mistral", "Mistral AI")
store.set_all_roles("mistral-ai", True)
store.set_all_countries("mistral-ai", True)
[sub] = store.subscriptions(source="ats")
found = reach.plan(store)
assert reach.line(found, sub) == f"{len(found.wide.countries)} countries · company tag"
assert reach.line(found, sub) == "all countries (Europe) · all roles"
def test_an_agent_without_a_required_place_makes_the_tag_everywhere(store: Store) -> None:
_wolf(store)
store.save_agent("Anywhere", gates=[Gate(field="country", values=["US"], mode="any")])
_board(store, "workday:mistral.wd3/Jobs", "Mistral AI")
store.set_all_roles("mistral-ai", True)
store.set_all_countries("mistral-ai", True)
plan = reach.plan(store)
[sub] = store.subscriptions(source="ats")
assert plan.why(sub) == (reach.EVERYWHERE, "tag")
assert plan.why(sub) == (reach.EVERYWHERE, "countries")
assert plan.for_subscription(sub) is None
assert reach.line(plan, sub) == "all roles · company tag"
assert reach.line(plan, sub) == "all countries (everywhere): read whole"
def test_a_boards_own_reach_wins_over_the_tag(store: Store) -> None:
_wolf(store)
_board(store, "workday:mistral.wd3/Jobs", "Mistral AI", params={"countries": ["FR"]})
store.set_all_roles("mistral-ai", True)
store.set_all_countries("mistral-ai", True)
[sub] = store.subscriptions(source="ats")
assert reach.line(reach.plan(store), sub) == "FR · set here"
assert reach.line(reach.plan(store), sub) == "set here: FR · all roles"
@pytest.mark.parametrize("size, params, why", [
@@ -248,8 +247,8 @@ def test_the_pull_reads_a_tagged_company_with_the_wide_reach(
_wolf(store)
_board(store, "phenom:jobs.mistral.ai/global/en", "Mistral AI")
_board(store, "smartrecruiters:bfl", "Black Forest Labs")
store.set_all_roles("mistral-ai", True)
store.set_all_roles("black-forest-labs", True)
store.set_all_countries("mistral-ai", True)
store.set_all_countries("black-forest-labs", True)
asked: dict[str, Ask] = {}
def fake(module: object, slug: str, get: object, ask: Ask, **kwargs: object