Drop pruning boards by region: a fix for the US seed, and a wrong one
`app companies prune`, `/api/prune` and the Sources disclosure switched off every board with no open role in a region. It existed because the first seed was 186 US boards; the European seed makes it moot, and it was wrong on its own terms: a board with no European role today (a company between openings, or a fetch that timed out) was switched off for good. A company that hires nowhere near should not be in the list, and a ranking's country gate handles the rest. `EUROPE` in models had no other reader and goes with it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
3aee48997c
commit
e602eb3388
12 files changed
+11
-233
No files matched your search
+1
-31
@@ -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|discover|check|prune
|
||||
app companies seed|add|discover|check
|
||||
app searches add|list|remove
|
||||
app db init
|
||||
|
||||
@@ -79,12 +79,6 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
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")
|
||||
prune.add_argument("--in", dest="region", default="europe",
|
||||
help="'europe' or country codes, e.g. DK,SE,NO,EU (default europe)")
|
||||
prune.add_argument("--apply", action="store_true",
|
||||
help="unsubscribe and close their roles; without it, only list them")
|
||||
|
||||
searches = sub.add_parser("searches", help="saved searches on cross-company job boards")
|
||||
searches_sub = searches.add_subparsers(dest="action", required=True)
|
||||
@@ -242,8 +236,6 @@ def run_companies(args: argparse.Namespace) -> int:
|
||||
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)
|
||||
|
||||
|
||||
@@ -346,28 +338,6 @@ def check_companies(store: Store) -> int:
|
||||
return 1 if dead else 0
|
||||
|
||||
|
||||
def prune_companies(store: Store, region: str, *, apply: bool) -> int:
|
||||
"""`app companies prune --in DK,EU`: every fetched board none of whose open
|
||||
roles is in the region, which is `europe` unless named. `--apply`
|
||||
switches them off, which closes their open roles. `app companies seed`
|
||||
never brings one back: it skips a company that exists. See
|
||||
`app.jobs.sources.prune_plan` for which boards count."""
|
||||
from app import jobs
|
||||
|
||||
try:
|
||||
filled, plan = jobs.sources.prune_plan(store, region)
|
||||
except ValueError as exc:
|
||||
print(f"companies prune: {exc}", file=sys.stderr)
|
||||
return 1
|
||||
for sub, count in plan:
|
||||
print(f"{sub.target:40} {sub.label:30} {count:6} open, none in {region}")
|
||||
result: dict[str, Any] = {"countries_filled": filled, "pruned": len(plan), "applied": apply}
|
||||
if apply:
|
||||
result |= jobs.sources.prune(store, region)
|
||||
print(json.dumps(result))
|
||||
return 0
|
||||
|
||||
|
||||
def run_searches(args: argparse.Namespace) -> int:
|
||||
from app import jobs
|
||||
from app.storage import Store
|
||||
|
||||
Reference in new issue
Block a user