ai-agentmanager 1.60.0 → 1.62.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,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.62.0 (2026-11-19)
4
+
5
+ - **Claims check: what the documents say, against the work.** A new document on every agent, **Claims** (or `agentmgr claims <agent>`), checks the statements of fact in the agent's brief and in what was written about its work (the update for the people who asked, Explanation, Insights, Analysis, Documentation) and shows each with what backs it: Contradicted, Not backed, Only the agent says so, Backed.
6
+ - **Another model checks, and the app checks that model.** A different model than the writer (another engine when one is installed) lists the statements and quotes a source for each. With no model, the app then drops statements that are not in the text, and marks as not backed any statement whose quote is not in the sources or that names a file, link, pull request, ticket, commit, version or number found in none of them. What only the agent says (brief, spec, plan, conversation) is not counted as backed, and the brief is never a source for itself.
7
+ - **Changed for everyone: updates written by themselves are checked before you are told.** When an agent finishes or opens a pull request and its update is written, the update and the brief are checked first (and the Explanation, Insights, Analysis or Documentation if written): one more model call for each, and the alert comes that much later. The alert says how many statements are not backed, and the Update shows it over the drafts. Turn it off with `agentmgr claims --auto off`.
8
+ - **Limits.** Whether a quote really shows a statement is the checking model's reading. A true statement can be "Not backed" when the source was cut (the diff after 60,000 characters) or is not on this computer. Standups and Value estimates are not checked.
9
+ - **Fixed:** the daemon no longer prints a "MaxListenersExceededWarning" at start.
10
+ - **Tests:** unit, end-to-end and browser tests with stand-in models. Tests that turn on remote access now try another port when the first does not start, and print why. The prompt was also tried once with a real model on a made-up update with four planted errors: it found all four, and its reply had malformed JSON, which is why replies are now read statement by statement when the whole does not parse.
11
+
12
+ ## 1.61.0 (2026-11-19)
13
+
14
+ - **Quality: what happened after the merge.** A new view (top bar, or `Q`) shows what became of the agents' pull requests once they merged: the share that held up, and the ones reverted, fixed afterwards, or with failed checks on the commit they merged as. From before the merge it shows how many had a reviewer ask for changes and the median time from opened to merged. By day, week, month, quarter and year, with the change against the period before.
15
+ - **How it knows.** Each merged pull request is watched for 14 days (1 to 90, in its settings). GitHub is asked through the `gh` CLI as you, a few pull requests every two minutes and each again every six hours. No model is called.
16
+ - **A guess you can overrule.** "Fixed afterwards" is a later pull request whose title says it fixes something and that changes one of the same files, or names it. **Not a problem** overrules it, **It was a problem** records one nothing here saw, **Undo** goes back.
17
+ - **Also:** `agentmgr quality` (`show`, `mark`, `report`, `set`), **Copy report** as Markdown, and **Only the ones with a problem**.
18
+ - **Standards: what every change in a repository has to meet.** A second tab in Quality, per repository, with three parts. `agentmgr standards` (`show`, `lesson`, `risk`, `bar`, `run`) does the same from a terminal. Only you set them: an agent's own calls are refused.
19
+ - **Lessons that stick.** A lesson is proposed whenever a merged pull request is reverted, fixed afterwards, fails its checks or had changes requested. You word it in one line (**Suggest wording** asks a model, from the pull request and what reviewers wrote) and accept or dismiss it; you can also add your own. Agents started in that repository from then on are told to follow the accepted ones, and the review scorecard checks each against the changes: one not followed means "Not ready", and Improve sends it back to the agent.
20
+ - **High-risk paths.** Mark paths such as `src/auth/**`, `**/migrations/**` or `*.sql`. A change that touches one cannot be scored "Ready to approve", is held by autopilot for you (Ship it opens the pull request; autopilot never merges it), is not merged on its Eval, and is reviewed by another model when the agent finishes, also with review rounds turned off. Agents are told which paths they are and to say what they will change there before they do.
21
+ - **A quality bar the app runs itself.** Per repository: your commands (lint, types, tests, a dependency scan), "code changes need a test file changed too", and "no keys or tokens on the added lines". They run in the agent's folder before its changes are scored, once per state of the changes. A failed check caps the Tests score at 30 and means "Not ready" whatever the agent says; its output goes back to the agent. Commands found in the repository (`npm run lint`, `go vet ./...` and the like) are offered with one click.
22
+ - **Changed for everyone:** the scan for keys and tokens is on for every repository unless you turn it off there, so a change that adds something that looks like one is now "Not ready".
23
+ - **Limits:** the scorecard's check of a lesson is a model's reading of the diff. The instruction to describe a high-risk change first is an instruction, not a gate; the gates are at shipping and merging. Coverage of changed lines is not measured unless one of your commands does it. The bar's commands run on this computer as you, not in a sandbox.
24
+ - **Tests:** a test that fails with a connection left open no longer keeps `npm test` running for ever; the run ends and shows the failure.
25
+ - **Tried:** in desktop Chrome with stand-ins for GitHub and the model. The lookups were tried read-only against this repository's own merged pull requests. Not yet with real agents, and not on a phone.
26
+
3
27
  ## 1.60.0 (2026-11-19)
4
28
 
5
29
  - **Value: pull requests merged.** Next to the value delivered, how many pull requests merged in the period and how many a day, with the change against the period before. Each counts in the period it merged in, so a second pull request on the same work is counted when it lands. It is on the page, in `agentmgr value`, in the report (Markdown and Slack) and as a `pull_requests` column at the end of `value.csv`.
package/README.md CHANGED
@@ -1197,6 +1197,96 @@ agentmgr value report --kind quarter --current # this quarter so far, as Markd
1197
1197
  agentmgr value set --rate 140 --reports weekly,monthly,quarterly --at 08:30 --drive on
