Judge each agent's best roles against its CV as skills, experience and career, a stage after summarise
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4fc474c437
commit
9960799b96
14 files changed
+866
-44
No files matched your search
+24
-6
@@ -1,7 +1,7 @@
|
||||
"""The tasks roledesk offers, and the order a pull runs them in.
|
||||
|
||||
pull → prep → embed → score → enrich → prep → embed → score → extract → score
|
||||
→ summarise
|
||||
→ summarise → judge
|
||||
|
||||
newsdesk's cascade convention: a cascade is a tuple of task names, and the
|
||||
final job of one task starts the next (`step` is the callback it carries).
|
||||
@@ -21,7 +21,9 @@ three. Extract
|
||||
reads only the best
|
||||
roles of each enabled agent, as deep and as low as that agent's own `limits`
|
||||
say; the second score then applies the gates to the columns it filled.
|
||||
Summarise runs last, on the best roles by the same agent's summarise limits.
|
||||
Summarise follows, on the best roles by the same agent's summarise limits,
|
||||
and judge runs last, reading each agent's best roles against its CV by its
|
||||
judge limits.
|
||||
|
||||
A batch that failed, or a stage somebody killed, does not stop the chain: the
|
||||
work comes round on the next pull, and a rescore of what did arrive is worth
|
||||
@@ -44,7 +46,7 @@ from dataclasses import replace
|
||||
from functools import partial
|
||||
from typing import Any
|
||||
|
||||
from app.jobs import embed, enrich, extract, prep, pull, score, summarise # noqa: F401 -- registers the jobs
|
||||
from app.jobs import embed, enrich, extract, judge, prep, pull, score, summarise # noqa: F401 -- registers the jobs
|
||||
from desk.tools import agent
|
||||
from pipeline import NULL, TASKS, Notice, RunContext, Tally, Task, declare, job
|
||||
|
||||
@@ -52,7 +54,7 @@ STEP = "app.jobs.cascade:step"
|
||||
|
||||
CASCADES: dict[str, tuple[str, ...]] = {
|
||||
"pull": ("pull", "prep", "embed", "score", "enrich", "prep", "embed", "score", "extract",
|
||||
"score", "summarise"),
|
||||
"score", "summarise", "judge"),
|
||||
"enrich": ("enrich", "prep", "embed", "score"),
|
||||
}
|
||||
|
||||
@@ -101,6 +103,21 @@ def _summarise(cascade: str) -> Task:
|
||||
return replace(stage, finder=during_a_pull)
|
||||
|
||||
|
||||
def _judge(cascade: str) -> Task:
|
||||
"""`judge` as a stage: nothing with no model reachable, as `_summarise`."""
|
||||
stage = judge.judge_task()
|
||||
if not cascade:
|
||||
return stage
|
||||
find = stage.finder
|
||||
|
||||
def during_a_pull(config: Any, store: Any) -> list[Any]:
|
||||
if not agent.backend(config.agent):
|
||||
return []
|
||||
return find(config, store)
|
||||
|
||||
return replace(stage, finder=during_a_pull)
|
||||
|
||||
|
||||
STAGES: dict[str, Callable[[str], Task]] = {
|
||||
"pull": lambda cascade: pull.pull_task(),
|
||||
"extract": _extract,
|
||||
@@ -110,6 +127,7 @@ STAGES: dict[str, Callable[[str], Task]] = {
|
||||
"prep": lambda cascade: Task(kind="prep", finder=_once,
|
||||
label="Mapping the roles' host words"),
|
||||
"summarise": _summarise,
|
||||
"judge": _judge,
|
||||
"enrich": lambda cascade: enrich.enrich_task(),
|
||||
}
|
||||
|
||||
@@ -224,7 +242,7 @@ def enrich_after(queue: Any, score_job: Any) -> Any:
|
||||
#: What `app job <name>` and `/api/jobs` start besides `pull`: one stage
|
||||
#: each, on its own. `pull` is not a task here, since it is a job: a name that
|
||||
#: is both would be listed twice by `/api/jobs/kinds`.
|
||||
for _name in ("extract", "embed", "score", "summarise", "prep"):
|
||||
for _name in ("extract", "embed", "score", "summarise", "judge", "prep"):
|
||||
TASKS[_name] = partial(task, _name)
|
||||
|
||||
|
||||
@@ -235,4 +253,4 @@ for _name in ("extract", "embed", "score", "summarise", "prep"):
|
||||
# every restart (see pipeline/schedule.py).
|
||||
declare("pull", "pull", "every 6h",
|
||||
label="Pull every board, then map, embed, score, read the best roles' pages, "
|
||||
"extract, rescore and summarise")
|
||||
"extract, rescore, summarise and judge against the CVs")
|
||||
Reference in new issue
Block a user