End the enrich cascade behind an agent's save with judge, so a changed CV or like text is judged again at once
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8da0f4512a
commit
1d0a4c37f2
2 files changed
+7
-4
No files matched your search
+5
-2
@@ -23,7 +23,10 @@ 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.
|
say; the second score then applies the gates to the columns it filled.
|
||||||
Summarise follows, 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
|
and judge runs last, reading each agent's best roles against its CV by its
|
||||||
judge limits.
|
judge limits. The `enrich` cascade, which follows the rescore after an agent
|
||||||
|
is saved, ends with judge too, so a changed CV, prompt or like text is read
|
||||||
|
again at once rather than at the next pull; a pair whose `input_key` did not
|
||||||
|
change costs nothing.
|
||||||
|
|
||||||
A batch that failed, or a stage somebody killed, does not stop the chain: the
|
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
|
work comes round on the next pull, and a rescore of what did arrive is worth
|
||||||
@@ -55,7 +58,7 @@ STEP = "app.jobs.cascade:step"
|
|||||||
CASCADES: dict[str, tuple[str, ...]] = {
|
CASCADES: dict[str, tuple[str, ...]] = {
|
||||||
"pull": ("pull", "prep", "embed", "score", "enrich", "prep", "embed", "score", "extract",
|
"pull": ("pull", "prep", "embed", "score", "enrich", "prep", "embed", "score", "extract",
|
||||||
"score", "summarise", "judge"),
|
"score", "summarise", "judge"),
|
||||||
"enrich": ("enrich", "prep", "embed", "score"),
|
"enrich": ("enrich", "prep", "embed", "score", "judge"),
|
||||||
}
|
}
|
||||||
|
|
||||||
#: What follows `enrich` for the roles it filled, passed over when it filled none.
|
#: What follows `enrich` for the roles it filled, passed over when it filled none.
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ def test_nothing_filled_passes_over_the_prep_embed_and_score_behind_enrich() ->
|
|||||||
|
|
||||||
out = cascade.step(None, None, empty, {"cascade": "enrich", "task": "enrich", "at": 0},
|
out = cascade.step(None, None, empty, {"cascade": "enrich", "task": "enrich", "at": 0},
|
||||||
context=context)
|
context=context)
|
||||||
assert out["next"] == "" and len(context.made) == 2
|
assert out["next"] == "judge" and context.made[2].carries["at"] == 4
|
||||||
|
|
||||||
|
|
||||||
class _Embedder:
|
class _Embedder:
|
||||||
@@ -397,7 +397,7 @@ def test_the_enrich_job_reads_the_pages_then_embeds_and_scores_those_roles(
|
|||||||
jobs = sorted(queue.jobs.of_cascade(queue.jobs.last(enrich.KIND).cascade_id), # type: ignore[union-attr]
|
jobs = sorted(queue.jobs.of_cascade(queue.jobs.last(enrich.KIND).cascade_id), # type: ignore[union-attr]
|
||||||
key=lambda j: j.id)
|
key=lambda j: j.id)
|
||||||
assert [j.result.get("task") for j in jobs if j.kind == FINAL] == \
|
assert [j.result.get("task") for j in jobs if j.kind == FINAL] == \
|
||||||
["enrich", "prep", "embed", "score"]
|
["enrich", "prep", "embed", "score", "judge"]
|
||||||
assert [j.kind for j in jobs if j.kind != FINAL] == \
|
assert [j.kind for j in jobs if j.kind != FINAL] == \
|
||||||
["enrich", enrich.KIND, "prep", "embed", "score"]
|
["enrich", enrich.KIND, "prep", "embed", "score"]
|
||||||
assert web["asked"] == [f"{BASE}/acme/1"]
|
assert web["asked"] == [f"{BASE}/acme/1"]
|
||||||
|
|||||||
Reference in new issue
Block a user