Files
jobboard/app/jobs/__init__.py
T

54 lines
2.8 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
embed.py one vector per open role, for prompt closeness and CV closeness
score.py every open role scored for every enabled search agent, and each
agent's cut
fetch_text.py the roles in the cut that came without text, read on their own
pages, with no model
extract.py title and description into the gate columns, on Haiku
judge.py each agent's cut against its CV: skills, experience, career
summarise.py about 60 words on the top of both orders and the roles liked or
saved, on Haiku
cascade.py pull → prep → embed → score → fetch_text → prep → embed → score
→ extract → score → judge → summarise, what `TASKS` offers, the
`pull` and `fetch_text` jobs that start it, and the default schedule
stages.py whether extract, summarise, judge and fetch text 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
posting.py one role's posting page fetched as text, on demand
reach.py which countries a pull asks each big board for, from the agents
limits.py what limits a board's read, in words, for the Companies list
"""
from __future__ import annotations
from typing import Any
from app.jobs import (cascade, discover, embed, extract, judge, limits, posting, 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", "judge", "limits", "posting",
"pull", "reach", "score", "search_target", "seed_agents", "seed_searches", "sources", "stages", "summarise"]