Bring the Python side to the ADR: the judge scores 0 to 10 with the cap at 4 and migration 33 clears every judgement, summarise reads the top 30 of the want and the match order, a hidden company's roles are never in the feed, and the company switch is called All locations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-10-04 21:40:32 +02:00
1 parent 6cad9713ac
commit 6d82287402
27 files changed
+390 -247

No files matched your search

+29 -3
View File
@@ -431,12 +431,14 @@ CREATE TABLE IF NOT EXISTS agent_cv_vectors (
-- One agent's judge reading of a role against its CV. Its own table, since
-- replace_scores rewrites scores every run and a judgement outlives that
-- and the role closing. skills, experience and career are 0 to 100,
-- cv_score their weighted total, strengths and gaps JSON lists. input_key
-- and the role closing. skills, experience and career are 0 to 10 (0 to
-- 100 until migration 33), cv_score their weighted total times 10 at the
-- default weights (not read: app.models.cv_score is worked out when a role
-- is served), strengths and gaps JSON lists. input_key
-- is a hash of the CV, prompts, avoid text and the role's text it read: a
-- different one is read again. musts is a JSON list of {id, text, verdict},
-- the model's verdict on each of the agent's must-haves (one per line of its
-- must text), broken how many are "broken": career counts as at most 39 then
-- must text), broken how many are "broken": career counts as at most 4 then
-- (app.models.BROKEN_CAP), applied when the role is served. tries counts
-- replies that left the role without one since; at 3 it is given up until the agent is saved again. A
-- row with judged_at NULL holds only tries.
@@ -758,6 +760,9 @@ UPDATE roles SET seniority = COALESCE(NULLIF(seniority_model, ''),
(32, "the cut: scores.fit and scores.cut, agents' limits reset to the cut's defaults, "
"prefer gates gone, saved_filters, and enrich renamed fetch text",
lambda conn: _add_cut(conn)),
# A Python step: JSON limits, and a count for the log.
(33, "the judge on 0 to 10: every judgement cleared to be made again, and summarise_top "
"50 becomes 30", lambda conn: _judge_out_of_ten(conn)),
)
#: What a file created from `SCHEMA` today is already at.
@@ -1191,6 +1196,27 @@ def _add_cut(conn: sqlite3.Connection) -> None:
"dropped", reset, dropped)
def _judge_out_of_ten(conn: sqlite3.Connection) -> None:
"""Migration 33's step. The judge scores 0 to 10 rather than 0 to 100
(`judge.FORMAT` 4), so every judgement is cleared: its numbers, the
verdicts, strengths and gaps, `input_key`, `judged_at` and `tries`, and no
old number is shown on the new scale. The rows stay, as rows of no
judgement, and the judge reads every pair again. An agent whose
`summarise_top` is 50, migration 32's default, takes 30, the new one.
Runs twice without harm."""
cleared = conn.execute(
"""UPDATE role_judgements
SET skills = NULL, experience = NULL, career = NULL, cv_score = NULL,
strengths = '[]', gaps = '[]', musts = '[]', broken = 0,
input_key = '', tries = 0, judged_at = NULL""").rowcount
lowered = conn.execute(
"""UPDATE agents SET limits = json_set(limits, '$.summarise_top', 30)
WHERE json_valid(limits) AND json_type(limits) = 'object'
AND json_extract(limits, '$.summarise_top') = 50""").rowcount
log.info("migration 33: %d judgements cleared for the 0 to 10 scale, %d agents' "
"summarise_top 50 set to 30", cleared, lowered)
def _add_all_roles(conn: sqlite3.Connection) -> None:
"""Migration 21's step. The column; the tag for every company that is a
favourite of any agent, since favourite no longer widens what a pull