upsert_role stores the host's own words (roles.*_host), the place texts unresolved when they change, and the company key unresolved on insert, and marks the role prep_due. app.prep maps seniority, employment, remote and country through the host tables in app/prep/hosts, resolves places and company aliases, lists unknown words in `unmapped`, remaps every open role when the tables' fingerprint changes, and runs rebuild_dupes, which moves out of the pull's settle. Migration 22 adds the columns and the table and fills the host words from raw. Cascade: pull, prep, embed, score, enrich, prep, embed, score, extract, score, summarise. `app prep [unmapped] [--remap]`, /api/prep/unmapped and a fold on the Sources page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
2.1 KiB
Python
45 lines
2.1 KiB
Python
"""The work roledesk queues. Importing this package registers every job, every
|
|
task in `pipeline.TASKS` and the default schedule in `pipeline.SCHEDULES`.
|
|
|
|
pull.py read every board and search and store the roles they yield
|
|
prep.py the `prep` stage: `app.prep` over what a pull stored, then the fold
|
|
extract.py title and description into the gate columns, on Haiku
|
|
embed.py one vector per open role, for fit
|
|
score.py every open role scored for every enabled search agent
|
|
summarise.py about 60 words on each of the best roles, on Haiku
|
|
cascade.py pull → prep → embed → score → ... → summarise, what `TASKS`
|
|
offers, the `pull` job a schedule fires, and that schedule
|
|
stages.py whether extract and summarise run: the switch, else config.yaml
|
|
sources.py what a pull reads, changed by hand: boards and searches
|
|
added, switched on or off
|
|
discover.py which ATS a company's careers site runs on, from its pages
|
|
reach.py which countries a pull asks each big board for, from the agents
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from app.jobs import (cascade, discover, embed, extract, pull, reach, score, sources, stages,
|
|
summarise)
|
|
from app.jobs.pull import search_target, seed_searches
|
|
from app.jobs.score import seed_agents
|
|
|
|
#: What `JobQueue(bootstrap=...)` and `pipeline.worker --bootstrap` are given.
|
|
BOOTSTRAP = "app.jobs:bootstrap"
|
|
|
|
|
|
def bootstrap(config_path: str = "") -> tuple[Any, Any]:
|
|
"""`(config, store)` from the config file alone, for a job run in its own
|
|
process or by `python -m pipeline.worker`. Importing this module is what
|
|
fills `JOBS`, which is why the worker is handed a name rather than a queue."""
|
|
from app import config as config_mod
|
|
from app.storage import Store
|
|
|
|
config = config_mod.load(config_path or None)
|
|
return config, Store(config.database)
|
|
|
|
|
|
__all__ = ["BOOTSTRAP", "bootstrap", "cascade", "discover", "embed", "extract", "pull",
|
|
"reach", "score", "search_target", "seed_agents", "seed_searches", "sources", "stages", "summarise"]
|