Compose remote as model, host word, place line and map a remote role's area in prep

The area is the model's names, else the parts of the place texts that say remote, else the resolved places as their countries. VERSION 3 maps every open role again. run_roles maps the roles extract answered. "Remote Sensing" in a title is no remote work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 16:00:06 +02:00
1 parent 57cac5f896
commit e4c0de4465
5 files changed
+139 -36

No files matched your search

+14 -12
View File
@@ -205,21 +205,23 @@ def test_a_prep_that_read_old_words_leaves_the_role_due(store: Store) -> None:
assert row(store, "1")["prep_due"] == 2
def test_the_model_level_wins_and_a_place_guess_never_overwrites_extract(
def test_the_model_level_and_remote_win_over_the_host_and_the_place_line(
store: Store) -> None:
store.upsert_role(item("1", title="Senior Engineer", place="Hybrid, Berlin"))
uid = row(store, "1")["uid"]
with store.transaction() as conn:
conn.execute("UPDATE roles SET seniority_model = 'lead', remote = 'remote' "
"WHERE uid = ?", (uid,))
prep.run(store, tables=TABLES)
mapped = row(store, "1")
assert (mapped["seniority_title"], mapped["seniority"], mapped["remote"]) == \
("senior", "lead", "remote")
# The host's own statement does overwrite.
store.upsert_role(item("1", title="Senior Engineer", place="Hybrid, Berlin", remote="2"))
prep.run(store, tables=TABLES)
assert row(store, "1")["remote"] == "hybrid"
# The host's own word wins over the line.
store.upsert_role(item("1", title="Senior Engineer", place="Hybrid, Berlin", remote="fully"))
prep.run(store, tables=TABLES)
assert row(store, "1")["remote"] == "remote"
uid = row(store, "1")["uid"]
with store.transaction() as conn:
conn.execute("UPDATE roles SET seniority_model = 'lead', remote_model = 'onsite' "
"WHERE uid = ?", (uid,))
prep.run(store, tables=TABLES, remap=True)
mapped = row(store, "1")
assert (mapped["seniority_title"], mapped["seniority"], mapped["remote"]) == \
("senior", "lead", "onsite")
def test_the_company_resolves_through_its_aliases(store: Store) -> None:
@@ -314,7 +316,7 @@ def test_migration_22_fills_the_host_words_from_raw(tmp_path: Path) -> None:
migrated = Store(path)
assert migrated.migrations_applied == [22, 23, 24, 25, 26]
assert migrated.migrations_applied == [22, 23, 24, 25, 26, 27]
one = row(migrated, "1")
assert (one["seniority_host"], one["employment_host"], one["remote_host"],
one["country_host"]) == ("senior", "full_time", "true", "DK")