1198
1198
  ```
1199
1199
 
1200
+ ## Quality: what happened after the merge
1201
+
1202
+ **Quality** in the top bar (or `Q`) shows what became of the agents' pull requests once they merged, by **Day**, **Week**, **Month**, **Quarter** or **Year**. Merging more is only good news if it holds up, so this sits next to the pull request count in Value.
1203
+
1204
+ | Figure | What it is |
1205
+ |---|---|
1206
+ | Held up | The share of the merged pull requests looked at that had no problem after the merge |
1207
+ | Reverted | A later pull request titled Revert that names it, or a commit that reverts the commit it merged as |
1208
+ | Fixed afterwards | A later pull request, within the days watched, whose title says it fixes something and that changes one of the same files or names it |
1209
+ | Checks failed | A check failed or timed out on the commit it merged as (a cancelled run is not a failure) |
1210
+ | Changes requested | How many had a reviewer ask for changes before the merge |
1211
+ | Opened to merged | Median hours from opening the pull request to merging it |
1212
+
1213
+ Each pull request is watched for 14 days after it merges (set it from 1 to 90). GitHub is asked through the `gh` CLI as you: a few pull requests every two minutes, and each again every six hours while it is watched. No model is called.
1214
+
1215
+ **Fixed afterwards is a guess**, from titles and files: a fix in the same file may be about something else. **Not a problem** on a pull request overrules what was found, **It was a problem** records one nothing here saw, and **Undo** goes back; yours are marked. **Look again** asks GitHub now. **Only the ones with a problem** narrows the list, and **Copy report** gives the period as Markdown.
1216
+
1217
+ It covers pull requests of agents here, from about 100 days before you first opened it. A problem that never showed on GitHub (an incident fixed elsewhere, a bug nobody linked) is not seen unless you mark it.
1218
+
1219
+ ```bash
1220
+ agentmgr quality --period month # the share that held up, by month
1221
+ agentmgr quality mark https://github.com/acme/shop/pull/77 --clean --note "the fix was about another bug"
1222
+ agentmgr quality report --kind month # last month, as Markdown
1223
+ agentmgr quality set --days 30 # watch each merge for 30 days
1224
+ ```
1225
+
1226
+ ## Standards: what every change in a repository has to meet
1227
+
1228
+ The **Standards** tab in Quality (or `agentmgr standards`) holds, per repository, the rules that turn what went wrong before into how agents work next. Only you set them; an agent's own calls to change them are refused.
1229
+
1230
+ **Lessons.** Whenever a merged pull request is reverted, fixed afterwards, fails its checks or had changes requested by a reviewer, a lesson is proposed for its repository. Word it in one line, or use **Suggest wording** to have a model draft it from the pull request and what reviewers wrote, then **Accept** or **Dismiss**. You can add your own too. Accepted lessons (at most 40 per repository) are given to every agent started there from then on, and the review scorecard checks each one against the changes: a lesson not followed means "Not ready", and Improve sends it back to the agent.
1231
+
1232
+ **High-risk paths.** Mark the parts where a mistake is expensive: `src/auth/**`, `**/migrations/**`, `*.sql`. `*` stays inside a folder, `**` crosses folders, and a name without a slash fits at any depth. A change that touches one:
1233
+
1234
+ - cannot be scored "Ready to approve"; the scorecard says which paths it touched
1235
+ - is held by autopilot for you. **Ship it** opens the pull request, and autopilot never merges it
1236
+ - is not merged on its Eval ("merge when sure")
1237
+ - is reviewed by another model when the agent finishes, also with review rounds turned off; the pull request is then yours to open
1238
+
1239
+ Agents are told which paths are high risk and to say in their brief what they will change there before they do.
1240
+
1241
+ **The quality bar.** Checks the app runs itself, in the agent's folder, before its changes are scored:
1242
+
1243
+ - your commands, each with a name: lint, a type check, the tests, a dependency scan. Commands found in the repository are offered with one click
1244
+ - code changes need a test file changed too (off by default)
1245
+ - no keys or tokens on the added lines (on by default, for every repository)
1246
+
1247
+ A failed check caps the Tests score at 30 and means "Not ready" whatever the agent says, and on autopilot the work goes back to the agent with the check's output. The bar runs once per state of the changes; `agentmgr standards run <agent>` runs it now. Each command gets 10 minutes (`"standards": { "checkTimeoutMs": 600000 }` in `config.json`), and runs on this computer as you. `"standards": { "enabled": false }` turns all of it off.
1248
+
1249
+ ```sh
1250
+ agentmgr standards # every repository: lessons, high-risk paths, the bar
1251
+ agentmgr standards lesson shop "Exports are paged, never loaded whole"
1252
+ agentmgr standards lesson shop --accept 3fa2c1d0 "Rotate tokens behind a flag"
1253
+ agentmgr standards risk shop "src/auth/**" "**/migrations/**" --why "sign-in and data"
1254
+ agentmgr standards bar shop --add "Lint=npm run lint" --add "Types=npx tsc --noEmit" --tests
1255
+ agentmgr standards run my-agent # run the bar on its changes now
1256
+ ```
1257
+
1258
+ ## Claims check: what the documents say, against the work
1259
+
1260
+ Models write confidently, also when they are wrong. **Claims**, among an agent's documents, checks what was written about its work against the work itself: the agent's own brief, the update for the people who asked, and the Explanation, Insights, Analysis and Documentation if they are written.
1261
+
1262
+ ```sh
1263
+ agentmgr claims fix-login # check, and print each statement with what backs it
1264
+ agentmgr claims fix-login --cached # the last check
1265
+ agentmgr claims fix-login --json
1266
+ agentmgr claims --auto off # do not check updates by themselves
1267
+ ```
1268
+
1269
+ **How it works.** Another model than the one that wrote the text (another engine if one is installed, as for Human vs AI) lists every statement of fact in it and gives each a verdict, with the source and a quote from it, word for word. Then the app checks the checker, with no model:
1270
+
1271
+ - a statement that is not in the text is left out;
1272
+ - a quote that is not in the source it names (or any other) makes the statement **Not backed**;
1273
+ - a file, link, pull request, ticket, commit, version or number in the statement that appears in none of the sources makes it **Not backed**;
1274
+ - what only the agent itself says (its brief, spec, plan, the conversation) counts as **Only the agent says so**, not as backed. The brief is never a source for itself.
1275
+
1276
+ | Verdict | Meaning |
1277
+ |---|---|
1278
+ | **Contradicted** | A source says otherwise: the update says merged, the pull request is open |
1279
+ | **Not backed** | No source says so, or the checker could not quote one |
1280
+ | **Only the agent says so** | In the brief, spec, plan or conversation only; nothing measured shows it |
1281
+ | **Backed** | A measured source says so, and the quote was found in it |
1282
+ | **Opinion or plan** | A judgment, estimate or recommendation: not counted |
1283
+
1284
+ The sources are what the app measured (status, pull requests and their checks, files changed, the quality bar), the commits, the diff (the first 60,000 characters), what was asked, and the agent's own account. Particulars in statements the checker passed over are listed too.
1285
+
1286
+ **By itself.** An update written by itself (when an agent finishes or opens a pull request) is checked before you are told it is ready, together with the brief (and the other documents above that are written); the alert says how many of its statements are not backed, and the Update shows it over the drafts with **Claims** one press away. `agentmgr claims --auto off` or `"claims": { "auto": false }` in config.json turns that off. Everything else is checked when you ask: **Claims** among the documents, **Regenerate** to check again.
1287
+
1288
+ **Limits.** That a quote is in a source is checked by the app; that the quote really shows the statement is the checking model's reading, so read the ones that matter. A statement can be true and not backed (the sources are what this computer has, and long diffs and conversations are cut), and numbers under 10 are not checked as particulars. Each text is one model call. Standups and Value estimates are not checked. `agentmgr claims` exits with 1 when something is contradicted.
1289
+
1200
1290
  ## Results and spend
1201
1291
 
1202
1292
  **Results** in the top bar shows how agents did over the last 7, 30 or 90 days (or all time): how many started and how many opened a pull request, PRs merged and closed, the merge rate, the median time from starting an agent to its first PR and to merge, and the cost per merged PR. The same by engine and model (which one gets merged more, for less), by where agents came from (you, the assistant, triggers, the backlog, teams, races) and by project. `agentmgr stats --days 30`.
@@ -68,4 +68,4 @@ Design notes: [distributed.md](distributed.md) (hub) and [engines.md](engines.md
68
68
 
69
69
  ## Tests
70
70
 
71
- `test/e2e.test.js` starts a real daemon on a temporary home and port, with fake engines that print what the real CLIs print. `test/unit.test.js` covers parsers and pure functions. CI runs both on macOS and Linux, Node 20 and 22.
71
+ `test/e2e.test.js` starts a real daemon on a temporary home and port, with fake engines that print what the real CLIs print. `test/unit.test.js` covers parsers and pure functions. CI runs them on macOS and Linux, Node 20 and 22, on every push to `main` and nightly. A pull request runs the basic set (the whole suite once, on Linux with Node 22, and the package check); the label `full-ci` on it, for a big change or a release, runs all four.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-agentmanager",
3
- "version": "1.60.0",
3
+ "version": "1.62.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",
@@ -18,6 +18,7 @@ export function updateHtml(a, d, { esc, docHtml }) {
18
18
  const to = a.announce?.to ?? (/@/.test(p.to ?? '') ? p.to : '');
19
19
  return `<div class="upd" data-upd="${esc(a.id)}">
20
20
  <p class="hint">Drafts, written from the work as it stands (${esc(d.stage ?? 'in progress')}). Change them as you like: nothing goes to anyone until you send it.</p>
21
+ <div data-upd-claims></div>
21
22
  <section class="ha-card upd-card">
22
23
  <h3>Slack</h3>
23
24
  <textarea data-upd-text="slack" rows="6" aria-label="The Slack message">${esc(p.slack ?? '')}</textarea>
@@ -42,7 +43,7 @@ export function updateHtml(a, d, { esc, docHtml }) {
42
43
  </div>`;
43
44
  }
44
45
 
45
- export function initUpdateView({ body, api, toast, ago, agentOf, upsert }) {
46
+ export function initUpdateView({ body, api, toast, ago, agentOf, upsert, claimsNote = null }) {
46
47
  let slack; // where Post to Slack goes: undefined until asked, null when nowhere
47
48
  const root = () => body.querySelector('[data-upd]');
48
49
  const field = (k) => root()?.querySelector(`[data-upd-text="${k}"]`);
@@ -55,6 +56,13 @@ export function initUpdateView({ body, api, toast, ago, agentOf, upsert }) {
55
56
  function refresh(a) {
56
57
  if (!root() || !a) return;
57
58
  const u = a.announce ?? {};
59
+ // Its statements checked against the work (claims.js): what to read before it goes out.
60
+ const cl = root().querySelector('[data-upd-claims]');
61
+ const html = claimsNote?.(a) ?? '';
62
+ if (cl && cl.dataset.html !== html) {
63
+ cl.innerHTML = html;
64
+ cl.dataset.html = html;
65
+ }
58
66
  const link = u.link ? 'The link to the details goes under it.' : 'No link to the details yet: it goes without one.';
59
67
  note('slack', `${u.sent?.slack ? `Posted ${ago(u.sent.slack)}. ` : ''}${link}`);
60
68
  note('email', `${u.sent?.email ? `Opened in mail ${ago(u.sent.email)}. ` : ''}${link}`);
package/public/app.js CHANGED
@@ -10,6 +10,7 @@ import { openCopy, pasteInto } from '/termclip.js';
10
10
  import { initBuilt } from '/built.js';
11
11
  import { addTools, download, htmlFile, initExport } from '/export.js';
12
12
  import { evalChip, evalHtml } from '/eval.js';
13
+ import { claimsHtml, claimsNote } from '/claims.js';
13
14
  import { badgeHtml as scoreBadge, chipHtml as scoreChip, improveHtml, scorecardHtml, scorecardSpeech } from '/scorecard.js';
14
15
  import { bindListen, listenHtml, play, speakable, now as speaking, stop as stopSpeaking } from '/speak.js';
15
16
  import { initReview } from '/review.js';
@@ -40,6 +41,7 @@ import { initReviews } from '/reviews.js';
40
41
  import { initBugHunt } from '/bughunt.js';
41
42
  import { drawDiagram } from '/diagram.js';
42
43
  import { initValue } from '/value.js';
44
+ import { initQuality } from '/quality.js';
43
45
  import { initNews } from '/news.js';
44
46
  import { initPlan } from '/plan.js';
45
47
  import { initSystem } from '/system.js';
@@ -78,6 +80,7 @@ const watchOnLoad = hashId === 'watch';
78
80
  const standupOnLoad = hashId === 'standup';
79
81
  const mapOnLoad = hashId === 'map';
80
82
  const valueOnLoad = hashId === 'value';
83
+ const qualityOnLoad = hashId === 'quality';
81
84
  const newsOnLoad = hashId === 'news';
82
85
  // "#plan" or "#plan/<dates|decisions|debt>".
83
86
  const planOnLoad = hashId === 'plan';
@@ -89,7 +92,7 @@ const reviewsOnLoad = hashId === 'reviews';
89
92
  // "#mcp" or "#mcp/<agent>": the MCP window on its own.
90
93
  const mcpOnLoad = hashId === 'mcp';
91
94
  let watchShown = false;
92
- let selectedId = (watchOnLoad || standupOnLoad || mapOnLoad || valueOnLoad || newsOnLoad || planOnLoad || osOnLoad || boardOnLoad || decideOnLoad || reviewsOnLoad || mcpOnLoad ? null : hashId) || null;
95
+ let selectedId = (watchOnLoad || standupOnLoad || mapOnLoad || valueOnLoad || qualityOnLoad || newsOnLoad || planOnLoad || osOnLoad || boardOnLoad || decideOnLoad || reviewsOnLoad || mcpOnLoad ? null : hashId) || null;
93
96
  let openTermOnLoad = hashView === 'term' || hashView === 'code' || isShell(hashView) || isBrowser(hashView);
94
97
  let filterText = '';
95
98
  // Only agents whose session is open (the "running" count above the list, clicked).
@@ -325,6 +328,9 @@ $('#bugs-btn').onclick = () => bugsUi.open();
325
328
  // Value: what the delivered work is worth, for you and for management.
326
329
  const valueUi = initValue({ api, $, esc, toast: (m, ms) => toast(m, ms), openAgent: (id) => (showTab('agents'), select(id)) });
327
330
  $('#value-btn').onclick = () => valueUi.open();
331
+ // Quality: what happened to the agents' pull requests after they merged.
332
+ const qualityUi = initQuality({ api, $, esc, toast: (m, ms) => toast(m, ms), ago: (t) => ago(t), openAgent: (id) => (showTab('agents'), select(id)) });
333
+ $('#quality-btn').onclick = () => qualityUi.open();
328
334
  // AI News: the frontier labs' latest releases, summarized.
329
335
  const newsUi = initNews({ api, $, esc, ago, toast: (m, ms) => toast(m, ms) });
330
336
  $('#news-btn').onclick = () => newsUi.open();
@@ -434,6 +440,7 @@ function shortcut(act) {
434
440
  if (act === 'reviews') return reviewsUi.open();
435
441
  if (act === 'bugs') return bugsUi.open();
436
442
  if (act === 'value') return valueUi.open();
443
+ if (act === 'quality') return qualityUi.open();
437
444
  if (act === 'news') return newsUi.open();
438
445
  if (act === 'plan') return planUi.open();
439
446
  if (act === 'os') return osUi.open();
@@ -630,9 +637,10 @@ const INSIGHT_ICONS = { why: '🎯', what: '📦', how: '🛠', now: '📍' };
630
637
 
631
638
  // ------------------------------------------------------------------ stakeholder documents
632
639
 
633
- const DOCS = { analysis: 'Analysis', design: 'Design', flow: 'Flow', proposal: 'Proposal', humanai: 'Human vs AI', estimate: 'Estimate', documentation: 'Documentation', diagrams: 'Diagrams', scorecard: 'Scorecard', update: 'Update' };
640
+ const DOCS = { analysis: 'Analysis', design: 'Design', flow: 'Flow', proposal: 'Proposal', humanai: 'Human vs AI', estimate: 'Estimate', documentation: 'Documentation', diagrams: 'Diagrams', scorecard: 'Scorecard', update: 'Update', claims: 'Claims' };
634
641
  // What a document is before it's written, where "Write a … document for stakeholders" doesn't say it.
635
642
  const DOC_HINTS = {
643
+ claims: 'Check what the brief and the documents written about this work say against the work itself: each statement of fact traced to a source by another model, and the app checking the quotes, files, links and numbers are really there',
636
644
  update: 'What to tell the people who asked: a short Slack message and a short email for you to send, and the details they point to. Written by itself when the agent finishes or opens a pull request',
637
645
  estimate: 'For planning: how long a person would take to do this work by hand, split into tasks with optimistic, likely and pessimistic hours, a suggested split into tickets, the roles needed and the risks',
638
646
  documentation: 'The documentation for this change: what is new, how to use it, configuration, upgrade notes, which docs to add or update, and an OpenAPI spec of any API changes',
@@ -640,7 +648,7 @@ const DOC_HINTS = {
640
648
  /** The OpenAPI spec in a Documentation document (its ```yaml block), if the change has API changes. */
