Prep stage: host words stored raw, mapped centrally in app/prep after every pull

upsert_role stores the host's own words (roles.*_host), the place texts
unresolved when they change, and the company key unresolved on insert, and
marks the role prep_due. app.prep maps seniority, employment, remote and
country through the host tables in app/prep/hosts, resolves places and
company aliases, lists unknown words in `unmapped`, remaps every open role
when the tables' fingerprint changes, and runs rebuild_dupes, which moves
out of the pull's settle. Migration 22 adds the columns and the table and
fills the host words from raw. Cascade: pull, prep, embed, score, enrich,
prep, embed, score, extract, score, summarise. `app prep [unmapped]
[--remap]`, /api/prep/unmapped and a fold on the Sources page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 11:19:22 +02:00
1 parent a66aac95cf
commit d04ceae7e0
31 files changed
+1468 -330

No files matched your search

+3 -3
View File
@@ -197,9 +197,9 @@ def pay_line(lo: float | None, hi: float | None, currency: Any, period: str) ->
return f"{code} {bounds}{tail}" if code else f"{bounds}{tail} (no currency stated)"
#: The employment words a row's `employment` may hold, for every host. A
#: host's table maps its own words onto these; a word that names none of them
#: (a permanent contract says nothing about hours) maps to "".
#: A copy of `app.models.EMPLOYMENTS`, the vocabulary `app.prep` maps a
#: host's employment word onto, kept for the readers' tests since a plugin
#: imports nothing from `app`. `tests/test_prep.py` holds the two equal.
EMPLOYMENTS = ("full_time", "part_time", "contract", "temporary", "internship", "freelance")
_REMOTE_WORD = re.compile(r"\bremote\b", re.IGNORECASE)