app/main.py assembles it in the boilerplate's order, auth.connect first, then the queue with the scheduler and the pages. TABS is Roles, Applications, Agents, Companies, Jobs, Schedules, Messages and Account: the alpha page's three views become templates on the boilerplate's base.html, driven by static/roles.js (the old app.js) through api() and toasts.js, over the unchanged JSON routes. Companies lists every board with its open roles and the affinity control. A 422 is one sentence, so a toast never reads [object Object]. Config takes the boilerplate's shape: APP_CONFIG or config.yaml, a missing file is the defaults, an unknown key is an error. roles.yaml is gone; config.yaml is the committed default and carries the starter agents. pull is now a job that asks for the pull cascade, because a schedule enqueues a job kind; its default schedule, every 6h, is declared beside it in app/jobs/cascade.py. pull_batch's targets are keyword-only so the Jobs tab offers no batch button. `app worker` is the boilerplate's; `app job` still drains a queue of its own and fires no schedules. test_coupling holds pipeline, auth and desk apart (desk may import pipeline) and plugins to desk; test_architecture keeps app's layers, now with main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1.4 KiB
Python
36 lines
1.4 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 configured plugin and store the roles it yields
|
|
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
|
|
cascade.py pull → extract → embed → score, what `TASKS` offers, the
|
|
`pull` job a schedule fires, and that schedule
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from app.jobs import cascade, embed, extract, pull, score
|
|
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", "embed", "extract", "pull", "score",
|
|
"seed_agents"]
|