ai-agentmanager 1.61.0 → 1.63.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 +30 -0
- package/README.md +124 -0
- package/package.json +1 -1
- package/public/acceptance.js +194 -0
- package/public/announce.js +9 -1
- package/public/app.js +82 -10
- package/public/attach.js +4 -0
- package/public/autonomy.js +140 -0
- package/public/boardcols.js +1 -0
- package/public/claims.js +65 -0
- package/public/dropzone.js +203 -0
- package/public/index.html +56 -0
- package/public/menu.js +20 -0
- package/public/scorecard.js +1 -1
- package/public/standup.js +1 -0
- package/public/style.css +64 -1
- package/src/acceptance.js +123 -0
- package/src/advisor.js +30 -8
- package/src/autonomy.js +624 -0
- package/src/autopilot.js +7 -1
- package/src/backlog.js +16 -3
- package/src/brief.js +21 -3
- package/src/bughunt.js +1 -0
- package/src/claims.js +239 -0
- package/src/cli.js +164 -2
- package/src/config.js +3 -0
- package/src/decisions.js +5 -1
- package/src/groundrules.js +97 -0
- package/src/judge.js +1 -1
- package/src/manager.js +257 -6
- package/src/notify.js +16 -0
- package/src/prereview.js +7 -2
- package/src/scorecard.js +27 -10
- package/src/server.js +67 -4
- package/src/standup.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.63.0 (2026-11-21)
|
|
4
|
+
|
|
5
|
+
- **Acceptance: agree on what done means.** Tick **Agree on what done means first** in New agent or the backlog (or `agentmgr add --acceptance`). The agent reads the code, writes three to six points you could check, and stops before changing anything. The points wait in the inbox as **Done means**, with a notification.
|
|
6
|
+
- **You change them and agree.** **Change points** opens the list to reword, remove or add your own, sized for a phone; **Agree as written** takes the agent's list; **Skip** stops waiting. After that the points are kept by the app, not in a file the agent can edit, and the agent's own calls to agree or skip are refused. The agent is told them word for word, and the agreement goes into the decision log.
|
|
7
|
+
- **Each point is checked.** The review scorecard now reports every agreed point as Met, Not met or Not verified with the evidence, in your wording and order. A point the model skips counts as not verified. One point not met makes the work "Not ready". The agent's Brief panel shows the count, for example "2 of 3 met, 1 not met".
|
|
8
|
+
- **Also without asking first.** Any agent with a spec has **What done means** in its Brief panel, with the points it wrote for itself. You can change and agree on them at any time; a running agent is told, and work already scored is scored again (for a running agent, when it next says it is done).
|
|
9
|
+
- **From a terminal:** `agentmgr acceptance <agent>` with `--agree`, `--set n=text`, `--remove n`, `--add text`, `--check`, `--skip` and `--json`. It exits with 1 when an agreed point is not met. `"acceptance": true` in config.json asks for it on every new agent.
|
|
10
|
+
- **Limits.** The verdict on each point is a model's reading of the changes, not a test the app ran. The agent waiting is an instruction it follows, as with plan review, not a lock on the repository.
|
|
11
|
+
- **Without you: how far an agent goes on its own.** Each agent has a level: **Ask me** (the default, nothing changes), **Agree, then run**, **Run to pull request**, **Run to merge**. Choose it in New agent, on a running agent's Brief panel, with `agentmgr add --autonomy <level>`, or as the default in Settings. Past "Ask me", what done means is agreed first.
|
|
12
|
+
- **What is handled for you.** A question the agent asks without stopping, or a plan waiting for review, is decided by Decide at its "Most things; ask when unsure" level whatever the project's level is. A question it stopped on in its terminal is answered from what is already decided (your request, the agreed points, your ground rules, the repository's lessons, your earlier answers). A stuck agent gets the judge's nudge, and a quiet one is told to carry on. At "Run to merge" the pull request is merged when checks pass, the review rounds approved, the scorecard says ready, no high-risk path is touched and the agent's own confidence is not low; otherwise it is held and the inbox says why.
|
|
13
|
+
- **You see all of it.** Each answer given for you is in the inbox as **Done for you**, with what it was based on: **OK**, or **Change answer…** to give your own. The agent's **Without you** dialog and `agentmgr autonomy <agent>` list everything answered, sent, merged or left for you.
|
|
14
|
+
- **Never done for you:** answering a permission prompt, or a question about deleting, rewriting history, publishing or merging, credentials, money, personal data, messages to others or the scope of the task. An agent cannot set its own level.
|
|
15
|
+
- **Models in order.** What is decided in your place runs on `fable`, then `opus`, then `sonnet`: the next one is used when a call fails. Change the list in Settings or with `agentmgr autonomy --models`.
|
|
16
|
+
- **Ground rules.** **Settings → Ground rules** (or `agentmgr ground-rules`): your own rules for every agent in every repository, one per line, given with each agent's instructions next to the repository's memory. Only you set them. **Also tell the agents running now** sends a change to open sessions.
|
|
17
|
+
- **Confidence.** Every agent now states its own confidence in what it built (`Confidence: 85% - why`) in its Results, shown in the Brief panel beside the scorecard. Under 70%, "Run to merge" and autopilot's Merge level leave the merge to you.
|
|
18
|
+
- **Drop to start.** Drag tickets, requirements, designs and files onto the page: New agents opens filled in. Issue links become the request, document and design links its context, a repository link the repository, files the attachments. The form has a drop box that says what was added, with **Paste what you copied** and **Choose files** for a phone.
|
|
19
|
+
- **Changed for everyone:** agents are now asked for a confidence line in their brief. Decide's recommendations are given the agreed points, your ground rules and the repository's lessons.
|
|
20
|
+
- **Fixed:** on a narrow phone the buttons at the bottom of New agents no longer push the form wider than the screen.
|
|
21
|
+
- **Limits.** An answer given for you is a model's reading of what you decided before, and can be wrong. Autonomy needs the AI judge and Decide on, and does not change the permission mode. Ground rules and the confidence line are instructions and the agent's own statement, not checks. A phone has no drag and drop; use paste or the file picker there.
|
|
22
|
+
- **Tried:** unit, end-to-end and browser tests with stand-in models, and the views at phone width in desktop Chrome. The prompt that answers for you was tried on the real `fable` model with three made-up questions (a routine detail, one decided by an agreed point, one that changes the database): it answered the first two and left the third for the person. Not yet with a real agent or on a phone.
|
|
23
|
+
|
|
24
|
+
## 1.62.0 (2026-11-19)
|
|
25
|
+
|
|
26
|
+
- **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.
|
|
27
|
+
- **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.
|
|
28
|
+
- **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`.
|
|
29
|
+
- **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.
|
|
30
|
+
- **Fixed:** the daemon no longer prints a "MaxListenersExceededWarning" at start.
|
|
31
|
+
- **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.
|
|
32
|
+
|
|
3
33
|
## 1.61.0 (2026-11-19)
|
|
4
34
|
|
|
5
35
|
- **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.
|
package/README.md
CHANGED
|
@@ -76,6 +76,7 @@ Run one background [Claude Code](https://claude.com/claude-code) agent per inten
|
|
|
76
76
|
- **As an app.** In Chrome or Edge, click the install icon in the address bar (or ⋮ → Cast, save and share → Install page as app). AI Agent Manager then opens in its own window with its own Dock or taskbar icon, and the daemon keeps running as before.
|
|
77
77
|
- **About.** The version next to the title opens the About box: release date, author, license, links, and how this daemon runs (data folder, port, Node.js, which `claude`). **Check for updates** asks npm for the newest version. In a terminal: `agentmgr about` (`--check` for updates).
|
|
78
78
|
- **General sessions.** **Ask Agent** starts a session with no repo, folder or intent, for questions, on Claude Code or any other engine you have (Codex, Antigravity, Muse Code). It is tracked and resumable like any other agent.
|
|
79
|
+
- **Drop to start.** Drag tickets, requirements and designs onto the page: a frame says **Drop to start a new agent**, and New agents opens filled in. A Jira, GitHub or Linear issue link becomes the request (the agent is named after the issue and tracks it); a link to a document (Google Docs, Confluence, Notion, a PDF) is listed under it as **Requirements** and a design link (Figma, Miro, an image) as **Design**; a repository link fills the repository; text becomes the request; files are attached. Several tickets give one agent each. The box at the top of the form takes the same drops and says what was added; nothing starts until you press the button. Without a mouse, **Paste what you copied** reads links from the clipboard and **Choose files** opens the picker.
|
|
79
80
|
- **Attachments.** **📎 Attach files** in New agents and Ask Agent (or drop files on the dialog, or paste a screenshot into the text box) adds a screenshot, a log or a document to the request. Each agent gets its own copy in `~/.agentmanager/uploads/<agent>/`, listed in its request, and Claude Code and Codex can read that folder without asking. From the CLI: `agentmgr add … --file-attach error.log` and `agentmgr ask … --file-attach shot.png`.
|
|
80
81
|
|
|
81
82
|
New in 0.2, for running many agents at once:
|
|
@@ -441,6 +442,97 @@ Tick **Review the implementation plan first** in New agent (or the backlog), or
|
|
|
441
442
|
- **After approval**, edits to the plan count as progress updates and don't ask again. A restarted agent is told its plan was approved.
|
|
442
443
|
- **Default.** Set `"planReview": true` in config.json to turn it on for every new agent.
|
|
443
444
|
|
|
445
|
+
## Acceptance: agree on what done means
|
|
446
|
+
|
|
447
|
+
An agent can finish a correct change to the wrong target. Acceptance settles the target first: a short list of points you would check when the work is done, agreed between you and the agent, and then checked one by one.
|
|
448
|
+
|
|
449
|
+
- **Ask for it.** Tick **Agree on what done means first** in New agent (or the backlog), or start with `agentmgr add --acceptance`. The agent reads the code, writes three to six points under "Acceptance criteria" in its `SPEC.md`, and stops. It changes nothing in the repository until you agree.
|
|
450
|
+
- **Where it shows.** In the inbox as **Done means**, with the points, a notification, and a row in the agent's Brief panel.
|
|
451
|
+
- **Change points** opens them to reword, remove or add your own. **Agree and start** sends the agent ahead with the list as you left it; **Agree as written** takes the agent's list. **Skip** stops waiting and keeps nothing.
|
|
452
|
+
- **From then on the points are yours.** They are kept by the app, not in a file the agent can edit, and an agent's own calls to agree or skip are refused. The agent is told them word for word, a restarted agent is told them again, and the agreement is in the decision log (Plan, Decisions).
|
|
453
|
+
- **Checked one by one.** The [review scorecard](#review-changes) reports each agreed point as **Met**, **Not met** or **Not verified**, with the evidence, in your wording and your order. A point the model does not answer counts as not verified. One point not met makes the work **Not ready**, so autopilot sends it back and does not ship it.
|
|
454
|
+
- **Without asking first.** Every agent with a spec has **What done means** in its Brief panel: the points it wrote for itself. Change them and agree at any time, also after the work is done; a running agent is told to check its work against them, and work already scored is scored again (for a running agent, when it next says it is done).
|
|
455
|
+
- **With plan review.** The points come first, then the plan.
|
|
456
|
+
- **Default.** Set `"acceptance": true` in config.json to ask for it on every new agent.
|
|
457
|
+
|
|
458
|
+
```bash
|
|
459
|
+
agentmgr add "Add a CSV export" --repo <url> --acceptance
|
|
460
|
+
agentmgr acceptance add-a-csv-export # the points, and what was found for each
|
|
461
|
+
agentmgr acceptance add-a-csv-export --agree # as the agent wrote them
|
|
462
|
+
agentmgr acceptance add-a-csv-export --set "2=The first row is the header" --remove 3 --add "Dates are ISO 8601"
|
|
463
|
+
agentmgr acceptance add-a-csv-export --check # score the work against them now
|
|
464
|
+
agentmgr acceptance add-a-csv-export --skip
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
Changing points with `--set`, `--remove` or `--add` agrees on the result. The command exits with 1 when an agreed point is not met.
|
|
468
|
+
|
|
469
|
+
**Limits.** Met, not met and not verified are a model's reading of the changes, not a test run by the app; the evidence it names is there to check. The agent waiting is an instruction it follows, as with plan review, not a lock on the repository. At most 12 points of 300 characters.
|
|
470
|
+
|
|
471
|
+
## Without you: how far an agent goes on its own
|
|
472
|
+
|
|
473
|
+
Each agent has a level for how far it goes before it needs you. Choose it in New agent (**Without you**), on a running agent (**Run without me…** in its Brief panel), with `agentmgr add --autonomy <level>`, or set the default for new agents in Settings.
|
|
474
|
+
|
|
475
|
+
| Level | What happens without you |
|
|
476
|
+
| --- | --- |
|
|
477
|
+
| **Ask me** (`ask`, the default) | Nothing: questions, stuck findings and follow-ups wait in the inbox, as before. |
|
|
478
|
+
| **Agree, then run** (`run`) | You [agree on what done means](#acceptance-agree-on-what-done-means) first. After that the middle is handled for you (below). |
|
|
479
|
+
| **Run to pull request** (`pr`) | The same, and its pull request is opened when the [review rounds](#review-rounds-before-a-pull-request) approve the work, also when "Open the pull request when the critics approve" is turned off. Review rounds themselves have to be on (the default). |
|
|
480
|
+
| **Run to merge** (`merge`) | The same, and the pull request is merged when its checks pass and everything else says ready (below). |
|
|
481
|
+
|
|
482
|
+
**What is handled for you, from "Agree, then run" up:**
|
|
483
|
+
|
|
484
|
+
- **A question it asks without stopping, or a plan waiting for review**, is decided by [Decide](#decide) at its "Most things; ask when unsure" level, whatever the project's own level is: carried out when the recommendation is at least 70% sure and easy to undo. Its recommendation now also knows the agreed points, your ground rules and the repository's lessons.
|
|
485
|
+
- **A question it stopped on in its terminal** (read from its screen by the AI judge) is answered from what is already decided: your request, the agreed points, your ground rules, the repository's lessons and your earlier answers, or the agent's own default when it is a routine detail that is cheap to change. The agent is told the answer came from the app while you were away, and to note it as an assumption.
|
|
486
|
+
- **A stuck agent** gets the judge's nudge when the judge is at least 70% sure, three times at most.
|
|
487
|
+
- **A quiet, unfinished agent** is told to carry on, twice at most, unless it is blocked on you.
|
|
488
|
+
- **At "Run to merge"**, its pull request is merged when the checks pass, the review rounds (when they ran) approved it, the scorecard says "Ready to approve", no high-risk path is touched, and the agent's own confidence is not low. Otherwise it is held, and the inbox says why. (A backlog item is shipped by [autopilot](#autopilot) at the item's level.)
|
|
489
|
+
|
|
490
|
+
**You see all of it.** An answer given for you is in the inbox as **Done for you**, with the question, the answer, what it was based on and how sure the model was: **OK**, or **Change answer…** to give your own, which the agent is told to apply. The agent's **Without you** dialog lists everything that was answered, sent, decided, merged or left for you, and `agentmgr autonomy <agent>` prints it.
|
|
491
|
+
|
|
492
|
+
**Never done for you:**
|
|
493
|
+
|
|
494
|
+
- A permission prompt is never answered by a model (your [approval rules](#decision-inbox) still apply).
|
|
495
|
+
- A question about deleting or overwriting, rewriting history, publishing, deploying or merging, credentials, money or licences, personal data, messages to other people, or the scope of the task is left for you whatever a model would say.
|
|
496
|
+
- An agent cannot set or raise its own level, and cannot change your ground rules: its own calls are refused.
|
|
497
|
+
|
|
498
|
+
**The models.** What is decided in your place runs on a list of models, best first: `fable`, then `opus`, then `sonnet`. The first one answers; when a call on it fails (the model is not on your plan, a limit, a timeout), the next one is used, and the one that failed is skipped for 15 minutes. Change the list in Settings or with `agentmgr autonomy --models opus,sonnet`. The AI judge's other calls (reading a screen, alerts) stay on its own fast model.
|
|
499
|
+
|
|
500
|
+
```bash
|
|
501
|
+
agentmgr add "Add a CSV export" --repo <url> --autonomy pr
|
|
502
|
+
agentmgr autonomy # the default level, the models, today's calls
|
|
503
|
+
agentmgr autonomy --default run --models fable,opus,sonnet
|
|
504
|
+
agentmgr autonomy add-a-csv-export # its level and what was done for you
|
|
505
|
+
agentmgr autonomy add-a-csv-export merge # set its level
|
|
506
|
+
agentmgr autonomy add-a-csv-export --change 3fa2c1d0="Use Postgres"
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
In config.json: `"autonomy": { "level": "ask", "models": ["fable", "opus", "sonnet"], "answers": true, "nudges": true, "followUps": true, "minConfidence": 0.7, "minBuildConfidence": 70, "maxAnswers": 12, "maxNudges": 3, "maxFollowUps": 2, "dailyCalls": 80 }`.
|
|
510
|
+
|
|
511
|
+
**Limits.** It needs the AI judge on (it reads the screen and finds stuck agents) and Decide on (for questions and plans). An answer is a model's reading of what you decided before, and can be wrong: that is why each one is shown to you. The level does not change the permission mode, so an agent can still stop at a permission prompt. Each answer, nudge and judgment is a model call on your own plan.
|
|
512
|
+
|
|
513
|
+
## Ground rules: your own rules for every agent
|
|
514
|
+
|
|
515
|
+
**Settings → Ground rules** (or `agentmgr ground-rules`) holds your own rules for how agents work: one per line, for every agent, in every repository and on every engine. "Ask before adding a dependency." "Never force-push or rewrite history." "Say what you did not do."
|
|
516
|
+
|
|
517
|
+
- **Next to memory, not instead of it.** [Repo memory](#repo-memory) is what agents learned in one repository, and [Standards](#standards-what-every-change-in-a-repository-has-to-meet) are lessons per repository. Ground rules are yours and apply everywhere; agents are told they come before what the memory suggests.
|
|
518
|
+
- **How agents get them.** With their instructions at every start. They are told to stop and say which rule is in the way when a task cannot be done without breaking one. Tick **Also tell the agents running now** (or `--tell`) to send a change to the sessions that are open.
|
|
519
|
+
- **Only you set them.** An agent's own calls to change them are refused. They are in `~/.agentmanager/ground-rules.md`, which you can also edit by hand.
|
|
520
|
+
- **Used when deciding for you.** Answers given for an agent that runs [without you](#without-you-how-far-an-agent-goes-on-its-own), and Decide's recommendations for it, are given the rules.
|
|
521
|
+
|
|
522
|
+
```bash
|
|
523
|
+
agentmgr ground-rules # show them
|
|
524
|
+
agentmgr ground-rules --add "Ask before adding a dependency" --tell
|
|
525
|
+
agentmgr ground-rules --remove 2
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
At most 40 rules of 400 characters. A rule is an instruction the agent follows, not a lock: the review scorecard does not check ground rules (it checks a repository's lessons).
|
|
529
|
+
|
|
530
|
+
## Confidence: how sure the agent is of what it built
|
|
531
|
+
|
|
532
|
+
Every agent now ends its Results with its own confidence: `Confidence: 85% - what it verified, and the one thing it is least sure about`. It is asked to count only what it ran and saw working, and to lower the number for anything it did not do. The Brief panel shows it beside the results (high from 85%, medium from 65%, low under that), next to the review scorecard, which is the separate check by another model. At "Run to merge" and on autopilot's Merge level, work whose agent is under 70% sure of it is not merged without you.
|
|
533
|
+
|
|
534
|
+
The number is the agent's own statement, not a measurement.
|
|
535
|
+
|
|
444
536
|
## Insights
|
|
445
537
|
|
|
446
538
|
**Insights** in the Brief panel, or `agentmgr insights <agent>`, shows the agent's work as four cards built from its ask and live context:
|
|
@@ -1255,6 +1347,38 @@ agentmgr standards bar shop --add "Lint=npm run lint" --add "Types=npx tsc --noE
|
|
|
1255
1347
|
agentmgr standards run my-agent # run the bar on its changes now
|
|
1256
1348
|
```
|
|
1257
1349
|
|
|
1350
|
+
## Claims check: what the documents say, against the work
|
|
1351
|
+
|
|
1352
|
+
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.
|
|
1353
|
+
|
|
1354
|
+
```sh
|
|
1355
|
+
agentmgr claims fix-login # check, and print each statement with what backs it
|
|
1356
|
+
agentmgr claims fix-login --cached # the last check
|
|
1357
|
+
agentmgr claims fix-login --json
|
|
1358
|
+
agentmgr claims --auto off # do not check updates by themselves
|
|
1359
|
+
```
|
|
1360
|
+
|
|
1361
|
+
**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:
|
|
1362
|
+
|
|
1363
|
+
- a statement that is not in the text is left out;
|
|
1364
|
+
- a quote that is not in the source it names (or any other) makes the statement **Not backed**;
|
|
1365
|
+
- a file, link, pull request, ticket, commit, version or number in the statement that appears in none of the sources makes it **Not backed**;
|
|
1366
|
+
- 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.
|
|
1367
|
+
|
|
1368
|
+
| Verdict | Meaning |
|
|
1369
|
+
|---|---|
|
|
1370
|
+
| **Contradicted** | A source says otherwise: the update says merged, the pull request is open |
|
|
1371
|
+
| **Not backed** | No source says so, or the checker could not quote one |
|
|
1372
|
+
| **Only the agent says so** | In the brief, spec, plan or conversation only; nothing measured shows it |
|
|
1373
|
+
| **Backed** | A measured source says so, and the quote was found in it |
|
|
1374
|
+
| **Opinion or plan** | A judgment, estimate or recommendation: not counted |
|
|
1375
|
+
|
|
1376
|
+
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.
|
|
1377
|
+
|
|
1378
|
+
**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.
|
|
1379
|
+
|
|
1380
|
+
**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.
|
|
1381
|
+
|
|
1258
1382
|
## Results and spend
|
|
1259
1383
|
|
|
1260
1384
|
**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`.
|
package/package.json
CHANGED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// Acceptance on the page: what "done" means for an agent, as points. The agent drafts them; here
|
|
2
|
+
// you reword, remove or add points and agree; after that each point shows what the review
|
|
3
|
+
// scorecard found (met, not met, not verified) with its evidence.
|
|
4
|
+
|
|
5
|
+
const LABEL = { met: 'Met', not_met: 'Not met', unverified: 'Not verified', unchecked: 'Not checked yet' };
|
|
6
|
+
const ROW_LABEL = { writing: 'being written', review: 'waiting for you', agreed: 'agreed' };
|
|
7
|
+
const MAX_POINTS = 12;
|
|
8
|
+
|
|
9
|
+
/** Whether the agent is stopped until its points are agreed. */
|
|
10
|
+
export const acceptanceWaits = (a) => Boolean(a.acceptance?.wait) && a.acceptance.status === 'review';
|
|
11
|
+
|
|
12
|
+
/** "3 of 5 met, 1 not met", from the scorecard the agent has (null when it was scored against other points). */
|
|
13
|
+
export function acceptanceSummary(a) {
|
|
14
|
+
const acc = a.acceptance;
|
|
15
|
+
if (acc?.status !== 'agreed') return null;
|
|
16
|
+
const sc = a.docs?.scorecard;
|
|
17
|
+
if (!sc?.data || sc.acceptanceAt !== acc.agreedAt) return { text: `${acc.points.length} point${acc.points.length === 1 ? '' : 's'}, not checked yet`, notMet: 0, checked: false };
|
|
18
|
+
const st = (s) => sc.data.criteria.filter((c) => c.status === s).length;
|
|
19
|
+
const notMet = st('not_met');
|
|
20
|
+
const unverified = st('unverified');
|
|
21
|
+
return { text: [`${st('met')} of ${acc.points.length} met`, notMet ? `${notMet} not met` : '', unverified ? `${unverified} not verified` : ''].filter(Boolean).join(', '), notMet, checked: true };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The row in the brief card: where the points stand, and the way in. */
|
|
25
|
+
export function acceptanceRow(a, esc) {
|
|
26
|
+
const acc = a.acceptance;
|
|
27
|
+
if (!acc) {
|
|
28
|
+
// Not asked for: offered once the agent has a spec to take the points from.
|
|
29
|
+
return a.specDocs?.spec ? `<div class="plan-row"><button class="small ghost" data-act="accept-open" title="The points the agent wrote for what done means: change them and agree, and its work is checked against them">What done means</button></div>` : '';
|
|
30
|
+
}
|
|
31
|
+
const sum = acceptanceSummary(a);
|
|
32
|
+
const waiting = acc.wait && acc.status !== 'agreed';
|
|
33
|
+
return `<div class="plan-row acc-row ${acc.status}"><b>Done means</b> <span class="tag acc-${acc.status}${sum?.notMet ? ' acc-bad' : ''}">${esc(sum?.text ?? ROW_LABEL[acc.status])}</span>
|
|
34
|
+
<button class="small ${acc.status === 'review' ? 'primary' : ''}" data-act="accept-open" ${acc.status === 'writing' ? 'disabled' : ''}>${acc.status === 'review' ? 'Review points' : 'Open'}</button>
|
|
35
|
+
${waiting ? '<button class="small ghost" data-act="accept-skip" title="Stop waiting; the agent goes ahead with the criteria in its own spec">Skip</button>' : ''}</div>`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function initAcceptance({ dialog, api, esc, toast, ago, agentOf, upsert }) {
|
|
39
|
+
// view: what the server says; edit: the texts being edited (null when only showing results).
|
|
40
|
+
let st = null;
|
|
41
|
+
|
|
42
|
+
const editing = () => Boolean(st?.edit);
|
|
43
|
+
|
|
44
|
+
function render() {
|
|
45
|
+
if (!st) return;
|
|
46
|
+
const { view: v } = st;
|
|
47
|
+
const a = agentOf(st.id);
|
|
48
|
+
dialog.querySelector('#acc-title').textContent = `What done means: ${a?.name ?? v?.name ?? ''}`;
|
|
49
|
+
const body = dialog.querySelector('#acc-body');
|
|
50
|
+
const actions = dialog.querySelector('#acc-actions');
|
|
51
|
+
if (!v) {
|
|
52
|
+
body.innerHTML = `<p class="hint">${st.error ? esc(st.error) : 'Loading…'}</p>`;
|
|
53
|
+
actions.innerHTML = '<button type="button" class="small" data-acc="close">Close</button>';
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (st.edit) {
|
|
57
|
+
const lead =
|
|
58
|
+
v.status === 'agreed'
|
|
59
|
+
? 'Change the points. The agent is told, and its work is checked against the new ones.'
|
|
60
|
+
: v.wait
|
|
61
|
+
? 'The agent wrote these and changes nothing until you agree. Reword, remove or add points: they should be things you would check.'
|
|
62
|
+
: st.edit.length
|
|
63
|
+
? 'The agent wrote these in its spec. Reword, remove or add points and agree: from then on they are yours, and its work is checked against them.'
|
|
64
|
+
: 'The agent has written no points. Add your own: each one a thing you would check when the work is done.';
|
|
65
|
+
body.innerHTML = `<p class="hint">${lead}</p>
|
|
66
|
+
<ol class="acc-edit">${st.edit
|
|
67
|
+
.map((t, i) => `<li><textarea data-acc-point="${i}" rows="2" maxlength="300" aria-label="Point ${i + 1}">${esc(t)}</textarea><button type="button" class="link" data-acc-remove="${i}" title="Take this point out" aria-label="Remove point ${i + 1}">×</button></li>`)
|
|
68
|
+
.join('')}</ol>
|
|
69
|
+
<button type="button" class="small" data-acc="add" ${st.edit.length >= MAX_POINTS ? 'disabled' : ''}>+ Add a point</button>`;
|
|
70
|
+
actions.innerHTML = `${v.wait ? '<button type="button" class="small ghost" data-acc="skip" title="Stop waiting; the agent goes ahead with the criteria in its own spec">Skip</button>' : ''}
|
|
71
|
+
<button type="button" class="small" data-acc="${v.status === 'agreed' ? 'cancel' : 'close'}">${v.status === 'agreed' ? 'Cancel' : 'Close'}</button>
|
|
72
|
+
<button type="button" class="small primary" data-acc="agree" ${st.busy ? 'disabled' : ''}>${v.status === 'agreed' ? 'Agree on these' : v.wait ? 'Agree and start' : 'Agree'}</button>`;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (v.status === 'writing') {
|
|
76
|
+
body.innerHTML = '<p class="hint">The agent is reading the code and writing its points. It changes nothing until you agree on them; they appear here and in the inbox.</p>';
|
|
77
|
+
actions.innerHTML = '<button type="button" class="small ghost" data-acc="skip">Skip</button><button type="button" class="small" data-acc="close">Close</button>';
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// Agreed: each point with what was found.
|
|
81
|
+
const c = v.counts;
|
|
82
|
+
const head = c.unchecked === c.total ? (v.scoring ? 'Being checked now…' : 'Not checked yet: the work is scored against these when the agent says it is done.') : `Checked ${ago(v.checkedAt)}${v.stale ? ' · the work or the points changed since' : ''}`;
|
|
83
|
+
body.innerHTML = `<p class="hint">Agreed ${ago(v.agreedAt)}. ${esc(head)}</p>
|
|
84
|
+
<ol class="acc-list">${v.results
|
|
85
|
+
.map((r) => `<li><span class="cl-chip acc-chip acc-${r.status}">${LABEL[r.status]}</span> ${esc(r.text)}${r.from === 'you' ? ' <span class="hint">(yours)</span>' : ''}${r.evidence ? `<div class="hint acc-evidence">${esc(r.evidence)}</div>` : ''}</li>`)
|
|
86
|
+
.join('')}</ol>
|
|
87
|
+
<p class="hint">Met, not met and not verified are another model's reading of the changes, with the evidence it gave. A point that is not met holds the work back from “Ready to approve”.</p>`;
|
|
88
|
+
actions.innerHTML = `<button type="button" class="small ghost" data-acc="edit">Change points</button>
|
|
89
|
+
<button type="button" class="small" data-acc="check" ${st.busy || v.scoring ? 'disabled' : ''} title="Score the work against these points now (a separate model call)">${st.busy || v.scoring ? 'Checking…' : c.unchecked === c.total || v.stale ? 'Check now' : 'Check again'}</button>
|
|
90
|
+
<button type="button" class="small primary" data-acc="close">Close</button>`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Keep what is typed: the list is drawn again on add and remove. */
|
|
94
|
+
function readEdits() {
|
|
95
|
+
if (!st?.edit) return;
|
|
96
|
+
for (const el of dialog.querySelectorAll('[data-acc-point]')) st.edit[Number(el.dataset.accPoint)] = el.value;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function load() {
|
|
100
|
+
const id = st.id;
|
|
101
|
+
try {
|
|
102
|
+
const view = await api('GET', `/agents/${id}/acceptance`);
|
|
103
|
+
if (st?.id !== id) return;
|
|
104
|
+
st.view = view;
|
|
105
|
+
st.error = null;
|
|
106
|
+
// Not agreed yet: straight to the points, to edit. (Typing in progress is kept.)
|
|
107
|
+
if (view.status !== 'agreed' && view.status !== 'writing' && !st.edit) st.edit = view.draft.slice();
|
|
108
|
+
if (view.status === 'none' && !st.edit) st.edit = [];
|
|
109
|
+
if (view.status === 'writing') st.edit = null;
|
|
110
|
+
} catch (e) {
|
|
111
|
+
if (st?.id !== id) return;
|
|
112
|
+
st.error = e.message;
|
|
113
|
+
}
|
|
114
|
+
render();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async function run(fn, ok) {
|
|
118
|
+
st.busy = true;
|
|
119
|
+
render();
|
|
120
|
+
try {
|
|
121
|
+
const a = await fn();
|
|
122
|
+
if (a?.id) upsert(a);
|
|
123
|
+
if (ok) toast(ok);
|
|
124
|
+
return true;
|
|
125
|
+
} catch (e) {
|
|
126
|
+
toast(`Error: ${e.message}`, 5000);
|
|
127
|
+
return false;
|
|
128
|
+
} finally {
|
|
129
|
+
if (st) st.busy = false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
dialog.addEventListener('click', async (e) => {
|
|
134
|
+
const rm = e.target.closest('[data-acc-remove]');
|
|
135
|
+
if (rm) {
|
|
136
|
+
readEdits();
|
|
137
|
+
st.edit.splice(Number(rm.dataset.accRemove), 1);
|
|
138
|
+
return render();
|
|
139
|
+
}
|
|
140
|
+
const act = e.target.closest('[data-acc]')?.dataset.acc;
|
|
141
|
+
if (!act || !st) return;
|
|
142
|
+
const id = st.id;
|
|
143
|
+
if (act === 'close') return dialog.close();
|
|
144
|
+
if (act === 'add') {
|
|
145
|
+
readEdits();
|
|
146
|
+
st.edit.push('');
|
|
147
|
+
render();
|
|
148
|
+
return dialog.querySelector(`[data-acc-point="${st.edit.length - 1}"]`)?.focus();
|
|
149
|
+
}
|
|
150
|
+
if (act === 'edit') {
|
|
151
|
+
st.edit = st.view.points.map((p) => p.text);
|
|
152
|
+
return render();
|
|
153
|
+
}
|
|
154
|
+
if (act === 'cancel') {
|
|
155
|
+
st.edit = null;
|
|
156
|
+
return render();
|
|
157
|
+
}
|
|
158
|
+
if (act === 'agree') {
|
|
159
|
+
readEdits();
|
|
160
|
+
const points = st.edit.map((t) => t.trim()).filter(Boolean);
|
|
161
|
+
if (!points.length) return toast('Add at least one point', 4000);
|
|
162
|
+
const waited = st.view.wait;
|
|
163
|
+
if (await run(() => api('POST', `/agents/${id}/acceptance/agree`, { points }), waited ? 'Agreed; the agent goes ahead' : 'Agreed; the work is checked against these')) {
|
|
164
|
+
if (st?.id !== id) return;
|
|
165
|
+
st.edit = null;
|
|
166
|
+
await load();
|
|
167
|
+
} else render();
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (act === 'skip') {
|
|
171
|
+
if (await run(() => api('POST', `/agents/${id}/acceptance/skip`), 'Not waiting; the agent goes ahead with its own criteria')) dialog.close();
|
|
172
|
+
else render();
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (act === 'check') {
|
|
176
|
+
await run(() => api('POST', `/agents/${id}/docs/scorecard`));
|
|
177
|
+
if (st?.id === id) await load();
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
dialog.addEventListener('close', () => (st = null));
|
|
181
|
+
|
|
182
|
+
return {
|
|
183
|
+
open(id) {
|
|
184
|
+
st = { id, view: null, edit: null, busy: false, error: null };
|
|
185
|
+
render();
|
|
186
|
+
if (!dialog.open) dialog.showModal();
|
|
187
|
+
return load();
|
|
188
|
+
},
|
|
189
|
+
/** The agent changed (new points from it, a new score): show it, unless the person is typing. */
|
|
190
|
+
agentChanged(a) {
|
|
191
|
+
if (st?.id === a.id && !editing() && !st.busy) load();
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
}
|
package/public/announce.js
CHANGED
|
@@ -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}`);
|