Per-agent ranking: votes, affinity and a taste term; settings are three sub-tabs

Votes on roles and company affinity move to role_votes and agent_companies,
one row per search agent, so two agents rank the same roles differently. The
score gains taste, the cosine to mean(liked) - mean(passed) of the agent's
votes, as newsdesk ranks articles. The API takes agent on roles, votes and
companies and falls back to the default agent, the enabled one with the
lowest id.

Settings become Search agents (a list again, with New and Delete), Sources
(job boards, company boards and runs with the message log, one section per
plugin) and Account. Old paths answer 301 to their section.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-28 12:53:41 +02:00
1 parent 515d2250fc
commit a0772519b3
28 files changed
+1461 -668

No files matched your search

+9 -3
View File
@@ -264,7 +264,8 @@ class Role(Model):
raw: JsonDict = {}
extracted_at: str | None = None
created_at: str
#: None unjudged, else -1 pass, 0 neutral, 1 like.
#: The vote of the agent the role was read for (see `role_votes`): None
#: unjudged, else -1 pass, 0 neutral, 1 like.
vote: Literal[-1, 0, 1] | None = None
voted_at: str | None = None
summary: str = ""
@@ -297,6 +298,9 @@ class ScoredRole(Role):
class Company(Model):
"""A row of `companies`, with `affinity` as the agent it was read for
has it (see `agent_companies`); 0 when no agent was asked for."""
key: str
name: str
domain: str = ""
@@ -377,6 +381,8 @@ class Weights(Model):
fit: float = Field(0.6, ge=0)
recency: float = Field(0.2, ge=0)
affinity: float = Field(0.2, ge=0)
#: Cosine to the liked-minus-passed direction of the agent's votes.
taste: float = Field(0.2, ge=0)
class Agent(Model):
@@ -394,8 +400,8 @@ class Agent(Model):
class Candidate(Model):
"""What scoring reads about one open role for one agent: when it was
first seen, its company's affinity, and per gate `1` match, `0` no
match, `-1` the column is empty."""
first seen, its company's affinity for that agent, and per gate `1`
match, `0` no match, `-1` the column is empty."""
uid: str
first_seen: str