Rank by the cut: fetch gate overrides in scoring, the cut per agent, stages read the cut, fetch text renamed from enrich, the feed kept to the fetch gate, and migration 32

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-10-04 15:11:43 +02:00
1 parent 060ccf66e6
commit 617356e60c
35 files changed
+1054 -751

No files matched your search

+48 -40
View File
@@ -1450,28 +1450,29 @@ GateField = Literal["place", "country", "remote", "remote_from", "seniority", "f
"salary_min", "currency", "permit", "languages", "company", "title"]
GATE_FIELDS: tuple[str, ...] = get_args(GateField)
GateMode = Literal["require", "any", "prefer", "exclude"]
GateMode = Literal["require", "any", "exclude"]
class Gate(Model):
"""One condition of an agent. `require` gates a role that fails it (the
row is kept with the reason); the `any` gates together are one group a
role must match at least one of ("in Denmark, or remote"); `prefer` adds
`weight` to its score when it matches; `exclude` gates a role that matches
any of its values ("title account executive"), a favourite's too. A gate
rejects on evidence only: a
role whose column is empty is not rejected, since `extract` fills the
column later for the roles that rank, and only for those."""
"""One condition of an agent's fetch gate. `require` gates a role that
fails it (the row is kept with the reason); the `any` gates together are
one group a role must match at least one of ("in Denmark, or remote");
`exclude` gates a role that matches any of its values ("title account
executive"). A company set to All countries skips the `any` group and one
set to All roles skips the `exclude` gates on `title` (`score.failed_gates`).
A gate rejects on evidence only: a role whose column is empty is not
rejected, since `extract` fills the column later for the roles in the
cut, and only for those."""
field: GateField
values: list[str | int | float] = Field(min_length=1)
mode: GateMode = "require"
weight: float = Field(1.0, ge=0)
class Weights(Model):
"""How much each score term counts. Summed with the prefer gates' weights
into the denominator, so a score stays in 0..1 whatever the numbers."""
"""How much each term of the final score counts. The score is the
weighted sum over the sum of the weights, so it stays in 0..1 whatever
the numbers."""
fit: float = Field(0.6, ge=0)
recency: float = Field(0.2, ge=0)
@@ -1488,31 +1489,21 @@ class Weights(Model):
class Limits(Model):
"""How far down an agent's ranking the two model stages read. Each pair
is a top N, the backstop, and a minimum score, the real stop: a role
is read when it is among the agent's best `extract_top` ungated scores
and not below `extract_min`, and summarised likewise. Fit is a
calibrated level (`score.scale`), so a bar means the same in every run.
A fresh role with the worst fit scores about 0.27 on the default
weights, a perfect one about 0.87. Measured on 16,841 open roles for the
"Copenhagen engineering" starter agent (4,156 ungated, no votes), 0.55
admits about 300 roles to extract and 0.65 about 35 to summarise, the
long answer; the top N catches an agent whose bar admits far more. An
agent keeps the limits stored with it; only a key its JSON lacks
follows these defaults."""
"""The agent's cut and the depth of summarise. The cut is the roles that
get fetch text, extract and judge (`app.jobs.score`): the best
`cut_fit_top` by fit level at or above `cut_fit_min`, then the best
`cut_cv_top` by CV level at or above `cut_cv_min` that the first list
leaves out, then every role liked or saved. Both levels are calibrated
(`score.scale`) with the company's affinity as a small bonus, so a
minimum means the same in every run. For a broad agent the count stops a
list, for a narrow one the minimum. Summarise reads the best
`summarise_top` by final score, and every role liked or saved."""
extract_top: int = Field(500, ge=0)
extract_min: float = Field(0.55, ge=0, le=1)
summarise_top: int = Field(30, ge=0)
summarise_min: float = Field(0.65, ge=0, le=1)
#: How deep `judge` reads an agent with a CV: a long answer per role,
#: so between summarise's 30 and extract's 500.
judge_top: int = Field(150, ge=0)
judge_min: float = Field(0.55, ge=0, le=1)
#: And the agent's ungated roles closest to its CV (`scores.cv_fit`, see
#: `app.jobs.score`) that the pair above leaves out, as many as this:
#: a role the prompts rank low can still be one the CV fits.
judge_cv_top: int = Field(50, ge=0)
cut_fit_top: int = Field(500, ge=0)
cut_fit_min: float = Field(0.6, ge=0, le=1)
cut_cv_top: int = Field(150, ge=0)
cut_cv_min: float = Field(0.6, ge=0, le=1)
summarise_top: int = Field(50, ge=0)
class Prompt(Model):
@@ -1601,16 +1592,33 @@ class Agent(Model):
created_at: str
class SavedFilter(Model):
"""A row of `saved_filters`: the feed's filter settings saved under a
name for one agent. `query` is the feed's query string as `roles.js`
writes it, without the agent. There is no editing: a change is a new
one."""
id: int
name: str
query: str
created_at: str
class Candidate(Model):
"""What scoring reads about one open role for one agent: its posted
date (for `recency`), its company's affinity for that agent, and per
gate `1` match, `0` no match, `-1` the column is empty. An `exclude`
gate's match is the position of the first value it matched, from 1, so
the reason can name it."""
date (for `recency`), its company's affinity for that agent and the
company's two overrides of the fetch gate, and per gate `1` match, `0`
no match, `-1` the column is empty. An `exclude` gate's match is the
position of the first value it matched, from 1, so the reason can name
it."""
uid: str
posted_at: str
affinity: int = 0
#: `companies.all_countries`: the `any` group (the place part) is skipped.
all_countries: bool = False
#: `companies.all_roles`: the `exclude` gates on `title` are skipped.
all_roles: bool = False
gates: list[int] = []