641
649
  const openApiOf = (markdown) => (markdown ?? '').match(/```ya?ml\s*\n((?:#.*\n|\s*\n)*openapi:[\s\S]*?)```/)?.[1] ?? null;
642
650
  // Optional extras that "Write all" leaves out.
643
- const DOC_EXTRAS = new Set(['diagrams', 'scorecard', 'update']);
651
+ const DOC_EXTRAS = new Set(['diagrams', 'scorecard', 'update', 'claims']);
644
652
  const DOC_TITLES = { ...DOCS, estimate: 'Human time estimate', eval: 'Eval', plan: 'Plan', intent: 'Intent', spec: 'Spec', designdoc: 'Design doc', benchmark: 'Benchmark' };
645
653
  // The agent's intent, spec and plan files (read from the daemon when opened; kept here by agent and kind).
646
654
  const SPEC_KINDS = { intent: 'Intent', spec: 'Spec', plan: 'Plan', designdoc: 'Design doc', benchmark: 'Benchmark' };
@@ -726,7 +734,7 @@ function docButtons(a) {
726
734
  const d = a.docs?.[k];
727
735
  const stale = d?.markdown && a.brief?.updatedAt && d.briefUpdatedAt !== a.brief.updatedAt;
728
736
  return `<button class="small doc-btn ${d?.markdown ? 'has' : ''}" data-doc="${k}" ${d?.pending ? 'disabled' : ''}
729
- title="${k === 'scorecard' ? (d?.markdown ? `Open the review scorecard: ${d.data?.overall ?? '—'}/100` : 'Score the changes for review: intent, spec, scope, plan, tests and safety, with an overall readiness and where to look') : k === 'diagrams' ? (d?.markdown ? `Open the diagrams${stale ? ' (the brief changed since)' : ''}` : 'Draw the problem and its solution for a quick grasp: architecture, design, data flow (animated) and the key interaction, diagrams only. Built from the documents already written and the agent\'s work') : d?.markdown ? `Open the ${label.toLowerCase()} document${stale ? ' (the brief changed since)' : ''}` : DOC_HINTS[k] ?? `Write a ${label.toLowerCase()} document for stakeholders`}">${d?.pending ? `${label}…` : label}${d?.markdown ? (stale ? ' •' : ' ✓') : ''}</button>`;
737
+ title="${k === 'claims' && d?.data ? `Open the claims check: ${claimsLine(d.data)}` : k === 'scorecard' ? (d?.markdown ? `Open the review scorecard: ${d.data?.overall ?? '—'}/100` : 'Score the changes for review: intent, spec, scope, plan, tests and safety, with an overall readiness and where to look') : k === 'diagrams' ? (d?.markdown ? `Open the diagrams${stale ? ' (the brief changed since)' : ''}` : 'Draw the problem and its solution for a quick grasp: architecture, design, data flow (animated) and the key interaction, diagrams only. Built from the documents already written and the agent\'s work') : d?.markdown ? `Open the ${label.toLowerCase()} document${stale ? ' (the brief changed since)' : ''}` : DOC_HINTS[k] ?? `Write a ${label.toLowerCase()} document for stakeholders`}">${d?.pending ? `${label}…` : label}${d?.markdown ? (k === 'claims' && d.data?.verdict !== 'backed' ? ' !' : stale ? ' •' : ' ✓') : ''}</button>`;
730
738
  })
731
739
  .join('')}</span>${specButtons(a)}${driveButton(a)}`;
732
740
  }
