Extract and summarise bounds are each agent's own limits, set on its form

agents.limits holds extract_top, extract_min, summarise_top and
summarise_min; the scope query reads them per ranked row, and a row saved
before this behaves like a fresh agent. The four global config keys go.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-28 16:02:06 +02:00
1 parent e602eb3388
commit cebe62ddc9
20 files changed
+229 -147

No files matched your search

+21
View File
@@ -20,6 +20,10 @@
const $ = (sel, root = document) => root.querySelector(sel);
const DEFAULT_WEIGHTS = { fit: 0.6, recency: 0.2, affinity: 0.2, taste: 0.2 };
// What the model reads after a pull, per agent: the best `extract_top`
// roles scoring at least `extract_min` get their gate columns filled, the
// best `summarise_top` at `summarise_min` or more a summary.
const DEFAULT_LIMITS = { extract_top: 500, extract_min: 0.3, summarise_top: 30, summarise_min: 0.5 };
const NEW = "new";
/** @type {object[]} every agent, as the server lists them */
@@ -108,6 +112,11 @@
return `fit ${w.fit} · newness ${w.recency} · companies ${w.affinity} · liked ${w.taste}${gates}`;
}
function limitsLine(row) {
const l = Object.assign({}, DEFAULT_LIMITS, row.limits);
return `reads ${l.extract_top} at ${l.extract_min} · summarises ${l.summarise_top} at ${l.summarise_min}`;
}
function card(row, fallback) {
const div = el("article", "agent-card");
if (!row.enabled) div.dataset.off = "true";
@@ -127,6 +136,7 @@
? el("p", "agent-intent", intent)
: 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-weights", weightsLine(row)));
div.appendChild(el("p", "agent-limits", limitsLine(row)));
const actions = el("div", "agent-card-actions");
const edit = el("button", "secondary", "Edit");
@@ -151,6 +161,7 @@
const div = el("article", "agent-card editing");
const f = $("#agent-form-template").content.querySelector("form").cloneNode(true);
const weights = Object.assign({}, DEFAULT_WEIGHTS, row ? row.weights : {});
const limits = Object.assign({}, DEFAULT_LIMITS, row ? row.limits : {});
$("#agent-form-title", f).textContent = row ? `Edit ${row.name}` : "New agent";
$("#a-name", f).value = row ? row.name : "";
$("#a-intent", f).value = row ? row.intent : "";
@@ -159,6 +170,10 @@
$("#a-recency", f).value = weights.recency;
$("#a-affinity", f).value = weights.affinity;
$("#a-taste", f).value = weights.taste;
$("#a-extract-top", f).value = limits.extract_top;
$("#a-extract-min", f).value = limits.extract_min;
$("#a-summarise-top", f).value = limits.summarise_top;
$("#a-summarise-min", f).value = limits.summarise_min;
$("#a-delete", f).hidden = !row;
f.addEventListener("input", () => { f.dataset.dirty = "true"; });
f.addEventListener("submit", (event) => save(event, row));
@@ -227,6 +242,12 @@
affinity: Number($("#a-affinity", f).value),
taste: Number($("#a-taste", f).value),
},
limits: {
extract_top: Number($("#a-extract-top", f).value),
extract_min: Number($("#a-extract-min", f).value),
summarise_top: Number($("#a-summarise-top", f).value),
summarise_min: Number($("#a-summarise-min", f).value),
},
// 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,
+4 -1
View File
@@ -1083,7 +1083,7 @@ table.applications td[data-label="Saved"] { white-space: nowrap; color: var(--di
white-space: pre-line; overflow-wrap: anywhere;
}
.agent-intent.empty { font-family: inherit; font-size: .9rem; color: var(--dim); font-style: italic; }
.agent-weights { margin: 0; font-size: .8rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.agent-weights, .agent-limits { 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) {
@@ -1147,6 +1147,9 @@ table.applications td[data-label="Saved"] { white-space: nowrap; color: var(--di
.weights { display: flex; gap: .75rem; flex-wrap: wrap; border: 1px solid var(--line); border-radius: .3rem; }
/* A label that wraps to two lines pushes its box down; the boxes stay in line. */
.weights label { flex: 1 1 6rem; justify-content: space-between; }
/* The limits are a pair per stage, count then score, so two to a row. */
.weights.limits label { flex: 1 1 40%; }
.agent-form fieldset + .hint { margin-top: -.3rem; }
.agent-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.agent-form details summary { cursor: pointer; color: var(--dim); font-size: .9rem; }
.agent-form details[open] summary { margin-bottom: .5rem; }