Score roles per search agent, and run pull into extract, embed and score
embed stores one vector per open role; score rates every open role for every enabled agent from require and prefer gates, fit against the agent's intent, recency and company affinity, keeping gated rows with a reason. Schema v3 adds vectors and the cached intent vector. The page gets an agent order, the score on each row, and an Agents tab. Two starter agents in roles.yaml are imported once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4dfb8831aa
commit
bc60324fab
22 files changed
+1457
-44
No files matched your search
+10
-8
@@ -1,4 +1,4 @@
|
||||
"""`roledesk serve | job pull|extract | companies seed|add|check | db init`."""
|
||||
"""`roledesk serve | job pull|extract|embed|score | companies seed|add|check | db init`."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -37,7 +37,7 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
serve.add_argument("--port", type=int, default=8790)
|
||||
|
||||
job = sub.add_parser("job", help="queue a job or task and drain the queue once")
|
||||
job.add_argument("kind", choices=["pull", "extract"])
|
||||
job.add_argument("kind", choices=["pull", "extract", "embed", "score"])
|
||||
|
||||
companies = sub.add_parser("companies", help="the target company list")
|
||||
companies_sub = companies.add_subparsers(dest="action", required=True)
|
||||
@@ -76,8 +76,8 @@ def main(argv: list[str] | None = None) -> int:
|
||||
def run_job(args: argparse.Namespace) -> int:
|
||||
"""Queue `kind` — a job, or a task from `pipeline.TASKS` such as `pull` —
|
||||
then run everything queued until the queue is idle, and print how it
|
||||
ended. A task's own result is its final job's, which is the one whose
|
||||
`task_id` equals the run this started."""
|
||||
ended: one line per task, from each task's final job. `pull` is a
|
||||
cascade, so it prints a line for every stage it went through."""
|
||||
from pipeline import FINAL, JobQueue, Jobs, TASKS
|
||||
from roledesk import jobs
|
||||
from roledesk.storage import Store
|
||||
@@ -90,12 +90,14 @@ def run_job(args: argparse.Namespace) -> int:
|
||||
if args.kind in TASKS:
|
||||
task_id = queue.start_task(TASKS[args.kind]())
|
||||
queue.drain()
|
||||
final = next((j for j in queue.jobs.of_task(task_id) if j.kind == FINAL), None)
|
||||
if final is not None:
|
||||
started = queue.jobs.of_task(task_id)
|
||||
if not started:
|
||||
return 0
|
||||
finals = [j for j in queue.jobs.of_cascade(started[0].cascade_id) if j.kind == FINAL]
|
||||
for final in finals:
|
||||
print(json.dumps({"id": final.id, "state": final.state,
|
||||
"result": final.result, "error": final.error}))
|
||||
return 0 if final.state == "done" else 1
|
||||
return 0
|
||||
return 0 if all(f.state == "done" for f in finals) else 1
|
||||
queued = queue.enqueue(args.kind)
|
||||
queue.drain()
|
||||
if queued is not None:
|
||||
|
||||
Reference in new issue
Block a user