Summarise every saved or liked role whatever its rank, queue it at once on save or like, and shorten the order labels to Agent match, CV match and Newest so they fit one line

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Sonnet 5.5 committed 2026-10-03 23:14:12 +02:00
1 parent 1d0a4c37f2
commit ee8e450640
20 files changed
+208 -60

No files matched your search

+1 -1
View File
@@ -491,7 +491,7 @@ CREATE INDEX IF NOT EXISTS idx_role_remote_place ON role_remote(place_id, uid);
CREATE INDEX IF NOT EXISTS idx_roles_prep_due ON roles(prep_due) WHERE prep_due > 0;
-- The feed's Closing soon filter. Partial: most roles state no deadline.
CREATE INDEX IF NOT EXISTS idx_roles_deadline ON roles(deadline) WHERE deadline IS NOT NULL;
-- An agent's judgements, for its feed under Best CV match.
-- An agent's judgements, for its feed under CV match.
CREATE INDEX IF NOT EXISTS idx_role_judgements_agent ON role_judgements(agent_id, cv_score DESC);
"""
+13 -5
View File
@@ -145,7 +145,7 @@ def _cv_sql(weights: Weights | None) -> str:
def _by_cv(expression: str) -> str:
"""The order of Best CV match: the judged roles by `cv_score` (its SQL
"""The order of CV match: the judged roles by `cv_score` (its SQL
`expression`), then the rest by score, as `roles` orders them."""
return f"{expression} IS NULL, {expression} DESC, "
@@ -1143,7 +1143,7 @@ class Store:
no score.
With `by_cv` as well, the roles the agent's `judge` read come first
by `cv_score`, then the others by score (Best CV match). Every row
by `cv_score`, then the others by score (CV match). Every row
carries the agent's `cv_score` (None when not judged), computed
from the three numbers under the agent's weights at read time, and the
language flag of its languages against the agent's
@@ -1787,7 +1787,9 @@ class Store:
"""The `WHERE` for a role `summarise` may be sent: no summary yet and
some text to summarise. Given `uids`, those of them and nothing else,
open or not and given up or not, because somebody asked for them.
Otherwise open, not given up, and in `_top_scope`."""
Otherwise open, not given up, and in `_top_scope` or one the owner
cares about whatever its rank: saved (it has an application) or voted
up by an enabled agent."""
where = ["r.summary = ''",
"(TRIM(r.article_text) <> '' OR TRIM(r.description) <> '')"]
if uids is not None:
@@ -1800,7 +1802,12 @@ class Store:
f"""NOT EXISTS (SELECT 1 FROM state
WHERE key = '{self._SUMMARY_MISSED}' || r.uid
AND CAST(value AS INTEGER) >= {GIVE_UP_AFTER})""",
top,
f"""({top}
OR r.uid IN (SELECT role_uid FROM applications
WHERE role_uid IS NOT NULL)
OR r.uid IN (SELECT v.uid FROM role_votes v
JOIN agents a ON a.id = v.agent_id AND a.enabled = 1
WHERE v.vote = 1))""",
]
return " AND ".join(where), params
@@ -1813,7 +1820,8 @@ class Store:
"""Roles `summarise` has yet to write, newest first: the top of every
enabled agent's scores, as deep and as low as that agent's own
`limits` say, so the backlog is bounded by the agents rather than by
the number of open roles; given `uids`, those still without a
the number of open roles, and every open role that is saved or voted
up by an enabled agent, whatever its rank; given `uids`, those still without a
summary, whatever their rank. A batch asks again when it runs."""
where, params = self._summary_scope(uids)
return [Role.from_row(r) for r in self._rows(