Extract and summarise bounds are each agent's own limits, set on its form

agents.limits holds extract_top, extract_min, summarise_top and
summarise_min; the scope query reads them per ranked row, and a row saved
before this behaves like a fresh agent. The four global config keys go.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-28 16:02:06 +02:00
1 parent e602eb3388
commit cebe62ddc9
20 files changed
+229 -147

No files matched your search

+7 -10
View File
@@ -8,9 +8,10 @@ refused batch, and failing with a notice when no model is reachable are
`desk.modeltask`'s.
A role is waiting while it is open, has never been answered (`extracted_at IS
NULL`), has not been given up on, and is in the best `extract.per_agent` of an
enabled agent's ungated scores at `extract.min_score` or more. That bound is
what keeps the cost proportional to the rankings rather than to the boards:
NULL`), has not been given up on, and is in the best of an enabled agent's
ungated scores as deep and as low as that agent's own `limits` say
(`extract_top`, `extract_min`). That bound is what keeps the cost
proportional to the rankings rather than to the boards:
the pull scores every role for free first, then reads the few hundred that
rank, and scores again so the gates see what was filled. A batch built for
named uids finishes what it was dealt whatever their rank. The answer only
@@ -133,8 +134,7 @@ def _item(role: Role) -> dict[str, Any]:
def build_batch(config: Config, store: Store, limit: int = 20,
uids: Sequence[str] | None = None) -> dict[str, Any]:
return {"instructions": SYSTEM,
"roles": [_item(r) for r in store.extract_waiting(
limit, config.extract.per_agent, config.extract.min_score, uids)]}
"roles": [_item(r) for r in store.extract_waiting(limit, uids)]}
# -------------------------------------------------------------------- answer
@@ -205,11 +205,8 @@ TASK: ModelTask[ExtractResult] = ModelTask(
kind="extract", label="Reading postings for gate fields",
verb="extracting", noun="fields", idle="nothing to extract", items="roles",
settings=lambda config: config.extract,
pending=lambda config, store: store.extract_pending(
config.extract.per_agent, config.extract.min_score),
waiting=lambda config, store, limit: [
r.uid for r in store.extract_waiting(
limit, config.extract.per_agent, config.extract.min_score)],
pending=lambda config, store: store.extract_pending(),
waiting=lambda config, store, limit: [r.uid for r in store.extract_waiting(limit)],
build_batch=build_batch,
system=lambda store: SYSTEM,
schema=SCHEMA,