ai-agentmanager 1.31.0 β†’ 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.33.0 (2026-11-08)
4
+
5
+ - **Eval for each Jira change, with a confidence.** When an agent on a Jira issue says it's done, the app runs the project's tests again itself, on the change as it is (the test command is found in the project's files, or set once per project), and works out an *Eval* from evidence, not from the agent's word. It covers:
6
+ - the tests the agent actually ran in its session and their results;
7
+ - the app's own test run;
8
+ - each acceptance criterion and what proves it;
9
+ - CI on the pull request and the AI judge's review;
10
+ - the brief's checks and the micro benchmarks;
11
+ - what is still pending.
12
+ The **confidence** comes from fixed rules over these: it is **100% only when** the tests pass when run again on the code as it is now, every criterion is met, CI and the judge agree, and nothing is pending. A change made after the run takes it below 100% until the tests run again. It shows as a percentage on the agent, in the Jira list and, for issues done but under 100%, in Today. From the Eval: *Close the gaps* sends what's pending to the agent, *Run tests again*, *Copy for Jira* (Markdown), and *Post to PR* (a comment, only when you press it).
13
+
14
+ ## 1.32.0 (2026-11-08)
15
+
16
+ - **Micro benchmarks per module, for Jira issues.** The Map has a *Speed* view: click a folder where speed matters, *Benchmark this folder*, and optionally name the Jira components or labels that mean it. An agent on a Jira issue then benchmarks that module when its issue names it (a component or label, or the folder in the request), or when its change touches it: if it says it's done without having measured it, it's asked to once. It runs every case before and after its change on the same machine, and adds cases for what it changed. A module's benchmarks are kept on this computer, outside the repository, so the next issue on it runs the same ones and the numbers line up. Each issue's numbers show on the module (case, before, after, change), and the folder is coloured by what the last issue did to its speed. A case more than 5% slower shows in Today as *Slower*, with *Ask to fix* (the agent makes it as fast as before, or says why it can't be) and *It's fine*. Jira issues' components and labels are now read along with their summary.
17
+
3
18
  ## 1.31.0 (2026-11-08)
4
19
 
5
20
  - **Bugs on the Map.** The Map has a *Bugs* view (next to *Agents*): each folder is coloured by the bugs hunts found in it, the worst weighing most, plus a little for how often it changed in the last 30 days, and its bug count shows on it. Bugs that come with their path through the code (`file:line` steps) are drawn as arrows from folder to folder along it: the hot paths, thicker where more (and worse) bugs go the same way. Folders no hunt has looked at are hatched. Click a folder or an arrow for its bugs, with *Fix* and *Evidence*, or *Hunt here* to start a hunt on that folder.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-agentmanager",
3
- "version": "1.31.0",
3
+ "version": "1.33.0",
4
4
  "description": "Run background coding agents (Claude Code, Codex) per intent, and keep track of them from a web UI, your phone or the CLI",
5
5
  "keywords": [
6
6
  "claude",
package/public/app.js CHANGED
@@ -9,6 +9,7 @@ import { initSide } from '/side.js';
9
9
  import { openCopy, pasteInto } from '/termclip.js';
10
10
  import { initBuilt } from '/built.js';
11
11
  import { addTools, download, htmlFile, initExport } from '/export.js';
12
+ import { evalChip, evalHtml } from '/eval.js';
12
13
  import { badgeHtml as scoreBadge, chipHtml as scoreChip, improveHtml, scorecardHtml, scorecardSpeech } from '/scorecard.js';
13
14
  import { bindListen, listenHtml, play, speakable, now as speaking, stop as stopSpeaking } from '/speak.js';
14
15
  import { initReview } from '/review.js';
@@ -267,6 +268,7 @@ const todayUi = initToday({
267
268
  openReviews: () => reviewsUi.open(),
268
269
  openBugs: (show = 'open') => bugsUi.open({ show }),
269
270
  openChanges: (id) => (showTab('agents'), select(id), reviewUi.open(id)),
271
+ openEval: (id) => (showTab('agents'), select(id), openDoc(id, 'eval')),
270
272
  });
271
273
  $('#today-btn').onclick = () => todayUi.open();
272
274
  // Designs: every agent's design doc, the ones waiting for your review first.
@@ -497,7 +499,7 @@ const INSIGHT_ICONS = { why: '🎯', what: 'πŸ“¦', how: 'πŸ› ', now: 'πŸ“' };
497
499
  const DOCS = { analysis: 'Analysis', design: 'Design', flow: 'Flow', proposal: 'Proposal', humanai: 'Human vs AI', diagrams: 'Diagrams', scorecard: 'Scorecard' };
498
500
  // Optional extras that "Write all" leaves out.
499
501
  const DOC_EXTRAS = new Set(['diagrams', 'scorecard']);
500
- const DOC_TITLES = { ...DOCS, plan: 'Plan', intent: 'Intent', spec: 'Spec', designdoc: 'Design doc', benchmark: 'Benchmark' };
502
+ const DOC_TITLES = { ...DOCS, eval: 'Eval', plan: 'Plan', intent: 'Intent', spec: 'Spec', designdoc: 'Design doc', benchmark: 'Benchmark' };
501
503
  // The agent's intent, spec and plan files (read from the daemon when opened; kept here by agent and kind).
502
504
  const SPEC_KINDS = { intent: 'Intent', spec: 'Spec', plan: 'Plan', designdoc: 'Design doc', benchmark: 'Benchmark' };
503
505
  // What each optional file is, for its button before it's written.
@@ -513,7 +515,7 @@ async function loadSpec(agentId, kind) {
513
515
  }
514
516
  /** What the document dialog shows: a stakeholder document, or the agent's plan under review. */
515
517
  const docOf = (a, kind) =>
516
- isSpecKind(a, kind) ? specCache.get(`${a?.id}:${kind}`) : kind === 'plan' ? a?.planReview && { markdown: a.planReview.markdown, at: a.planReview.updatedAt } : a?.docs?.[kind];
518
+ kind === 'eval' ? (a?.eval?.markdown ? { markdown: a.eval.markdown, at: a.eval.at } : null) : isSpecKind(a, kind) ? specCache.get(`${a?.id}:${kind}`) : kind === 'plan' ? a?.planReview && { markdown: a.planReview.markdown, at: a.planReview.updatedAt } : a?.docs?.[kind];
517
519
 
518
520
  const VERDICT = { agree: 'βœ“ Agrees', partly: 'β‰ˆ Partly agrees', disagree: 'βœ— Disagrees', keep: 'βœ“ Keep', ai: 'πŸ€– AI could answer', reword: '✎ Reword' };
519
521
  const CONFIDENCE = { high: 'High confidence', medium: 'Medium confidence', low: 'Low confidence' };
@@ -629,6 +631,7 @@ function renderDocDialog() {
629
631
  const specKind = isSpecKind(a, docView.kind);
630
632
  $('#doc-title').textContent = `${label} Β· ${a?.name ?? ''}`;
631
633
  const body = $('#doc-body');
634
+ if (docView.kind === 'eval') return renderEval(a, body, d);
632
635
  body.classList.toggle('diagrams-view', docView.kind === 'diagrams');
633
636
  if (d?.pending) {
634
637
  body.innerHTML = `<p class="hint">${docView.kind === 'humanai' ? 'Splitting the open questions and answering the AI ones, then asking a second model to check…' : docView.kind === 'diagrams' ? "Drawing the diagrams from the documents and the agent's work so far…" : `Writing the ${label.toLowerCase()} document from the agent's work so far…`}</p>`;
@@ -675,13 +678,61 @@ function openDoc(agentId, kind) {
675
678
  $('#doc-body').dataset.rendered = '';
676
679
  $('#doc-dialog').showModal();
677
680
  const a = agents.get(agentId);
678
- if (isSpecKind(a, kind)) {
681
+ if (kind === 'eval') {
682
+ if (!a?.eval?.items) api('POST', `/agents/${agentId}/eval`).catch((e) => toast(e.message, 6000));
683
+ } else if (isSpecKind(a, kind)) {
679
684
  specCache.delete(`${agentId}:${kind}`);
680
685
  loadSpec(agentId, kind).then(() => docView?.agentId === agentId && docView.kind === kind && renderDocDialog());
681
686
  } else if (kind !== 'plan' && !a.docs?.[kind]?.markdown && !a.docs?.[kind]?.pending) generateDoc();
682
687
  renderDocDialog();
683
688
  }
684
689
 
690
+ /** The Eval in the document dialog: drawn again when it or its test run changes. */
691
+ function renderEval(a, body, d) {
692
+ body.classList.remove('diagrams-view');
693
+ const ev = a?.eval;
694
+ const version = `${ev?.at}:${ev?.rerun?.at}:${Boolean(ev?.rerun?.running)}`;
695
+ if (body.dataset.rendered !== version) {
696
+ body.innerHTML = evalHtml(ev, esc, { canPost: Object.values(a?.prs ?? {}).some((p) => p.state === 'OPEN') });
697
+ body.dataset.rendered = version;
698
+ }
699
+ $('#doc-meta').textContent = ev?.at ? `Worked out ${ago(ev.at)}${ev.postedTo ? ' Β· posted on the pull request' : ''}` : '';
700
+ for (const id of ['doc-copy', 'doc-download', 'doc-print']) $(`#${id}`).disabled = !d?.markdown;
701
+ $('#doc-html').hidden = true;
702
+ $('#doc-listen').innerHTML = '';
703
+ $('#doc-print').hidden = true;
704
+ $('#doc-regen').hidden = true;
705
+ $('#doc-bg').hidden = true;
706
+ $('#doc-foot').hidden = true;
707
+ }
708
+
709
+ $('#doc-body').addEventListener('click', (e) => {
710
+ const b = e.target.closest('[data-eval]');
711
+ if (!b || docView?.kind !== 'eval') return;
712
+ const id = docView.agentId;
713
+ const what = b.dataset.eval;
714
+ if (what === 'copy') {
715
+ return navigator.clipboard.writeText(agents.get(id)?.eval?.markdown ?? '').then(
716
+ () => toast('Eval copied as Markdown; paste it in the Jira issue'),
717
+ () => toast('Copy failed: your browser blocked clipboard access'),
718
+ );
719
+ }
720
+ if (what === 'verify') return act(() => api('POST', `/agents/${id}/eval/verify`), 'Running the tests again on the change');
721
+ if (what === 'gaps') return act(() => api('POST', `/agents/${id}/eval/gaps`), 'Sent the gaps to the agent; the Eval is worked out again when it is done');
722
+ if (what === 'post') return act(async () => toast((await api('POST', `/agents/${id}/eval/post`)).edited ? 'Eval updated on the pull request' : 'Eval posted on the pull request', 4000));
723
+ });
724
+ $('#doc-body').addEventListener('submit', (e) => {
725
+ const f = e.target.closest('[data-eval-command]');
726
+ if (!f || docView?.kind !== 'eval') return;
727
+ e.preventDefault();
728
+ const id = docView.agentId;
729
+ act(async () => {
730
+ const r = await api('PUT', `/agents/${id}/eval/command`, { command: f.command.value });
731
+ await api('POST', `/agents/${id}/eval/verify`);
732
+ toast(r.testCommand ? `Saved; running ${r.testCommand}` : 'Saved', 4000);
733
+ });
734
+ });
735
+
685
736
  function generateDoc() {
686
737
  const { agentId, kind } = docView;
687
738
  act(async () => upsert(await api('POST', `/agents/${agentId}/docs/${kind}`)));
@@ -835,8 +886,9 @@ const OUTCOME = {
835
886
 
836
887
  /** The scorecard before you review: the score, Improve, and the full card. */
837
888
  function scoreStrip(a) {
838
- if (!a.docs?.scorecard?.data && !a.improving) return '';
839
- return `<div class="sc-strip">${scoreBadge(a.docs?.scorecard, esc, { improving: a.improving })} ${improveHtml(a)} ${a.docs?.scorecard?.data ? '<button class="small ghost" data-doc="scorecard">Scorecard</button>' : ''}</div>`;
889
+ const ev = a.eval?.items || a.eval?.rerun?.running ? `${evalChip(a.eval, esc, 'data-doc="eval"')}` : '';
890
+ if (!a.docs?.scorecard?.data && !a.improving && !ev) return '';
891
+ return `<div class="sc-strip">${ev} ${scoreBadge(a.docs?.scorecard, esc, { improving: a.improving })} ${improveHtml(a)} ${a.docs?.scorecard?.data ? '<button class="small ghost" data-doc="scorecard">Scorecard</button>' : ''}${ev ? '<button class="small ghost" data-doc="eval">Eval</button>' : ''}</div>`;
840
892
  }
841
893
 
842
894
  /** End result, status and blockers: first thing a reviewer reads. */
@@ -983,7 +1035,7 @@ function agentItem(a, { project = false } = {}) {
983
1035
  ${a.prs.length ? `<span>${a.prs.length} PR</span>` : ''}
984
1036
  ${a.bugs.length ? `<span>${a.bugs.length} bug</span>` : ''}
985
1037
  ${a.usage?.total ? `<span title="${esc(usageTitle(a.usage))}">${fmtTokens(ioOf(a.usage))} tok</span>` : ''}
986
- ${scoreChip(a, esc)}
1038
+ ${scoreChip(a, esc)}${evalChip(a.eval, esc)}
987
1039
  ${(a.brief?.references ?? []).filter((r) => r.key && r.url).map((r) => `<span class="tag key-ref" title="${esc(r.title || r.url)}">${esc(r.label)}</span>`).join('')}
988
1040
  ${a.brief?.summary?.total
989
1041
  ? `<span class="${a.brief.summary.failed ? 'fail' : ''}" title="${esc(checksSummary(a.brief))}">βœ“${a.brief.summary.passed}/${a.brief.summary.total}${a.brief.summary.failed ? ` βœ—${a.brief.summary.failed}` : ''}</span>`
package/public/codemap.js CHANGED
@@ -65,10 +65,10 @@ export function initCodeMap({ api, $, esc, agents, openAgent, openBugs, toast })
65
65
  let timer = null;
66
66
  let project = null;
67
67
  let layer = 'agents';
68
- let picked = null; // in the Bugs view: { module } or { from, to }
68
+ let picked = null; // in the Bugs and Speed views: { module } or { from, to }
69
69
  try {
70
70
  project = localStorage.getItem(SAVED) || null;
71
- layer = localStorage.getItem(LAYER) === 'bugs' ? 'bugs' : 'agents';
71
+ layer = ['bugs', 'speed'].includes(localStorage.getItem(LAYER)) ? localStorage.getItem(LAYER) : 'agents';
72
72
  } catch {}
73
73
 
74
74
  const nameOf = (id) => data?.map.agents.find((a) => a.id === id)?.name ?? agents.get(id)?.name ?? id;
@@ -76,7 +76,7 @@ export function initCodeMap({ api, $, esc, agents, openAgent, openBugs, toast })
76
76
 
77
77
  async function load() {
78
78
  try {
79
- const q = new URLSearchParams({ ...(project ? { project } : {}), ...(layer === 'bugs' ? { layer } : {}) });
79
+ const q = new URLSearchParams({ ...(project ? { project } : {}), ...(layer !== 'agents' ? { layer } : {}) });
80
80
  data = await api('GET', `/codemap${q.size ? `?${q}` : ''}`);
81
81
  if (data.project && data.project.key !== project) project = data.project.key;
82
82
  } catch (e) {
@@ -101,14 +101,17 @@ export function initCodeMap({ api, $, esc, agents, openAgent, openBugs, toast })
101
101
  $('#map-bar').innerHTML = `
102
102
  <b>Map</b>
103
103
  ${projects.length ? `<select data-map-set="project" aria-label="Project">${projects.map((p) => `<option value="${esc(p.key)}" ${p.key === data?.project?.key ? 'selected' : ''}>${esc(p.name)} (${p.running} running)</option>`).join('')}</select>` : ''}
104
- <span class="chips map-layers" role="tablist"><button class="chip ${layer === 'agents' ? 'active' : ''}" data-map-layer="agents" role="tab" aria-selected="${layer === 'agents'}">Agents</button><button class="chip ${layer === 'bugs' ? 'active' : ''}" data-map-layer="bugs" role="tab" aria-selected="${layer === 'bugs'}" title="Where hunts found bugs, and the paths through the code they take">Bugs</button></span>
105
- ${layer === 'bugs'
104
+ <span class="chips map-layers" role="tablist"><button class="chip ${layer === 'agents' ? 'active' : ''}" data-map-layer="agents" role="tab" aria-selected="${layer === 'agents'}">Agents</button><button class="chip ${layer === 'bugs' ? 'active' : ''}" data-map-layer="bugs" role="tab" aria-selected="${layer === 'bugs'}" title="Where hunts found bugs, and the paths through the code they take">Bugs</button><button class="chip ${layer === 'speed' ? 'active' : ''}" data-map-layer="speed" role="tab" aria-selected="${layer === 'speed'}" title="Modules where speed matters: micro benchmarks for the Jira issues that change them">Speed</button></span>
105
+ ${layer === 'speed'
106
+ ? `<span class="map-legend"><span class="map-key watched"></span>benchmarked <span class="map-key slower"></span>last issue made it over ${data?.speed?.slowerPct ?? 5}% slower <span class="map-key faster"></span>faster</span>`
107
+ : layer === 'bugs'
106
108
  ? '<span class="map-legend"><span class="map-key heat"></span>bugs (worst weigh most) and recent changes <span class="map-key arrow"></span>path a bug takes <span class="map-key cold"></span>no hunt has looked here</span>'
107
109
  : '<span class="map-legend"><span class="map-key solid"></span>changing <span class="map-key ring"></span>reading <span class="map-key red"></span>same file changed <span class="map-key dash"></span>reading what another changed</span>'}
108
110
  <span class="spacer"></span>
109
111
  <button class="small" data-map="refresh" title="Look again now (it refreshes every few seconds)">↻</button>
110
112
  <button class="small" data-map="close" title="Back (Esc)">Close</button>`;
111
113
  if (layer === 'bugs') return drawBugs();
114
+ if (layer === 'speed') return drawSpeed();
112
115
  const warn = (m?.links ?? []).filter((l) => l.kind !== 'near');
113
116
  $('#map-warn').innerHTML = warn.length ? `<ul>${warn.map(sentence).join('')}</ul>` : m?.agents.length ? '<p class="hint">No agents are on the same code.</p>' : '';
114
117
  const box = $('#map-box');
@@ -301,6 +304,104 @@ export function initCodeMap({ api, $, esc, agents, openAgent, openBugs, toast })
301
304
  }
302
305
  }
303
306
 
307
+ /** The benchmarked modules a map folder has, or is in (a folder can be deeper or shallower than a tile). */
308
+ const watchedIn = (key) => (data?.speed?.modules ?? []).filter((w) => !w.path || key === w.path || key.startsWith(`${w.path}/`) || w.path.startsWith(`${key === '.' ? '' : key}/`));
309
+ const pct = (n) => (n === null || n === undefined ? '' : `${n > 0 ? '+' : n < 0 ? 'βˆ’' : 'Β±'}${Math.abs(n)}%`);
310
+ const trend = (n, limit) => (n === null || n === undefined ? '' : n > limit ? 'slower' : n < -limit ? 'faster' : 'same');
311
+
312
+ /** The Speed view: benchmarked folders, coloured by what the last issue on them did to their speed. */
313
+ function drawSpeed() {
314
+ const m = data?.map;
315
+ const sp = data?.speed;
316
+ const box = $('#map-box');
317
+ $('#map-agents').innerHTML = '';
318
+ if (!m || !sp || !m.modules.length) {
319
+ box.innerHTML = `<p class="hint map-empty">${data?.project ? 'No files to show for this project yet.' : 'No projects with a repository yet.'}</p>`;
320
+ $('#map-warn').innerHTML = '';
321
+ return;
322
+ }
323
+ const limit = sp.slowerPct;
324
+ const last = (key) => watchedIn(key).flatMap((w) => w.runs).sort((a, b) => String(b.at).localeCompare(String(a.at)))[0] ?? null;
325
+ // Benchmarked folders get more room, so their numbers show.
326
+ const items = m.modules.map((mod) => ({ ...mod, weight: Math.max(1, mod.files) + (watchedIn(mod.key).length ? 20 : 0) })).sort((a, b) => b.weight - a.weight);
327
+ const W = box.clientWidth;
328
+ const H = Math.max(320, view.clientHeight - box.offsetTop - 24);
329
+ box.style.height = `${H}px`;
330
+ const big = items.slice(0, 100);
331
+ const rest = items.slice(100);
332
+ if (rest.length) big.push({ key: `${rest.length} more folders`, files: rest.reduce((s2, x) => s2 + x.files, 0), weight: rest.reduce((s2, x) => s2 + x.weight, 0), more: true });
333
+ box.innerHTML = squarify(big, 0, 0, W, H)
334
+ .map(({ x, y, w, h, item }) => {
335
+ const on = !item.more && watchedIn(item.key).length > 0;
336
+ const r = on ? last(item.key) : null;
337
+ const t = trend(r?.worst, limit);
338
+ const sel = picked?.module === item.key;
339
+ const tip = `${item.key}: ${item.files} files${on ? ` Β· benchmarked${r ? ` Β· ${r.issue ?? r.agent}: ${pct(r.worst)} at worst` : ', no issue has measured it yet'}` : ''}`;
340
+ return `<div class="map-tile speed ${on ? 'watched' : ''} ${t} ${sel ? 'picked' : ''} ${item.more ? 'more' : ''}" data-map-mod="${esc(item.more ? '' : item.key)}" style="left:${x}px;top:${y}px;width:${w}px;height:${h}px" title="${esc(tip)}">
341
+ ${w > 46 && h > 22 ? `<span class="map-name">${esc(item.key === '.' ? '(top level)' : item.key)}</span>` : ''}
342
+ ${on && w > 40 && h > 38 ? `<span class="map-speed ${t}">${r ? esc(`${r.issue ?? 'last'} ${pct(r.worst)}`) : 'benchmarked'}</span>` : w > 46 && h > 38 ? `<span class="map-count">${item.files}</span>` : ''}
343
+ </div>`;
344
+ })
345
+ .join('');
346
+ $('#map-warn').innerHTML = speedPanel(limit);
347
+ }
348
+
349
+ function runRow(r, limit) {
350
+ const cases = r.cases
351
+ .map((c) => `<tr class="${trend(c.change, limit)}"><td>${esc(c.name)}</td><td>${c.before ?? 'β€”'}</td><td>${c.after}</td><td>${esc(c.unit ?? '')}</td><td>${pct(c.change) || 'β€”'}</td><td>${esc(c.note ?? '')}</td></tr>`)
352
+ .join('');
353
+ return `<li><details><summary><b>${esc(r.issue ?? '(no issue)')}</b> <button class="link" data-map-open="${esc(r.agentId)}" title="Open its agent">${esc(r.agent && r.agent !== r.issue ? r.agent : 'its agent')}</button> <span class="map-speed ${trend(r.worst, limit)}">${r.worst === null ? 'no before numbers' : `${pct(r.worst)} at worst`}</span> <span class="hint">${esc(new Date(r.at).toLocaleDateString())} Β· ${r.cases.length} case${r.cases.length === 1 ? '' : 's'}${r.accepted ? ' Β· marked fine' : ''}</span></summary>
354
+ <table class="bench-cases"><thead><tr><th>Case</th><th>Before</th><th>After</th><th>Unit</th><th>Change</th><th>Note</th></tr></thead><tbody>${cases}</tbody></table>
355
+ ${r.command ? `<p class="hint">Run with <code>${esc(r.command)}</code>${r.env ? ` Β· ${esc(r.env)}` : ''}</p>` : ''}</details></li>`;
356
+ }
357
+
358
+ /** Under the map: the picked folder's benchmarks and the issues that ran them, else a summary. */
359
+ function speedPanel(limit) {
360
+ const sp = data.speed;
361
+ if (picked?.module !== undefined) {
362
+ const name = picked.module === '.' ? '(top level)' : picked.module;
363
+ const ws = watchedIn(picked.module);
364
+ const unpick = '<button class="small" data-map-unpick>Γ—</button>';
365
+ if (!ws.length) {
366
+ return `<div class="map-pick"><b>${esc(name)}</b> <span class="hint">not benchmarked</span> ${unpick}
367
+ <form class="bench-watch" data-bench-watch="${esc(picked.module === '.' ? '' : picked.module)}"><input name="components" placeholder="Jira components or labels for it (optional, comma-separated)" autocomplete="off" /> <button class="small primary">Benchmark this folder</button></form>
368
+ <p class="hint">Agents on Jira issues that name it (a component or label, or the folder in the request), or whose change touches it, run its micro benchmarks before and after. The benchmarks are kept on this computer, outside the repository, and reused by the next issue.</p></div>`;
369
+ }
370
+ return ws
371
+ .map((w) => `<div class="map-pick"><b>${esc(w.path || '(whole repository)')}</b> <span class="hint">${w.runs.length ? `${w.runs.length} issue${w.runs.length === 1 ? '' : 's'} measured` : 'no issue has measured it yet'} Β· kept in <code>${esc(w.dir)}</code></span> ${unpick}
372
+ <form class="bench-watch" data-bench-watch="${esc(w.path)}"><input name="components" value="${esc(w.components.join(', '))}" placeholder="Jira components or labels for it (comma-separated)" autocomplete="off" /> <button class="small">Save</button> <button type="button" class="small" data-bench-unwatch="${esc(w.id)}" title="Agents stop benchmarking it; what was measured stays">Stop benchmarking</button></form>
373
+ ${w.runs.length ? `<ul class="map-bug-list bench-runs">${w.runs.map((r) => runRow(r, limit)).join('')}</ul>` : ''}</div>`)
374
+ .join('');
375
+ }
376
+ if (!sp.modules.length) return `<p class="hint">No folder is benchmarked in this project yet. Click one where speed matters, then <b>Benchmark this folder</b>: agents on Jira issues about it measure its speed before and after their change.${sp.other.length ? ` ${sp.other.length} run${sp.other.length === 1 ? '' : 's'} from agents with benchmarks on are kept too.` : ''}</p>`;
377
+ return `<p class="hint">Benchmarked: ${sp.modules
378
+ .map((w) => {
379
+ const r = w.runs[0];
380
+ return `<button class="link" data-map-mod="${esc(w.path ? w.path.split('/').slice(0, 2).join('/') : '.')}">${esc(w.path || '(whole repository)')}</button>${r ? ` <span class="map-speed ${trend(r.worst, limit)}">${esc(r.issue ?? 'last')} ${pct(r.worst)}</span>` : ''}`;
381
+ })
382
+ .join(', ')}. Click a folder for its issues and numbers.</p>`;
383
+ }
384
+
385
+ async function benchWatch(form) {
386
+ try {
387
+ await api('POST', '/benchmodules', { project: data.project.key, path: form.dataset.benchWatch, components: form.components.value });
388
+ toast?.('Saved: agents on Jira issues about it will benchmark it', 4000);
389
+ } catch (e) {
390
+ toast?.(e.message, 6000);
391
+ }
392
+ load();
393
+ }
394
+
395
+ async function benchUnwatch(id) {
396
+ try {
397
+ await api('DELETE', `/benchmodules/${id}`);
398
+ toast?.('Not benchmarked any more', 3000);
399
+ } catch (e) {
400
+ toast?.(e.message, 6000);
401
+ }
402
+ load();
403
+ }
404
+
304
405
  function show(on) {
305
406
  open = on;
306
407
  view.hidden = !on;
@@ -337,6 +438,13 @@ export function initCodeMap({ api, $, esc, agents, openAgent, openBugs, toast })
337
438
  const mod = e.target.closest('[data-map-mod]');
338
439
  if (mod?.dataset.mapMod) return (picked = picked?.module === mod.dataset.mapMod ? null : { module: mod.dataset.mapMod }), draw();
339
440
  }
441
+ if (layer === 'speed') {
442
+ const un = e.target.closest('[data-bench-unwatch]');
443
+ if (un) return benchUnwatch(un.dataset.benchUnwatch);
444
+ if (e.target.closest('[data-map-unpick]')) return (picked = null), draw();
445
+ const mod = e.target.closest('[data-map-mod]');
446
+ if (mod?.dataset.mapMod) return (picked = picked?.module === mod.dataset.mapMod ? null : { module: mod.dataset.mapMod }), draw();
447
+ }
340
448
  const o = e.target.closest('[data-map-open]');
341
449
  if (o) {
342
450
  show(false);
@@ -346,6 +454,12 @@ export function initCodeMap({ api, $, esc, agents, openAgent, openBugs, toast })
346
454
  if (b?.dataset.map === 'close') return show(false);
347
455
  if (b?.dataset.map === 'refresh') return load();
348
456
  });
457
+ view.addEventListener('submit', (e) => {
458
+ const f = e.target.closest('[data-bench-watch]');
459
+ if (!f) return;
460
+ e.preventDefault();
461
+ benchWatch(f);
462
+ });
349
463
  view.addEventListener('change', (e) => {
350
464
  if (e.target.dataset.mapSet !== 'project') return;
351
465
  project = e.target.value;
package/public/eval.js ADDED
@@ -0,0 +1,42 @@
1
+ // Eval on the page: the confidence for an agent's Jira change, what was run and verified, and
2
+ // what's pending. Shared by the agent's Eval document, its strip, the Jira list and Today.
3
+
4
+ const MARK = { ok: 'βœ…', partial: '🟑', pending: '⏳', failed: '❌', na: 'β€”' };
5
+ const tone = (n) => (n === 100 ? 'good' : n >= 70 ? 'mid' : 'bad');
6
+
7
+ /** A small chip: "βœ” 100%" / "87%" (or "Testing…"); `attr` makes it a button. */
8
+ export function evalChip(ev, esc, attr = '') {
9
+ if (!ev?.items && !ev?.rerun?.running) return '';
10
+ if (ev.rerun?.running && !ev.items) return `<span class="eval-chip" title="Running the tests again">Testing…</span>`;
11
+ const tip = ev.confidence === 100 ? 'Eval: every check holds up' : `Eval: ${ev.pending.length} pending: ${ev.pending.slice(0, 3).join('; ')}`;
12
+ const inner = `${ev.confidence === 100 ? 'βœ” ' : ''}${ev.confidence}%${ev.rerun?.running ? ' ↻' : ''}`;
13
+ return attr ? `<button class="eval-chip ${tone(ev.confidence)}" ${attr} title="${esc(tip)}">${inner}</button>` : `<span class="eval-chip ${tone(ev.confidence)}" title="${esc(tip)}">${inner}</span>`;
14
+ }
15
+
16
+ /** The whole Eval: confidence, each verification, the criteria, the tests run, what's pending, and actions. */
17
+ export function evalHtml(ev, esc, { canPost = false } = {}) {
18
+ if (!ev?.items) return `<p class="hint">${ev?.rerun?.running ? `Running <code>${esc(ev.rerun.command)}</code> on the change…` : 'Working the Eval out…'}</p>`;
19
+ const last = new Map();
20
+ for (const r of ev.runs) last.set(r.command, r);
21
+ const rerun = ev.rerun;
22
+ const counts = (c) => (c ? ` <span class="hint">${c.passed} passed${c.failed ? `, ${c.failed} failed` : ''}${c.unit ? ` (${esc(c.unit)})` : ''}</span>` : '');
23
+ return `<div class="eval">
24
+ <div class="eval-head"><span class="eval-score ${tone(ev.confidence)}">${ev.confidence}%</span> <b>${ev.confidence === 100 ? 'Confident: every check holds up' : `confident Β· ${ev.pending.length} pending`}</b>
25
+ <span class="eval-acts">
26
+ <button class="small" data-eval="verify" ${rerun?.running ? 'disabled' : ''} title="Run the tests again on the change as it is now">${rerun?.running ? 'Running tests…' : 'Run tests again'}</button>
27
+ ${ev.pending.length ? '<button class="small primary" data-eval="gaps" title="Send what is pending to the agent, to bring it to 100%">Close the gaps</button>' : ''}
28
+ ${canPost ? '<button class="small" data-eval="post" title="Post it as a comment on the pull request (edited in place next time)">Post to PR</button>' : ''}
29
+ <button class="small" data-eval="copy" title="Copy as Markdown, to paste in the Jira issue">Copy for Jira</button>
30
+ </span></div>
31
+ <table class="eval-items"><tbody>${ev.items.map((i) => `<tr class="eval-${i.state}"><td>${MARK[i.state]}</td><td>${esc(i.label)}</td><td>${esc(i.detail)}</td></tr>`).join('')}</tbody></table>
32
+ ${ev.criteria.length ? `<h4>Acceptance criteria</h4><ul class="eval-list">${ev.criteria.map((c) => `<li>${c.status === 'met' ? 'βœ…' : c.status === 'not_met' ? '❌' : '⏳'} ${esc(c.criterion)}${c.evidence ? ` <span class="hint">β€” ${esc(c.evidence)}</span>` : ''}</li>`).join('')}</ul>` : ''}
33
+ <h4>Tests run</h4>
34
+ <ul class="eval-list">
35
+ ${rerun && !rerun.running ? `<li>${rerun.passed ? 'βœ…' : '❌'} <code>${esc(rerun.command)}</code> run again by AI Agent Manager${counts(rerun.counts)} <span class="hint">${esc(new Date(rerun.at).toLocaleString())}${rerun.ms ? ` Β· ${Math.round(rerun.ms / 1000)}s` : ''}</span>${rerun.passed ? '' : `<pre class="eval-tail">${esc(rerun.tail ?? '')}</pre>`}</li>` : ''}
36
+ ${[...last.values()].map((r) => `<li>${r.passed ? 'βœ…' : '❌'} <code>${esc(r.command)}</code> by the agent${counts(r.counts)} ${ev.runs.filter((x) => x.command === r.command).length > 1 ? `<span class="hint">Β· ran ${ev.runs.filter((x) => x.command === r.command).length}Γ—, last shown</span>` : ''}</li>`).join('') || '<li class="hint">The agent ran no tests in its session.</li>'}
37
+ </ul>
38
+ <form class="eval-command" data-eval-command><label class="hint">Test command for this project <input name="command" value="${esc(ev.testCommand ?? '')}" placeholder="e.g. npm test" autocomplete="off" /></label> <button class="small">Save</button></form>
39
+ ${ev.pending.length ? `<h4>Pending</h4><ul class="eval-list">${ev.pending.map((p) => `<li>⏳ ${esc(p)}</li>`).join('')}</ul>` : '<p class="hint">Nothing pending.</p>'}
40
+ <p class="hint">Confidence comes from fixed rules over these, not from a model: it is 100% only when the tests pass when run again on the code as it is now, every acceptance criterion is met, CI and the AI judge agree, and nothing is pending.</p>
41
+ </div>`;
42
+ }
package/public/issues.js CHANGED
@@ -4,6 +4,7 @@
4
4
  // agents start only for the ticked ones. Each issue has your action on its left (assign, skip, done,
5
5
  // remove), kept by the daemon across restarts and updates, and changeable any time.
6
6
 
7
+ import { evalChip } from './eval.js';
7
8
  import { listenHtml } from './speak.js';
8
9
  import { holdWhilePicking, rowKeys } from './rowkeys.js';
9
10
  import { expandButton, expandable } from './expand.js';
@@ -119,7 +120,7 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, openChanges,
119
120
  : '<span class="hint">β€”</span>';
120
121
  return `<tr data-row-id="${esc(r.key)}" class="stage-${esc(r.stage)} action-${esc(r.action)}">${box}${actionCell(r)}
121
122
  <td>${issue}${aboutIssue(r)}</td>
122
- <td>${status}</td>
123
+ <td>${status}${r.eval ? `<div>${evalChip(r.eval, esc, `data-issue-doc="eval" data-agent="${esc(r.agent.id)}"`)}</div>` : ''}</td>
123
124
  <td class="issue-note">${esc(r.note)}${r.snoozeUntil ? `<div class="hint">until ${esc(new Date(r.snoozeUntil).toLocaleString([], { weekday: 'short', hour: 'numeric', minute: '2-digit' }))}</div>` : ''}${r.stage === 'review' && !r.pr ? `<div class="issue-ship"><button class="small" data-issue-ship="changes" data-agent="${esc(r.agent.id)}" title="The diff, to look over first">See changes</button> <button class="small primary" data-issue-ship="pr" data-agent="${esc(r.agent.id)}" title="Commit what is left, push and open the pull request">Open PR</button></div>` : ''}</td>
124
125
  <td class="nowrap">${plan}</td>
125
126
  <td class="nowrap">${design}</td>
package/public/style.css CHANGED
@@ -1148,6 +1148,26 @@ body.mapping .layout, body.mapping .watch-view { display: none; }
1148
1148
  .map-pick { padding: 6px 10px; margin-bottom: 8px; border-radius: 6px; background: var(--panel); font-size: 13px; }
1149
1149
  .map-warn .map-bug-list li { border-left: none; padding: 4px 0; margin: 0; background: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
1150
1150
  .map-bug-list { margin: 6px 0 0 !important; }
1151
+ .map-tile.speed { cursor: pointer; }
1152
+ .map-tile.speed.watched { background: color-mix(in srgb, var(--accent) 22%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
1153
+ .map-tile.speed.watched.slower { background: color-mix(in srgb, var(--red) 30%, var(--panel)); }
1154
+ .map-tile.speed.watched.faster { background: color-mix(in srgb, var(--green) 26%, var(--panel)); }
1155
+ .map-tile.speed.picked { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
1156
+ .map-tile.speed:hover { filter: brightness(1.08); }
1157
+ .map-key.watched { background: color-mix(in srgb, var(--accent) 35%, var(--panel)); }
1158
+ .map-key.slower { background: color-mix(in srgb, var(--red) 45%, var(--panel)); }
1159
+ .map-key.faster { background: color-mix(in srgb, var(--green) 45%, var(--panel)); }
1160
+ .map-speed { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 8px; font-size: 10.5px; font-weight: 700; background: var(--panel); border: 1px solid currentColor; color: var(--muted); }
1161
+ .map-speed.slower { color: var(--red); }
1162
+ .map-speed.faster { color: var(--green); }
1163
+ .bench-watch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
1164
+ .bench-watch input { flex: 1; min-width: 200px; }
1165
+ .map-warn .bench-runs li { display: block; }
1166
+ .bench-runs summary { cursor: pointer; }
1167
+ table.bench-cases { margin: 6px 0; border-collapse: collapse; font-size: 12px; width: 100%; }
1168
+ table.bench-cases th, table.bench-cases td { text-align: left; padding: 2px 8px 2px 0; border-bottom: 1px solid var(--border); }
1169
+ table.bench-cases tr.slower td:nth-child(5) { color: var(--red); font-weight: 600; }
1170
+ table.bench-cases tr.faster td:nth-child(5) { color: var(--green); font-weight: 600; }
1151
1171
 
1152
1172
  /* ---------- Jira: issues agents work on */
1153
1173
  .issues-dialog { width: min(1100px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 16px; }
@@ -1372,3 +1392,28 @@ tr.bug-detail pre { white-space: pre-wrap; max-height: 280px; overflow: auto; pa
1372
1392
  .today-ask .today-label { color: var(--accent, currentColor); }
1373
1393
  table.today-table td.today-acts { white-space: normal; text-align: right; width: 34%; }
1374
1394
  table.today-table td.today-acts > * { margin: 2px 0; }
1395
+
1396
+ /* ---------- Eval: confidence for a Jira change */
1397
+ .eval-chip { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px; font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--panel); border: 1px solid currentColor; color: var(--muted); }
1398
+ button.eval-chip { cursor: pointer; }
1399
+ .eval-chip.good { color: var(--green); }
1400
+ .eval-chip.mid { color: var(--amber, #c98a12); }
1401
+ .eval-chip.bad { color: var(--red); }
1402
+ .eval-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
1403
+ .eval-score { font-size: 26px; font-weight: 800; }
1404
+ .eval-score.good { color: var(--green); }
1405
+ .eval-score.mid { color: var(--amber, #c98a12); }
1406
+ .eval-score.bad { color: var(--red); }
1407
+ .eval-acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
1408
+ table.eval-items { width: 100%; border-collapse: collapse; font-size: 13px; }
1409
+ table.eval-items td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
1410
+ table.eval-items td:first-child { width: 1.6em; }
1411
+ table.eval-items td:nth-child(2) { white-space: nowrap; font-weight: 600; }
1412
+ table.eval-items tr.eval-na td { color: var(--muted); }
1413
+ .eval h4 { margin: 14px 0 4px; }
1414
+ .eval-list { margin: 0; padding-left: 1.2em; list-style: none; }
1415
+ .eval-list li { margin: 3px 0; text-indent: -1.2em; }
1416
+ .eval-tail { margin: 4px 0 0 1.2em; text-indent: 0; max-height: 160px; overflow: auto; font-size: 11.5px; white-space: pre-wrap; }
1417
+ .eval-command { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
1418
+ .eval-command input { min-width: 220px; }
1419
+ @media (max-width: 600px) { table.eval-items td:nth-child(2) { white-space: normal; } .eval-acts { margin-left: 0; } }
package/public/today.js CHANGED
@@ -10,7 +10,7 @@ import { expandButton, expandable } from './expand.js';
10
10
  // Up to this score an item is pressing: it counts on the button.
11
11
  const PRESSING = 32;
12
12
 
13
- export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions, openIssues, openReviews, openBugs, openChanges, toast }) {
13
+ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions, openIssues, openReviews, openBugs, openChanges, openEval, toast }) {
14
14
  const dialog = $('#today-dialog');
15
15
  const body = $('#today-body');
16
16
  let data = null;
@@ -61,6 +61,8 @@ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions,
61
61
  if (it.kind === 'pr-requested') return [btn('review', 'Review it', 'A reviewer agent reads it and finds what blocks approval (a)', true), link(it.url, 'PR')].join(' ');
62
62
  if (it.kind === 'pr-ready') return [btn('open-reviews', 'Open review', 'Pick what to post (Enter)', true), link(it.url, 'PR')].join(' ');
63
63
  if (it.kind === 'rule') return btn('inbox', 'Inbox', 'Decide in the inbox (Enter)', true);
64
+ if (it.kind === 'eval') return [btn('gaps', 'Close the gaps', 'Send what is pending to the agent, to bring it to 100% (a)', true), btn('eval', 'Eval', 'What was run and verified, and what is pending (Enter)'), btn('done', 'Seen', 'Off the list until its confidence changes (d)'), btn('open', 'Open', "Open the agent's session")].join(' ');
65
+ if (it.kind === 'bench') return [btn('fix', 'Ask to fix', 'Ask the agent to make it as fast as before, or say why it can\'t be (a)', true), btn('done', "It's fine", 'The slowdown is expected: off the list (d)'), btn('open', 'Open', "Open the agent's session (Enter)")].join(' ');
64
66
  if (it.kind === 'bug-pr') return [link(it.url, 'Open PR'), btn('done', 'Done', 'You looked at it: off the list (d)'), btn('bugs', 'Details', 'The bug and how the fix was checked (Enter)')].join(' ');
65
67
  if (it.kind === 'bug') return [btn('fix', 'Fix', 'Start an agent on it, with the failing test (a)', true), btn('skip', 'Snooze', 'Until tomorrow 9am (s)'), btn('notbug', 'Not a bug', "It won't be reported again"), btn('bugs', 'Evidence', 'See it in Bugs (Enter)')].join(' ');
66
68
  return [it.agentId ? btn('open', 'Open', "Open the agent's session (Enter)", it.score < 20) : '', link(it.url, it.issueKey ? 'Jira' : 'Link')].join(' ');
@@ -200,7 +202,7 @@ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions,
200
202
  async function act(it, what) {
201
203
  if (!it) return;
202
204
  try {
203
- if (what === 'open' || (what === 'enter' && it.agentId && !['pr-ready', 'rule'].includes(it.kind))) {
205
+ if (what === 'open' || (what === 'enter' && it.agentId && !['pr-ready', 'rule', 'eval'].includes(it.kind))) {
204
206
  if (!it.agentId) return;
205
207
  dialog.close();
206
208
  return openAgent(it.agentId);
@@ -213,6 +215,10 @@ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions,
213
215
  dialog.close();
214
216
  return openReviews();
215
217
  }
218
+ if (it.kind === 'eval' && (what === 'eval' || what === 'enter')) {
219
+ dialog.close();
220
+ return openEval?.(it.agentId);
221
+ }
216
222
  if (what === 'bugs' || (what === 'enter' && (it.kind === 'bug' || it.kind === 'bug-pr'))) {
217
223
  dialog.close();
218
224
  return openBugs?.(it.kind === 'bug-pr' ? 'pr' : undefined);
@@ -282,6 +288,20 @@ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions,
282
288
  t.setHours(9, 0, 0, 0);
283
289
  await api('POST', '/findings/set', { ids: [it.findingId], status: what === 'skip' ? 'snoozed' : 'notbug', until: what === 'skip' ? t.toISOString() : null });
284
290
  changedWith(what === 'skip' ? 'Snoozed until tomorrow 9am' : "Not a bug: it won't be reported again", what === 'skip' ? 'snoozed' : 'not a bug', () => api('POST', '/findings/set', { ids: [it.findingId], status: 'open' }));
291
+ } else if (it.kind === 'eval' && (what === 'gaps' || what === 'assign')) {
292
+ await api('POST', `/agents/${it.agentId}/eval/gaps`, {});
293
+ toast?.('Sent the gaps to the agent; the Eval is worked out again when it is done', 4000);
294
+ return;
295
+ } else if (it.kind === 'eval' && what === 'done') {
296
+ await api('POST', `/agents/${it.agentId}/eval/seen`, { seen: true });
297
+ changedWith('Seen: off the list until its confidence changes', 'seen', () => api('POST', `/agents/${it.agentId}/eval/seen`, { seen: false }));
298
+ } else if (it.kind === 'bench' && (what === 'fix' || what === 'assign')) {
299
+ await api('POST', `/benchruns/${it.runId}/fix`, {});
300
+ toast?.('Asked the agent to fix it, or say why it can\'t be', 4000);
301
+ return;
302
+ } else if (it.kind === 'bench' && what === 'done') {
303
+ await api('POST', `/benchruns/${it.runId}/accept`, { accepted: true });
304
+ changedWith("It's fine: off the list", 'accepted', () => api('POST', `/benchruns/${it.runId}/accept`, { accepted: false }));
285
305
  } else if (it.kind === 'bug-pr' && what === 'done') {
286
306
  await api('POST', '/findings/set', { ids: [it.findingId], status: 'done' });
287
307
  changedWith('Done: off the list', 'done', () => api('POST', '/findings/set', { ids: [it.findingId], status: 'pr' }));