Merge the ADR follow-up in the front end: All locations, the four-part fetch gate and analytics filter on the form, the order labels, no hidden-companies filter, judge numbers of 10 (wp-adr-ui)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-10-04 21:41:02 +02:00
commit 1f444aa077
10 files changed
+212 -176

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.
+6 -4
View File
@@ -579,10 +579,12 @@ kbd {
font-size: .8rem; padding: .18rem .3rem; font-size: .8rem; padding: .18rem .3rem;
border: 1px solid var(--line); border: 1px solid var(--line);
} }
/* The three order labels share one line: Agent match is the longest and /* The three order labels share one row. What I'm looking for is longer than
would otherwise wrap in a 240px rail. Cells grow to the width, each by its a 240px rail has room for on one line, so a cell may wrap its words; the
own text. */ cells split the width by their text, the short ones keeping theirs. */
#sort button { white-space: nowrap; } #sort button { min-width: 0; line-height: 1.2; }
#sort button:nth-child(2), #sort button:nth-child(3) { flex-grow: 0; white-space: nowrap; }
#sort button:first-child { flex-basis: 0; flex-grow: 1; }
/* Square everything first; only the ends are ends. Every cell but the first /* Square everything first; only the ends are ends. Every cell but the first
eats its neighbour's border, so the joins are one rule wide rather than two. */ eats its neighbour's border, so the joins are one rule wide rather than two. */
.seg > * { border-radius: 0; } .seg > * { border-radius: 0; }
+16 -16
View File
@@ -16,7 +16,7 @@
* Beside `api` on `window`, the few helpers more than one page script uses: * Beside `api` on `window`, the few helpers more than one page script uses:
* `count`, `cell`, `debounce`, `safeUrl`, and the company list with its * `count`, `cell`, `debounce`, `safeUrl`, and the company list with its
* affinity control (`loadCompanies`, `companies`, `affinityControl`, * affinity control (`loadCompanies`, `companies`, `affinityControl`,
* `setAffinity`) and the two fetch overrides beside it, All countries and * `setAffinity`) and the two fetch overrides beside it, All locations and
* All roles (`overridesControl`). One * All roles (`overridesControl`). One
* copy each, since two copies of a helper is one of them * copy each, since two copies of a helper is one of them
* being fixed. * being fixed.
@@ -189,26 +189,26 @@
/* The two fetch overrides, one more pair of toggles in the affinity /* The two fetch overrides, one more pair of toggles in the affinity
buttons' fragment beside them, in a group of their own since they are buttons' fragment beside them, in a group of their own since they are
global rather than an agent's stance (app/jobs/reach.py). The fetch gate global rather than an agent's stance (app/jobs/reach.py). The fetch gate
has three parts, region, place and role, and a company follows every has four parts, world, location, role exclusion and role fetch, and a
agent's on all three unless it is set to: company follows every agent's unless it is set to:
- All countries: the place part is skipped. The company's roles are - All locations: the location gate is skipped. The company's roles are
fetched and kept from the whole region (Europe), not only the agents' fetched and kept from the whole world gate (Europe, say), not only the
places, for every agent. The region itself still holds. agents' locations, for every agent. The world gate itself still holds.
- All roles: the role part is skipped: no fetch terms and no titles to - All roles: role exclusion and role fetch are skipped: no titles to
leave out. leave out and no fetch terms.
Turning either on or off queues a rescore on the server, as the other Turning either on or off queues a rescore on the server, as the other
switches that change what passes do, and a pull reads the board anew. switches that change what passes do, and a pull reads the board anew.
`company` is the shared list's row; `onChange` runs after the server `company` is the shared list's row; `onChange` runs after the server
accepted a switch, with the company it answered. */ accepted a switch, with the company it answered. */
const OVERRIDES = [ const OVERRIDES = [
{ value: "countries", field: "all_countries", path: "all-countries", text: "All countries", { value: "countries", field: "all_countries", path: "all-countries", text: "All locations",
on: "All countries is on: this company's roles are fetched and kept from the whole " on: "All locations is on: this company's roles are fetched and kept from the whole "
+ "region (Europe), not only the agents' places, for every agent. The region still " + "world gate (Europe, say), not only the agents' locations, for every agent. The "
+ "holds. Turning it off puts the agents' places back and rescores.", + "world gate still holds. Turning it off puts the agents' locations back and rescores.",
off: "All countries: fetch and keep this company's roles from the whole region " off: "All locations: fetch and keep this company's roles from the whole world gate "
+ "(Europe) instead of only the agents' places, for every agent. Turning it on " + "(Europe, say) instead of only the agents' locations, for every agent. Turning it "
+ "rescores.", + "on rescores.",
said: (on) => (on ? "all countries in the region" : "the agents' places") }, said: (on) => (on ? "all locations in the world gate" : "the agents' locations") },
{ value: "roles", field: "all_roles", path: "all-roles", text: "All roles", { value: "roles", field: "all_roles", path: "all-roles", text: "All roles",
on: "All roles is on: this company's roles are fetched with no fetch terms and kept " on: "All roles is on: this company's roles are fetched with no fetch terms and kept "
+ "whatever their title, for every agent. Turning it off puts the agents' fetch " + "whatever their title, for every agent. Turning it off puts the agents' fetch "
+6 -6
View File
@@ -5,7 +5,7 @@
* joined with each company's board subscription — its id and whether it is * joined with each company's board subscription — its id and whether it is
* on — so nothing here fetches `/api/sources` as well. The affinity buttons * on — so nothing here fetches `/api/sources` as well. The affinity buttons
* are `affinityControl`, the same ones the Roles tab and the read page draw, * are `affinityControl`, the same ones the Roles tab and the read page draw,
* and beside them `overridesControl`, the two fetch overrides All countries * and beside them `overridesControl`, the two fetch overrides All locations
* and All roles, which are global and drawn with or without an agent. * and All roles, which are global and drawn with or without an agent.
* *
* Liked and hidden are per search agent, so the `#c-agent` select above the * Liked and hidden are per search agent, so the `#c-agent` select above the
@@ -25,10 +25,10 @@
* from app/jobs/reach.py), so the row shows whether the company follows the * from app/jobs/reach.py), so the row shows whether the company follows the
* agents' filters or overrides them. Its editor has a second line that sets * agents' filters or overrides them. Its editor has a second line that sets
* the board's own reach: the agents', or its own countries and remote, * the board's own reach: the agents', or its own countries and remote,
* posted to `/api/sources/{id}/reach`. Fetching from the whole region (All * posted to `/api/sources/{id}/reach`. Fetching from the whole world gate (All
* countries) and no fetch terms or titles to leave out (All roles) are the * locations) and no fetch terms or titles to leave out (All roles) are the
* company's two overrides instead, and the board's own countries win over * company's two overrides instead, and the board's own countries win over
* All countries. * All locations.
* *
* Beside that line stands the board's size, set when it was added and * Beside that line stands the board's size, set when it was added and
* changed only by a Recheck ("999 roles · checked 30 Sep"). Recheck, beside * changed only by a Recheck ("999 roles · checked 30 Sep"). Recheck, beside
@@ -326,8 +326,8 @@
note.className = "muted small"; note.className = "muted small";
note.textContent = [ note.textContent = [
company.all_countries company.all_countries
? "All countries is on: roles are fetched and kept from the whole region, and countries set here win over it." ? "All locations is on: roles are fetched and kept from the whole world gate, and countries set here win over it."
: "All countries, beside the stars, fetches and keeps this company's roles from the whole region (Europe), not only the agents' places.", : "All locations, beside the stars, fetches and keeps this company's roles from the whole world gate (Europe, say), not only the agents' locations.",
company.all_roles company.all_roles
? "All roles is on: no fetch terms and no titles to leave out." ? "All roles is on: no fetch terms and no titles to leave out."
: "All roles drops the fetch terms and the titles to leave out.", : "All roles drops the fetch terms and the titles to leave out.",
+67 -75
View File
@@ -10,10 +10,11 @@
* *
* A row is newsdesk's `.row`: the score gutter and number (hidden under * A row is newsdesk's `.row`: the score gutter and number (hidden under
* Newest, since the score is not what put the row there, and the CV * Newest, since the score is not what put the row there, and the CV
* match under CV match, a dash for a role not judged yet), the title, * match under What fits me, a dash for a role not judged yet), the title,
* company · place · badges · age · tags, the summary or the description's * company · place · badges · age · tags, the summary or the description's
* opening, and ▼ ● ▲ ★ from judge.js. A passed role and a hidden company's * opening, and ▼ ● ▲ ★ from judge.js. A passed role is dimmed, never
* are dimmed, never dropped, so a stray tap stays visible to be undone. * dropped, so a stray tap stays visible to be undone. A hidden company's roles
* are never in the feed.
* *
* Opening a role pushes `/roles/{uid}`; closing goes back. Stepping with j/k * Opening a role pushes `/roles/{uid}`; closing goes back. Stepping with j/k
* while it is open replaces that entry rather than stacking one per role, so * while it is open replaces that entry rather than stacking one per role, so
@@ -32,12 +33,12 @@
* Picking another reloads the feed and the counts under the reader, which * Picking another reloads the feed and the counts under the reader, which
* stays open and is fetched again for that agent's vote. * stays open and is fetched again for that agent's vote.
* *
* Order is Agent match (`order=score`, the agent's final score moved by its * Order is What I'm looking for (`order=score`, the agent's want feed score
* votes), Newest (`order=newest`) or CV match (`order=cv`, the roles the * moved by its votes), Newest (`order=newest`) or What fits me (`order=cv`,
* agent's `judge` read against its CV first, by that total), the same three * the roles the agent's `judge` read against its CV first, by that total),
* whichever agent is viewed, and all carry the agent's votes and hidden * the same three whichever agent is viewed, and all carry the agent's votes.
* companies. CV match needs a CV: an agent without one is shown Agent * What fits me needs a CV: an agent without one is shown What I'm looking
* match, as an agentless page is shown Newest. Every order keeps to the * for, as an agentless page is shown Newest. Every order keeps to the
* roles the agent's fetch gate passes, which a note under Viewing as says; * roles the agent's fetch gate passes, which a note under Viewing as says;
* Show gated (`gated=true`) adds the ones it rejects, with the reason. * Show gated (`gated=true`) adds the ones it rejects, with the reason.
* *
@@ -128,10 +129,11 @@
}; };
const TRACKS = { "": "Both", ic: "Individual", people: "People" }; const TRACKS = { "": "Both", ic: "Individual", people: "People" };
// What the list is in the order of. Agent match is the viewing agent's // What the list is in the order of. What I'm looking for is the viewing
// score, moved by its votes; Newest is first seen; CV match is // agent's want feed score, moved by its votes; Newest is first seen; What
// the agent's `judge` total, the roles not judged after by score. // fits me is the agent's `judge` total, the roles not judged after by CV
const SORTS = { score: "Agent match", cv: "CV match", time: "Newest" }; // closeness.
const SORTS = { score: "What I\u2019m looking for", cv: "What fits me", time: "Newest" };
// The route's `order` for each. // The route's `order` for each.
const ORDERS = { score: "score", time: "newest", cv: "cv" }; const ORDERS = { score: "score", time: "newest", cv: "cv" };
// How many days ahead a deadline earns a badge: today to today + 4, the // How many days ahead a deadline earns a badge: today to today + 4, the
@@ -162,7 +164,7 @@
return { return {
sort: "score", agent: null, period: "all", tags: new Set(), showRead: true, sort: "score", agent: null, period: "all", tags: new Set(), showRead: true,
company: "", place: "", function: "", remote: "", judged: "", pay: "", company: "", place: "", function: "", remote: "", judged: "", pay: "",
showMuted: false, gated: false, companyKeys: [], places: [], gated: false, companyKeys: [], places: [],
levelFrom: "", levelTo: "", track: "", seniorityUnknown: true, payUnknown: false, levelFrom: "", levelTo: "", track: "", seniorityUnknown: true, payUnknown: false,
closing: false, closing: false,
}; };
@@ -174,7 +176,7 @@
counted. */ counted. */
function filtersOn(f = state.filter, { more = false } = {}) { function filtersOn(f = state.filter, { more = false } = {}) {
const folded = [f.company.trim(), f.place.trim(), f.function, f.remote, f.pay, f.judged, const folded = [f.company.trim(), f.place.trim(), f.function, f.remote, f.pay, f.judged,
f.showMuted, f.closing, f.agent !== null && f.gated].filter(Boolean).length f.closing, f.agent !== null && f.gated].filter(Boolean).length
+ f.companyKeys.length + f.places.length + f.companyKeys.length + f.places.length
+ [f.levelFrom, f.levelTo, f.track].filter(Boolean).length; + [f.levelFrom, f.levelTo, f.track].filter(Boolean).length;
if (more) return folded; if (more) return folded;
@@ -225,13 +227,14 @@
/** The viewing agent, once the agents are in. */ /** The viewing agent, once the agents are in. */
const viewed = () => state.agents.find((a) => a.id === state.filter.agent) || null; const viewed = () => state.agents.find((a) => a.id === state.filter.agent) || null;
/** Whether CV match has a CV to go by: the viewed agent has one, or /** Whether What fits me has a CV to go by: the viewed agent has one, or
the agents are not in yet, when the address is taken at its word. */ the agents are not in yet, when the address is taken at its word. */
const hasCv = () => !state.agentsLoaded || Boolean(viewed()?.cv_text?.trim()); const hasCv = () => !state.agentsLoaded || Boolean(viewed()?.cv_text?.trim());
/** The order the list is in. Agent match needs an agent to score by: with /** The order the list is in. What I'm looking for needs an agent to score
none enabled the server answers newest first, and so does this. Best by: with none enabled the server answers newest first, and so does this.
CV match needs that agent's CV too, and without one is Agent match. */ What fits me needs that agent's CV too, and without one is What I'm
looking for. */
function sortShown() { function sortShown() {
const { sort, agent } = state.filter; const { sort, agent } = state.filter;
if (sort === "time" || agent === null) return "time"; if (sort === "time" || agent === null) return "time";
@@ -249,7 +252,6 @@
for (const key of ["function", "remote", "judged", "pay"]) if (f[key]) p.set(key, f[key]); for (const key of ["function", "remote", "judged", "pay"]) if (f[key]) p.set(key, f[key]);
const days = PERIODS[f.period].days; const days = PERIODS[f.period].days;
if (days) p.set("days", String(days)); if (days) p.set("days", String(days));
if (f.showMuted) p.set("show_muted", "true");
if (!f.showRead) p.set("include_read", "false"); if (!f.showRead) p.set("include_read", "false");
f.tags.forEach((t) => p.append("tags", t)); f.tags.forEach((t) => p.append("tags", t));
f.companyKeys.forEach((key) => p.append("company_keys", key)); f.companyKeys.forEach((key) => p.append("company_keys", key));
@@ -286,7 +288,6 @@
f[key] = q.get(key) || ""; f[key] = q.get(key) || "";
} }
f.period = PERIOD_OF_DAYS[q.get("days")] || "all"; f.period = PERIOD_OF_DAYS[q.get("days")] || "all";
f.showMuted = q.get("show_muted") === "true";
f.showRead = q.get("include_read") !== "false"; f.showRead = q.get("include_read") !== "false";
f.gated = q.get("gated") === "true" || q.get("gated") === "1"; f.gated = q.get("gated") === "true" || q.get("gated") === "1";
f.tags = new Set(q.getAll("tags")); f.tags = new Set(q.getAll("tags"));
@@ -387,7 +388,6 @@
written into the entry landed on, so the entry says what is shown. */ written into the entry landed on, so the entry says what is shown. */
function restore() { function restore() {
const before = addressFor(pathFor(null)); const before = addressFor(pathFor(null));
const muted = state.filter.showMuted;
readUrl(location.search, { view: false }); readUrl(location.search, { view: false });
$("#search").value = state.q; $("#search").value = state.q;
writeUrl(); writeUrl();
@@ -397,7 +397,6 @@
labelPlaces(); labelPlaces();
if (addressFor(pathFor(null)) === before) return; if (addressFor(pathFor(null)) === before) return;
reload(); reload();
if (state.filter.showMuted !== muted) loadFilters().catch(() => {});
renderRail(); renderRail();
renderActive(); renderActive();
} }
@@ -514,12 +513,11 @@
if (state.readingUid) refreshReader(state.readingUid); if (state.readingUid) refreshReader(state.readingUid);
} }
// The tag counts. Asked with `show_muted` and the agent only, the filters // The tag counts. Asked with the agent only, the filter the route takes, so
// the route takes, so picking a tag does not renumber the others. // picking a tag does not renumber the others.
let filtersRequest = 0; let filtersRequest = 0;
async function loadFilters() { async function loadFilters() {
const params = new URLSearchParams(); const params = new URLSearchParams();
if (state.filter.showMuted) params.set("show_muted", "true");
if (state.filter.agent !== null) params.set("agent", String(state.filter.agent)); if (state.filter.agent !== null) params.set("agent", String(state.filter.agent));
const request = ++filtersRequest; const request = ++filtersRequest;
const data = await api(`/api/filters?${params}`); const data = await api(`/api/filters?${params}`);
@@ -547,7 +545,7 @@
it: pushed, so back takes the filter off and brings the role back, or it: pushed, so back takes the filter off and brings the role back, or
replacing the entry for text being typed (`replace`). A filter that replacing the entry for text being typed (`replace`). A filter that
changes nothing only closes the reader. */ changes nothing only closes the reader. */
function setFilter(patch = {}, { counts = false, replace = false } = {}) { function setFilter(patch = {}, { replace = false } = {}) {
Object.assign(state.filter, patch); Object.assign(state.filter, patch);
if (state.readingUid && addressFor(pathFor(null)) === pathFor(null) + location.search) { if (state.readingUid && addressFor(pathFor(null)) === pathFor(null) + location.search) {
closeReader(); closeReader();
@@ -556,7 +554,6 @@
route(); route();
} }
reload(); reload();
if (counts) loadFilters().catch(() => {});
renderRail(); renderRail();
renderActive(); renderActive();
} }
@@ -568,7 +565,7 @@
// Text half typed into a chip field goes too, and with it its list. // Text half typed into a chip field goes too, and with it its list.
companyChips?.clear(); companyChips?.clear();
placeChips?.clear(); placeChips?.clear();
setFilter({}, { counts: true }); setFilter();
} }
/* The other order over the same filter: the entry is replaced, since an /* The other order over the same filter: the entry is replaced, since an
@@ -593,11 +590,9 @@
/** Where a company's name links: the list on screen, every filter and the /** Where a company's name links: the list on screen, every filter and the
search kept, with this company as its one company filter, in place of search kept, with this company as its one company filter, in place of
any company chips and of `?company=`. A company this agent hid turns any company chips and of `?company=`. */
on Show hidden companies, or its own name would lead to an empty list. */
function companyHref(key) { function companyHref(key) {
const f = Object.assign({}, state.filter, { companyKeys: [key], company: "" }); const f = Object.assign({}, state.filter, { companyKeys: [key], company: "" });
if (companies.get(key)?.affinity === -1) f.showMuted = true;
return addressFor(pathFor(null), f); return addressFor(pathFor(null), f);
} }
@@ -627,10 +622,9 @@
const link = e.currentTarget; const link = e.currentTarget;
link.href = companyHref(link.dataset.company); link.href = companyHref(link.dataset.company);
companyNames.set(link.dataset.company, link.textContent.trim()); companyNames.set(link.dataset.company, link.textContent.trim());
const counts = state.filter.showMuted;
readUrl(new URL(link.href).search, { view: false }); readUrl(new URL(link.href).search, { view: false });
$("#search").value = state.q; $("#search").value = state.q;
setFilter({}, { counts: counts !== state.filter.showMuted }); setFilter();
} }
/* The strip's way back to every company: back, when the entry under this /* The strip's way back to every company: back, when the entry under this
@@ -669,8 +663,8 @@
renderAgent(); renderAgent();
// The order, the same three whatever is viewed. Agent match needs an // The order, the same three whatever is viewed. What I'm looking for needs
// agent to score by, and CV match that agent's CV, so without one // an agent to score by, and What fits me that agent's CV, so without one
// each is greyed and says why. // each is greyed and says why.
const none = state.agentsLoaded && !state.agents.length; const none = state.agentsLoaded && !state.agents.length;
const why = { const why = {
@@ -714,7 +708,6 @@
setValue("f-remote", f.remote); setValue("f-remote", f.remote);
setValue("f-pay", f.pay); setValue("f-pay", f.pay);
setValue("f-judged", f.judged); setValue("f-judged", f.judged);
setValue("f-show-muted", f.showMuted);
setValue("f-closing", f.closing); setValue("f-closing", f.closing);
setValue("f-gated", f.gated); setValue("f-gated", f.gated);
renderFacets(); renderFacets();
@@ -852,7 +845,7 @@
gate.hidden = state.filter.agent === null; gate.hidden = state.filter.agent === null;
gate.textContent = state.filter.gated gate.textContent = state.filter.gated
? "Filtered by this agent's fetch gate, and Show gated adds the roles it rejects." ? "Filtered by this agent's fetch gate, and Show gated adds the roles it rejects."
: "Already filtered by this agent's fetch gate: region, places and role."; : "Already filtered by this agent's fetch gate: world, location and role exclusion. Hidden companies are never shown.";
if (agents.length) { if (agents.length) {
// Rebuilt only when the agents changed, since the rail is drawn again on // Rebuilt only when the agents changed, since the rail is drawn again on
// every filter and a rebuild shuts a select that is open. // every filter and a rebuild shuts a select that is open.
@@ -950,7 +943,6 @@
async function applySaved(id) { async function applySaved(id) {
const saved = state.saved.find((x) => x.id === id); const saved = state.saved.find((x) => x.id === id);
if (!saved) return; if (!saved) return;
const muted = state.filter.showMuted;
const query = new URLSearchParams(saved.query); const query = new URLSearchParams(saved.query);
readUrl(`?${saved.query}`, { view: false }); readUrl(`?${saved.query}`, { view: false });
const sort = query.get("sort"); const sort = query.get("sort");
@@ -961,7 +953,7 @@
await labelPlaces({ write: false }); await labelPlaces({ write: false });
if (filtersOn(state.filter, { more: true })) $("#f-more").open = true; if (filtersOn(state.filter, { more: true })) $("#f-more").open = true;
if (overlayRail() && state.railOpen) toggleRail(); if (overlayRail() && state.railOpen) toggleRail();
setFilter({}, { counts: muted !== state.filter.showMuted }); setFilter();
} }
async function deleteSaved(id) { async function deleteSaved(id) {
@@ -1236,7 +1228,7 @@
} }
/* The gutter's number, of 100, and what it says: the agent's score, or /* The gutter's number, of 100, and what it says: the agent's score, or
under CV match the CV match. A role `judge` has not read yet has an under What fits me the CV match. A role `judge` has not read yet has an
empty bar and, faint, how close it is to the CV (`cv_fit`), which is empty bar and, faint, how close it is to the CV (`cv_fit`), which is
what orders it there, else a dash. */ what orders it there, else a dash. */
function gutterOf(role) { function gutterOf(role) {
@@ -1300,12 +1292,10 @@
el.querySelector(".company")?.addEventListener("click", companyClick); el.querySelector(".company")?.addEventListener("click", companyClick);
} }
/* A passed role and a hidden company's are dimmed, never dropped: the pass /* A passed role is dimmed, never dropped: the pass has to stay visible to be
has to stay visible to be undone. */ undone. */
function paintRow(el, role) { function paintRow(el, role) {
const company = companies.get(role.company_key);
el.dataset.read = String(Boolean(role.read_at)); el.dataset.read = String(Boolean(role.read_at));
el.classList.toggle("muted", Boolean(company && company.affinity === -1));
el.classList.toggle("passed", role.vote === -1); el.classList.toggle("passed", role.vote === -1);
el.classList.toggle("gated", Boolean(role.gated_reason)); el.classList.toggle("gated", Boolean(role.gated_reason));
} }
@@ -1432,38 +1422,41 @@
} }
/* Which parts of the viewing agent's fetch gate apply to a company's /* Which parts of the viewing agent's fetch gate apply to a company's
roles: All countries lifts the place part (the Where lines), All roles roles: All locations lifts the location gate, All roles the role
the role part (fetch terms, titles to leave out); the region always exclusion and the fetch terms; the world gate always holds. A favourite
holds. A favourite only ranks higher, so it is not named here. Nothing only ranks higher, so it is not named here. A hidden company has no
with no agent, when no fetch gate applies. */ roles in the feed at all. Nothing with no agent, when no fetch gate
applies. */
function gateNote(company) { function gateNote(company) {
if (state.filter.agent === null) return ""; if (state.filter.agent === null) return "";
const countries = Boolean(company?.all_countries); if (company?.affinity === -1) return "Hidden for this agent: its roles are never shown.";
const locations = Boolean(company?.all_countries);
const roles = Boolean(company?.all_roles); const roles = Boolean(company?.all_roles);
if (countries && roles) { if (locations && roles) {
return "All countries and All roles: every role in the agent's region, " return "All locations and All roles: every role in the agent's world, "
+ "not filtered by place or by role."; + "not filtered by location, role exclusion or fetch terms.";
} }
if (countries) { if (locations) {
return "All countries: every role in the agent's region, not filtered by place. " return "All locations: every role in the agent's world, not filtered by location. "
+ "The agent's fetch terms and titles to leave out still apply."; + "The agent's role exclusion still applies.";
} }
if (roles) { if (roles) {
return "All roles: not filtered by role, no fetch terms and no titles left out. " return "All roles: no titles left out and no fetch terms. "
+ "The agent's places still apply."; + "The agent's locations still apply.";
} }
return "The roles this agent's fetch gate passes: its region, places and role. " return "The roles this agent's fetch gate passes: its world, locations and role exclusion. "
+ "All countries lifts the places for this company, All roles the role."; + "All locations lifts the locations for this company, All roles the role exclusion.";
} }
/* A company seen only through a search has no row until its first change /* A company seen only through a search has no row until its first change
creates one, so the list is reloaded then. A change dims or undims its creates one, so the list is reloaded then. Hiding takes the company's
rows at once; where they rank waits on the `score` it queued, whose id rows out at once, since a hidden company is never in the feed; where the
the affinity route answers with (`updated.score_job`), and the feed others rank waits on the `score` it queued, whose id the affinity route
reloads when that has finished. */ answers with (`updated.score_job`), and the feed reloads when that has
finished. */
async function affinityChanged(key, company, updated) { async function affinityChanged(key, company, updated) {
if (!company) await loadCompanies(state.filter.agent).catch(() => {}); if (!company) await loadCompanies(state.filter.agent).catch(() => {});
renderFeed(); if (updated?.affinity === -1) reload(); else renderFeed();
const status = () => $("#company-strip .strip-status"); const status = () => $("#company-strip .strip-status");
if (status()) status().textContent = "Scoring again; the list reloads when that is done."; if (status()) status().textContent = "Scoring again; the list reloads when that is done.";
await scored(updated?.score_job); await scored(updated?.score_job);
@@ -1644,7 +1637,7 @@
const MUST_MARKS = { met: ["✓", "met"], broken: ["✗", "broken"], unclear: ["?", "unclear"] }; const MUST_MARKS = { met: ["✓", "met"], broken: ["✗", "broken"], unclear: ["?", "unclear"] };
/* The agent's `judge` reading against its CV: the total and its three /* The agent's `judge` reading against its CV: the total and its three
numbers, career as the server counted it (capped at 39 when a must-have numbers, each of 10, career as the server counted it (capped at 4 when a must-have
is broken, with what the model said), the must-haves with a verdict is broken, with what the model said), the must-haves with a verdict
each, then the strengths and gaps it named. A box as the summary is, each, then the strengths and gaps it named. A box as the summary is,
since it is the same kind of thing: a model's reading, not the posting. */ since it is the same kind of thing: a model's reading, not the posting. */
@@ -1656,7 +1649,8 @@
: `<p class="muted small">${none}</p>`); : `<p class="muted small">${none}</p>`);
const counted = j.career_capped ?? j.career; const counted = j.career_capped ?? j.career;
const career = counted < j.career const career = counted < j.career
? `career ${counted} (capped: breaks a must-have; model said ${j.career})` : `career ${j.career}`; ? `career ${counted}/10 (capped: breaks a must-have; model said ${j.career}/10)`
: `career ${j.career}/10`;
const musts = Array.isArray(j.musts) && j.musts.length const musts = Array.isArray(j.musts) && j.musts.length
? `<ul class="cv-musts">${j.musts.map((m) => { ? `<ul class="cv-musts">${j.musts.map((m) => {
const [mark, word] = MUST_MARKS[m.verdict] || MUST_MARKS.unclear; const [mark, word] = MUST_MARKS[m.verdict] || MUST_MARKS.unclear;
@@ -1666,7 +1660,7 @@
return `<section class="reader-summary reader-cv"> return `<section class="reader-summary reader-cv">
<h2 class="reader-label">CV match</h2> <h2 class="reader-label">CV match</h2>
<p class="cv-total"><b>${Math.round(j.cv_score)}</b> of 100 <p class="cv-total"><b>${Math.round(j.cv_score)}</b> of 100
<span>skills ${j.skills} · experience ${j.experience} · ${career}</span></p> <span>skills ${j.skills}/10 · experience ${j.experience}/10 · ${career}</span></p>
${musts} ${musts}
<div class="cv-lists"> <div class="cv-lists">
<div><h3 class="reader-label">Strengths</h3>${list(j.strengths, "None named.")}</div> <div><h3 class="reader-label">Strengths</h3>${list(j.strengths, "None named.")}</div>
@@ -1812,15 +1806,15 @@
/* The company's ⊘ ▲ ★, the one place a company is judged outside the /* The company's ⊘ ▲ ★, the one place a company is judged outside the
Companies page, and its two fetch overrides beside them. A company seen Companies page, and its two fetch overrides beside them. A company seen
only through a search has no row until its first change creates one, so only through a search has no row until its first change creates one, so
the list is reloaded then, and the overrides, which need a row, wait for it. A the list is reloaded then, and the overrides, which need a row, wait for it.
change dims or undims its rows in the feed. */ Hiding reloads the feed, which no longer holds the company's roles. */
function renderAffinity(slot, r) { function renderAffinity(slot, r) {
const company = companies.get(r.company_key); const company = companies.get(r.company_key);
if (!r.company_key) { slot.replaceChildren(); return; } if (!r.company_key) { slot.replaceChildren(); return; }
slot.replaceChildren(affinityControl(r.company_key, company ? company.affinity : 0, async () => { slot.replaceChildren(affinityControl(r.company_key, company ? company.affinity : 0, async (updated) => {
if (!company) await loadCompanies(state.filter.agent).catch(() => {}); if (!company) await loadCompanies(state.filter.agent).catch(() => {});
renderAffinity(slot, r); renderAffinity(slot, r);
renderFeed(); if (updated?.affinity === -1) reload(); else renderFeed();
}, state.filter.agent)); }, state.filter.agent));
if (company) { if (company) {
slot.append(" ", overridesControl(r.company_key, company, slot.append(" ", overridesControl(r.company_key, company,
@@ -2109,8 +2103,6 @@
}); });
$("#f-seniority-unknown").addEventListener("change", $("#f-seniority-unknown").addEventListener("change",
(e) => setFilter({ seniorityUnknown: e.target.checked })); (e) => setFilter({ seniorityUnknown: e.target.checked }));
$("#f-show-muted").addEventListener("change",
(e) => setFilter({ showMuted: e.target.checked }, { counts: true }));
$("#f-gated").addEventListener("change", (e) => setFilter({ gated: e.target.checked })); $("#f-gated").addEventListener("change", (e) => setFilter({ gated: e.target.checked }));
$("#f-closing").addEventListener("change", (e) => setFilter({ closing: e.target.checked })); $("#f-closing").addEventListener("change", (e) => setFilter({ closing: e.target.checked }));
@@ -2187,7 +2179,7 @@
// known, and either way bring the reader's affinity control and judge // known, and either way bring the reader's affinity control and judge
// buttons up to date, since `companies` was still empty when it first // buttons up to date, since `companies` was still empty when it first
// painted. // painted.
// CV match asked of an agent with no CV is Agent match. // What fits me asked of an agent with no CV is What I'm looking for.
if (state.filter.agent !== before || sortShown() !== sortBefore) reload(); if (state.filter.agent !== before || sortShown() !== sortBefore) reload();
else renderFeed(); else renderFeed();
if (state.readingUid) { if (state.readingUid) {
-3
View File
@@ -149,9 +149,6 @@
<label class="check"> <label class="check">
<input type="checkbox" id="f-closing"> Closing soon <input type="checkbox" id="f-closing"> Closing soon
</label> </label>
<label class="check">
<input type="checkbox" id="f-show-muted"> Show hidden companies
</label>
{# The roles the agent's fetch gate rejects, each with the reason, {# The roles the agent's fetch gate rejects, each with the reason,
in any order; offered only with an agent. #} in any order; offered only with an agent. #}
<label class="check" id="show-gated" hidden <label class="check" id="show-gated" hidden
+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">
+2 -2
View File
@@ -104,7 +104,7 @@
<section class="card" id="company-boards" data-section> <section class="card" id="company-boards" data-section>
<h2>Company boards</h2> <h2>Company boards</h2>
<p class="lede">Every company roledesk has seen, and how many of its roles are open. Switching a board off stops reading it and closes its roles; hiding a company keeps reading it but leaves its roles out of the list and unscored. Like or favourite raises a company's roles a little in the cut and in the feed order, in each search agent's own ranking (a liked company about 0.05, a favourite about 0.1), and passes nothing the fetch gate rejects. All countries and All roles are for every agent: the first skips the place part of the fetch gate, the second the fetch terms and the titles to leave out.</p> <p class="lede">Every company roledesk has seen, and how many of its roles are open. Switching a board off stops reading it and closes its roles; hiding a company keeps reading it but leaves its roles out of the list and unscored. Like or favourite raises a company's roles a little in the cut and in the feed order, in each search agent's own ranking (a liked company about 0.05, a favourite about 0.1), and passes nothing the fetch gate rejects. All locations and All roles are for every agent: the first skips the location gate and keeps the world gate, the second skips the role exclusion and the fetch terms.</p>
<form id="board-form" class="agent-form source-form" autocomplete="off"> <form id="board-form" class="agent-form source-form" autocomplete="off">
<h3>Follow a company</h3> <h3>Follow a company</h3>
@@ -132,7 +132,7 @@
<option value="favourite">Favourite</option> <option value="favourite">Favourite</option>
<option value="liked">Liked</option> <option value="liked">Liked</option>
<option value="hidden">Hidden</option> <option value="hidden">Hidden</option>
<option value="all_countries">All countries</option> <option value="all_countries">All locations</option>
<option value="all_roles">All roles</option> <option value="all_roles">All roles</option>
<option value="on">On</option> <option value="on">On</option>
<option value="off">Off</option> <option value="off">Off</option>
+29
View File
@@ -81,3 +81,32 @@ def test_a_saved_filter_round_trips_the_query_roles_js_writes(
# the page treats as done. # the page treats as done.
assert client.delete(f"/api/filters/{made.json()['id']}").status_code == 404 assert client.delete(f"/api/filters/{made.json()['id']}").status_code == 404
assert client.get(f"/api/agents/{agent.id}/filters").json() == [] assert client.get(f"/api/agents/{agent.id}/filters").json() == []
def test_the_feed_orders_carry_the_adrs_names() -> None:
script = (STATIC / "roles.js").read_text()
assert "What I\\u2019m looking for" in script and '"What fits me"' in script
assert 'time: "Newest"' in script
assert "Agent match" not in script
def test_the_rail_has_no_show_hidden_companies_and_the_feed_never_asks_for_them(
client: TestClient) -> None:
page = client.get("/").text
assert "f-show-muted" not in page and "Show hidden companies" not in page
script = (STATIC / "roles.js").read_text()
assert "show_muted" not in script and "showMuted" not in script
def test_the_reader_shows_the_judges_numbers_of_ten() -> None:
script = (STATIC / "roles.js").read_text()
assert "skills ${j.skills}/10" in script and "experience ${j.experience}/10" in script
assert "career ${j.career}/10" in script
assert "of 100" in script # the CV match itself stays on 0 to 100
def test_every_page_says_all_locations() -> None:
for path in STATIC.glob("*.js"):
assert "All countries" not in path.read_text(), path.name
for path in (STATIC.parent / "templates").rglob("*.html"):
assert "All countries" not in path.read_text(), path.name
+20 -8
View File
@@ -569,13 +569,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:
@@ -969,21 +969,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