Mark a role whose title or text says remote while no field does, in prep with no model, and let it meet a gate on remote until extract has read it (migration 35, roles.remote_text)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-10-06 14:02:46 +02:00
1 parent f141cffc3c
commit 49929372c7
14 files changed
+144 -36

No files matched your search

+15
View File
@@ -55,6 +55,10 @@ CREATE TABLE IF NOT EXISTS roles (
country TEXT NOT NULL DEFAULT '',
remote TEXT NOT NULL DEFAULT ''
CHECK (remote IN ('', 'remote', 'hybrid', 'onsite')),
-- 1 when the title or text says the role is worked remotely while no
-- field does (prep, app.prep.words.remote_in_text): the location gate
-- lets such a role through until extract has read it.
remote_text INTEGER NOT NULL DEFAULT 0,
salary_min INTEGER,
salary_max INTEGER,
currency TEXT NOT NULL DEFAULT '',
@@ -760,6 +764,8 @@ UPDATE roles SET seniority = COALESCE(NULLIF(seniority_model, ''),
# judge reads every role again (judge.FORMAT).
(34, "agents.must_text, role_judgements.musts and broken dropped: the profile is the "
"CV, languages, likes and dislikes", lambda conn: _drop_musts(conn)),
(35, "roles.remote_text: the text says remote while no field does, read by prep for the "
"location gate", lambda conn: _add_remote_text(conn)),
)
#: What a file created from `SCHEMA` today is already at.
@@ -1009,6 +1015,15 @@ def _add_posting_url(conn: sqlite3.Connection) -> None:
conn.execute("ALTER TABLE roles ADD COLUMN posting_url TEXT NOT NULL DEFAULT ''")
def _add_remote_text(conn: sqlite3.Connection) -> None:
"""Migration 35's step: `roles.remote_text`, 0 until the next prep,
which maps every open role again since its rules changed. Runs twice
without harm."""
columns = {r[1] for r in conn.execute("PRAGMA table_info(roles)")}
if "remote_text" not in columns:
conn.execute("ALTER TABLE roles ADD COLUMN remote_text INTEGER NOT NULL DEFAULT 0")
def _add_remote_area(conn: sqlite3.Connection) -> None:
"""Migration 27's step: `roles.remote_model` empty and
`roles.remote_where_model` NULL for every role, so `extract` reads the