Read role pages in an enrich stage after scoring, best roles first

The pull reads listings only. `enrich` (app/jobs/enrich.py) takes the open
roles without text that an enabled agent ranks ungated in its best
`enrich.top` at `enrich.min_score` or above, best score first, on boards
whose reader has `detail`, within `enrich.per_board` and `enrich.per_run`,
one batch per board. `plugins.ats.read_board_details` reads them and keeps
the per-board state; a read that gave no text is read again after
`enrich.retry_days` (finding 18). Filled roles are upserted, which drops
their vectors, and embed and score follow; `cascade.step` passes over both
when nothing was filled.

The pull cascade is pull, embed, score, enrich, embed, score, extract, score,
summarise. Saving an agent and changing a company's affinity queue the
`enrich` job (enrich, embed, score) behind their rescore; a vote does not.
The stage has a switch, `stage:enrich`, over `enrich.enabled`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 09:53:29 +02:00
1 parent 3adafd8950
commit 77b45a4b0f
10 files changed
+956 -219

No files matched your search

+20
View File
@@ -66,6 +66,25 @@ class SummariseConfig(ModelTaskConfig):
batch_size: int = Field(10, ge=1)
class EnrichConfig(Section):
"""Reading roles on their own pages after scoring, for the hosts whose
list carries no text. See app/jobs/enrich.py. A role is read when it has
no text and an enabled agent with a prompt ranks it ungated among its
best `top` and at `min_score` or above: the extract bar (`Limits`,
500 and 0.55) with the score a notch lower, since a role ranked on its
title alone is the one whose score its text moves most."""
enabled: bool = True
top: int = Field(500, ge=0)
min_score: float = Field(0.5, ge=0, le=1)
#: Reads per board and per run. Per board is the cap the pull had; the
#: boards are read in parallel on the `http` pool.
per_board: int = Field(200, ge=0)
per_run: int = Field(1000, ge=0)
#: Days before a page that gave no text is read again.
retry_days: int = Field(7, ge=1)
class Calibration(Section):
"""Where one embedding model's cosines sit, as `(lo, hi)` for fit and for
taste: `score.scale` maps `lo` to 0 and `hi` to 1 and clips outside, so a
@@ -181,6 +200,7 @@ class Config(Section):
extract: ExtractConfig = Field(default_factory=ExtractConfig)
summarise: SummariseConfig = Field(default_factory=SummariseConfig)
embed: EmbedConfig = Field(default_factory=EmbedConfig)
enrich: EnrichConfig = Field(default_factory=EnrichConfig)
#: Starter agents, imported once into an empty table.
agents: list[AgentSeed] = Field(default_factory=list)
#: Starter searches, imported once into an empty set of `search`