# Architecture This is the owner's document: how a role gets from a board to the Roles feed, for one search agent, and the key decisions about that flow. It is the picture any change is made against. `decisions.md` is the detailed log behind it. Each stage says what the code does **today**, what was **decided** (since 2026-10-04, not built yet) and what is still **open**. Names: **fetch text** is the second HTTP read of a role's own page, with no model (the code calls it `enrich`). **Extract**, **judge** and **summarise** are the model calls. ``` company boards (ATS) search providers reach: Where lines + fetch terms, their own saved query only boards ≥300 roles whose host filters │ │ ▼ ▼ 1 Fetch ─ list pages: title, place, teaser or text │ ▼ 2 Cheap pass, no tokens ─ prep, embed, fit to the prompts, closeness to the CV, gates │ ▼ analysis score → the cut (at most N, each at least X) 3 Fetch text ─ the role's own page, for cut roles without text → embed, rescore │ ▼ 4 Model pass (Haiku), the whole cut ─ extract → rescore → judge │ ▼ 5 Feed ─ two orders: "what I'm looking for" (final score) and "what fits me" (CV match) front-end filters narrow either order │ ▼ 6 After the ranking ─ summarise the top of the feed ``` ## 1 Fetch **Today.** The Where lines become the reach: a country and remote filter the host applies. This only happens on boards with 300 or more roles whose host can filter by place. Smaller boards, and hosts that cannot filter, are read whole. Fetch terms only apply to companies set to All countries (Mistral AI and OpenAI today), and only on hosts that take a query (Workday, SuccessFactors, Oracle, Phenom, Eightfold, SmartRecruiters). Search providers send their own saved query and take neither filter. **Decided.** Where lines and fetch terms become one block on the agent form and follow one rule: each applies to every board with 300 or more roles whose host can filter on it. Fetch terms no longer depend on All countries. Agent 2 has no fetch terms today, so nothing changes on the live server until some are set. **Consequence.** The pull never closes a role against a read narrowed by terms, because that read is not the whole board. With terms on every big board, roles there close only by age. Accepted, since Wolf ranks on recency, not on `closed_at`. ## 2 Cheap pass **Today.** Every open role gets one score per agent: `(0.6 fit + 0.2 newness + 0.2 company affinity + 0.2 taste + prefer gates) / sum of the weights`. Fit is the calibrated cosine to the best of the agent's prompts. The gates (Where lines, titles to leave out) set a failing role's score to 0 with a reason. A gate rejects on evidence only, so a role with no known location still ranks until extract fills it in (323 of agent 2's 7,263 ungated roles). Closeness to the CV (`cv_fit`) is stored beside the score but is not part of it. That one score drives enrich, extract, summarise, judge and the feed order. **Decided.** The score is split in two: - The **analysis score** decides which roles get a second fetch and a model read. It uses fit to the prompts, closeness to the CV and company affinity, so a liked company gets more of its roles read. It leaves out newness (a pull runs every 6 hours and a role is read once), taste (votes come after the read) and prefer gates. - The **final score** orders the feed (section 5). Prefer gates leave the agent. Hybrid becomes a feed filter. **Decided: the cut is two lists, joined.** One list is by prompt fit (at most N, each at least X). The other is by CV closeness: the roles closest to the CV that the first list leaves out (at most M, each at least Y). The two scores are not merged into one number, because they answer different questions (what I want, what I am), and a merged number would let the stronger side crowd the other out. Wolf's starting sizes are about 500 by prompt fit and 150 by CV closeness. Within today's gates, 2,086 roles reach fit 0.6, 1,580 reach CV closeness 0.6, and 2,437 reach either. **Decided: affinity is a bonus on the level, as today in spirit.** A role's level on both lists rises by the company's affinity. Today the affinity term is weighted 0.2 out of 1.25, which puts a liked company about 0.05 above a neutral one and a favourite about 0.1 above. The cut keeps those sizes. The four company settings are hidden (-1), neutral (0), liked (1) and favourite (2). A hidden company is not scored at all, so it never reaches the cut or the feed. There is no level that pushes a company down without hiding it, and none is planned. Affinity remains a nudge, not a pass: a favourite's role that matches nothing stays out of the cut. **Decided: location guards the analysis cut.** For agent 2 on 2026-10-04 (24,711 open roles): | Gates on the cut | Roles passing | Fit ≥ 0.6 | Inside today's Where, of the top 500 by fit | Inside today's Where, of the top 150 | |---|---|---|---|---| | Today: Europe, Where lines, titles | 7,263 | 2,086 | 500 | 150 | | Europe and titles, no Where lines | 14,704 | 4,855 | 118 | 28 | | Titles only | 22,297 | 9,161 | 66 | 18 | Without the Where lines, about four in five model reads go to roles outside DK, SE, the Skåne towns and remote. Keeping today's coverage would then take a budget about four times larger, so the Where lines stay a guard on the cut. Companies on the follow-everywhere list (section 5) skip the Where lines, as favourites do today. **Decided: a role you like or save always makes the cut.** This is part of the analysis score, not a separate manual path: a like or a save passes the cut whatever the role's levels, so the role gets fetch text, extract and judge. It goes through on the next pull or agent save, not the moment you click. ## 3 Fetch text **Today.** The `enrich` stage reads the role's own page for open roles without text, on hosts that list without it. It uses its own bar from the config (`enrich.top` 500, `enrich.min_score` 0.5, at most 200 per board and 1,000 per run). Embed and score run again for the roles it filled. **Decided.** Fetch text reads the whole analysis cut, so every role the model will read has its text first. The stage is renamed from `enrich` to fetch text so it is not mistaken for a model call. ## 4 Model pass **Today.** Extract and judge run on Haiku (summarise is in section 6). Each limit is a count *and* a minimum score: at most N roles, each scoring at least X. The count is a ceiling and the score is the real stop. - **Extract** reads at most 500 roles scoring at least 0.55. It fills location, remote area, seniority, languages and deadline. A rescore follows so the gates see these columns. - **Judge** reads at most 150 roles scoring at least 0.55, plus the 50 closest to the CV that those leave out. It scores skills, experience and career 0 to 100, plus a verdict on each must-have. These are weighted 30/25/30 into `cv_score`. **Decided.** One depth: the analysis cut is the only gate, and every scoring model stage reads all of it. A second score inside the cut would defeat the purpose of the cut. The order is: 1. **Extract** reads the whole cut. It is the small, fast call (about 1.5 s a role on the live backend). 2. A rescore applies the gates to what extract filled, mainly location and remote area. The cut is the same gate as before, recomputed with better facts. A role that a rescore moves into the cut is extracted on the next pull. 3. **Judge** reads the cut as recomputed (about 6 s a role). The form wording for the sizes becomes "at most N, each scoring at least X", in place of "the best N down to a score of X". **Cost.** Every model read happens once per role (judge once per role and CV), so a larger cut costs mostly a one-off catch-up. With a cut of about 650 roles, that catch-up is about 16 minutes of extract and about an hour of judge on the live backend (`claude_code`, the subscription, so no per-token bill). After it, each pull reads only the roles new to the cut. The recurring cost is a re-judge: changing the CV, a prompt, or the like or dislike text changes every judgement's input, so the whole cut is judged again, about an hour for 650 roles. A changed posting text re-judges that role only. Accepted: the re-judge takes a while but is correct, since the old judgements were made against the old text. **Decided: extract and judge stay two calls.** Extract needs no CV and its location and remote answers feed the rescore before judge reads anything. Judge works per agent and role, with the CV in the system prompt. ## 5 Feed **Today.** There are two orders. **Score** uses the same score as section 2. **CV match** shows the judged roles first by `cv_score`, then the unjudged ones by CV closeness. Roles gated by the agent are hidden unless Show gated is ticked, so the front-end place filter can only narrow inside the Where lines. A favourite company (affinity 2) skips the Where lines but also gains in the score; that is why OpenAI's London roles rank. All countries and All roles are separate company flags that only change what is fetched. **Decided.** There are two orders: "what I'm looking for" (final score) and "what fits me" (CV match). The final score includes newness and likes. It is not one blended number. **Open.** - What the final score is made of: whether fit stays at 0.6, and whether it reads extracted facts such as seniority. - Location in the feed: does the agent's Where keep hiding roles, or is location only a front-end filter on top of the analysis cut? - A follow-everywhere company group. It is shown as a feed filter, skips the Where lines in the cut, and is fetched across all countries without fetch terms. It would replace three things: favourite as a workaround, All countries and All roles. ## 6 After the ranking **Today.** Summarise reads at most 30 roles scoring at least 0.65, plus the roles you saved or liked. It runs inside the model pass, on the same score. **Decided.** Summarise is not part of the preparation or the scoring. It runs once the final scores are set, on the top of the feed by the final score, with its own size on the form (50 to start, as a slider). Roles you saved or liked are summarised too, as today.