Extract is bounded to the ranking: pull → embed → score → extract → score → summarise

The free stages run first and their score bounds the two model stages.
Extract reads only the best extract.per_agent roles of each agent at
extract.min_score or more, then score runs again so the gates read what it
filled; summarise gets a min_score of its own. The cascade steps by
position, since score is in it twice.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-28 15:26:58 +02:00
1 parent c4f2bcc0c9
commit 7db77e83a3
15 files changed
+215 -89

No files matched your search

+7 -5
View File
@@ -6,9 +6,9 @@ what the model is told, the schema it answers in, what to do with the
answer), and running it is `desk.modeltask`'s.
A role is waiting while it has no summary, has some text, and is in the top
`summarise.per_agent` of an enabled agent's ungated scores. That bound is what
keeps the cost flat: a pull summarises the roles somebody will look at, not the
30k that are open. A batch built for named uids (the read page's Summarise
`summarise.per_agent` of an enabled agent's ungated scores at
`summarise.min_score` or more. That bound is what keeps the cost flat: a pull
summarises the roles somebody will look at, not the 30k that are open. A batch built for named uids (the read page's Summarise
button) takes those roles whatever their rank. See `Store.summarise_waiting`.
The text is `article_text` when the posting page was fetched, else
@@ -121,7 +121,8 @@ def _item(role: Role) -> dict[str, Any]:
def _waiting(config: Config, store: Store, limit: int,
uids: Sequence[str] | None = None) -> list[Role]:
return store.summarise_waiting(limit, config.summarise.per_agent, uids)
return store.summarise_waiting(limit, config.summarise.per_agent, uids,
min_score=config.summarise.min_score)
def build_batch(config: Config, store: Store, limit: int = 10,
@@ -165,7 +166,8 @@ TASK: ModelTask[SummariseResult] = ModelTask(
verb="summarising", noun="summaries", idle="nothing to summarise",
items="summaries",
settings=lambda config: config.summarise,
pending=lambda config, store: store.summarise_pending(config.summarise.per_agent),
pending=lambda config, store: store.summarise_pending(
config.summarise.per_agent, config.summarise.min_score),
waiting=lambda config, store, limit: [r.uid for r in _waiting(config, store, limit)],
build_batch=build_batch,
system=lambda store: SYSTEM,