Split the agent form's fetch gate into world, location, role exclusion and role fetch, and name the analytics filter and the feed score weights

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Sonnet 5.5 committed 2026-10-04 21:33:31 +02:00
1 parent 744d14160d
commit b6e27fcb26
3 files changed
+86 -70

No files matched your search

+28 -25
View File
@@ -3,17 +3,19 @@
* *
* Every agent from `/api/agents` is a card, newest first: its name, its * Every agent from `/api/agents` is a card, newest first: its name, its
* switch, its prompts, its gates in words, its weights, and a link to the * switch, its prompts, its gates in words, its weights, and a link to the
* Roles tab in its order. The prompts are the body, since fit is measured * Roles tab in its order. The prompts are the body, since prompt closeness is
* against the one a role fits best; the weights only share out the terms. * measured against the one a role is closest to; the weights only share out the terms.
* The form edits the prompts as rows, and the fetch gate in three parts: the * The form edits the prompts as rows, and the fetch gate in four parts, in the
* region (the scope select), the place (a short list of lines a role passes by * ADR's order: the world (the scope select), the location (a short list of
* matching any one of: countries, towns, remote) and the role (the fetch terms * lines a role passes by matching any one of: countries, towns, remote), the
* and the titles to leave out), over a row per remaining rule under Advanced; * role exclusion (the titles to leave out) and the role fetch (the fetch
* a gate the three parts cannot say lands in a row, so a load and a save lose * terms), over a row per remaining rule under Advanced; a gate the four parts
* nothing. A gate is a field, values and a mode (must, one of, not), with no * cannot say lands in a row, so a load and a save lose nothing. A gate is a
* weight. After it come the feed order (the four weights of the final score and * field, values and a mode (must, one of, not), with no weight. After it come
* the CV match weights), the cut (the best N by fit and the best M by CV * the analytics filter (the best N by prompt closeness and the best M by CV
* closeness, each with a minimum level) and the size of summarise. Edit turns a card * closeness, each with a minimum level), the want feed score weights (prompt
* closeness, newness, company like, job like), the CV match weights and the
* size of summarise. Edit turns a card
* into the form from the page's `<template>`, in place, and New agent puts a * into the form from the page's `<template>`, in place, and New agent puts a
* blank card on top in the same state. One card edits at a time, so the * blank card on top in the same state. One card edits at a time, so the
* form's ids stay unique. Votes, liked companies and scores are the agent's, * form's ids stay unique. Votes, liked companies and scores are the agent's,
@@ -47,13 +49,14 @@
const DEFAULT_WEIGHTS = { fit: 0.6, recency: 0.2, affinity: 0.2, taste: 0.2, const DEFAULT_WEIGHTS = { fit: 0.6, recency: 0.2, affinity: 0.2, taste: 0.2,
cv_skills: 30, cv_experience: 25, cv_career: 30 }; cv_skills: 30, cv_experience: 25, cv_career: 30 };
// What the models read after a pull, per agent (`app.models.Limits`): the // What the models read after a pull, per agent (`app.models.Limits`): the
// cut is the best `cut_fit_top` roles by fit at `cut_fit_min` or more, then // analytics filter is the best `cut_fit_top` roles by prompt closeness at
// the best `cut_cv_top` by CV closeness at `cut_cv_min` or more that the // `cut_fit_min` or more, then the best `cut_cv_top` by CV closeness at
// first list leaves out, and every role liked or saved. Fetch text, extract // `cut_cv_min` or more that the first list leaves out, and every role liked
// and judge read the cut; summarise reads the top `summarise_top` of the // or saved: the cut. Fetch text, extract and judge read the cut; summarise
// feed and the roles liked or saved. // reads the top `summarise_top` of each feed order, want and match, and the
// roles liked or saved.
const DEFAULT_LIMITS = { cut_fit_top: 500, cut_fit_min: 0.6, cut_cv_top: 150, cut_cv_min: 0.6, const DEFAULT_LIMITS = { cut_fit_top: 500, cut_fit_min: 0.6, cut_cv_top: 150, cut_cv_min: 0.6,
summarise_top: 50 }; summarise_top: 30 };
// The levels of a language, the order of the server's ladder, and how big a // The levels of a language, the order of the server's ladder, and how big a
// CV file the browser reads into the box. // CV file the browser reads into the box.
const LEVELS = ["basic", "conversational", "professional", "fluent", "native"]; const LEVELS = ["basic", "conversational", "professional", "fluent", "native"];
@@ -233,7 +236,7 @@
function weightsLine(row) { function weightsLine(row) {
const w = Object.assign({}, DEFAULT_WEIGHTS, row.weights); const w = Object.assign({}, DEFAULT_WEIGHTS, row.weights);
return `fit ${w.fit} · newness ${w.recency} · companies ${w.affinity} · liked ${w.taste}` return `prompt closeness ${w.fit} · newness ${w.recency} · company like ${w.affinity} · job like ${w.taste}`
+ ` · CV match: skills ${w.cv_skills}, experience ${w.cv_experience}, career ${w.cv_career}`; + ` · CV match: skills ${w.cv_skills}, experience ${w.cv_experience}, career ${w.cv_career}`;
} }
@@ -299,18 +302,18 @@
return sentences.join(" "); return sentences.join(" ");
} }
// What the models read after a pull: the cut, then the stages that read // What the models read after a pull: the analytics filter's cut, then the
// it, then summarise's own size. A stage that is off says so, with a link to // stages that read it, then summarise's own size. A stage that is off says so, with a link to
// its switch under Runs: the numbers are only what it would read once it is // its switch under Runs: the numbers are only what it would read once it is
// on. The stage names are those of `/api/stages`. // on. The stage names are those of `/api/stages`.
function limitsLine(row) { function limitsLine(row) {
const l = Object.assign({}, DEFAULT_LIMITS, row.limits); const l = Object.assign({}, DEFAULT_LIMITS, row.limits);
const p = el("p", "agent-limits"); const p = el("p", "agent-limits");
const lists = []; const lists = [];
if (l.cut_fit_top) lists.push(`the best ${l.cut_fit_top} by fit at ${l.cut_fit_min} or more`); if (l.cut_fit_top) lists.push(`the best ${l.cut_fit_top} by prompt closeness at ${l.cut_fit_min} or more`);
if (l.cut_cv_top) lists.push(`the best ${l.cut_cv_top} by closeness to the CV at ${l.cut_cv_min} or more`); if (l.cut_cv_top) lists.push(`the best ${l.cut_cv_top} by CV closeness at ${l.cut_cv_min} or more`);
const cut = lists.length ? `${lists.join(", then ")}, and liked and saved roles` : "liked and saved roles only"; const cut = lists.length ? `${lists.join(", then ")}, and liked and saved roles` : "liked and saved roles only";
p.append(`The cut: ${cut}.`); p.append(`Analytics filter: ${cut}.`);
const off = (name, would) => { const off = (name, would) => {
const a = link("/settings/sources#stages", `${name} is off`); const a = link("/settings/sources#stages", `${name} is off`);
a.title = "Switch it on under Runs."; a.title = "Switch it on under Runs.";
@@ -323,7 +326,7 @@
p.append(` ${said[0].toUpperCase()}${said.slice(1)} ${on.length > 1 ? "read" : "reads"} it`); p.append(` ${said[0].toUpperCase()}${said.slice(1)} ${on.length > 1 ? "read" : "reads"} it`);
} }
for (const [key, name] of reads) if (stageOn[key] === false) off(name, "reads the cut"); for (const [key, name] of reads) if (stageOn[key] === false) off(name, "reads the cut");
const summarised = `the top ${l.summarise_top} of the feed and liked and saved roles`; const summarised = `the top ${l.summarise_top} of each feed order and liked and saved roles`;
if (stageOn.summarise === false) off("summarise", `summarises ${summarised}`); if (stageOn.summarise === false) off("summarise", `summarises ${summarised}`);
else p.append(` · summarises ${summarised}`); else p.append(` · summarises ${summarised}`);
return p; return p;
@@ -345,7 +348,7 @@
const prompts = promptsOf(row).filter((p) => p.text.trim()); const prompts = promptsOf(row).filter((p) => p.text.trim());
if (!prompts.length) { if (!prompts.length) {
div.appendChild(el("p", "agent-intent empty", "Nothing described yet, so fit has nothing to measure against. Edit says what this agent looks for.")); div.appendChild(el("p", "agent-intent empty", "Nothing described yet, so prompt closeness has nothing to measure against. Edit says what this agent looks for."));
} }
for (const prompt of prompts) { for (const prompt of prompts) {
// A lone prompt named after its agent, as a migrated intent is, says its name once. // A lone prompt named after its agent, as a migrated intent is, says its name once.
+38 -37
View File
@@ -3,12 +3,12 @@
{# A card per agent: `static/agents.js` fills the list from `/api/agents`, {# A card per agent: `static/agents.js` fills the list from `/api/agents`,
newest first. A card shows the agent's prompts, its fetch gate in words, its newest first. A card shows the agent's prompts, its fetch gate in words, its
switch, its weights, its cut and its summarise size; Edit turns that card into the form below, in place, and New puts switch, its weights, its analytics filter and its summarise size; Edit turns
a blank one on top. The form is a `<template>` because only one card edits that card into the form below, in place, and New puts a blank one on top. The form is a `<template>` because only one card edits
at a time, so its ids stay unique. #} at a time, so its ids stay unique. #}
{% block content %} {% block content %}
<h1>Search agents</h1> <h1>Search agents</h1>
<p class="lede">A search agent is what the Roles tab ranks by: describe each kind of role you want as a prompt, set the fetch gate (where, what role), and it measures every open role against the prompt each fits best. Several agents rank the same roles differently, each with its own votes and liked companies; Viewing as on Roles picks one, and its votes are that agent's.</p> <p class="lede">A search agent is what the Roles tab ranks by: describe each kind of role you want as a prompt, set the fetch gate (world, location, role exclusion, role fetch), and it measures every open role's closeness to the prompt it is closest to. Several agents rank the same roles differently, each with its own votes and liked companies; Viewing as on Roles picks one, and its votes are that agent's.</p>
<div class="agents-head"> <div class="agents-head">
<p id="agents-count" class="count" role="status"></p> <p id="agents-count" class="count" role="status"></p>
@@ -24,24 +24,24 @@
<legend>What you are looking for</legend> <legend>What you are looking for</legend>
<div id="a-prompts" class="prompt-rows"></div> <div id="a-prompts" class="prompt-rows"></div>
<button type="button" id="a-add-prompt" class="secondary">Add prompt</button> <button type="button" id="a-add-prompt" class="secondary">Add prompt</button>
<span class="hint">A prompt is one kind of role in your own words: the work, the level, the setting. A role is ranked by the prompt it fits best, so three kinds of role are three prompts, not one blended paragraph. Votes and liked companies count for the whole agent.</span> <span class="hint">A prompt is one kind of role in your own words: the work, the level, the setting. A role is ranked by the prompt it is closest to, so three kinds of role are three prompts, not one blended paragraph. Votes and liked companies count for the whole agent.</span>
</fieldset> </fieldset>
<fieldset class="where"> <fieldset class="where">
<legend>The fetch gate</legend> <legend>The fetch gate</legend>
<span class="hint">Hard rules, a yes or no per role, applied at every stage: at the host where it can filter, before anything is scored, again after extract has read the posting, and in the feed. A role that fails is never read by a model and never shown. A rule rejects on evidence only: a role whose location is not known yet passes until extract reads it. A company set to All countries skips the place part and one set to All roles skips the role part, for every agent; both are switched under Sources.</span> <span class="hint">Hard rules, a yes or no per role, in four parts. A role that fails is never read by a model and never shown. A rule rejects on evidence only: a role whose location is not known yet passes until extract reads it. Two company switches under Sources override parts for every agent: All locations bypasses Location, All roles bypasses Role exclusion and Role fetch.</span>
<h3>Region</h3> <h3>World</h3>
<div class="where-line"> <div class="where-line">
<span>Only roles in:</span> <span>Only roles in:</span>
<select id="a-scope" aria-label="Only roles in"> <select id="a-scope" aria-label="World: only roles in">
<option value="europe">Europe</option> <option value="europe">Europe</option>
<option value="countries">Chosen countries</option> <option value="countries">Chosen countries</option>
<option value="everywhere">Everywhere</option> <option value="everywhere">Everywhere</option>
</select> </select>
<div id="a-scope-countries"></div> <div id="a-scope-countries"></div>
</div> </div>
<span class="hint">Every role must be in this, and no company switch lifts it. A company set to All countries is fetched and kept from the whole region.</span> <span class="hint">The outer countries. Every role must be in them, and no company switch lifts this. All locations falls back to it.</span>
<h3>Place</h3> <h3>Location</h3>
<span class="hint">A role passes when it matches at least one line: a country, a town or remote, so a line more means more roles. With every line empty a role can be anywhere in the region.</span> <span class="hint">A role passes when it matches at least one line: a country, a town or remote, so a line more means more roles. With every line empty a role can be anywhere in the world gate.</span>
<div class="where-line"> <div class="where-line">
<span>Anywhere in</span> <span>Anywhere in</span>
<div id="a-countries"></div> <div id="a-countries"></div>
@@ -55,28 +55,29 @@
<span>Remote:</span> <span>Remote:</span>
<select id="a-remote" aria-label="Remote"> <select id="a-remote" aria-label="Remote">
<option value="none">no</option> <option value="none">no</option>
<option value="scope">anywhere within the region</option> <option value="scope">anywhere within the world gate</option>
<option value="from">only when open to someone in:</option> <option value="from">only when open to someone in:</option>
</select> </select>
<div id="a-remote-from"></div> <div id="a-remote-from"></div>
</div> </div>
<span class="hint">A remote role passes on top of the lines above. A remote role whose area is not stated yet passes until extract reads the posting.</span> <span class="hint">A remote role passes on top of the lines above. A remote role whose area is not stated yet passes until extract reads the posting.</span>
<h3>Role</h3> <h3>Role exclusion</h3>
<div class="where-line">
<span>Only roles matching</span>
<div id="a-terms"></div>
</div>
<span class="hint">Fetch terms, separated by a comma or Enter: <code>machine learning, data science</code> is two terms, and <code>machine learning</code> is searched as one. They are asked of the host, which then sends only roles with one of the terms anywhere in the ad, not only the title. They apply on boards of 300 or more roles whose host takes a query, and only there; smaller boards and other hosts are read whole. Empty means no narrowing.</span>
<div class="where-line"> <div class="where-line">
<span>Leave out titles with</span> <span>Leave out titles with</span>
<div id="a-titles"></div> <div id="a-titles"></div>
</div> </div>
<span class="hint">Phrases, separated by a comma or Enter. A phrase matches whole words anywhere in the title, whatever the case: <code>account executive</code> takes "Enterprise Account Executive, UK", and <code>data engineer</code> leaves "Data Engineering Manager" alone. A shorter phrase takes more: <code>sales</code> takes Sales Engineer too. A host cannot be asked this, so it applies once the roles are in, to liked companies as well. A role left out keeps its row, and Show gated on Roles lists it with the phrase that took it.</span> <span class="hint">Phrases, separated by a comma or Enter. A phrase matches whole words anywhere in the title, whatever the case: <code>account executive</code> takes "Enterprise Account Executive, UK", and <code>data engineer</code> leaves "Data Engineering Manager" alone. A shorter phrase takes more: <code>sales</code> takes Sales Engineer too. No host can be asked this, so it is applied to every role after the fetch, liked companies included. A role left out keeps its row, and Show gated on Roles lists it with the phrase that took it.</span>
<h3>Role fetch</h3>
<div class="where-line">
<span>Only roles matching</span>
<div id="a-terms"></div>
</div>
<span class="hint">Fetch terms, separated by a comma or Enter: <code>machine learning, data science</code> is two terms, and <code>machine learning</code> is searched as one. A host that takes a query sends only roles with one of the terms anywhere in the ad, but only for boards of 300 or more roles; smaller boards and other hosts are read whole. The terms are ignored after the fetch, since prompt closeness is the finer filter. Empty means no narrowing.</span>
<p id="a-where-sum" class="where-sum" role="status"></p> <p id="a-where-sum" class="where-sum" role="status"></p>
</fieldset> </fieldset>
<fieldset class="terms cv"> <fieldset class="terms cv">
<legend>Your CV</legend> <legend>Your CV</legend>
<span class="hint">Optional. With a CV, the judge stage reads each of this agent's best roles against it and scores skills, experience and career, which CV match on Roles sorts by. A role is read at most once per change of the CV, the prompts or the texts below. The CV stays in this app and goes only to the model you set up.</span> <span class="hint">Optional. With a CV, the judge stage reads each of this agent's best roles against it and rates skills, experience and career from 0 to 10, which the CV match on Roles is made of. A role is read at most once per change of the CV, the prompts or the texts below. The CV stays in this app and goes only to the model you set up.</span>
<label>CV <label>CV
<textarea id="a-cv-text" rows="10" placeholder="Paste your CV or career summary here"></textarea></label> <textarea id="a-cv-text" rows="10" placeholder="Paste your CV or career summary here"></textarea></label>
<label>or read it from a file <label>or read it from a file
@@ -93,36 +94,36 @@
<textarea id="a-like-text" rows="4" placeholder="Building a team from scratch, close work with the product side, small companies, a say in the roadmap"></textarea></label> <textarea id="a-like-text" rows="4" placeholder="Building a team from scratch, close work with the product side, small companies, a say in the roadmap"></textarea></label>
<label>What I don't like <label>What I don't like
<textarea id="a-avoid-text" rows="4" placeholder="Constant on-call, sales targets, large consultancies, open-plan offices"></textarea></label> <textarea id="a-avoid-text" rows="4" placeholder="Constant on-call, sales targets, large consultancies, open-plan offices"></textarea></label>
<span class="hint">The work, the workplace, situations; read by the CV match for the career score. Rules that must hold go under the fetch gate or Other rules instead.</span> <span class="hint">The work, the workplace, situations; read by the judge for the career rating. Rules that must hold go under the fetch gate or Other rules instead.</span>
</fieldset> </fieldset>
<fieldset class="weights limits">
<legend>Analytics filter</legend>
<label>Prompt closeness: the best <input type="number" id="a-cut-fit-top" min="0" step="10" value="500"></label>
<label>each at least <input type="number" id="a-cut-fit-min" min="0" max="1" step="0.05" value="0.6"></label>
<label>CV closeness: the best <input type="number" id="a-cut-cv-top" min="0" step="10" value="150"></label>
<label>not already in, each at least <input type="number" id="a-cut-cv-min" min="0" max="1" step="0.05" value="0.6"></label>
</fieldset>
<span class="hint">Of the roles that pass the fetch gate, the analytics filter keeps the best N by prompt closeness and, of the rest, the best M by CV closeness. Liked and saved roles always pass, whatever their closeness. The roles that pass, the cut, get fetch text, extract and judge, so it sets what the models read. Closeness is a level from 0 to 1, the same in every run and free to compute; a liked company adds about 0.056 to it and a favourite about 0.111. For a broad agent the count stops a list, for a narrow one the minimum does, so roles that do not fit are not read to fill the count. An agent with no prompt has no prompt list, and one with no CV no CV list.</span>
<fieldset class="weights"> <fieldset class="weights">
<legend>The feed order</legend> <legend>Want feed score</legend>
<label>Fit to the prompts <input type="number" id="a-fit" min="0" step="0.05" value="0.6"></label> <label>Prompt closeness <input type="number" id="a-fit" min="0" step="0.05" value="0.6"></label>
<label>Newness <input type="number" id="a-recency" min="0" step="0.05" value="0.2"></label> <label>Newness <input type="number" id="a-recency" min="0" step="0.05" value="0.2"></label>
<label>Companies you like <input type="number" id="a-affinity" min="0" step="0.05" value="0.2"></label> <label>Company like <input type="number" id="a-affinity" min="0" step="0.05" value="0.2"></label>
<label>Roles you liked <input type="number" id="a-taste" min="0" step="0.05" value="0.2"></label> <label>Job like <input type="number" id="a-taste" min="0" step="0.05" value="0.2"></label>
</fieldset> </fieldset>
<span class="hint">The final score, which orders What I'm looking for on Roles: the weighted sum of the four over the sum of the weights. Newness halves every 14 days; Roles you liked is a role's closeness to the roles you liked, away from those you passed. Changing the weights re-sorts and reads nothing.</span> <span class="hint">Orders What I'm looking for on Roles: the weighted sum of the four over the sum of the weights. Newness halves every 14 days; job like is a role's closeness to the roles you liked, away from those you passed. Changing the weights re-sorts and reads nothing.</span>
<fieldset class="weights"> <fieldset class="weights">
<legend>How much each counts in the CV match</legend> <legend>CV match weights</legend>
<label>Skills <input type="number" id="a-cv-skills" min="0" step="5" value="30"></label> <label>Skills <input type="number" id="a-cv-skills" min="0" step="5" value="30"></label>
<label>Experience <input type="number" id="a-cv-experience" min="0" step="5" value="25"></label> <label>Experience <input type="number" id="a-cv-experience" min="0" step="5" value="25"></label>
<label>Career <input type="number" id="a-cv-career" min="0" step="5" value="30"></label> <label>Career <input type="number" id="a-cv-career" min="0" step="5" value="30"></label>
</fieldset> </fieldset>
<span class="hint">The judge's three numbers are averaged with these shares into the CV match. Changing them re-sorts at once and asks the model for nothing; 0 leaves a number out, all three 0 means no CV match.</span> <span class="hint">The judge rates skills, experience and career from 0 to 10; the CV match, from 0 to 100, is those three weighted by these shares. It orders What fits me on Roles. Changing the weights re-sorts at once and asks the model for nothing; 0 leaves a number out, all three 0 means no CV match.</span>
<fieldset class="weights limits">
<legend>The cut</legend>
<label>Fit to the prompts: the best <input type="number" id="a-cut-fit-top" min="0" step="10" value="500"></label>
<label>each at least <input type="number" id="a-cut-fit-min" min="0" max="1" step="0.05" value="0.6"></label>
<label>Closeness to the CV: the best <input type="number" id="a-cut-cv-top" min="0" step="10" value="150"></label>
<label>not already in, each at least <input type="number" id="a-cut-cv-min" min="0" max="1" step="0.05" value="0.6"></label>
</fieldset>
<span class="hint">Of the roles that pass the fetch gate, the cut holds the best by fit and, of the rest, the best by closeness to the CV. Liked and saved roles are always in, whatever their levels. The cut gets fetch text, extract and judge, so it sets what the models read. Both are levels from 0 to 1, the same in every run and free to compute; a liked company adds about 0.05 to them and a favourite about 0.1. For a broad agent the count stops a list, for a narrow one the minimum does, so roles that do not fit are not read to fill the count. An agent with no prompt has no fit list, and one with no CV no closeness list.</span>
<fieldset class="weights limits"> <fieldset class="weights limits">
<legend>After the ranking</legend> <legend>After the ranking</legend>
<label>Summarise the top <input type="number" id="a-summarise-top" min="0" step="5" value="50"></label> <label>Summarise the top <input type="number" id="a-summarise-top" min="0" step="5" value="30"> of each feed order</label>
</fieldset> </fieldset>
<span class="hint">Summarise writes a short summary and tags for the top of the feed by the final score, and for every role you liked or saved, whatever its score. It is no part of any score.</span> <span class="hint">Summarise writes a short summary and tags for the top N of What I'm looking for and the top N of What fits me, at most twice N roles, and for every role you liked or saved. It is no part of any score.</span>
<details class="advanced"> <details class="advanced">
<summary>Advanced</summary> <summary>Advanced</summary>
<div class="advanced-body"> <div class="advanced-body">
+20 -8
View File
@@ -566,13 +566,13 @@ def test_one_role_and_its_read_page(client: TestClient, store: Store) -> None:
assert missing.status_code == 404 and "text/html" in missing.headers["content-type"] assert missing.status_code == 404 and "text/html" in missing.headers["content-type"]
def test_the_roles_page_offers_the_judged_filter_and_hidden_companies( def test_the_roles_page_offers_the_judged_filter_and_no_hidden_companies(
client: TestClient) -> None: client: TestClient) -> None:
page = client.get("/").text page = client.get("/").text
assert 'id="f-judged"' in page and "<details" in page assert 'id="f-judged"' in page and "<details" in page
for label in ("Liked", "Unjudged", "Passed", "Show hidden companies"): for label in ("Liked", "Unjudged", "Passed"):
assert label in page assert label in page
assert "Show muted" not in page assert "Show muted" not in page and "Show hidden companies" not in page
def test_the_roles_page_carries_the_ladder_as_json(client: TestClient, store: Store) -> None: def test_the_roles_page_carries_the_ladder_as_json(client: TestClient, store: Store) -> None:
@@ -966,21 +966,33 @@ def test_the_agents_page_lists_and_edits_search_agents(client: TestClient) -> No
for weight in ("a-fit", "a-recency", "a-affinity", "a-taste"): for weight in ("a-fit", "a-recency", "a-affinity", "a-taste"):
assert f'id="{weight}"' in page assert f'id="{weight}"' in page
assert 'id="a-taste" min="0" step="0.05" value="0.2"' in page assert 'id="a-taste" min="0" step="0.05" value="0.2"' in page
# The fetch gate in three parts, and no hybrid prefer control. # The fetch gate in four parts, in the ADR's order, and no hybrid prefer control.
assert "<legend>The fetch gate</legend>" in template assert "<legend>The fetch gate</legend>" in template
for part in ("<h3>Region</h3>", "<h3>Place</h3>", "<h3>Role</h3>"): parts = ("<h3>World</h3>", "<h3>Location</h3>", "<h3>Role exclusion</h3>", "<h3>Role fetch</h3>")
for part in parts:
assert part in template assert part in template
assert [template.index(part) for part in parts] == sorted(template.index(part) for part in parts)
assert template.index('id="a-scope"') < template.index("<h3>Location</h3>")
assert template.index("<h3>Location</h3>") < template.index('id="a-countries"') \
< template.index('id="a-towns"') < template.index('id="a-remote"') \
< template.index("<h3>Role exclusion</h3>") < template.index('id="a-titles"') \
< template.index("<h3>Role fetch</h3>") < template.index('id="a-terms"')
for field in ("a-scope", "a-countries", "a-towns", "a-remote", "a-terms", "a-titles"): for field in ("a-scope", "a-countries", "a-towns", "a-remote", "a-terms", "a-titles"):
assert f'id="{field}"' in template assert f'id="{field}"' in template
assert "All locations bypasses Location" in template and "All countries" not in template
assert "a-hybrid" not in page and "prefer" not in template.lower() assert "a-hybrid" not in page and "prefer" not in template.lower()
# The cut, and summarise after the ranking: the keys of `Limits`. # The analytics filter, the want feed score and summarise: the keys of `Limits`.
assert "<legend>The cut</legend>" in template and "<legend>After the ranking</legend>" in template for legend in ("Analytics filter", "Want feed score", "CV match weights", "After the ranking"):
assert f"<legend>{legend}</legend>" in template
assert "The cut</legend>" not in template and "The feed order" not in template
assert "Prompt closeness" in template and "Fit to the prompts" not in template
for limit in ("a-cut-fit-top", "a-cut-fit-min", "a-cut-cv-top", "a-cut-cv-min", "a-summarise-top"): for limit in ("a-cut-fit-top", "a-cut-fit-min", "a-cut-cv-top", "a-cut-cv-min", "a-summarise-top"):
assert f'id="{limit}"' in template assert f'id="{limit}"' in template
assert 'id="a-cut-fit-top" min="0" step="10" value="500"' in page assert 'id="a-cut-fit-top" min="0" step="10" value="500"' in page
assert 'id="a-cut-fit-min" min="0" max="1" step="0.05" value="0.6"' in page assert 'id="a-cut-fit-min" min="0" max="1" step="0.05" value="0.6"' in page
assert 'id="a-cut-cv-top" min="0" step="10" value="150"' in page assert 'id="a-cut-cv-top" min="0" step="10" value="150"' in page
assert 'id="a-summarise-top" min="0" step="5" value="50"' in page assert 'id="a-summarise-top" min="0" step="5" value="30"' in page
assert "of each feed order" in template
for gone in ("a-extract-top", "a-extract-min", "a-summarise-min", "a-judge-top", "a-judge-min", for gone in ("a-extract-top", "a-extract-min", "a-summarise-min", "a-judge-top", "a-judge-min",
"a-judge-cv-top"): "a-judge-cv-top"):
assert f'id="{gone}"' not in page assert f'id="{gone}"' not in page