@@ -761,6 +769,9 @@ function demoButton(a) {
761
769
  : '<button class="small doc-btn" disabled title="The agent makes it once the change works and publishes it as an Artifact">Demo page</button>';
762
770
  }
763
771
 
772
+ /** "1 contradicted, 2 not backed, 5 backed" for a tooltip. */
773
+ const claimsLine = (c) => [c.counts.contradicted && `${c.counts.contradicted} contradicted`, (c.counts.not_backed || c.missing) && `${c.counts.not_backed + c.missing} not backed`, `${c.counts.backed} backed`].filter(Boolean).join(', ');
774
+
764
775
  let docView = null; // { agentId, kind }
765
776
 
766
777
  function renderDocDialog() {
@@ -776,9 +787,9 @@ function renderDocDialog() {
776
787
  if (docView.kind === 'eval') return renderEval(a, body, d);
777
788
  body.classList.toggle('diagrams-view', docView.kind === 'diagrams');
778
789
  if (d?.pending) {
779
- 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>`;
790
+ 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…" : docView.kind === 'claims' ? 'Checking each statement of the brief and the documents against the work, with another model… a minute or two.' : `Writing the ${label.toLowerCase()} document from the agent's work so far…`}</p>`;
780
791
  body.dataset.rendered = '';
781
- } else if (d?.error) body.innerHTML = `<p class="error">Couldn't write it: ${esc(d.error)}</p>`;
792
+ } else if (d?.error) body.innerHTML = `<p class="error">Couldn't ${docView.kind === 'claims' ? 'check' : 'write'} it: ${esc(d.error)}</p>`;
782
793
  else if (plan && !d?.markdown) body.innerHTML = '<p class="hint">The agent is investigating and hasn\'t written its plan yet. You\'ll see it here (and in the inbox) when it has.</p>';
783
794
  else if (specKind && !d?.loaded) body.innerHTML = '<p class="hint">Loading…</p>';
784
795
  else if (specKind && !d?.markdown) body.innerHTML = `<p class="hint">${docView.kind === 'intent' ? 'No intent file for this agent (agents created before 1.9 have none).' : `The agent hasn't written its ${label.toLowerCase()} yet. It writes ${docView.kind === 'spec' ? 'the spec before changing code' : docView.kind === 'designdoc' ? 'the design doc once its plan is settled and publishes it as an Artifact' : docView.kind === 'benchmark' ? 'the benchmark results once the change works' : 'the plan and keeps it current'}.`}</p>`;
@@ -786,7 +797,7 @@ function renderDocDialog() {
786
797
  // The scorecard's Improve button follows the agent being improved.
787
798
  const version = docView.kind === 'scorecard' ? `${d.at}:${Boolean(a.improving)}` : d.at;
788
799
  if (body.dataset.rendered !== version) {
789
- body.innerHTML = docView.kind === 'scorecard' ? scorecardHtml(d, esc, { actions: improveHtml(a) }) : docView.kind === 'update' ? updateHtml(a, d, { esc, docHtml }) : d.data ? humanAiHtml(d) : docHtml(d.markdown);
800
+ body.innerHTML = docView.kind === 'scorecard' ? scorecardHtml(d, esc, { actions: improveHtml(a) }) : docView.kind === 'update' ? updateHtml(a, d, { esc, docHtml }) : docView.kind === 'claims' ? claimsHtml(d, esc) : d.data ? humanAiHtml(d) : docHtml(d.markdown);
790
801
  body.dataset.rendered = version;
791
802
  renderDiagrams(body);
792
803
  }
@@ -794,7 +805,7 @@ function renderDocDialog() {
794
805
  }
795
806
  const stale = !plan && d?.markdown && a.brief?.updatedAt && d.briefUpdatedAt !== a.brief.updatedAt;
796
807
  const by = d?.writer ? ` by ${d.writer}${d.critique ? `, checked by ${d.critique.label}` : ''}${d.from ? ` from ${d.from.length ? d.from.join(', ') : "the agent's work"}` : ''}` : '';
797
- $('#doc-meta').textContent = d?.markdown ? `${plan ? `Plan · ${PLAN_LABEL[a.planReview.status]} · updated` : specKind ? 'Updated' : docView.kind === 'diagrams' ? 'Drawn' : 'Written'} ${ago(d.at)}${by}${stale && !specKind ? ' · the brief has changed since; Regenerate for the latest' : ''}${specKind ? ' · goes into the pull request description' : ''}` : '';
808
+ $('#doc-meta').textContent = d?.markdown ? `${plan ? `Plan · ${PLAN_LABEL[a.planReview.status]} · updated` : specKind ? 'Updated' : docView.kind === 'diagrams' ? 'Drawn' : docView.kind === 'claims' ? 'Checked' : 'Written'} ${ago(d.at)}${by}${stale && !specKind ? ' · the brief has changed since; Regenerate for the latest' : ''}${specKind ? ' · goes into the pull request description' : ''}` : '';
798
809
  for (const id of ['doc-copy', 'doc-download', 'doc-print']) $(`#${id}`).disabled = !d?.markdown;
799
810
  // Diagrams: the whole document as one HTML file with every diagram (each also has Copy / PNG / SVG).
800
811
  $('#doc-html').hidden = !/```mermaid/.test(d?.markdown ?? '');
@@ -879,7 +890,7 @@ $('#doc-body').addEventListener('submit', (e) => {
879
890
  });
880
891
 
881
892
  // The Update document's own buttons: copy, open in mail, post to Slack, the link to its details.
882
- const announceUi = initUpdateView({ body: $('#doc-body'), api, toast, ago, agentOf: (id) => agents.get(id), upsert: (a) => upsert(a) });
893
+ const announceUi = initUpdateView({ body: $('#doc-body'), api, toast, ago, agentOf: (id) => agents.get(id), upsert: (a) => upsert(a), claimsNote: (a) => claimsNote(a, 'update', a.docs?.update?.at ?? null, esc) });
883
894
 
884
895
  function generateDoc() {
885
896
  const { agentId, kind } = docView;
@@ -934,6 +945,14 @@ $('#doc-openapi').onclick = () => {
934
945
  link.click();
935
946
  setTimeout(() => URL.revokeObjectURL(link.href), 1000);
936
947
  };
948
+ // From one document to another (an update to its claims check); "run" checks again when it is of an earlier text.
949
+ $('#doc-body').addEventListener('click', (e) => {
950
+ const b = e.target.closest('button[data-doc]');
951
+ if (!b || !docView) return;
952
+ const had = Boolean(agents.get(docView.agentId)?.docs?.[b.dataset.doc]?.markdown);
953
+ openDoc(docView.agentId, b.dataset.doc);
954
+ if (had && 'run' in b.dataset) generateDoc();
955
+ });
937
956
  const haAnswers = () => Object.fromEntries([...document.querySelectorAll('#doc-body [data-ha]')].map((t) => [t.dataset.ha, t.value]));
938
957
  $('#doc-body').addEventListener('click', (e) => {
939
958
  const pick = e.target.closest('[data-ha-pick]');
@@ -4695,6 +4714,11 @@ function handleEvent(msg) {
4695
4714
  history.replaceState(null, '', '#');
4696
4715
  valueUi.open();
4697
4716
  }
4717
+ if (qualityOnLoad && !watchShown) {
4718
+ watchShown = true;
4719
+ history.replaceState(null, '', '#');
4720
+ qualityUi.open();
4721
+ }
4698
4722
  if (planOnLoad && !watchShown) {
4699
4723
  watchShown = true;
4700
4724
  history.replaceState(null, '', '#');
@@ -4769,6 +4793,8 @@ function handleEvent(msg) {
4769
4793
  teams.delete(msg.id);
4770
4794
  } else if (msg.t === 'value') {
4771
4795
  valueUi.changed();
4796
+ } else if (msg.t === 'quality') {
4797
+ qualityUi.changed();
4772
4798
  } else if (msg.t === 'news') {
4773
4799
  newsUi.changed();
4774
4800
  } else if (msg.t === 'usage') {
@@ -0,0 +1,65 @@
1
+ // Claims check, in the document dialog: each statement of fact in an agent's brief and in what was
2
+ // written about its work, with the source that backs it (src/claims.js). What is contradicted or
3
+ // not backed comes first; the rest is folded away.
4
+
5
+ const LABEL = { contradicted: 'Contradicted', not_backed: 'Not backed', said: 'Only the agent says so', backed: 'Backed', opinion: 'Opinion or plan' };
6
+ const HINT = {
7
+ contradicted: 'A source says otherwise',
8
+ not_backed: 'No source says so, or what the checker quoted is not in the source',
9
+ said: 'In the brief, spec, plan or conversation only: nothing measured shows it',
10
+ backed: 'A source says so, and the quote was found in it',
11
+ opinion: 'A judgment, estimate or plan: the sources cannot settle it',
12
+ };
13
+ const ORDER = ['contradicted', 'not_backed', 'said', 'backed', 'opinion'];
14
+ const plural = (n, one, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
15
+
16
+ /** "1 contradicted · 2 not backed · 5 backed" as chips. */
17
+ export function countsHtml(counts, gone, esc) {
18
+ const chip = (v, n) => (n ? `<span class="cl-chip cl-${v}" title="${esc(HINT[v])}">${n} ${esc(LABEL[v].toLowerCase())}</span>` : '');
19
+ return `${ORDER.slice(0, 4).map((v) => chip(v, counts[v])).join('')}${gone ? `<span class="cl-chip cl-not_backed" title="Files, links, pull requests or numbers in the text that are in none of the sources, in statements the checker passed over">${plural(gone, 'particular')} nowhere in the sources</span>` : ''}` || '<span class="cl-chip">no statements of fact</span>';
20
+ }
21
+
22
+ function textHtml(t, esc) {
23
+ if (t.error) return `<section class="ha-card cl-text"><h3>${esc(t.label)}</h3><p class="error">Not checked: ${esc(t.error)}</p></section>`;
24
+ const item = (c) => `<li class="cl-claim cl-${c.verdict}">
25
+ <div class="cl-said">${esc(c.text)}</div>
26
+ ${c.quote ? `<div class="hint cl-quote"><b>${esc(c.source.name)}:</b> “${esc(c.quote)}”</div>` : ''}
27
+ ${c.note ? `<div class="hint">${esc(c.note)}</div>` : ''}
28
+ </li>`;
29
+ const group = (v) => {
30
+ const list = t.claims.filter((c) => c.verdict === v);
31
+ if (!list.length) return '';
32
+ const open = v === 'contradicted' || v === 'not_backed' || v === 'said';
33
+ return `<details class="cl-group" ${open ? 'open' : ''}><summary><span class="cl-chip cl-${v}">${list.length}</span> ${esc(LABEL[v])} <span class="hint">${esc(HINT[v])}</span></summary><ul class="cl-list">${list.map(item).join('')}</ul></details>`;
34
+ };
35
+ const gone = t.missing.length
36
+ ? `<details class="cl-group" open><summary><span class="cl-chip cl-not_backed">${t.missing.length}</span> Nowhere in the sources <span class="hint">in statements the checker passed over</span></summary><ul class="cl-list">${t.missing.map((s) => `<li class="cl-claim cl-not_backed"><span class="hint">${esc(s.kind)}</span> <code>${esc(s.value)}</code></li>`).join('')}</ul></details>`
37
+ : '';
38
+ return `<section class="ha-card cl-text" data-claims-text="${esc(t.key)}"><h3>${esc(t.label)}</h3><p class="cl-counts">${countsHtml(t.counts, t.missing.length, esc)}</p>${ORDER.map(group).join('')}${gone}</section>`;
39
+ }
40
+
41
+ export function claimsHtml(d, esc) {
42
+ const c = d.data;
43
+ return `<div class="cl">
44
+ <p class="cl-counts cl-total">${countsHtml(c.counts, c.missing, esc)}</p>
45
+ <p class="hint">Each statement of fact, traced to a source by ${esc(d.writer ?? 'another model')}. The app checked that every statement is in the text, every quote in its source, and that the files, links, pull requests and numbers exist in the sources. Whether a quote really shows the statement is the model's reading: read the ones that matter.</p>
46
+ ${c.texts.map((t) => textHtml(t, esc)).join('')}
47
+ <p class="hint">Sources: ${c.sources.map((s) => `${esc(s.name)}${s.own ? " (the agent's own account)" : ''}`).join(' · ')}</p>
48
+ </div>`;
49
+ }
50
+
51
+ /** The check of one text of an agent, if it was made of the text as it is now. */
52
+ export function checkOf(a, key, at) {
53
+ const t = a?.docs?.claims?.data?.texts.find((x) => x.key === key && !x.error);
54
+ return t && t.at === at ? t : null;
55
+ }
56
+
57
+ /** One line over a document about its last check, with the way to the whole of it. */
58
+ export function claimsNote(a, key, at, esc) {
59
+ const d = a?.docs?.claims;
60
+ if (d?.pending) return '<p class="hint cl-note">Checking its statements against the work…</p>';
61
+ const t = checkOf(a, key, at);
62
+ if (!t) return `<p class="hint cl-note">Its statements are not checked against the work yet. <button type="button" class="link" data-doc="claims" data-run>Check claims</button></p>`;
63
+ const doubt = t.counts.contradicted + t.counts.not_backed + t.missing.length;
64
+ return `<p class="cl-note ${doubt ? 'cl-doubt' : ''}">${doubt ? '<b>Read before sending:</b> ' : 'Checked against the work: '}${countsHtml(t.counts, t.missing.length, esc)} <button type="button" class="link" data-doc="claims">Claims</button></p>`;
65
+ }
package/public/index.html CHANGED
@@ -42,6 +42,7 @@
42
42
  <button id="bugs-btn" title="Bugs: background hunts in a project or folder, and what they found, checked and worst first">Bugs <span id="bugs-count" class="badge"></span></button>
43
43
  <button id="reviews-btn" title="Reviews: pull requests you review. Reviewer agents ask the critical questions and find what blocks approval; you post what you pick">Reviews <span id="reviews-count" class="badge ready"></span></button>
44
44
  <button id="value-btn" title="Value: what the delivered work is worth, and the pull requests merged, by day, week, month, quarter and year, against the AI cost and your time; reports for management">Value</button>
45
+ <button id="quality-btn" title="Quality: what happened to the agents' pull requests after they merged: reverted, fixed afterwards, failed checks, or held up; and how often a reviewer asked for changes">Quality</button>
45
46
  <button id="decide-btn" title="Decide: what waits for you with its options and a recommendation, your standing decisions and what was decided for you, the backlog by impact, dates at risk as choices, and a look back at past decisions">Decide <span id="decide-count" class="badge"></span></button>
46
47
  <button id="plan-btn" title="Plan: a project's dates (code complete, RC, GA) with their checklists and reminders, the decision log, and the tech debt radar">Plan <span id="plan-count" class="badge"></span></button>
47
48
  <button id="news-btn" title="AI News: the frontier labs' latest releases (Anthropic, OpenAI, Google and the other top labs), each summarized, with links">AI News <span id="news-count" class="badge ready"></span></button>
@@ -430,6 +431,9 @@
430
431
  <dialog id="value-dialog" class="issues-dialog value-dialog" aria-label="Value">
431
432
  <div id="value-body"></div>
432
433
  </dialog>
434
+ <dialog id="quality-dialog" class="issues-dialog value-dialog" aria-label="Quality">
435
+ <div id="quality-body"></div>
436
+ </dialog>
433
437
  <dialog id="plan-dialog" class="issues-dialog plan-dialog" aria-label="Plan">
434
438
  <div id="plan-body"></div>
435
439
  </dialog>
package/public/keys.js CHANGED
@@ -28,6 +28,7 @@ export const SHORTCUTS = [
28
28
  [['d'], 'Designs: agents\' design docs', 'designs'],
29
29
  [['g'], 'Reviews: pull requests you review', 'reviews'],
30
30
  [['v'], 'Value: what the work is worth', 'value'],
31
+ [['Q'], 'Quality: what happened to pull requests after they merged', 'quality'],
31
32
  [['l'], 'AI News: the latest frontier releases', 'news'],
32
33
  [['c'], 'Plan: project dates, decisions and tech debt', 'plan'],
33
34
  [['u'], 'OS: this computer and its load', 'os'],
@@ -79,11 +80,11 @@ export const SHORTCUTS = [
79
80
  // A single key, as an event names it, to its action.
80
81
  export const SINGLE = {
81
82
  j: 'next', k: 'prev', Enter: 'terminal', t: 'terminal',
82
- r: 'changes', s: 'start', X: 'stop', e: 'edit', n: 'new', a: 'ask', '/': 'filter', w: 'watch', p: 'standup', m: 'map', i: 'issues', o: 'actions', h: 'assistant', ',': 'settings', d: 'designs', g: 'reviews', v: 'value', l: 'news', c: 'plan', u: 'os', B: 'board', q: 'decide', z: 'usage', y: 'today', b: 'bugs', S: 'screen', T: 'machine', '?': 'help',
83
+ r: 'changes', s: 'start', X: 'stop', e: 'edit', n: 'new', a: 'ask', '/': 'filter', w: 'watch', p: 'standup', m: 'map', i: 'issues', o: 'actions', h: 'assistant', ',': 'settings', d: 'designs', g: 'reviews', v: 'value', Q: 'quality', l: 'news', c: 'plan', u: 'os', B: 'board', q: 'decide', z: 'usage', y: 'today', b: 'bugs', S: 'screen', T: 'machine', '?': 'help',
83
84
  1: 'tab:agents', 2: 'tab:inbox', 3: 'tab:backlog', 4: 'tab:land', 5: 'tab:built',
84
85
  };
85
86
  // While Watch is open: only what makes sense there.
86
- const ON_WATCH = new Set(['today', 'new', 'ask', 'watch', 'standup', 'map', 'issues', 'actions', 'assistant', 'settings', 'designs', 'reviews', 'value', 'news', 'plan', 'os', 'board', 'decide', 'usage', 'bugs', 'screen', 'machine', 'help']);
87
+ const ON_WATCH = new Set(['today', 'new', 'ask', 'watch', 'standup', 'map', 'issues', 'actions', 'assistant', 'settings', 'designs', 'reviews', 'value', 'quality', 'news', 'plan', 'os', 'board', 'decide', 'usage', 'bugs', 'screen', 'machine', 'help']);
87
88
 
88
89
  /** Typing somewhere: a field, an editor or a terminal (xterm types through a textarea). */
89
90
  const typing = (el) => Boolean(el?.closest?.('input, textarea, select, [contenteditable=""], [contenteditable="true"], .xterm, .cm-editor'));