A European seed of 362 employers, readable or not; discover finds a company's board from its site

The seed was jobhunt-hq's 186 US boards, chosen because they could be read. It is now a hand-picked list of European tech employers, with `board` filled by the new `app.jobs.discover` from each company's own careers site and every board fetched once before it landed: 175 have one, and the rest keep the ATS host their site runs on (Teamtailor 32, Workday 12, SuccessFactors 9, ...) and a careers URL, as rows the app cannot read yet. Companies shows them as "not readable yet" with a link, behind a filter, so the next parser to write is the host that filter shows most.

`app companies discover NAME DOMAIN [--add]` reads the home page, its careers links and the usual paths for a link into a known host, one level down on a careers page, and probes Greenhouse, Lever, Ashby, SmartRecruiters, Recruitee and Personio by slug when the pages link nothing. It is what the LinkedIn flow will call.

Migration 7 adds companies.ats, country and city. The Workable parser now reads the v3 shape its list endpoint actually sends (location object, department list, shortcode and no URL or text); the first populated board showed it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-28 15:27:14 +02:00
1 parent c4f2bcc0c9
commit 51d1e67ff9
19 files changed
+3362 -1394

No files matched your search

+58 -18
View File
@@ -3,7 +3,7 @@
app serve [--host H] [--port P] [--reload]
app job pull|extract|embed|score [--payload JSON]
app worker [--workers http=8,cpu=1] [--until-idle]
app companies seed|add|check|prune
app companies seed|add|discover|check|prune
app searches add|list|remove
app db init
@@ -67,11 +67,17 @@ def build_parser() -> argparse.ArgumentParser:
companies = sub.add_parser("companies", help="the target company list")
companies_sub = companies.add_subparsers(dest="action", required=True)
seed = companies_sub.add_parser(
"seed", help="import seed/companies.json, subscribing to each board")
"seed", help="import seed/companies.json, subscribing to each readable board")
seed.add_argument("--path", default="seed/companies.json")
add = companies_sub.add_parser("add", help="add one company from its board")
add.add_argument("board", help="host:slug, e.g. greenhouse:acme")
add.add_argument("name")
discover = companies_sub.add_parser(
"discover", help="find a company's board from its website; --add follows it")
discover.add_argument("name")
discover.add_argument("domain", help="its website, e.g. pleo.io")
discover.add_argument("--add", action="store_true",
help="add the company, with its board when one is readable")
companies_sub.add_parser("check", help="report boards that do not answer")
prune = companies_sub.add_parser(
"prune", help="unsubscribe every board with no open role in the region")
@@ -234,42 +240,76 @@ def run_companies(args: argparse.Namespace) -> int:
return 0
if args.action == "add":
return add_company(store, args.board, args.name)
if args.action == "discover":
return discover_company(store, args.name, args.domain, add=args.add)
if args.action == "prune":
return prune_companies(store, args.region, apply=args.apply)
return check_companies(store)
def seed_companies(store: Store, path: str) -> dict[str, int]:
"""Import `seed/companies.json`: one `companies` row and one `ats`
subscription per entry, skipping a key that already exists. Not
idempotent on edits to an existing row — re-running it only ever adds
what is missing."""
from plugins.ats import is_known_target
"""Import `seed/companies.json`: one `companies` row per entry, and one
`ats` subscription for each entry with a readable `board`. An entry
without one is the point of the list as much as one with: a company worth
following whose careers site the app cannot read yet keeps its `ats`
host and `careers_url`, and the Companies section says so. A key that
already exists is skipped, so re-running only ever adds what is missing;
it never edits a row."""
from app.models import company_key
from plugins.ats import careers_url, is_known_target
data = json.loads(Path(path).read_text(encoding="utf-8"))
added = skipped = 0
added = readable = skipped = 0
for row in data.get("companies", []):
key, name, board = row["key"], row["name"], row["board"]
name = row["name"]
key = row.get("key") or company_key(name)
if store.company(key) is not None:
skipped += 1
continue
if not is_known_target(board):
print(f"companies seed: {key}: {board!r} is not a known board; skipped",
board = row.get("board") or ""
if board and not is_known_target(board):
print(f"companies seed: {key}: {board!r} is not a known board; kept without it",
file=sys.stderr)
skipped += 1
board = ""
host = board.partition(":")[0]
store.add_company(
name, key=key, domain=row.get("domain", ""),
careers_url=row.get("careers_url") or (careers_url(board) if board else ""),
ats=row.get("ats") or host, country=row.get("country", ""),
city=row.get("city", ""))
added += 1
if not board:
continue
# A seed's `affinity` is not read: affinity is per agent now, and a
# seed has no agent to set it for.
store.add_company(name, key=key, careers_url=row.get("careers_url", ""))
host, _, _slug = board.partition(":")
try:
store.add_subscription("ats", board, label=name, company=name, board=host)
readable += 1
except ValueError as exc:
# The company row landed; the subscription is the only thing
# missing, and worth saying rather than losing silently.
print(f"companies seed: {key}: {exc}", file=sys.stderr)
added += 1
return {"added": added, "skipped": skipped, "total": len(data.get("companies", []))}
return {"added": added, "readable": readable, "skipped": skipped,
"total": len(data.get("companies", []))}
def discover_company(store: Store, name: str, domain: str, *, add: bool) -> int:
"""`app companies discover "Pleo" pleo.io [--add]`: what the company's
site says its board is, as JSON. With `--add`, the company is added the
way the seed adds it: with its board when one is readable, as a row the
app cannot read yet otherwise."""
from app import jobs
found = jobs.discover.discover(name, domain)
out: dict[str, Any] = {"name": name, "domain": domain, "board": found.board,
"ats": found.ats, "careers_url": found.careers_url,
"evidence": found.evidence}
if add:
try:
out["key"], out["roles"] = jobs.sources.add_discovered(store, name, domain, found)
except ValueError as exc:
print(f"companies discover: {exc}", file=sys.stderr)
return 1
print(json.dumps(out))
return 0
def add_company(store: Store, board: str, name: str) -> int: