Fetch terms narrow what big boards read with the wide reach send (WP F2)
An agent has fetch_terms (migration 23, API, a chip field in the agent
editor). The terms of a pull are the union over the enabled agents, none
when one of them has none. They go only to wide reads: a company tagged All
roles, or a reach ask_for drops as too many countries for a one host; a
board's {"terms": false} switches them off. SmartRecruiters q,
SuccessFactors q, Workday searchText, Phenom keywords, Eightfold query and
Oracle keyword declare query="one"; the runner makes one series per term
times the country series, drops the places first over MAX_SERIES, then the
terms. A term read is narrowed: it writes no ats:size, closes nothing and
prunes no per-role state, and the 10% guard holds it to its own
fingerprint. The Companies reach line counts the terms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3917b31209
commit
0fd45b333a
28 files changed
+839
-113
No files matched your search
+27
-10
@@ -14,6 +14,10 @@
|
||||
* form's ids stay unique. Votes, liked companies and scores are the agent's,
|
||||
* so a delete takes them with it, and the confirm says so.
|
||||
*
|
||||
* The fetch terms are chips of free text, as the towns are: words that
|
||||
* narrow what big boards read with the wide reach send (app/jobs/reach.py).
|
||||
* The card says them in a line of their own, or that boards send every role.
|
||||
*
|
||||
* Every request goes through `api()` from app.js, so a failure is one toast
|
||||
* carrying the server's own sentence.
|
||||
*/
|
||||
@@ -283,6 +287,7 @@
|
||||
if (rules) div.appendChild(el("p", "agent-rules", rules));
|
||||
div.appendChild(el("p", "agent-weights", weightsLine(row)));
|
||||
div.appendChild(limitsLine(row));
|
||||
div.appendChild(termsLine(row));
|
||||
|
||||
const actions = el("div", "agent-card-actions");
|
||||
const edit = el("button", "secondary", "Edit");
|
||||
@@ -374,15 +379,15 @@
|
||||
return { node: chips.node, values: () => [...chips.list] };
|
||||
}
|
||||
|
||||
// Towns as chips of free text, added on Enter or a comma, and one chip for
|
||||
// the spellings of a town. What is typed but not added yet counts, so Save
|
||||
// does not drop it.
|
||||
function townInput(values) {
|
||||
// Words as chips of free text, added on Enter or a comma, and one chip for
|
||||
// the spellings that fold alike. What is typed but not added yet counts, so
|
||||
// Save does not drop it. Towns and fetch terms both.
|
||||
function wordInput(values, prompt) {
|
||||
const input = el("input");
|
||||
input.type = "text";
|
||||
input.spellcheck = false;
|
||||
input.placeholder = "Add a town";
|
||||
input.setAttribute("aria-label", "Add a town");
|
||||
input.placeholder = prompt;
|
||||
input.setAttribute("aria-label", prompt);
|
||||
const split = (text) => text.split(",").map((v) => v.trim()).filter(Boolean);
|
||||
const chips = chipList(values, input, { group: fold });
|
||||
const take = () => {
|
||||
@@ -402,6 +407,14 @@
|
||||
};
|
||||
}
|
||||
|
||||
// The fetch terms on a card: the words, or that big boards send every role.
|
||||
function termsLine(row) {
|
||||
const terms = row.fetch_terms || [];
|
||||
return el("p", "agent-terms", terms.length
|
||||
? `Big boards read across Europe send only roles matching ${orList(terms.map((t) => `“${t}”`))}.`
|
||||
: "Big boards send every role: no fetch terms.");
|
||||
}
|
||||
|
||||
// A prompt as a row: its name and Remove on a line, its text under them.
|
||||
function promptRow(prompt, remove) {
|
||||
const row = el("div", "prompt-row");
|
||||
@@ -547,7 +560,9 @@
|
||||
|
||||
const { where, rest } = distribute(row ? row.gates : []);
|
||||
const countries = countryInput(where.countries ? where.countries.values : []);
|
||||
const places = townInput(where.places ? where.places.values : []);
|
||||
const places = wordInput(where.places ? where.places.values : [], "Add a town");
|
||||
const terms = wordInput(row ? row.fetch_terms || [] : [], "Add a word");
|
||||
$("#a-terms", f).replaceWith(terms.node);
|
||||
$("#a-countries", f).replaceWith(countries.node);
|
||||
$("#a-towns", f).replaceWith(places.node);
|
||||
const remote = $("#a-remote", f);
|
||||
@@ -623,7 +638,7 @@
|
||||
$("#a-delete", f).hidden = !row;
|
||||
f.addEventListener("input", () => { f.dataset.dirty = "true"; view(); });
|
||||
f.addEventListener("change", view);
|
||||
f.addEventListener("submit", (event) => save(event, row, () => prompts.map((p) => p.read()), gates));
|
||||
f.addEventListener("submit", (event) => save(event, row, () => prompts.map((p) => p.read()), gates, terms.values));
|
||||
$("#a-cancel", f).addEventListener("click", () => { close(); render(); });
|
||||
$("#a-delete", f).addEventListener("click", () => row && removeAgent(row));
|
||||
div.appendChild(f);
|
||||
@@ -669,9 +684,10 @@
|
||||
: "No search agents yet. New agent describes one.";
|
||||
}
|
||||
|
||||
// `readPrompts` and `readGates` are the form's rows as the API takes them.
|
||||
// `readPrompts`, `readGates` and `readTerms` are the form's rows and chips
|
||||
// as the API takes them.
|
||||
// A prompt with neither name nor text is an empty row, left out.
|
||||
async function save(event, row, readPrompts, readGates) {
|
||||
async function save(event, row, readPrompts, readGates, readTerms) {
|
||||
event.preventDefault();
|
||||
const f = event.target;
|
||||
const prompts = readPrompts().filter((p) => p.name || p.text.trim());
|
||||
@@ -696,6 +712,7 @@
|
||||
summarise_top: Number($("#a-summarise-top", f).value),
|
||||
summarise_min: Number($("#a-summarise-min", f).value),
|
||||
},
|
||||
fetch_terms: readTerms(),
|
||||
// Saving an agent means it is wanted, so a new one starts on; the
|
||||
// card's switch is where an existing one is switched.
|
||||
enabled: row ? row.enabled : true,
|
||||
|
||||
+3
-2
@@ -1149,7 +1149,7 @@ table.applications td[data-label="Saved"] { white-space: nowrap; color: var(--di
|
||||
.agent-prompt-name { margin: .7rem 0 0; font-size: .8rem; font-weight: 600; color: var(--dim); }
|
||||
.agent-prompt-name + .agent-intent { margin-top: .2rem; }
|
||||
.agent-rules { margin: 0 0 .3rem; font-size: .9rem; color: var(--dim); overflow-wrap: anywhere; }
|
||||
.agent-weights, .agent-limits { margin: 0; font-size: .8rem; color: var(--faint); font-variant-numeric: tabular-nums; }
|
||||
.agent-weights, .agent-limits, .agent-terms { margin: 0; font-size: .8rem; color: var(--faint); font-variant-numeric: tabular-nums; }
|
||||
.agent-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .8rem; }
|
||||
.agent-card-actions a { font-size: .9rem; font-weight: 600; text-decoration: none; }
|
||||
@media (hover: hover) {
|
||||
@@ -1223,7 +1223,8 @@ table.applications td[data-label="Saved"] { white-space: nowrap; color: var(--di
|
||||
border-radius: .3rem; padding: .35rem .5rem;
|
||||
}
|
||||
/* The fieldsets that hold rows: a column, the Add button under the rows. */
|
||||
.agent-form fieldset.prompts, .agent-form fieldset.where, .agent-form fieldset.rules {
|
||||
.agent-form fieldset.prompts, .agent-form fieldset.where, .agent-form fieldset.terms,
|
||||
.agent-form fieldset.rules {
|
||||
display: flex; flex-direction: column; align-items: stretch; gap: .5rem; min-width: 0;
|
||||
border: 1px solid var(--line); border-radius: .3rem;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user